getSignersFromInstructionPlan

function getSignersFromInstructionPlan<TSigner>(
    instructionPlan,
): readonly TSigner[];

Extracts and deduplicates all TransactionSigners stored inside the account metas of the instructions of an InstructionPlan.

Any extracted signers that share the same Address will be de-duplicated.

Note that message packer plans are skipped, since their instructions are only created when packed into a transaction message. To access their signers, use getSignersFromTransactionMessage on the planned transaction messages instead.

Type Parameters

Type ParameterDefault typeDescription
TSigner extends TransactionSignerTransactionSignerOptionally provide a narrower type for TransactionSigners.

Parameters

ParameterType
instructionPlanInstructionPlan

Returns

readonly TSigner[]

Example

import { parallelInstructionPlan, sequentialInstructionPlan } from '@solana/instruction-plans';
import { getSignersFromInstructionPlan } from '@solana/signers';
 
const plan = sequentialInstructionPlan([
    instructionSignedByA,
    parallelInstructionPlan([instructionSignedByB, instructionSignedByAAndB]),
]);
 
const instructionPlanSigners = getSignersFromInstructionPlan(plan);
// ^ [signerA, signerB]

On this page