Complete API reference for the Spark Token Issuance SDK
IssuerSparkWallet
class extends SparkWallet
(all the functions of SparkWallet
are available) and provides functions for token issuance and management on the Spark network.
announceTokenL1()
OP_RETURN
for the LRC20
prefix in the returned L1 txid to verify announcement on chain.tokenName
: Name of the token (eg: SparkCoin)tokenTicker
: Token ticker (eg: SPARKC)decimals
: The precision the token supports (eg: 8 for BTC)maxSupply
: The maximum supply for this tokenisFreezable
: Whether or not the Issuer can freeze this tokenfeeRateSatsPerVb
: (Default: 2) Transaction fee per virtual bytegetBalance()
balance
: Current balance in satoshistokenBalances
: Map of token balances by token public key with token information and Bech32m token identifier to displaymintTokens()
tokenAmount
: The amount to mint (eg: 1000n)transferTokens()
tokenIdentifier
: Bech32m token identifier (eg: btkn1…) of the token to transfertokenAmount
: Amount of tokens to transferreceiverSparkAddress
: Recipient’s Spark AddressselectedOutputs
: (Optional) Specific outputs to use for transferbatchTransferTokens()
tokenIdentifier
: Bech32m token identifier (eg: btkn1…) of the token to transfertransfers
: Array of transfer objects containing recipient addresses and amountsselectedOutputs
: (Optional) Specific outputs to use for transferburnTokens()
tokenAmount
: The amount to burn (eg: 1000n)freezeTokens()
sparkAddress
: The Spark Address to freeze.unfreezeTokens()
sparkAddress
: The Spark Address to unfreeze.getIssuerTokenBalance()
sparkAddress
: (Optional) Spark Address of the wallet to get the balance of. If no address is provided, the function will return the token balance of the issuer wallet.getIssuerTokenMetadata()
getIssuerTokenMetadata()
or getIdentityPublicKey()
getIdentityPublicKey()
since it does not involve a network call.getIssuerTokenIdentifier()
queryTokenTransactions()
ownerPublicKeys
: (Optional) Array of owner public keys to filter byissuerPublicKeys
: (Optional) Array of issuer public keys to filter bytokenTransactionHashes
: (Optional) Array of token transaction hashes to filter bytokenIdentifiers
: (Optional) Array of Bech32m token identifiers to filter byoutputIds
: (Optional) Array of output IDs to filter bygetIssuerTokenDistribution()
totalCirculatingSupply
: Total circulating supply of the tokentotalIssued
: Total issued tokenstotalBurned
: Total tokens burnednumHoldingAddress
: Number of addresses holding the tokennumConfirmedTransactions
: Number of confirmed transactionsSparkWallet
class provides core wallet functionality for interacting with the Spark network.