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