@dashevo/dapi-client 0.25.0-dev.16 → 0.25.0-dev.17

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.
@@ -5,9 +5,10 @@ const {
5
5
  },
6
6
  } = require('@dashevo/dapi-grpc');
7
7
 
8
+ const { UInt32Value } = require('google-protobuf/google/protobuf/wrappers_pb');
9
+
8
10
  const GetDataContractHistoryResponse = require('./GetDataContractHistoryResponse');
9
11
  const InvalidResponseError = require('../response/errors/InvalidResponseError');
10
-
11
12
  /**
12
13
  * @param {GrpcTransport} grpcTransport
13
14
  * @returns {getDataContractHistory}
@@ -43,8 +44,8 @@ function getDataContractHistoryFactory(grpcTransport) {
43
44
 
44
45
  getDataContractHistoryRequest.setId(contractId);
45
46
  getDataContractHistoryRequest.setStartAtMs(startAtMs);
46
- getDataContractHistoryRequest.setLimit(limit);
47
- getDataContractHistoryRequest.setOffset(offset);
47
+ getDataContractHistoryRequest.setLimit(new UInt32Value([limit]));
48
+ getDataContractHistoryRequest.setOffset(new UInt32Value([offset]));
48
49
  getDataContractHistoryRequest.setProve(!!options.prove);
49
50
 
50
51
  let lastError;
@@ -1,6 +1,6 @@
1
- const ServerError = require('../../errors/response/RetriableResponseError');
1
+ const RetriableResponseError = require('../../errors/response/RetriableResponseError');
2
2
 
3
- class InternalServerError extends ServerError {
3
+ class InternalServerError extends RetriableResponseError {
4
4
  /**
5
5
  * @param {number} code
6
6
  * @param {string} message
@@ -1,7 +1,6 @@
1
1
  const https = require('https');
2
2
  const JsonRpcError = require('./errors/JsonRpcError');
3
3
  const WrongHttpCodeError = require('./errors/WrongHttpCodeError');
4
-
5
4
  /**
6
5
  * @typedef {requestJsonRpc}
7
6
  * @param {string} protocol
@@ -58,7 +57,6 @@ async function requestJsonRpc(protocol, host, port, selfSigned, method, params,
58
57
  rejectUnauthorized: false,
59
58
  });
60
59
  }
61
-
62
60
  // eslint-disable-next-line
63
61
  const response = await fetch(url, requestOptions);
64
62
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dashevo/dapi-client",
3
- "version": "0.25.0-dev.16",
3
+ "version": "0.25.0-dev.17",
4
4
  "description": "Client library used to access Dash DAPI endpoints",
5
5
  "main": "lib/index.js",
6
6
  "contributors": [
@@ -26,14 +26,15 @@
26
26
  }
27
27
  ],
28
28
  "dependencies": {
29
- "@dashevo/dapi-grpc": "0.25.0-dev.16",
30
- "@dashevo/dash-spv": "0.25.0-dev.16",
29
+ "@dashevo/dapi-grpc": "0.25.0-dev.17",
30
+ "@dashevo/dash-spv": "0.25.0-dev.17",
31
31
  "@dashevo/dashcore-lib": "~0.20.9",
32
- "@dashevo/dpp": "0.25.0-dev.16",
33
- "@dashevo/grpc-common": "0.25.0-dev.16",
34
- "@dashevo/wasm-dpp": "0.25.0-dev.16",
32
+ "@dashevo/dpp": "0.25.0-dev.17",
33
+ "@dashevo/grpc-common": "0.25.0-dev.17",
34
+ "@dashevo/wasm-dpp": "0.25.0-dev.17",
35
35
  "bs58": "^4.0.1",
36
36
  "cbor": "^8.0.0",
37
+ "google-protobuf": "^3.12.2",
37
38
  "lodash": "^4.17.21",
38
39
  "node-fetch": "^2.6.7",
39
40
  "node-inspect-extracted": "^1.0.8",
@@ -55,7 +56,6 @@
55
56
  "eslint-plugin-import": "^2.24.2",
56
57
  "eslint-plugin-jsdoc": "^27.0.0",
57
58
  "events": "^3.3.0",
58
- "google-protobuf": "^3.12.2",
59
59
  "karma": "^6.4.1",
60
60
  "karma-chai": "^0.1.0",
61
61
  "karma-chrome-launcher": "^3.1.0",
@@ -2,7 +2,7 @@
2
2
 
3
3
  const { default: fetch, Headers, Request, Response } = require('node-fetch');
4
4
 
5
- if (!globalThis.fetch) {
5
+ if (typeof window === 'undefined') {
6
6
  globalThis.fetch = fetch;
7
7
  globalThis.Headers = Headers;
8
8
  globalThis.Request = Request;