Compare commits

...

3 commits

Author SHA1 Message Date
Vlad Stan
801ce44561 chore: clean&bump version
Some checks failed
CI / lint (push) Has been cancelled
CI / tests (push) Has been cancelled
/ release (push) Has been cancelled
/ pullrequest (push) Has been cancelled
2025-12-11 17:41:07 +02:00
Ben Weeks
507003ac20
Add extension metadata and screenshots for LNbits UI (#46)
* Add extension metadata and screenshots for LNbits UI

- Update description.md with comprehensive explanation of relay multiplexer
- Add screenshots array to config.json pointing to 1.jpeg and 2.jpeg
- Change short_description to "Nostr relay multiplexer" for clarity
- Create extensions.json with nostrclient-dev entries for testing
- Add CLAUDE.md for future Claude Code instances

Fixes #41

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Change extension name to 'Nostr Client Dev'

Rename extension from 'Nostr Client' to 'Nostr Client Dev' to distinguish from the official extension.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* FIX: Ensure valid json

Wrap extensions array in object with "featured" and "extensions" keys to match LNbits Manifest format. This fixes the "1 validation error for Manifest" issue.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Update config.json format for LNbits UI display

- Change name to "Nostr Client Dev" to match extensions.json
- Replace "screenshots" with "images" array using proper format
- Add "description_md" URL for full description display

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Crop screenshot 1 to match height of screenshot 2

Crop bottom of 1.jpeg to make both screenshots the same height (1557px) for consistent display in LNbits UI.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Remove headings from description.md

Remove markdown headings for cleaner display in LNbits extension UI.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Change name back to 'Nostr Client' in config.json

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Delete CLAUDE.md

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com>
2025-12-11 17:38:34 +02:00
Vlad Stan
5a078f2bfc
fix: fetch wallets for admin (#51)
Some checks failed
/ release (push) Has been cancelled
/ pullrequest (push) Has been cancelled
2025-12-11 17:32:22 +02:00
6 changed files with 33 additions and 26 deletions

View file

@ -1,8 +1,17 @@
{
"name": "Nostr Client",
"short_description": "Nostr relay multiplexer",
"version": "1.1.0",
"short_description": "Nostr client for extensions",
"tile": "/nostrclient/static/images/nostr-bitcoin.png",
"contributors": ["calle", "motorina0", "dni"],
"min_lnbits_version": "1.0.0"
"min_lnbits_version": "1.4.0",
"images": [
{
"uri": "https://raw.githubusercontent.com/lnbits/nostrclient/add-extension-metadata/static/images/1.jpeg"
},
{
"uri": "https://raw.githubusercontent.com/lnbits/nostrclient/add-extension-metadata/static/images/2.jpeg"
}
],
"description_md": "https://raw.githubusercontent.com/lnbits/nostrclient/add-extension-metadata/description.md"
}

View file

@ -1 +1,8 @@
An always-on extension that can open multiple connections to nostr relays and act as a multiplexer for other clients: You open a single websocket to nostrclient which then sends the data to multiple relays. The responses from these relays are then sent back to the client.
An always-on relay multiplexer that simplifies connecting to multiple Nostr relays.
Instead of your Nostr client managing connections to dozens of relays, you connect to a single WebSocket endpoint provided by `nostrclient`, which then fans out your requests to all configured relays and aggregates the responses back to you.
- **Simplified Client Configuration** - Connect to one endpoint instead of managing multiple relay connections
- **Always-On Connectivity** - Your LNbits instance maintains persistent connections to relays
- **Resource Efficient** - Share relay connections across multiple clients
- **Automatic Subscription Management** - Subscription ID rewriting prevents conflicts between clients

BIN
static/images/1.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 KiB

BIN
static/images/2.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 KiB

View file

@ -476,11 +476,7 @@
getRelays: function () {
var self = this
LNbits.api
.request(
'GET',
'/nostrclient/api/v1/relays?usr=' + this.g.user.id,
this.g.user.wallets[0].adminkey
)
.request('GET', '/nostrclient/api/v1/relays')
.then(function (response) {
if (response.data) {
response.data.map(maplrelays)
@ -508,12 +504,9 @@
console.log('ADD RELAY ' + this.relayToAdd)
let that = this
LNbits.api
.request(
'POST',
'/nostrclient/api/v1/relay?usr=' + this.g.user.id,
this.g.user.wallets[0].adminkey,
{url: this.relayToAdd}
)
.request('POST', '/nostrclient/api/v1/relay', null, {
url: this.relayToAdd
})
.then(function (response) {
console.log('response:', response)
if (response.data) {
@ -540,12 +533,7 @@
},
deleteRelay(url) {
LNbits.api
.request(
'DELETE',
'/nostrclient/api/v1/relay?usr=' + this.g.user.id,
this.g.user.wallets[0].adminkey,
{url: url}
)
.request('DELETE', '/nostrclient/api/v1/relay', null, {url: url})
.then(response => {
const relayIndex = this.nostrrelayLinks.indexOf(r => r.url === url)
if (relayIndex !== -1) {
@ -561,8 +549,7 @@
try {
const {data} = await LNbits.api.request(
'GET',
'/nostrclient/api/v1/config',
this.g.user.wallets[0].adminkey
'/nostrclient/api/v1/config'
)
this.config.data = data
} catch (error) {
@ -574,7 +561,7 @@
const {data} = await LNbits.api.request(
'PUT',
'/nostrclient/api/v1/config',
this.g.user.wallets[0].adminkey,
null,
this.config.data
)
this.config.data = data
@ -623,7 +610,7 @@
const {data} = await LNbits.api.request(
'PUT',
'/nostrclient/api/v1/relay/test',
this.g.user.wallets[0].adminkey,
null,
{
sender_private_key: this.testData.senderPrivateKey,
reciever_public_key: this.testData.recieverPublicKey,

View file

@ -1,6 +1,7 @@
from fastapi import APIRouter, Depends, Request
from fastapi.responses import HTMLResponse
from lnbits.core.models import User
from lnbits.core.crud.users import get_user_from_account
from lnbits.core.models.users import Account
from lnbits.decorators import check_admin
from lnbits.helpers import template_renderer
@ -12,7 +13,10 @@ def nostr_renderer():
@nostrclient_generic_router.get("/", response_class=HTMLResponse)
async def index(request: Request, user: User = Depends(check_admin)):
async def index(request: Request, account: Account = Depends(check_admin)):
user = await get_user_from_account(account)
if not user:
return HTMLResponse("No user found", status_code=404)
return nostr_renderer().TemplateResponse(
"nostrclient/index.html", {"request": request, "user": user.json()}
)