Kit
Type aliases

RpcSubscriptionsDevnet

RpcSubscriptionsDevnet<TRpcMethods> = RpcSubscriptions<TRpcMethods> & object

A RpcSubscriptions that supports the RPC Subscriptions 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 subscribeToSpecialAccountNotifications(
    address: Address<'ReAL1111111111111111111111111111'>,
    rpcSubscriptions: RpcSubscriptionsMainnet<unknown>,
    abortSignal: AbortSignal,
): Promise<AsyncIterable<SpecialAccountInfo>>;
async function subscribeToSpecialAccountNotifications(
    address: Address<'TeST1111111111111111111111111111'>,
    rpcSubscriptions: RpcSubscriptionsDevnet<unknown> | RpcTestnet<unknown>,
    abortSignal: AbortSignal,
): Promise<AsyncIterable<SpecialAccountInfo>>;
async function subscribeToSpecialAccountNotifications(
    address: Address,
    rpcSubscriptions: RpcSubscriptions<unknown>,
    abortSignal: AbortSignal,
): Promise<AsyncIterable<SpecialAccountInfo>> {
    /* ... */
}
const rpcSubscriptions = createSolanaRpcSubscriptions(devnet('https://api.devnet.solana.com'));
await subscribeToSpecialAccountNotifications(address('ReAL1111111111111111111111111111'), rpcSubscriptions); // ERROR

On this page