@ape.swap/bonds-sdk 3.0.36 → 3.0.37

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.
Files changed (2) hide show
  1. package/dist/main.js +24 -9
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -70993,13 +70993,7 @@ const getBondsList = (apeswapListsURL) => __awaiter$9(void 0, void 0, void 0, fu
70993
70993
  /* MODIFIED FUNCTION FROM FRONTEND SPECIFICALLY FOR THE SDK */
70994
70994
  const fetchUserOwnedBillsDataAsync = (chainId, account, bondData, tokenPrices) => __awaiter$9(void 0, void 0, void 0, function* () {
70995
70995
  try {
70996
- const bonds = bondData.filter((bond) => {
70997
- var _a;
70998
- return bond.billVersion !== types.BillVersion.FixedPrice &&
70999
- (bond === null || bond === void 0 ? void 0 : bond.chainId) === chainId &&
71000
- bond.billType !== 'migration' &&
71001
- ((_a = bond.contractAddress[bond.chainId]) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== ACF_TO_ABOND.toLowerCase();
71002
- });
70996
+ const bonds = bondData;
71003
70997
  // Fetch and set user owned bill data without NFT Data
71004
70998
  const userOwnedBills = yield fetchUserOwnedBills(chainId, account, bonds, tokenPrices);
71005
70999
  const mapUserOwnedBills = bonds.map((bill) => userOwnedBills.filter((b) => { var _a; return b.address.toLowerCase() === ((_a = bill.contractAddress[bill.chainId]) === null || _a === void 0 ? void 0 : _a.toLowerCase()); }));
@@ -71113,7 +71107,24 @@ function useUserBonds() {
71113
71107
  }
71114
71108
  const getUserBonds = (account, bondList, chains, tokenPrices) => __awaiter$9(void 0, void 0, void 0, function* () {
71115
71109
  try {
71116
- const results = yield Promise.allSettled(chains.map((chain) => fetchUserOwnedBillsDataAsync(chain, account, bondList, tokenPrices)));
71110
+ const bondsByChain = bondList.reduce((acc, bond) => {
71111
+ var _a;
71112
+ // Exclude ACF to ABOND bonds, fixed price bonds and migration bonds
71113
+ // this is done here to avoid filtering again in the fetchUserOwnedBillsDataAsync
71114
+ if (((_a = bond.contractAddress[bond.chainId]) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ACF_TO_ABOND.toLowerCase() ||
71115
+ bond.billVersion === types.BillVersion.FixedPrice ||
71116
+ bond.billType === 'migration') {
71117
+ return acc;
71118
+ }
71119
+ if (!acc[bond.chainId] && chains.includes(bond.chainId)) {
71120
+ acc[bond.chainId] = [bond];
71121
+ }
71122
+ else {
71123
+ acc[bond.chainId].push(bond);
71124
+ }
71125
+ return acc;
71126
+ }, {});
71127
+ const results = yield Promise.allSettled(chains.map((chain) => fetchUserOwnedBillsDataAsync(chain, account, bondsByChain[chain], tokenPrices)));
71117
71128
  // Filter out only fulfilled promises
71118
71129
  const fulfilledResults = results
71119
71130
  .filter((result) => result.status === 'fulfilled')
@@ -77239,9 +77250,13 @@ const HotBondCards = () => {
77239
77250
  const BANNER_INFO = {
77240
77251
  [types.ChainId.MONAD_TESTNET]: {
77241
77252
  title: 'Test and Play on Monad Testnet',
77242
- subtitle: 'Explore Monad for free, earn points and qualify for potential airdrops.',
77253
+ subtitle: 'Explore Bonds on the Monad Testnet for free.',
77243
77254
  buttons: [
77244
77255
  { label: 'GET MON TOKENS', href: 'https://testnet.monad.xyz' },
77256
+ {
77257
+ label: 'LEARN MORE',
77258
+ href: 'https://apebond.medium.com/apebond-integrates-testnet-bonds-paving-the-way-for-exciting-new-chains-3f62e2204746?source=social.tw',
77259
+ },
77245
77260
  ],
77246
77261
  background: 'https://res.cloudinary.com/dswmrqgwy/image/upload/v1/banner_jpkg38.png',
77247
77262
  backgroundMobile: 'https://res.cloudinary.com/dswmrqgwy/image/upload/v1/banner-mobile_y6xveu.png',
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": "3.0.36",
6
+ "version": "3.0.37",
7
7
  "module": "dist/main.js",
8
8
  "type": "module",
9
9
  "types": "dist/main.d.ts",