Beta
an instance of a TokenContract
a mutation object that can be used to mint new tokens to the connected wallet
const Component = () => {
const { contract } = useContract("{{contract_address}}");
const {
mutate: mintTokens,
isLoading,
error,
} = useMintToken(contract);
if (error) {
console.error("failed to mint tokens", error);
}
return (
<button
disabled={isLoading}
onClick={() => mintTokens({ to: "{{wallet_address}}", amount: 1000 })}
>
Mint!
</button>
);
};
ERC20Mintable
Generated using TypeDoc
Mint tokens