@ape.swap/bonds-sdk 3.0.37 → 3.0.38

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 +13 -9
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -71109,22 +71109,26 @@ const getUserBonds = (account, bondList, chains, tokenPrices) => __awaiter$9(voi
71109
71109
  try {
71110
71110
  const bondsByChain = bondList.reduce((acc, bond) => {
71111
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
71112
+ // Exclude ACF to ABOND bonds, fixed price bonds, and migration bonds
71114
71113
  if (((_a = bond.contractAddress[bond.chainId]) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ACF_TO_ABOND.toLowerCase() ||
71115
71114
  bond.billVersion === types.BillVersion.FixedPrice ||
71116
71115
  bond.billType === 'migration') {
71117
- return acc;
71118
- }
71119
- if (!acc[bond.chainId] && chains.includes(bond.chainId)) {
71120
- acc[bond.chainId] = [bond];
71116
+ return acc; // Skip this bond
71121
71117
  }
71122
- else {
71118
+ // Only process bonds that belong to the specified chains
71119
+ if (chains.includes(bond.chainId)) {
71120
+ // Initialize acc[bond.chainId] if it doesn't exist yet
71121
+ if (!acc[bond.chainId]) {
71122
+ acc[bond.chainId] = [];
71123
+ }
71124
+ // Safely push the bond to the array
71123
71125
  acc[bond.chainId].push(bond);
71124
71126
  }
71125
71127
  return acc;
71126
71128
  }, {});
71127
- const results = yield Promise.allSettled(chains.map((chain) => fetchUserOwnedBillsDataAsync(chain, account, bondsByChain[chain], tokenPrices)));
71129
+ const results = yield Promise.allSettled(chains
71130
+ .filter((chain) => bondsByChain[chain])
71131
+ .map((chain) => fetchUserOwnedBillsDataAsync(chain, account, bondsByChain[chain], tokenPrices)));
71128
71132
  // Filter out only fulfilled promises
71129
71133
  const fulfilledResults = results
71130
71134
  .filter((result) => result.status === 'fulfilled')
@@ -75776,7 +75780,7 @@ const useApproval = (amount, currency, spender, account, chainId) => {
75776
75780
  return [approvalState !== null && approvalState !== void 0 ? approvalState : ApprovalState.NOT_APPROVED, handleApprove];
75777
75781
  };
75778
75782
 
75779
- const version$1 = '2.23.6';
75783
+ const version$1 = '2.24.3';
75780
75784
 
75781
75785
  let errorConfig = {
75782
75786
  getDocsUrl: ({ docsBaseUrl, docsPath = '', docsSlug, }) => docsPath
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.37",
6
+ "version": "3.0.38",
7
7
  "module": "dist/main.js",
8
8
  "type": "module",
9
9
  "types": "dist/main.d.ts",