Kit
Type aliases

RpcDevnet

RpcDevnet<TRpcMethods> = Rpc<TRpcMethods> & object

A Rpc that supports the RPC methods available on the devnet cluster.

This is useful in cases where you need to make assertions about the suitability of a RPC for a given purpose. For example, you might like to make it a type error to combine certain types with RPCs belonging to certain clusters, at compile time.

Type declaration

NameType
~cluster"devnet"

Type Parameters

Type Parameter
TRpcMethods

Example

async function getSpecialAccountInfo(
    address: Address<'ReAL1111111111111111111111111111'>,
    rpc: RpcMainnet<unknown>,
): Promise<SpecialAccountInfo>;
async function getSpecialAccountInfo(
    address: Address<'TeST1111111111111111111111111111'>,
    rpc: RpcDevnet<unknown> | RpcTestnet<unknown>,
): Promise<SpecialAccountInfo>;
async function getSpecialAccountInfo(address: Address, rpc: Rpc<unknown>): Promise<SpecialAccountInfo> {
    /* ... */
}
const rpc = createSolanaRpc(devnet('https://api.devnet.solana.com'));
await getSpecialAccountInfo(address('ReAL1111111111111111111111111111'), rpc); // ERROR

On this page