Kit
Functions

createSolanaRpcApi

createSolanaRpcApi<TRpcMethods>(config?): RpcApi<TRpcMethods>

Creates a RpcApi implementation of the Solana JSON RPC API with some default behaviours.

The default behaviours include:

  • A transform that converts bigint inputs to number for compatibility with version 1.0 of the Solana JSON RPC.
  • A transform that calls the config's Config.onIntegerOverflow | onIntegerOverflow handler whenever a bigint input would overflow a JavaScript IEEE 754 number. See this GitHub issue for more information.
  • A transform that applies a default commitment wherever not specified

Type Parameters

Type ParameterDefault type
TRpcMethods extends SolanaRpcApiForAllClusters | SolanaRpcApiForTestClustersSolanaRpcApiForTestClusters

Parameters

ParameterType
config?Readonly<{ defaultCommitment?: Commitment; onIntegerOverflow?: IntegerOverflowHandler; }>

Returns

RpcApi<TRpcMethods>

On this page