UNPKG

@bsv/spv-wallet-js-client

Version:

TypeScript library for connecting to a SPV Wallet server

16 lines (15 loc) 686 B
import { SPVWalletAdminAPI } from '../admin-api'; import { Events } from '../types'; import { EventsMap } from './eventsMap'; import { EventHandler, WebhookHttpHandler, WebhookOptions } from './interface'; export declare class WebhookManager { url: string; options: WebhookOptions; subscriber: SPVWalletAdminAPI; handlers: EventsMap; constructor(subscriber: SPVWalletAdminAPI, url: string, options?: WebhookOptions); subscribe(): Promise<void>; unsubscribe(): Promise<void>; handleIncomingEvents(httpHandler: WebhookHttpHandler): Promise<void>; registerHandler<T extends keyof Events>(eventName: T, handlerFunction: EventHandler<Events[T]>): void; }