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, a context object, and the Error that caused 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<TContext>;

error

error: Error;

kind

kind: "single";

plannedMessage

plannedMessage: TTransactionMessage;

status

status: "failed";

On this page