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 TypeDescription
blockchain.block.createdNew block added to the chain
blockchain.transaction.confirmedTransaction confirmed on-chain
contract.deployedSmart contract successfully deployed
contract.event.emittedContract event emitted
validator.status.changedValidator joined, left, or changed status
governance.proposal.createdNew 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)
  );
}