mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-20 10:34:20 +01:00
cashu pypi
This commit is contained in:
11
core/db.py
11
core/db.py
@@ -128,10 +128,13 @@ class Database(Compat):
|
|||||||
database_uri = f"sqlite:///{self.path}"
|
database_uri = f"sqlite:///{self.path}"
|
||||||
self.type = SQLITE
|
self.type = SQLITE
|
||||||
else:
|
else:
|
||||||
raise NotADirectoryError(
|
print(f"Creating database directory: {self.db_location}")
|
||||||
f"db_location named {self.db_location} was not created"
|
if not os.path.exists(self.db_location):
|
||||||
f" - please 'mkdir {self.db_location}' and try again"
|
os.makedirs(self.db_location)
|
||||||
)
|
# raise NotADirectoryError(
|
||||||
|
# f"db_location named {self.db_location} was not created"
|
||||||
|
# f" - please 'mkdir {self.db_location}' and try again"
|
||||||
|
# )
|
||||||
self.schema = self.name
|
self.schema = self.name
|
||||||
if self.name.startswith("ext_"):
|
if self.name.startswith("ext_"):
|
||||||
self.schema = self.name[4:]
|
self.schema = self.name[4:]
|
||||||
|
|||||||
@@ -9,12 +9,12 @@ LIGHTNING_FEE_PERCENT = env.float("LIGHTNING_FEE_PERCENT", default=1.0)
|
|||||||
assert LIGHTNING_FEE_PERCENT >= 0, "LIGHTNING_FEE_PERCENT must be at least 0"
|
assert LIGHTNING_FEE_PERCENT >= 0, "LIGHTNING_FEE_PERCENT must be at least 0"
|
||||||
LIGHTNING_RESERVE_FEE_MIN = env.float("LIGHTNING_RESERVE_FEE_MIN", default=4000)
|
LIGHTNING_RESERVE_FEE_MIN = env.float("LIGHTNING_RESERVE_FEE_MIN", default=4000)
|
||||||
|
|
||||||
MINT_PRIVATE_KEY = env.str("MINT_PRIVATE_KEY")
|
MINT_PRIVATE_KEY = env.str("MINT_PRIVATE_KEY", default=None)
|
||||||
|
|
||||||
MINT_SERVER_HOST = env.str("MINT_SERVER_HOST", default="127.0.0.1")
|
MINT_SERVER_HOST = env.str("MINT_SERVER_HOST", default="127.0.0.1")
|
||||||
MINT_SERVER_PORT = env.int("MINT_SERVER_PORT", default=3338)
|
MINT_SERVER_PORT = env.int("MINT_SERVER_PORT", default=3338)
|
||||||
|
|
||||||
MINT_HOST = env.str("MINT_HOST", default="127.0.0.1")
|
MINT_HOST = env.str("MINT_HOST", default="8333.space")
|
||||||
MINT_PORT = env.int("MINT_PORT", default=3338)
|
MINT_PORT = env.int("MINT_PORT", default=3338)
|
||||||
|
|
||||||
if MINT_HOST in ["localhost", "127.0.0.1"]:
|
if MINT_HOST in ["localhost", "127.0.0.1"]:
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ authors = ["calle <callebtc@protonmail.com>"]
|
|||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = "^3.8"
|
python = "^3.7"
|
||||||
requests = "2.27.1"
|
requests = "2.27.1"
|
||||||
pytest-asyncio = "0.19.0"
|
pytest-asyncio = "0.19.0"
|
||||||
SQLAlchemy = "1.3.24"
|
SQLAlchemy = "1.3.24"
|
||||||
|
|||||||
49
requirements.txt
Normal file
49
requirements.txt
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
anyio==3.6.1 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
asgiref==3.5.2 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
attrs==22.1.0 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
bech32==1.2.0 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
bitstring==3.1.9 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
certifi==2022.9.14 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
cffi==1.15.1 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
charset-normalizer==2.0.12 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
click==8.0.4 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
colorama==0.4.5 ; python_version >= "3.7" and python_version < "4.0" and platform_system == "Windows" or python_version >= "3.7" and python_version < "4.0" and sys_platform == "win32"
|
||||||
|
ecdsa==0.18.0 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
environs==9.5.0 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
fastapi==0.83.0 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
flask==2.2.2 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
h11==0.13.0 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
idna==3.3 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
importlib-metadata==4.12.0 ; python_version >= "3.7" and python_version < "3.10"
|
||||||
|
iniconfig==1.1.1 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
itsdangerous==2.1.1 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
jinja2==3.0.3 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
loguru==0.6.0 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
markupsafe==2.1.1 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
marshmallow==3.18.0 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
outcome==1.2.0 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
packaging==21.3 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
pluggy==1.0.0 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
psycopg2-binary==2.9.3 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
py==1.11.0 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
pycparser==2.21 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
pydantic==1.10.2 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
pyparsing==3.0.9 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
pytest-asyncio==0.19.0 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
pytest==7.1.3 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
python-dotenv==0.21.0 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
represent==1.6.0.post0 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
requests==2.27.1 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
secp256k1==0.14.0 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
six==1.16.0 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
sniffio==1.3.0 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
sqlalchemy-aio==0.17.0 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
sqlalchemy==1.3.24 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
starlette==0.19.1 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
tomli==2.0.1 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
typing-extensions==4.3.0 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
urllib3==1.26.12 ; python_version >= "3.7" and python_version < "4"
|
||||||
|
uvicorn==0.18.3 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
werkzeug==2.2.2 ; python_version >= "3.7" and python_version < "4.0"
|
||||||
|
win32-setctime==1.1.0 ; python_version >= "3.7" and python_version < "4.0" and sys_platform == "win32"
|
||||||
|
zipp==3.8.1 ; python_version >= "3.7" and python_version < "3.10"
|
||||||
34
setup.py
Normal file
34
setup.py
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
import setuptools
|
||||||
|
|
||||||
|
from os import path
|
||||||
|
|
||||||
|
this_directory = path.abspath(path.dirname(__file__))
|
||||||
|
with open(path.join(this_directory, "README.md"), encoding="utf-8") as f:
|
||||||
|
long_description = f.read()
|
||||||
|
|
||||||
|
with open("requirements.txt") as f:
|
||||||
|
requirements = f.read().splitlines()
|
||||||
|
|
||||||
|
entry_points = {"console_scripts": ["cashu = wallet.cashu:cli"]}
|
||||||
|
|
||||||
|
setuptools.setup(
|
||||||
|
name="cashu",
|
||||||
|
version="0.1.3",
|
||||||
|
description="Ecash wallet and mint with Bitcoin Lightning support",
|
||||||
|
long_description=long_description,
|
||||||
|
long_description_content_type="text/markdown",
|
||||||
|
url="https://github.com/callebtc/cashu",
|
||||||
|
author="Calle",
|
||||||
|
author_email="calle@protonmail.com",
|
||||||
|
license="MIT",
|
||||||
|
packages=setuptools.find_packages(),
|
||||||
|
classifiers=[
|
||||||
|
"Programming Language :: Python :: 3",
|
||||||
|
"License :: OSI Approved :: MIT License",
|
||||||
|
"Operating System :: OS Independent",
|
||||||
|
],
|
||||||
|
python_requires=">=3.7",
|
||||||
|
install_requires=requirements,
|
||||||
|
include_package_data=True,
|
||||||
|
entry_points=entry_points,
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user