How to Subscribe to Ethereum Contract Events in ICP

Hey i am thinking of using ic-cdk::timers for this but not sure if they can run async functions can they ?

Yes, you can run an async function in a timer using ic_cdk::spawn.

1 Like

Hey can you show me a documentation on how to use it please… Or if possible can you share a code snippet on how to use it

Hey @agentDPS,

have a look at the period tasks example: examples/rust/periodic_tasks/timer/src/ at 75c655ba4440def8222be18e2869ae34fb1bb658 · dfinity/examples · GitHub

1 Like

Another example is how the Index canister indexes ckBTC/SNS transactions by querying them periodically using timers. build_index is async because it queries the Ledger for blocks.