Beta
an instance of a TokenContract
a mutation object that can be used to transfer tokens
const Component = () => {
const { contract } = useContract("{{contract_address}}");
const {
mutate: transferTokens,
isLoading,
error,
} = useTransferToken(contract);
if (error) {
console.error("failed to transfer tokens", error);
}
return (
<button
disabled={isLoading}
onClick={() => transferTokens({ to: "{{wallet_address}}", amount: 1000 })}
>
Transfer
</button>
);
};
ERC20
Generated using TypeDoc
Transfer tokens to a specific wallet