@ape.swap/bonds-sdk 1.0.156 → 1.0.158
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.
|
@@ -59,6 +59,8 @@ import Svg from '../uikit/Svg';
|
|
|
59
59
|
import '../../scss/Bonds.scss';
|
|
60
60
|
import { BigNumber } from 'bignumber.js';
|
|
61
61
|
import { ChainId } from '../../config/chains';
|
|
62
|
+
import ProgressBarWrapper from '../ProgressBar/ProgressBarWrapper';
|
|
63
|
+
import ProgressBar from '../ProgressBar/ProgressBar';
|
|
62
64
|
var Bonds = function (_a) {
|
|
63
65
|
var connectionString = _a.connectionString;
|
|
64
66
|
var _b = useWeb3React(), account = _b.account, isActive = _b.isActive;
|
|
@@ -116,10 +118,6 @@ var Bonds = function (_a) {
|
|
|
116
118
|
console.log(bonds);
|
|
117
119
|
});
|
|
118
120
|
}, []);
|
|
119
|
-
// const bondsToRender = bondData.filter(bond => !isSoldOut(bond));
|
|
120
|
-
// console.log("BONDS TO RENDER");
|
|
121
|
-
// console.log(bondsToRender);
|
|
122
|
-
// setBondData(bondsToRender);
|
|
123
121
|
useEffect(function () {
|
|
124
122
|
axios.get('https://apeswap-strapi.herokuapp.com/hot-bonds').then(function (response) {
|
|
125
123
|
var hotBondAddresses = response.data.map(function (bond) {
|
|
@@ -167,7 +165,13 @@ var Bonds = function (_a) {
|
|
|
167
165
|
};
|
|
168
166
|
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: [_jsxs(Flex, __assign({ className: "container header-container" }, { children: [_jsx(Flex, __assign({ className: "column column-header" }, { children: "Tokens" })), _jsx(Flex, __assign({ className: "column column-header" }, { children: "Discount" })), _jsx(Flex, __assign({ className: "column column-header" }, { children: "ARR" })), _jsx(Flex, __assign({ className: "column column-header" }, { children: "Terms" })), _jsx(Flex, __assign({ className: "column column-header" }, { children: "Tokens Remaining" })), _jsx(Flex, { className: "column column-header" })] })), sortedBonds.map(function (bond) {
|
|
169
167
|
var _a, _b, _c;
|
|
170
|
-
return (_jsxs(Flex, __assign({ className: "container bondrow-container", onClick: function () { return rowClick(bond); } }, { children: [_jsx(Flex, __assign({ className: "column column-token" }, { children: bond.showcaseTokenName })), _jsx(Flex, __assign({ className: "column column-discount ".concat(getDiscountColor(bond === null || bond === void 0 ? void 0 : bond.discount)) }, { children: "".concat((_a = bond === null || bond === void 0 ? void 0 : bond.discount) === null || _a === void 0 ? void 0 : _a.toFixed(2), "%") })), _jsx(Flex, __assign({ className: "column column-arr" }, { children: "".concat(((((_b = bond === null || bond === void 0 ? void 0 : bond.discount) !== null && _b !== void 0 ? _b : 0) * 365) / vestingTime(bond.vestingTerm).days).toFixed(2), "%") })), _jsx(Flex, __assign({ className: "column column-term" }, { children: vestingTime(bond.vestingTerm).days ? "".concat(vestingTime(bond.vestingTerm).days, " D") : '-' })),
|
|
168
|
+
return (_jsxs(Flex, __assign({ className: "container bondrow-container", onClick: function () { return rowClick(bond); } }, { children: [_jsx(Flex, __assign({ className: "column column-token" }, { children: bond.showcaseTokenName })), _jsx(Flex, __assign({ className: "column column-discount ".concat(getDiscountColor(bond === null || bond === void 0 ? void 0 : bond.discount)) }, { children: "".concat((_a = bond === null || bond === void 0 ? void 0 : bond.discount) === null || _a === void 0 ? void 0 : _a.toFixed(2), "%") })), _jsx(Flex, __assign({ className: "column column-arr" }, { children: "".concat(((((_b = bond === null || bond === void 0 ? void 0 : bond.discount) !== null && _b !== void 0 ? _b : 0) * 365) / vestingTime(bond.vestingTerm).days).toFixed(2), "%") })), _jsx(Flex, __assign({ className: "column column-term" }, { children: vestingTime(bond.vestingTerm).days ? "".concat(vestingTime(bond.vestingTerm).days, " D") : '-' })), _jsxs(Flex, __assign({ className: "column column-tokensremaining" }, { children: [_jsx(ProgressBarWrapper, { title: '', value: _jsx(ProgressBar, { value: new BigNumber(bond.tokensRemaining).div(bond.maxTotalPayout).times(100).toNumber() }), style: {
|
|
169
|
+
width: '127px',
|
|
170
|
+
height: '25px',
|
|
171
|
+
flexDirection: 'column',
|
|
172
|
+
justifyContent: 'center',
|
|
173
|
+
display: ['none', 'none', 'none', 'flex'],
|
|
174
|
+
}, showTooltip: true }), bond.tokensRemaining.split('.')[0]] })), _jsx(Flex, __assign({ className: "column column-hotbond" }, { children: _jsx(Flex, __assign({ className: "column column-icon" }, { children: hotBonds.includes(bond.billAddress.toLowerCase()) && ((_c = bond.discount) !== null && _c !== void 0 ? _c : 0) > 0 && (_jsx(Svg, { icon: "fire", width: "20px" })) })) }))] }), bond.billAddress));
|
|
171
175
|
})] }))] })));
|
|
172
176
|
};
|
|
173
177
|
export default Bonds;
|
|
@@ -14,10 +14,9 @@ import React from 'react';
|
|
|
14
14
|
import { useTranslation } from '../../contexts/Localization';
|
|
15
15
|
import { styles } from './styles';
|
|
16
16
|
import { Flex, Skeleton, Text } from '../uikit';
|
|
17
|
-
import TooltipBubble from '../uikit/Tooltip';
|
|
18
17
|
var ProgressBarWrapper = function (_a) {
|
|
19
18
|
var title = _a.title, value = _a.value, style = _a.style, showTooltip = _a.showTooltip, toolTipPlacement = _a.toolTipPlacement, toolTipTransform = _a.toolTipTransform, toolTip = _a.toolTip;
|
|
20
19
|
var t = useTranslation().t;
|
|
21
|
-
return (_jsxs(Flex, __assign({ sx: style }, { children: [_jsx(Flex, __assign({ sx: { alignItems: 'center' } }, { children: _jsx(Text, __assign({ sx: styles.titleText }, { children: t("".concat(title)) })) })), showTooltip ? (_jsx(Flex,
|
|
20
|
+
return (_jsxs(Flex, __assign({ sx: style }, { children: [_jsx(Flex, __assign({ sx: { alignItems: 'center' } }, { children: _jsx(Text, __assign({ sx: styles.titleText }, { children: t("".concat(title)) })) })), showTooltip ? (_jsx(Flex, { sx: { alignItems: 'center', width: '100%' } })) : (_jsx(Flex, __assign({ sx: { justifyContent: 'center', alignItems: 'center' } }, { children: value ? value : _jsx(Skeleton, { sx: styles.skeleton }) })))] })));
|
|
22
21
|
};
|
|
23
22
|
export default React.memo(ProgressBarWrapper);
|