register_webhook
Register HTTPS webhook URLs to receive real-time notifications for payment events like invoice_paid, payment_completed, and balance_changed from a Bitcoin Lightning wallet.
Instructions
Register a webhook URL to receive payment notifications. Max 5 webhooks per agent. REQUIRES AGENT KEY.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | HTTPS webhook URL to receive events | |
| events | No | Event types to subscribe to |
Implementation Reference
- src/lightning-faucet.ts:566-590 (handler)Handler method to register a webhook with the Lightning Faucet API.
async registerWebhook( url: string, events: string[] = ['invoice_paid'] ): Promise<{ webhookId: number; url: string; events: string[]; secret: string; rawResponse: ApiResponse; }> { const result = await this.request<ApiResponse & { webhook_id?: number; url?: string; events?: string[]; secret?: string; }>('register_webhook', { url, events }); return { webhookId: result.webhook_id || 0, url: result.url || url, events: result.events || events, secret: result.secret || '', rawResponse: result, }; }