@pioneer-platform/eth-network 8.1.69 → 8.1.71

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.
Files changed (2) hide show
  1. package/lib/index.js +205 -86
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -93,6 +93,8 @@ var etherscanAPI = __importStar(require("./etherscan-api"));
93
93
  var log = require('@pioneer-platform/loggerdog')();
94
94
  var ETHPLORER_API_KEY = process.env['ETHPLORER_API_KEY'] || 'freekey';
95
95
  var utils_2 = require("ethers/lib/utils");
96
+ var wait = require('wait-promise');
97
+ var sleep = wait.sleep;
96
98
  //
97
99
  var web3;
98
100
  var ETHERSCAN;
@@ -224,49 +226,58 @@ module.exports = {
224
226
  };
225
227
  var get_all_pioneers = function () {
226
228
  return __awaiter(this, void 0, void 0, function () {
227
- var tag, output, nftContract, metadataContract, totalSupply, i, owner, imageInfo, imageName, baseImageUrl, fullImageUrl, e_1;
229
+ var tag, output, nftContract, metadataContract, totalSupply, i, owner, imageInfo, imageName, baseImageUrl, fullImageUrl, e_1, e_2;
228
230
  return __generator(this, function (_a) {
229
231
  switch (_a.label) {
230
232
  case 0:
231
233
  tag = TAG + " | get_all_pioneers | ";
232
234
  _a.label = 1;
233
235
  case 1:
234
- _a.trys.push([1, 8, , 9]);
236
+ _a.trys.push([1, 10, , 11]);
235
237
  output = {};
236
238
  nftContract = new web3.eth.Contract(constant_1.ERC721_ABI, constant_1.PIONEER_CONTRACT_ADDRESS);
237
239
  metadataContract = new web3.eth.Contract(constant_1.METADATA_ABI, constant_1.PIONEER_METADATA_CONTRACT_ADDRESS);
238
240
  return [4 /*yield*/, nftContract.methods.totalSupply().call()];
239
241
  case 2:
240
242
  totalSupply = _a.sent();
243
+ log.info("totalSupply: ", totalSupply);
241
244
  output['totalSupply'] = totalSupply;
242
245
  output['owners'] = [];
243
246
  output['images'] = []; // add an images array to output
244
247
  i = 0;
245
248
  _a.label = 3;
246
249
  case 3:
247
- if (!(i < totalSupply)) return [3 /*break*/, 7];
248
- return [4 /*yield*/, nftContract.methods.ownerOf(i).call()];
250
+ if (!(i < totalSupply)) return [3 /*break*/, 9];
251
+ _a.label = 4;
249
252
  case 4:
253
+ _a.trys.push([4, 7, , 8]);
254
+ return [4 /*yield*/, nftContract.methods.ownerOf(i).call()];
255
+ case 5:
250
256
  owner = _a.sent();
257
+ log.info(tag, "owner: ", owner);
251
258
  output['owners'].push(owner.toLowerCase());
252
259
  return [4 /*yield*/, metadataContract.methods.getAttributes(i).call()];
253
- case 5:
260
+ case 6:
254
261
  imageInfo = _a.sent();
255
262
  imageName = JSON.parse(imageInfo['0'])["0-backgrounds"];
256
263
  baseImageUrl = "https://ipfs.io/ipfs/bafybeiezdzjofkcpiwy5hlvxwzkgcztxc6xtodh3q7eddfjmqsguqs47aa/0-backgrounds/";
257
264
  fullImageUrl = baseImageUrl + imageName + ".png";
258
265
  // Add this image URL to the images array in output
259
266
  output['images'].push({ address: owner.toLowerCase(), image: fullImageUrl });
260
- _a.label = 6;
261
- case 6:
267
+ return [3 /*break*/, 8];
268
+ case 7:
269
+ e_1 = _a.sent();
270
+ log.info("no image for: ", i);
271
+ return [3 /*break*/, 8];
272
+ case 8:
262
273
  i++;
263
274
  return [3 /*break*/, 3];
264
- case 7: return [2 /*return*/, output];
265
- case 8:
266
- e_1 = _a.sent();
267
- console.error(tag, e_1);
268
- return [3 /*break*/, 9];
269
- case 9: return [2 /*return*/];
275
+ case 9: return [2 /*return*/, output];
276
+ case 10:
277
+ e_2 = _a.sent();
278
+ console.error(tag, e_2);
279
+ return [3 /*break*/, 11];
280
+ case 11: return [2 /*return*/];
270
281
  }
271
282
  });
272
283
  });
@@ -289,7 +300,7 @@ var decode_tx = function (tx) {
289
300
  };
290
301
  var build_airdrop_claim = function (address) {
291
302
  return __awaiter(this, void 0, void 0, function () {
292
- var tag, airdropContract, accountInfo, AirDropInterface, data, e_2;
303
+ var tag, airdropContract, accountInfo, AirDropInterface, data, e_3;
293
304
  return __generator(this, function (_a) {
294
305
  switch (_a.label) {
295
306
  case 0:
@@ -315,8 +326,8 @@ var build_airdrop_claim = function (address) {
315
326
  ]);
316
327
  return [2 /*return*/, data];
317
328
  case 3:
318
- e_2 = _a.sent();
319
- console.error(tag, e_2);
329
+ e_3 = _a.sent();
330
+ console.error(tag, e_3);
320
331
  return [3 /*break*/, 4];
321
332
  case 4: return [2 /*return*/];
322
333
  }
@@ -325,7 +336,7 @@ var build_airdrop_claim = function (address) {
325
336
  };
326
337
  var check_airdrop_claim = function (address) {
327
338
  return __awaiter(this, void 0, void 0, function () {
328
- var tag, accountInfo, output, airdropContract, isClaimed, e_3;
339
+ var tag, accountInfo, output, airdropContract, isClaimed, e_4;
329
340
  return __generator(this, function (_a) {
330
341
  switch (_a.label) {
331
342
  case 0:
@@ -353,17 +364,127 @@ var check_airdrop_claim = function (address) {
353
364
  _a.label = 5;
354
365
  case 5: return [2 /*return*/, output];
355
366
  case 6:
356
- e_3 = _a.sent();
357
- console.error(tag, e_3);
367
+ e_4 = _a.sent();
368
+ console.error(tag, e_4);
358
369
  return [3 /*break*/, 7];
359
370
  case 7: return [2 /*return*/];
360
371
  }
361
372
  });
362
373
  });
363
374
  };
375
+ // const get_token_transfer_data = async function(toAddress: string, amount: string, contract: string) {
376
+ // const tag = TAG + " | get_token_transfer_data | ";
377
+ // try {
378
+ // const minABI = [
379
+ // // balanceOf
380
+ // {
381
+ // "constant": true,
382
+ // "inputs": [{ "name": "_owner", "type": "address" }],
383
+ // "name": "balanceOf",
384
+ // "outputs": [{ "name": "balance", "type": "uint256" }],
385
+ // "type": "function"
386
+ // },
387
+ // // decimals
388
+ // {
389
+ // "constant": true,
390
+ // "inputs": [],
391
+ // "name": "decimals",
392
+ // "outputs": [{ "name": "", "type": "uint8" }],
393
+ // "type": "function"
394
+ // }
395
+ // ];
396
+ // const newContract = new web3.eth.Contract(minABI, contract);
397
+ // const decimalPlaces = await newContract.methods.decimals().call();
398
+ //
399
+ // // Convert amount to the appropriate number of decimal places
400
+ // const amountInSmallestUnit = web3.utils.toBN(amount).mul(web3.utils.toBN(10).pow(decimalPlaces));
401
+ //
402
+ // // Convert the amount to a hexadecimal string
403
+ // const amountHex = amountInSmallestUnit.toString(16);
404
+ //
405
+ // // Pad the hexadecimal string with zeros to 64 characters
406
+ // const amountHexPadded = amountHex.padStart(64, '0');
407
+ //
408
+ // // Parse the token data
409
+ // const tokenData = web3.eth.abi.encodeFunctionCall({
410
+ // name: 'transfer',
411
+ // type: 'function',
412
+ // inputs: [
413
+ // {
414
+ // type: 'address',
415
+ // name: '_to'
416
+ // },
417
+ // {
418
+ // type: 'uint256',
419
+ // name: '_value'
420
+ // }
421
+ // ]
422
+ // }, [toAddress, amountInSmallestUnit.toString()]);
423
+ //
424
+ // return tokenData;
425
+ // } catch (e) {
426
+ // console.error(tag, e);
427
+ // }
428
+ // }
429
+ // const get_token_transfer_data = async function(toAddress: string, amount: string, contract: string) {
430
+ // const tag = TAG + " | get_token_transfer_data | ";
431
+ // try {
432
+ // const minABI = [
433
+ // // balanceOf
434
+ // {
435
+ // "constant": true,
436
+ // "inputs": [{ "name": "_owner", "type": "address" }],
437
+ // "name": "balanceOf",
438
+ // "outputs": [{ "name": "balance", "type": "uint256" }],
439
+ // "type": "function"
440
+ // },
441
+ // // decimals
442
+ // {
443
+ // "constant": true,
444
+ // "inputs": [],
445
+ // "name": "decimals",
446
+ // "outputs": [{ "name": "", "type": "uint8" }],
447
+ // "type": "function"
448
+ // }
449
+ // ];
450
+ // const newContract = new web3.eth.Contract(minABI, contract);
451
+ // const decimalPlaces = await newContract.methods.decimals().call();
452
+ //
453
+ // // Convert amount to the appropriate number of decimal places
454
+ // const amountInWei = web3.utils.toWei(amount, 'ether');
455
+ // const decimals = web3.utils.toBN(decimalPlaces);
456
+ // const amountInSmallestUnit = web3.utils.toBN(amountInWei).mul(web3.utils.toBN(10).pow(decimals));
457
+ //
458
+ // // Convert the amount to a hexadecimal string
459
+ // const amountHex = amountInSmallestUnit.toString(16);
460
+ //
461
+ // // Pad the hexadecimal string with zeros to 64 characters
462
+ // const amountHexPadded = amountHex.padStart(64, '0');
463
+ //
464
+ // // Parse the token data
465
+ // const tokenData = web3.eth.abi.encodeFunctionCall({
466
+ // name: 'transfer',
467
+ // type: 'function',
468
+ // inputs: [
469
+ // {
470
+ // type: 'address',
471
+ // name: '_to'
472
+ // },
473
+ // {
474
+ // type: 'uint256',
475
+ // name: '_value'
476
+ // }
477
+ // ]
478
+ // }, [toAddress, amountInSmallestUnit.toString()]);
479
+ //
480
+ // return tokenData;
481
+ // } catch (e) {
482
+ // console.error(tag, e);
483
+ // }
484
+ // }
364
485
  var get_token_transfer_data = function (toAddress, amount, contract) {
365
486
  return __awaiter(this, void 0, void 0, function () {
366
- var tag, minABI, newContract, decimalPlaces, amountInWei, decimals, amountInSmallestUnit, amountHex, amountHexPadded, tokenData, e_4;
487
+ var tag, minABI, newContract, decimalPlaces, amountInSmallestUnit, amountHex, amountHexPadded, tokenData, e_5;
367
488
  return __generator(this, function (_a) {
368
489
  switch (_a.label) {
369
490
  case 0:
@@ -393,9 +514,7 @@ var get_token_transfer_data = function (toAddress, amount, contract) {
393
514
  return [4 /*yield*/, newContract.methods.decimals().call()];
394
515
  case 2:
395
516
  decimalPlaces = _a.sent();
396
- amountInWei = web3.utils.toWei(amount, 'ether');
397
- decimals = web3.utils.toBN(decimalPlaces);
398
- amountInSmallestUnit = web3.utils.toBN(amountInWei).mul(web3.utils.toBN(10).pow(decimals));
517
+ amountInSmallestUnit = web3.utils.toBN(parseFloat(amount) * Math.pow(10, decimalPlaces));
399
518
  amountHex = amountInSmallestUnit.toString(16);
400
519
  amountHexPadded = amountHex.padStart(64, '0');
401
520
  tokenData = web3.eth.abi.encodeFunctionCall({
@@ -414,8 +533,8 @@ var get_token_transfer_data = function (toAddress, amount, contract) {
414
533
  }, [toAddress, amountInSmallestUnit.toString()]);
415
534
  return [2 /*return*/, tokenData];
416
535
  case 3:
417
- e_4 = _a.sent();
418
- console.error(tag, e_4);
536
+ e_5 = _a.sent();
537
+ console.error(tag, e_5);
419
538
  return [3 /*break*/, 4];
420
539
  case 4: return [2 /*return*/];
421
540
  }
@@ -488,7 +607,7 @@ var get_token_transfer_data = function (toAddress, amount, contract) {
488
607
  // }
489
608
  var get_symbol_from_contract = function (address) {
490
609
  return __awaiter(this, void 0, void 0, function () {
491
- var tag, contract, tokenName, e_5;
610
+ var tag, contract, tokenName, e_6;
492
611
  return __generator(this, function (_a) {
493
612
  switch (_a.label) {
494
613
  case 0:
@@ -505,8 +624,8 @@ var get_symbol_from_contract = function (address) {
505
624
  //log.debug(tag,"tokenName: ",tokenName)
506
625
  return [2 /*return*/, tokenName];
507
626
  case 3:
508
- e_5 = _a.sent();
509
- console.error(tag, e_5);
627
+ e_6 = _a.sent();
628
+ console.error(tag, e_6);
510
629
  return [3 /*break*/, 4];
511
630
  case 4: return [2 /*return*/];
512
631
  }
@@ -515,7 +634,7 @@ var get_symbol_from_contract = function (address) {
515
634
  };
516
635
  var get_stream = function (streamId) {
517
636
  return __awaiter(this, void 0, void 0, function () {
518
- var tag, sablierContract, totalFox, e_6;
637
+ var tag, sablierContract, totalFox, e_7;
519
638
  return __generator(this, function (_a) {
520
639
  switch (_a.label) {
521
640
  case 0:
@@ -535,8 +654,8 @@ var get_stream = function (streamId) {
535
654
  //log.debug(tag,"totalFox: ",totalFox)
536
655
  return [2 /*return*/, totalFox];
537
656
  case 3:
538
- e_6 = _a.sent();
539
- console.error(tag, e_6);
657
+ e_7 = _a.sent();
658
+ console.error(tag, e_7);
540
659
  return [3 /*break*/, 4];
541
660
  case 4: return [2 /*return*/];
542
661
  }
@@ -545,7 +664,7 @@ var get_stream = function (streamId) {
545
664
  };
546
665
  var get_tx_count = function (address, options) {
547
666
  return __awaiter(this, void 0, void 0, function () {
548
- var tag, txsConfirmed, txsWithPending, pending, e_7;
667
+ var tag, txsConfirmed, txsWithPending, pending, e_8;
549
668
  return __generator(this, function (_a) {
550
669
  switch (_a.label) {
551
670
  case 0:
@@ -573,8 +692,8 @@ var get_tx_count = function (address, options) {
573
692
  pending: pending
574
693
  }];
575
694
  case 4:
576
- e_7 = _a.sent();
577
- console.error(tag, e_7);
695
+ e_8 = _a.sent();
696
+ console.error(tag, e_8);
578
697
  return [3 /*break*/, 5];
579
698
  case 5: return [2 /*return*/];
580
699
  }
@@ -583,7 +702,7 @@ var get_tx_count = function (address, options) {
583
702
  };
584
703
  var get_pool_percent = function (amountFox, amountEth, poolAddress) {
585
704
  return __awaiter(this, void 0, void 0, function () {
586
- var tag, lpContract, foxContract, wethContract, totalSupply, totalFox, totalEth, result, lpTokens, percent, e_8;
705
+ var tag, lpContract, foxContract, wethContract, totalSupply, totalFox, totalEth, result, lpTokens, percent, e_9;
587
706
  return __generator(this, function (_a) {
588
707
  switch (_a.label) {
589
708
  case 0:
@@ -617,8 +736,8 @@ var get_pool_percent = function (amountFox, amountEth, poolAddress) {
617
736
  log.debug("percent: ", percent);
618
737
  return [2 /*return*/, percent];
619
738
  case 5:
620
- e_8 = _a.sent();
621
- console.error(tag, e_8);
739
+ e_9 = _a.sent();
740
+ console.error(tag, e_9);
622
741
  return [3 /*break*/, 6];
623
742
  case 6: return [2 /*return*/];
624
743
  }
@@ -627,7 +746,7 @@ var get_pool_percent = function (amountFox, amountEth, poolAddress) {
627
746
  };
628
747
  var get_balances = function (addresses) {
629
748
  return __awaiter(this, void 0, void 0, function () {
630
- var tag, actions, i, address, action, result, output, i, entry, balance, e_9;
749
+ var tag, actions, i, address, action, result, output, i, entry, balance, e_10;
631
750
  return __generator(this, function (_a) {
632
751
  switch (_a.label) {
633
752
  case 0:
@@ -659,8 +778,8 @@ var get_balances = function (addresses) {
659
778
  }
660
779
  return [2 /*return*/, output];
661
780
  case 3:
662
- e_9 = _a.sent();
663
- console.error(tag, e_9);
781
+ e_10 = _a.sent();
782
+ console.error(tag, e_10);
664
783
  return [3 /*break*/, 4];
665
784
  case 4: return [2 /*return*/];
666
785
  }
@@ -711,7 +830,7 @@ var rpcCallBatch = function (actions) { return __awaiter(void 0, void 0, void 0,
711
830
  //get_approval_status
712
831
  var get_allowance = function (tokenAddress, spender, sender) {
713
832
  return __awaiter(this, void 0, void 0, function () {
714
- var tag, contract, allowance, e_10;
833
+ var tag, contract, allowance, e_11;
715
834
  return __generator(this, function (_a) {
716
835
  switch (_a.label) {
717
836
  case 0:
@@ -725,8 +844,8 @@ var get_allowance = function (tokenAddress, spender, sender) {
725
844
  allowance = _a.sent();
726
845
  return [2 /*return*/, allowance];
727
846
  case 3:
728
- e_10 = _a.sent();
729
- console.error(tag, e_10);
847
+ e_11 = _a.sent();
848
+ console.error(tag, e_11);
730
849
  return [3 /*break*/, 4];
731
850
  case 4: return [2 /*return*/];
732
851
  }
@@ -735,7 +854,7 @@ var get_allowance = function (tokenAddress, spender, sender) {
735
854
  };
736
855
  var get_all_tokens_blockbook = function (address) {
737
856
  return __awaiter(this, void 0, void 0, function () {
738
- var tag, ethInto, e_11;
857
+ var tag, ethInto, e_12;
739
858
  return __generator(this, function (_a) {
740
859
  switch (_a.label) {
741
860
  case 0:
@@ -749,8 +868,8 @@ var get_all_tokens_blockbook = function (address) {
749
868
  log.debug(tag, "ethInto: ", ethInto);
750
869
  return [2 /*return*/, true];
751
870
  case 3:
752
- e_11 = _a.sent();
753
- console.error(tag, e_11);
871
+ e_12 = _a.sent();
872
+ console.error(tag, e_12);
754
873
  return [3 /*break*/, 4];
755
874
  case 4: return [2 /*return*/];
756
875
  }
@@ -759,7 +878,7 @@ var get_all_tokens_blockbook = function (address) {
759
878
  };
760
879
  var get_nfts = function (address) {
761
880
  return __awaiter(this, void 0, void 0, function () {
762
- var tag, ethInfo, e_12;
881
+ var tag, ethInfo, e_13;
763
882
  return __generator(this, function (_a) {
764
883
  switch (_a.label) {
765
884
  case 0:
@@ -776,8 +895,8 @@ var get_nfts = function (address) {
776
895
  log.debug(tag, "ethInfo: ", ethInfo);
777
896
  return [2 /*return*/, ethInfo];
778
897
  case 3:
779
- e_12 = _a.sent();
780
- console.error(tag, e_12);
898
+ e_13 = _a.sent();
899
+ console.error(tag, e_13);
781
900
  return [3 /*break*/, 4];
782
901
  case 4: return [2 /*return*/];
783
902
  }
@@ -786,7 +905,7 @@ var get_nfts = function (address) {
786
905
  };
787
906
  var get_pool_positions = function (address) {
788
907
  return __awaiter(this, void 0, void 0, function () {
789
- var tag, ethInfo, e_13;
908
+ var tag, ethInfo, e_14;
790
909
  return __generator(this, function (_a) {
791
910
  switch (_a.label) {
792
911
  case 0:
@@ -803,8 +922,8 @@ var get_pool_positions = function (address) {
803
922
  log.debug(tag, "ethInfo: ", ethInfo);
804
923
  return [2 /*return*/, ethInfo];
805
924
  case 3:
806
- e_13 = _a.sent();
807
- console.error(tag, e_13);
925
+ e_14 = _a.sent();
926
+ console.error(tag, e_14);
808
927
  return [3 /*break*/, 4];
809
928
  case 4: return [2 /*return*/];
810
929
  }
@@ -860,7 +979,7 @@ var get_memo_data = function (swap) {
860
979
  */
861
980
  var estimate_fee = function (sourceAsset, params) {
862
981
  return __awaiter(this, void 0, void 0, function () {
863
- var tag, checkSummedAddress, decimal, provider, contract, estimateGas, entry, fees, minimumWeiCost, e_14;
982
+ var tag, checkSummedAddress, decimal, provider, contract, estimateGas, entry, fees, minimumWeiCost, e_15;
864
983
  var _a;
865
984
  return __generator(this, function (_b) {
866
985
  switch (_b.label) {
@@ -909,9 +1028,9 @@ var estimate_fee = function (sourceAsset, params) {
909
1028
  minimumWeiCost = minimumWeiCost.mul(estimateGas.toNumber());
910
1029
  return [2 /*return*/, minimumWeiCost];
911
1030
  case 4:
912
- e_14 = _b.sent();
913
- log.error(tag, e_14);
914
- throw e_14;
1031
+ e_15 = _b.sent();
1032
+ log.error(tag, e_15);
1033
+ throw e_15;
915
1034
  case 5: return [2 /*return*/];
916
1035
  }
917
1036
  });
@@ -920,7 +1039,7 @@ var estimate_fee = function (sourceAsset, params) {
920
1039
  var get_gas_limit = function (_a) {
921
1040
  var asset = _a.asset, recipient = _a.recipient, amount = _a.amount, memo = _a.memo;
922
1041
  return __awaiter(this, void 0, void 0, function () {
923
- var tag, txAmount, assetAddress, estimate, contract, transactionRequest, e_15;
1042
+ var tag, txAmount, assetAddress, estimate, contract, transactionRequest, e_16;
924
1043
  return __generator(this, function (_b) {
925
1044
  switch (_b.label) {
926
1045
  case 0:
@@ -956,9 +1075,9 @@ var get_gas_limit = function (_a) {
956
1075
  _b.label = 5;
957
1076
  case 5: return [2 /*return*/, estimate];
958
1077
  case 6:
959
- e_15 = _b.sent();
960
- log.error(tag, e_15);
961
- throw e_15;
1078
+ e_16 = _b.sent();
1079
+ log.error(tag, e_16);
1080
+ throw e_16;
962
1081
  case 7: return [2 /*return*/];
963
1082
  }
964
1083
  });
@@ -967,7 +1086,7 @@ var get_gas_limit = function (_a) {
967
1086
  var get_fees = function (params) {
968
1087
  var _a;
969
1088
  return __awaiter(this, void 0, void 0, function () {
970
- var tag, response, averageWei, fastWei, fastestWei, gasPrices, fastGP, fastestGP, averageGP, gasLimit, output, e_16;
1089
+ var tag, response, averageWei, fastWei, fastestWei, gasPrices, fastGP, fastestGP, averageGP, gasLimit, output, e_17;
971
1090
  return __generator(this, function (_b) {
972
1091
  switch (_b.label) {
973
1092
  case 0:
@@ -1022,9 +1141,9 @@ var get_fees = function (params) {
1022
1141
  };
1023
1142
  return [2 /*return*/, output];
1024
1143
  case 4:
1025
- e_16 = _b.sent();
1026
- log.error(tag, e_16);
1027
- throw e_16;
1144
+ e_17 = _b.sent();
1145
+ log.error(tag, e_17);
1146
+ throw e_17;
1028
1147
  case 5: return [2 /*return*/];
1029
1148
  }
1030
1149
  });
@@ -1032,7 +1151,7 @@ var get_fees = function (params) {
1032
1151
  };
1033
1152
  var broadcast_transaction = function (tx) {
1034
1153
  return __awaiter(this, void 0, void 0, function () {
1035
- var tag, output, resp, e_17;
1154
+ var tag, output, resp, e_18;
1036
1155
  return __generator(this, function (_a) {
1037
1156
  switch (_a.label) {
1038
1157
  case 0:
@@ -1075,9 +1194,9 @@ var broadcast_transaction = function (tx) {
1075
1194
  output.txid = resp.result;
1076
1195
  return [2 /*return*/, output];
1077
1196
  case 3:
1078
- e_17 = _a.sent();
1079
- log.error(tag, e_17);
1080
- throw e_17;
1197
+ e_18 = _a.sent();
1198
+ log.error(tag, e_18);
1199
+ throw e_18;
1081
1200
  case 4: return [2 /*return*/];
1082
1201
  }
1083
1202
  });
@@ -1085,7 +1204,7 @@ var broadcast_transaction = function (tx) {
1085
1204
  };
1086
1205
  var get_balance_tokens = function (address) {
1087
1206
  return __awaiter(this, void 0, void 0, function () {
1088
- var tag, balances, valueUsds, coinInfo, resp, tokenInfo, i, info, symbol, rate, balance, e_18;
1207
+ var tag, balances, valueUsds, coinInfo, resp, tokenInfo, i, info, symbol, rate, balance, e_19;
1089
1208
  return __generator(this, function (_a) {
1090
1209
  switch (_a.label) {
1091
1210
  case 0:
@@ -1130,8 +1249,8 @@ var get_balance_tokens = function (address) {
1130
1249
  }
1131
1250
  return [2 /*return*/, { balances: balances, valueUsds: valueUsds, coinInfo: coinInfo }];
1132
1251
  case 3:
1133
- e_18 = _a.sent();
1134
- console.error(tag, e_18);
1252
+ e_19 = _a.sent();
1253
+ console.error(tag, e_19);
1135
1254
  return [3 /*break*/, 4];
1136
1255
  case 4: return [2 /*return*/];
1137
1256
  }
@@ -1140,7 +1259,7 @@ var get_balance_tokens = function (address) {
1140
1259
  };
1141
1260
  var get_balance_token = function (address, token) {
1142
1261
  return __awaiter(this, void 0, void 0, function () {
1143
- var tag, contract, decimals, balance, e_19;
1262
+ var tag, contract, decimals, balance, e_20;
1144
1263
  return __generator(this, function (_a) {
1145
1264
  switch (_a.label) {
1146
1265
  case 0:
@@ -1162,8 +1281,8 @@ var get_balance_token = function (address, token) {
1162
1281
  //log.debug(tag,"balance: ",balance)
1163
1282
  return [2 /*return*/, balance / Math.pow(10, decimals)];
1164
1283
  case 4:
1165
- e_19 = _a.sent();
1166
- console.error(tag, e_19);
1284
+ e_20 = _a.sent();
1285
+ console.error(tag, e_20);
1167
1286
  return [3 /*break*/, 5];
1168
1287
  case 5: return [2 /*return*/];
1169
1288
  }
@@ -1172,7 +1291,7 @@ var get_balance_token = function (address, token) {
1172
1291
  };
1173
1292
  var get_balance = function (address) {
1174
1293
  return __awaiter(this, void 0, void 0, function () {
1175
- var tag, output, e_20;
1294
+ var tag, output, e_21;
1176
1295
  return __generator(this, function (_a) {
1177
1296
  switch (_a.label) {
1178
1297
  case 0:
@@ -1187,8 +1306,8 @@ var get_balance = function (address) {
1187
1306
  output = (_a.sent()) / BASE;
1188
1307
  return [2 /*return*/, output];
1189
1308
  case 3:
1190
- e_20 = _a.sent();
1191
- console.error(tag, e_20);
1309
+ e_21 = _a.sent();
1310
+ console.error(tag, e_21);
1192
1311
  return [3 /*break*/, 4];
1193
1312
  case 4: return [2 /*return*/];
1194
1313
  }
@@ -1197,7 +1316,7 @@ var get_balance = function (address) {
1197
1316
  };
1198
1317
  var get_transactions = function (address, options) {
1199
1318
  return __awaiter(this, void 0, void 0, function () {
1200
- var tag, output, ethInfo, e_21;
1319
+ var tag, output, ethInfo, e_22;
1201
1320
  return __generator(this, function (_a) {
1202
1321
  switch (_a.label) {
1203
1322
  case 0:
@@ -1211,8 +1330,8 @@ var get_transactions = function (address, options) {
1211
1330
  ethInfo = _a.sent();
1212
1331
  return [2 /*return*/, ethInfo];
1213
1332
  case 3:
1214
- e_21 = _a.sent();
1215
- console.error(tag, e_21);
1333
+ e_22 = _a.sent();
1334
+ console.error(tag, e_22);
1216
1335
  return [3 /*break*/, 4];
1217
1336
  case 4: return [2 /*return*/];
1218
1337
  }
@@ -1221,7 +1340,7 @@ var get_transactions = function (address, options) {
1221
1340
  };
1222
1341
  var get_transaction = function (txid) {
1223
1342
  return __awaiter(this, void 0, void 0, function () {
1224
- var tag, output, _a, _b, e_22;
1343
+ var tag, output, _a, _b, e_23;
1225
1344
  return __generator(this, function (_c) {
1226
1345
  switch (_c.label) {
1227
1346
  case 0:
@@ -1246,8 +1365,8 @@ var get_transaction = function (txid) {
1246
1365
  _b.receipt = _c.sent();
1247
1366
  return [2 /*return*/, output];
1248
1367
  case 4:
1249
- e_22 = _c.sent();
1250
- console.error(tag, e_22);
1368
+ e_23 = _c.sent();
1369
+ console.error(tag, e_23);
1251
1370
  return [3 /*break*/, 5];
1252
1371
  case 5: return [2 /*return*/];
1253
1372
  }
@@ -1256,7 +1375,7 @@ var get_transaction = function (txid) {
1256
1375
  };
1257
1376
  var check_online_status = function () {
1258
1377
  return __awaiter(this, void 0, void 0, function () {
1259
- var tag, output, _a, _b, _c, _d, networkName, _e, _f, e_23;
1378
+ var tag, output, _a, _b, _c, _d, networkName, _e, _f, e_24;
1260
1379
  return __generator(this, function (_g) {
1261
1380
  switch (_g.label) {
1262
1381
  case 0:
@@ -1324,8 +1443,8 @@ var check_online_status = function () {
1324
1443
  _f.syncing = _g.sent();
1325
1444
  return [2 /*return*/, output];
1326
1445
  case 8:
1327
- e_23 = _g.sent();
1328
- console.error(tag, e_23);
1446
+ e_24 = _g.sent();
1447
+ console.error(tag, e_24);
1329
1448
  return [3 /*break*/, 9];
1330
1449
  case 9: return [2 /*return*/];
1331
1450
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pioneer-platform/eth-network",
3
- "version": "8.1.69",
3
+ "version": "8.1.71",
4
4
  "main": "./lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "scripts": {