Skip to content
Alchemy Logo

sendTransaction

function sendTransaction<
  TChain,
  TAccount,
  TChainOverride,
  TContext,
  TEntryPointVersion,
>(client_, args, overrides?, context?): Promise<`0x${string}`>;

Defined in: aa-sdk/core/src/actions/smartAccount/sendTransaction.ts:48

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 { createSmartAccountClient } from "@aa-sdk/core";
 
// smart account client is already extended with sendTransaction
const client = createSmartAccountClient(...);
const result = await client.sendTransaction({
 to: "0x...",
 data: "0x...", // or "0x",
 value: 0n, // optional
 account, // only required if the client above is not connected to an account
});

Type ParameterDefault type

TChain extends undefined | Chain

undefined | Chain

TAccount extends | undefined | SmartContractAccount

| undefined | SmartContractAccount

TChainOverride extends undefined | Chain

undefined | Chain

TContext extends | undefined | UserOperationContext

| undefined | UserOperationContext

TEntryPointVersion extends keyof EntryPointRegistryBase<unknown>

GetEntryPointFromAccount<TAccount>

ParameterTypeDescription

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?

TContext

Optional context for the user operation

Promise<`0x${string}`>

A promise that resolves to a hex string representing the transaction hash

Was this page helpful?