{"bugs":{"url":"http://github.com/solana-labs/solana-web3.js/issues"},"dist":{"shasum":"5edbe2ae9c29b4e17fe6ebbdbb4c107b5290a23c","tarball":"https://registry.npmjs.org/@solana/rpc-transport/-/rpc-transport-2.0.0-experimental.04c19fd.tgz","fileCount":27,"integrity":"sha512-BfU+aM4u6mivbKXkYoRRTbeytjUwPB9Mf0f82RkLNh8mz2BtvG0FNOq2AfVpM8C4wTscidT284/6IqcfbW9Wlg==","signatures":[{"sig":"MEUCIQDau1p6Rp2jDRGm8sHGhoaMKjwMvcZO7sXeMaQF9CQ7oQIgJucVHpBt4ozS1YWQx1mLdI2IT2wDkRfYtNpzcuFKuSE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":310735},"main":"./dist/index.node.cjs","name":"@solana/rpc-transport","type":"module","_from":"file:solana-rpc-transport-2.0.0-experimental.04c19fd.tgz","types":"./dist/types/index.d.ts","author":{"name":"Solana Labs Maintainers","email":"maintainers@solanalabs.com"},"module":"./dist/index.node.js","readme":"[![npm][npm-image]][npm-url]\n[![npm-downloads][npm-downloads-image]][npm-url]\n[![semantic-release][semantic-release-image]][semantic-release-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-transport/experimental.svg?style=flat\n[npm-image]: https://img.shields.io/npm/v/@solana/rpc-transport/experimental.svg?style=flat\n[npm-url]: https://www.npmjs.com/package/@solana/rpc-transport/v/experimental\n[semantic-release-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg\n[semantic-release-url]: https://github.com/semantic-release/semantic-release\n\n# @solana/rpc-transport\n\nThis package implements a JSON-RPC client with which you can interact with the Solana network. It can be used standalone, in combination with an RPC specification such as [`@solana/rpc-core`](https://github.com/solana-labs/solana-web3.js/tree/master/packages/rpc-core), but it is also exported as part of the Solana JavaScript SDK [`@solana/web3.js@experimental`](https://github.com/solana-labs/solana-web3.js/tree/master/packages/library).\n\n## Configuration\n\nA new transport created with `createJsonRpc()` can be configured as follows:\n\n### `api` (required)\n\nAn object that conforms to `IRpcApi<TMethods>`, where `TMethods` is an interface that specifies the type of every RPC function.\n\n```ts\ninterface ExampleApi {\n    getBlocks(startSlot: number, endSlot: number): ReadonlyArray<number>;\n}\n```\n\n#### With no concrete implementation\n\nCrucially, this object does not _need_ to provide _implementations_ of those methods. This allows an infinite number of JSON-RPC methods to be added to the API without affecting the size of the client bundle.\n\nAbsent a concrete implementation, `@solana/rpc-transport` will simply send the function name and its arguments to the RPC as the JSON-RPC method and params. For example, if no concrete implementation for `getBlocks` is provided in `api`, the following call:\n\n```ts\nrpc.getBlocks(1, 20).send();\n```\n\n&hellip;will result in an RPC call whose `method` is `getBlocks` and whose `params` are `[1, 20]`.\n\n#### With an optional concrete implementation\n\nIf you would like to modify the inputs to a given method call before they are sent, or would like to post-process the response from the JSON-RPC server, you may supply a concrete implementation for one or more methods of `api`.\n\n```ts\nconst api = {\n    getBlocks(startSlot: number, endSlot: number): ReadonlyArray<number> {\n        return {\n            // Optionally pre-process the method name,\n            methodName: 'getBlocksInRange',\n            // Pre-process the inputs any way you like.\n            params: [assertIsInteger(startSlot), assertIsInteger(endSlot)],\n            // Provide an optional function to modify the response.\n            responseProcessor: response => ({\n                confirmedBlocks: response,\n                queryRange: [startSlot, endSlot],\n            }),\n        };\n    },\n};\n```\n\n### `transport` (required)\n\nA function that implements a wire transport.\n\n```ts\ntype RpcTransportConfig = Readonly<{\n    payload: unknown;\n    signal?: AbortSignal;\n}>;\n\nexport interface IRpcTransport {\n    <TResponse>(config: RpcTransportConfig): Promise<TResponse>;\n}\n```\n\nAn HTTP wire transport is supplied with this package, but you can supply any wire transport that conforms to `IRpcTransport`.\n","browser":{"./dist/index.node.js":"./dist/index.browser.js","./dist/index.node.cjs":"./dist/index.browser.cjs"},"exports":{"node":{"import":"./dist/index.node.js","require":"./dist/index.node.cjs"},"types":"./dist/types/index.d.ts","browser":{"import":"./dist/index.browser.js","require":"./dist/index.browser.cjs"},"react-native":"./dist/index.native.js"},"license":"MIT","scripts":{"dev":"jest -c node_modules/test-config/jest-dev.config.ts --rootDir . --watch","style:fix":"pnpm eslint --fix src/* && pnpm prettier -w src/*","test:lint":"jest -c node_modules/test-config/jest-lint.config.ts --rootDir . --silent","compile:js":"tsup --config build-scripts/tsup.config.package.ts","test:prettier":"jest -c node_modules/test-config/jest-prettier.config.ts --rootDir . --silent","test:typecheck":"tsc --noEmit","test:unit:node":"jest -c node_modules/test-config/jest-unit.config.node.ts --rootDir . --silent","compile:typedefs":"tsc -p ./tsconfig.declarations.json","publish-packages":"pnpm publish --tag experimental --access public --no-git-checks","test:unit:browser":"jest -c node_modules/test-config/jest-unit.config.browser.ts --rootDir . --silent","test:treeshakability:node":"agadoo dist/index.node.js","test:treeshakability:native":"agadoo dist/index.native.js","test:treeshakability:browser":"agadoo dist/index.browser.js"},"_npmUser":{"name":"buffalojoec","email":"joe.caulfield@solana.com"},"homepage":"https://github.com/solana-labs/solana-web3.js#readme","keywords":["blockchain","solana","web3"],"_resolved":"/tmp/496285dc0f8c7cbfa27cc78ea81e595e/solana-rpc-transport-2.0.0-experimental.04c19fd.tgz","_integrity":"sha512-BfU+aM4u6mivbKXkYoRRTbeytjUwPB9Mf0f82RkLNh8mz2BtvG0FNOq2AfVpM8C4wTscidT284/6IqcfbW9Wlg==","repository":{"url":"git+https://github.com/solana-labs/solana-web3.js.git","type":"git"},"_npmVersion":"9.8.1","bundlewatch":{"files":[{"path":"./dist/index*.js"}],"defaultCompression":"gzip"},"description":"Network transports for accessing the Solana JSON RPC API","directories":{},"maintainers":[{"name":"2501babe","email":"hana@solana.com"},{"name":"lorisleiva","email":"loris.leiva@gmail.com"},{"name":"buffalojoec","email":"joe.caulfield@solana.com"},{"name":"ngundotra","email":"noah@gundotra.org"},{"name":"_chido","email":"yihau.chen@solana.com"},{"name":"steveluscher","email":"me+npm@steveluscher.com"},{"name":"sebastianbor","email":"sebastian_bor@hotmail.com"},{"name":"seanyoung","email":"sean@mess.org"},{"name":"mvines","email":"mvines@gmail.com"},{"name":"tyera","email":"tyera@solana.com"},{"name":"joncinque","email":"me@jonc.dev"},{"name":"ryoqun","email":"ryoqun@gmail.com"},{"name":"trent-solana","email":"trent@solana.com"},{"name":"jordansexton","email":"jordan@jordansexton.com"}],"sideEffects":false,"_nodeVersion":"18.18.0","browserslist":["supports bigint and not dead","maintained node versions"],"react-native":"./dist/index.native.js","_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^29.7.0","tsup":"7.2.0","agadoo":"^3.0.0","eslint":"^8.45.0","ws-impl":"0.0.0","prettier":"^2.8","tsconfig":"0.0.0","@swc/jest":"^0.2.28","fetch-impl":"0.0.0","typescript":"^5.2.2","@types/jest":"^29.5.5","@types/node":"^20","test-config":"0.0.0","build-scripts":"0.0.0","version-from-git":"^1.1.1","eslint-plugin-jest":"^27.2.3","jest-runner-eslint":"^2.1.0","jest-websocket-mock":"^2.4.1","jest-fetch-mock-fork":"^3.0.4","jest-runner-prettier":"^1.0.0","fast-stable-stringify":"^1.0.0","jest-environment-jsdom":"^29.6.4","@typescript-eslint/parser":"^6.3.0","eslint-plugin-sort-keys-fix":"^1.1.2","@solana/eslint-config-solana":"^1.0.2","@typescript-eslint/eslint-plugin":"^6.7.0"},"peerDependencies":{"ws":"^8.14.0","node-fetch":"^2.6.7"},"_npmOperationalInternal":{"tmp":"tmp/rpc-transport_2.0.0-experimental.04c19fd_1696944562243_0.8971538338400586","host":"s3://npm-registry-packages"},"_id":"@solana/rpc-transport@2.0.0-experimental.04c19fd","version":"2.0.0-experimental.04c19fd"}