Add relay
@@ -104,17 +115,21 @@
Nostrclient Extension
This extension is a always-on nostr client that other extensions can
- use to send and receive events on nostr.
-
- Add multiple nostr relays to connect to. The extension then opens a websocket for you to use
- at
-
-
-
-
- Only Admin users can manage
- this extension.
+ use to send and receive events on nostr. Add multiple nostr relays to
+ connect to. The extension then opens a websocket for you to use at
+
+
+
+
+
+ Only Admin users can manage this extension.
+
@@ -217,7 +232,7 @@
message: `Invalid relay URL.`,
caption: "Should start with 'wss://'' or 'ws://'"
})
- return false;
+ return false
}
console.log('ADD RELAY ' + this.relayToAdd)
let that = this
@@ -229,7 +244,7 @@
{url: this.relayToAdd}
)
.then(function (response) {
- console.log("response:", response)
+ console.log('response:', response)
if (response.data) {
response.data.map(maplrelays)
that.nostrrelayLinks = response.data
@@ -239,7 +254,7 @@
.catch(function (error) {
LNbits.utils.notifyApiError(error)
})
- return false;
+ return false
},
deleteRelay(url) {
console.log('DELETE RELAY ' + url)
diff --git a/views.py b/views.py
index ce30b3b..a05f956 100644
--- a/views.py
+++ b/views.py
@@ -6,11 +6,12 @@ from fastapi import Request
from fastapi.param_functions import Query
from fastapi.params import Depends
from fastapi.templating import Jinja2Templates
+from starlette.responses import HTMLResponse
+
from lnbits.core.crud import update_payment_status
from lnbits.core.models import User
from lnbits.core.views.api import api_payment
from lnbits.decorators import check_admin, check_user_exists
-from starlette.responses import HTMLResponse
from . import nostr_renderer, nostrclient_ext
diff --git a/views_api.py b/views_api.py
index c3da200..15cc3ab 100644
--- a/views_api.py
+++ b/views_api.py
@@ -3,11 +3,12 @@ from http import HTTPStatus
from typing import Optional
from fastapi import Depends, WebSocket
-from lnbits.decorators import check_admin
-from lnbits.helpers import urlsafe_short_hash
from loguru import logger
from starlette.exceptions import HTTPException
+from lnbits.decorators import check_admin
+from lnbits.helpers import urlsafe_short_hash
+
from . import nostrclient_ext
from .crud import add_relay, delete_relay, get_relays
from .models import Relay, RelayList