NUT-06: Mint contact info (#585)

* Implement NUT-06 change: https://github.com/cashubtc/nuts/pull/117

* wallet deserialize

* ignore contact info for deprecated v0 response
This commit is contained in:
callebtc
2024-07-15 14:11:54 +02:00
committed by GitHub
parent f32099bce7
commit 21f339ca2b
4 changed files with 15 additions and 7 deletions

View File

@@ -10,6 +10,7 @@ from ..core.models import (
KeysetsResponseKeyset,
KeysResponse,
KeysResponseKeyset,
MintInfoContact,
PostCheckStateRequest,
PostCheckStateResponse,
PostMeltQuoteRequest,
@@ -41,13 +42,16 @@ router: APIRouter = APIRouter()
async def info() -> GetInfoResponse:
logger.trace("> GET /v1/info")
mint_features = ledger.mint_features()
contact_info = [
MintInfoContact(method=m, info=i) for m, i in settings.mint_info_contact
]
return GetInfoResponse(
name=settings.mint_info_name,
pubkey=ledger.pubkey.serialize().hex() if ledger.pubkey else None,
version=f"Nutshell/{settings.version}",
description=settings.mint_info_description,
description_long=settings.mint_info_description_long,
contact=settings.mint_info_contact,
contact=contact_info,
nuts=mint_features,
motd=settings.mint_info_motd,
)