mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-20 18:44:20 +01:00
implement nut-06 time (#611)
This commit is contained in:
@@ -38,6 +38,7 @@ class GetInfoResponse(BaseModel):
|
||||
description_long: Optional[str] = None
|
||||
contact: Optional[List[MintInfoContact]] = None
|
||||
motd: Optional[str] = None
|
||||
time: Optional[int] = None
|
||||
nuts: Optional[Dict[int, Any]] = None
|
||||
|
||||
def supports(self, nut: int) -> Optional[bool]:
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import asyncio
|
||||
import time
|
||||
|
||||
from fastapi import APIRouter, Request, WebSocket
|
||||
from loguru import logger
|
||||
@@ -56,6 +57,7 @@ async def info() -> GetInfoResponse:
|
||||
contact=contact_info,
|
||||
nuts=mint_features,
|
||||
motd=settings.mint_info_motd,
|
||||
time=int(time.time()),
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -996,6 +996,8 @@ async def info(ctx: Context, mint: bool, mnemonic: bool):
|
||||
print(f" - Version: {mint_info['version']}")
|
||||
if mint_info.get("motd"):
|
||||
print(f" - Message of the day: {mint_info['motd']}")
|
||||
if mint_info.get("time"):
|
||||
print(f" - Server time: {mint_info['time']}")
|
||||
if mint_info.get("nuts"):
|
||||
print(
|
||||
" - Supported NUTS:"
|
||||
|
||||
@@ -15,6 +15,7 @@ class MintInfo(BaseModel):
|
||||
description_long: Optional[str]
|
||||
contact: Optional[List[MintInfoContact]]
|
||||
motd: Optional[str]
|
||||
time: Optional[int]
|
||||
nuts: Optional[Dict[int, Any]]
|
||||
|
||||
def __str__(self):
|
||||
|
||||
Reference in New Issue
Block a user