fetchProofsERC20

Retrieves the claim merkle proof for the provided address.

Example

import { fetchProofsERCC20 } from "thirdweb/extensions/airdrop";
import { getContract, defineChain } from "thirdweb";
const TOKEN = getContracct({
client,
chain: defineChain(1),
address: "0x...",
});
const merkleRoot = await tokenMerkleRoot({
contract: TOKEN,
tokenAddress: TOKEN.address,
});
const proof = await fetchProofsERC20({
contract: TOKEN,
recipient: "0x...",
merkleRoot,
});
function fetchProofsERC20(options: {
contract: Readonly<ContractOptions<[]>>;
merkleRoot: string;
recipient: string;
tokenDecimals: number;
}): Promise<ClaimProofERC20 | null>;

Parameters

Type

let options: {
contract: Readonly<ContractOptions<[]>>;
merkleRoot: string;
recipient: string;
tokenDecimals: number;
};

Returns

let returnType: Promise<ClaimProofERC20 | null>;

A promise that resolves to the proof or null if the recipient is not in the allowlist