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

8
helpers.py Normal file
View file

@ -0,0 +1,8 @@
from .nostr.key import PrivateKey
def parse_nostr_private_key(key: str) -> PrivateKey:
if key.startswith("nsec"):
return PrivateKey.from_nsec(key)
else:
return PrivateKey(bytes.fromhex(key))