@ape.swap/bonds-sdk 1.0.394 → 1.0.396
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.
|
@@ -133,7 +133,7 @@ var YourBonds = function (_a) {
|
|
|
133
133
|
}, []);
|
|
134
134
|
useEffect(function () {
|
|
135
135
|
var fetchData = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
136
|
-
var results, error_2;
|
|
136
|
+
var results, mappedBills, error_2;
|
|
137
137
|
return __generator(this, function (_a) {
|
|
138
138
|
switch (_a.label) {
|
|
139
139
|
case 0:
|
|
@@ -145,6 +145,11 @@ var YourBonds = function (_a) {
|
|
|
145
145
|
case 2:
|
|
146
146
|
results = _a.sent();
|
|
147
147
|
setUserOwnedBillsData(results);
|
|
148
|
+
mappedBills = userOwnedBillsData.flat().flatMap(function (data) { return data.userOwnedBills; });
|
|
149
|
+
setMappedUserBills(mappedBills);
|
|
150
|
+
console.log('MAPPEDBILLS');
|
|
151
|
+
console.log(mappedBills);
|
|
152
|
+
console.log('MAPPEDBILLS');
|
|
148
153
|
return [3 /*break*/, 4];
|
|
149
154
|
case 3:
|
|
150
155
|
error_2 = _a.sent();
|
|
@@ -155,10 +160,6 @@ var YourBonds = function (_a) {
|
|
|
155
160
|
});
|
|
156
161
|
}); };
|
|
157
162
|
fetchData();
|
|
158
|
-
var mappedBills = userOwnedBillsData.flat().flatMap(function (data) {
|
|
159
|
-
return data.userOwnedBills.map(function (bill) { return bill; });
|
|
160
|
-
});
|
|
161
|
-
setMappedUserBills(mappedBills);
|
|
162
163
|
}, [account]);
|
|
163
164
|
var _j = useState(null), sortConfig = _j[0], setSortConfig = _j[1];
|
|
164
165
|
var _k = useState(mappedUserBills), sortedBonds = _k[0], setSortedBonds = _k[1];
|
|
@@ -178,10 +179,13 @@ var YourBonds = function (_a) {
|
|
|
178
179
|
}
|
|
179
180
|
return 0;
|
|
180
181
|
});
|
|
182
|
+
console.log('SORTEDBILLS');
|
|
183
|
+
console.log(sortedBills);
|
|
184
|
+
console.log('SORTEDBILLS');
|
|
181
185
|
setSortedBonds(sortedBills);
|
|
182
186
|
return;
|
|
183
187
|
}
|
|
184
|
-
var sorted = __spreadArray([],
|
|
188
|
+
var sorted = __spreadArray([], mappedUserBills, true).sort(function (a, b) {
|
|
185
189
|
var aValue, bValue;
|
|
186
190
|
if (sortConfig.key === 'claimable') {
|
|
187
191
|
aValue = parseFloat(claimable(a).toFixed(3));
|
|
@@ -208,7 +212,7 @@ var YourBonds = function (_a) {
|
|
|
208
212
|
return 0;
|
|
209
213
|
});
|
|
210
214
|
setSortedBonds(sorted);
|
|
211
|
-
}, [sortConfig,
|
|
215
|
+
}, [sortConfig, mappedUserBills]);
|
|
212
216
|
var rowClick = function (bill) {
|
|
213
217
|
setSelectedBill(bill);
|
|
214
218
|
setIsModalOpen(true);
|
|
@@ -149,9 +149,6 @@ export var fetchUserOwnedBillsDataAsync = function (chainId, account, bondData)
|
|
|
149
149
|
});
|
|
150
150
|
return __assign(__assign({}, data), { userOwnedBills: enrichedUserBills });
|
|
151
151
|
});
|
|
152
|
-
console.log("combinedData");
|
|
153
|
-
console.log(combinedData);
|
|
154
|
-
console.log("combinedData");
|
|
155
152
|
return [2 /*return*/, Promise.resolve(combinedData)];
|
|
156
153
|
case 3:
|
|
157
154
|
error_1 = _a.sent();
|