@ape.swap/bonds-sdk 1.0.175 → 1.0.177
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.
|
@@ -58,10 +58,12 @@ import { defaultTheme } from '../../theme';
|
|
|
58
58
|
import Svg from '../uikit/Svg';
|
|
59
59
|
import '../../scss/Bonds.scss';
|
|
60
60
|
import { BigNumber } from 'bignumber.js';
|
|
61
|
-
import { ChainId } from '../../
|
|
61
|
+
import { ChainId } from '../../enum/chains';
|
|
62
62
|
import ProgressBarWrapper from '../ProgressBar/ProgressBarWrapper';
|
|
63
63
|
import ProgressBar from '../ProgressBar/ProgressBar';
|
|
64
64
|
import { formatDollar, formatValue } from '../../utils/formatNumbers';
|
|
65
|
+
import Tooltip from '../Tooltip';
|
|
66
|
+
import { TooltipText } from '../../enum/tooltips';
|
|
65
67
|
var Bonds = function (_a) {
|
|
66
68
|
var connectionString = _a.connectionString;
|
|
67
69
|
var _b = useWeb3React(), account = _b.account, isActive = _b.isActive;
|
|
@@ -179,7 +181,7 @@ var Bonds = function (_a) {
|
|
|
179
181
|
var tokens = new BigNumber((_a = bond.tokensRemaining) !== null && _a !== void 0 ? _a : '0');
|
|
180
182
|
return tokens.times((_b = bond.payoutTokenPrice) !== null && _b !== void 0 ? _b : 0);
|
|
181
183
|
};
|
|
182
|
-
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-token" }, { children: "Tokens" })), _jsx(Flex, __assign({ className: "column column-discount" }, { children: "Discount" })), _jsx(Flex, __assign({ className: "column column-arr" }, { children: "ARR" })), _jsx(Flex, __assign({ className: "column column-term" }, { children: "Terms" })), _jsx(Flex, __assign({ className: "column column-tokensremaining" }, { children: "Tokens Remaining" })), _jsx(Flex, { className: "column column-hotbond" })] })), sortedBonds.map(function (bond) {
|
|
184
|
+
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-token" }, { children: "Tokens" })), _jsx(Flex, __assign({ className: "column column-discount" }, { children: _jsxs(Tooltip, __assign({ body: TooltipText.Discount }, { children: ["Discount", _jsx(Flex, __assign({ className: "column header-icon" }, { children: _jsx(Svg, { icon: "questionFill", width: "15px" }) }))] })) })), _jsx(Flex, __assign({ className: "column column-arr" }, { children: _jsxs(Tooltip, __assign({ body: TooltipText.ARR }, { children: ["ARR", _jsx(Flex, __assign({ className: "column header-icon" }, { children: _jsx(Svg, { icon: "questionFill", width: "15px" }) }))] })) })), _jsx(Flex, __assign({ className: "column column-term" }, { children: _jsxs(Tooltip, __assign({ body: TooltipText.Terms }, { children: ["Terms", _jsx(Flex, __assign({ className: "column header-icon" }, { children: _jsx(Svg, { icon: "questionFill", width: "15px" }) }))] })) })), _jsx(Flex, __assign({ className: "column column-tokensremaining" }, { children: _jsxs(Tooltip, __assign({ body: TooltipText.TokensRemaining }, { children: ["Tokens Remaining", _jsx(Flex, __assign({ className: "column header-icon" }, { children: _jsx(Svg, { icon: "questionFill", width: "15px" }) }))] })) })), _jsx(Flex, { className: "column column-hotbond" })] })), sortedBonds.map(function (bond) {
|
|
183
185
|
var _a, _b, _c;
|
|
184
186
|
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") : '-' })), _jsx(Flex, __assign({ className: "column column-tokensremaining" }, { children: _jsx(ProgressBarWrapper, { title: '', value: _jsx(ProgressBar, { value: remainingPercentage(bond) }), style: {
|
|
185
187
|
width: '127px',
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare enum TooltipText {
|
|
2
|
+
Discount = "This is the percentage discount relative to the token's current market price.",
|
|
3
|
+
ARR = "This is the Annualized Rate of Return you would receive considering the current discount, adjusted for APR.",
|
|
4
|
+
Terms = "This is the amount of days it will take for all tokens in the Bond to fully vest.",
|
|
5
|
+
TokensRemaining = "This is the amount of remaining tokens for sale in this Bond."
|
|
6
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export var TooltipText;
|
|
2
|
+
(function (TooltipText) {
|
|
3
|
+
TooltipText["Discount"] = "This is the percentage discount relative to the token's current market price.";
|
|
4
|
+
TooltipText["ARR"] = "This is the Annualized Rate of Return you would receive considering the current discount, adjusted for APR.";
|
|
5
|
+
TooltipText["Terms"] = "This is the amount of days it will take for all tokens in the Bond to fully vest.";
|
|
6
|
+
TooltipText["TokensRemaining"] = "This is the amount of remaining tokens for sale in this Bond.";
|
|
7
|
+
})(TooltipText || (TooltipText = {}));
|
package/dist/scss/Bonds.scss
CHANGED
|
@@ -44,6 +44,13 @@
|
|
|
44
44
|
flex: 1;
|
|
45
45
|
min-width: 150px;
|
|
46
46
|
text-align: center;
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
|
|
49
|
+
.Tooltip {
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-direction: row;
|
|
52
|
+
min-width: 100px;
|
|
53
|
+
}
|
|
47
54
|
}
|
|
48
55
|
|
|
49
56
|
.column.column-token {
|
|
@@ -90,4 +97,10 @@
|
|
|
90
97
|
flex-direction: column;
|
|
91
98
|
justify-content: center;
|
|
92
99
|
align-items: center;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.column.header-icon {
|
|
103
|
+
padding-left: 5px;
|
|
104
|
+
align-items: start;
|
|
105
|
+
cursor: pointer;
|
|
93
106
|
}
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|