assertIsNonDivisibleSequentialInstructionPlan

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

Asserts that the given instruction plan is a non-divisible SequentialInstructionPlan.

A non-divisible sequential plan requires all its instructions to be executed atomically — either in a single transaction or in a transaction bundle.

Parameters

ParameterTypeDescription
planInstructionPlanThe instruction plan to assert.

Returns

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

Throws

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

Example

const plan: InstructionPlan = nonDivisibleSequentialInstructionPlan([instructionA, instructionB]);
 
assertIsNonDivisibleSequentialInstructionPlan(plan);
// All instructions must be executed atomically.

See

On this page