1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | import {Utils} from 'conflux-web-utils';
|
16 | import {AbstractConfluxWebModule, PromiEvent} from 'conflux-web-core';
|
17 | import {formatters} from 'conflux-web-core-helpers';
|
18 |
|
19 | export class AbstractMethod {
|
20 | constructor(
|
21 | rpcMethod: string,
|
22 | parametersAmount: number,
|
23 | utils: Utils,
|
24 | formatters: formatters,
|
25 | moduleInstance: AbstractConfluxWebModule
|
26 | );
|
27 |
|
28 | utils: Utils;
|
29 | formatters: formatters;
|
30 | promiEvent: PromiEvent<any>;
|
31 | rpcMethod: string;
|
32 | parametersAmount: number;
|
33 | parameters: any[];
|
34 |
|
35 | getArguments(): any;
|
36 |
|
37 | setArguments(args: any[]): void;
|
38 |
|
39 | isHash(parameter: string): boolean;
|
40 |
|
41 | hasWallets(): boolean;
|
42 |
|
43 | callback(error: string | Error, response: any): void;
|
44 |
|
45 | beforeExecution(moduleInstance: AbstractConfluxWebModule): void;
|
46 |
|
47 | afterExecution(response: any): any;
|
48 |
|
49 | execute(): Promise<any> | PromiEvent<any> | string;
|
50 |
|
51 | clearSubscriptions(unsubscribeMethod: string): Promise<boolean | Error>;
|
52 | }
|
53 |
|
54 | export class AbstractMethodFactory {
|
55 | constructor(utils: Utils, formatters: formatters);
|
56 |
|
57 | methods: null | object;
|
58 | hasMethod: boolean;
|
59 |
|
60 | createMethod(name: string, moduleInstance: AbstractConfluxWebModule): AbstractMethod;
|
61 | }
|