@solana/rpc-spec-types
TypeScript icon, indicating that this package has built-in type declarations

2.1.0 • Public • Published

npm npm-downloads
code-style-prettier

@solana/rpc-spec-types

This package contains core types that can be used on both RPC and RPC Subscriptions specifications. It can be used standalone, but it is also exported as part of Kit @solana/kit.

Types

RpcRequest

An object that describes the elements of an RPC or RPC Subscriptions request. It consists of the following properties:

  • methodName: The name of the RPC method or subscription requested.
  • params: The parameters to be passed to the RPC server.

RpcRequestTransformer

A function that accepts an RpcRequest and returns another RpcRequest. This allows the RpcApi to transform the request before it is sent to the RPC server.

RpcResponse

A type that represents the response from an RPC server. This could be any sort of data which is why RpcResponse defaults to unknown. You may use a type parameter to specify the shape of the response — e.g. RpcResponse<{ result: number }>.

RpcResponseTransformer

A function that accepts an RpcResponse and returns another RpcResponse. This allows the RpcApi to transform the response before it is returned to the caller.

Readme

Keywords

Package Sidebar

Install

npm i @solana/rpc-spec-types

Weekly Downloads

96,374

Version

2.1.0

License

MIT

Unpacked Size

110 kB

Total Files

29

Last publish

Collaborators

  • solana-devs
  • nickfrosty