successfulSingleTransactionPlanResultFromTransaction

function successfulSingleTransactionPlanResultFromTransaction<
    TContext,
    TTransactionMessage,
>(
    plannedMessage,
    transaction,
    context?,
): SuccessfulSingleTransactionPlanResult<
    TContext & object,
    TTransactionMessage
>;

Creates a successful SingleTransactionPlanResult from a transaction message and transaction.

This function creates a single result with a 'successful' status, indicating that the transaction was successfully executed. It also includes the original transaction message, the executed transaction, and an optional context object.

Type Parameters

Type ParameterDefault typeDescription
TContext extends TransactionPlanResultContextTransactionPlanResultContextWithSignatureThe type of the context object
TTransactionMessage extends TransactionMessage & TransactionMessageWithFeePayer<string>TransactionMessage & TransactionMessageWithFeePayer<string>The type of the transaction message

Parameters

ParameterTypeDescription
plannedMessageTTransactionMessageThe original transaction message
transactionTransactionThe successfully executed transaction
context?TContextOptional context object to be included with the result. The result's context claims exactly what you pass, plus the signature and transaction derived from the transaction argument. Anything you do pass for those two keys is overwritten by the derived values

Returns

SuccessfulSingleTransactionPlanResult<TContext & object, TTransactionMessage>

Example

const result = successfulSingleTransactionPlanResultFromTransaction(
  transactionMessage,
  transaction
);
result satisfies SingleTransactionPlanResult;

See

SingleTransactionPlanResult

On this page