Skip to content

Releases: lnbotdev/typescript-sdk

v1.0.0

05 Mar 14:49

Choose a tag to compare

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 a Wallet handle with all sub-resources (invoices, payments, addresses, transactions, webhooks, events, l402, key)
  • client.register() — create a new account without auth
  • client.me() — get current identity
  • client.wallets.create() / .list() — wallet CRUD with user key
  • w.key.create() / .get() / .rotate() / .delete() — wallet key management
  • client.invoices.createForWallet() / .createForAddress() — public invoice creation (no auth)
  • w.payments.resolve() — inspect a payment target before sending
  • w.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

27 Feb 18:12

Choose a tag to compare

What's new

  • L402 paywall supportln.l402.createChallenge(), ln.l402.verify(), ln.l402.pay()
  • Get/watch by payment hashln.invoices.get() and ln.payments.get() now accept number | string
  • Removed ln.keys.list() — server endpoint removed (key listing is a local CLI operation)

Breaking changes

  • keys.list() removed
  • ApiKeyResponse type removed

v0.4.0

27 Feb 15:53

Choose a tag to compare

What's new

  • Wallet event stream: events.stream() — real-time SSE stream of all wallet activity
  • preimage field added to InvoiceResponse and PaymentResponse
  • serviceFee field added to PaymentResponse
  • New types: WalletEvent, WalletEventType, EventsResource

v0.3.0

27 Feb 14:57

Choose a tag to compare

What's new

  • Payment watch: payments.watch() SSE stream for real-time payment events (settled/failed)
  • Unauthenticated invoice creation: invoices.createForWallet() and invoices.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

26 Feb 01:51

Choose a tag to compare

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

Documentation · npm