@ethereansos/interfaces-core 0.4.131 → 0.4.132

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
@@ -23755,43 +23755,53 @@ function instrumentProvider(_x, _x2) {
23755
23755
 
23756
23756
  function _instrumentProvider() {
23757
23757
  _instrumentProvider = _asyncToGenerator$1( /*#__PURE__*/regeneratorRuntime.mark(function _callee(provider, method) {
23758
+ var _instrumentableMethod;
23759
+
23758
23760
  var instrumentableMethods, entry, chainId, _ref, chainProvider;
23759
23761
 
23760
23762
  return regeneratorRuntime.wrap(function _callee$(_context) {
23761
23763
  while (1) {
23762
23764
  switch (_context.prev = _context.next) {
23763
23765
  case 0:
23764
- instrumentableMethods = defaultInstrumentableMethods;
23766
+ instrumentableMethods = [];
23765
23767
 
23766
23768
  try {
23767
- instrumentableMethods = sendAsync.context.providerInstrumentableMethods;
23769
+ instrumentableMethods = _toConsumableArray(sendAsync.context.providerInstrumentableMethods || []);
23768
23770
  } catch (e) {}
23769
23771
 
23770
- if (!(instrumentableMethods.indexOf(method) === -1)) {
23771
- _context.next = 4;
23772
+ (_instrumentableMethod = instrumentableMethods).push.apply(_instrumentableMethod, defaultInstrumentableMethods);
23773
+
23774
+ instrumentableMethods = instrumentableMethods.map(function (it) {
23775
+ return it.toLowerCase();
23776
+ }).filter(function (it, i, arr) {
23777
+ return arr.indexOf(it) === i;
23778
+ });
23779
+
23780
+ if (!(instrumentableMethods.indexOf(method.toLowerCase()) === -1)) {
23781
+ _context.next = 6;
23772
23782
  break;
23773
23783
  }
23774
23784
 
23775
23785
  return _context.abrupt("return", provider);
23776
23786
 
23777
- case 4:
23787
+ case 6:
23778
23788
  entry = instrumentedProviders.filter(function (it) {
23779
23789
  return it.provider === provider;
23780
23790
  })[0];
23781
23791
 
23782
23792
  if (!entry) {
23783
- _context.next = 7;
23793
+ _context.next = 9;
23784
23794
  break;
23785
23795
  }
23786
23796
 
23787
23797
  return _context.abrupt("return", entry.instrumentedProvider);
23788
23798
 
23789
- case 7:
23799
+ case 9:
23790
23800
  _context.t0 = parseInt;
23791
- _context.next = 10;
23801
+ _context.next = 12;
23792
23802
  return sendAsync(provider, 'eth_chainId');
23793
23803
 
23794
- case 10:
23804
+ case 12:
23795
23805
  _context.t1 = _context.sent;
23796
23806
  chainId = (0, _context.t0)(_context.t1);
23797
23807
  instrumentedProviders.push(entry = {
@@ -23804,7 +23814,7 @@ function _instrumentProvider() {
23804
23814
  }, chainProvider = _ref.chainProvider;
23805
23815
  return _context.abrupt("return", entry.instrumentedProvider = chainId !== 1 && chainProvider[chainId] ? new Web3.providers.HttpProvider(chainProvider[chainId]) : provider);
23806
23816
 
23807
- case 15:
23817
+ case 17:
23808
23818
  case "end":
23809
23819
  return _context.stop();
23810
23820
  }