@ape.swap/bonds-sdk 1.0.508 → 1.0.509

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.
@@ -56,7 +56,6 @@ import { NETWORK_ICONS } from '../../../config/constants/chains';
56
56
  import { formatUSDNumber, getPremiumColor, premium, youGet, youGetUSD, youSpend, youSpendUSD } from './helper';
57
57
  import '../../../scss/BondModal.scss';
58
58
  import { useWriteContract } from "wagmi";
59
- import { getProvider } from '../../../config/constants/providers';
60
59
  var BondModal = function (_a) {
61
60
  var account = _a.account, accountChainId = _a.accountChainId, isActive = _a.isActive, isOpen = _a.isOpen, onClose = _a.onClose, bondAddress = _a.bondAddress;
62
61
  if (!isOpen)
@@ -188,29 +187,26 @@ var BondModal = function (_a) {
188
187
  }
189
188
  }, [isActive, account, bondData]);
190
189
  var getTokenBalance = function (chainId, tokenAddress, walletAddress) { return __awaiter(void 0, void 0, void 0, function () {
191
- var provider, contract, balance, balanceInEther, error_3;
192
190
  return __generator(this, function (_a) {
193
- switch (_a.label) {
194
- case 0:
195
- _a.trys.push([0, 2, , 3]);
196
- provider = getProvider(56, true);
197
- // const provider = RPC_PROVIDERS[chainId];
198
- if (!provider) {
199
- throw new Error("No provider found for chainId: ".concat(chainId));
200
- }
201
- contract = new ethers.Contract(tokenAddress, ERC_20_ABI, provider);
202
- return [4 /*yield*/, contract.balanceOf(walletAddress)];
203
- case 1:
204
- balance = _a.sent();
205
- balanceInEther = ethers.utils.formatUnits(balance, 18);
206
- console.log("Token Balance: ".concat(balanceInEther));
207
- return [2 /*return*/, balanceInEther];
208
- case 2:
209
- error_3 = _a.sent();
210
- console.error('Error fetching token balance', error_3);
211
- return [2 /*return*/, 'Error fetching token balance'];
212
- case 3: return [2 /*return*/];
191
+ try {
192
+ return [2 /*return*/, "4"];
193
+ // const provider = getProvider(56, true)
194
+ //
195
+ // // const provider = RPC_PROVIDERS[chainId];
196
+ // if (!provider) {
197
+ // throw new Error(`No provider found for chainId: ${chainId}`);
198
+ // }
199
+ // const contract = new ethers.Contract(tokenAddress, ERC_20_ABI, provider);
200
+ // const balance = await contract.balanceOf(walletAddress);
201
+ // const balanceInEther = ethers.utils.formatUnits(balance, 18); // Assuming the token has 18 decimals
202
+ // console.log(`Token Balance: ${balanceInEther}`);
203
+ // return balanceInEther;
204
+ }
205
+ catch (error) {
206
+ console.error('Error fetching token balance', error);
207
+ return [2 /*return*/, 'Error fetching token balance'];
213
208
  }
209
+ return [2 /*return*/];
214
210
  });
215
211
  }); };
216
212
  return (_jsx(ThemeUIProvider, { theme: defaultTheme, children: bondData.map(function (bond) {
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.508",
6
+ "version": "1.0.509",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.es.js",
9
9
  "types": "dist/index.d.ts",