useMintToken
Mint tokens
Example
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>
);
};
Parameters
Returns
a mutation object that can be used to mint new tokens to the connected wallet