Webhooks
https://api.cerulea.app/v1
Receive real-time signed payloads when events occur in your blockchain infrastructure. Cerulea delivers
HTTP POST
requests to your endpoint with a HMAC-SHA256 signature for verification.
POST
/webhooks
Register a new webhook subscription
JSON
{
"url": "https://yourapp.com/cerulea-webhook",
"events": ["blockchain.block.created", "transaction.confirmed"],
"secret": "whsec_your_signing_secret",
"blockchainId": "bc_01HXYZ"
}Webhook Events
| Event Type | Description |
|---|---|
| blockchain.block.created | New block added to the chain |
| blockchain.transaction.confirmed | Transaction confirmed on-chain |
| contract.deployed | Smart contract successfully deployed |
| contract.event.emitted | Contract event emitted |
| validator.status.changed | Validator joined, left, or changed status |
| governance.proposal.created | New governance proposal submitted |
Signature Verification
JAVASCRIPT
const crypto = require("crypto");
function verifyWebhook(payload, signature, secret) {
const expected = crypto
.createHmac("sha256", secret)
.update(payload, "utf8")
.digest("hex");
return crypto.timingSafeEqual(
Buffer.from(expected),
Buffer.from(signature)
);
}