This commit is contained in:
2025-07-09 16:59:00 +03:00
parent 02fca8f958
commit 34d9c9f4ab
2 changed files with 12 additions and 1 deletions

View File

@ -8,3 +8,5 @@ class TransactionInfo:
symbol: str symbol: str
hash: str hash: str
time: datetime time: datetime
from_: str
to: str

View File

@ -33,4 +33,13 @@ async def get_transaction_by_hash(
time_ = datetime.fromtimestamp( time_ = datetime.fromtimestamp(
float(tx.get("block_timestamp", "")) / 1000 float(tx.get("block_timestamp", "")) / 1000
) )
return TransactionInfo(symbol=symbol, amount=f, hash=hash_, time=time_) from_ = tx.get("from", "")
to = tx.get("to", "")
return TransactionInfo(
symbol=symbol,
amount=f,
hash=hash_,
time=time_,
from_=from_,
to=to,
)