change settings in wallets

This commit is contained in:
dni ⚡
2022-10-05 13:05:11 +02:00
parent bf566c5a26
commit ad81bb322a
10 changed files with 50 additions and 48 deletions
+6 -5
View File
@@ -1,12 +1,13 @@
import asyncio
import hashlib
import json
from os import getenv
from typing import AsyncGenerator, Dict, Optional
import httpx
from loguru import logger
from lnbits.settings import settings
from .base import (
InvoiceResponse,
PaymentResponse,
@@ -20,13 +21,13 @@ class LntxbotWallet(Wallet):
"""https://github.com/fiatjaf/lntxbot/blob/master/api.go"""
def __init__(self):
endpoint = getenv("LNTXBOT_API_ENDPOINT")
endpoint = settings.lntxbot_api_endpoint
self.endpoint = endpoint[:-1] if endpoint.endswith("/") else endpoint
key = (
getenv("LNTXBOT_KEY")
or getenv("LNTXBOT_ADMIN_KEY")
or getenv("LNTXBOT_INVOICE_KEY")
settings.lntxbot_key
or settings.lntxbot_admin_key
or settings.lntxbot_invoice_key
)
self.auth = {"Authorization": f"Basic {key}"}