Transfer events from USDC on Sei Mainnet as they happen. Then it fetches past Transfer events. USDC is busy, so new events usually arrive within a minute.
Pick the right endpoint
Sei’s public endpoints split the work:Install
Watch new events
Each script prints a line for every USDC transfer. The script keeps running until you stop it with Ctrl+C.The web3.py example uses the subscription manager, which needs web3.py 7.7 or later.
Fetch past events
eth_getLogs returns the events in a block range. On the public endpoints, one request can cover at most 2,000 blocks. A larger range fails with block range too large. This example fetches the transfers from the latest 1,000 blocks.
eth_getLogs.
Related recipes
- WebSocket connections: new blocks and the
newHeadssubscription - Transaction lifecycle: decode the events from one transaction’s receipt
- Deploy an ERC-20: deploy a token that emits its own
Transferevents