UNPKG

1.69 kBTypeScriptView Raw
1/**
2 * User webhook handler for v2 coins and tokens
3 *
4 * @prettier
5 */
6import * as Bluebird from 'bluebird';
7import { BitGo } from '../bitgo';
8import { BaseCoin } from './baseCoin';
9import { NodeCallback } from './types';
10export interface AddOptions {
11 url: string;
12 type: string;
13}
14export interface RemoveOptions {
15 url: string;
16 type: string;
17}
18export interface ListNotificationsOptions {
19 prevId?: string;
20 limit?: number;
21}
22export interface SimulateOptions {
23 webhookId: string;
24 blockId: string;
25}
26export declare class Webhooks {
27 private bitgo;
28 private baseCoin;
29 constructor(bitgo: BitGo, baseCoin: BaseCoin);
30 /**
31 * Fetch list of user webhooks
32 *
33 * @param callback
34 * @returns {*}
35 */
36 list(callback: NodeCallback<any>): Bluebird<any>;
37 /**
38 * Add new user webhook
39 *
40 * @param params
41 * @param callback
42 * @returns {*}
43 */
44 add(params: AddOptions, callback: NodeCallback<any>): Bluebird<any>;
45 /**
46 * Remove user webhook
47 *
48 * @param params
49 * @param callback
50 * @returns {*}
51 */
52 remove(params: RemoveOptions, callback: NodeCallback<any>): Bluebird<any>;
53 /**
54 * Fetch list of webhook notifications for the user
55 *
56 * @param params
57 * @param callback
58 * @returns {*}
59 */
60 listNotifications(params: ListNotificationsOptions | undefined, callback: NodeCallback<any>): Bluebird<any>;
61 /**
62 * Simulate a user webhook
63 *
64 * @param params
65 * @param callback
66 * @returns {*}
67 */
68 simulate(params: SimulateOptions, callback: NodeCallback<any>): Bluebird<any>;
69}
70//# sourceMappingURL=webhooks.d.ts.map
\No newline at end of file