sendTransaction

Sends a transaction using the provided client, arguments, optional overrides, and context. This sends a UO and then waits for it to be mined

Import

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

Usage

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

Parameters

client_

Client<Transport, TChain, TAccount> The client to send the transaction through

args

SendTransactionParameters<TChain, TAccount, TChainOverride> The parameters required to send the transaction

overrides

UserOperationOverrides<TEntryPointVersion> Optional overrides for the user operation

context

UserOperationContext Optional context for the user operation

Returns

Promise<Hex> A promise that resolves to a hex string representing the transaction hash