DOCS

useAirdropNFT

Airdrop NFTs to a list of wallets

Example

const Component = () => {
  const { contract } = useContract("{{contract_address}}");
  const {
    mutate: airdropNFT,
    isLoading,
    error,
  } = useAirdropNFT(contract);

  if (error) {
    console.error("failed to transfer batch NFTs", error);
  }

  return (
    <button
      disabled={isLoading}
      onClick={() => airdropNFT({
         tokenId: 2,
         addresses: [
           { address: "{{wallet_address}}", quantity: 2 },
           { address: "{{wallet_address}}", quantity: 4 } }
         ]
      )}
    >
      Airdrop NFT
    </button>
  );
};

Parameters

Returns

a mutation object that can be used to transfer batch NFTs