useSendTransaction
Sends a single transaction to the network, as a reactive action.
Wraps client.sendTransaction with useAction, which handles signing, submission, and
confirmation. Each dispatch(input) runs with a fresh AbortSignal and tracks its lifecycle
through React state; calling dispatch again while a previous send is in flight aborts the first.
Accepts flexible input: instructions, an instruction plan, a single transaction message, or a
single transaction plan. Use useSendTransactions when the work may span multiple
transactions.
Parameters
| Parameter | Type | Description |
|---|---|---|
client | ClientWithTransactionSending | A client with a transaction-sending plugin installed. |
Returns
ActionResult<[
| InstructionPlanInput
| TransactionMessage & TransactionMessageWithFeePayer<string>
| Readonly<{
kind: "single";
message: TransactionMessage & TransactionMessageWithFeePayer<string>;
planType: "transactionPlan";
}>], SuccessfulSingleTransactionPlanResult>
An ActionResult whose dispatch/dispatchAsync take the input and resolve with
the SuccessfulSingleTransactionPlanResult.