@ape.swap/bonds-sdk 1.0.411 → 1.0.412
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.
|
@@ -237,29 +237,30 @@ var YourBonds = function (_a) {
|
|
|
237
237
|
setIsModalOpen(true);
|
|
238
238
|
navigate("/YourBonds/?bondAddress=".concat(bill.address, "&bondChain=").concat(bill.bond.chainId), { replace: true });
|
|
239
239
|
};
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
240
|
+
var _k = useState(false), bondsRendered = _k[0], setBondsRendered = _k[1];
|
|
241
|
+
useEffect(function () {
|
|
242
|
+
if (sortedBonds.length > 0) {
|
|
243
|
+
setBondsRendered(true);
|
|
244
|
+
}
|
|
245
|
+
}, [sortedBonds]);
|
|
246
|
+
return (_jsxs(ThemeUIProvider, __assign({ theme: defaultTheme }, { children: [isActive && account && _jsx("p", { children: account }), isActive && account && _jsx("button", __assign({ onClick: handleApprove }, { children: "Approve USDT" })), _jsxs(Flex, __assign({ className: "container table-container" }, { children: [bondsRendered && (_jsxs(Flex, __assign({ className: "container header-container" }, { children: [_jsx(Flex, __assign({ className: "column column-tokens" }, { children: _jsx(Flex, { className: "column column-tokeninfoname" }) })), _jsxs(Flex, __assign({ className: "column column-bondinfo" }, { children: [_jsxs(Flex, __assign({ className: "column header-claimable" }, { children: [_jsx(Text, __assign({ sx: { opacity: '0.6', fontSize: '12px' } }, { children: "Claimable" })), _jsx(Flex, __assign({ className: "column header-icon", sx: { opacity: '0.6' }, onClick: function () { return handleSort('claimable'); } }, { children: _jsx(Svg, { icon: "sort", width: "12px" }) }))] })), _jsxs(Flex, __assign({ className: "column header-pending" }, { children: [_jsx(Text, __assign({ sx: { opacity: '0.6', fontSize: '12px' } }, { children: "Pending" })), _jsx(Flex, __assign({ className: "column header-icon", sx: { opacity: '0.6' }, onClick: function () { return handleSort('pending'); } }, { children: _jsx(Svg, { icon: "sort", width: "12px" }) }))] })), _jsxs(Flex, __assign({ className: "column header-terms" }, { children: [_jsx(Text, __assign({ sx: { opacity: '0.6', fontSize: '12px' } }, { children: "Terms" })), _jsx(Flex, __assign({ className: "column header-icon", sx: { opacity: '0.6' }, onClick: function () { return handleSort('terms'); } }, { children: _jsx(Svg, { icon: "sort", width: "12px" }) }))] })), _jsx(Flex, __assign({ className: "column header-claimall" }, { children: _jsx(Button, __assign({ disabled: !account, sx: {
|
|
247
|
+
height: ['36px', '36px', '36px', '26px'],
|
|
248
|
+
lineHeight: '12px',
|
|
249
|
+
fontSize: '14px',
|
|
250
|
+
fontWeight: 600,
|
|
251
|
+
width: '100%',
|
|
252
|
+
} }, { children: "CLAIM ALL" })) }))] }))] }))), sortedBonds.map(function (bill) {
|
|
253
|
+
var _a, _b;
|
|
254
|
+
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, onClick: function (event) {
|
|
255
|
+
event.stopPropagation();
|
|
256
|
+
// Add your claim logic here
|
|
257
|
+
}, sx: {
|
|
245
258
|
height: ['36px', '36px', '36px', '26px'],
|
|
246
259
|
lineHeight: '12px',
|
|
247
260
|
fontSize: '14px',
|
|
248
261
|
fontWeight: 600,
|
|
249
262
|
width: '100%',
|
|
250
|
-
} }, { children: "
|
|
251
|
-
|
|
252
|
-
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, onClick: function (event) {
|
|
253
|
-
event.stopPropagation();
|
|
254
|
-
// Add your claim logic here
|
|
255
|
-
}, sx: {
|
|
256
|
-
height: ['36px', '36px', '36px', '26px'],
|
|
257
|
-
lineHeight: '12px',
|
|
258
|
-
fontSize: '14px',
|
|
259
|
-
fontWeight: 600,
|
|
260
|
-
width: '100%',
|
|
261
|
-
} }, { children: "Claim" })) }))] }))] }), bill.bond.billAddress));
|
|
262
|
-
})] }))] })));
|
|
263
|
-
}
|
|
263
|
+
} }, { children: "Claim" })) }))] }))] }), bill.bond.billAddress));
|
|
264
|
+
})] }))] })));
|
|
264
265
|
};
|
|
265
266
|
export default YourBonds;
|