@pioneer-platform/utxo-network 8.1.58 → 8.1.60
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 +20 -9
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -205,8 +205,8 @@ var ONLINE = [];
|
|
|
205
205
|
var OFFLINE = [];
|
|
206
206
|
var unchained;
|
|
207
207
|
module.exports = {
|
|
208
|
-
init: function (
|
|
209
|
-
return init_network(
|
|
208
|
+
init: function (servers) {
|
|
209
|
+
return init_network(servers);
|
|
210
210
|
},
|
|
211
211
|
getInfo: function (coin) {
|
|
212
212
|
return get_node_info(coin);
|
|
@@ -297,9 +297,9 @@ module.exports = {
|
|
|
297
297
|
// return get_validators();
|
|
298
298
|
// }
|
|
299
299
|
};
|
|
300
|
-
var init_network = function (
|
|
300
|
+
var init_network = function (servers) {
|
|
301
301
|
return __awaiter(this, void 0, void 0, function () {
|
|
302
|
-
var tag, output, e_1;
|
|
302
|
+
var tag, output, unchainedServers, e_1;
|
|
303
303
|
return __generator(this, function (_a) {
|
|
304
304
|
switch (_a.label) {
|
|
305
305
|
case 0:
|
|
@@ -309,16 +309,26 @@ var init_network = function (runtime, servers) {
|
|
|
309
309
|
_a.trys.push([1, 4, , 5]);
|
|
310
310
|
log.debug(tag, "checkpoint: ");
|
|
311
311
|
output = [];
|
|
312
|
-
|
|
313
|
-
|
|
312
|
+
// @TODO
|
|
313
|
+
// const blockbooks = servers.filter((server: { type: string; }) => server.type === 'blockbook');
|
|
314
|
+
// log.debug(tag,"blockbooks: ",blockbooks)
|
|
315
|
+
return [4 /*yield*/, blockbook.init()
|
|
316
|
+
// @TODO
|
|
317
|
+
//load daemon servers
|
|
318
|
+
//load unchained servers
|
|
319
|
+
];
|
|
314
320
|
case 2:
|
|
321
|
+
// @TODO
|
|
322
|
+
// const blockbooks = servers.filter((server: { type: string; }) => server.type === 'blockbook');
|
|
323
|
+
// log.debug(tag,"blockbooks: ",blockbooks)
|
|
315
324
|
_a.sent();
|
|
316
|
-
|
|
325
|
+
unchainedServers = servers.filter(function (server) { return server.type === 'unchained'; });
|
|
326
|
+
log.info(tag, "unchainedServers: ", unchainedServers);
|
|
327
|
+
return [4 /*yield*/, Unchained.init(unchainedServers)];
|
|
317
328
|
case 3:
|
|
318
329
|
unchained = _a.sent();
|
|
319
330
|
log.info("unchained: ", unchained);
|
|
320
|
-
//
|
|
321
|
-
//figure out what is online
|
|
331
|
+
//figure out what is online, and if can meet blockchain requirements
|
|
322
332
|
//return online servers
|
|
323
333
|
return [2 /*return*/, true];
|
|
324
334
|
case 4:
|
|
@@ -440,6 +450,7 @@ var get_fee = function (coin) {
|
|
|
440
450
|
case 4:
|
|
441
451
|
result = _a.sent();
|
|
442
452
|
console.log("result: ", result.data);
|
|
453
|
+
output = result.data;
|
|
443
454
|
return [3 /*break*/, 6];
|
|
444
455
|
case 5:
|
|
445
456
|
console.log("no unchained for coin: ", coin);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pioneer-platform/utxo-network",
|
|
3
|
-
"version": "8.1.
|
|
3
|
+
"version": "8.1.60",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"types": "./lib/index.d.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@pioneer-platform/blockbook": "^8.1.49",
|
|
15
15
|
"@pioneer-platform/loggerdog": "^8.1.29",
|
|
16
|
-
"@pioneer-platform/unchained": "8.1.
|
|
16
|
+
"@pioneer-platform/unchained": "8.1.57",
|
|
17
17
|
"@types/request-promise-native": "^1.0.17",
|
|
18
18
|
"@xchainjs/xchain-client": "^0.7.0",
|
|
19
19
|
"@xchainjs/xchain-util": "^0.2.6",
|