diff --git a/cashu/core/base.py b/cashu/core/base.py index d68e760..2c21a83 100644 --- a/cashu/core/base.py +++ b/cashu/core/base.py @@ -276,14 +276,14 @@ class MintKeysets: # ------- TOKEN ------- -class TokenMintJson(BaseModel): +class TokenMintV2(BaseModel): url: str ks: List[str] class TokenV2(BaseModel): proofs: List[Proof] - mints: Optional[Dict[str, TokenMintJson]] = None + mints: Optional[Dict[str, TokenMintV2]] = None def to_dict(self): return dict( diff --git a/cashu/wallet/clihelpers.py b/cashu/wallet/clihelpers.py index 0e1e57e..3d8c402 100644 --- a/cashu/wallet/clihelpers.py +++ b/cashu/wallet/clihelpers.py @@ -3,7 +3,7 @@ import urllib.parse import click -from cashu.core.base import Proof, TokenMintJson, TokenV2, WalletKeyset +from cashu.core.base import Proof, TokenMintV2, TokenV2, WalletKeyset from cashu.core.settings import CASHU_DIR, MINT_URL from cashu.wallet.crud import get_keyset from cashu.wallet.wallet import Wallet as Wallet @@ -168,6 +168,6 @@ async def proofs_to_token(wallet, proofs, url: str): input(f"Enter mint URL (press enter for default {MINT_URL}): ") or MINT_URL ) - token.mints[url] = TokenMintJson(url=url, ks=keysets) # type: ignore + token.mints[url] = TokenMintV2(url=url, ks=keysets) # type: ignore token_serialized = await wallet._serialize_token_base64(token) return token_serialized diff --git a/cashu/wallet/wallet.py b/cashu/wallet/wallet.py index a32803e..1223a8e 100644 --- a/cashu/wallet/wallet.py +++ b/cashu/wallet/wallet.py @@ -27,7 +27,7 @@ from cashu.core.base import ( PostMintResponseLegacy, Proof, SplitRequest, - TokenMintJson, + TokenMintV2, TokenV2, WalletKeyset, ) @@ -515,7 +515,7 @@ class Wallet(LedgerAPI): # add mint information to the token, if requested if include_mints: # hold information about the mint - mints: Dict[str, TokenMintJson] = dict() + mints: Dict[str, TokenMintV2] = dict() # iterate through all proofs and add their keyset to `mints` for proof in proofs: if proof.id: @@ -526,7 +526,7 @@ class Wallet(LedgerAPI): placeholder_mint_id = keyset.mint_url if placeholder_mint_id not in mints: # mint information - id = TokenMintJson( + id = TokenMintV2( url=keyset.mint_url, ks=[keyset.id], )