feat(lightning): add USD (Stablesats) support for Blink backend#869
Open
Forte11Cuba wants to merge 7 commits intocashubtc:mainfrom
Open
feat(lightning): add USD (Stablesats) support for Blink backend#869Forte11Cuba wants to merge 7 commits intocashubtc:mainfrom
Forte11Cuba wants to merge 7 commits intocashubtc:mainfrom
Conversation
Forte11Cuba
commented
Jan 16, 2026
- Add Unit.usd to supported_units in BlinkWallet
- Implement USD invoice creation via lnUsdInvoiceCreateOnBehalfOfRecipient
- Implement USD fee probe via lnUsdInvoiceFeeProbe
- Add sats to cents conversion using currencyConversionEstimation API
- Update pay_invoice and get_payment_status to use correct wallet
- Add comprehensive tests for USD operations
- Add Unit.usd to supported_units in BlinkWallet - Implement USD invoice creation via lnUsdInvoiceCreateOnBehalfOfRecipient - Implement USD fee probe via lnUsdInvoiceFeeProbe - Add sats to cents conversion using currencyConversionEstimation API - Update pay_invoice and get_payment_status to use correct wallet - Add comprehensive tests for USD operations
- Change unit verification order to check BTC (sat/msat) before USD - Use explicit if/elif/else pattern instead of if/else - Add exception handling for unsupported units - Follow Strike backend pattern for consistency - Improves performance by checking most common case first
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #869 +/- ##
===========================================
- Coverage 64.71% 49.46% -15.25%
===========================================
Files 91 89 -2
Lines 10900 10619 -281
===========================================
- Hits 7054 5253 -1801
- Misses 3846 5366 +1520 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
backend - Remove invalid type: ignore comments (cents/sats) in blink.py lines 113, 117 - Add type: ignore to _get_sats_per_usd post call (line 492) - Fix PRICE_RESPONSE mock to use currencyConversionEstimation instead of realtimePrice
… in Blink backend
a1denvalu3
reviewed
Feb 4, 2026
Collaborator
|
Can we use the |
KvngMikey
reviewed
Feb 10, 2026
| self.wallet_ids[Unit.sat] = wallet_dict["id"] # type: ignore | ||
| balance = wallet_dict["balance"] # type: ignore | ||
| if self.unit == Unit.sat or self.unit == Unit.msat: | ||
| balance = wallet_dict["balance"] # type: ignore |
Contributor
There was a problem hiding this comment.
this does the same thing as line 113, why don't we just merge the conditions or do we intend to handle USD balances differently in the future?
KvngMikey
reviewed
Feb 10, 2026
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.