mirror of
https://github.com/aljazceru/nutshell.git
synced 2026-02-20 08:04:21 +01:00
pending
This commit is contained in:
@@ -9,6 +9,7 @@ class Proof(BaseModel):
|
||||
C: str
|
||||
secret: str
|
||||
reserved: bool = False # whether this proof is reserved for sending
|
||||
send_id: str = "" # unique ID of send attempt
|
||||
|
||||
@classmethod
|
||||
def from_row(cls, row: Row):
|
||||
@@ -17,6 +18,7 @@ class Proof(BaseModel):
|
||||
C=row[1],
|
||||
secret=row[2],
|
||||
reserved=row[3] or False,
|
||||
send_id=row[4] or "",
|
||||
)
|
||||
|
||||
@classmethod
|
||||
@@ -26,6 +28,7 @@ class Proof(BaseModel):
|
||||
C=d["C"],
|
||||
secret=d["secret"],
|
||||
reserved=d["reserved"] or False,
|
||||
send_id=d["send_id"] or "",
|
||||
)
|
||||
|
||||
def __getitem__(self, key):
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
from pathlib import Path
|
||||
|
||||
from environs import Env # type: ignore
|
||||
|
||||
env = Env()
|
||||
env.read_env()
|
||||
|
||||
DEBUG = env.bool("DEBUG", default=False)
|
||||
CASHU_DIR = env.str("CASHU_DIR", default="~/.cashu")
|
||||
CASHU_DIR = CASHU_DIR.replace("~", str(Path.home()))
|
||||
assert len(CASHU_DIR), "CASHU_DIR not defined"
|
||||
|
||||
LIGHTNING = env.bool("LIGHTNING", default=True)
|
||||
LIGHTNING_FEE_PERCENT = env.float("LIGHTNING_FEE_PERCENT", default=1.0)
|
||||
assert LIGHTNING_FEE_PERCENT >= 0, "LIGHTNING_FEE_PERCENT must be at least 0"
|
||||
|
||||
Reference in New Issue
Block a user