Kit
Functions

isAdvanceNonceAccountInstruction

isAdvanceNonceAccountInstruction(instruction): instruction is AdvanceNonceAccountInstruction<string, string>

A type guard that returns true if the instruction conforms to the AdvanceNonceAccountInstruction type, and refines its type for use in your program.

Parameters

ParameterType
instructionInstruction

Returns

instruction is AdvanceNonceAccountInstruction<string, string>

Example

import { isAdvanceNonceAccountInstruction } from '@solana/transaction-messages';
 
if (isAdvanceNonceAccountInstruction(message.instructions[0])) {
    // At this point, the first instruction in the message has been refined to a
    // `AdvanceNonceAccountInstruction`.
    setNonceAccountAddress(message.instructions[0].accounts[0].address);
} else {
    setError('The first instruction is not an `AdvanceNonce` instruction');
}

On this page