From a4ca6910fa3899dcc994786037cbc262c7da4873 Mon Sep 17 00:00:00 2001 From: benarc Date: Wed, 3 Nov 2021 22:35:01 +0000 Subject: [PATCH] tidied spark --- lnbits/wallets/spark.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lnbits/wallets/spark.py b/lnbits/wallets/spark.py index a97ad310..1505c2eb 100644 --- a/lnbits/wallets/spark.py +++ b/lnbits/wallets/spark.py @@ -183,11 +183,13 @@ class SparkWallet(Wallet): raise KeyError("supplied an invalid checking_id") async def paid_invoices_stream(self) -> AsyncGenerator[str, None]: - url = self.url + "/stream?access-key=" + self.token + url = f"{self.url}/stream?access-key={self.token}" while True: try: - async with httpx.AsyncClient(timeout=None) as client: + async with httpx.AsyncClient( + timeout=None, headers=self.token + ) as client: async with client.stream("GET", url) as r: async for line in r.aiter_lines(): if line.startswith("data:"):