diff --git a/trc20wrapper/models.py b/trc20wrapper/models.py index 5be0032..d3357a0 100644 --- a/trc20wrapper/models.py +++ b/trc20wrapper/models.py @@ -8,3 +8,5 @@ class TransactionInfo: symbol: str hash: str time: datetime + from_: str + to: str diff --git a/trc20wrapper/transactions.py b/trc20wrapper/transactions.py index 934906d..ed9f815 100644 --- a/trc20wrapper/transactions.py +++ b/trc20wrapper/transactions.py @@ -33,4 +33,13 @@ async def get_transaction_by_hash( time_ = datetime.fromtimestamp( 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, + )