fix: Add Breez SDK trampoline payments support (#2905)

* fix: add support for trampoline payments in Breez integration

- Introduced `BREEZ_USE_TRAMPOLINE` configuration in `.env.example`.
- Updated `BreezSdkFundingSource` to include `breez_use_trampoline` setting.
- Modified payment request in `breez.py` to utilize the trampoline setting when sending payments.

* Update .env.example

Co-authored-by: Pavol Rusnak <pavol@rusnak.io>

* Update lnbits/settings.py

Co-authored-by: Pavol Rusnak <pavol@rusnak.io>

* refactor: streamline payment request formatting in Breez integration

---------

Co-authored-by: Pavol Rusnak <pavol@rusnak.io>
This commit is contained in:
Tim Heide 2025-01-25 22:21:55 +01:00 committed by GitHub
parent cb5cc1e5e8
commit 8633891485
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 1 deletions

View file

@ -133,6 +133,8 @@ BREEZ_GREENLIGHT_SEED=SEED
BREEZ_GREENLIGHT_INVITE_CODE=CODE
BREEZ_GREENLIGHT_DEVICE_KEY="/path/to/breezsdk/device.pem" # or BASE64/HEXSTRING
BREEZ_GREENLIGHT_DEVICE_CERT="/path/to/breezsdk/device.crt" # or BASE64/HEXSTRING
# BREEZ_USE_TRAMPOLINE=true
######################################
####### Auth Configurations ##########

View file

@ -511,6 +511,7 @@ class BreezSdkFundingSource(LNbitsSettings):
breez_greenlight_invite_code: Optional[str] = Field(default=None)
breez_greenlight_device_key: Optional[str] = Field(default=None)
breez_greenlight_device_cert: Optional[str] = Field(default=None)
breez_use_trampoline: bool = Field(default=True)
class BoltzFundingSource(LNbitsSettings):

View file

@ -198,7 +198,9 @@ else:
invoice = lnbits_bolt11.decode(bolt11)
try:
send_payment_request = breez_sdk.SendPaymentRequest(bolt11=bolt11)
send_payment_request = breez_sdk.SendPaymentRequest(
bolt11=bolt11, use_trampoline=settings.breez_use_trampoline
)
send_payment_response: breez_sdk.SendPaymentResponse = (
self.sdk_services.send_payment(send_payment_request)
)