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