Why Use Event Listening?
- Real-time Updates: Receive instant notifications when blockchain events occur
- Reduced Infrastructure Costs: Eliminate the need for constant polling
- Scalable Architecture: Handle high volumes of events efficiently
- Flexible Event Filtering: Configure exactly which events you want to monitor
Available Event Listening Options
Webhooks
Webhooks are HTTP callbacks that deliver data to your application when events occur on the Solana blockchain. They’re ideal for:- Tracking token transfers
- Monitoring NFT activities
- Detecting program interactions
- Receiving notifications about account changes
Websockets
Websockets provide a persistent connection between your application and the Solana blockchain, allowing for real-time bidirectional communication. They’re particularly useful for:- Applications requiring immediate updates
- User interfaces that need to reflect blockchain state in real-time
- Cases where lower latency is critical
- Scenarios requiring continuous data streaming
Choosing Between Webhooks and Websockets
- Use Webhooks when: You need reliable delivery with retry mechanisms, prefer a stateless approach, or want to process events asynchronously.
- Use Websockets when: You need lowest possible latency, require bidirectional communication, or are building highly interactive applications.
Getting Started
To begin using event listening capabilities:- For webhooks: Create a webhook configured for your specific use case
- For websockets: Connect to our websocket endpoint
- Set up your application to process the incoming events
- Implement appropriate business logic based on the events received
Use Cases
- NFT Marketplaces: Track listing, sales, and transfers in real-time
- Wallets: Notify users of incoming transactions
- DeFi Applications: Monitor trades, liquidity changes, and protocol events
- Gaming: Capture in-game actions stored on-chain
- Analytics Platforms: Aggregate transaction data as it happens