@ethereansos/interfaces-core 0.3.3 → 0.3.7

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/README.md CHANGED
File without changes
package/dist/index.cjs.js CHANGED
@@ -32826,72 +32826,89 @@ nhp.NodeType;
32826
32826
 
32827
32827
  var url = "https://etherscan.io/gastracker/";
32828
32828
 
32829
- var request = require('http' + (url.indexOf('https') === 0 ? 's' : ''));
32830
-
32831
32829
  function gasCalculator(_x) {
32832
32830
  return _gasCalculator.apply(this, arguments);
32833
32831
  }
32834
32832
 
32835
32833
  function _gasCalculator() {
32836
- _gasCalculator = _asyncToGenerator$1( /*#__PURE__*/regeneratorRuntime.mark(function _callee(provider) {
32834
+ _gasCalculator = _asyncToGenerator$1( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(provider) {
32837
32835
  var chainId;
32838
- return regeneratorRuntime.wrap(function _callee$(_context) {
32836
+ return regeneratorRuntime.wrap(function _callee2$(_context2) {
32839
32837
  while (1) {
32840
- switch (_context.prev = _context.next) {
32838
+ switch (_context2.prev = _context2.next) {
32841
32839
  case 0:
32842
- _context.t0 = parseInt;
32843
- _context.next = 3;
32840
+ _context2.t0 = parseInt;
32841
+ _context2.next = 3;
32844
32842
  return sendAsync(provider, 'eth_chainId');
32845
32843
 
32846
32844
  case 3:
32847
- _context.t1 = _context.sent;
32848
- chainId = (0, _context.t0)(_context.t1);
32845
+ _context2.t1 = _context2.sent;
32846
+ chainId = (0, _context2.t0)(_context2.t1);
32849
32847
 
32850
32848
  if (!(chainId !== 1 && !provider.blockchainConnection)) {
32851
- _context.next = 7;
32849
+ _context2.next = 7;
32852
32850
  break;
32853
32851
  }
32854
32852
 
32855
- return _context.abrupt("return", "1.500000009");
32853
+ return _context2.abrupt("return", "1.500000009");
32856
32854
 
32857
32855
  case 7:
32858
- _context.next = 9;
32859
- return new Promise(function (ok) {
32860
- var backup = function backup() {
32861
- return ok("2000000000");
32862
- };
32863
-
32864
- request.get(url, function (res) {
32865
- res.setEncoding("utf8");
32866
- var body = "";
32867
- res.on("data", function (data) {
32868
- body += data;
32869
- });
32870
- res.on("end", function () {
32871
- try {
32872
- var gas = parseInt(parse(body).querySelectorAll("#spanHighPrice")[0].innerHTML.trim());
32873
- return ok(numberToString(parseInt(numberToString(gas * 1.3))));
32874
- } catch (e) {
32875
- console.error(e);
32876
- backup();
32856
+ _context2.next = 9;
32857
+ return new Promise( /*#__PURE__*/function () {
32858
+ var _ref = _asyncToGenerator$1( /*#__PURE__*/regeneratorRuntime.mark(function _callee(ok) {
32859
+ var backup, gas;
32860
+ return regeneratorRuntime.wrap(function _callee$(_context) {
32861
+ while (1) {
32862
+ switch (_context.prev = _context.next) {
32863
+ case 0:
32864
+ backup = function backup() {
32865
+ return ok("2000000000");
32866
+ };
32867
+
32868
+ _context.prev = 1;
32869
+ _context.t0 = parseInt;
32870
+ _context.t1 = parse;
32871
+ _context.next = 6;
32872
+ return fetch(url);
32873
+
32874
+ case 6:
32875
+ _context.next = 8;
32876
+ return _context.sent.text();
32877
+
32878
+ case 8:
32879
+ _context.t2 = _context.sent;
32880
+ _context.t3 = (0, _context.t1)(_context.t2).querySelectorAll("#spanHighPrice")[0].innerHTML.trim();
32881
+ gas = (0, _context.t0)(_context.t3);
32882
+ return _context.abrupt("return", ok(numberToString(parseInt(numberToString(gas * 1.3)))));
32883
+
32884
+ case 14:
32885
+ _context.prev = 14;
32886
+ _context.t4 = _context["catch"](1);
32887
+ console.error(_context.t4);
32888
+ backup();
32889
+
32890
+ case 18:
32891
+ case "end":
32892
+ return _context.stop();
32893
+ }
32877
32894
  }
32878
- });
32879
- res.on("error", function (e) {
32880
- console.error(e);
32881
- backup();
32882
- });
32883
- });
32884
- });
32895
+ }, _callee, null, [[1, 14]]);
32896
+ }));
32897
+
32898
+ return function (_x2) {
32899
+ return _ref.apply(this, arguments);
32900
+ };
32901
+ }());
32885
32902
 
32886
32903
  case 9:
32887
- return _context.abrupt("return", _context.sent);
32904
+ return _context2.abrupt("return", _context2.sent);
32888
32905
 
32889
32906
  case 10:
32890
32907
  case "end":
32891
- return _context.stop();
32908
+ return _context2.stop();
32892
32909
  }
32893
32910
  }
32894
- }, _callee);
32911
+ }, _callee2);
32895
32912
  }));
32896
32913
  return _gasCalculator.apply(this, arguments);
32897
32914
  }
package/dist/index.esm.js CHANGED
@@ -32808,72 +32808,89 @@ nhp.NodeType;
32808
32808
 
32809
32809
  var url = "https://etherscan.io/gastracker/";
32810
32810
 
32811
- var request = require('http' + (url.indexOf('https') === 0 ? 's' : ''));
32812
-
32813
32811
  function gasCalculator(_x) {
32814
32812
  return _gasCalculator.apply(this, arguments);
32815
32813
  }
32816
32814
 
32817
32815
  function _gasCalculator() {
32818
- _gasCalculator = _asyncToGenerator$1( /*#__PURE__*/regeneratorRuntime.mark(function _callee(provider) {
32816
+ _gasCalculator = _asyncToGenerator$1( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(provider) {
32819
32817
  var chainId;
32820
- return regeneratorRuntime.wrap(function _callee$(_context) {
32818
+ return regeneratorRuntime.wrap(function _callee2$(_context2) {
32821
32819
  while (1) {
32822
- switch (_context.prev = _context.next) {
32820
+ switch (_context2.prev = _context2.next) {
32823
32821
  case 0:
32824
- _context.t0 = parseInt;
32825
- _context.next = 3;
32822
+ _context2.t0 = parseInt;
32823
+ _context2.next = 3;
32826
32824
  return sendAsync(provider, 'eth_chainId');
32827
32825
 
32828
32826
  case 3:
32829
- _context.t1 = _context.sent;
32830
- chainId = (0, _context.t0)(_context.t1);
32827
+ _context2.t1 = _context2.sent;
32828
+ chainId = (0, _context2.t0)(_context2.t1);
32831
32829
 
32832
32830
  if (!(chainId !== 1 && !provider.blockchainConnection)) {
32833
- _context.next = 7;
32831
+ _context2.next = 7;
32834
32832
  break;
32835
32833
  }
32836
32834
 
32837
- return _context.abrupt("return", "1.500000009");
32835
+ return _context2.abrupt("return", "1.500000009");
32838
32836
 
32839
32837
  case 7:
32840
- _context.next = 9;
32841
- return new Promise(function (ok) {
32842
- var backup = function backup() {
32843
- return ok("2000000000");
32844
- };
32845
-
32846
- request.get(url, function (res) {
32847
- res.setEncoding("utf8");
32848
- var body = "";
32849
- res.on("data", function (data) {
32850
- body += data;
32851
- });
32852
- res.on("end", function () {
32853
- try {
32854
- var gas = parseInt(parse(body).querySelectorAll("#spanHighPrice")[0].innerHTML.trim());
32855
- return ok(numberToString(parseInt(numberToString(gas * 1.3))));
32856
- } catch (e) {
32857
- console.error(e);
32858
- backup();
32838
+ _context2.next = 9;
32839
+ return new Promise( /*#__PURE__*/function () {
32840
+ var _ref = _asyncToGenerator$1( /*#__PURE__*/regeneratorRuntime.mark(function _callee(ok) {
32841
+ var backup, gas;
32842
+ return regeneratorRuntime.wrap(function _callee$(_context) {
32843
+ while (1) {
32844
+ switch (_context.prev = _context.next) {
32845
+ case 0:
32846
+ backup = function backup() {
32847
+ return ok("2000000000");
32848
+ };
32849
+
32850
+ _context.prev = 1;
32851
+ _context.t0 = parseInt;
32852
+ _context.t1 = parse;
32853
+ _context.next = 6;
32854
+ return fetch(url);
32855
+
32856
+ case 6:
32857
+ _context.next = 8;
32858
+ return _context.sent.text();
32859
+
32860
+ case 8:
32861
+ _context.t2 = _context.sent;
32862
+ _context.t3 = (0, _context.t1)(_context.t2).querySelectorAll("#spanHighPrice")[0].innerHTML.trim();
32863
+ gas = (0, _context.t0)(_context.t3);
32864
+ return _context.abrupt("return", ok(numberToString(parseInt(numberToString(gas * 1.3)))));
32865
+
32866
+ case 14:
32867
+ _context.prev = 14;
32868
+ _context.t4 = _context["catch"](1);
32869
+ console.error(_context.t4);
32870
+ backup();
32871
+
32872
+ case 18:
32873
+ case "end":
32874
+ return _context.stop();
32875
+ }
32859
32876
  }
32860
- });
32861
- res.on("error", function (e) {
32862
- console.error(e);
32863
- backup();
32864
- });
32865
- });
32866
- });
32877
+ }, _callee, null, [[1, 14]]);
32878
+ }));
32879
+
32880
+ return function (_x2) {
32881
+ return _ref.apply(this, arguments);
32882
+ };
32883
+ }());
32867
32884
 
32868
32885
  case 9:
32869
- return _context.abrupt("return", _context.sent);
32886
+ return _context2.abrupt("return", _context2.sent);
32870
32887
 
32871
32888
  case 10:
32872
32889
  case "end":
32873
- return _context.stop();
32890
+ return _context2.stop();
32874
32891
  }
32875
32892
  }
32876
- }, _callee);
32893
+ }, _callee2);
32877
32894
  }));
32878
32895
  return _gasCalculator.apply(this, arguments);
32879
32896
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethereansos/interfaces-core",
3
- "version": "0.3.3",
3
+ "version": "0.3.7",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",