@ethereansos/interfaces-core 0.4.111 → 0.4.114

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.cjs.js CHANGED
@@ -48879,16 +48879,20 @@ var Web3ContextInitializer = function Web3ContextInitializer(_ref) {
48879
48879
  while (1) {
48880
48880
  switch (_context.prev = _context.next) {
48881
48881
  case 0:
48882
- if (!provider) {
48883
- setter(0);
48882
+ if (provider) {
48883
+ _context.next = 2;
48884
+ break;
48884
48885
  }
48885
48886
 
48886
- _context.prev = 1;
48887
+ return _context.abrupt("return", setter(0));
48888
+
48889
+ case 2:
48890
+ _context.prev = 2;
48887
48891
  _context.t0 = parseInt;
48888
- _context.next = 5;
48892
+ _context.next = 6;
48889
48893
  return sendAsync(provider, 'eth_blockNumber');
48890
48894
 
48891
- case 5:
48895
+ case 6:
48892
48896
  _context.t1 = _context.sent;
48893
48897
  currentBlockNumber = (0, _context.t0)(_context.t1);
48894
48898
 
@@ -48896,19 +48900,19 @@ var Web3ContextInitializer = function Web3ContextInitializer(_ref) {
48896
48900
  setter(currentBlockNumber);
48897
48901
  }
48898
48902
 
48899
- _context.next = 12;
48903
+ _context.next = 13;
48900
48904
  break;
48901
48905
 
48902
- case 10:
48903
- _context.prev = 10;
48904
- _context.t2 = _context["catch"](1);
48906
+ case 11:
48907
+ _context.prev = 11;
48908
+ _context.t2 = _context["catch"](2);
48905
48909
 
48906
- case 12:
48910
+ case 13:
48907
48911
  case "end":
48908
48912
  return _context.stop();
48909
48913
  }
48910
48914
  }
48911
- }, _callee, null, [[1, 10]]);
48915
+ }, _callee, null, [[2, 11]]);
48912
48916
  }));
48913
48917
 
48914
48918
  return function (_x, _x2, _x3, _x4) {
@@ -48918,15 +48922,12 @@ var Web3ContextInitializer = function Web3ContextInitializer(_ref) {
48918
48922
  var resetBlockInterval = React.useCallback(function () {
48919
48923
  intervalId && clearInterval(intervalId);
48920
48924
  tryUpdateBlock(wallet === null || wallet === void 0 ? void 0 : wallet.ethereum, block, setBlock, true);
48921
- tryUpdateBlock(dualProvider, dualBlock, setDualBlock, true);
48922
- wallet && wallet.ethereum && setIntervalId(setInterval(function () {
48923
- return tryUpdateBlock(wallet.ethereum, block, setBlock);
48924
- }, realBlockIntervalTimeout));
48925
- dualProvider && setIntervalId(setInterval(function () {
48926
- return tryUpdateBlock(dualProvider, dualBlock, setDualBlock);
48925
+ tryUpdateBlock(dualProvider, dualBlock, setDualBlock, true)(wallet && wallet.ethereum || dualProvider) && setIntervalId(setInterval(function () {
48926
+ tryUpdateBlock(wallet.ethereum, block, setBlock);
48927
+ tryUpdateBlock(dualProvider, dualBlock, setDualBlock);
48927
48928
  }, realBlockIntervalTimeout));
48928
- }, [wallet, dualProvider, intervalId]);
48929
- React.useEffect(resetBlockInterval, [realBlockInterval, realBlockIntervalTimeout, wallet && wallet.ethereum, dualProvider, intervalId]);
48929
+ }, [wallet, dualProvider, realBlockIntervalTimeout, intervalId]);
48930
+ React.useEffect(resetBlockInterval, [realBlockInterval, realBlockIntervalTimeout, wallet && wallet.ethereum, dualProvider]);
48930
48931
  React.useEffect(function () {
48931
48932
  setConnectionStatus(wallet && wallet.ethereum ? CONNECTED : connectionStatus === CONNECTING ? CONNECTING : NOT_CONNECTED);
48932
48933
  setWeb3Instance(wallet && wallet.ethereum && (web3Instance || new Web3__default["default"](wallet.ethereum)) || null);