@dashevo/dapi-client 1.0.0-pr.1937.B.2 → 1.0.0-rc.1

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/lib/DAPIClient.js CHANGED
@@ -39,7 +39,15 @@ class DAPIClient extends EventEmitter {
39
39
  ...options,
40
40
  };
41
41
 
42
- this.dapiAddressProvider = createDAPIAddressProviderFromOptions(this.options);
42
+ this.logger = logger.getForId(
43
+ this.options.loggerOptions.identifier,
44
+ this.options.loggerOptions.level,
45
+ );
46
+
47
+ this.dapiAddressProvider = createDAPIAddressProviderFromOptions({
48
+ ...this.options,
49
+ logger: this.logger,
50
+ });
43
51
 
44
52
  const grpcTransport = new GrpcTransport(
45
53
  createDAPIAddressProviderFromOptions,
@@ -58,10 +66,6 @@ class DAPIClient extends EventEmitter {
58
66
 
59
67
  this.core = new CoreMethodsFacade(jsonRpcTransport, grpcTransport);
60
68
  this.platform = new PlatformMethodsFacade(grpcTransport);
61
- this.logger = logger.getForId(
62
- this.options.loggerOptions.identifier,
63
- this.options.loggerOptions.level,
64
- );
65
69
 
66
70
  this.initBlockHeadersProvider();
67
71
  }
@@ -1,5 +1,6 @@
1
1
  const SimplifiedMNList = require('@dashevo/dashcore-lib/lib/deterministicmnlist/SimplifiedMNList');
2
2
  const SimplifiedMNListDiff = require('@dashevo/dashcore-lib/lib/deterministicmnlist/SimplifiedMNListDiff');
3
+ const cbor = require('cbor');
3
4
 
4
5
  const logger = require('../logger');
5
6
 
@@ -98,11 +99,15 @@ class SimplifiedMasternodeListProvider {
98
99
  }
99
100
 
100
101
  let simplifiedMNListDiff;
102
+ let simplifiedMNListDiffObject;
101
103
  let simplifiedMNListDiffBuffer;
102
104
  try {
103
105
  simplifiedMNListDiffBuffer = Buffer.from(response.getMasternodeListDiff_asU8());
106
+
107
+ simplifiedMNListDiffObject = cbor.decodeFirstSync(simplifiedMNListDiffBuffer);
108
+
104
109
  simplifiedMNListDiff = new SimplifiedMNListDiff(
105
- simplifiedMNListDiffBuffer,
110
+ simplifiedMNListDiffObject,
106
111
  this.options.network,
107
112
  );
108
113
  } catch (e) {
@@ -112,7 +117,8 @@ class SimplifiedMasternodeListProvider {
112
117
  diffCount,
113
118
  network: this.options.network,
114
119
  error: e,
115
- simplifiedMNListDiff: simplifiedMNListDiffBuffer.toString('hex'),
120
+ simplifiedMNListDiffObject,
121
+ simplifiedMNListDiffBytes: simplifiedMNListDiffBuffer.toString('hex'),
116
122
  },
117
123
  );
118
124
 
@@ -42,6 +42,7 @@ function createMasternodeListStreamFactory(
42
42
  ),
43
43
  {
44
44
  maxRetriesOnError: -1,
45
+ logger: options.logger,
45
46
  },
46
47
  );
47
48
  }
@@ -14,7 +14,7 @@ const InvalidResponseError = require('../response/errors/InvalidResponseError');
14
14
  */
15
15
  function getIdentityContractNonceFactory(grpcTransport) {
16
16
  /**
17
- * Fetch the version upgrade vote status
17
+ * Fetch the version upgrade votes status
18
18
  * @typedef {getIdentityContractNonce}
19
19
  * @param {Buffer} identityId
20
20
  * @param {Buffer} contractId
@@ -17,7 +17,7 @@ const InvalidResponseError = require('../response/errors/InvalidResponseError');
17
17
  */
18
18
  function getIdentityKeysFactory(grpcTransport) {
19
19
  /**
20
- * Fetch the version upgrade vote status
20
+ * Fetch the version upgrade votes status
21
21
  * @typedef {getIdentityKeys}
22
22
  * @param {Buffer} identityId
23
23
  * @param {number[]} keyIds
@@ -14,7 +14,7 @@ const InvalidResponseError = require('../response/errors/InvalidResponseError');
14
14
  */
15
15
  function getIdentityNonceFactory(grpcTransport) {
16
16
  /**
17
- * Fetch the version upgrade vote status
17
+ * Fetch the version upgrade votes status
18
18
  * @typedef {getIdentityNonce}
19
19
  * @param {Buffer} identityId
20
20
  * @param {DAPIClientOptions & {prove: boolean}} [options]
@@ -32,7 +32,7 @@ class GetProtocolVersionUpgradeVoteStatusResponse extends AbstractResponse {
32
32
  );
33
33
 
34
34
  if (!versions && !proof) {
35
- throw new InvalidResponseError('Version upgrade vote status is not defined');
35
+ throw new InvalidResponseError('Version upgrade votes status is not defined');
36
36
  }
37
37
 
38
38
  let versionSignals = [];
@@ -14,7 +14,7 @@ const InvalidResponseError = require('../response/errors/InvalidResponseError');
14
14
  */
15
15
  function getProtocolVersionUpgradeVoteStatusFactory(grpcTransport) {
16
16
  /**
17
- * Fetch the version upgrade vote status
17
+ * Fetch the version upgrade votes status
18
18
  * @typedef {getProtocolVersionUpgradeVoteStatus}
19
19
  * @param {string} startProTxHash
20
20
  * @param {number} count
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dashevo/dapi-client",
3
- "version": "1.0.0-pr.1937.B.2",
3
+ "version": "1.0.0-rc.1",
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": "1.0.0-pr.1937.B.2",
30
- "@dashevo/dash-spv": "1.0.0-pr.1937.B.2",
31
- "@dashevo/dashcore-lib": "~0.21.2",
32
- "@dashevo/grpc-common": "1.0.0-pr.1937.B.2",
33
- "@dashevo/wasm-dpp": "1.0.0-pr.1937.B.2",
29
+ "@dashevo/dapi-grpc": "1.0.0-rc.1",
30
+ "@dashevo/dash-spv": "1.0.0-rc.1",
31
+ "@dashevo/dashcore-lib": "~0.21.3",
32
+ "@dashevo/grpc-common": "1.0.0-rc.1",
33
+ "@dashevo/wasm-dpp": "1.0.0-rc.1",
34
34
  "bs58": "^4.0.1",
35
35
  "cbor": "^8.0.0",
36
36
  "google-protobuf": "^3.12.2",