@dashevo/dapi-client 0.24.0-dev.16 → 0.24.0-dev.18

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 CHANGED
@@ -50,7 +50,7 @@ const DAPIClient = require('@dashevo/dapi-client');
50
50
  var client = new DAPIClient({
51
51
  seeds: [{
52
52
  host: 'seed-1.evonet.networks.dash.org',
53
- port: 3000,
53
+ port: 443,
54
54
  }],
55
55
  });
56
56
 
@@ -70,8 +70,8 @@ const DAPIClient = require('@dashevo/dapi-client');
70
70
 
71
71
  var client = new DAPIClient({
72
72
  dapiAddresses: [
73
- '127.0.0.1:3000',
74
- '127.0.0.2:3000',
73
+ '127.0.0.1:443',
74
+ '127.0.0.2:443',
75
75
  ],
76
76
  });
77
77
 
@@ -167,14 +167,14 @@ class DAPIAddress {
167
167
  }
168
168
  }
169
169
 
170
- DAPIAddress.DEFAULT_PORT = 3000;
170
+ DAPIAddress.DEFAULT_PORT = 443;
171
171
  DAPIAddress.DEFAULT_PROTOCOL = 'https';
172
172
 
173
173
  /**
174
174
  * @typedef {object} RawDAPIAddress
175
175
  * @property {string} protocol
176
176
  * @property {string} host
177
- * @property {number} [port=3000]
177
+ * @property {number} [port=443]
178
178
  * @property {string} [proRegTxHash]
179
179
  * @property {bool} [selfSigned]
180
180
  */
@@ -30,7 +30,7 @@ class ListDAPIAddressProvider {
30
30
  }
31
31
 
32
32
  // This is a temporary fix for a localhost masternode.
33
- // On mac os, internal docker IP is used to register masternode, and it's
33
+ // On macOS, internal docker IP is used to register masternode, and it's
34
34
  // not really possible to bind to that address, so that workaround is introduced.
35
35
  const network = networks.get(this.options.network);
36
36
  if (network && network.regtestEnabled) {
@@ -39,7 +39,7 @@ class ListDAPIAddressProvider {
39
39
  liveAddress.protocol = 'https';
40
40
  liveAddress.host = '127.0.0.1';
41
41
  liveAddress.allowSelfSignedCertificate = true;
42
- liveAddress.port = 3000 + randomNodeIndex * 100;
42
+ liveAddress.port = 2443 + randomNodeIndex * 100;
43
43
  }
44
44
 
45
45
  return liveAddress;
@@ -19,10 +19,15 @@ class SimplifiedMasternodeListDAPIAddressProvider {
19
19
  */
20
20
  async getLiveAddress() {
21
21
  const sml = await this.smlProvider.getSimplifiedMNList();
22
- const validMasternodeList = sml.getValidMasternodesList();
22
+ const validMasternodeList = sml.getValidMasternodesList()
23
+ // Keep only HP masternodes
24
+ .filter((smlEntry) => smlEntry.nType === 1);
23
25
 
24
26
  const addressesByRegProTxHashes = {};
27
+ let allowSelfSignedCertificate;
25
28
  this.listDAPIAddressProvider.getAllAddresses().forEach((address) => {
29
+ allowSelfSignedCertificate = address.isSelfSignedCertificateAllowed();
30
+
26
31
  if (!address.getProRegTxHash()) {
27
32
  return;
28
33
  }
@@ -36,6 +41,8 @@ class SimplifiedMasternodeListDAPIAddressProvider {
36
41
  if (!address) {
37
42
  address = new DAPIAddress({
38
43
  host: smlEntry.getIp(),
44
+ port: smlEntry.platformHTTPPort,
45
+ allowSelfSignedCertificate,
39
46
  proRegTxHash: smlEntry.proRegTxHash,
40
47
  });
41
48
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dashevo/dapi-client",
3
- "version": "0.24.0-dev.16",
3
+ "version": "0.24.0-dev.18",
4
4
  "description": "Client library used to access Dash DAPI endpoints",
5
5
  "main": "lib/index.js",
6
6
  "contributors": [
@@ -26,11 +26,11 @@
26
26
  }
27
27
  ],
28
28
  "dependencies": {
29
- "@dashevo/dapi-grpc": "0.24.0-dev.16",
30
- "@dashevo/dash-spv": "0.24.0-dev.16",
29
+ "@dashevo/dapi-grpc": "0.24.0-dev.18",
30
+ "@dashevo/dash-spv": "0.24.0-dev.18",
31
31
  "@dashevo/dashcore-lib": "~0.20.0",
32
- "@dashevo/dpp": "0.24.0-dev.16",
33
- "@dashevo/grpc-common": "0.24.0-dev.16",
32
+ "@dashevo/dpp": "0.24.0-dev.18",
33
+ "@dashevo/grpc-common": "0.24.0-dev.18",
34
34
  "bs58": "^4.0.1",
35
35
  "cbor": "^8.0.0",
36
36
  "lodash": "^4.17.21",