Skip to content

Releases: lnbotdev/python-sdk

v1.0.0

05 Mar 17:04

Choose a tag to compare

v1.0.0 — Wallet-scoped API

Breaking changes

  • All wallet operations now go through ln.wallet(wallet_id) instead of top-level methods
  • wallets.create() no longer takes parameters or returns keys
  • wallets.current() and wallets.update() removed — use ln.wallet(id).get() / .update()
  • CreateWalletResponse no longer has primary_key, secondary_key, recovery_passphrase

New features

  • Wallet-scoped APIln.wallet(id) returns a Wallet handle with sub-resources: key, invoices, payments, addresses, transactions, webhooks, events, l402
  • Account registrationln.register()
  • Identity checkln.me()
  • Wallet key managementwallet.key.create(), .get(), .delete(), .rotate()
  • Public invoice creationln.invoices.create_for_wallet(), .create_for_address()
  • Payment target resolutionwallet.payments.resolve(target=...)
  • SSE resilience — handles heartbeat/malformed data lines gracefully

New types

  • RegisterResponse, MeResponse, WalletListItem
  • WalletKeyResponse, WalletKeyInfoResponse
  • ResolveTargetResponse
  • Wallet, AsyncWallet

Testing

  • 130 unit tests
  • 56 integration tests (real API, real sats)

v0.5.0

27 Feb 18:12

Choose a tag to compare

What's new

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

Breaking changes

  • keys.list() removed from both KeysResource and AsyncKeysResource
  • 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 (sync + async)
  • preimage field added to InvoiceResponse and PaymentResponse
  • service_fee field added to PaymentResponse
  • New types: WalletEvent, WalletEventType

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) — both sync and async
  • Unauthenticated invoice creation: invoices.create_for_wallet() and invoices.create_for_address() — no API key required
  • LNURL support: payments.create() now accepts LNURL targets alongside Lightning addresses and BOLT11 invoices
  • New types: PaymentEvent, AddressInvoiceResponse

v.0.1.1

26 Feb 13:16

Choose a tag to compare

lnbot v0.1.1

The official Python SDK for LnBot — Bitcoin for AI Agents.

Give your AI agents, apps, and services access to Bitcoin over the Lightning Network.

Features

  • Sync and async clientsLnBot and AsyncLnBot with full API parity
  • Wallets — create, query balance, update
  • Invoices — create BOLT11 invoices, list, get by number
  • Payments — send sats to Lightning addresses or BOLT11 invoices
  • Addresses — create, list, delete, transfer Lightning addresses
  • Transactions — list credit and debit history
  • Webhooks — register and manage webhook endpoints
  • Backup & Restore — recovery passphrase and WebAuthn passkey support
  • SSE streamingwait_for_settlement for real-time invoice events
  • Typed responses — frozen dataclasses with full type annotations (py.typed)
  • Error hierarchyBadRequestError, UnauthorizedError, ForbiddenError, NotFoundError, ConflictError
  • Environment variable supportLNBOT_API_KEY
  • Configurable timeouts — default 30s

Quick start

pip install lnbot
from lnbot import LnBot

ln = LnBot(api_key="lnbot_...")

invoice = ln.invoices.create(amount=1000, memo="Coffee")
ln.payments.create(target="alice@ln.bot", amount=500)

Requirements

  • Python 3.10+
  • Single dependency: httpx