@ethereansos/interfaces-core 0.4.128 → 0.4.131

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.esm.js CHANGED
@@ -23747,7 +23747,7 @@ var solidityImportRule = new RegExp('import( )+"(\\d+)"( )*;', 'gs');
23747
23747
  var pragmaSolidityRule = new RegExp('pragma( )+solidity( )*(\\^|>)\\d+.\\d+.\\d+;', 'gs');
23748
23748
 
23749
23749
  var instrumentedProviders = [];
23750
- var instrumentableMethods = ['eth_call', 'eth_getLogs'];
23750
+ var defaultInstrumentableMethods = ['eth_call', 'eth_getLogs', 'eth_estimateGas'];
23751
23751
 
23752
23752
  function instrumentProvider(_x, _x2) {
23753
23753
  return _instrumentProvider.apply(this, arguments);
@@ -23755,37 +23755,43 @@ function instrumentProvider(_x, _x2) {
23755
23755
 
23756
23756
  function _instrumentProvider() {
23757
23757
  _instrumentProvider = _asyncToGenerator$1( /*#__PURE__*/regeneratorRuntime.mark(function _callee(provider, method) {
23758
- var entry, chainId, _ref, chainProvider;
23758
+ var instrumentableMethods, entry, chainId, _ref, chainProvider;
23759
23759
 
23760
23760
  return regeneratorRuntime.wrap(function _callee$(_context) {
23761
23761
  while (1) {
23762
23762
  switch (_context.prev = _context.next) {
23763
23763
  case 0:
23764
+ instrumentableMethods = defaultInstrumentableMethods;
23765
+
23766
+ try {
23767
+ instrumentableMethods = sendAsync.context.providerInstrumentableMethods;
23768
+ } catch (e) {}
23769
+
23764
23770
  if (!(instrumentableMethods.indexOf(method) === -1)) {
23765
- _context.next = 2;
23771
+ _context.next = 4;
23766
23772
  break;
23767
23773
  }
23768
23774
 
23769
- return _context.abrupt("return");
23775
+ return _context.abrupt("return", provider);
23770
23776
 
23771
- case 2:
23777
+ case 4:
23772
23778
  entry = instrumentedProviders.filter(function (it) {
23773
23779
  return it.provider === provider;
23774
23780
  })[0];
23775
23781
 
23776
23782
  if (!entry) {
23777
- _context.next = 5;
23783
+ _context.next = 7;
23778
23784
  break;
23779
23785
  }
23780
23786
 
23781
23787
  return _context.abrupt("return", entry.instrumentedProvider);
23782
23788
 
23783
- case 5:
23789
+ case 7:
23784
23790
  _context.t0 = parseInt;
23785
- _context.next = 8;
23791
+ _context.next = 10;
23786
23792
  return sendAsync(provider, 'eth_chainId');
23787
23793
 
23788
- case 8:
23794
+ case 10:
23789
23795
  _context.t1 = _context.sent;
23790
23796
  chainId = (0, _context.t0)(_context.t1);
23791
23797
  instrumentedProviders.push(entry = {
@@ -23798,7 +23804,7 @@ function _instrumentProvider() {
23798
23804
  }, chainProvider = _ref.chainProvider;
23799
23805
  return _context.abrupt("return", entry.instrumentedProvider = chainId !== 1 && chainProvider[chainId] ? new Web3.providers.HttpProvider(chainProvider[chainId]) : provider);
23800
23806
 
23801
- case 13:
23807
+ case 15:
23802
23808
  case "end":
23803
23809
  return _context.stop();
23804
23810
  }
@@ -23822,7 +23828,7 @@ function _sendAsync() {
23822
23828
  switch (_context3.prev = _context3.next) {
23823
23829
  case 0:
23824
23830
  _context3.next = 2;
23825
- return instrumentProvider(inputProvider);
23831
+ return instrumentProvider(inputProvider, method);
23826
23832
 
23827
23833
  case 2:
23828
23834
  provider = _context3.sent;