sendTransactions

Sends transactions using the provided client and transaction parameters. This function builds user operations from the transactions, sends them, and waits for the transaction to be mined.

Import

1import { sendTransactions } from "@aa-sdk/core";

Usage

1import { createSmartAccountClient } from "@aa-sdk/core";
2
3// smart account client is already extended with sendTransactions
4const client = createSmartAccountClient(...);
5const result = await client.sendTransactions({
6requests: [{
7to: "0x...",
8data: "0x...", // or "0x",
9value: 0n, // optional
10}],
11account, // only required if the client above is not connected to an account
12});

Parameters

client_

Client<TTransport, TChain, TAccount> The client used to send the transactions

args

SendTransactionsParameters<TAccount, TContext> The parameters for sending the transactions, including requests, overrides, account, and context

Returns

Promise<Hex> A promise that resolves to the transaction hash of the sent transactions