assertIsFailedSingleTransactionPlanResult

function assertIsFailedSingleTransactionPlanResult(
    plan,
): asserts plan is FailedSingleTransactionPlanResult;

Asserts that the given transaction plan result is a failed SingleTransactionPlanResult.

Parameters

ParameterTypeDescription
planTransactionPlanResultThe transaction plan result to assert.

Returns

asserts plan is FailedSingleTransactionPlanResult

Throws

Throws a SolanaError with code SOLANA_ERROR__INSTRUCTION_PLANS__UNEXPECTED_TRANSACTION_PLAN_RESULT if the result is not a failed single transaction plan result.

Example

const result: TransactionPlanResult = failedSingleTransactionPlanResult(message, error);
 
assertIsFailedSingleTransactionPlanResult(result);
console.log(result.status.error); // TypeScript knows this is a failed result.

See

On this page