Webhooks Module

Manage webhook endpoints for event notifications

Webhooks Module

The webhooks module provides functionality for registering and managing webhook endpoints to receive real-time notifications for wallet events.

Import

import { 
  create, 
  findAll, 
  findOne, 
  update, 
  remove 
} from 'cilantro-sdk/webhooks';

Operations

create(options)

Register a new webhook endpoint.

urlstringrequired

Webhook endpoint URL

eventsstring[]required

Array of event types to subscribe to

descriptionstring

Description of the webhook

isActiveboolean

Whether the webhook is active (default: true)

const webhook = await create({
  url: 'https://your-domain.com/webhooks/cilantro',
  events: ['wallet.created', 'transaction.confirmed', 'transaction.failed'],
  description: 'Production webhook for transaction events',
  isActive: true
});

findAll()

List all webhooks for your platform.

const webhooks = await findAll();
console.log('Registered webhooks:', webhooks);

findOne(webhookId)

Get webhook by ID.

const webhook = await findOne('webhook-id');

update(webhookId, options)

Update webhook configuration.

await update('webhook-id', {
  events: ['wallet.created', 'transaction.confirmed'],
  isActive: false // Temporarily disable
});

remove(webhookId)

Delete a webhook.

await remove('webhook-id');

Available Events

  • wallet.created - Wallet was created
  • wallet.updated - Wallet was updated
  • wallet.deleted - Wallet was deleted
  • transaction.confirmed - Transaction was confirmed
  • transaction.failed - Transaction failed
  • signer.created - Signer was created
  • signer.updated - Signer was updated
  • signer.deleted - Signer was deleted
Webhooks Module | Cilantro Smart Wallet Docs | Cilantro Smart Wallet