execute

Prepares a transaction to call the "execute" function on the contract.

Example

import { sendTransaction } from "thirdweb";
import { execute } from "thirdweb/extensions/vote";
const transaction = execute({
contract,
targets: ...,
values: ...,
calldatas: ...,
descriptionHash: ...,
overrides: {
...
}
});
// Send the transaction
await sendTransaction({ transaction, account });
function execute(
ExecuteParams | { asyncParams: () => Promise<ExecuteParams> }
>,

Parameters

The options for the "execute" function.

Type

ExecuteParams | { asyncParams: () => Promise<ExecuteParams> }
>;

Returns

let returnType: PreparedTransaction<
any,
AbiFunction,
>;

A prepared transaction object.