Webhooks
Receive real-time notifications when blockchain events occur.
Setting Up Webhooks
Configure webhook endpoints in your dashboard:
{
"url": "https://your-app.com/webhook",
"events": ["transaction.confirmed", "block.mined"],
"chains": ["ethereum", "polygon"]
}
Event Types
Transaction Events
transaction.pending- Transaction submittedtransaction.confirmed- Transaction confirmedtransaction.failed- Transaction failed
Block Events
block.mined- New block minedblock.reorg- Chain reorganization
Gas Events
gas.spike- Gas price spike detectedgas.low- Low gas prices
Webhook Payload
{
"event": "transaction.confirmed",
"chain": "ethereum",
"timestamp": "2024-01-01T00:00:00Z",
"data": {
"hash": "0x...",
"block": 12345678,
"confirmations": 12
}
}
Verifying Webhooks
Verify webhook signatures for security:
const crypto = require('crypto');
function verifyWebhook(payload, signature, secret) {
const hash = crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex');
return hash === signature;
}
Pricing Note
Webhook deliveries do not consume CUs. Only the initial API calls to set up webhook subscriptions count toward your limits.
See also:
- Pricing - CU costs and tier limits
- WebSockets - Alternative real-time data streaming