@ethereansos/interfaces-core 0.4.136 → 0.4.139

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
@@ -23746,7 +23746,7 @@ var URL_REGEXP = new RegExp('(http://www.|https://www.|http://|https://)?[a-z0-9
23746
23746
  var solidityImportRule = new RegExp('import( )+"(\\d+)"( )*;', 'gs');
23747
23747
  var pragmaSolidityRule = new RegExp('pragma( )+solidity( )*(\\^|>)\\d+.\\d+.\\d+;', 'gs');
23748
23748
 
23749
- var defaultInstrumentableMethods = ['eth_call', 'eth_getLogs', 'eth_estimateGas'];
23749
+ var defaultInstrumentableMethods = ['eth_getLogs'];
23750
23750
 
23751
23751
  function instrumentProvider(_x, _x2) {
23752
23752
  return _instrumentProvider.apply(this, arguments);
@@ -23780,7 +23780,7 @@ function _instrumentProvider() {
23780
23780
  return _context.abrupt("return", provider);
23781
23781
 
23782
23782
  case 5:
23783
- entry = sendAsync.instrumentedProviders.filter(function (it) {
23783
+ entry = (sendAsync.instrumentedProviders = sendAsync.instrumentedProviders || []).filter(function (it) {
23784
23784
  return it.provider === provider;
23785
23785
  })[0];
23786
23786
 
@@ -23804,7 +23804,7 @@ function _instrumentProvider() {
23804
23804
  provider: provider,
23805
23805
  instrumentedProvider: provider
23806
23806
  };
23807
- sendAsync.instrumentedProviders.push(entry);
23807
+ sendAsync.instrumentedProviders = [].concat(_toConsumableArray(sendAsync.instrumentProvider || []), [entry]);
23808
23808
  _ref = sendAsync.context || {
23809
23809
  chainProvider: {}
23810
23810
  }, chainProvider = _ref.chainProvider;
@@ -23820,26 +23820,17 @@ function _instrumentProvider() {
23820
23820
  return _instrumentProvider.apply(this, arguments);
23821
23821
  }
23822
23822
 
23823
- function sendAsync(_x3, _x4) {
23824
- return _sendAsync.apply(this, arguments);
23823
+ function sendAsyncInternal(_x3, _x4, _x5) {
23824
+ return _sendAsyncInternal.apply(this, arguments);
23825
23825
  }
23826
23826
 
23827
- function _sendAsync() {
23828
- _sendAsync = _asyncToGenerator$1( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(inputProvider, method) {
23829
- var provider,
23830
- params,
23831
- _args3 = arguments;
23827
+ function _sendAsyncInternal() {
23828
+ _sendAsyncInternal = _asyncToGenerator$1( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(provider, method, params) {
23832
23829
  return regeneratorRuntime.wrap(function _callee3$(_context3) {
23833
23830
  while (1) {
23834
23831
  switch (_context3.prev = _context3.next) {
23835
23832
  case 0:
23836
23833
  _context3.next = 2;
23837
- return instrumentProvider(inputProvider, method);
23838
-
23839
- case 2:
23840
- provider = _context3.sent;
23841
- params = Array.prototype.slice.call(_args3).slice(2) || [];
23842
- _context3.next = 6;
23843
23834
  return new Promise( /*#__PURE__*/function () {
23844
23835
  var _ref2 = _asyncToGenerator$1( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(ok, ko) {
23845
23836
  return regeneratorRuntime.wrap(function _callee2$(_context2) {
@@ -23874,25 +23865,106 @@ function _sendAsync() {
23874
23865
  }, _callee2, null, [[0, 5]]);
23875
23866
  }));
23876
23867
 
23877
- return function (_x5, _x6) {
23868
+ return function (_x8, _x9) {
23878
23869
  return _ref2.apply(this, arguments);
23879
23870
  };
23880
23871
  }());
23881
23872
 
23882
- case 6:
23873
+ case 2:
23883
23874
  return _context3.abrupt("return", _context3.sent);
23884
23875
 
23885
- case 7:
23876
+ case 3:
23886
23877
  case "end":
23887
23878
  return _context3.stop();
23888
23879
  }
23889
23880
  }
23890
23881
  }, _callee3);
23891
23882
  }));
23883
+ return _sendAsyncInternal.apply(this, arguments);
23884
+ }
23885
+
23886
+ function sendAsync(_x6, _x7) {
23892
23887
  return _sendAsync.apply(this, arguments);
23893
23888
  }
23894
23889
 
23895
- sendAsync.instrumentedProviders = [];
23890
+ function _sendAsync() {
23891
+ _sendAsync = _asyncToGenerator$1( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(provider, method) {
23892
+ var params,
23893
+ message,
23894
+ instrumentedProvider,
23895
+ _args4 = arguments;
23896
+ return regeneratorRuntime.wrap(function _callee4$(_context4) {
23897
+ while (1) {
23898
+ switch (_context4.prev = _context4.next) {
23899
+ case 0:
23900
+ params = Array.prototype.slice.call(_args4).slice(2) || [];
23901
+
23902
+ case 1:
23903
+
23904
+ _context4.prev = 2;
23905
+ _context4.next = 5;
23906
+ return sendAsyncInternal(provider, method, params);
23907
+
23908
+ case 5:
23909
+ return _context4.abrupt("return", _context4.sent);
23910
+
23911
+ case 8:
23912
+ _context4.prev = 8;
23913
+ _context4.t0 = _context4["catch"](2);
23914
+ message = (_context4.t0.stack || _context4.t0.message || _context4.t0.toString()).toLowerCase();
23915
+
23916
+ if (!(message.indexOf('execution reverted') !== -1 || message.indexOf('zero result') !== -1)) {
23917
+ _context4.next = 13;
23918
+ break;
23919
+ }
23920
+
23921
+ throw _context4.t0;
23922
+
23923
+ case 13:
23924
+ if (!(message.indexOf('429') !== -1)) {
23925
+ _context4.next = 22;
23926
+ break;
23927
+ }
23928
+
23929
+ _context4.next = 16;
23930
+ return instrumentProvider(provider, method);
23931
+
23932
+ case 16:
23933
+ instrumentedProvider = _context4.sent;
23934
+
23935
+ if (!(provider === instrumentedProvider)) {
23936
+ _context4.next = 19;
23937
+ break;
23938
+ }
23939
+
23940
+ throw _context4.t0;
23941
+
23942
+ case 19:
23943
+ _context4.next = 21;
23944
+ return sendAsyncInternal(instrumentedProvider, method, params);
23945
+
23946
+ case 21:
23947
+ return _context4.abrupt("return", _context4.sent);
23948
+
23949
+ case 22:
23950
+ _context4.next = 24;
23951
+ return new Promise(function (ok) {
23952
+ return setTimeout(ok, 700);
23953
+ });
23954
+
23955
+ case 24:
23956
+ _context4.next = 1;
23957
+ break;
23958
+
23959
+ case 26:
23960
+ case "end":
23961
+ return _context4.stop();
23962
+ }
23963
+ }
23964
+ }, _callee4, null, [[2, 8]]);
23965
+ }));
23966
+ return _sendAsync.apply(this, arguments);
23967
+ }
23896
23968
 
23897
23969
  /**
23898
23970
  * Get current ethereum address
@@ -48884,7 +48956,7 @@ var useWeb3 = function useWeb3() {
48884
48956
  };
48885
48957
  var Web3ContextProvider = function Web3ContextProvider(props) {
48886
48958
  var context = useEthosContext();
48887
- sendAsync.context = sendAsync.context || context;
48959
+ sendAsync.context = sendAsync.context || _objectSpread2({}, context);
48888
48960
  var connectors = context.useWalletSettings.reduce(function (acc, connector) {
48889
48961
  return _objectSpread2(_objectSpread2({}, acc), _defineProperty({}, connector.id, _objectSpread2(_objectSpread2({}, connector.settings), {}, {
48890
48962
  buttonText: connector.buttonText