It would be nice to also have similar features for ape
Specification
my_contract.MyEvent[-1] # Last `MyEvent` emitted by contract
iter(my_contract.MyEvent) # Iterate overall events
my_contract.MyEvent.query(...) # Similar to #380, #391, and #392
my_contract.MyEvent.poll_events(start_event=txn_hash) # infinite iterator of new events (since `start_event`)
# NOTE: also add the `num_confirmations` kwarg here
Dependencies
Might be best to wait until after pydantic refactor.
Overview
Events currently don't do a whole lot: https://github.com/ApeWorX/ape/blob/main/src/ape/contracts/base.py#L221
One thing they should do is allow you to query past events and iterate over future ones:
These two features are implemented for blocks in the
chain
manager: https://github.com/ApeWorX/ape/blob/main/src/ape/contracts/base.py#L221 https://github.com/ApeWorX/ape/blob/main/src/ape/managers/chain.py#L127-L187It would be nice to also have similar features for ape
Specification
Dependencies
Might be best to wait until after pydantic refactor.