{"_id":"@axvn-hoding/api-types","name":"@axvn-hoding/api-types","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@axvn-hoding/api-types","version":"0.1.0","description":"TypeScript types generated from Blockscout OpenAPI specs (public, private, and chain-specific)","license":"LicenseRef-Blockscout","type":"module","types":"./index.ts","exports":{".":{"types":"./index.ts"}},"scripts":{"generate:spec":"bash scripts/generate-spec.sh","generate:types":"bash scripts/generate-types.sh","build":"npm run generate:spec && npm run generate:types","typecheck":"tsc --noEmit"},"devDependencies":{"openapi-typescript":"^7.13.0","typescript":"^5.8.3"},"publishConfig":{"access":"public"},"_id":"@axvn-hoding/api-types@0.1.0","_integrity":"sha512-Yov5VPWNgNbNhOHklwfe4O24sT25f4G42ozwwAkTGPTAMPHRxxanQY2JFVYDFApOcIDn5PZH7zLLzPtHQOHBXw==","_resolved":"/tmp/axvn-npm-repacked/axvn-hoding-api-types-0.1.0.tgz","_from":"file:axvn-hoding-api-types-0.1.0.tgz","_nodeVersion":"22.23.2","_npmVersion":"10.9.8","dist":{"integrity":"sha512-Yov5VPWNgNbNhOHklwfe4O24sT25f4G42ozwwAkTGPTAMPHRxxanQY2JFVYDFApOcIDn5PZH7zLLzPtHQOHBXw==","shasum":"90459044703c6dd576cb357b25210c35aa932588","tarball":"https://registry.npmjs.org/@axvn-hoding/api-types/-/api-types-0.1.0.tgz","fileCount":24,"unpackedSize":6250259,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQChygRYWr7FIjocFzo1i1pIs39vXmBJZh5/PlFJzMsCZwIgSakduQvU3Jcv8bzEjpMyi4mECbODT59fW6McN22zVdA="}]},"_npmUser":{"name":"axvn-network","email":"namlangtu20162@gmail.com"},"directories":{},"maintainers":[{"name":"avnkr","email":"alisababivip@gmail.com"},{"name":"axvn-network","email":"namlangtu20162@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/api-types_0.1.0_1786742634582_0.6470235702932083"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-14T21:23:54.377Z","0.1.0":"2026-08-14T21:23:54.786Z","modified":"2026-08-14T21:23:55.069Z"},"maintainers":[{"name":"avnkr","email":"alisababivip@gmail.com"},{"name":"axvn-network","email":"namlangtu20162@gmail.com"}],"description":"TypeScript types generated from Blockscout OpenAPI specs (public, private, and chain-specific)","license":"LicenseRef-Blockscout","readme":"# @blockscout/api-types\n\nTypeScript types generated from Blockscout OpenAPI specs via [openapi-typescript](https://openapi-ts.dev):\n\n- **publicApi** — default public API (`BlockScoutWeb.Specs.Public`, no `CHAIN_TYPE`)\n- **privateApi** — account API (`BlockScoutWeb.Specs.Private`)\n- **chain namespaces** — chain-specific public API (`CHAIN_TYPE` set; matches [generate-swagger.yml](https://github.com/blockscout/blockscout/blob/master/.github/workflows/generate-swagger.yml), excluding deprecated MUD)\n\nBuild artifacts (`openapi/`, `dist/`) are gitignored; run `npm run build` after clone.\n\n## Prerequisites\n\n- **Elixir / Mix** at the Blockscout repo root (compiled `block_scout_web` app)\n- **Node.js** 18+ (for `openapi-typescript`)\n\n## Generate\n\nFrom this directory:\n\n```bash\nnpm install\nnpm run build\n```\n\n`build` runs:\n\n1. **`generate:spec`** — `mix openapi.spec.yaml` for public, private, and each chain type\n2. **`generate:types`** — `openapi-typescript` writes matching files under `dist/`\n\n## Usage\n\nTypes are grouped by spec name in the package entry:\n\n```ts\nimport type { publicApi, privateApi, arbitrum, optimismCelo } from \"@blockscout/api-types\";\n\ntype AddressResponse = publicApi.components[\"schemas\"][\"AddressResponse\"];\n\ntype GetAddressParams =\n  publicApi.paths[\"/v2/addresses/{address_hash_param}\"][\"get\"][\"parameters\"];\n\ntype ArbitrumPath = arbitrum.paths[keyof arbitrum.paths];\n```\n\n`publicApi` / `privateApi` avoid TypeScript reserved words (`public`, `private`). `optimism-celo` is exported as `optimismCelo` (hyphen is invalid in identifiers).\n\nPoint your app at this package via `file:../types-package` or your monorepo workspace.\n\n## Chain types\n\nSynced with `.github/workflows/generate-swagger.yml` via `scripts/chain-types.sh`:\n\n`arbitrum`, `arc`, `blackfort`, `ethereum`, `filecoin`, `neon`, `optimism`, `optimism-celo`, `rsk`, `scroll`, `shibarium`, `stability`, `suave`, `zetachain`, `zilliqa`, `zksync`\n\nWhen CI adds or removes a chain type, update `scripts/chain-types.sh` and `index.ts`.\n","readmeFilename":"README.md","_rev":"1-4a9fa94097f26362dc537ea5343bbb63"}