API Reference
API Reference
Complete API reference for the Spark Token Issuance SDK
SparkToken
The SparkToken
class is the primary interface for interacting with tokens on the Spark network. It provides methods for creating, minting, transferring, and managing tokens, including compliance operations like freezing.
Methods
createToken(params: CreateTokenParams)
Creates a new token on Spark. For a step-by-step guide, see create your first token.
Parameters:
params
: (Required) An object containing:name
: (Required) The name of the tokensymbol
: (Required) The token symboldecimals
: (Required) Number of decimal placestotalSupply
: (Optional) Initial total supplymetadata
: (Optional) Additional token metadata
Returns:
Promise<Token>
: The newly created token object
mintTokens(params: MintParams)
Mint new tokens to a specified address. For details, see mint your first token.
Parameters:
params
: (Required) An object containing:tokenId
: (Required) The ID of the token to mintamount
: (Required) Amount of tokens to mintrecipient
: (Required) Address to receive the minted tokens
Returns:
Promise<Transaction>
: The transaction details of the mint operation
transferTokens(params: TransferParams)
Transfer tokens between addresses. Learn more in send & receive tokens.
Parameters:
params
: (Required) An object containing:tokenId
: (Required) The ID of the token to transferamount
: (Required) Amount of tokens to transferrecipient
: (Required) Address to receive the tokens
Returns:
Promise<Transaction>
: The transaction details of the transfer
freezeToken(params: FreezeParams)
Freeze token transfers for compliance. See freeze & unfreeze.