ClientWithTransactionSending
Represents a client that can send transactions to the Solana network.
Transaction sending handles signing, submission, and confirmation of transactions. It supports flexible input formats including instructions, instruction plans, transaction messages or transaction plans.
Example
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
TContext extends TransactionPlanResultContext | TransactionPlanResultContextWithSignature | The context attached to the results. It defaults to TransactionPlanResultContextWithSignature, which guarantees a context.signature on every successful result. Supply a different context to change or drop that guarantee — for instance, a client whose executor records extra fields on the context. |
Properties
sendTransaction
Sends a single transaction to the network.
Accepts flexible input: instructions, instruction plans, a single transaction message or a single transaction plan.
Parameters
| Parameter | Type | Description |
|---|---|---|
input | | InstructionPlanInput | SingleTransactionPlan | SingleTransactionPlan["message"] | Instructions, a transaction plan, or a transaction message. |
config? | Config | Optional configuration including an abort signal. |
Returns
Promise<SuccessfulSingleTransactionPlanResult<TContext>>
A promise resolving to the successful transaction result.
See
- InstructionPlanInput
- SingleTransactionPlan
sendTransactions
Sends one or more transactions to the network.
Accepts flexible input: instructions, instruction plans, transaction messages or transaction plans.
Parameters
| Parameter | Type | Description |
|---|---|---|
input | InstructionPlanInput | TransactionPlanInput | Any instruction or a transaction plan input. |
config? | Config | Optional configuration including an abort signal. |
Returns
Promise<TransactionPlanResult<TContext>>
A promise resolving to the results for all transactions.
See
- InstructionPlanInput
- TransactionPlanInput