@dashevo/dapi-client 0.22.0-dev.4 → 0.22.0-dev.5

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
@@ -12,7 +12,7 @@ Platform via the decentralized API ([DAPI](https://github.com/dashevo/dapi))
12
12
  hosted on Dash masternodes.
13
13
 
14
14
  - `DAPI-Client` provides automatic server (masternode) discovery using either a default seed node or a user-supplied one
15
- - `DAPI-Client` maps to DAPI's [RPC](https://github.com/dashevo/dapi/tree/master/lib/rpcServer/commands) and [gRPC](https://github.com/dashevo/dapi/tree/master/lib/grpcServer/handlers) endpoints
15
+ - `DAPI-Client` maps to DAPI's [RPC](https://github.com/dashevo/platform/tree/master/packages/dapi/lib/rpcServer/commands) and [gRPC](https://github.com/dashevo/platform/tree/master/packages/dapi/lib/grpcServer/handlers) endpoints
16
16
 
17
17
  ## Table of Contents
18
18
  - [Install](#install)
@@ -101,12 +101,12 @@ client.core.getBestBlockHash(options).then((r) => {
101
101
 
102
102
  ## Documentation
103
103
 
104
- More extensive documentation available at https://dashevo.github.io/js-dapi-client/.
104
+ More extensive documentation available at https://dashevo.github.io/platform/DAPI-Client/.
105
105
 
106
106
 
107
107
  ## Contributing
108
108
 
109
- Feel free to dive in! [Open an issue](https://github.com/dashevo/js-dapi-client/issues/new/choose) or submit PRs.
109
+ Feel free to dive in! [Open an issue](https://github.com/dashevo/platform/issues/new/choose) or submit PRs.
110
110
 
111
111
  ## License
112
112
 
@@ -1,3 +1,5 @@
1
+ const cbor = require('cbor');
2
+
1
3
  const AbstractResponse = require('../response/AbstractResponse');
2
4
 
3
5
  class GetIdentitiesByPublicKeyHashesResponse extends AbstractResponse {
@@ -13,7 +15,7 @@ class GetIdentitiesByPublicKeyHashesResponse extends AbstractResponse {
13
15
  }
14
16
 
15
17
  /**
16
- * @returns {Buffer[]}
18
+ * @returns {Array<Buffer[]>}
17
19
  */
18
20
  getIdentities() {
19
21
  return this.identities;
@@ -27,8 +29,13 @@ class GetIdentitiesByPublicKeyHashesResponse extends AbstractResponse {
27
29
  const { metadata, proof } = AbstractResponse.createMetadataAndProofFromProto(proto);
28
30
 
29
31
  return new GetIdentitiesByPublicKeyHashesResponse(
30
- proto.getIdentitiesList()
31
- .map((identity) => (identity.length > 0 ? Buffer.from(identity) : null)),
32
+ proto.getIdentitiesList().map((identitiesSerialized) => {
33
+ const identities = cbor.decode(identitiesSerialized);
34
+
35
+ return identities.map((identity) => (
36
+ (identity.length > 0 ? Buffer.from(identity) : null)
37
+ ));
38
+ }),
32
39
  metadata,
33
40
  proof,
34
41
  );
@@ -1,3 +1,5 @@
1
+ const cbor = require('cbor');
2
+
1
3
  const AbstractResponse = require('../response/AbstractResponse');
2
4
 
3
5
  class GetIdentityIdsByPublicKeyHashesResponse extends AbstractResponse {
@@ -13,7 +15,7 @@ class GetIdentityIdsByPublicKeyHashesResponse extends AbstractResponse {
13
15
  }
14
16
 
15
17
  /**
16
- * @returns {Buffer[]}
18
+ * @returns {Array<Buffer[]>}
17
19
  */
18
20
  getIdentityIds() {
19
21
  return this.identityIds;
@@ -27,8 +29,13 @@ class GetIdentityIdsByPublicKeyHashesResponse extends AbstractResponse {
27
29
  const { metadata, proof } = AbstractResponse.createMetadataAndProofFromProto(proto);
28
30
 
29
31
  return new GetIdentityIdsByPublicKeyHashesResponse(
30
- proto.getIdentityIdsList()
31
- .map((identityId) => (identityId.length > 0 ? Buffer.from(identityId) : null)),
32
+ proto.getIdentityIdsList().map((identityIdsSerialized) => {
33
+ const identityIds = cbor.decode(identityIdsSerialized);
34
+
35
+ return identityIds.map((identityId) => (
36
+ (identityId.length > 0 ? Buffer.from(identityId) : null)
37
+ ));
38
+ }),
32
39
  metadata,
33
40
  proof,
34
41
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dashevo/dapi-client",
3
- "version": "0.22.0-dev.4",
3
+ "version": "0.22.0-dev.5",
4
4
  "description": "Client library used to access Dash DAPI endpoints",
5
5
  "main": "lib/DAPIClient.js",
6
6
  "contributors": [
@@ -26,10 +26,10 @@
26
26
  }
27
27
  ],
28
28
  "dependencies": {
29
- "@dashevo/dapi-grpc": "~0.22.0-dev.4",
29
+ "@dashevo/dapi-grpc": "~0.22.0-dev.5",
30
30
  "@dashevo/dashcore-lib": "~0.19.28",
31
- "@dashevo/dpp": "~0.22.0-dev.4",
32
- "@dashevo/grpc-common": "~0.22.0-dev.4",
31
+ "@dashevo/dpp": "~0.22.0-dev.5",
32
+ "@dashevo/grpc-common": "~0.22.0-dev.5",
33
33
  "@grpc/grpc-js": "^1.3.7",
34
34
  "axios": "^0.21.1",
35
35
  "bs58": "^4.0.1",