UnwrapRpcResponse

type UnwrapRpcResponse<T> = T extends SolanaRpcResponse<infer U> ? U : T;

Unwraps SolanaRpcResponse<U>U at the type level so callers can surface the inner value without losing static type information. Values that are not wrapped in a SolanaRpcResponse envelope pass through unchanged.

Pairs with splitSolanaRpcResponse for runtime detection.

Type Parameters

Type ParameterDescription
TThe raw notification shape.

Example

type AccountValue = UnwrapRpcResponse<SolanaRpcResponse<{ lamports: bigint }>>;
//   ^? { lamports: bigint }
 
type AccountValue = UnwrapRpcResponse<{ lamports: bigint }>;
//   ^? { lamports: bigint }

On this page