Approves the spending of tokens by a specific address.
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( options: BaseTransactionOptions<ApproveParams>,): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
The transaction options.
let options: BaseTransactionOptions<ApproveParams>;
let returnType: PreparedTransaction< any, AbiFunction, PrepareTransactionOptions>;
A prepared transaction object.