@dashevo/dapi-client 0.23.0-dev.2 → 0.23.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/lib/index.js ADDED
@@ -0,0 +1,9 @@
1
+ const DAPIClient = require('./DAPIClient');
2
+
3
+ const NotFoundError = require('./transport/GrpcTransport/errors/NotFoundError');
4
+
5
+ DAPIClient.Errors = {
6
+ NotFoundError,
7
+ };
8
+
9
+ module.exports = DAPIClient;
@@ -2,7 +2,6 @@ const broadcastStateTransitionFactory = require('./broadcastStateTransition/broa
2
2
  const getDataContractFactory = require('./getDataContract/getDataContractFactory');
3
3
  const getDocumentsFactory = require('./getDocuments/getDocumentsFactory');
4
4
  const getIdentityFactory = require('./getIdentity/getIdentityFactory');
5
- const getIdentityIdsByPublicKeyHashesFactory = require('./getIdentityIdsByPublicKeyHashes/getIdentityIdsByPublicKeyHashesFactory');
6
5
  const getIdentitiesByPublicKeyHashesFactory = require('./getIdentitiesByPublicKeyHashes/getIdentitiesByPublicKeyHashesFactory');
7
6
  const waitForStateTransitionResultFactory = require('./waitForStateTransitionResult/waitForStateTransitionResultFactory');
8
7
  const getConsensusParamsFactory = require('./getConsensusParams/getConsensusParamsFactory');
@@ -16,7 +15,6 @@ class PlatformMethodsFacade {
16
15
  this.getDataContract = getDataContractFactory(grpcTransport);
17
16
  this.getDocuments = getDocumentsFactory(grpcTransport);
18
17
  this.getIdentity = getIdentityFactory(grpcTransport);
19
- this.getIdentityIdsByPublicKeyHashes = getIdentityIdsByPublicKeyHashesFactory(grpcTransport);
20
18
  this.getIdentitiesByPublicKeyHashes = getIdentitiesByPublicKeyHashesFactory(grpcTransport);
21
19
  this.waitForStateTransitionResult = waitForStateTransitionResultFactory(grpcTransport);
22
20
  this.getConsensusParams = getConsensusParamsFactory(grpcTransport);
@@ -1,5 +1,3 @@
1
- const cbor = require('cbor');
2
-
3
1
  const AbstractResponse = require('../response/AbstractResponse');
4
2
 
5
3
  class GetIdentitiesByPublicKeyHashesResponse extends AbstractResponse {
@@ -15,7 +13,7 @@ class GetIdentitiesByPublicKeyHashesResponse extends AbstractResponse {
15
13
  }
16
14
 
17
15
  /**
18
- * @returns {Array<Buffer[]>}
16
+ * @returns {Buffer[]}
19
17
  */
20
18
  getIdentities() {
21
19
  return this.identities;
@@ -29,13 +27,7 @@ class GetIdentitiesByPublicKeyHashesResponse extends AbstractResponse {
29
27
  const { metadata, proof } = AbstractResponse.createMetadataAndProofFromProto(proto);
30
28
 
31
29
  return new GetIdentitiesByPublicKeyHashesResponse(
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
- }),
30
+ proto.getIdentitiesList_asU8().map((identity) => Buffer.from(identity)),
39
31
  metadata,
40
32
  proof,
41
33
  );