fix: support paying RGB Lightning invoices with open asset amount#107
Open
bitwalt wants to merge 1 commit into
Open
fix: support paying RGB Lightning invoices with open asset amount#107bitwalt wants to merge 1 commit into
bitwalt wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
asset_idbut leaveasset_amountnull (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, andsendPaymentwas called withoutasset_id/asset_amount, so the payment could not settle.LightningInvoiceDetailsoffasset_idalone 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;handleConfirmedSubmitforwardsasset_idplus the rawasset_amount(floored to int) to the node;ConfirmationModalrenders the user-entered amount.withdrawModal.main.info.assetAmountRequiredandwithdrawModal.details.lightning.assetAmountNotSpecifiedkeys 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
asset_idset,asset_amountnull) — asset section appears, amount field is shown, info banner asks for the asset amount./sendpaymentwithasset_id+asset_amount.pnpm type-checkpasses.🤖 Generated with Claude Code