From 651b51129305ab401dc00d73595808c80ecc1a68 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Wed, 19 Nov 2025 12:48:52 +0100 Subject: [PATCH] handle USDT fees (#829) --- cashu/lightning/strike.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cashu/lightning/strike.py b/cashu/lightning/strike.py index 3745e3e..72f91e8 100644 --- a/cashu/lightning/strike.py +++ b/cashu/lightning/strike.py @@ -99,6 +99,7 @@ class StrikeWallet(LightningBackend): unit: Unit, ) -> int: fee_str = strike_quote.totalFee.amount + fee: int = 0 if strike_quote.totalFee.currency == self.currency_map[Unit.sat]: if unit == Unit.sat: fee = int(float(fee_str) * 1e8) @@ -107,8 +108,13 @@ class StrikeWallet(LightningBackend): elif strike_quote.totalFee.currency in [ self.currency_map[Unit.usd], self.currency_map[Unit.eur], + USDT, ]: fee = int(float(fee_str) * 100) + else: + raise Exception( + f"Unexpected currency {strike_quote.totalFee.currency} in fee" + ) return fee def __init__(self, unit: Unit, **kwargs): @@ -154,7 +160,7 @@ class StrikeWallet(LightningBackend): balance=Amount.from_float(float(balance["total"]), self.unit), ) - # if no the unit is USD but no USD balance was found, we try USDT + # if the unit is USD but no USD balance was found, we try USDT if self.unit == Unit.usd: for balance in data: if balance["currency"] == USDT: