useTransferBatchToken
Hook for transferring ERC20 tokens to multiple recipients in a single transaction (i.e. airdrop).
Available to use on contracts that implement the ERC20 interface.
The wallet that initiates this transaction must have sufficient balance to cover the total amount of tokens being transferred and must have transfer permissions on the contract, i.e. tokens are not soulbound.
Example
Provide your token contract instance from the useContract
hook to the hook.
Then, provide an array of objects with the to
and amount
properties to the function.
Parameters
Returns
A Mutation object to transfer batch tokens
options
The mutation function takes an array of objects containing to
and amount
properties.
to
- The wallet address to transfer tokens to. Must be astring
.amount
- The amount of tokens to transfer. Must be anumber
.