mirror of
https://github.com/aljazceru/nutshell.git
synced 2026-01-11 04:34:20 +01:00
rename TokenMintJson to TokenMintV2
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user