prepareTransaction

Prepares a transaction with the given options.

Example

import { prepareTransaction, toWei } from "thirdweb";
import { ethereum } from "thirdweb/chains";
const transaction = prepareTransaction({
to: "0x1234567890123456789012345678901234567890",
chain: ethereum,
client: thirdwebClient,
value: toWei("1.0"),
gasPrice: 30n,
});
function prepareTransaction(
info?: Additional<abi, abiFn>,

Parameters

The options for preparing the transaction.

Type

let options: {
chain: Chain;
client: ThirdwebClient;
} & PromisedObject<
Omit<StaticPrepareTransactionOptions, "chain" | "client">
>;

Additional information about the ABI function.

Type

let info: Additional<abi, abiFn>;

Returns

let returnType: PreparedTransaction<
abi,
abiFn,
>;

The prepared transaction.