isParallelTransactionPlanResult

function isParallelTransactionPlanResult(
    plan,
): plan is Readonly<{
    kind: 'parallel';
    plans: TransactionPlanResult<
        TransactionPlanResultContext,
        Readonly<{
            kind: 'single';
            message: TransactionMessage &
                TransactionMessageWithFeePayer<string>;
            status: TransactionPlanResultStatus<TransactionPlanResultContext>;
        }>
    >[];
}>;

Checks if the given transaction plan result is a ParallelTransactionPlanResult.

Parameters

ParameterTypeDescription
planTransactionPlanResultThe transaction plan result to check.

Returns

plan is Readonly<{ kind: "parallel"; plans: TransactionPlanResult<TransactionPlanResultContext, Readonly<{ kind: "single"; message: TransactionMessage & TransactionMessageWithFeePayer<string>; status: TransactionPlanResultStatus<TransactionPlanResultContext> }>>[] }>

true if the result is a parallel transaction plan result, false otherwise.

Example

const result: TransactionPlanResult = parallelTransactionPlanResult([resultA, resultB]);
 
if (isParallelTransactionPlanResult(result)) {
  console.log(result.plans.length); // TypeScript knows this is a ParallelTransactionPlanResult.
}

See

On this page