@ape.swap/bonds-sdk 1.0.706 → 1.0.708
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.
|
@@ -15,6 +15,6 @@ var BondRowsWithTitle = function (_a) {
|
|
|
15
15
|
overflow: 'hidden',
|
|
16
16
|
width: '100%',
|
|
17
17
|
marginTop: '0px',
|
|
18
|
-
}, children: billsFilteredByChain === null || billsFilteredByChain === void 0 ? void 0 : billsFilteredByChain.map(function (bill) { return (_jsx(BondRow, { bond: bill, hotBonds: hotBonds, rowClick: rowClick }, bill.billAddress)); }) }, key))] }) }, key));
|
|
18
|
+
}, children: billsFilteredByChain === null || billsFilteredByChain === void 0 ? void 0 : billsFilteredByChain.map(function (bill) { return (_jsx(Flex, { className: "bondrow-container", children: _jsx(BondRow, { bond: bill, hotBonds: hotBonds, rowClick: rowClick }, bill.billAddress) })); }) }, key))] }) }, key));
|
|
19
19
|
};
|
|
20
20
|
export default BondRowsWithTitle;
|
|
@@ -155,8 +155,8 @@ var BondModal = function (_a) {
|
|
|
155
155
|
useEffect(function () {
|
|
156
156
|
if (isActive && account && bondData.length > 0) {
|
|
157
157
|
getTokenBalance(chainId, bondData[0].lpToken.address[chainId], account).then(function (_a) {
|
|
158
|
-
var
|
|
159
|
-
setTokenBalance(
|
|
158
|
+
var roundedBalance = _a.roundedBalance, decimals = _a.decimals;
|
|
159
|
+
setTokenBalance(roundedBalance);
|
|
160
160
|
setTokenDecimals(decimals);
|
|
161
161
|
}).catch(function (error) {
|
|
162
162
|
console.error('Error fetching token balance', error);
|
|
@@ -164,7 +164,7 @@ var BondModal = function (_a) {
|
|
|
164
164
|
}
|
|
165
165
|
}, [isActive, account, bondData]);
|
|
166
166
|
var getTokenBalance = function (chainId, tokenAddress, walletAddress) { return __awaiter(void 0, void 0, void 0, function () {
|
|
167
|
-
var urls, provider, contract, decimals, balance, balanceInEther, error_3;
|
|
167
|
+
var urls, provider, contract, decimals, balance, balanceInEther, roundedBalance, error_3;
|
|
168
168
|
return __generator(this, function (_a) {
|
|
169
169
|
switch (_a.label) {
|
|
170
170
|
case 0:
|
|
@@ -182,14 +182,12 @@ var BondModal = function (_a) {
|
|
|
182
182
|
case 2:
|
|
183
183
|
balance = _a.sent();
|
|
184
184
|
balanceInEther = ethers.utils.formatUnits(balance, decimals);
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
console.log('roundedBalance', Number(balanceInEther).toFixed(4).toString());
|
|
188
|
-
return [2 /*return*/, { balanceInEther: balanceInEther, decimals: decimals }];
|
|
185
|
+
roundedBalance = Number(balanceInEther).toFixed(4).toString();
|
|
186
|
+
return [2 /*return*/, { roundedBalance: roundedBalance, decimals: decimals }];
|
|
189
187
|
case 3:
|
|
190
188
|
error_3 = _a.sent();
|
|
191
189
|
console.error('Error fetching token balance', error_3);
|
|
192
|
-
return [2 /*return*/, {
|
|
190
|
+
return [2 /*return*/, { roundedBalance: '0', decimals: 0 }];
|
|
193
191
|
case 4: return [2 /*return*/];
|
|
194
192
|
}
|
|
195
193
|
});
|
package/dist/scss/BondModal.scss
CHANGED