@electrum-cash/network 3.2.0-r1 → 3.3.0-development.6103536979
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -1
- package/dist/index.cjs +1637 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +619 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +1611 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,619 @@
|
|
|
1
|
+
import * as net from "net";
|
|
2
|
+
import { WebSocket, MessageEvent, ErrorEvent } from "@monsterbitar/isomorphic-ws";
|
|
3
|
+
import { EventEmitter } from "events";
|
|
4
|
+
import { Mutex } from "async-mutex";
|
|
5
|
+
type RPCParameter = string | number | boolean | null;
|
|
6
|
+
interface RPCBase {
|
|
7
|
+
jsonrpc: string;
|
|
8
|
+
}
|
|
9
|
+
interface RPCNotification extends RPCBase {
|
|
10
|
+
method: string;
|
|
11
|
+
params?: RPCParameter[];
|
|
12
|
+
}
|
|
13
|
+
interface RPCStatement extends RPCBase {
|
|
14
|
+
id: number | null;
|
|
15
|
+
result: string;
|
|
16
|
+
}
|
|
17
|
+
interface RPCError {
|
|
18
|
+
code: number;
|
|
19
|
+
message: string;
|
|
20
|
+
data?: any;
|
|
21
|
+
}
|
|
22
|
+
interface RPCErrorResponse extends RPCBase {
|
|
23
|
+
id: number | null;
|
|
24
|
+
error: RPCError;
|
|
25
|
+
}
|
|
26
|
+
type RPCResponse = RPCErrorResponse | RPCStatement;
|
|
27
|
+
/**
|
|
28
|
+
* Enum that denotes the ordering to use in an ElectrumCluster.
|
|
29
|
+
* @enum {number}
|
|
30
|
+
* @property {0} RANDOM Send requests to randomly selected servers in the cluster.
|
|
31
|
+
* @property {1} PRIORITY Send requests to servers in the cluster in the order they were added.
|
|
32
|
+
*/
|
|
33
|
+
export enum ClusterOrder {
|
|
34
|
+
RANDOM = 0,
|
|
35
|
+
PRIORITY = 1
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Enum that denotes the distribution setting to use in an ElectrumCluster.
|
|
39
|
+
* @enum {number}
|
|
40
|
+
* @property {0} ALL Send requests to all servers in the cluster.
|
|
41
|
+
*/
|
|
42
|
+
export enum ClusterDistribution {
|
|
43
|
+
ALL = 0
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Enum that denotes the ready status of an ElectrumCluster.
|
|
47
|
+
* @enum {number}
|
|
48
|
+
* @property {0} DISABLED The cluster is disabled and unusable.
|
|
49
|
+
* @property {1} DEGRADED The cluster is degraded but still usable.
|
|
50
|
+
* @property {2} READY The cluster is healthy and ready for use.
|
|
51
|
+
*/
|
|
52
|
+
export enum ClusterStatus {
|
|
53
|
+
DISABLED = 0,
|
|
54
|
+
DEGRADED = 1,
|
|
55
|
+
READY = 2
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Enum that denotes the availability of an ElectrumClient.
|
|
59
|
+
* @enum {number}
|
|
60
|
+
* @property {0} UNAVAILABLE The client is currently not available.
|
|
61
|
+
* @property {1} AVAILABLE The client is available for use.
|
|
62
|
+
*/
|
|
63
|
+
export enum ClientState {
|
|
64
|
+
UNAVAILABLE = 0,
|
|
65
|
+
AVAILABLE = 1
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Enum that denotes the connection status of an ElectrumConnection.
|
|
69
|
+
* @enum {number}
|
|
70
|
+
* @property {0} DISCONNECTED The connection is disconnected.
|
|
71
|
+
* @property {1} AVAILABLE The connection is connected.
|
|
72
|
+
* @property {2} DISCONNECTING The connection is disconnecting.
|
|
73
|
+
* @property {3} CONNECTING The connection is connecting.
|
|
74
|
+
* @property {4} RECONNECTING The connection is restarting.
|
|
75
|
+
*/
|
|
76
|
+
export enum ConnectionStatus {
|
|
77
|
+
DISCONNECTED = 0,
|
|
78
|
+
CONNECTED = 1,
|
|
79
|
+
DISCONNECTING = 2,
|
|
80
|
+
CONNECTING = 3,
|
|
81
|
+
RECONNECTING = 4
|
|
82
|
+
}
|
|
83
|
+
export interface ClientConfig {
|
|
84
|
+
state: ClientState;
|
|
85
|
+
connection: ElectrumClient;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* A list of possible responses to requests.
|
|
89
|
+
*/
|
|
90
|
+
export type RequestResponse = object | string | number | boolean | null | RequestResponse[];
|
|
91
|
+
export type RequestResolver = (error?: Error, data?: string) => void;
|
|
92
|
+
export type ResolveFunction<T> = (value: T | PromiseLike<T>) => void;
|
|
93
|
+
export type RejectFunction = (reason?: any) => void;
|
|
94
|
+
export interface VersionRejected {
|
|
95
|
+
error: RPCError;
|
|
96
|
+
}
|
|
97
|
+
export interface VersionNegotiated {
|
|
98
|
+
software: string;
|
|
99
|
+
protocol: string;
|
|
100
|
+
}
|
|
101
|
+
export const isVersionRejected: (object: any) => object is VersionRejected;
|
|
102
|
+
export const isVersionNegotiated: (object: any) => object is VersionNegotiated;
|
|
103
|
+
/**
|
|
104
|
+
* Possible Transport Schemes for communication with the Electrum server
|
|
105
|
+
*/
|
|
106
|
+
export type TransportScheme = 'tcp' | 'tcp_tls' | 'ws' | 'wss';
|
|
107
|
+
export interface ConnectionOptions {
|
|
108
|
+
rejectUnauthorized?: boolean;
|
|
109
|
+
serverName?: string;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Object containing the commonly used ports and schemes for specific Transports.
|
|
113
|
+
* @example const electrum = new ElectrumClient('Electrum client example', '1.4.1', 'bch.imaginary.cash', Transport.WSS.Port, Transport.WSS.Scheme);
|
|
114
|
+
*
|
|
115
|
+
* @property {object} TCP Port and Scheme to use unencrypted TCP sockets.
|
|
116
|
+
* @property {object} TCP_TLS Port and Scheme to use TLS-encrypted TCP sockets.
|
|
117
|
+
* @property {object} WS Port and Scheme to use unencrypted WebSockets.
|
|
118
|
+
* @property {object} WSS Port and Scheme to use TLS-encrypted WebSockets.
|
|
119
|
+
*/
|
|
120
|
+
export const ElectrumTransport: {
|
|
121
|
+
TCP: {
|
|
122
|
+
Port: number;
|
|
123
|
+
Scheme: TransportScheme;
|
|
124
|
+
};
|
|
125
|
+
TCP_TLS: {
|
|
126
|
+
Port: number;
|
|
127
|
+
Scheme: TransportScheme;
|
|
128
|
+
};
|
|
129
|
+
WS: {
|
|
130
|
+
Port: number;
|
|
131
|
+
Scheme: TransportScheme;
|
|
132
|
+
};
|
|
133
|
+
WSS: {
|
|
134
|
+
Port: number;
|
|
135
|
+
Scheme: TransportScheme;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
export const DefaultParameters: {
|
|
139
|
+
PORT: number;
|
|
140
|
+
TRANSPORT_SCHEME: TransportScheme;
|
|
141
|
+
RECONNECT: number;
|
|
142
|
+
TIMEOUT: number;
|
|
143
|
+
PING_INTERVAL: number;
|
|
144
|
+
CLUSTER_CONFIDENCE: number;
|
|
145
|
+
CLUSTER_DISTRIBUTION: ClusterDistribution;
|
|
146
|
+
CLUSTER_ORDER: ClusterOrder;
|
|
147
|
+
USE_BIG_INT: boolean;
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* Isomorphic Socket interface supporting TCP sockets and WebSockets (Node and browser).
|
|
151
|
+
* The interface is a subset of the TLSSocket interface with some slight modifications.
|
|
152
|
+
* It can be expanded when more socket functionality is needed in the rest of the
|
|
153
|
+
* electrum-cash code. Changes from the TLSSocket interface (besides it being a subset):
|
|
154
|
+
* - Event 'close' -> 'disconnect'
|
|
155
|
+
* - New function socket.disconnect()
|
|
156
|
+
*
|
|
157
|
+
* @ignore
|
|
158
|
+
*/
|
|
159
|
+
declare class ElectrumSocket extends EventEmitter {
|
|
160
|
+
tcpSocket?: net.Socket;
|
|
161
|
+
webSocket?: WebSocket;
|
|
162
|
+
timers: {
|
|
163
|
+
retryConnection?: number;
|
|
164
|
+
disconnect?: number;
|
|
165
|
+
};
|
|
166
|
+
onConnectHasRun: boolean;
|
|
167
|
+
eventForwarders: {
|
|
168
|
+
disconnect: () => boolean;
|
|
169
|
+
tcpData: (data: string) => boolean;
|
|
170
|
+
wsData: (event: MessageEvent) => boolean;
|
|
171
|
+
tcpError: (err: Error) => boolean;
|
|
172
|
+
wsError: (event: ErrorEvent) => boolean;
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* Connect to host:port using the specified transport
|
|
176
|
+
*
|
|
177
|
+
* @param {string} host Fully qualified domain name or IP address of the host
|
|
178
|
+
* @param {number} port Network port for the host to connect to
|
|
179
|
+
* @param {TransportScheme} scheme Transport scheme to use
|
|
180
|
+
* @param {number} timeout If no connection is established after `timeout` ms, the connection is terminated
|
|
181
|
+
*
|
|
182
|
+
* @throws {Error} if an incorrect transport scheme is specified
|
|
183
|
+
*/
|
|
184
|
+
connect(host: string, port: number, scheme: TransportScheme, timeout: number): void;
|
|
185
|
+
/**
|
|
186
|
+
* Sets up forwarding of events related to the connection.
|
|
187
|
+
*
|
|
188
|
+
* @param {string} connectionType Name of the connection/transport type, used for logging.
|
|
189
|
+
* @param {string} host Fully qualified domain name or IP address of the host
|
|
190
|
+
* @param {number} port Network port for the host to connect to
|
|
191
|
+
*/
|
|
192
|
+
onConnect(connectionType: string, host: string, port: number): void;
|
|
193
|
+
/**
|
|
194
|
+
* Forcibly terminate the connection.
|
|
195
|
+
*
|
|
196
|
+
* @throws {Error} if no connection was found
|
|
197
|
+
*/
|
|
198
|
+
disconnect(): void;
|
|
199
|
+
/**
|
|
200
|
+
* Write data to the socket
|
|
201
|
+
*
|
|
202
|
+
* @param {Uint8Array | string} data Data to be written to the socket
|
|
203
|
+
* @param {function} callback Callback function to be called when the write has completed
|
|
204
|
+
*
|
|
205
|
+
* @throws {Error} if no connection was found
|
|
206
|
+
* @returns true if the message was fully flushed to the socket, false if part of the message
|
|
207
|
+
* is queued in the user memory
|
|
208
|
+
*/
|
|
209
|
+
write(data: Uint8Array | string, callback?: (err?: Error) => void): boolean;
|
|
210
|
+
/**
|
|
211
|
+
* Force a disconnection if no connection is established after `timeout` milliseconds.
|
|
212
|
+
*
|
|
213
|
+
* @param {string} host Host of the connection that timed out
|
|
214
|
+
* @param {number} port Port of the connection that timed out
|
|
215
|
+
* @param {number} timeout Elapsed milliseconds
|
|
216
|
+
*/
|
|
217
|
+
disconnectOnTimeout(host: string, port: number, timeout: number): void;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Wrapper around TLS/WSS sockets that gracefully separates a network stream into Electrum protocol messages.
|
|
221
|
+
*
|
|
222
|
+
* @ignore
|
|
223
|
+
*/
|
|
224
|
+
declare class ElectrumConnection extends EventEmitter {
|
|
225
|
+
application: string;
|
|
226
|
+
version: string;
|
|
227
|
+
host: string;
|
|
228
|
+
port: number;
|
|
229
|
+
scheme: TransportScheme;
|
|
230
|
+
timeout: number;
|
|
231
|
+
pingInterval: number;
|
|
232
|
+
reconnectInterval: number;
|
|
233
|
+
useBigInt: boolean;
|
|
234
|
+
socket: ElectrumSocket;
|
|
235
|
+
lastReceivedTimestamp: number;
|
|
236
|
+
timers: {
|
|
237
|
+
keepAlive?: number;
|
|
238
|
+
reconnect?: number;
|
|
239
|
+
};
|
|
240
|
+
verifications: Array<number>;
|
|
241
|
+
status: ConnectionStatus;
|
|
242
|
+
messageBuffer: string;
|
|
243
|
+
/**
|
|
244
|
+
* Sets up network configuration for an Electrum client connection.
|
|
245
|
+
*
|
|
246
|
+
* @param {string} application your application name, used to identify to the electrum host.
|
|
247
|
+
* @param {string} version protocol version to use with the host.
|
|
248
|
+
* @param {string} host fully qualified domain name or IP number of the host.
|
|
249
|
+
* @param {number} port the network port of the host.
|
|
250
|
+
* @param {TransportScheme} scheme the transport scheme to use for connection
|
|
251
|
+
* @param {number} timeout how long network delays we will wait for before taking action, in milliseconds.
|
|
252
|
+
* @param {number} pingInterval the time between sending pings to the electrum host, in milliseconds.
|
|
253
|
+
* @param {number} reconnectInterval the time between reconnection attempts to the electrum host, in milliseconds.
|
|
254
|
+
* @param {boolean} useBigInt whether to use bigint for numbers in json response.
|
|
255
|
+
*
|
|
256
|
+
* @throws {Error} if `version` is not a valid version string.
|
|
257
|
+
*/
|
|
258
|
+
constructor(application: string, version: string, host: string, port?: number, scheme?: TransportScheme, timeout?: number, pingInterval?: number, reconnectInterval?: number, useBigInt?: boolean);
|
|
259
|
+
/**
|
|
260
|
+
* Returns a string for the host identifier for usage in debug messages.
|
|
261
|
+
*/
|
|
262
|
+
get hostIdentifier(): string;
|
|
263
|
+
/**
|
|
264
|
+
* Create and configures a fresh socket and attaches all relevant listeners.
|
|
265
|
+
*/
|
|
266
|
+
createSocket(): void;
|
|
267
|
+
/**
|
|
268
|
+
* Shuts down and destroys the current socket.
|
|
269
|
+
*/
|
|
270
|
+
destroySocket(): void;
|
|
271
|
+
/**
|
|
272
|
+
* Assembles incoming data into statements and hands them off to the message parser.
|
|
273
|
+
*
|
|
274
|
+
* @param {string} data data to append to the current message buffer, as a string.
|
|
275
|
+
*
|
|
276
|
+
* @throws {SyntaxError} if the passed statement parts are not valid JSON.
|
|
277
|
+
*/
|
|
278
|
+
parseMessageChunk(data: string): void;
|
|
279
|
+
/**
|
|
280
|
+
* Sends a keep-alive message to the host.
|
|
281
|
+
*
|
|
282
|
+
* @returns true if the ping message was fully flushed to the socket, false if
|
|
283
|
+
* part of the message is queued in the user memory
|
|
284
|
+
*/
|
|
285
|
+
ping(): boolean;
|
|
286
|
+
/**
|
|
287
|
+
* Initiates the network connection negotiates a protocol version. Also emits the 'connect' signal if successful.
|
|
288
|
+
*
|
|
289
|
+
* @throws {Error} if the socket connection fails.
|
|
290
|
+
* @returns a promise resolving when the connection is established
|
|
291
|
+
*/
|
|
292
|
+
connect(): Promise<void>;
|
|
293
|
+
/**
|
|
294
|
+
* Restores the network connection.
|
|
295
|
+
*/
|
|
296
|
+
reconnect(): Promise<void>;
|
|
297
|
+
/**
|
|
298
|
+
* Removes the current reconnect timer.
|
|
299
|
+
*/
|
|
300
|
+
clearReconnectTimer(): void;
|
|
301
|
+
/**
|
|
302
|
+
* Removes the current keep-alive timer.
|
|
303
|
+
*/
|
|
304
|
+
clearKeepAliveTimer(): void;
|
|
305
|
+
/**
|
|
306
|
+
* Initializes the keep alive timer loop.
|
|
307
|
+
*/
|
|
308
|
+
setupKeepAliveTimer(): void;
|
|
309
|
+
/**
|
|
310
|
+
* Tears down the current connection and removes all event listeners on disconnect.
|
|
311
|
+
*
|
|
312
|
+
* @param {boolean} force disconnect even if the connection has not been fully established yet.
|
|
313
|
+
* @param {boolean} intentional update connection state if disconnect is intentional.
|
|
314
|
+
*
|
|
315
|
+
* @returns true if successfully disconnected, or false if there was no connection.
|
|
316
|
+
*/
|
|
317
|
+
disconnect(force?: boolean, intentional?: boolean): Promise<boolean>;
|
|
318
|
+
/**
|
|
319
|
+
* Updates connection state based on application visibility.
|
|
320
|
+
*
|
|
321
|
+
* Some browsers will disconnect network connections when the browser is out of focus,
|
|
322
|
+
* which would normally cause our reconnect-on-timeout routines to trigger, but that
|
|
323
|
+
* results in a poor user experience since the events are not handled consistently
|
|
324
|
+
* and sometimes it can take some time after restoring focus to the browser.
|
|
325
|
+
*
|
|
326
|
+
* By manually disconnecting when this happens we prevent the default reconnection routines
|
|
327
|
+
* and make the behavior consistent across browsers.
|
|
328
|
+
*/
|
|
329
|
+
handleVisibilityChange(): Promise<void>;
|
|
330
|
+
/**
|
|
331
|
+
* Sends an arbitrary message to the server.
|
|
332
|
+
*
|
|
333
|
+
* @param {string} message json encoded request object to send to the server, as a string.
|
|
334
|
+
*
|
|
335
|
+
* @returns true if the message was fully flushed to the socket, false if part of the message
|
|
336
|
+
* is queued in the user memory
|
|
337
|
+
*/
|
|
338
|
+
send(message: string): boolean;
|
|
339
|
+
/**
|
|
340
|
+
* Marks the connection as timed out and schedules reconnection if we have not
|
|
341
|
+
* received data within the expected time frame.
|
|
342
|
+
*/
|
|
343
|
+
verifySend(sentTimestamp: number): void;
|
|
344
|
+
/**
|
|
345
|
+
* Updates the connection status when a connection is confirmed.
|
|
346
|
+
*/
|
|
347
|
+
onSocketConnect(): void;
|
|
348
|
+
/**
|
|
349
|
+
* Updates the connection status when a connection is ended.
|
|
350
|
+
*/
|
|
351
|
+
onSocketDisconnect(): void;
|
|
352
|
+
/**
|
|
353
|
+
* Notify administrator of any unexpected errors.
|
|
354
|
+
*/
|
|
355
|
+
onSocketError(error: any | undefined): void;
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Triggers when the underlying connection is established.
|
|
359
|
+
*
|
|
360
|
+
* @event ElectrumClient#connected
|
|
361
|
+
*/
|
|
362
|
+
/**
|
|
363
|
+
* Triggers when the underlying connection is lost.
|
|
364
|
+
*
|
|
365
|
+
* @event ElectrumClient#disconnected
|
|
366
|
+
*/
|
|
367
|
+
/**
|
|
368
|
+
* Triggers when the remote server sends data that is not a request response.
|
|
369
|
+
*
|
|
370
|
+
* @event ElectrumClient#notification
|
|
371
|
+
*/
|
|
372
|
+
/**
|
|
373
|
+
* High-level Electrum client that lets applications send requests and subscribe to notification events from a server.
|
|
374
|
+
*/
|
|
375
|
+
export class ElectrumClient extends EventEmitter {
|
|
376
|
+
connection: ElectrumConnection;
|
|
377
|
+
subscriptionMethods: Record<string, Set<string>>;
|
|
378
|
+
requestId: number;
|
|
379
|
+
requestResolvers: {
|
|
380
|
+
[index: number]: RequestResolver;
|
|
381
|
+
};
|
|
382
|
+
connectionLock: Mutex;
|
|
383
|
+
/**
|
|
384
|
+
* Initializes an Electrum client.
|
|
385
|
+
*
|
|
386
|
+
* @param {string} application your application name, used to identify to the electrum host.
|
|
387
|
+
* @param {string} version protocol version to use with the host.
|
|
388
|
+
* @param {string} host fully qualified domain name or IP number of the host.
|
|
389
|
+
* @param {number} port the TCP network port of the host.
|
|
390
|
+
* @param {TransportScheme} scheme the transport scheme to use for connection
|
|
391
|
+
* @param {number} timeout how long network delays we will wait for before taking action, in milliseconds.
|
|
392
|
+
* @param {number} pingInterval the time between sending pings to the electrum host, in milliseconds.
|
|
393
|
+
* @param {number} reconnectInterval the time between reconnection attempts to the electrum host, in milliseconds.
|
|
394
|
+
* @param {boolean} useBigInt whether to use bigint for numbers in json response.
|
|
395
|
+
*
|
|
396
|
+
* @throws {Error} if `version` is not a valid version string.
|
|
397
|
+
*/
|
|
398
|
+
constructor(application: string, version: string, host: string, port?: number, scheme?: TransportScheme, timeout?: number, pingInterval?: number, reconnectInterval?: number, useBigInt?: boolean);
|
|
399
|
+
/**
|
|
400
|
+
* Connects to the remote server.
|
|
401
|
+
*
|
|
402
|
+
* @throws {Error} if the socket connection fails.
|
|
403
|
+
* @returns a promise resolving when the connection is established.
|
|
404
|
+
*/
|
|
405
|
+
connect(): Promise<void>;
|
|
406
|
+
/**
|
|
407
|
+
* Disconnects from the remote server and removes all event listeners/subscriptions and open requests.
|
|
408
|
+
*
|
|
409
|
+
* @param {boolean} force disconnect even if the connection has not been fully established yet.
|
|
410
|
+
* @param {boolean} retainSubscriptions retain subscription data so they will be restored on reconnection.
|
|
411
|
+
*
|
|
412
|
+
* @returns true if successfully disconnected, or false if there was no connection.
|
|
413
|
+
*/
|
|
414
|
+
disconnect(force?: boolean, retainSubscriptions?: boolean): Promise<boolean>;
|
|
415
|
+
/**
|
|
416
|
+
* Calls a method on the remote server with the supplied parameters.
|
|
417
|
+
*
|
|
418
|
+
* @param {string} method name of the method to call.
|
|
419
|
+
* @param {...string} parameters one or more parameters for the method.
|
|
420
|
+
*
|
|
421
|
+
* @throws {Error} if the client is disconnected.
|
|
422
|
+
* @returns a promise that resolves with the result of the method or an Error.
|
|
423
|
+
*/
|
|
424
|
+
request(method: string, ...parameters: RPCParameter[]): Promise<Error | RequestResponse>;
|
|
425
|
+
/**
|
|
426
|
+
* Subscribes to the method and payload at the server.
|
|
427
|
+
*
|
|
428
|
+
* @note the response for the subscription request is issued as a notification event.
|
|
429
|
+
*
|
|
430
|
+
* @param {string} method one of the subscribable methods the server supports.
|
|
431
|
+
* @param {...string} parameters one or more parameters for the method.
|
|
432
|
+
*
|
|
433
|
+
* @throws {Error} if the client is disconnected.
|
|
434
|
+
* @returns a promise resolving when the subscription is established.
|
|
435
|
+
*/
|
|
436
|
+
subscribe(method: string, ...parameters: RPCParameter[]): Promise<void>;
|
|
437
|
+
/**
|
|
438
|
+
* Unsubscribes to the method at the server and removes any callback functions
|
|
439
|
+
* when there are no more subscriptions for the method.
|
|
440
|
+
*
|
|
441
|
+
* @param {string} method a previously subscribed to method.
|
|
442
|
+
* @param {...string} parameters one or more parameters for the method.
|
|
443
|
+
*
|
|
444
|
+
* @throws {Error} if no subscriptions exist for the combination of the provided `method` and `parameters.
|
|
445
|
+
* @throws {Error} if the client is disconnected.
|
|
446
|
+
* @returns a promise resolving when the subscription is removed.
|
|
447
|
+
*/
|
|
448
|
+
unsubscribe(method: string, ...parameters: RPCParameter[]): Promise<void>;
|
|
449
|
+
/**
|
|
450
|
+
* Parser messages from the remote server to resolve request promises and emit subscription events.
|
|
451
|
+
*
|
|
452
|
+
* @param {RPCNotification | RPCResponse} message the response message
|
|
453
|
+
*
|
|
454
|
+
* @throws {Error} if the message ID does not match an existing request.
|
|
455
|
+
* @ignore
|
|
456
|
+
*/
|
|
457
|
+
response(message: RPCNotification | RPCResponse): void;
|
|
458
|
+
/**
|
|
459
|
+
* Callback function that is called when connection to the Electrum server is lost.
|
|
460
|
+
* Aborts all active requests with an error message indicating that connection was lost.
|
|
461
|
+
*
|
|
462
|
+
* @ignore
|
|
463
|
+
*/
|
|
464
|
+
onConnectionDisconnect(): void;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Triggers when the cluster connects to enough servers to satisfy both the cluster confidence and distribution policies.
|
|
468
|
+
*
|
|
469
|
+
* @event ElectrumCluster#ready
|
|
470
|
+
* @deprecated
|
|
471
|
+
*/
|
|
472
|
+
/**
|
|
473
|
+
* Triggers when the cluster loses a connection and can no longer satisfy the cluster distribution policy.
|
|
474
|
+
*
|
|
475
|
+
* @event ElectrumCluster#degraded
|
|
476
|
+
* @deprecated
|
|
477
|
+
*/
|
|
478
|
+
/**
|
|
479
|
+
* Triggers when the cluster loses a connection and can no longer satisfy the cluster confidence policy.
|
|
480
|
+
*
|
|
481
|
+
* @event ElectrumCluster#disabled
|
|
482
|
+
* @deprecated
|
|
483
|
+
*/
|
|
484
|
+
/**
|
|
485
|
+
* Triggers when the cluster verifies the integrity of remote server sent data that is not a request responses.
|
|
486
|
+
*
|
|
487
|
+
* @event ElectrumCluster#notification
|
|
488
|
+
* @deprecated
|
|
489
|
+
*/
|
|
490
|
+
/**
|
|
491
|
+
* High-level electrum client that provides transparent load balancing, confidence checking and/or low-latency polling.
|
|
492
|
+
* @deprecated
|
|
493
|
+
*/
|
|
494
|
+
export class ElectrumCluster extends EventEmitter {
|
|
495
|
+
application: string;
|
|
496
|
+
version: string;
|
|
497
|
+
confidence: number;
|
|
498
|
+
distribution: number;
|
|
499
|
+
order: ClusterOrder;
|
|
500
|
+
timeout: number;
|
|
501
|
+
pingInterval: number;
|
|
502
|
+
reconnectInterval: number;
|
|
503
|
+
useBigInt: boolean;
|
|
504
|
+
clients: {
|
|
505
|
+
[index: string]: ClientConfig;
|
|
506
|
+
};
|
|
507
|
+
connections: number;
|
|
508
|
+
notifications: Record<string, Set<string>>;
|
|
509
|
+
status: ClusterStatus;
|
|
510
|
+
requestCounter: number;
|
|
511
|
+
requestPromises: {
|
|
512
|
+
[index: number]: Promise<Error | RequestResponse>[];
|
|
513
|
+
};
|
|
514
|
+
requestLock: Mutex;
|
|
515
|
+
responseLock: Mutex;
|
|
516
|
+
/**
|
|
517
|
+
* @param {string} application your application name, used to identify to the electrum hosts.
|
|
518
|
+
* @param {string} version protocol version to use with the hosts.
|
|
519
|
+
* @param {number} confidence wait for this number of hosts to provide identical results.
|
|
520
|
+
* @param {number} distribution request information from this number of hosts.
|
|
521
|
+
* @param {ClusterOrder} order select hosts to communicate with in this order.
|
|
522
|
+
* @param {number} timeout how long network delays we will wait for before taking action, in milliseconds.
|
|
523
|
+
* @param {number} pingInterval the time between sending pings to the electrum host, in milliseconds.
|
|
524
|
+
* @param {number} reconnectInterval the time between reconnection attempts to the electrum host, in milliseconds.
|
|
525
|
+
* @param {boolean} useBigInt whether to use bigint for numbers in json response.
|
|
526
|
+
*/
|
|
527
|
+
constructor(application: string, version: string, confidence?: number, distribution?: number, order?: ClusterOrder, timeout?: number, pingInterval?: number, reconnectInterval?: number, useBigInt?: boolean);
|
|
528
|
+
/**
|
|
529
|
+
* Adds a server to the cluster.
|
|
530
|
+
* @deprecated
|
|
531
|
+
*
|
|
532
|
+
* @param {string} host fully qualified domain name or IP number of the host.
|
|
533
|
+
* @param {number} port the TCP network port of the host.
|
|
534
|
+
* @param {TransportScheme} scheme the transport scheme to use for connection
|
|
535
|
+
* @param {boolean} autoConnect flag indicating whether the server should automatically connect (default true)
|
|
536
|
+
*
|
|
537
|
+
* @throws {Error} if the cluster's version is not a valid version string.
|
|
538
|
+
* @returns a promise that resolves when the connection has been initiated.
|
|
539
|
+
*/
|
|
540
|
+
addServer(host: string, port?: number, scheme?: TransportScheme, autoConnect?: boolean): Promise<void>;
|
|
541
|
+
/**
|
|
542
|
+
* Calls a method on the remote server with the supplied parameters.
|
|
543
|
+
* @deprecated
|
|
544
|
+
*
|
|
545
|
+
* @param {string} method name of the method to call.
|
|
546
|
+
* @param {...string} parameters one or more parameters for the method.
|
|
547
|
+
*
|
|
548
|
+
* @throws {Error} if not enough clients are connected
|
|
549
|
+
* @throws {Error} if no response is received with sufficient integrity
|
|
550
|
+
* @returns a promise that resolves with the result of the method.
|
|
551
|
+
*/
|
|
552
|
+
request(method: string, ...parameters: RPCParameter[]): Promise<Error | RequestResponse>;
|
|
553
|
+
/**
|
|
554
|
+
* Subscribes to the method at the cluster and attaches the callback function to the event feed.
|
|
555
|
+
* @deprecated
|
|
556
|
+
*
|
|
557
|
+
* @note the response for the subscription request is issued as a notification event.
|
|
558
|
+
*
|
|
559
|
+
* @param {string} method one of the subscribable methods the server supports.
|
|
560
|
+
* @param {...string} parameters one or more parameters for the method.
|
|
561
|
+
*
|
|
562
|
+
* @throws {Error} if not enough clients are connected
|
|
563
|
+
* @throws {Error} if no response is received with sufficient integrity for the initial request
|
|
564
|
+
*/
|
|
565
|
+
subscribe(method: string, ...parameters: RPCParameter[]): Promise<void>;
|
|
566
|
+
/**
|
|
567
|
+
* Unsubscribes to the method at the cluster and removes any callback functions
|
|
568
|
+
* when there are no more subscriptions for the method.
|
|
569
|
+
* @deprecated
|
|
570
|
+
*
|
|
571
|
+
* @param {string} method one of the subscribable methods the server supports.
|
|
572
|
+
* @param {...string} parameters one or more parameters for the method.
|
|
573
|
+
*
|
|
574
|
+
* @throws {Error} if, for any of the clients, no subscriptions exist for the combination of the provided `method` and `parameters.
|
|
575
|
+
*/
|
|
576
|
+
unsubscribe(method: string, ...parameters: RPCParameter[]): Promise<void>;
|
|
577
|
+
/**
|
|
578
|
+
* Define a callback function to validate server notifications and pass them to the subscribe callback.
|
|
579
|
+
* @deprecated
|
|
580
|
+
*
|
|
581
|
+
* @ignore
|
|
582
|
+
*/
|
|
583
|
+
handleSubscriptionNotifications(clientIdentity: string, data: RPCNotification): Promise<void>;
|
|
584
|
+
/**
|
|
585
|
+
* Forgets/Removes notification data for a specific notification.
|
|
586
|
+
*
|
|
587
|
+
* This is required in order to allow future identical notifications to be properly processed and emitted.
|
|
588
|
+
* @deprecated
|
|
589
|
+
*/
|
|
590
|
+
dismissSubscriptionNotification(responseDataIdentifier: any): Promise<void>;
|
|
591
|
+
/**
|
|
592
|
+
* Provides a method to check or wait for the cluster to become ready.
|
|
593
|
+
* @deprecated
|
|
594
|
+
*
|
|
595
|
+
* @returns a promise that resolves when the required servers are available.
|
|
596
|
+
*/
|
|
597
|
+
ready(): Promise<boolean>;
|
|
598
|
+
/**
|
|
599
|
+
* Connects all servers from the cluster and attaches event listeners and handlers
|
|
600
|
+
* for all underlying clients and connections.
|
|
601
|
+
* @deprecated
|
|
602
|
+
*
|
|
603
|
+
* @throws {Error} if the cluster's version is not a valid version string.
|
|
604
|
+
*/
|
|
605
|
+
startup(): Promise<void[]>;
|
|
606
|
+
/**
|
|
607
|
+
* Disconnects all servers from the cluster. Removes all event listeners and
|
|
608
|
+
* handlers from all underlying clients and connections. This includes all
|
|
609
|
+
* active subscriptions, unless retainSubscriptions is set to true.
|
|
610
|
+
* @deprecated
|
|
611
|
+
*
|
|
612
|
+
* @param {boolean} retainSubscriptions retain subscription data so they will be restored on reconnection.
|
|
613
|
+
*
|
|
614
|
+
* @returns a list with the disconnection result for every client
|
|
615
|
+
*/
|
|
616
|
+
shutdown(retainSubscriptions?: boolean): Promise<boolean[]>;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;ACCA,oBAA2B,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AAG5D;IAEC,OAAO,EAAE,MAAM,CAAC;CAChB;AAGD,yBAAiC,SAAQ,OAAO;IAE/C,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC;CACxB;AAWD,sBAA8B,SAAQ,OAAO;IAE5C,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CACf;AAED;IAEC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,GAAG,CAAC;CACX;AAGD,0BAAkC,SAAQ,OAAO;IAEhD,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,KAAK,EAAE,QAAQ,CAAC;CAChB;AAGD,mBAA0B,gBAAgB,GAAG,YAAY,CAAC;AE3C1D;;;;;GAKG;AACH;IAEC,MAAM,IAAI;IACV,QAAQ,IAAI;CACZ;AAED;;;;GAIG;AACH;IAEC,GAAG,IAAI;CACP;AAED;;;;;;GAMG;AACH;IAEC,QAAQ,IAAI;IACZ,QAAQ,IAAI;IACZ,KAAK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G;IACG,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,KAAK,GAAG,eAAe,CAAC;IAuK9F;;;;;;;;;;;OAWG;IACG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAsB7E;;;;;;;;;OASG;IACG,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAmB/E;;;;;OAKG;IACG,+BAA+B,CAAC,cAAc,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAiDnG;;;;;OAKG;IACG,+BAA+B,CAAC,sBAAsB,KAAA,GAAG,OAAO,CAAC,IAAI,CAAC;IAK5E;;;;;OAKG;IACG,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC;IA8C/B;;;;;;OAMG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;IAgChC;;;;;;;;;OASG;IACG,QAAQ,CAAC,mBAAmB,GAAE,OAAe,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAwBxE","sources":["lib/lib/util.ts","lib/lib/rpc-interfaces.ts","lib/lib/electrum-protocol.ts","lib/lib/enums.ts","lib/lib/interfaces.ts","lib/lib/constants.ts","lib/lib/electrum-socket.ts","lib/lib/electrum-connection.ts","lib/lib/electrum-client.ts","lib/lib/electrum-cluster.ts","lib/lib/index.ts","lib/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,"export { default as ElectrumClient } from './electrum-client';\nexport { default as ElectrumCluster } from './electrum-cluster';\n\nexport * from './interfaces';\nexport * from './constants';\nexport * from './enums';\n"],"names":[],"version":3,"file":"index.d.ts.map"}
|