approve

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

Example

import { approve } from "thirdweb/extensions/erc721";
const transaction = approve({
contract,
to: ...,
tokenId: ...,
overrides: {
...
}
});
// Send the transaction
...
function approve(
ApproveParams | { asyncParams: () => Promise<ApproveParams> }
>,

Parameters

The options for the "approve" function.

Type

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

Returns

let returnType: PreparedTransaction<
any,
AbiFunction,
>;

A prepared transaction object.