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.
Parameters
| Parameter | Type | Description |
|---|---|---|
result | TransactionPlanResult | 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.