isSingleTransactionPlanResult

function isSingleTransactionPlanResult(
    plan,
): plan is Readonly<{
    kind: 'single';
    message: TransactionMessage &
        TransactionMessageWithFeePayer<string>;
    status: TransactionPlanResultStatus<TransactionPlanResultContext>;
}>;

Checks if the given transaction plan result is a SingleTransactionPlanResult.

Parameters

ParameterTypeDescription
planTransactionPlanResultThe transaction plan result to check.

Returns

plan is Readonly<{ kind: "single"; message: TransactionMessage & TransactionMessageWithFeePayer<string>; status: TransactionPlanResultStatus<TransactionPlanResultContext> }>

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

Example

const result: TransactionPlanResult = successfulSingleTransactionPlanResult(message, transaction);
 
if (isSingleTransactionPlanResult(result)) {
  console.log(result.status.kind); // TypeScript knows this is a SingleTransactionPlanResult.
}

See

On this page