Claim ERC20 NFTs to a specified address
import { claimTo } from "thirdweb/extensions/erc20";import { sendTransaction } from "thirdweb"; const transaction = claimTo({ contract, to: "0x...", quantity: 100n,}); await sendTransaction({ transaction, account });
You need to specify the claimer address as the from param to avoid any issue with the allowlist
from
const transaction = claimTo({ contract, to: "0x...", quantity: 100n, from: "0x...", // address of the one claiming});
function claimTo( options: BaseTransactionOptions<ClaimToParams>,): PreparedTransaction<any, AbiFunction, PrepareTransactionOptions>;
The options for the transaction
let options: BaseTransactionOptions<ClaimToParams>;
let returnType: PreparedTransaction< any, AbiFunction, PrepareTransactionOptions>;
A promise that resolves with the submitted transaction hash.