assertIsNonDivisibleSequentialTransactionPlan

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

Asserts that the given transaction plan is a non-divisible SequentialTransactionPlan.

A non-divisible sequential plan requires all its transaction messages to be executed atomically — usually in a transaction bundle.

Parameters

ParameterTypeDescription
planTransactionPlanThe transaction plan to assert.

Returns

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

Throws

Throws a SolanaError with code SOLANA_ERROR__INSTRUCTION_PLANS__UNEXPECTED_TRANSACTION_PLAN if the plan is not a non-divisible sequential transaction plan.

Example

const plan: TransactionPlan = nonDivisibleSequentialTransactionPlan([messageA, messageB]);
 
assertIsNonDivisibleSequentialTransactionPlan(plan);
// All transaction messages must be executed atomically.

See

On this page