I am trying to parse uniswap transaction and extract "summary" like what Etherscan does when showing transaction (like this one) below:
Transaction Action:
Swap 2,937.943845 USDC For 1.055626826417338071 Ether On Uniswap V3
Swap 1.055626826417338071 Ether For 73.765903190964302924 TORN On Uniswap V3
The raw transaction data looks like this:
{
"blockHash": "0x4de7a163e436e0085772da19f837e3cd7ac4c976f0acefcf41195a5262d004ee",
"blockNumber": 14237558,
"from": "0xd26BaA5F41CC7839CEdb020b6d98E1C6e1642D75",
"gas": 272371,
"gasPrice": "61850376427",
"maxFeePerGas": "79333124379",
"maxPriorityFeePerGas": "1500000000",
"hash": "0xd72a4edd39a45a65055a7b9b8a1c772c21012801be195ef529f2f96bdbbdf6a8",
"input": "0x5ae401dc00000000000000000000000000000000000000000000000000000000621123160000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000124b858183f00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000080000000000000000000000000d26baa5f41cc7839cedb020b6d98e1c6e1642d7500000000000000000000000000000000000000000000000000000000af1d7725000000000000000000000000000000000000000000000003f3ce7f66bc562ee70000000000000000000000000000000000000000000000000000000000000042a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480001f4c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200271077777feddddffc19ff86db637967013e6c6a116c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"nonce": 53,
"to": "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",
"transactionIndex": 44,
"value": "0",
"type": 2,
"accessList":
[],
"chainId": "0x1",
"v": "0x0",
"r": "0x3a00df8025b591167bf0f05fce01a84e79260dea7d5d3720a2a6d795383f1fe4",
"s": "0x6db1374f2058e222b73419dd9b3974dad1d6c9d5478dc9ac09a9f2943a0947a3"
}
I am assuming that the transaction summary can be extracted from the input
attribute, but unsure how to do that.