Update opennode.py

This commit is contained in:
Arc
2020-01-16 12:37:33 +00:00
committed by GitHub
parent 883e826aa4
commit 364ab472d2

View File

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