ClientWithTransactionPlanning
Represents a client that can plan transactions from instruction inputs.
Transaction planning converts high-level instruction plans into concrete transaction messages, handling concerns like blockhash fetching, transaction splitting for size limits, and instruction ordering.
Example
Properties
planTransaction()
Plans a single transaction from the given instruction input.
Use this when you expect all instructions to fit in a single transaction.
Parameters
| Parameter | Type | Description |
|---|---|---|
input | InstructionPlanInput | The instruction plan input (instructions or instruction plans). |
config? | Config | Optional configuration including an abort signal. |
Returns
Promise<SingleTransactionPlan["message"]>
A promise resolving to the planned transaction message.
See
InstructionPlanInput
planTransactions()
Plans one or more transactions from the given instruction input.
Use this when instructions might need to be split across multiple transactions due to size limits.
Parameters
| Parameter | Type | Description |
|---|---|---|
input | InstructionPlanInput | The instruction plan input (instructions or instruction plans). |
config? | Config | Optional configuration including an abort signal. |
Returns
Promise<TransactionPlan>
A promise resolving to the full transaction plan.
See
InstructionPlanInput