useMintToken
Description
Hook to mint ERC20 tokens
Parameters
| Name | Type | Description |
|---|---|---|
| to | string | The address to which the newly minted tokens will be sent. |
| tokenURI | string | The amount of tokens to mint. |
| [overrides] | Overrides | Optional overrides for the contract call. |
Example
import { useContract, useMintToken } from "@openformat/react";
// address of a created token (ERC20) contract. You can get this from the subgraph.
const address = "0x123...";
// returns an instance of the token.
const { data: token } = useContract(address);
const { data, mint, isLoading, error } = useMintToken(token);
async function handleMint() {
await mint({ to: "0x123...", amount: 5 });
}