feat: add extension-settings instead of environs (#28)

* feat: add extension-settings instead of environs
This commit is contained in:
dni ⚡ 2023-11-22 11:40:22 +01:00 committed by GitHub
commit f2e419e18d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 230 additions and 130 deletions

View file

@ -10,6 +10,21 @@ from pydantic import BaseModel
from lnbits.lnurl import encode as lnurl_encode
from .helpers import parse_nostr_private_key
from .nostr.key import PrivateKey
class LnurlpSettings(BaseModel):
nostr_private_key: str
@property
def private_key(self) -> PrivateKey:
return parse_nostr_private_key(self.nostr_private_key)
@property
def public_key(self) -> str:
return self.private_key.public_key.hex()
class CreatePayLinkData(BaseModel):
description: str