Commit graph

22 commits

Author SHA1 Message Date
fusion44
df62098cd1
refactor(lightning): migrate SendCoinsInput validator to Pydantic v2
Replace the deprecated Pydantic v1 @validator('amount', pre=True,
always=True) with a v2 @model_validator(mode='after'). The model
validator always runs and can see both amount and send_all, preserving
the cross-field rule (and the always=True semantics that reject the
empty/default case). Removes the last Pydantic v1 deprecation warning.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 22:22:05 +02:00
fusion44
e564d18d2b
chore: clean up imports; add better LND error logging 2026-02-03 11:05:19 +01:00
Justin Sharp
6b3acf0239 fix: handle missing fields in CLN invoice data gracefully
Fixes #129, #128, and addresses part of raspiblitz/raspiblitz#3182

BOLT12 offers, keysend payments, and certain CLN invoice types don't
always include all fields that the API expects, causing KeyError
exceptions that crash the web interface.

Changes:
- Modified Invoice.from_cln_json() to use .get() with safe defaults
  for all potentially missing fields (bolt11, amount_msat, payment_hash,
  description, label, status, etc.)
- Added fallback logic for amount_msat to use amount_received_msat
  when the primary field is missing
- Enhanced InvoiceState.from_cln_json() to handle unknown/missing
  statuses gracefully with logging instead of raising exceptions

This allows the web interface to display all CLN invoices including
BOLT12 payments from services like OCEAN mining pool, while preserving
all existing payment data for standard BOLT11 invoices.

Tested on RaspiBlitz v1.12.0 with Core Lightning and OCEAN mining
pool BOLT12 payouts.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-10 10:00:05 +01:00
fusion44
751687e60b chore: run ruff format and isort 2025-05-06 09:16:46 +02:00
fusion44
8ee5a49892 feat: update get app status error handling code
refs #123
2025-05-06 09:16:46 +02:00
Christoph Stenglein
cf4ab3963c remove ln_info_lite 2024-10-06 14:18:01 +02:00
fusion44
b7e9ae29fb
fix: adapt code to recent dependeny upgrades 2024-02-24 15:30:32 +01:00
pre-commit-ci[bot]
9bd14d161a
[pre-commit.ci] pre-commit autoupdate (#240)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black: 23.12.1 → 24.2.0](https://github.com/psf/black/compare/23.12.1...24.2.0)
- [github.com/astral-sh/ruff-pre-commit: v0.1.14 → v0.2.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.14...v0.2.1)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-02-18 12:11:15 +01:00
fusion44
adf472ac8b feat: implement Ruff as a linter; fix given errors 2023-06-25 07:17:00 +02:00
fusion44
8d93ce608f
fix: ln-info delivers wrong identity_uri #202 2023-05-20 14:13:24 +02:00
fusion44
467d23a2c3
feat: improvements and fixes for send-coins
both:
feat: add send_all field to SendCoinsResponse

CLN_gRPC only:
feat: improve error handling
fix: return a status 412 when no funds are  available to send

CLN_gRPC only:
fix: send-coins sending incorrect amount
2023-05-01 13:28:58 +02:00
fusion44
3826fd93a0
fix: a few smaller bugs
- CLN-JRPC: short_channel_id is not available while a channel is
  confirming => return an empty string
- CLN-GRPC: don't send all=False with the amount flag when opening a
  channel as it'll lead to an erro
- CLN-GRPC: don't utf8-decode the open-channel result
2023-04-07 20:59:44 +02:00
fusion44
bcd1e782c3
fix: parsing errors 2023-04-02 20:27:05 +02:00
fusion44
d40790e5f4
fix: crashes in CLN JSON RPC implementation 2023-04-02 12:58:04 +02:00
fusion44
94179cc5da
feat: add CLN JSON-RPC implementation 2023-03-26 20:53:50 +02:00
pre-commit-ci[bot]
3d1dfd919c
[pre-commit.ci] pre-commit autoupdate (#187)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black: 22.12.0 → 23.1.0](https://github.com/psf/black/compare/22.12.0...23.1.0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-02-11 13:47:34 +01:00
/rootzoll
5703263b13
#179 add identity_uri to ln_info_lite (#183)
* #3260 allow selected special chars password check

* #179 add identity_uri

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-12-20 07:43:37 +01:00
fusion44
2435b1c57f
feat: improve logging and remove print statements 2022-12-18 20:55:48 +01:00
fusion44
4af5c7bf07
refactor: make openapi-client-generator happy 2022-12-11 19:24:31 +01:00
fusion44
86442dde89
feat: implement send all onchain funds flag
refs #139
2022-11-28 19:07:25 +01:00
fusion44
1388205ff5
feat: use CLN bookeeper plugin to serve onchain tx
closes #87, refs #99
2022-11-05 22:35:01 +01:00
fusion44
ba453e7bdb
refactor: switch to domain driven directory layout 2022-10-03 20:22:00 +02:00
Renamed from app/models/lightning.py (Browse further)