Releases: lnbotdev/typescript-sdk
Releases · lnbotdev/typescript-sdk
v1.0.0
Breaking changes
All wallet resources are now scoped under client.wallet("wal_..."):
// Before (v0.x)
const ln = new LnBot({ apiKey: "key_..." });
await ln.invoices.create({ amount: 100 });
// After (v1.0)
const client = new LnBot({ apiKey: "uk_..." });
const w = client.wallet("wal_...");
await w.invoices.create({ amount: 100 });New features
- User keys (
uk_) + wallet keys (wk_) — user keys manage all wallets, wallet keys are scoped to one wallet client.wallet(id)— returns aWallethandle with all sub-resources (invoices, payments, addresses, transactions, webhooks, events, l402, key)client.register()— create a new account without authclient.me()— get current identityclient.wallets.create()/.list()— wallet CRUD with user keyw.key.create()/.get()/.rotate()/.delete()— wallet key managementclient.invoices.createForWallet()/.createForAddress()— public invoice creation (no auth)w.payments.resolve()— inspect a payment target before sendingw.events.stream()— SSE stream of all wallet events
Testing
- 98 unit tests + 58 integration tests against live API
- Integration tests cover all methods, balance bookkeeping, SSE streams, L402 full flow, error handling, and cleanup
v0.5.0
What's new
- L402 paywall support —
ln.l402.createChallenge(),ln.l402.verify(),ln.l402.pay() - Get/watch by payment hash —
ln.invoices.get()andln.payments.get()now acceptnumber | string - Removed
ln.keys.list()— server endpoint removed (key listing is a local CLI operation)
Breaking changes
keys.list()removedApiKeyResponsetype removed
v0.4.0
v0.3.0
What's new
- Payment watch:
payments.watch()SSE stream for real-time payment events (settled/failed) - Unauthenticated invoice creation:
invoices.createForWallet()andinvoices.createForAddress()— no API key required - LNURL support:
payments.create()now accepts LNURL targets alongside Lightning addresses and BOLT11 invoices - New types:
PaymentEvent,CreateInvoiceForWalletRequest,CreateInvoiceForAddressRequest,AddressInvoiceResponse
v0.1.1
Initial release
Official TypeScript SDK for the LnBot Lightning Network API.
Highlights
- Wallet creation, balance, and management
- Create and pay BOLT11 invoices
- Lightning address support (create, delete, transfer)
- Real-time invoice settlement via SSE
- Webhook management
- Backup and restore (recovery passphrase + passkey)
- Typed errors (
BadRequestError,NotFoundError,ConflictError) - Zero dependencies, ESM + CJS, full TypeScript types
Install
npm install @lnbot/sdk