@ethereansos/interfaces-core 0.4.133 → 0.4.137

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/dist/index.esm.js CHANGED
@@ -23754,22 +23754,18 @@ function instrumentProvider(_x, _x2) {
23754
23754
 
23755
23755
  function _instrumentProvider() {
23756
23756
  _instrumentProvider = _asyncToGenerator$1( /*#__PURE__*/regeneratorRuntime.mark(function _callee(provider, method) {
23757
- var _instrumentableMethod2;
23758
-
23759
- var instrumentableMethods, _instrumentableMethod, entry, chainId, _ref, chainProvider;
23757
+ var instrumentableMethods, entry, chainId, _ref, chainProvider;
23760
23758
 
23761
23759
  return regeneratorRuntime.wrap(function _callee$(_context) {
23762
23760
  while (1) {
23763
23761
  switch (_context.prev = _context.next) {
23764
23762
  case 0:
23765
- instrumentableMethods = [];
23763
+ instrumentableMethods = [].concat(defaultInstrumentableMethods);
23766
23764
 
23767
23765
  try {
23768
- (_instrumentableMethod = instrumentableMethods).push.apply(_instrumentableMethod, _toConsumableArray(sendAsync.context.providerInstrumentableMethods || []));
23766
+ instrumentableMethods = _toConsumableArray(sendAsync.context.providerInstrumentableMethods || defaultInstrumentableMethods);
23769
23767
  } catch (e) {}
23770
23768
 
23771
- (_instrumentableMethod2 = instrumentableMethods).push.apply(_instrumentableMethod2, defaultInstrumentableMethods);
23772
-
23773
23769
  instrumentableMethods = instrumentableMethods.map(function (it) {
23774
23770
  return it.toLowerCase();
23775
23771
  }).filter(function (it, i, arr) {
@@ -23777,30 +23773,30 @@ function _instrumentProvider() {
23777
23773
  });
23778
23774
 
23779
23775
  if (!(instrumentableMethods.indexOf(method.toLowerCase()) === -1)) {
23780
- _context.next = 6;
23776
+ _context.next = 5;
23781
23777
  break;
23782
23778
  }
23783
23779
 
23784
23780
  return _context.abrupt("return", provider);
23785
23781
 
23786
- case 6:
23782
+ case 5:
23787
23783
  entry = sendAsync.instrumentedProviders.filter(function (it) {
23788
23784
  return it.provider === provider;
23789
23785
  })[0];
23790
23786
 
23791
23787
  if (!entry) {
23792
- _context.next = 9;
23788
+ _context.next = 8;
23793
23789
  break;
23794
23790
  }
23795
23791
 
23796
23792
  return _context.abrupt("return", entry.instrumentedProvider);
23797
23793
 
23798
- case 9:
23794
+ case 8:
23799
23795
  _context.t0 = parseInt;
23800
- _context.next = 12;
23796
+ _context.next = 11;
23801
23797
  return sendAsync(provider, 'eth_chainId');
23802
23798
 
23803
- case 12:
23799
+ case 11:
23804
23800
  _context.t1 = _context.sent;
23805
23801
  chainId = (0, _context.t0)(_context.t1);
23806
23802
  entry = {
@@ -23814,7 +23810,7 @@ function _instrumentProvider() {
23814
23810
  }, chainProvider = _ref.chainProvider;
23815
23811
  return _context.abrupt("return", entry.instrumentedProvider = chainId !== 1 && chainProvider[chainId] ? new Web3.providers.HttpProvider(chainProvider[chainId]) : provider);
23816
23812
 
23817
- case 18:
23813
+ case 17:
23818
23814
  case "end":
23819
23815
  return _context.stop();
23820
23816
  }
@@ -23824,26 +23820,17 @@ function _instrumentProvider() {
23824
23820
  return _instrumentProvider.apply(this, arguments);
23825
23821
  }
23826
23822
 
23827
- function sendAsync(_x3, _x4) {
23828
- return _sendAsync.apply(this, arguments);
23823
+ function sendAsyncInternal(_x3, _x4, _x5) {
23824
+ return _sendAsyncInternal.apply(this, arguments);
23829
23825
  }
23830
23826
 
23831
- function _sendAsync() {
23832
- _sendAsync = _asyncToGenerator$1( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(inputProvider, method) {
23833
- var provider,
23834
- params,
23835
- _args3 = arguments;
23827
+ function _sendAsyncInternal() {
23828
+ _sendAsyncInternal = _asyncToGenerator$1( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(provider, method, params) {
23836
23829
  return regeneratorRuntime.wrap(function _callee3$(_context3) {
23837
23830
  while (1) {
23838
23831
  switch (_context3.prev = _context3.next) {
23839
23832
  case 0:
23840
23833
  _context3.next = 2;
23841
- return instrumentProvider(inputProvider, method);
23842
-
23843
- case 2:
23844
- provider = _context3.sent;
23845
- params = Array.prototype.slice.call(_args3).slice(2) || [];
23846
- _context3.next = 6;
23847
23834
  return new Promise( /*#__PURE__*/function () {
23848
23835
  var _ref2 = _asyncToGenerator$1( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(ok, ko) {
23849
23836
  return regeneratorRuntime.wrap(function _callee2$(_context2) {
@@ -23878,21 +23865,75 @@ function _sendAsync() {
23878
23865
  }, _callee2, null, [[0, 5]]);
23879
23866
  }));
23880
23867
 
23881
- return function (_x5, _x6) {
23868
+ return function (_x8, _x9) {
23882
23869
  return _ref2.apply(this, arguments);
23883
23870
  };
23884
23871
  }());
23885
23872
 
23886
- case 6:
23873
+ case 2:
23887
23874
  return _context3.abrupt("return", _context3.sent);
23888
23875
 
23889
- case 7:
23876
+ case 3:
23890
23877
  case "end":
23891
23878
  return _context3.stop();
23892
23879
  }
23893
23880
  }
23894
23881
  }, _callee3);
23895
23882
  }));
23883
+ return _sendAsyncInternal.apply(this, arguments);
23884
+ }
23885
+
23886
+ function sendAsync(_x6, _x7) {
23887
+ return _sendAsync.apply(this, arguments);
23888
+ }
23889
+
23890
+ function _sendAsync() {
23891
+ _sendAsync = _asyncToGenerator$1( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(provider, method) {
23892
+ var params,
23893
+ instrumentedProvider,
23894
+ _args4 = arguments;
23895
+ return regeneratorRuntime.wrap(function _callee4$(_context4) {
23896
+ while (1) {
23897
+ switch (_context4.prev = _context4.next) {
23898
+ case 0:
23899
+ params = Array.prototype.slice.call(_args4).slice(2) || [];
23900
+ _context4.prev = 1;
23901
+ _context4.next = 4;
23902
+ return sendAsyncInternal(provider, method, params);
23903
+
23904
+ case 4:
23905
+ return _context4.abrupt("return", _context4.sent);
23906
+
23907
+ case 7:
23908
+ _context4.prev = 7;
23909
+ _context4.t0 = _context4["catch"](1);
23910
+ _context4.next = 11;
23911
+ return instrumentProvider(provider, method);
23912
+
23913
+ case 11:
23914
+ instrumentedProvider = _context4.sent;
23915
+
23916
+ if (!(provider === instrumentedProvider)) {
23917
+ _context4.next = 14;
23918
+ break;
23919
+ }
23920
+
23921
+ throw _context4.t0;
23922
+
23923
+ case 14:
23924
+ _context4.next = 16;
23925
+ return sendAsyncInternal(instrumentedProvider, method, params);
23926
+
23927
+ case 16:
23928
+ return _context4.abrupt("return", _context4.sent);
23929
+
23930
+ case 17:
23931
+ case "end":
23932
+ return _context4.stop();
23933
+ }
23934
+ }
23935
+ }, _callee4, null, [[1, 7]]);
23936
+ }));
23896
23937
  return _sendAsync.apply(this, arguments);
23897
23938
  }
23898
23939