feat: Add Spark wallet support with Breez Nodeless SDK#841
feat: Add Spark wallet support with Breez Nodeless SDK#841aljazceru wants to merge 1 commit intocashubtc:mainfrom
Conversation
aljazceru
commented
Nov 28, 2025
- Adds SparkWallet backend
- Fixes docker-compose.yaml file to only default to fakewallet if the env variables are not present
|
nice one! |
| assert settings.mint_spark_api_key, "MINT_SPARK_API_KEY not set" | ||
| assert settings.mint_spark_mnemonic, "MINT_SPARK_MNEMONIC not set" | ||
|
|
||
| network_name = getattr(settings, "mint_spark_network", "mainnet").lower() |
There was a problem hiding this comment.
You have these defaults already defined in settings.py:
mint_spark_network: str = Field(default="mainnet")
mint_spark_storage_dir: str = Field(default="data/spark")
mint_spark_connection_timeout: int = Field(default=30)
mint_spark_retry_attempts: int = Field(default=3)
We should manage them in one place.
There was a problem hiding this comment.
ah yeah, good catch, i'll remove the duplicates
There was a problem hiding this comment.
@TheRealCheebs I've finally looked into this properly, technically its following patterns from other backends that have settings define in settings.py but actually validate the needed credentials in their respective files
nutshell/cashu/lightning/lndrest.py
Line 70 in a59f369
There was a problem hiding this comment.
I think those two are showing the pattern you have for the mint_spark_api_key and mint_spark_mnemonic; raising an exception or asserting when nothing is set. What I am calling out is you set defaults in settings.py for mint_spark_network, mint_spark_storage_dir,... , then you have defaults set again in the third parameter of getattr. The getattr defaults should be dropped as they are duplicates, and defaults should be managed in one place.
| - MINT_BACKEND_BOLT11_SAT=${MINT_BACKEND_BOLT11_SAT:-FakeWallet} | ||
| - MINT_LISTEN_HOST=${MINT_LISTEN_HOST:-0.0.0.0} | ||
| - MINT_LISTEN_PORT=${MINT_LISTEN_PORT:-3338} | ||
| - MINT_PRIVATE_KEY=${MINT_PRIVATE_KEY:-TEST_PRIVATE_KEY} |
There was a problem hiding this comment.
yeah kinda, it makes the docker file actually work properly (vars taken from .env with sane defaults). otherwise you either need docker-compose.override.yaml or you always have a diff of the file in the repo. so its an improvemen, but it should possibly be in a separate PR :)
| COPY . . | ||
| RUN poetry config virtualenvs.create false | ||
| RUN poetry install --no-dev --no-root | ||
|
|