useClaimToken
Hook for claiming a ERC20 tokens from a smart contract.
Available to use on smart contracts that implement both the ERC20 interface
and the claim
function,
such as the Token Drop .
A mutation object to tokens to the wallet specified in the params
options
The mutation function takes an object as an argument with the following properties:
to (required)
Likely, you will want to claim the token to the currently connected wallet address.
You can use the useAddress
hook to get this value.
amount (required)
The amount of tokens to be claimed.
checkERC20Allowance (optional)
Boolean value to check whether the current wallet has enough allowance to pay for claiming the tokens before attempting to claim the tokens.
Defaults to true
.