Mint: Fakewallet support for USD (#488)

* fakewallet usd wip

* FakeWallet support for USD

* fix api return for receive

* use MINT_BACKEND_BOLT11_SAT everywhere
This commit is contained in:
callebtc
2024-03-22 12:11:40 +01:00
committed by GitHub
parent f4621345f3
commit 3ba1e81fcb
21 changed files with 168 additions and 93 deletions

View File

@@ -36,7 +36,6 @@ class BlinkWallet(LightningBackend):
Create API Key at: https://dashboard.blink.sv/
"""
units = set([Unit.sat, Unit.usd])
wallet_ids: Dict[Unit, str] = {}
endpoint = "https://api.blink.sv/graphql"
invoice_statuses = {"PENDING": None, "PAID": True, "EXPIRED": False}
@@ -47,7 +46,12 @@ class BlinkWallet(LightningBackend):
}
payment_statuses = {"SUCCESS": True, "PENDING": None, "FAILURE": False}
def __init__(self):
supported_units = set([Unit.sat, Unit.msat])
unit = Unit.sat
def __init__(self, unit: Unit = Unit.sat, **kwargs):
self.assert_unit_supported(unit)
self.unit = unit
assert settings.mint_blink_key, "MINT_BLINK_KEY not set"
self.client = httpx.AsyncClient(
verify=not settings.debug,
@@ -297,7 +301,7 @@ class BlinkWallet(LightningBackend):
... on SettlementViaLn {
preImage
}
}
}
}
}
}