createTransactionPlanExecutor
Creates a new transaction plan executor based on the provided configuration.
The executor will traverse the provided TransactionPlan sequentially or in parallel,
executing each transaction message using the executeTransactionMessage function.
- If that function is successful, the executor will return a successful
TransactionPlanResultfor that message including the transaction and any custom context. - If that function throws an error, the executor will stop processing and cancel all remaining transaction messages in the plan.
- If the
abortSignalis triggered, the executor will immediately stop processing the plan and return aTransactionPlanResultwith the status set tocanceled.
Parameters
| Parameter | Type | Description |
|---|---|---|
config | TransactionPlanExecutorConfig | Configuration object containing the transaction message executor function. |
Returns
A TransactionPlanExecutor function that can execute transaction plans.
Throws
SOLANA_ERROR__INSTRUCTION_PLANS__FAILED_TO_EXECUTE_TRANSACTION_PLAN
if any transaction in the plan fails to execute. The error context contains a
transactionPlanResult property with the partial results up to the point of failure.
Throws
SOLANA_ERROR__INSTRUCTION_PLANS__NON_DIVISIBLE_TRANSACTION_PLANS_NOT_SUPPORTED if the transaction plan contains non-divisible sequential plans, which are not supported by this executor.