@pioneer-platform/blockbook 8.1.55 → 8.1.57
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 +2 -2
- package/lib/index.js +16 -16
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -27,5 +27,5 @@ declare let get_txs_by_xpub: (coin: string, xpub: string) => Promise<any>;
|
|
|
27
27
|
declare let broadcast_transaction: (coin: string, hex: string) => Promise<any>;
|
|
28
28
|
declare let get_transaction: (coin: string, txid: string) => Promise<any>;
|
|
29
29
|
declare let get_utxos_by_xpub: (coin: string, xpub: string) => Promise<any>;
|
|
30
|
-
declare let get_balance_by_xpub: (coin: string, xpub: any) => Promise<number
|
|
31
|
-
declare let get_node_info: () => Promise<
|
|
30
|
+
declare let get_balance_by_xpub: (coin: string, xpub: any) => Promise<number>;
|
|
31
|
+
declare let get_node_info: () => Promise<boolean>;
|
package/lib/index.js
CHANGED
|
@@ -225,7 +225,7 @@ var init_network = function (servers) {
|
|
|
225
225
|
case 4:
|
|
226
226
|
allBlockbooksRemote = _a.sent();
|
|
227
227
|
allBlockbooksRemote = allBlockbooksRemote.data;
|
|
228
|
-
log.
|
|
228
|
+
log.debug(tag, "allBlockbooksRemote: ", allBlockbooksRemote);
|
|
229
229
|
blockbooks.apply(void 0, allBlockbooksRemote);
|
|
230
230
|
return [3 /*break*/, 6];
|
|
231
231
|
case 5:
|
|
@@ -234,16 +234,15 @@ var init_network = function (servers) {
|
|
|
234
234
|
case 6:
|
|
235
235
|
if (blockbooks.length === 0)
|
|
236
236
|
blockbooks = SERVERS_CONFIG;
|
|
237
|
-
log.
|
|
237
|
+
log.debug(tag, "blockbooks: ", blockbooks.length);
|
|
238
238
|
for (i = 0; i < blockbooks.length; i++) {
|
|
239
239
|
blockbook = blockbooks[i];
|
|
240
240
|
//get swagger
|
|
241
|
-
if (blockbook)
|
|
242
|
-
//log.info("unchainedInfo.swagger: ",unchainedInfo.swagger)
|
|
241
|
+
if (blockbook && blockbook.service)
|
|
243
242
|
BLOCKBOOK_URLS[blockbook.symbol.toUpperCase()] = blockbook.service;
|
|
243
|
+
if (blockbook && blockbook.websocket) {
|
|
244
244
|
url = blockbook.websocket.replace("/websocket", "");
|
|
245
245
|
url = blockbook.websocket.replace("wss://", "https://");
|
|
246
|
-
console.log("url: ", url);
|
|
247
246
|
BLOCKBOOK_SOCKETS[blockbook.symbol.toUpperCase()] = new Blockbook({
|
|
248
247
|
nodes: [url],
|
|
249
248
|
disableTypeValidation: true,
|
|
@@ -254,8 +253,8 @@ var init_network = function (servers) {
|
|
|
254
253
|
// throw Error("invalid unchained service!")
|
|
255
254
|
}
|
|
256
255
|
}
|
|
257
|
-
log.
|
|
258
|
-
log.
|
|
256
|
+
log.debug(tag, "BLOCKBOOK_URLS: ", BLOCKBOOK_URLS);
|
|
257
|
+
log.debug(tag, "BLOCKBOOK_SOCKETS: ", BLOCKBOOK_SOCKETS);
|
|
259
258
|
return [2 /*return*/, true];
|
|
260
259
|
case 7:
|
|
261
260
|
e_2 = _a.sent();
|
|
@@ -277,7 +276,7 @@ var get_fees = function (coin) {
|
|
|
277
276
|
case 1:
|
|
278
277
|
_a.trys.push([1, 3, , 4]);
|
|
279
278
|
url = BLOCKBOOK_URLS[coin.toUpperCase()] + "/api/v2/fees";
|
|
280
|
-
log.
|
|
279
|
+
log.debug(tag, "url: ", url);
|
|
281
280
|
body = {
|
|
282
281
|
method: 'GET',
|
|
283
282
|
url: url,
|
|
@@ -299,7 +298,7 @@ var get_fees = function (coin) {
|
|
|
299
298
|
case 3:
|
|
300
299
|
e_3 = _a.sent();
|
|
301
300
|
console.error(tag, e_3);
|
|
302
|
-
|
|
301
|
+
throw e_3;
|
|
303
302
|
case 4: return [2 /*return*/];
|
|
304
303
|
}
|
|
305
304
|
});
|
|
@@ -337,7 +336,7 @@ var get_info_by_pubkey = function (coin, pubkey, page) {
|
|
|
337
336
|
case 3:
|
|
338
337
|
e_4 = _a.sent();
|
|
339
338
|
console.error(tag, e_4);
|
|
340
|
-
|
|
339
|
+
throw e_4;
|
|
341
340
|
case 4: return [2 /*return*/];
|
|
342
341
|
}
|
|
343
342
|
});
|
|
@@ -376,7 +375,7 @@ var get_txids_by_address = function (coin, address, page) {
|
|
|
376
375
|
case 3:
|
|
377
376
|
e_5 = _a.sent();
|
|
378
377
|
console.error(tag, e_5);
|
|
379
|
-
|
|
378
|
+
throw e_5;
|
|
380
379
|
case 4: return [2 /*return*/];
|
|
381
380
|
}
|
|
382
381
|
});
|
|
@@ -414,7 +413,7 @@ var get_info_by_address = function (coin, address, filter) {
|
|
|
414
413
|
case 3:
|
|
415
414
|
e_6 = _a.sent();
|
|
416
415
|
console.error(tag, e_6);
|
|
417
|
-
|
|
416
|
+
throw e_6;
|
|
418
417
|
case 4: return [2 /*return*/];
|
|
419
418
|
}
|
|
420
419
|
});
|
|
@@ -448,7 +447,7 @@ var get_txs_by_xpub = function (coin, xpub) {
|
|
|
448
447
|
case 3:
|
|
449
448
|
e_7 = _a.sent();
|
|
450
449
|
console.error(tag, e_7);
|
|
451
|
-
|
|
450
|
+
throw e_7;
|
|
452
451
|
case 4: return [2 /*return*/];
|
|
453
452
|
}
|
|
454
453
|
});
|
|
@@ -531,7 +530,7 @@ var get_transaction = function (coin, txid) {
|
|
|
531
530
|
case 3:
|
|
532
531
|
e_10 = _a.sent();
|
|
533
532
|
console.error(tag, e_10);
|
|
534
|
-
|
|
533
|
+
throw e_10;
|
|
535
534
|
case 4: return [2 /*return*/];
|
|
536
535
|
}
|
|
537
536
|
});
|
|
@@ -565,7 +564,7 @@ var get_utxos_by_xpub = function (coin, xpub) {
|
|
|
565
564
|
case 3:
|
|
566
565
|
e_11 = _a.sent();
|
|
567
566
|
console.error(tag, e_11);
|
|
568
|
-
|
|
567
|
+
throw e_11;
|
|
569
568
|
case 4: return [2 /*return*/];
|
|
570
569
|
}
|
|
571
570
|
});
|
|
@@ -597,7 +596,7 @@ var get_balance_by_xpub = function (coin, xpub) {
|
|
|
597
596
|
case 3:
|
|
598
597
|
e_12 = _a.sent();
|
|
599
598
|
console.error(tag, e_12);
|
|
600
|
-
|
|
599
|
+
throw e_12;
|
|
601
600
|
case 4: return [2 /*return*/];
|
|
602
601
|
}
|
|
603
602
|
});
|
|
@@ -613,6 +612,7 @@ var get_node_info = function () {
|
|
|
613
612
|
}
|
|
614
613
|
catch (e) {
|
|
615
614
|
console.error(tag, e);
|
|
615
|
+
throw e;
|
|
616
616
|
}
|
|
617
617
|
return [2 /*return*/];
|
|
618
618
|
});
|