Skip to content
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ data
.vscode
dump
.venv
.claude
1 change: 1 addition & 0 deletions crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ async def create_nwc(data: CreateNWCKey) -> NWCKey:
permissions=" ".join(data.permissions),
created_at=int(time.time()),
last_used=int(time.time()),
lud16=data.lud16,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should add some validation for lud16

)
await db.insert("nwcprovider.keys", nwckey_entry)
if data.budgets:
Expand Down
7 changes: 7 additions & 0 deletions migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,10 @@ async def m006_default_config3(db):
""",
{"value": "0"},
)


async def m007_add_lud16(db):
"""
Add lud16 column to keys table for lightning address support
"""
await db.execute("ALTER TABLE nwcprovider.keys ADD COLUMN lud16 TEXT")
10 changes: 10 additions & 0 deletions models.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class NWCKey(BaseModel):
permissions: str
created_at: int
last_used: int
lud16: str | None = None

def get_permissions(self) -> list[str]:
try:
Expand Down Expand Up @@ -67,6 +68,7 @@ class CreateNWCKey(BaseModel):
expires_at: int
permissions: list[str]
budgets: list[NWCNewBudget] | None = None
lud16: str | None = None


class DeleteNWC(BaseModel):
Expand Down Expand Up @@ -102,13 +104,21 @@ class NWCRegistrationRequest(BaseModel):
description: str
expires_at: int
budgets: list[NWCNewBudget]
lud16: str | None = None


class NWCGetResponse(BaseModel):
data: NWCKey
budgets: list[NWCBudget]


class NWCGetAllResponse(BaseModel):
data: NWCKey
budgets: list[NWCBudget]
wallet_id: str
wallet_name: str


class NWCConfig(BaseModel):
key: str
value: str
4,072 changes: 0 additions & 4,072 deletions poetry.lock

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/image/NWC_Banner_Extension.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion static/js/admin.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
window.app = Vue.createApp({
el: '#vue',
mixins: [windowMixin],
delimiters: ['${', '}'],
data: function () {
return {
config: {},
Expand Down
Loading
Loading