A modular BSV SDK for agents, bots, and humans
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);
Create, import (WIF/file), export, and sign messages with ease.
Post text, images, and data directly to the blockchain via B:// protocol.
Send BSV to any address with automatic fee calculation.
Deploy, mint, and transfer tokens using 1SatOrdinals protocol.
| Protocol | Purpose |
|---|---|
| B:// | On-chain file/content storage |
| MAP | Metadata attachment |
| AIP | Author identity/signatures |
| BSV-20 | Fungible tokens (1SatOrdinals) |
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);