@ape.swap/bonds-sdk 1.0.469 → 1.0.470
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.
|
@@ -135,6 +135,8 @@ var YourBonds = function (_a) {
|
|
|
135
135
|
return __generator(this, function (_a) {
|
|
136
136
|
switch (_a.label) {
|
|
137
137
|
case 0:
|
|
138
|
+
console.log("ACCOUNT");
|
|
139
|
+
console.log(account);
|
|
138
140
|
if (!account) return [3 /*break*/, 4];
|
|
139
141
|
_a.label = 1;
|
|
140
142
|
case 1:
|
|
@@ -144,6 +146,7 @@ var YourBonds = function (_a) {
|
|
|
144
146
|
results = _a.sent();
|
|
145
147
|
mappedBills = results.flat().flatMap(function (results) { return results.userOwnedBills; });
|
|
146
148
|
setMappedUserBills(mappedBills);
|
|
149
|
+
console.log('User owned bills data:', mappedBills);
|
|
147
150
|
return [3 /*break*/, 4];
|
|
148
151
|
case 3:
|
|
149
152
|
error_2 = _a.sent();
|
|
@@ -267,24 +270,24 @@ var YourBonds = function (_a) {
|
|
|
267
270
|
setBondsRendered(true);
|
|
268
271
|
}
|
|
269
272
|
}, [filteredBonds]);
|
|
270
|
-
return (
|
|
273
|
+
return (_jsx(ThemeUIProvider, __assign({ theme: defaultTheme }, { children: bondsRendered && (_jsxs(Flex, __assign({ className: "container table-container" }, { children: [_jsxs(Flex, __assign({ className: "container header-container" }, { children: [_jsx(Flex, __assign({ className: "column column-tokens" }, { children: _jsx(Flex, __assign({ className: "column column-search", sx: { width: '100%', maxWidth: ['200px', '200px', '200px', '340px'] } }, { children: _jsx(Input, { value: inputValue, onChange: handleInputChange, variant: "search", sx: { fontWeight: 400, background: 'white2', height: '30px', fontSize: '14px', color: 'white' }, width: '100%', placeholder: 'Search...' }) })) })), _jsxs(Flex, __assign({ className: "column column-bondinfo" }, { children: [_jsxs(Flex, __assign({ className: "column header-claimable" }, { children: [_jsx(Text, __assign({ sx: { fontSize: '11px', color: 'textDisabledButton' } }, { children: "CLAIMABLE" })), _jsx(Flex, __assign({ className: "column header-icon", onClick: function () { return handleSort('claimable'); } }, { children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) }))] })), _jsxs(Flex, __assign({ className: "column header-pending" }, { children: [_jsx(Text, __assign({ sx: { fontSize: '11px', color: 'textDisabledButton' } }, { children: "PENDING" })), _jsx(Flex, __assign({ className: "column header-icon", onClick: function () { return handleSort('pending'); } }, { children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) }))] })), _jsxs(Flex, __assign({ className: "column header-terms" }, { children: [_jsx(Text, __assign({ sx: { fontSize: '11px', color: 'textDisabledButton' } }, { children: "TERMS" })), _jsx(Flex, __assign({ className: "column header-icon", onClick: function () { return handleSort('terms'); } }, { children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) }))] })), _jsx(Flex, __assign({ className: "column header-claimall" }, { children: _jsx(Button, __assign({ disabled: !account && !hasPendingRewards(filteredBonds), sx: {
|
|
274
|
+
height: ['36px', '36px', '36px', '26px'],
|
|
275
|
+
lineHeight: '12px',
|
|
276
|
+
fontSize: '14px',
|
|
277
|
+
fontWeight: 600,
|
|
278
|
+
width: '100%',
|
|
279
|
+
} }, { children: "CLAIM ALL" })) }))] }))] })), filteredBonds.map(function (bill) {
|
|
280
|
+
var _a, _b;
|
|
281
|
+
return (_jsxs(Flex, __assign({ className: "container bondrow-container", onClick: function () { return rowClick(bill); } }, { children: [_jsx(Flex, __assign({ className: "column column-tokens" }, { children: _jsx(Flex, __assign({ className: "column column-tokeninfoname" }, { children: _jsx(TokenInfoAndName, { bill: bill.bond, vestEnds: "Ends in ".concat(getPendingVesting(bill.lastBlockTimestamp, bill.vesting)) }) })) })), _jsxs(Flex, __assign({ className: "column column-bondinfo" }, { children: [_jsxs(Flex, __assign({ className: "column column-claimable" }, { children: [formatNumberSI(parseFloat(claimable(bill).toFixed(3)), 0), _jsx(Text, __assign({ sx: { opacity: '0.6', fontSize: '12px', paddingLeft: '5px' } }, { children: "($".concat((claimable(bill) * ((_a = parseFloat(earnTokenPrice(bill.bond))) !== null && _a !== void 0 ? _a : 0)).toFixed(2), ")") }))] })), _jsxs(Flex, __assign({ className: "column column-pending" }, { children: [formatNumberSI(parseFloat(totalPending(bill).toFixed(0)), 0), _jsx(Text, __assign({ sx: { opacity: '0.6', fontSize: '12px', paddingLeft: '5px' } }, { children: "($".concat((totalPending(bill) * ((_b = parseFloat(earnTokenPrice(bill.bond))) !== null && _b !== void 0 ? _b : 0)).toFixed(2), ")") }))] })), _jsx(Flex, __assign({ className: "column column-terms" }, { children: "".concat(vestingTimeRemaining(bill).days, "d, ").concat(vestingTimeRemaining(bill).hours, "h, ").concat(vestingTimeRemaining(bill).minutes, "m") })), _jsx(Flex, __assign({ className: "column column-claimall" }, { children: _jsx(Button, __assign({ disabled: !account && (claimableNumber(bill) === 0), onClick: function (event) {
|
|
282
|
+
event.stopPropagation();
|
|
283
|
+
// Add your claim logic here
|
|
284
|
+
}, sx: {
|
|
271
285
|
height: ['36px', '36px', '36px', '26px'],
|
|
272
286
|
lineHeight: '12px',
|
|
273
287
|
fontSize: '14px',
|
|
274
288
|
fontWeight: 600,
|
|
275
289
|
width: '100%',
|
|
276
|
-
} }, { children: "
|
|
277
|
-
|
|
278
|
-
return (_jsxs(Flex, __assign({ className: "container bondrow-container", onClick: function () { return rowClick(bill); } }, { children: [_jsx(Flex, __assign({ className: "column column-tokens" }, { children: _jsx(Flex, __assign({ className: "column column-tokeninfoname" }, { children: _jsx(TokenInfoAndName, { bill: bill.bond, vestEnds: "Ends in ".concat(getPendingVesting(bill.lastBlockTimestamp, bill.vesting)) }) })) })), _jsxs(Flex, __assign({ className: "column column-bondinfo" }, { children: [_jsxs(Flex, __assign({ className: "column column-claimable" }, { children: [formatNumberSI(parseFloat(claimable(bill).toFixed(3)), 0), _jsx(Text, __assign({ sx: { opacity: '0.6', fontSize: '12px', paddingLeft: '5px' } }, { children: "($".concat((claimable(bill) * ((_a = parseFloat(earnTokenPrice(bill.bond))) !== null && _a !== void 0 ? _a : 0)).toFixed(2), ")") }))] })), _jsxs(Flex, __assign({ className: "column column-pending" }, { children: [formatNumberSI(parseFloat(totalPending(bill).toFixed(0)), 0), _jsx(Text, __assign({ sx: { opacity: '0.6', fontSize: '12px', paddingLeft: '5px' } }, { children: "($".concat((totalPending(bill) * ((_b = parseFloat(earnTokenPrice(bill.bond))) !== null && _b !== void 0 ? _b : 0)).toFixed(2), ")") }))] })), _jsx(Flex, __assign({ className: "column column-terms" }, { children: "".concat(vestingTimeRemaining(bill).days, "d, ").concat(vestingTimeRemaining(bill).hours, "h, ").concat(vestingTimeRemaining(bill).minutes, "m") })), _jsx(Flex, __assign({ className: "column column-claimall" }, { children: _jsx(Button, __assign({ disabled: !account && (claimableNumber(bill) === 0), onClick: function (event) {
|
|
279
|
-
event.stopPropagation();
|
|
280
|
-
// Add your claim logic here
|
|
281
|
-
}, sx: {
|
|
282
|
-
height: ['36px', '36px', '36px', '26px'],
|
|
283
|
-
lineHeight: '12px',
|
|
284
|
-
fontSize: '14px',
|
|
285
|
-
fontWeight: 600,
|
|
286
|
-
width: '100%',
|
|
287
|
-
} }, { children: "Claim" })) }))] }))] }), bill.bond.billAddress));
|
|
288
|
-
})] })))] })));
|
|
290
|
+
} }, { children: "Claim" })) }))] }))] }), bill.bond.billAddress));
|
|
291
|
+
})] }))) })));
|
|
289
292
|
};
|
|
290
293
|
export default YourBonds;
|