Skip to content

fix: support paying RGB Lightning invoices with open asset amount#107

Open
bitwalt wants to merge 1 commit into
devfrom
fix/rgb-lightning-open-amount-invoice
Open

fix: support paying RGB Lightning invoices with open asset amount#107
bitwalt wants to merge 1 commit into
devfrom
fix/rgb-lightning-open-amount-invoice

Conversation

@bitwalt
Copy link
Copy Markdown
Collaborator

@bitwalt bitwalt commented Apr 29, 2026

Summary

  • Lightning invoices that set asset_id but leave asset_amount null (open-amount RGB invoices) were misclassified as plain BTC invoices in the Withdraw modal: the asset details panel was hidden, the amount input never appeared, and sendPayment was called without asset_id / asset_amount, so the payment could not settle.
  • The Withdraw flow now keys the asset section in LightningInvoiceDetails off asset_id alone and shows "Not specified by invoice" for the missing amount; the form reveals the amount input for this case; validation uses the asset's precision-based minimum; handleConfirmedSubmit forwards asset_id plus the raw asset_amount (floored to int) to the node; ConfirmationModal renders the user-entered amount.
  • Added withdrawModal.main.info.assetAmountRequired and withdrawModal.details.lightning.assetAmountNotSpecified keys across en/de/es/fr/it/ja/zh.

Repro (before this fix)

Decoded invoice on Regtest:

{
  "amt_msat": 3000000,
  "asset_id": "rgb:6q1pZv_O-nav3uB~-RyXxrqO-245hsX~-u4BDAQU-Szl8NUQ",
  "asset_amount": null,
  "payment_hash": "84c3a05e...0225",
  "network": "Regtest"
}

The Withdraw modal hid the RGB asset details and offered no input for the asset amount, so the payment could not be sent.

Test plan

  • Paste an open-amount RGB Lightning invoice (asset_id set, asset_amount null) — asset section appears, amount field is shown, info banner asks for the asset amount.
  • Enter an asset amount within channel capacity → confirmation modal shows the entered asset amount, payment settles via /sendpayment with asset_id + asset_amount.
  • Paste a regular fixed-amount RGB Lightning invoice — behaviour unchanged (amount input stays hidden, asset amount comes from invoice).
  • Paste a plain BTC Lightning invoice (with and without amount) — behaviour unchanged.
  • pnpm type-check passes.

🤖 Generated with Claude Code

Lightning invoices specifying an asset_id but leaving asset_amount null
(open-amount RGB invoices) were misclassified as plain BTC invoices in
the Withdraw modal: the asset section was hidden, the amount input
never appeared, and sendPayment was invoked without asset_id /
asset_amount.

The Withdraw flow now keys the asset section in LightningInvoiceDetails
off asset_id alone (showing "Not specified by invoice" when the amount
is null), the form reveals the amount input for this case, validation
uses the asset's precision-based minimum, and handleConfirmedSubmit
forwards asset_id plus the raw asset_amount to the node so the payment
can settle. ConfirmationModal renders the user-entered amount.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant