New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@electrum-cash/network

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@electrum-cash/network - npm Package Compare versions

Comparing version

to
4.0.0-development.6392223875

33

dist/index.d.ts

@@ -25,32 +25,2 @@ import { EventEmitter } from "events";

/**
* Enum that denotes the ordering to use in an ElectrumCluster.
* @enum {number}
* @property {0} RANDOM Send requests to randomly selected servers in the cluster.
* @property {1} PRIORITY Send requests to servers in the cluster in the order they were added.
*/
export enum ClusterOrder {
RANDOM = 0,
PRIORITY = 1
}
/**
* Enum that denotes the distribution setting to use in an ElectrumCluster.
* @enum {number}
* @property {0} ALL Send requests to all servers in the cluster.
*/
export enum ClusterDistribution {
ALL = 0
}
/**
* Enum that denotes the ready status of an ElectrumCluster.
* @enum {number}
* @property {0} DISABLED The cluster is disabled and unusable.
* @property {1} DEGRADED The cluster is degraded but still usable.
* @property {2} READY The cluster is healthy and ready for use.
*/
export enum ClusterStatus {
DISABLED = 0,
DEGRADED = 1,
READY = 2
}
/**
* Enum that denotes the availability of an ElectrumClient.

@@ -142,5 +112,2 @@ * @enum {number}

PING_INTERVAL: number;
CLUSTER_CONFIDENCE: number;
CLUSTER_DISTRIBUTION: ClusterDistribution;
CLUSTER_ORDER: ClusterOrder;
USE_BIG_INT: boolean;

@@ -147,0 +114,0 @@ };

2

package.json
{
"name": "@electrum-cash/network",
"version": "4.0.0-development.6391574314",
"version": "4.0.0-development.6392223875",
"description": "@electrum-cash/network is a lightweight JavaScript library that lets you connect with one or more Electrum servers.",

@@ -5,0 +5,0 @@ "homepage": "https://gitlab.com/electrum-cash/network#readme",

@@ -22,4 +22,2 @@ # electrum-cash

If you only want to use a **single server**, load the `ElectrumClient` module:
```js

@@ -30,9 +28,2 @@ // Load the electrum library.

If you want to use **multiple servers**, load the `ElectrumCluster` module:
```js
// Load the electrum library.
const { ElectrumCluster } = require('electrum-cash');
```
### Usage on Web

@@ -69,25 +60,5 @@

If you want to use multiple servers, initialize an `ElectrumCluster` and add some servers:
*For more information on various cluster configurations, read the [cluster documentation](https://read.cash/@JonathanSilverblood/electrum-cash-strategic-use-of-clusters-83743111).*
```js
// Initialize an electrum cluster where 2 out of 3 needs to be consistent, polled randomly with fail-over (default).
const electrum = new ElectrumCluster('Electrum cluster example', '1.4.1', 2, 3);
// Add some servers to the cluster.
electrum.addServer('bch.imaginary.cash');
electrum.addServer('electroncash.de');
electrum.addServer('electroncash.dk');
electrum.addServer('electron.jochen-hoenicke.de', 51002);
electrum.addServer('electrum.imaginary.cash');
// Wait for enough connections to be available.
await electrum.ready();
```
### Request information
Once your `ElectrumClient` or `ElectrumCluster` is connected and ready, you can call methods:
Once your `ElectrumClient` is connected and ready, you can call methods:

@@ -109,3 +80,3 @@ *For a list of methods you can use, refer to the [Electrum Cash documentation](https://bitcoincash.network/electrum/).*

Once your `ElectrumClient` or `ElectrumCluster` is connected and ready, you can set up subscriptions to get notifications on events:
Once your `ElectrumClient` is connected and ready, you can set up subscriptions to get notifications on events:

@@ -154,9 +125,2 @@ *For a list of methods you can subscribe to, refer to the [Electrum Cash documentation](https://bitcoincash.network/electrum/).*

If you're using a `ElectrumCluster` with multiple servers, call the `shutdown()` function.
```js
// Close all connections.
await electrum.shutdown();
```
## Documentation

@@ -163,0 +127,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet