Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cashu/core/mint_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class MintInfo(BaseModel):
urls: Optional[List[str]]
tos_url: Optional[str]
time: Optional[int]
max_array_length: Optional[int] = None
nuts: Dict[int, Any]

def __str__(self):
Expand Down
1 change: 1 addition & 0 deletions cashu/core/models/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class GetInfoResponse(BaseModel):
tos_url: Optional[str] = None
urls: Optional[List[str]] = None
time: Optional[int] = None
max_array_length: Optional[int] = None
nuts: Optional[Dict[int, Any]] = None

def supports(self, nut: int) -> Optional[bool]:
Expand Down
1 change: 1 addition & 0 deletions cashu/mint/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def mint_info(self) -> MintInfo:
tos_url=settings.mint_info_tos_url,
motd=settings.mint_info_motd,
time=None,
max_array_length=settings.mint_max_request_length,
)

@property
Expand Down
2 changes: 2 additions & 0 deletions cashu/mint/management_rpc/management_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ def GetInfo(self, request, _):
logger.debug("gRPC GetInfo has been called")
mint_info_dict = self.ledger.mint_info.dict()
del mint_info_dict["nuts"]
# not in the management proto; operators set it in the mint config
del mint_info_dict["max_array_length"]
mint_info_dict["long_description"] = mint_info_dict["description_long"]
del mint_info_dict["description_long"]
response = management_pb2.GetInfoResponse(**mint_info_dict)
Expand Down
1 change: 1 addition & 0 deletions cashu/mint/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ async def info() -> GetInfoResponse:
urls=settings.mint_info_urls,
motd=mint_info.motd,
time=int(time.time()),
max_array_length=mint_info.max_array_length,
)


Expand Down
1 change: 1 addition & 0 deletions tests/mint/test_mint_app_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def _dummy_ledger():
icon_url="https://mint.test/icon.png",
tos_url="https://mint.test/tos",
motd="Hello",
max_array_length=1000,
)

async def mint_quote(payload):
Expand Down
Loading