@coinbase/cdp-sdk
Version:
SDK for interacting with the Coinbase Developer Platform Wallet API
41 lines • 1.82 kB
TypeScript
/**
* @module Client
*/
import { CreateWebhookSubscriptionOptions, CreateWebhookSubscriptionResult } from "../../actions/webhooks/createWebhookSubscription.js";
/**
* The namespace containing all webhook methods.
*/
export declare class WebhooksClient {
/**
* Creates a webhook subscription for wallet transaction events.
*
* @param {CreateWebhookSubscriptionOptions} options - Parameters for creating the webhook subscription.
* @param {string} [options.description] - A description of the webhook subscription.
* @param {WebhookEventType[]} options.eventTypes - The event types to subscribe to.
* @param {string} options.targetUrl - The URL to deliver webhook events to.
* @param {Record<string, string>} [options.targetHeaders] - Additional headers to include in webhook requests.
* @param {boolean} [options.isEnabled] - Whether the subscription is enabled. Defaults to `true`.
* @param {Record<string, string>} [options.metadata] - Additional metadata for the subscription.
*
* @returns A promise that resolves to the created webhook subscription.
*
* @example
* ```ts
* const subscription = await cdp.webhooks.createSubscription({
* description: "Monitor wallet transactions",
* eventTypes: [
* "wallet.transaction.pending",
* "wallet.transaction.confirmed",
* "wallet.transaction.failed",
* ],
* targetUrl: "https://example.com/webhook",
* isEnabled: true,
* });
*
* console.log("Subscription ID:", subscription.subscriptionId);
* console.log("Secret:", subscription.secret);
* ```
*/
createSubscription(options: CreateWebhookSubscriptionOptions): Promise<CreateWebhookSubscriptionResult>;
}
//# sourceMappingURL=webhooks.d.ts.map