@ape.swap/bonds-sdk 1.0.352 → 1.0.353

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.
@@ -193,25 +193,16 @@ var YourBonds = function (_a) {
193
193
  });
194
194
  });
195
195
  return [4 /*yield*/, fetchUserOwnedBillNftData(ownedBillsData, chainId, bonds)
196
- // const ownedBillsWithNftData = mapUserOwnedBills.map((bs: any, index: number) => {
197
- // return {
198
- // index: bonds[index].index,
199
- // userOwnedBillsNfts: bs.map((b: any) => {
200
- // const nftData = userBillNftData.find((nftB) => parseInt(nftB.id) === b.id);
201
- // return {
202
- // ...b,
203
- // ...nftData
204
- // } as UserBillNftData;
205
- // }),
206
- // };
207
- // });
208
- // Combine userBillNftData with userOwnedBillsData
196
+ // Merge userBillNftData into userOwnedBillsData
209
197
  ];
210
198
  case 2:
211
199
  userBillNftData_1 = _a.sent();
212
- combinedData = ownedBillsData.map(function (ownedBill) {
213
- var nftData = userBillNftData_1.find(function (nft) { return nft.id === parseInt(ownedBill.id); });
214
- return __assign(__assign({}, ownedBill), { image: nftData === null || nftData === void 0 ? void 0 : nftData.data.image, attributes: nftData === null || nftData === void 0 ? void 0 : nftData.data.attributes });
200
+ combinedData = userOwnedBillsData_1.map(function (data) {
201
+ var enrichedUserBills = data.userOwnedBills.map(function (bill) {
202
+ var nftData = userBillNftData_1.find(function (nft) { return nft.id === parseInt(bill.id); });
203
+ return __assign(__assign({}, bill), (nftData ? { image: nftData.data.image, attributes: nftData.data.attributes } : {}));
204
+ });
205
+ return __assign(__assign({}, data), { userOwnedBills: enrichedUserBills });
215
206
  });
216
207
  console.log("userBillNftData");
217
208
  console.log(userBillNftData_1);
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.352",
6
+ "version": "1.0.353",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.es.js",
9
9
  "types": "dist/index.d.ts",