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

# Issuer Wallet

Your issuer wallet holds the keys that control your token. Create one to get started, or restore an existing wallet with your mnemonic.

<Frame className="chill">
  <img className="block dark:hidden" src="https://mintcdn.com/lightspark/OQ3nooAPVcDN2i7X/images/issuance/issuer-wallet-light.png?fit=max&auto=format&n=OQ3nooAPVcDN2i7X&q=85&s=76b60d50a3f0549c4eb3ee5c6dcfa369" alt="Issuer Wallet" width="3840" height="2160" data-path="images/issuance/issuer-wallet-light.png" />

  <img className="hidden dark:block" src="https://mintcdn.com/lightspark/OQ3nooAPVcDN2i7X/images/issuance/issuer-wallet.png?fit=max&auto=format&n=OQ3nooAPVcDN2i7X&q=85&s=e4bc41d927a11f31242b9bb712f483bc" alt="Issuer Wallet" width="3840" height="2160" data-path="images/issuance/issuer-wallet.png" />
</Frame>

## Create a Wallet

```typescript theme={null}
import { IssuerSparkWallet } from "@buildonspark/issuer-sdk";

const { wallet, mnemonic } = await IssuerSparkWallet.initialize({
  options: { network: "REGTEST" }
});

console.log("Backup this phrase:", mnemonic);
console.log("Your address:", await wallet.getSparkAddress());
```

Store the mnemonic securely. It's the only way to recover your wallet.

## Restore a Wallet

```typescript theme={null}
const { wallet } = await IssuerSparkWallet.initialize({
  mnemonicOrSeed: "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about",
  options: { network: "MAINNET" }
});
```

## Networks

| Network   | Use                     |
| :-------- | :---------------------- |
| `REGTEST` | Development and testing |
| `MAINNET` | Production              |

Start on `REGTEST`. When you're ready for production, generate a fresh wallet on `MAINNET`.

## Multiple Tokens

An issuer identity can create multiple tokens. Use `getIssuerTokenIdentifiers()` and `getIssuerTokenBalances()` to work with all of them.

If you want separate issuer identities (separate keys) from the same mnemonic, derive them with different account numbers:

```typescript theme={null}
const { wallet: tokenA } = await IssuerSparkWallet.initialize({
  mnemonicOrSeed: "your mnemonic...",
  accountNumber: 0,
  options: { network: "REGTEST" }
});

const { wallet: tokenB } = await IssuerSparkWallet.initialize({
  mnemonicOrSeed: "your mnemonic...",
  accountNumber: 1,
  options: { network: "REGTEST" }
});
```

## Cleanup

Close connections when your app shuts down:

```typescript theme={null}
await wallet.cleanupConnections();
```
