Browse Source

Update opennode.py

fee_issues
Arc 5 years ago
committed by GitHub
parent
commit
364ab472d2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      lnbits/wallets/opennode.py

10
lnbits/wallets/opennode.py

@ -1,6 +1,6 @@
from requests import Response, get, post
from flask import jsonify
from .base import InvoiceResponse, TxStatus, Wallet
from .base import InvoiceResponse, TxStatus, Wallet, PaymentResponse
import json
class OpenNodeWallet(Wallet):
@ -24,11 +24,11 @@ class OpenNodeWallet(Wallet):
return InvoiceResponse(r, payment_hash, payment_request)
def pay_invoice(self, bolt11: str) -> Response:
return post(
url=f"{self.endpoint}/v2/withdrawals", headers=self.auth_admin, json={"type": "ln", "address": bolt11}
)
def pay_invoice(self, bolt11: str) -> PaymentResponse:
r = post(url=f"{self.endpoint}/v2/withdrawals", headers=self.auth_admin, json={"type": "ln","address": bolt11})
return PaymentResponse(r)
def get_invoice_status(self, payment_hash: str) -> TxStatus:

Loading…
Cancel
Save