views and tasks
This commit is contained in:
parent
9503a909eb
commit
7265199139
5 changed files with 90 additions and 71 deletions
18
models.py
18
models.py
|
|
@ -5,7 +5,7 @@ from sqlite3 import Row
|
|||
from typing import Any, Dict, List, Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from .nwcp import NWCServiceProvider
|
||||
|
||||
class NWCKey(BaseModel):
|
||||
pubkey: str
|
||||
|
|
@ -32,7 +32,11 @@ class GetNWCKey(BaseModel):
|
|||
include_expired: Optional[bool] = False
|
||||
refresh_last_used: Optional[bool] = False
|
||||
|
||||
class GetWalletNWCKey(BaseModel):
|
||||
class GetNWCs(BaseModel):
|
||||
include_expired: bool = False
|
||||
calculate_spent_budget: bool = False
|
||||
|
||||
class GetWalletNWC(BaseModel):
|
||||
wallet_id: Optional[str] = None
|
||||
include_expired: Optional[bool] = False
|
||||
|
||||
|
|
@ -46,7 +50,12 @@ class TrackedSpendNWC(BaseModel):
|
|||
|
||||
class DeleteNWC(BaseModel):
|
||||
pubkey: str
|
||||
wallet_id: str
|
||||
wallet_id: Optional[str] = None
|
||||
|
||||
class OnInvoicePaid(BaseModel):
|
||||
sp: NWCServiceProvider
|
||||
pubkey: str
|
||||
payload: Dict
|
||||
|
||||
class NWCBudget(BaseModel):
|
||||
id: int
|
||||
|
|
@ -96,6 +105,9 @@ class NWCRegistrationRequest(BaseModel):
|
|||
expires_at: int
|
||||
budgets: List[NWCNewBudget]
|
||||
|
||||
class RegisterNWC(BaseModel):
|
||||
pubkey: str
|
||||
registration_data: NWCRegistrationRequest
|
||||
|
||||
class NWCGetResponse(BaseModel):
|
||||
data: NWCKey
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue