I am trying to monitor contract events with the topic swap{} keccak hash: “0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
”
I can successfully connect to the websocket filter and I am getting messages whenever this event fires on a contract address.
Problem is, the [‘data’] variable I get back in the message seems to be missing part of the expected message.
Recieved log: 'data': '0x00000000000000000000000000000000000000000000005411a685c98ef94747'
Expected log (from etherscan): 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002dcbf4840eca000000000000000000000000000000000000000000000000005411a685c98ef947470000000000000000000000000000000000000000000000000000000000000000
As you can see, there is a whole section of the data missing in the reply. The data translates to the following information:
* amount0In :0
* amount1In :3300000000000000000
* amount0Out :1550798353237114701639
* amount1Out :0
Currently, the message I get only gives me only amount0, and I need both amount0 and amount1 for my use case
Raw data from the websocket response:
{"jsonrpc":"2.0","method":"eth_subscription","params":{"subscription":"0x1feed340d52bba03e5ee349f34f56a6b","result":{"removed":false,"logIndex":"0xfb","transactionIndex":"0x37","transactionHash":"0x51ee25d2035041d5b1a3badea9d466781fbdf24cbf5c056d4d01cc202b72c6a4","blockHash":"0xce8ca6baee336d3ee59a796c61eeb0125f5a623dbb1f4c20a15f3dfd0d142825","blockNumber":"0xa48b66","address":"0x56d811088235F11C8920698a204A5010a788f4b3","data":"0x00000000000000000000000000000000000000000000005411a685c98ef94747","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x000000000000000000000000b9b752f7f4a4680eeb327ffe728f46666763a796","0x0000000000000000000000005ce1fd9e8d7aba85dd43079606fedfa4385b06b8"]}}}
I am using python to make the websocket calls, with no special web3 library.
How can I get the entire length of data? Is infura restricting/limiting the amount of bytes it sends back in the ‘data’ field?