🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@buildonspark/issuer-sdk

Package Overview
Dependencies
Maintainers
7
Versions
159
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@buildonspark/issuer-sdk

Spark Issuer SDK for token issuance

latest
npmnpm
Version
0.1.45
Version published
Weekly downloads
2.4K
8.74%
Maintainers
7
Weekly downloads
 
Created
Source

Spark Issuer SDK

Spark is the fastest, cheapest, and most UX-friendly way to build financial apps and launch assets natively on Bitcoin. It’s a Bitcoin L2 that lets developers move Bitcoin and Bitcoin-native assets (including stablecoins) instantly, at near-zero cost, while staying fully connected to Bitcoin’s infrastructure.

For complete documentation, visit https://docs.spark.money

Installation

npm install @buildonspark/issuer-sdk @buildonspark/spark-sdk
# or
yarn add @buildonspark/issuer-sdk @buildonspark/spark-sdk
# or
pnpm add @buildonspark/issuer-sdk @buildonspark/spark-sdk

Quick Start

Initialize an Issuer Wallet

import { IssuerSparkWallet } from "@buildonspark/issuer-sdk";

// Create a new issuer wallet (generates a new mnemonic)
const { wallet, mnemonic } = await IssuerSparkWallet.create({
  options: {
    network: "MAINNET", // or "REGTEST" for testing
  },
});

// Or initialize with an existing mnemonic
const wallet = await IssuerSparkWallet.initialize({
  mnemonicOrSeed: "your twelve word mnemonic phrase here ...",
  options: {
    network: "MAINNET",
  },
});

Create a Token

const token = await wallet.createToken({
  tokenName: "My Token",
  tokenTicker: "MTK",
  decimals: 8,
  maxSupply: 1000000n,
  isFreezable: true,
});

console.log(`Token created: ${token.tokenIdentifier}`);

Mint Tokens

// Mint tokens to your own wallet
const mintResult = await wallet.mintTokens({
  tokenIdentifier: "spark1...",
  tokenAmount: 10000n,
});

// To distribute tokens to others, mint first then transfer
await wallet.mintTokens({
  tokenIdentifier: "spark1...",
  tokenAmount: 5000n,
});

await wallet.transferTokens({
  tokenIdentifier: "spark1...",
  receiverSparkAddress: "sp1q...",
  tokenAmount: 5000n,
});

Check Issuer Token Balance

// Get balance for all tokens you've issued
const balances = await wallet.getIssuerTokenBalances();
for (const [tokenId, info] of balances) {
  console.log(`${info.tokenMetadata.tokenName}: ${info.balance}`);
}

Freeze/Unfreeze Tokens

// Freeze tokens at a Spark address (requires isFreezable: true during creation)
await wallet.freezeTokens({
  tokenIdentifier: "spark1...",
  sparkAddress: "sp1q...",
});

// Unfreeze tokens at a Spark address
await wallet.unfreezeTokens({
  tokenIdentifier: "spark1...",
  sparkAddress: "sp1q...",
});

Burn Tokens

const burnResult = await wallet.burnTokens({
  tokenIdentifier: "spark1...",
  tokenAmount: 1000n,
});

Query Token Transactions

const transactions = await wallet.getTokenTransactions({
  tokenIdentifier: "spark1...",
  limit: 50,
});

for (const tx of transactions) {
  console.log(`TX: ${tx.id}, Amount: ${tx.amount}`);
}

Platform Support

The SDK supports multiple JavaScript runtimes:

  • Browser
  • Node.js
  • React Native

Keywords

bitcoin

FAQs

Package last updated on 24 Jul 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts