usePlanTransaction
Plans a single transaction from an instruction input, as a reactive action.
Wraps client.planTransaction with useAction: each dispatch(input) runs the plan with a
fresh AbortSignal and tracks its lifecycle through React state. Calling dispatch again while a
previous plan is in flight aborts the first. Use this when you expect all instructions to fit in a
single transaction; reach for usePlanTransactions when they might need splitting.
Parameters
| Parameter | Type | Description |
|---|---|---|
client | ClientWithTransactionPlanning | A client with a transaction-planning plugin installed. |
Returns
ActionResult<[InstructionPlanInput], TransactionMessage & TransactionMessageWithFeePayer<string>>
An ActionResult whose dispatch/dispatchAsync take the
InstructionPlanInput and resolve with the planned transaction message.