@pioneer-platform/blockbook 8.1.64 → 8.1.66

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.d.ts CHANGED
@@ -7,6 +7,7 @@ declare const https: any;
7
7
  declare const nodes: any;
8
8
  declare const axios: any;
9
9
  declare const axiosRetry: any;
10
+ declare let NOW_NODES_API: string | undefined;
10
11
  declare let BLOCKBOOK_URLS: any;
11
12
  declare let BLOCKBOOK_SOCKETS: any;
12
13
  declare let init_network: (servers?: any[]) => Promise<boolean>;
package/lib/index.js CHANGED
@@ -49,9 +49,13 @@ var nodes = require("@pioneer-platform/nodes");
49
49
  var axios = Axios.create({
50
50
  httpsAgent: new https.Agent({
51
51
  rejectUnauthorized: false
52
- })
52
+ }),
53
+ timeout: 30000 // 10 seconds
53
54
  });
54
55
  var axiosRetry = require('axios-retry');
56
+ var NOW_NODES_API = process.env['NOW_NODES_API'];
57
+ if (!NOW_NODES_API)
58
+ throw Error("NOW_NODES_API is required");
55
59
  axiosRetry(axios, {
56
60
  retries: 3,
57
61
  retryDelay: function (retryCount) {
@@ -446,15 +450,17 @@ var get_utxos_by_xpub = function (coin, xpub) {
446
450
  _a.label = 1;
447
451
  case 1:
448
452
  _a.trys.push([1, 3, , 4]);
449
- url = BLOCKBOOK_URLS[coin.toUpperCase()] + "/api/v2/utxo/" + xpub + "?confirmed=false";
453
+ log.info(tag, "get_utxos_by_xpub: ", BLOCKBOOK_URLS);
454
+ url = BLOCKBOOK_URLS[coin.toUpperCase()] + "/" + NOW_NODES_API + "/api/v2/utxo/" + xpub + "?confirmed=false";
455
+ console.log("url: ", url);
450
456
  body = {
451
457
  method: 'GET',
452
458
  url: url,
453
- headers: {
454
- 'api-key': process.env['NOW_NODES_API'],
455
- 'content-type': 'application/json',
456
- 'User-Agent': fakeUa()
457
- },
459
+ // headers: {
460
+ // 'api-key': NOW_NODES_API,
461
+ // 'content-type': 'application/json',
462
+ // 'User-Agent': fakeUa()
463
+ // },
458
464
  };
459
465
  return [4 /*yield*/, axios(body)];
460
466
  case 2:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pioneer-platform/blockbook",
3
- "version": "8.1.64",
3
+ "version": "8.1.66",
4
4
  "main": "./lib/index.js",
5
5
  "types": "./lib/main.d.ts",
6
6
  "scripts": {
@@ -15,7 +15,7 @@
15
15
  "dependencies": {
16
16
  "@altangent/lib-blockbook": "^0.12.9",
17
17
  "@pioneer-platform/loggerdog": "^8.1.31",
18
- "@pioneer-platform/nodes": "^8.1.37",
18
+ "@pioneer-platform/nodes": "^8.1.38",
19
19
  "@pioneer-platform/pioneer-client": "^9.0.18",
20
20
  "@types/request-promise-native": "^1.0.17",
21
21
  "@types/ws": "^7.4.2",
@@ -31,5 +31,5 @@
31
31
  "ts-node": "^10.9.1",
32
32
  "typescript": "^5.0.2"
33
33
  },
34
- "gitHead": "23a487e92ce077dbbd9c5ea694c1c688885a2b27"
34
+ "gitHead": "bc0fcffd1ceb16cb7db6e63664dc78361ccb783e"
35
35
  }