{"_id":"@axvn-vn/rpc-subscriptions-api","_rev":"3-d3b8ee300a69db5c7bc7efe471f59e3b","name":"@axvn-vn/rpc-subscriptions-api","dist-tags":{"latest":"0.0.0"},"versions":{"0.0.0":{"name":"@axvn-vn/rpc-subscriptions-api","version":"0.0.0","keywords":["blockchain","solana","web3"],"author":{"name":"Solana Labs Maintainers","email":"maintainers@solanalabs.com"},"license":"MIT","_id":"@axvn-vn/rpc-subscriptions-api@0.0.0","maintainers":[{"name":"davidtran76","email":"Farm15ceo@gmail.com"}],"homepage":"https://www.solanakit.com/api#solanarpc-subscriptions-api","bugs":{"url":"https://github.com/anza-xyz/kit/issues"},"dist":{"shasum":"7a1ad8c0e96e57f1c98861bb6585d7da4f7d2a44","tarball":"https://registry.npmjs.org/@axvn-vn/rpc-subscriptions-api/-/rpc-subscriptions-api-0.0.0.tgz","fileCount":43,"integrity":"sha512-jVVMCUhfuEuYhaDHdDzoNNXWEdO2VAt1BVV+HhplF22zJbRgoNznxLykYzODbtm3OCHGb/oFirwLBVVdgrYjHQ==","signatures":[{"sig":"MEUCIHiOrS1EyVg/CcehEjcp5Y6NuuiqPHjSpSzaDqtwYYzKAiEA/cXpvNHl5Ry7Yhd4eXDOvjhgtowaK4/42yj3fcYDdZU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":204662},"main":"./dist/index.node.cjs","type":"commonjs","types":"./dist/types/index.d.ts","module":"./dist/index.node.mjs","browser":{"./dist/index.node.cjs":"./dist/index.browser.cjs","./dist/index.node.mjs":"./dist/index.browser.mjs"},"engines":{"node":">=20.18.0"},"exports":{"node":{"import":"./dist/index.node.mjs","require":"./dist/index.node.cjs"},"types":"./dist/types/index.d.ts","browser":{"import":"./dist/index.browser.mjs","require":"./dist/index.browser.cjs"},"workerd":{"import":"./dist/index.node.mjs","require":"./dist/index.node.cjs"},"edge-light":{"import":"./dist/index.node.mjs","require":"./dist/index.node.cjs"},"react-native":"./dist/index.native.mjs"},"scripts":{"dev":"NODE_OPTIONS=\"--no-experimental-webstorage\" jest -c ../../node_modules/@solana/test-config/jest-dev.config.js --globalSetup @solana/test-config/test-validator-setup.js --globalTeardown @solana/test-config/test-validator-teardown.js --rootDir . --watch","style:fix":"pnpm eslint --fix src && pnpm prettier --log-level warn --ignore-unknown --write ./*","test:lint":"TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@solana/test-config/jest-lint.config.js --rootDir . --silent","compile:js":"tsup --config build-scripts/tsup.config.package.ts","compile:docs":"typedoc","publish-impl":"npm view $npm_package_name@$npm_package_version > /dev/null 2>&1 || (pnpm publish --tag ${PUBLISH_TAG:-canary} --access public --no-git-checks && (([ -n \"${GITHUB_OUTPUT:-}\" ] && echo 'published=true' >> \"$GITHUB_OUTPUT\") || true) && (([ \"$PUBLISH_TAG\" != \"canary\" ] && ../build-scripts/maybe-tag-latest.ts --token \"$GITHUB_TOKEN\" $npm_package_name@$npm_package_version) || true))","test:prettier":"TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@solana/test-config/jest-prettier.config.js --rootDir . --silent","test:typecheck":"tsc --noEmit","test:unit:node":"NODE_OPTIONS=\"--no-experimental-webstorage\" TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@solana/test-config/jest-unit.config.node.js --globalSetup @solana/test-config/test-validator-setup.js --globalTeardown @solana/test-config/test-validator-teardown.js --rootDir . --silent","compile:typedefs":"tsc -p ./tsconfig.declarations.json","publish-packages":"pnpm prepublishOnly && pnpm publish-impl","test:unit:browser":"NODE_OPTIONS=\"--no-experimental-webstorage\" TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@solana/test-config/jest-unit.config.browser.js --globalSetup @solana/test-config/test-validator-setup.js --globalTeardown @solana/test-config/test-validator-teardown.js --rootDir . --silent","test:treeshakability:node":"agadoo dist/index.node.mjs","test:treeshakability:native":"agadoo dist/index.native.mjs","test:treeshakability:browser":"agadoo dist/index.browser.mjs"},"_npmUser":{"name":"davidtran76","email":"Farm15ceo@gmail.com"},"repository":{"url":"git+https://github.com/anza-xyz/kit.git","type":"git"},"_npmVersion":"11.17.0","description":"Defines all default Solana RPC subscriptions as types","directories":{},"sideEffects":false,"_nodeVersion":"24.19.0","browserslist":["supports bigint and not dead","maintained node versions"],"dependencies":{"@axvn-vn/keys":"8.0.0","@axvn-vn/addresses":"8.0.0","@axvn-vn/rpc-types":"8.0.0","@axvn-vn/transactions":"8.0.0","@axvn-vn/rpc-transformers":"8.0.0","@axvn-vn/transaction-messages":"8.0.0","@axvn-vn/rpc-subscriptions-spec":"8.0.0"},"react-native":"./dist/index.native.mjs","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"peerDependencies":{"typescript":">=5.4.0"},"peerDependenciesMeta":{"typescript":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/rpc-subscriptions-api_0.0.0_1787355450575_0.5638607673008802","host":"s3://npm-registry-packages-npm-production"},"deprecated":"DEPRECATED: This package has been removed. Do not use."}},"time":{"created":"2026-08-21T23:37:30.364Z","modified":"2026-08-22T16:11:18.055Z","0.0.0":"2026-08-21T23:37:30.737Z"},"bugs":{"url":"https://github.com/anza-xyz/kit/issues"},"author":{"name":"Solana Labs Maintainers","email":"maintainers@solanalabs.com"},"license":"MIT","homepage":"https://www.solanakit.com/api#solanarpc-subscriptions-api","keywords":["blockchain","solana","web3"],"repository":{"url":"git+https://github.com/anza-xyz/kit.git","type":"git"},"description":"Defines all default Solana RPC subscriptions as types","maintainers":[{"name":"davidtran76","email":"Farm15ceo@gmail.com"},{"name":"nhamhuan","email":"Nhamhuan@gmail.com"}],"readme":"[![npm][npm-image]][npm-url]\n[![npm-downloads][npm-downloads-image]][npm-url]\n<br />\n[![code-style-prettier][code-style-prettier-image]][code-style-prettier-url]\n\n[code-style-prettier-image]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square\n[code-style-prettier-url]: https://github.com/prettier/prettier\n[npm-downloads-image]: https://img.shields.io/npm/dm/@solana/rpc-subscriptions-api?style=flat\n[npm-image]: https://img.shields.io/npm/v/@solana/rpc-subscriptions-api?style=flat\n[npm-url]: https://www.npmjs.com/package/@solana/rpc-subscriptions-api\n\n# @solana/rpc-subscriptions-api\n\nThis package contains types that describe the [methods](https://solana.com/docs/rpc/websocket) of the Solana JSON RPC Subscriptions API, and utilities for creating a `RpcSubscriptionsApi` implementation with sensible defaults. It can be used standalone, but it is also exported as part of Kit [`@solana/kit`](https://github.com/anza-xyz/kit/tree/main/packages/kit).\n\nEach RPC subscriptions method is described in terms of a TypeScript type of the following form:\n\n```ts\ntype ExampleApi = {\n    thingNotifications(address: Address): Thing;\n};\n```\n\nA `RpcSubscriptionsApi` that implements `ExampleApi` will ultimately expose its defined methods on any `RpcSubscriptions` that uses it.\n\n```ts\nconst rpcSubscriptions: RpcSubscriptions<ExampleApi> = createExampleRpcSubscriptions(/* ... */);\nconst thingNotifications = await rpc\n    .thingNotifications(address('95DpK3y3GF7U8s1k4EvZ7xqyeCkhsHeZaE97iZpHUGMN'))\n    .subscribe({ abortSignal: AbortSignal.timeout(5_000) });\ntry {\n    for await (const thing of thingNotifications) {\n        console.log('Got a thing', thing);\n    }\n} catch (e) {\n    console.error('Our subscription to `Thing` notifications has failed', e);\n} finally {\n    console.log('We are done listening for `Thing` notifications');\n}\n```\n\n## Types\n\n### `SolanaRpcSubscriptionsApi{Devnet|Testnet|Mainnet}`\n\nThese types represent the RPC subscription methods available on a specific Solana cluster.\n\n## Functions\n\n### `createSolanaRpcSubscriptionsApi(config)`\n\nCreates a `RpcSubscriptionsApi` implementation of the Solana JSON RPC Subscriptions API with some default behaviours.\n\nThe default behaviours include:\n\n- A transform that converts `bigint` inputs to `number` for compatibility with version 1.0 of the Solana JSON RPC.\n- A transform that calls the config's `onIntegerOverflow` handler whenever a `bigint` input would overflow a JavaScript IEEE 754 number. See [this](https://github.com/solana-labs/solana-web3.js/issues/1116) GitHub issue for more information.\n- A transform that applies a default commitment wherever not specified\n\n#### Arguments\n\nA config object with the following properties:\n\n- `defaultCommitment`: An optional default `Commitment` value. Given an RPC method that takes `commitment` as a parameter, this value will be used when the caller does not supply one.\n- `onIntegerOverflow(request, keyPath, value): void`: An optional function that will be called whenever a `bigint` input exceeds that which can be expressed using JavaScript numbers. This is used in the default `SolanaRpcSubscriptionsApi` to throw an exception rather than to allow truncated values to propagate through a program.\n","readmeFilename":"README.md"}