@ape.swap/bonds-sdk 1.0.556 → 1.0.558
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.
|
@@ -91,6 +91,9 @@ var YourBonds = function (_a) {
|
|
|
91
91
|
case 2:
|
|
92
92
|
tx = _a.sent();
|
|
93
93
|
console.log('Transaction:', tx);
|
|
94
|
+
if (tx != null) {
|
|
95
|
+
setClaimTx(tx);
|
|
96
|
+
}
|
|
94
97
|
return [3 /*break*/, 4];
|
|
95
98
|
case 3:
|
|
96
99
|
error_1 = _a.sent();
|
|
@@ -100,9 +103,10 @@ var YourBonds = function (_a) {
|
|
|
100
103
|
}
|
|
101
104
|
});
|
|
102
105
|
}); };
|
|
106
|
+
var _b = useState(null), claimTx = _b[0], setClaimTx = _b[1];
|
|
103
107
|
// Fetch data
|
|
104
|
-
var
|
|
105
|
-
var
|
|
108
|
+
var _c = useState([]), bondData = _c[0], setBondData = _c[1];
|
|
109
|
+
var _d = useState([]), mappedUserBills = _d[0], setMappedUserBills = _d[1];
|
|
106
110
|
useEffect(function () {
|
|
107
111
|
axios.get('https://realtime-api.ape.bond/bonds').then(function (response) {
|
|
108
112
|
var bonds = response.data.bonds;
|
|
@@ -135,9 +139,9 @@ var YourBonds = function (_a) {
|
|
|
135
139
|
});
|
|
136
140
|
}); };
|
|
137
141
|
fetchData();
|
|
138
|
-
}, [account, bondData]);
|
|
139
|
-
var
|
|
140
|
-
var
|
|
142
|
+
}, [account, bondData, claimTx]);
|
|
143
|
+
var _e = useState(null), sortConfig = _e[0], setSortConfig = _e[1];
|
|
144
|
+
var _f = useState(mappedUserBills), sortedBonds = _f[0], setSortedBonds = _f[1];
|
|
141
145
|
var handleSort = function (key) {
|
|
142
146
|
var direction = 'asc';
|
|
143
147
|
if ((sortConfig === null || sortConfig === void 0 ? void 0 : sortConfig.key) === key && (sortConfig === null || sortConfig === void 0 ? void 0 : sortConfig.direction) === 'asc') {
|
|
@@ -218,8 +222,8 @@ var YourBonds = function (_a) {
|
|
|
218
222
|
return getFirstNonZeroDigits(parseFloat((_a = bond === null || bond === void 0 ? void 0 : bond.payoutTokenPrice) !== null && _a !== void 0 ? _a : '0'));
|
|
219
223
|
};
|
|
220
224
|
// Modal
|
|
221
|
-
var
|
|
222
|
-
var
|
|
225
|
+
var _g = useState(false), isModalOpen = _g[0], setIsModalOpen = _g[1];
|
|
226
|
+
var _h = useState(undefined), selectedBill = _h[0], setSelectedBill = _h[1];
|
|
223
227
|
var rowClick = function (bill) {
|
|
224
228
|
console.log(bill);
|
|
225
229
|
setSelectedBill(bill);
|
|
@@ -227,8 +231,8 @@ var YourBonds = function (_a) {
|
|
|
227
231
|
// navigate(`/yourBonds/?bondAddress=${bill.address}&bondChain=${bill.bond.chainId}`, { replace: true });
|
|
228
232
|
};
|
|
229
233
|
// Search logic
|
|
230
|
-
var
|
|
231
|
-
var
|
|
234
|
+
var _j = useState(''), inputValue = _j[0], setInputValue = _j[1];
|
|
235
|
+
var _k = useState(sortedBonds), filteredBonds = _k[0], setFilteredBonds = _k[1];
|
|
232
236
|
useEffect(function () {
|
|
233
237
|
if (inputValue === '') {
|
|
234
238
|
setFilteredBonds(sortedBonds);
|
|
@@ -243,7 +247,7 @@ var YourBonds = function (_a) {
|
|
|
243
247
|
setInputValue(event.target.value);
|
|
244
248
|
};
|
|
245
249
|
// Page render logic
|
|
246
|
-
var
|
|
250
|
+
var _l = useState(false), bondsRendered = _l[0], setBondsRendered = _l[1];
|
|
247
251
|
useEffect(function () {
|
|
248
252
|
if (filteredBonds.length > 0) {
|
|
249
253
|
setBondsRendered(true);
|