@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.esm.js CHANGED
@@ -48867,16 +48867,20 @@ var Web3ContextInitializer = function Web3ContextInitializer(_ref) {
48867
48867
  while (1) {
48868
48868
  switch (_context.prev = _context.next) {
48869
48869
  case 0:
48870
- if (!provider) {
48871
- setter(0);
48870
+ if (provider) {
48871
+ _context.next = 2;
48872
+ break;
48872
48873
  }
48873
48874
 
48874
- _context.prev = 1;
48875
+ return _context.abrupt("return", setter(0));
48876
+
48877
+ case 2:
48878
+ _context.prev = 2;
48875
48879
  _context.t0 = parseInt;
48876
- _context.next = 5;
48880
+ _context.next = 6;
48877
48881
  return sendAsync(provider, 'eth_blockNumber');
48878
48882
 
48879
- case 5:
48883
+ case 6:
48880
48884
  _context.t1 = _context.sent;
48881
48885
  currentBlockNumber = (0, _context.t0)(_context.t1);
48882
48886
 
@@ -48884,19 +48888,19 @@ var Web3ContextInitializer = function Web3ContextInitializer(_ref) {
48884
48888
  setter(currentBlockNumber);
48885
48889
  }
48886
48890
 
48887
- _context.next = 12;
48891
+ _context.next = 13;
48888
48892
  break;
48889
48893
 
48890
- case 10:
48891
- _context.prev = 10;
48892
- _context.t2 = _context["catch"](1);
48894
+ case 11:
48895
+ _context.prev = 11;
48896
+ _context.t2 = _context["catch"](2);
48893
48897
 
48894
- case 12:
48898
+ case 13:
48895
48899
  case "end":
48896
48900
  return _context.stop();
48897
48901
  }
48898
48902
  }
48899
- }, _callee, null, [[1, 10]]);
48903
+ }, _callee, null, [[2, 11]]);
48900
48904
  }));
48901
48905
 
48902
48906
  return function (_x, _x2, _x3, _x4) {
@@ -48906,15 +48910,12 @@ var Web3ContextInitializer = function Web3ContextInitializer(_ref) {
48906
48910
  var resetBlockInterval = useCallback(function () {
48907
48911
  intervalId && clearInterval(intervalId);
48908
48912
  tryUpdateBlock(wallet === null || wallet === void 0 ? void 0 : wallet.ethereum, block, setBlock, true);
48909
- tryUpdateBlock(dualProvider, dualBlock, setDualBlock, true);
48910
- wallet && wallet.ethereum && setIntervalId(setInterval(function () {
48911
- return tryUpdateBlock(wallet.ethereum, block, setBlock);
48912
- }, realBlockIntervalTimeout));
48913
- dualProvider && setIntervalId(setInterval(function () {
48914
- return tryUpdateBlock(dualProvider, dualBlock, setDualBlock);
48913
+ tryUpdateBlock(dualProvider, dualBlock, setDualBlock, true)(wallet && wallet.ethereum || dualProvider) && setIntervalId(setInterval(function () {
48914
+ tryUpdateBlock(wallet.ethereum, block, setBlock);
48915
+ tryUpdateBlock(dualProvider, dualBlock, setDualBlock);
48915
48916
  }, realBlockIntervalTimeout));
48916
- }, [wallet, dualProvider, intervalId]);
48917
- useEffect(resetBlockInterval, [realBlockInterval, realBlockIntervalTimeout, wallet && wallet.ethereum, dualProvider, intervalId]);
48917
+ }, [wallet, dualProvider, realBlockIntervalTimeout, intervalId]);
48918
+ useEffect(resetBlockInterval, [realBlockInterval, realBlockIntervalTimeout, wallet && wallet.ethereum, dualProvider]);
48918
48919
  useEffect(function () {
48919
48920
  setConnectionStatus(wallet && wallet.ethereum ? CONNECTED : connectionStatus === CONNECTING ? CONNECTING : NOT_CONNECTED);
48920
48921
  setWeb3Instance(wallet && wallet.ethereum && (web3Instance || new Web3(wallet.ethereum)) || null);