> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spark.money/llms.txt
> Use this file to discover all available pages before exploring further.

# Testing Guide

### Prerequisites

* Node.js 20+
* [Spark CLI tool](https://github.com/buildonspark/spark)

### 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:

```bash theme={null}
git clone https://github.com/buildonspark/spark.git

cd spark/sdks/js

yarn && yarn build

cd examples/spark-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

<div style={{ height: "0.01rem" }} />

<table style={{width: '100%', borderCollapse: 'collapse', marginBottom: '20px'}}>
  <thead>
    <tr>
      <th style={{textAlign: 'left', width: '25%', borderBottom: '1px solid #ddd', paddingBottom: '8px'}}>Command</th>
      <th style={{textAlign: 'left', width: '75%', borderBottom: '1px solid #ddd', paddingBottom: '8px'}}>Usage</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td style={{paddingTop: '8px', paddingBottom: '8px'}}><code>initwallet</code></td>
      <td style={{paddingTop: '8px', paddingBottom: '8px'}}><code>initwallet \<mnemonic/seed></code> - Creates a new wallet instance. If no mnemonic provided, generates one</td>
    </tr>

    <tr>
      <td style={{paddingTop: '8px', paddingBottom: '8px'}}><code>getbalance</code></td>
      <td style={{paddingTop: '8px', paddingBottom: '8px'}}>Gets the current wallet balance as well the token balance</td>
    </tr>

    <tr>
      <td style={{paddingTop: '8px', paddingBottom: '8px'}}><code>getsparkaddress</code></td>
      <td style={{paddingTop: '8px', paddingBottom: '8px'}}>Gets a new Spark Address for receiving transfers</td>
    </tr>

    <tr>
      <td style={{paddingTop: '8px', paddingBottom: '8px'}}><code>announcetoken</code></td>
      <td style={{paddingTop: '8px', paddingBottom: '8px'}}><code>announcetoken \<tokenname> \<tokenticker> \<decimals> \<maxsupply> \<isfreezable></code> - Mint a certain amount of tokens</td>
    </tr>

    <tr>
      <td style={{paddingTop: '8px', paddingBottom: '8px'}}><code>minttokens</code></td>
      <td style={{paddingTop: '8px', paddingBottom: '8px'}}><code>minttokens \<amount></code> - Mint a certain amount of tokens</td>
    </tr>

    <tr>
      <td style={{paddingTop: '8px', paddingBottom: '8px'}}><code>transfertokens</code></td>
      <td style={{paddingTop: '8px', paddingBottom: '8px'}}><code>transfertokens \<tokenIdentifier> \<amount> \<receiverSparkAddress></code> - Sends tokens to the given receiver Spark Address using Bech32m token identifier (btkn1...)</td>
    </tr>

    <tr>
      <td style={{paddingTop: '8px', paddingBottom: '8px'}}><code>burntokens</code></td>
      <td style={{paddingTop: '8px', paddingBottom: '8px'}}><code>burntokens \<amount></code> - Burns the specified amount of tokens</td>
    </tr>

    <tr>
      <td style={{paddingTop: '8px', paddingBottom: '8px'}}><code>freezetokens</code></td>
      <td style={{paddingTop: '8px', paddingBottom: '8px'}}><code>freezetokens \<sparkaddress></code> - Freezes tokens at the Spark Address</td>
    </tr>

    <tr>
      <td style={{paddingTop: '8px', paddingBottom: '8px'}}><code>unfreezetokens</code></td>
      <td style={{paddingTop: '8px', paddingBottom: '8px'}}><code>unfreezetokens \<sparkaddress></code> - Unfreezes tokens at the Spark Address</td>
    </tr>

    <tr>
      <td style={{paddingTop: '8px', paddingBottom: '8px'}}><code>tokenactivity</code></td>
      <td style={{paddingTop: '8px', paddingBottom: '8px'}}>Gets the token activity for the issuer's token</td>
    </tr>

    <tr>
      <td style={{paddingTop: '8px', paddingBottom: '8px'}}><code>tokeninfo</code></td>
      <td style={{paddingTop: '8px', paddingBottom: '8px'}}>Gets the token info for the issuer's token</td>
    </tr>

    <tr>
      <td style={{paddingTop: '8px', paddingBottom: '8px'}}><code>help</code></td>
      <td style={{paddingTop: '8px', paddingBottom: '8px'}}>Shows the help menu</td>
    </tr>

    <tr>
      <td style={{paddingTop: '8px', paddingBottom: '8px'}}><code>exit</code></td>
      <td style={{paddingTop: '8px', paddingBottom: '8px'}}>Exits the CLI tool</td>
    </tr>
  </tbody>
</table>

## Demo application

The fully built Demo Application is available [Here](https://github.com/buildonspark/spark/tree/develop/sdks/js/examples/spark-demo)

## Sample Express server project

### Clone the SDK repo

```bash theme={null}
git clone https://github.com/buildonspark/spark.git
```

### Navigate to project directory

```bash theme={null}
cd spark/sdks/js/examples/spark-node-express/
```

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