Prerequisites

Using our Spark CLI tool

We have a CLI tool that allows you to test your wallet operations on Spark. No coding is required!

To install the CLI tool:

# Clone the Spark SDK repo
git clone https://github.com/buildonspark/spark.git

# Navigate to the JS folder
cd spark/sdks/js

# Install dependencies and build the SDK
yarn && yarn build

# Navigate to the JS CLI folder
cd examples/spark-cli

# Start the CLi
yarn cli

This will start the CLI tool and you will be able to interact with the wallet. Run help to see the available commands.

Command Reference

CommandUsage
initwalletinitwallet <mnemonic/seed> - Creates a new wallet instance. If no mnemonic provided, generates one
getbalanceGets the current wallet balance as well the token balance
getsparkaddressGets a new Spark Address for receiving transfers
announcetokenannouncetoken <tokenname> <tokenticker> <decimals> <maxsupply> <isfreezable> - Mint a certain amount of tokens
minttokensminttokens <amount> - Mint a certain amount of tokens
transfertokenstransfertokens <tokenPubKey> <amount> <receiverSparkAddress> - Sends tokens to the given receiver Spark Address
burntokensburntokens <amount> - Burns the specified amount of tokens
freezetokensfreezetokens <sparkaddress> - Freezes tokens at the Spark Address
unfreezetokensunfreezetokens <sparkaddress> - Unfreezes tokens at the Spark Address
tokenactivityGets the token activity for the issuer’s token
tokeninfoGets the token info for the issuer’s token
helpShows the help menu
exitExits the CLI tool

Demo application

The fully built Demo Application is available Here

Sample Express server project

Clone the SDK repo

git clone https://github.com/buildonspark/spark.git
cd spark/sdks/js/examples/spark-node-express/

Follow the instructions in the README to install dependencies and run the server.