Releases: lnbotdev/python-sdk
Releases · lnbotdev/python-sdk
v1.0.0
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 keyswallets.current()andwallets.update()removed — useln.wallet(id).get()/.update()CreateWalletResponseno longer hasprimary_key,secondary_key,recovery_passphrase
New features
- Wallet-scoped API —
ln.wallet(id)returns aWallethandle with sub-resources:key,invoices,payments,addresses,transactions,webhooks,events,l402 - Account registration —
ln.register() - Identity check —
ln.me() - Wallet key management —
wallet.key.create(),.get(),.delete(),.rotate() - Public invoice creation —
ln.invoices.create_for_wallet(),.create_for_address() - Payment target resolution —
wallet.payments.resolve(target=...) - SSE resilience — handles heartbeat/malformed data lines gracefully
New types
RegisterResponse,MeResponse,WalletListItemWalletKeyResponse,WalletKeyInfoResponseResolveTargetResponseWallet,AsyncWallet
Testing
- 130 unit tests
- 56 integration tests (real API, real sats)
v0.5.0
What's new
- L402 paywall support —
ln.l402.create_challenge(),ln.l402.verify(),ln.l402.pay()(sync + async) - Get/watch by payment hash —
ln.invoices.get()andln.payments.get()now acceptint | str - Removed
ln.keys.list()— server endpoint removed (key listing is a local CLI operation)
Breaking changes
keys.list()removed from bothKeysResourceandAsyncKeysResourceApiKeyResponsetype removed
v0.4.0
v0.3.0
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()andinvoices.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
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 clients —
LnBotandAsyncLnBotwith 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 streaming —
wait_for_settlementfor real-time invoice events - Typed responses — frozen dataclasses with full type annotations (
py.typed) - Error hierarchy —
BadRequestError,UnauthorizedError,ForbiddenError,NotFoundError,ConflictError - Environment variable support —
LNBOT_API_KEY - Configurable timeouts — default 30s
Quick start
pip install lnbotfrom 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