@ututrust/web-components 1.2.7 → 1.2.8
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.js +14 -17
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -18811,10 +18811,6 @@
|
|
|
18811
18811
|
NETWORK_NAME["polygon_mumbai"] = "polygon_mumbai";
|
|
18812
18812
|
})(NETWORK_NAME || (NETWORK_NAME = {}));
|
|
18813
18813
|
|
|
18814
|
-
// UTT Endorsement Contracts
|
|
18815
|
-
|
|
18816
|
-
var UTT_CONTRACT_ADDRESS_TEST = "0x19bc90FfBDCaD53c48eF0b08A67B0D2563AEE2a8";
|
|
18817
|
-
|
|
18818
18814
|
function e$1(e) {
|
|
18819
18815
|
this.message = e;
|
|
18820
18816
|
}
|
|
@@ -41407,7 +41403,7 @@
|
|
|
41407
41403
|
setUTTWalletState = _useState2[1];
|
|
41408
41404
|
var fetchBalance = /*#__PURE__*/function () {
|
|
41409
41405
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
41410
|
-
var provider, network, ethersProvider, userAddress, getContract, walletUTTBalance, UTTBalance;
|
|
41406
|
+
var provider, network, contractAddress, ethersProvider, userAddress, getContract, walletUTTBalance, UTTBalance;
|
|
41411
41407
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
41412
41408
|
while (1) switch (_context.prev = _context.next) {
|
|
41413
41409
|
case 0:
|
|
@@ -41417,33 +41413,34 @@
|
|
|
41417
41413
|
case 3:
|
|
41418
41414
|
provider = _context.sent;
|
|
41419
41415
|
network = getDefaultNetworkName();
|
|
41420
|
-
|
|
41416
|
+
contractAddress = getUTTContractAddress(network);
|
|
41417
|
+
_context.next = 8;
|
|
41421
41418
|
return requestNetworkChange(provider, network);
|
|
41422
|
-
case
|
|
41419
|
+
case 8:
|
|
41423
41420
|
ethersProvider = new Web3Provider(provider);
|
|
41424
|
-
_context.next =
|
|
41421
|
+
_context.next = 11;
|
|
41425
41422
|
return ethersProvider.getSigner().getAddress();
|
|
41426
|
-
case
|
|
41423
|
+
case 11:
|
|
41427
41424
|
userAddress = _context.sent;
|
|
41428
|
-
getContract = new Contract(
|
|
41429
|
-
_context.next =
|
|
41425
|
+
getContract = new Contract(contractAddress, abi, ethersProvider);
|
|
41426
|
+
_context.next = 15;
|
|
41430
41427
|
return getContract.balanceOf(userAddress);
|
|
41431
|
-
case
|
|
41428
|
+
case 15:
|
|
41432
41429
|
walletUTTBalance = _context.sent;
|
|
41433
41430
|
UTTBalance = Number(formatUnits(walletUTTBalance, 0) || 0);
|
|
41434
41431
|
setUTTWalletState(UTTBalance);
|
|
41435
|
-
_context.next =
|
|
41432
|
+
_context.next = 24;
|
|
41436
41433
|
break;
|
|
41437
|
-
case
|
|
41438
|
-
_context.prev =
|
|
41434
|
+
case 20:
|
|
41435
|
+
_context.prev = 20;
|
|
41439
41436
|
_context.t0 = _context["catch"](0);
|
|
41440
41437
|
console.error(_context.t0);
|
|
41441
41438
|
setUTTWalletState(0);
|
|
41442
|
-
case
|
|
41439
|
+
case 24:
|
|
41443
41440
|
case "end":
|
|
41444
41441
|
return _context.stop();
|
|
41445
41442
|
}
|
|
41446
|
-
}, _callee, null, [[0,
|
|
41443
|
+
}, _callee, null, [[0, 20]]);
|
|
41447
41444
|
}));
|
|
41448
41445
|
return function fetchBalance() {
|
|
41449
41446
|
return _ref.apply(this, arguments);
|