ResolvedInstruction

type ResolvedInstruction<TProgramAddress> = Instruction<TProgramAddress, readonly AccountMeta[]>;

An outer transaction instruction with its account indices resolved to full AccountMetas and its data exposed as a ReadonlyUint8Array.

Following the kit Instruction conventions, accounts and data are present only when non-empty, so isInstructionWithAccounts and isInstructionWithData from @solana/instructions behave as expected and can be used to narrow before passing the instruction to the auto-generated parseXInstruction helpers.

Type Parameters

Type ParameterDefault type
TProgramAddress extends stringstring

Example

for (const ix of getInstructionsFromCompiledTransactionMessage(compiled)) {
    // `ix` is a `ResolvedInstruction` — usable with `isInstructionForProgram`
    // directly, and with the auto-generated `identifyXInstruction` helpers
    // after narrowing `data`.
    if (isInstructionWithData(ix)) {
        identifyTokenInstruction(ix);
    }
}

On this page