Skip to main content

ERC1155 - Claim

You can utilize these features of the SDK if your contract implements the ERC1155Claimable interface.

Claim A Lazy-Minted NFT

Claim the next available NFT(s) from the lazy minted batch.

Unless otherwise specified in your contract, the default is to claim the next available token IDs; starting from 0.

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

if (error) {
console.error("failed to claim nft", error);
}

return (
<button
disabled={isLoading}
onClick={() => claimNFT({ to: "{{wallet_address}}", quantity: 1 })}
>
Claim NFT!
</button>
);
};

This snippet is for v3 of the SDK. Learn how to upgrade.

View in React SDK Documentation