forked from BlueWallet/rn-electrum-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
58 lines (52 loc) · 1.86 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import * as net from "net";
import * as tls from "tls";
export default class ElectrumClient {
constructor(
netModule: typeof net,
tlsModule: typeof tls | false,
port: number,
host: string,
protocol: string,
);
initElectrum(
elecrumConfig: {
client: string;
version: string;
},
persistencePolicy?: { maxRetry: number; callback: (() => void) | null },
timeout?: number
): Promise<void>;
subscribe: {
on(eventName: string, callback: (data: any) => void): void;
removeAllListeners(event: string): void;
};
blockchainHeaders_subscribe(): Promise<any>;
blockchainScripthash_subscribe(scriptHash: string): Promise<any>;
blockchainScripthash_listunspent(scriptHash: string): Promise<any[]>;
blockchainTransaction_get(
transactionHash: string,
verbose?: boolean,
): Promise<any>;
blockchainScripthash_getBalance(scriptHash: string): Promise<any>;
blockchainScripthash_getHistory(scriptHash: string): Promise<any[]>;
blockchainEstimatefee(target: number): Promise<number>;
blockchainTransaction_broadcast(txHex: string): Promise<string>;
blockchainBlock_header(height: number): Promise<string>;
blockchainBlock_headers(startHeight: number, count: number): Promise<any>;
server_version(clientName: string, protocolVersion: string): Promise<string>;
server_banner(): Promise<string>;
server_features(): Promise<any>;
server_ping(): Promise<null>;
server_addPeer(features: any): Promise<any>;
serverDonation_address(): Promise<string>;
serverPeers_subscribe(): Promise<any>;
blockchainAddress_getProof(address: string): Promise<any>;
blockchain_relayfee(): Promise<number>;
mempool_getFeeHistogram(): Promise<any[]>;
close(): void;
reconnect(): void;
keepAlive(): void;
onError: (e: Error) => void;
onClose: (hadError: boolean) => void;
onData: (data: Buffer | string) => void;
}