electrum-cash
Advanced tools
Comparing version 2.0.5 to 2.0.6
@@ -55,2 +55,3 @@ /// <reference types="node" /> | ||
* @property {3} CONNECTING The connection is connecting. | ||
* @property {4} RECONNECTING The connection is restarting. | ||
*/ | ||
@@ -61,3 +62,4 @@ declare enum ConnectionStatus { | ||
DISCONNECTING = 2, | ||
CONNECTING = 3 | ||
CONNECTING = 3, | ||
RECONNECTING = 4 | ||
} | ||
@@ -146,4 +148,4 @@ //# sourceMappingURL=enums.d.ts.map | ||
}; | ||
onConnectHasRun: boolean; | ||
eventForwarders: { | ||
connect: () => boolean; | ||
disconnect: () => boolean; | ||
@@ -162,8 +164,19 @@ tcpData: (data: string) => boolean; | ||
* @param {number} timeout If no connection is established after `timeout` ms, the connection is terminated | ||
* @param {boolean} retryOnFailure If true, retry if connection fails after timeout. | ||
* | ||
* @throws {Error} if an incorrect transport scheme is specified | ||
*/ | ||
connect(host: string, port: number, scheme: TransportScheme, timeout: number, retryOnFailure: boolean): void; | ||
connect(host: string, port: number, scheme: TransportScheme, timeout: number): void; | ||
/** | ||
* Sets up forwarding of events related to the connection. | ||
* | ||
* @param {string} connectionType Name of the connection/transport type, used for logging. | ||
* @param {string} host Fully qualified domain name or IP address of the host | ||
* @param {number} port Network port for the host to connect to | ||
*/ | ||
onConnect(connectionType: string, host: string, port: number): void; | ||
/** | ||
* Clears the disconnect timer if it is still active. | ||
*/ | ||
private clearDisconnectTimerOnTimeout; | ||
/** | ||
* Forcibly terminate the connection. | ||
@@ -193,12 +206,2 @@ * | ||
disconnectOnTimeout(host: string, port: number, timeout: number): void; | ||
/** | ||
* Force a reconnect after a of `timeout` milliseconds. | ||
* | ||
* @param {string} host Host of the connection that timed out | ||
* @param {number} port Port of the connection that timed out | ||
* @param {TransportScheme} scheme Transport scheme to use | ||
* @param {number} timeout Elapsed milliseconds | ||
*/ | ||
retryOnTimeout(host: string, port: number, scheme: TransportScheme, timeout: number): void; | ||
private clearAllTimers; | ||
} | ||
@@ -242,2 +245,6 @@ //# sourceMappingURL=electrum-socket.d.ts.map | ||
/** | ||
* Returns a string for the host identifier for usage in debug messages. | ||
*/ | ||
get hostIdentifier(): string; | ||
/** | ||
* Create and configures a fresh socket and attaches all relevant listeners. | ||
@@ -268,8 +275,6 @@ */ | ||
* | ||
* @param {boolean} retryOnFailure If true, the connection will be retried until successful. | ||
* | ||
* @throws {Error} if the socket connection fails. | ||
* @returns a promise resolving to true when the connection is established | ||
* @returns a promise resolving when the connection is established | ||
*/ | ||
connect(retryOnFailure?: boolean): Promise<boolean>; | ||
connect(): Promise<void>; | ||
/** | ||
@@ -280,2 +285,14 @@ * Restores the network connection. | ||
/** | ||
* Removes the current reconnect timer. | ||
*/ | ||
clearReconnectTimer(): void; | ||
/** | ||
* Removes the current keep-alive timer. | ||
*/ | ||
clearKeepAliveTimer(): void; | ||
/** | ||
* Initializes the keep alive timer loop. | ||
*/ | ||
setupKeepAliveTimer(): void; | ||
/** | ||
* Tears down the current connection and removes all event listeners on disconnect. | ||
@@ -299,3 +316,3 @@ * | ||
* Marks the connection as timed out and schedules reconnection if we have not | ||
* received data within the expected timeframe. | ||
* received data within the expected time frame. | ||
*/ | ||
@@ -324,3 +341,3 @@ verifySend(sentTimestamp: number): void; | ||
/** | ||
* Triggers when the underlyng connection is lost. | ||
* Triggers when the underlying connection is lost. | ||
* | ||
@@ -358,8 +375,6 @@ * @event ElectrumClient#disconnected | ||
* | ||
* @param {boolean} retryOnFailure If true, the connection will be retried until successful. | ||
* | ||
* @throws {Error} if the socket connection fails. | ||
* @returns a promise resolving to true when the connection is established. | ||
* @returns a promise resolving when the connection is established. | ||
*/ | ||
connect(retryOnFailure?: boolean): Promise<boolean>; | ||
connect(): Promise<void>; | ||
/** | ||
@@ -405,3 +420,3 @@ * Disconnects from the remote server and removes all event listeners/subscriptions and open requests. | ||
* @throws {Error} if the client is disconnected. | ||
* @returns a promise that resovles to true when the subscription has been cancelled. | ||
* @returns a promise that resolves to true when the subscription has been cancelled. | ||
*/ | ||
@@ -418,3 +433,3 @@ unsubscribe(callback: SubscribeCallback, method: string, ...parameters: RPCParameter[]): Promise<true>; | ||
*/ | ||
resubscribe(): Promise<true>; | ||
private resubscribeOnConnect; | ||
/** | ||
@@ -429,2 +444,7 @@ * Parser messages from the remote server to resolve request promises and emit subscription events. | ||
response(message: RPCNotification | RPCResponse): void; | ||
/** | ||
* Callback function that is called when connection to the Electrum server is lost. | ||
* Aborts all active requests with an error message indicating that connection was lost. | ||
*/ | ||
onConnectionDisconnect(): void; | ||
} | ||
@@ -488,5 +508,5 @@ //# sourceMappingURL=electrum-client.d.ts.map | ||
* @throws {Error} if the cluster's version is not a valid version string. | ||
* @returns a promise that resolves to true when the connection has been initiated. | ||
* @returns a promise that resolves when the connection has been initiated. | ||
*/ | ||
addServer(host: string, port?: number, scheme?: TransportScheme, autoConnect?: boolean): Promise<boolean>; | ||
addServer(host: string, port?: number, scheme?: TransportScheme, autoConnect?: boolean): Promise<void>; | ||
/** | ||
@@ -540,3 +560,3 @@ * Calls a method on the remote server with the supplied parameters. | ||
*/ | ||
startup(): Promise<boolean[]>; | ||
startup(): Promise<void[]>; | ||
/** | ||
@@ -543,0 +563,0 @@ * Disconnects all servers from the cluster. Removes all event listeners and |
{ | ||
"name": "electrum-cash", | ||
"version": "2.0.5", | ||
"version": "2.0.6", | ||
"description": "Electrum-cash is a lightweight JavaScript library that lets you connect with one or more Electrum servers.", | ||
@@ -27,3 +27,4 @@ "main": "dist/index.cjs.js", | ||
"rollup": "rollup -c", | ||
"postrollup": "del ./dist/module ./dist/main" | ||
"postrollup": "del ./dist/module ./dist/main", | ||
"spellcheck": "cspell '**'" | ||
}, | ||
@@ -54,2 +55,3 @@ "repository": { | ||
"@ava/typescript": "^1.1.1", | ||
"@generalprotocols/cspell-dictionary": "git+https://gitlab.com/GeneralProtocols/cspell-dictionary.git", | ||
"@generalprotocols/eslint-config": "git+https://gitlab.com/GeneralProtocols/eslint-config.git", | ||
@@ -60,2 +62,3 @@ "@types/debug": "^4.1.5", | ||
"c8": "^7.2.1", | ||
"cspell": "4.1.2", | ||
"del-cli": "^3.0.1", | ||
@@ -62,0 +65,0 @@ "docdash": "^1.2.0", |
@@ -38,3 +38,3 @@ # electrum-cash | ||
After you have loaded the appropiate module you need to initialize the module by configuring your **application identifier** and **protocol version**. | ||
After you have loaded the appropriate module you need to initialize the module by configuring your **application identifier** and **protocol version**. | ||
@@ -128,3 +128,3 @@ If you only want to use a single server, initialize an `ElectrumClient` and connect to the server: | ||
If you need help with how to use the library or just want to talk about electrum-cash, you can find us on [Telegram](https://t.me/electrumcash) and [Discord](https://discord.gg/ZjXQzew). | ||
If you need help with how to use the library or just want to talk about electrum-cash, you can find us on [Telegram](https://t.me/electrumcash) and [Discord](https://discord.gg/ZjXQzew). | ||
@@ -131,0 +131,0 @@ You can also read our tutorials on [read.cash](https://read.cash/c/electrum-cash-f45e), or share your own. |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
197799
3863
17