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 });

Parameters

Returns

A prepared transaction object.