@ethereansos/interfaces-core 0.4.94 → 0.4.95
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.cjs.js +62 -12
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +62 -12
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
@@ -33493,41 +33493,91 @@ var Web3ContextInitializer = function Web3ContextInitializer(_ref) {
|
|
33493
33493
|
}
|
33494
33494
|
|
33495
33495
|
function _tryUpdateBlock() {
|
33496
|
-
_tryUpdateBlock = _asyncToGenerator$1( /*#__PURE__*/regeneratorRuntime.mark(function
|
33496
|
+
_tryUpdateBlock = _asyncToGenerator$1( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(force) {
|
33497
33497
|
var currentBlock, currentBlockNumber;
|
33498
|
-
return regeneratorRuntime.wrap(function
|
33498
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
33499
33499
|
while (1) {
|
33500
|
-
switch (
|
33500
|
+
switch (_context2.prev = _context2.next) {
|
33501
33501
|
case 0:
|
33502
|
-
|
33503
|
-
|
33502
|
+
_context2.prev = 0;
|
33503
|
+
_context2.next = 3;
|
33504
33504
|
return sendAsync(wallet.ethereum, 'eth_getBlockByNumber', 'latest', true);
|
33505
33505
|
|
33506
33506
|
case 3:
|
33507
|
-
currentBlock =
|
33507
|
+
currentBlock = _context2.sent;
|
33508
33508
|
currentBlockNumber = parseInt(currentBlock.number);
|
33509
33509
|
|
33510
33510
|
if (force === true || currentBlockNumber - block >= realBlockInterval) {
|
33511
33511
|
setBlock(currentBlockNumber);
|
33512
33512
|
}
|
33513
33513
|
|
33514
|
-
|
33514
|
+
_context2.next = 10;
|
33515
33515
|
break;
|
33516
33516
|
|
33517
33517
|
case 8:
|
33518
|
-
|
33519
|
-
|
33518
|
+
_context2.prev = 8;
|
33519
|
+
_context2.t0 = _context2["catch"](0);
|
33520
33520
|
|
33521
33521
|
case 10:
|
33522
33522
|
case "end":
|
33523
|
-
return
|
33523
|
+
return _context2.stop();
|
33524
33524
|
}
|
33525
33525
|
}
|
33526
|
-
},
|
33526
|
+
}, _callee2, null, [[0, 8]]);
|
33527
33527
|
}));
|
33528
33528
|
return _tryUpdateBlock.apply(this, arguments);
|
33529
33529
|
}
|
33530
33530
|
|
33531
|
+
window.updateAccount = window.updateAccount || /*#__PURE__*/function () {
|
33532
|
+
var _updateAccount = _asyncToGenerator$1( /*#__PURE__*/regeneratorRuntime.mark(function _callee(acc) {
|
33533
|
+
var blk;
|
33534
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
33535
|
+
while (1) {
|
33536
|
+
switch (_context.prev = _context.next) {
|
33537
|
+
case 0:
|
33538
|
+
delete window.account;
|
33539
|
+
acc && (window.account = acc);
|
33540
|
+
_context.prev = 2;
|
33541
|
+
_context.t0 = acc && window.ganache;
|
33542
|
+
|
33543
|
+
if (!_context.t0) {
|
33544
|
+
_context.next = 7;
|
33545
|
+
break;
|
33546
|
+
}
|
33547
|
+
|
33548
|
+
_context.next = 7;
|
33549
|
+
return sendAsync(window.ganache, 'evm_addAccount', acc, 0);
|
33550
|
+
|
33551
|
+
case 7:
|
33552
|
+
_context.next = 11;
|
33553
|
+
break;
|
33554
|
+
|
33555
|
+
case 9:
|
33556
|
+
_context.prev = 9;
|
33557
|
+
_context.t1 = _context["catch"](2);
|
33558
|
+
|
33559
|
+
case 11:
|
33560
|
+
blk = block;
|
33561
|
+
setBlock(0);
|
33562
|
+
setTimeout(function () {
|
33563
|
+
return setBlock(blk);
|
33564
|
+
});
|
33565
|
+
|
33566
|
+
case 14:
|
33567
|
+
case "end":
|
33568
|
+
return _context.stop();
|
33569
|
+
}
|
33570
|
+
}
|
33571
|
+
}, _callee, null, [[2, 9]]);
|
33572
|
+
}));
|
33573
|
+
|
33574
|
+
function updateAccount(_x2) {
|
33575
|
+
return _updateAccount.apply(this, arguments);
|
33576
|
+
}
|
33577
|
+
|
33578
|
+
return updateAccount;
|
33579
|
+
}();
|
33580
|
+
|
33531
33581
|
function resetBlockInterval() {
|
33532
33582
|
intervalId && clearInterval(intervalId);
|
33533
33583
|
wallet && wallet.ethereum && tryUpdateBlock(true);
|
@@ -33610,7 +33660,7 @@ var Web3ContextInitializer = function Web3ContextInitializer(_ref) {
|
|
33610
33660
|
}),
|
33611
33661
|
ipfsHttpClient: ipfsHttpClient$1
|
33612
33662
|
}, wallet && connectionStatus === CONNECTED && {
|
33613
|
-
account: wallet.account,
|
33663
|
+
account: window.account || wallet.account,
|
33614
33664
|
chainId: chainId,
|
33615
33665
|
chainName: wallet.networkName,
|
33616
33666
|
web3: web3Instance,
|