Skip to main content
Minting creates new tokens and deposits them directly into your issuer wallet. From there, you can transfer them to users or hold them in reserve. Only the issuer wallet that created the token can mint.
Mint Tokens

Mint

const [tokenIdentifier] = await wallet.getIssuerTokenIdentifiers();
if (!tokenIdentifier) throw new Error("No token identifiers found for this issuer");

// Mint 10,000 tokens (6 decimals)
await wallet.mintTokens({
  tokenIdentifier,
  tokenAmount: 10_000_000000n
});
The amount is in base units. If your token has 6 decimals, multiply the human-readable amount by 1,000,000.
function toBaseUnits(amount: string, decimals: number): bigint {
  const [whole, fraction = ""] = amount.split(".");
  const fractionPadded = (fraction + "0".repeat(decimals)).slice(0, decimals);
  return BigInt(whole || "0") * 10n ** BigInt(decimals) + BigInt(fractionPadded || "0");
}

await wallet.mintTokens({
  tokenIdentifier,
  tokenAmount: toBaseUnits("10000", 6)
});

Check Your Balance

After minting, tokens appear in your wallet immediately:
const { tokenBalances } = await wallet.getBalance();
for (const [tokenId, info] of tokenBalances) {
  console.log(tokenId, info.ownedBalance);
}

Max Supply

If you set a maxSupply when creating your token, minting fails once you reach it. With unlimited supply (maxSupply: 0n), you can mint indefinitely.
const [tokenIdentifier] = await wallet.getIssuerTokenIdentifiers();
if (!tokenIdentifier) throw new Error("No token identifiers found for this issuer");

const [metadata] = await wallet.getIssuerTokensMetadata([tokenIdentifier]);
if (!metadata) throw new Error(`No metadata found for token ${tokenIdentifier}`);

if (metadata.maxSupply === 0n) {
  console.log("Unlimited supply");
} else {
  console.log("Max supply:", metadata.maxSupply);
}