Kit
Functions

getDefaultCommitmentRequestTransformer

getDefaultCommitmentRequestTransformer(config): RpcRequestTransformer

Creates a transformer that adds the provided default commitment to the configuration object of the request when applicable.

Parameters

ParameterTypeDescription
configReadonly<{ defaultCommitment?: Commitment; optionsObjectPositionByMethod: Record<string, number>; }>

Returns

RpcRequestTransformer

Example

import { getDefaultCommitmentRequestTransformer, OPTIONS_OBJECT_POSITION_BY_METHOD } from '@solana/rpc-transformers';
 
const requestTransformer = getDefaultCommitmentRequestTransformer({
    defaultCommitment: 'confirmed',
    optionsObjectPositionByMethod: OPTIONS_OBJECT_POSITION_BY_METHOD,
});

On this page