FailedSingleTransactionPlanResult

type FailedSingleTransactionPlanResult<TContext, TTransactionMessage> = object;

A SingleTransactionPlanResult with a 'failed' status.

This type represents a single transaction that failed during execution. It includes the original planned message, the Error that caused the failure, and a context object containing the fields from BaseTransactionPlanResultContext — namely optional TransactionMessage, Signature, and Transaction fields that may or may not be populated depending on how far execution progressed before the failure.

You may use the failedSingleTransactionPlanResult helper to create objects of this type.

Example

Creating a failed result from a transaction message and error.

const result = failedSingleTransactionPlanResult(
  transactionMessage,
  new Error('Transaction simulation failed'),
);
result satisfies FailedSingleTransactionPlanResult;
result.error; // The error that caused the failure.

See

Type Parameters

Type ParameterDefault typeDescription
TContext extends TransactionPlanResultContextTransactionPlanResultContextThe type of the context object that may be passed along with the result.
TTransactionMessage extends TransactionMessage & TransactionMessageWithFeePayerTransactionMessage & TransactionMessageWithFeePayerThe type of the transaction message.

Properties

context

context: Readonly<BaseTransactionPlanResultContext & TContext>;

error

error: Error;

kind

kind: "single";

plannedMessage

plannedMessage: TTransactionMessage;

planType

planType: "transactionPlanResult";

status

status: "failed";

On this page