approve

Approves the spending of tokens by a specific address.

Example

import { approve } from "thirdweb/extensions/erc20";
import { sendTransaction } from "thirdweb";
const transaction = await approve({
contract,
spender: "0x...",
amount: 100,
});
await sendTransaction({ transaction, account });
function approve(

Parameters

The transaction options.

Type

Returns

let returnType: PreparedTransaction<
any,
AbiFunction,
>;

A prepared transaction object.