Skip to main content
Creates a new token on Spark using Spark Native Tokens for the IssuerSparkWallet.

Method Signature

async function createToken({
  tokenName: string,
  tokenTicker: string,
  decimals: number,
  maxSupply: bigint,
  isFreezable: boolean
}): Promise<string>;

Parameters

tokenName
string
required
Name of the token (eg: SparkCoin)
tokenTicker
string
required
Token ticker (eg: SPARKC)
decimals
number
required
The precision the token supports (eg: 8 for BTC)
maxSupply
bigint
required
The maximum supply for this token (use 0n for unlimited supply)
isFreezable
boolean
required
Whether or not the Issuer can freeze this token

Returns

txId
string
required
Spark Transaction ID

Example

const txId = await issuerWallet.createToken({
  tokenName: "SparkCoin",
  tokenTicker: "SPARKC",
  decimals: 8,
  maxSupply: 1000000n,
  isFreezable: true
});

console.log("Token created:", txId);