mirror of
https://github.com/lnbits/lnbits.git
synced 2025-10-11 04:52:34 +02:00
Merge pull request #390 from arcbtc/FastAPI
restored create invoice api endpoint
This commit is contained in:
@@ -122,11 +122,12 @@ class CLightningWallet(Wallet):
|
|||||||
call = json.dumps(
|
call = json.dumps(
|
||||||
{"method": "waitanyinvoice", "id": 0, "params": [self.last_pay_index]}
|
{"method": "waitanyinvoice", "id": 0, "params": [self.last_pay_index]}
|
||||||
)
|
)
|
||||||
writer.write(call.encode("utf-8"))
|
writer.write(call.encode())
|
||||||
await writer.drain()
|
await writer.drain()
|
||||||
|
|
||||||
data = await reader.read(100)
|
data = await reader.read(500)
|
||||||
paid = json.loads(data.decode("ascii"))
|
paid = json.loads(data.decode("ascii"))
|
||||||
|
print(paid)
|
||||||
|
|
||||||
paid = self.ln.waitanyinvoice(self.last_pay_index)
|
paid = self.ln.waitanyinvoice(self.last_pay_index)
|
||||||
self.last_pay_index = paid["pay_index"]
|
self.last_pay_index = paid["pay_index"]
|
||||||
|
Reference in New Issue
Block a user