createFailedToSignTransactionError
Creates a SolanaError with the SOLANA_ERROR__FAILED_TO_SIGN_TRANSACTION error code from a failed or canceled SingleTransactionPlanResult.
This is the signing counterpart to createFailedToSendTransactionError, designed
for user-facing failures raised by executors that sign a transaction without submitting
it. It behaves identically — unwrapping simulation errors to expose the underlying
transaction error as the cause, and extracting preflight data and logs into the error
context — because signing executors typically estimate resource limits by simulating
before they sign.
Unlike the sending variant, the message carries no indicator of where the failure
happened. That indicator locates a failure relative to network submission — (preflight)
before it, or the transaction signature after it — and signing never submits, so neither
applies. The logs and preflightData context properties are still populated whenever a
simulation was responsible, and those logs still appear in the message, so nothing is lost
beyond the prefix.
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
TContext extends TransactionPlanResultContext | TransactionPlanResultContext | The type of the context object attached to the result. Any context is accepted, since this helper never reads from it. |
Parameters
| Parameter | Type | Description |
|---|---|---|
result | | CanceledSingleTransactionPlanResult<TContext> | FailedSingleTransactionPlanResult<TContext> | A failed or canceled single transaction plan result. |
abortReason? | unknown | An optional abort reason if the transaction was canceled. |
Returns
SolanaError<13>
A SolanaError with the appropriate error code, context, and cause.
Example
Creating an error from a failed transaction plan result.