@ethereansos/interfaces-core 0.4.112 → 0.4.115
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.cjs.js +22 -17
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +22 -17
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
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 (
|
48883
|
-
|
48882
|
+
if (provider) {
|
48883
|
+
_context.next = 2;
|
48884
|
+
break;
|
48884
48885
|
}
|
48885
48886
|
|
48886
|
-
_context.
|
48887
|
+
return _context.abrupt("return", setter(0));
|
48888
|
+
|
48889
|
+
case 2:
|
48890
|
+
_context.prev = 2;
|
48887
48891
|
_context.t0 = parseInt;
|
48888
|
-
_context.next =
|
48892
|
+
_context.next = 6;
|
48889
48893
|
return sendAsync(provider, 'eth_blockNumber');
|
48890
48894
|
|
48891
|
-
case
|
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 =
|
48903
|
+
_context.next = 13;
|
48900
48904
|
break;
|
48901
48905
|
|
48902
|
-
case
|
48903
|
-
_context.prev =
|
48904
|
-
_context.t2 = _context["catch"](
|
48906
|
+
case 11:
|
48907
|
+
_context.prev = 11;
|
48908
|
+
_context.t2 = _context["catch"](2);
|
48905
48909
|
|
48906
|
-
case
|
48910
|
+
case 13:
|
48907
48911
|
case "end":
|
48908
48912
|
return _context.stop();
|
48909
48913
|
}
|
48910
48914
|
}
|
48911
|
-
}, _callee, null, [[
|
48915
|
+
}, _callee, null, [[2, 11]]);
|
48912
48916
|
}));
|
48913
48917
|
|
48914
48918
|
return function (_x, _x2, _x3, _x4) {
|
@@ -48919,12 +48923,13 @@ var Web3ContextInitializer = function Web3ContextInitializer(_ref) {
|
|
48919
48923
|
intervalId && clearInterval(intervalId);
|
48920
48924
|
tryUpdateBlock(wallet === null || wallet === void 0 ? void 0 : wallet.ethereum, block, setBlock, true);
|
48921
48925
|
tryUpdateBlock(dualProvider, dualBlock, setDualBlock, true);
|
48922
|
-
|
48923
|
-
|
48924
|
-
|
48925
|
-
|
48926
|
-
|
48927
|
-
|
48926
|
+
|
48927
|
+
if (wallet && wallet.ethereum || dualProvider) {
|
48928
|
+
setIntervalId(setInterval(function () {
|
48929
|
+
tryUpdateBlock(wallet.ethereum, block, setBlock);
|
48930
|
+
tryUpdateBlock(dualProvider, dualBlock, setDualBlock);
|
48931
|
+
}, realBlockIntervalTimeout));
|
48932
|
+
}
|
48928
48933
|
}, [wallet, dualProvider, realBlockIntervalTimeout, intervalId]);
|
48929
48934
|
React.useEffect(resetBlockInterval, [realBlockInterval, realBlockIntervalTimeout, wallet && wallet.ethereum, dualProvider]);
|
48930
48935
|
React.useEffect(function () {
|