1 | import { SubscriptionResponse, ErrorResponse, SuccessResponse } from "frontblock-generic/Service";
|
2 | import { Coin, AccountMap, TransactionMap } from "frontblock-generic/Types";
|
3 | import { FrontblockApi as FrontblockApi } from "frontblock-generic/Api";
|
4 | import { Plugin, socketioRPC } from "frontblock-generic/Plugin";
|
5 | export declare type FrontblockApiConf = {
|
6 | apiHost: string;
|
7 | apiPort: number;
|
8 | tls?: boolean;
|
9 | apiKey?: string;
|
10 | };
|
11 | export default class FrontblockApiClient implements FrontblockApi, Plugin {
|
12 | protected apikey: string;
|
13 | protected conf: FrontblockApiConf;
|
14 | protected socket: any;
|
15 | private started;
|
16 | constructor(conf?: FrontblockApiConf);
|
17 | exportRPCs(): socketioRPC[];
|
18 | start(): void;
|
19 | stop(): void;
|
20 | subscribe<C extends Coin>(apikey: string, coin: C, account: AccountMap[C], callback: (tx: TransactionMap[C]) => void): Promise<SubscriptionResponse | ErrorResponse>;
|
21 | unsubscribe(apikey: string, uid: string | SubscriptionResponse): Promise<ErrorResponse | SuccessResponse>;
|
22 | }
|