useClaimNFT
Hook for claiming an NFT from a smart contract.
Available to use on smart contracts that implement a Claimable
interface, and follow either the ERC721
or ERC1155
standard.
Example
Parameters
Returns
A mutation object to claim a NFT to the wallet specified in the params
options
The mutation function takes an object as argument with below properties:
to
The wallet address to mint the NFT(s) to.
Use the useAddress
hook to get the currently connected wallet address.
quantity
The number of NFTs you wish to claim.
With ERC721 contracts, this represents the number of unique tokens you wish to claim.
With ERC1155 contracts, this represents the quantity of the specific
tokenId
you wish to claim.
tokenId
For ERC1155 contracts, you must specify a specific tokenId
to claim.
options (optional)
Customizable ClaimOptions
object to override the default behaviour of the hook.
There are three options available:
checkERC20Allowance
- Whether to check the ERC20 allowance of the sender, defaults to true.currencyAddress
- The currency to pay for each token claimed, defaults toNATIVE_TOKEN_ADDRESS
for native currency.pricePerToken
- The price to pay for each token claimed. Not relevant when using claim conditions.