assertIsSequentialInstructionPlan

function assertIsSequentialInstructionPlan(
    plan,
): asserts plan is Readonly<{
    divisible: boolean;
    kind: 'sequential';
    plans: InstructionPlan[];
    planType: 'instructionPlan';
}>;

Asserts that the given instruction plan is a SequentialInstructionPlan.

Parameters

ParameterTypeDescription
planInstructionPlanThe instruction plan to assert.

Returns

asserts plan is Readonly<{ divisible: boolean; kind: "sequential"; plans: InstructionPlan[]; planType: "instructionPlan" }>

Throws

Throws a SolanaError with code SOLANA_ERROR__INSTRUCTION_PLANS__UNEXPECTED_INSTRUCTION_PLAN if the plan is not a sequential instruction plan.

Example

const plan: InstructionPlan = sequentialInstructionPlan([instructionA, instructionB]);
 
assertIsSequentialInstructionPlan(plan);
console.log(plan.divisible); // TypeScript knows this is a SequentialInstructionPlan.

See

On this page