sendAndConfirmTransaction

Sends a transaction using the provided wallet.

Example

Basic usage

import { sendAndConfirmTransaction } from "thirdweb";
const transactionReceipt = await sendAndConfirmTransaction({
account,
transaction,
});

Gasless usage with thirdweb Engine

const transactionReceipt = await sendAndConfirmTransaction({
account,
transaction,
gasless: {
provider: "engine",
relayerUrl:
"https://thirdweb.engine-***.thirdweb.com/relayer/***",
relayerForwarderAddress: "0x...",
},
});

Gasless usage with OpenZeppelin

const transactionReceipt = await sendAndConfirmTransaction({
account,
transaction,
gasless: {
provider: "openzeppelin",
relayerUrl: "https://...",
relayerForwarderAddress: "0x...",
},
});
function sendAndConfirmTransaction(
): Promise<TransactionReceipt>;

Parameters

The options for sending the transaction.

Type

let options: {
account: Account;
gasless: GaslessOptions;
transaction: PreparedTransaction<any>;
};

Returns

let returnType: {
blobGasPrice?: quantity;
blobGasUsed?: quantity;
blockHash: Hash;
blockNumber: quantity;
contractAddress: Address | null | undefined;
cumulativeGasUsed: quantity;
effectiveGasPrice: quantity;
from: Address;
gasUsed: quantity;
logs: Array<Log<quantity, index, false>>;
logsBloom: Hex;
root?: Hash;
status: status;
to: Address | null;
transactionHash: Hash;
transactionIndex: index;
type: type;
};

A promise that resolves to the confirmed transaction receipt.