Pseudo events for push, pull, withdraw
Closed this issue · 0 comments
Due to size constraints in the agent contract, we removed pushFunds
pullFunds
and withdraw
events. This has made it tricky to get the full picture overview of an agent's activity.
We have an events
package in the SDK repo, which we should add "pseudo" events to for processing pushFunds
, pullFunds
and withdraw
events. The functions should accept:
- An array of agents to "filter" events for
- A from block to start filtering events from
- A to block to end the epoch range to scan for events
The function should return a list of the relevant transactions
There are a few different approaches to getting this done that I can think of:
- Scan every message on chain, look at its internal messages, find transactions that are sent from/to the agent's addresses passed in the filter, and then look at the 4 byte function selector to match the tx type
- Use Filfox or beryx to find messages from/to the agent contracts in question, and complete the same analysis by looking at function selectors
Either of these approaches should work, and we should be OK relying on an external source for this information (since moving forward we will have events for these contracts). As long as the external source isn't missing data of course...