@pioneer-platform/binance-network 8.1.15 → 8.1.19
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 +48 -47
- package/package.json +4 -4
package/lib/index.js
CHANGED
|
@@ -201,7 +201,7 @@ var get_balance = function (address, token) {
|
|
|
201
201
|
case 2:
|
|
202
202
|
result = _a.sent();
|
|
203
203
|
balanceInfo = result.data;
|
|
204
|
-
log.
|
|
204
|
+
log.debug('balanceInfo: ', balanceInfo);
|
|
205
205
|
if (!balanceInfo || !balanceInfo.balances || balanceInfo.balances.length === 0) {
|
|
206
206
|
output = 0;
|
|
207
207
|
}
|
|
@@ -426,34 +426,35 @@ var get_block_remote = function (height) {
|
|
|
426
426
|
};
|
|
427
427
|
var get_account = function (address) {
|
|
428
428
|
return __awaiter(this, void 0, void 0, function () {
|
|
429
|
-
var tag, output;
|
|
429
|
+
var tag, output, url, result, balanceInfo, e_8;
|
|
430
430
|
return __generator(this, function (_a) {
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
431
|
+
switch (_a.label) {
|
|
432
|
+
case 0:
|
|
433
|
+
tag = TAG + " | get_account | ";
|
|
434
|
+
output = {};
|
|
435
|
+
_a.label = 1;
|
|
436
|
+
case 1:
|
|
437
|
+
_a.trys.push([1, 3, , 4]);
|
|
438
|
+
log.debug(tag, "get_account: ", address);
|
|
439
|
+
url = URL_DEX + '/api/v1/account/' + address;
|
|
440
|
+
log.debug(tag, "url: ", url);
|
|
441
|
+
return [4 /*yield*/, axios({
|
|
442
|
+
url: url,
|
|
443
|
+
method: 'GET'
|
|
444
|
+
})];
|
|
445
|
+
case 2:
|
|
446
|
+
result = _a.sent();
|
|
447
|
+
balanceInfo = result.data;
|
|
448
|
+
log.info('balanceInfo: ', balanceInfo);
|
|
449
|
+
return [2 /*return*/, "TODO"];
|
|
450
|
+
case 3:
|
|
451
|
+
e_8 = _a.sent();
|
|
452
|
+
//log.error(tag,"e: ",{e})
|
|
453
|
+
output.success = false;
|
|
454
|
+
output.error = e_8;
|
|
455
|
+
return [2 /*return*/, output];
|
|
456
|
+
case 4: return [2 /*return*/];
|
|
455
457
|
}
|
|
456
|
-
return [2 /*return*/];
|
|
457
458
|
});
|
|
458
459
|
});
|
|
459
460
|
};
|
|
@@ -528,7 +529,7 @@ The tx must be a signed StdTx. The supported broadcast modes include "block"(ret
|
|
|
528
529
|
*/
|
|
529
530
|
var broadcast_transaction = function (rawTx) {
|
|
530
531
|
return __awaiter(this, void 0, void 0, function () {
|
|
531
|
-
var tag, output, buffer, hash, url, result,
|
|
532
|
+
var tag, output, buffer, hash, url, result, e_9;
|
|
532
533
|
return __generator(this, function (_a) {
|
|
533
534
|
switch (_a.label) {
|
|
534
535
|
case 0:
|
|
@@ -555,18 +556,18 @@ var broadcast_transaction = function (rawTx) {
|
|
|
555
556
|
result = _a.sent();
|
|
556
557
|
log.debug('result: ', result.data);
|
|
557
558
|
if (result.data[0].hash) {
|
|
558
|
-
log.
|
|
559
|
+
log.debug("success! ");
|
|
559
560
|
}
|
|
560
561
|
return [2 /*return*/, result.data[0].hash];
|
|
561
562
|
case 3:
|
|
562
|
-
|
|
563
|
+
e_9 = _a.sent();
|
|
563
564
|
//log.error(tag,"e: ",{e})
|
|
564
|
-
log.error(tag,
|
|
565
|
-
log.error(tag,
|
|
566
|
-
log.error(tag,
|
|
567
|
-
log.error(tag,
|
|
565
|
+
log.error(tag, e_9);
|
|
566
|
+
log.error(tag, e_9.response);
|
|
567
|
+
log.error(tag, e_9.response.data);
|
|
568
|
+
log.error(tag, e_9.response.data.error);
|
|
568
569
|
output.success = false;
|
|
569
|
-
output.error =
|
|
570
|
+
output.error = e_9;
|
|
570
571
|
return [2 /*return*/, output];
|
|
571
572
|
case 4: return [2 /*return*/];
|
|
572
573
|
}
|
|
@@ -575,7 +576,7 @@ var broadcast_transaction = function (rawTx) {
|
|
|
575
576
|
};
|
|
576
577
|
var get_node_info = function () {
|
|
577
578
|
return __awaiter(this, void 0, void 0, function () {
|
|
578
|
-
var tag, output, chaind, bnbncli, bnbncliRemote,
|
|
579
|
+
var tag, output, chaind, bnbncli, bnbncliRemote, e_10;
|
|
579
580
|
return __generator(this, function (_a) {
|
|
580
581
|
switch (_a.label) {
|
|
581
582
|
case 0:
|
|
@@ -601,10 +602,10 @@ var get_node_info = function () {
|
|
|
601
602
|
output.bnbncliRemote = bnbncliRemote.data;
|
|
602
603
|
return [2 /*return*/, output];
|
|
603
604
|
case 5:
|
|
604
|
-
|
|
605
|
+
e_10 = _a.sent();
|
|
605
606
|
//log.error(tag,"e: ",{e})
|
|
606
607
|
output.success = false;
|
|
607
|
-
output.error =
|
|
608
|
+
output.error = e_10;
|
|
608
609
|
return [2 /*return*/, output];
|
|
609
610
|
case 6: return [2 /*return*/];
|
|
610
611
|
}
|
|
@@ -613,7 +614,7 @@ var get_node_info = function () {
|
|
|
613
614
|
};
|
|
614
615
|
var get_node_syncing = function () {
|
|
615
616
|
return __awaiter(this, void 0, void 0, function () {
|
|
616
|
-
var tag, output, txInfo,
|
|
617
|
+
var tag, output, txInfo, e_11;
|
|
617
618
|
return __generator(this, function (_a) {
|
|
618
619
|
switch (_a.label) {
|
|
619
620
|
case 0:
|
|
@@ -628,10 +629,10 @@ var get_node_syncing = function () {
|
|
|
628
629
|
log.debug(tag, "txInfo: ", txInfo.data);
|
|
629
630
|
return [2 /*return*/, txInfo.data];
|
|
630
631
|
case 3:
|
|
631
|
-
|
|
632
|
+
e_11 = _a.sent();
|
|
632
633
|
//log.error(tag,"e: ",{e})
|
|
633
634
|
output.success = false;
|
|
634
|
-
output.error =
|
|
635
|
+
output.error = e_11;
|
|
635
636
|
return [2 /*return*/, output];
|
|
636
637
|
case 4: return [2 /*return*/];
|
|
637
638
|
}
|
|
@@ -640,7 +641,7 @@ var get_node_syncing = function () {
|
|
|
640
641
|
};
|
|
641
642
|
var get_node_version = function () {
|
|
642
643
|
return __awaiter(this, void 0, void 0, function () {
|
|
643
|
-
var tag, output, txInfo,
|
|
644
|
+
var tag, output, txInfo, e_12;
|
|
644
645
|
return __generator(this, function (_a) {
|
|
645
646
|
switch (_a.label) {
|
|
646
647
|
case 0:
|
|
@@ -655,10 +656,10 @@ var get_node_version = function () {
|
|
|
655
656
|
log.debug(tag, "txInfo: ", txInfo.data);
|
|
656
657
|
return [2 /*return*/, txInfo.data];
|
|
657
658
|
case 3:
|
|
658
|
-
|
|
659
|
+
e_12 = _a.sent();
|
|
659
660
|
//log.error(tag,"e: ",{e})
|
|
660
661
|
output.success = false;
|
|
661
|
-
output.error =
|
|
662
|
+
output.error = e_12;
|
|
662
663
|
return [2 /*return*/, output];
|
|
663
664
|
case 4: return [2 /*return*/];
|
|
664
665
|
}
|
|
@@ -706,7 +707,7 @@ var normalize_tx = function (tx, type) {
|
|
|
706
707
|
};
|
|
707
708
|
var getTransaction = function (txid) {
|
|
708
709
|
return __awaiter(this, void 0, void 0, function () {
|
|
709
|
-
var tag, output, selected, txInfo,
|
|
710
|
+
var tag, output, selected, txInfo, e_13;
|
|
710
711
|
return __generator(this, function (_a) {
|
|
711
712
|
switch (_a.label) {
|
|
712
713
|
case 0:
|
|
@@ -738,10 +739,10 @@ var getTransaction = function (txid) {
|
|
|
738
739
|
// log.debug(tag,"txInfo: ",txInfo.data)
|
|
739
740
|
return [2 /*return*/, txInfo.data];
|
|
740
741
|
case 3:
|
|
741
|
-
|
|
742
|
+
e_13 = _a.sent();
|
|
742
743
|
//log.error(tag,"e: ",{e})
|
|
743
744
|
output.success = false;
|
|
744
|
-
output.error =
|
|
745
|
+
output.error = e_13;
|
|
745
746
|
return [2 /*return*/, output];
|
|
746
747
|
case 4: return [2 /*return*/];
|
|
747
748
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pioneer-platform/binance-network",
|
|
3
|
-
"version": "8.1.
|
|
3
|
+
"version": "8.1.19",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"create": "npm run build && npm run test",
|
|
6
6
|
"build": "tsc -p .",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@crypto-hex-decoder/bnb": "^2.1.0",
|
|
13
|
-
"@pioneer-platform/loggerdog": "^8.1.
|
|
14
|
-
"@pioneer-platform/nodes": "^8.1.
|
|
13
|
+
"@pioneer-platform/loggerdog": "^8.1.17",
|
|
14
|
+
"@pioneer-platform/nodes": "^8.1.17",
|
|
15
15
|
"axios": "^0.19.2",
|
|
16
16
|
"dotenv": "^8.2.0",
|
|
17
17
|
"https": "^1.0.0",
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
],
|
|
28
28
|
"author": "Bithighlander <pioneer@gmail.com>",
|
|
29
29
|
"license": "ISC",
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "d0e74ea447175d6d7e9697793093f9155f0dab38"
|
|
31
31
|
}
|