@ethereansos/interfaces-core 0.4.128 → 0.4.131

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
@@ -23759,7 +23759,7 @@ var solidityImportRule = new RegExp('import( )+"(\\d+)"( )*;', 'gs');
23759
23759
  var pragmaSolidityRule = new RegExp('pragma( )+solidity( )*(\\^|>)\\d+.\\d+.\\d+;', 'gs');
23760
23760
 
23761
23761
  var instrumentedProviders = [];
23762
- var instrumentableMethods = ['eth_call', 'eth_getLogs'];
23762
+ var defaultInstrumentableMethods = ['eth_call', 'eth_getLogs', 'eth_estimateGas'];
23763
23763
 
23764
23764
  function instrumentProvider(_x, _x2) {
23765
23765
  return _instrumentProvider.apply(this, arguments);
@@ -23767,37 +23767,43 @@ function instrumentProvider(_x, _x2) {
23767
23767
 
23768
23768
  function _instrumentProvider() {
23769
23769
  _instrumentProvider = _asyncToGenerator$1( /*#__PURE__*/regeneratorRuntime.mark(function _callee(provider, method) {
23770
- var entry, chainId, _ref, chainProvider;
23770
+ var instrumentableMethods, entry, chainId, _ref, chainProvider;
23771
23771
 
23772
23772
  return regeneratorRuntime.wrap(function _callee$(_context) {
23773
23773
  while (1) {
23774
23774
  switch (_context.prev = _context.next) {
23775
23775
  case 0:
23776
+ instrumentableMethods = defaultInstrumentableMethods;
23777
+
23778
+ try {
23779
+ instrumentableMethods = sendAsync.context.providerInstrumentableMethods;
23780
+ } catch (e) {}
23781
+
23776
23782
  if (!(instrumentableMethods.indexOf(method) === -1)) {
23777
- _context.next = 2;
23783
+ _context.next = 4;
23778
23784
  break;
23779
23785
  }
23780
23786
 
23781
- return _context.abrupt("return");
23787
+ return _context.abrupt("return", provider);
23782
23788
 
23783
- case 2:
23789
+ case 4:
23784
23790
  entry = instrumentedProviders.filter(function (it) {
23785
23791
  return it.provider === provider;
23786
23792
  })[0];
23787
23793
 
23788
23794
  if (!entry) {
23789
- _context.next = 5;
23795
+ _context.next = 7;
23790
23796
  break;
23791
23797
  }
23792
23798
 
23793
23799
  return _context.abrupt("return", entry.instrumentedProvider);
23794
23800
 
23795
- case 5:
23801
+ case 7:
23796
23802
  _context.t0 = parseInt;
23797
- _context.next = 8;
23803
+ _context.next = 10;
23798
23804
  return sendAsync(provider, 'eth_chainId');
23799
23805
 
23800
- case 8:
23806
+ case 10:
23801
23807
  _context.t1 = _context.sent;
23802
23808
  chainId = (0, _context.t0)(_context.t1);
23803
23809
  instrumentedProviders.push(entry = {
@@ -23810,7 +23816,7 @@ function _instrumentProvider() {
23810
23816
  }, chainProvider = _ref.chainProvider;
23811
23817
  return _context.abrupt("return", entry.instrumentedProvider = chainId !== 1 && chainProvider[chainId] ? new Web3__default["default"].providers.HttpProvider(chainProvider[chainId]) : provider);
23812
23818
 
23813
- case 13:
23819
+ case 15:
23814
23820
  case "end":
23815
23821
  return _context.stop();
23816
23822
  }
@@ -23834,7 +23840,7 @@ function _sendAsync() {
23834
23840
  switch (_context3.prev = _context3.next) {
23835
23841
  case 0:
23836
23842
  _context3.next = 2;
23837
- return instrumentProvider(inputProvider);
23843
+ return instrumentProvider(inputProvider, method);
23838
23844
 
23839
23845
  case 2:
23840
23846
  provider = _context3.sent;