@ape.swap/bonds-sdk 1.0.706 → 1.0.707

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.
@@ -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 balanceInEther = _a.balanceInEther, decimals = _a.decimals;
159
- setTokenBalance(balanceInEther);
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
- console.log('balanceInEther', balanceInEther);
186
- console.log('decimals', decimals);
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*/, { balanceInEther: '0', decimals: 0 }];
190
+ return [2 /*return*/, { roundedBalance: '0', decimals: 0 }];
193
191
  case 4: return [2 /*return*/];
194
192
  }
195
193
  });
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Ape Bond SDK",
4
4
  "author": "Ape Bond",
5
5
  "license": "MIT",
6
- "version": "1.0.706",
6
+ "version": "1.0.707",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.es.js",
9
9
  "types": "dist/index.d.ts",