mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-20 02:24:20 +01:00
bumop to 0.8
This commit is contained in:
@@ -115,7 +115,7 @@ cashu info
|
|||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
```bash
|
```bash
|
||||||
Version: 0.7.0
|
Version: 0.8
|
||||||
Debug: False
|
Debug: False
|
||||||
Cashu dir: /home/user/.cashu
|
Cashu dir: /home/user/.cashu
|
||||||
Wallet: wallet
|
Wallet: wallet
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class P2SHScript(BaseModel):
|
|||||||
class Proof(BaseModel):
|
class Proof(BaseModel):
|
||||||
id: Union[
|
id: Union[
|
||||||
None, str
|
None, str
|
||||||
] = "" # NOTE: None for backwards compatibility of old clients < 0.3
|
] = "" # NOTE: None for backwards compatibility for old clients that do not include the keyset id < 0.3
|
||||||
amount: int = 0
|
amount: int = 0
|
||||||
secret: str = ""
|
secret: str = ""
|
||||||
C: str = ""
|
C: str = ""
|
||||||
@@ -78,7 +78,7 @@ class BlindedMessages(BaseModel):
|
|||||||
|
|
||||||
|
|
||||||
class PostMintResponseLegacy(BaseModel):
|
class PostMintResponseLegacy(BaseModel):
|
||||||
# NOTE: Backwards compability for < 0.7.1 where we used a simple list and not a key-value dictionary
|
# NOTE: Backwards compability for < 0.8 where we used a simple list and not a key-value dictionary
|
||||||
__root__: List[BlindedSignature] = []
|
__root__: List[BlindedSignature] = []
|
||||||
|
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ class SplitRequest(BaseModel):
|
|||||||
amount: int
|
amount: int
|
||||||
output_data: Union[
|
output_data: Union[
|
||||||
BlindedMessages, None
|
BlindedMessages, None
|
||||||
] = None # backwards compatibility with clients < v0.2.2
|
] = None # backwards compatibility with clients that called this output_data and not outputs < v0.2.2
|
||||||
outputs: Union[BlindedMessages, None] = None
|
outputs: Union[BlindedMessages, None] = None
|
||||||
|
|
||||||
def __init__(self, **data):
|
def __init__(self, **data):
|
||||||
|
|||||||
@@ -57,4 +57,4 @@ NOSTR_PRIVATE_KEY = env.str("NOSTR_PRIVATE_KEY", default=None)
|
|||||||
NOSTR_RELAYS = env.list("NOSTR_RELAYS", default=["wss://nostr-pub.wellorder.net"])
|
NOSTR_RELAYS = env.list("NOSTR_RELAYS", default=["wss://nostr-pub.wellorder.net"])
|
||||||
|
|
||||||
MAX_ORDER = 64
|
MAX_ORDER = 64
|
||||||
VERSION = "0.7.0"
|
VERSION = "0.8"
|
||||||
|
|||||||
@@ -262,12 +262,15 @@ class LedgerAPI:
|
|||||||
reponse_dict = resp.json()
|
reponse_dict = resp.json()
|
||||||
self.raise_on_error(reponse_dict)
|
self.raise_on_error(reponse_dict)
|
||||||
try:
|
try:
|
||||||
# backwards compatibility: parse promises < 0.7.1 with no "promises" field
|
# backwards compatibility: parse promises < 0.8 with no "promises" field
|
||||||
promises = PostMintResponseLegacy.parse_obj(reponse_dict)
|
promises = PostMintResponseLegacy.parse_obj(reponse_dict).__root__
|
||||||
return self._construct_proofs(promises, secrets, rs)
|
logger.warning(
|
||||||
|
"Parsing token with no promises field. Please upgrade mint to 0.8"
|
||||||
|
)
|
||||||
except:
|
except:
|
||||||
promises = PostMintResponse.parse_obj(reponse_dict)
|
promises = PostMintResponse.parse_obj(reponse_dict).promises
|
||||||
return self._construct_proofs(promises.promises, secrets, rs)
|
|
||||||
|
return self._construct_proofs(promises, secrets, rs)
|
||||||
|
|
||||||
async def split(self, proofs, amount, scnd_secret: Optional[str] = None):
|
async def split(self, proofs, amount, scnd_secret: Optional[str] = None):
|
||||||
"""Consume proofs and create new promises based on amount split.
|
"""Consume proofs and create new promises based on amount split.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "cashu"
|
name = "cashu"
|
||||||
version = "0.7.0"
|
version = "0.8"
|
||||||
description = "Ecash wallet and mint."
|
description = "Ecash wallet and mint."
|
||||||
authors = ["calle <callebtc@protonmail.com>"]
|
authors = ["calle <callebtc@protonmail.com>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|||||||
2
setup.py
2
setup.py
@@ -13,7 +13,7 @@ entry_points = {"console_scripts": ["cashu = cashu.wallet.cli:cli"]}
|
|||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name="cashu",
|
name="cashu",
|
||||||
version="0.7.0",
|
version="0.8",
|
||||||
description="Ecash wallet and mint with Bitcoin Lightning support",
|
description="Ecash wallet and mint with Bitcoin Lightning support",
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
|
|||||||
Reference in New Issue
Block a user