Adds token decimals to transaction object.
This commit is contained in:
parent
dc454eeec8
commit
29b2d7084a
@ -100,14 +100,17 @@ def transaction_actors(transaction: dict) -> Tuple[Dict, Dict]:
|
||||
"""
|
||||
destination_token_symbol = transaction.get('destination_token_symbol')
|
||||
destination_token_value = transaction.get('destination_token_value') or transaction.get('to_value')
|
||||
destination_token_decimals = transaction.get('destination_token_decimals')
|
||||
recipient_blockchain_address = transaction.get('recipient')
|
||||
sender_blockchain_address = transaction.get('sender')
|
||||
source_token_symbol = transaction.get('source_token_symbol')
|
||||
source_token_value = transaction.get('source_token_value') or transaction.get('from_value')
|
||||
source_token_decimals = transaction.get('source_token_decimals')
|
||||
|
||||
recipient_transaction_data = {
|
||||
"token_symbol": destination_token_symbol,
|
||||
"token_value": destination_token_value,
|
||||
"token_decimals": destination_token_decimals,
|
||||
"blockchain_address": recipient_blockchain_address,
|
||||
"role": "recipient",
|
||||
}
|
||||
@ -115,6 +118,7 @@ def transaction_actors(transaction: dict) -> Tuple[Dict, Dict]:
|
||||
"blockchain_address": sender_blockchain_address,
|
||||
"token_symbol": source_token_symbol,
|
||||
"token_value": source_token_value,
|
||||
"token_decimals": source_token_decimals,
|
||||
"role": "sender",
|
||||
}
|
||||
return recipient_transaction_data, sender_transaction_data
|
||||
|
Loading…
Reference in New Issue
Block a user