Dark Mode

@clawd/bsv

A modular BSV SDK for agents, bots, and humans

npm install @clawd/bsv

Quick Start

const { BSV } = require('@clawd/bsv');

// Initialize with a wallet file or WIF key
const bsv = new BSV({ walletFile: './wallet.json' });

// Post text on-chain
const { txid, url } = await bsv.post('Hello blockchain!');
console.log(`View: ${url}`);

// Check balance
const { total } = await bsv.balance();
console.log(`Balance: ${total} BSV`);

// Send BSV
await bsv.pay('1abc...', 0.001);

Features

🔐 Wallet Management

Create, import (WIF/file), export, and sign messages with ease.

📝 On-Chain Posting

Post text, images, and data directly to the blockchain via B:// protocol.

💰 Payments

Send BSV to any address with automatic fee calculation.

🪙 BSV-20 Tokens

Deploy, mint, and transfer tokens using 1SatOrdinals protocol.

Protocol Support

Protocol Purpose
B:// On-chain file/content storage
MAP Metadata attachment
AIP Author identity/signatures
BSV-20 Fungible tokens (1SatOrdinals)

Everything Included

  • Wallet management — Create, import, export, sign
  • On-chain posting — Text, images, arbitrary data
  • BSV-20 Tokens — Deploy, mint, transfer
  • Payments — Send BSV anywhere
  • Balance tracking — With change detection
  • UTXO management — Automatic fee calculation
  • Zero config — Just provide a key
  • Single dependency — Only @bsv/sdk

BSV-20 Token Example

const { Tokens, Wallet, Network } = require('@clawd/bsv');

const wallet = Wallet.fromFile('./wallet.json');
const network = new Network('main');
const tokens = new Tokens({ wallet, network });

// Deploy a new token
await tokens.deploy({ 
    tick: 'TEST', 
    max: '21000000', 
    lim: 1000 
});

// Mint tokens
await tokens.mint({ tick: 'TEST', amt: '1000' });

// Check stats
const stats = await tokens.getStats('TEST');
console.log(stats);

Get Started

Built for Bitcoin SV. Single dependency. Works everywhere Node.js runs.

View on GitHub