createFailedToSendTransactionsError
Creates a SolanaError with the SOLANA_ERROR__FAILED_TO_SEND_TRANSACTIONS error code from a TransactionPlanResult.
This is a high-level error designed for user-facing transaction send failures
involving multiple transactions. It walks the result tree, unwraps simulation
errors from each failure, and builds a failedTransactions array pairing each
failure with its unwrapped error, logs, and preflight data.
The error message lists each failure with its position in the plan and an indicator showing whether it was a preflight error or includes the transaction signature. When all transactions were canceled, the message is a single line.
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
TContext extends TransactionPlanResultContext | TransactionPlanResultContextWithSignature | The type of the context object attached to the results. Any context is accepted; each signature is read from it only if one happens to be there. |
Parameters
| Parameter | Type | Description |
|---|---|---|
result | TransactionPlanResult<TContext> | The full transaction plan result tree. |
abortReason? | unknown | An optional abort reason if the plan was aborted. |
Returns
SolanaError<12>
A SolanaError with the appropriate error code, context, and cause.
Example
Creating an error from a failed transaction plan result.