Creating a token registers it on the network and locks in its properties. Once created, the token exists immediately and you can start minting. All token properties (name, ticker, decimals, max supply, freezability) are permanent and cannot be changed after creation.
Create Your Token
import { IssuerSparkWallet } from "@buildonspark/issuer-sdk";
const { wallet, mnemonic } = await IssuerSparkWallet.initialize({
options: { network: "REGTEST" }
});
await wallet.createToken({
tokenName: "Acme Dollar",
tokenTicker: "ACME",
decimals: 6,
maxSupply: BigInt(0),
isFreezable: true
});
const tokenId = await wallet.getIssuerTokenIdentifier();
console.log("Token created:", tokenId); // btkn1q...
Token Properties
All properties are permanent. Choose carefully.
Name and Ticker
Display name and symbol shown in wallets and explorers.
tokenName: "Acme Dollar"
tokenTicker: "ACME"
Decimals
Defines the smallest unit. If decimals: 6, then 1000000 base units = 1 token.
| Decimals | Smallest Unit | Common Usage |
|---|
| 6 | 0.000001 | Stablecoins |
| 8 | 0.00000001 | Bitcoin-style |
Max Supply
BigInt(0) for unlimited. Any other value caps total supply forever.
// Unlimited
maxSupply: BigInt(0)
// Capped at 21 million (8 decimals)
maxSupply: BigInt(21_000_000_00000000)
Freezable
If true, you can freeze addresses from transacting your token. If false, you lose this ability permanently.
This cannot be changed. If you set isFreezable: false, you can never freeze tokens.
Get Token Info
After creation, retrieve your token’s metadata and identifier:
const metadata = await wallet.getIssuerTokenMetadata();
console.log(metadata.tokenName); // "Acme Dollar"
console.log(metadata.tokenTicker); // "ACME"
console.log(metadata.decimals); // 6
console.log(metadata.maxSupply); // 0n
console.log(metadata.isFreezable); // true
const tokenId = await wallet.getIssuerTokenIdentifier();
console.log(tokenId); // btkn1q...
Vanity Identifiers
Token identifiers are derived from your wallet keys. Want a custom suffix like btkn1...usdc? Use the vanity generator.