@ape.swap/bonds-sdk 4.5.4 → 4.5.5
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.
- package/dist/main.js +329 -242
- package/dist/utils/displayHelpers.d.ts +18 -5
- package/dist/utils/formatNumber.d.ts +1 -1
- package/dist/utils/getTimePeriods.d.ts +1 -1
- package/dist/views/Bonds/utils.d.ts +0 -3
- package/dist/views/BuyBond/components/BondCards/BondCards.d.ts +2 -1
- package/package.json +2 -2
package/dist/main.js
CHANGED
|
@@ -4463,7 +4463,7 @@ const Success$1 = ({ direction = 'down', color = 'success', width, getStyles })
|
|
|
4463
4463
|
degree: deg[direction],
|
|
4464
4464
|
color,
|
|
4465
4465
|
});
|
|
4466
|
-
return (jsxs("svg", { width: width || '10', viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", sx: style, children: [jsx$2("mask", { id: "path-1-inside-1_8581_37376", fill: "white", children: jsx$2("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.5 15C11.6421 15 15 11.6421 15 7.5C15 3.35786 11.6421 0 7.5 0C3.35786 0 0 3.35786 0 7.5C0 11.6421 3.35786 15 7.5 15ZM10.7168 4.6311C10.8812 4.47247 11.1484 4.46313 11.3232 4.6031C11.4773 4.73374 11.5082 4.94836 11.3848 5.10699L7.57177 10.1459L7.54094 10.1832C7.29427 10.5098 6.80094 10.5938 6.44122 10.3698C6.36927 10.3232 6.29733 10.2578 6.24594 10.1925L4.324 7.70108C4.19039 7.52379 4.2315 7.28117 4.42678 7.15987C4.58094 7.05722 4.79678 7.06656 4.94066 7.17853L6.79066 8.55956L10.7168 4.6311Z" }) }), jsx$2("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.5 15C11.6421 15 15 11.6421 15 7.5C15 3.35786 11.6421 0 7.5 0C3.35786 0 0 3.35786 0 7.5C0 11.6421 3.35786 15 7.5 15ZM10.7168 4.6311C10.8812 4.47247 11.1484 4.46313 11.3232 4.6031C11.4773 4.73374 11.5082 4.94836 11.3848 5.10699L7.57177 10.1459L7.54094 10.1832C7.29427 10.5098 6.80094 10.5938 6.44122 10.3698C6.36927 10.3232 6.29733 10.2578 6.24594 10.1925L4.324 7.70108C4.19039 7.52379 4.2315 7.28117 4.42678 7.15987C4.58094 7.05722 4.79678 7.06656 4.94066 7.17853L6.79066 8.55956L10.7168 4.6311Z", fill: "#38A611" }), jsx$2("path", { d: "M11.3232 4.6031L12.6161 3.07725L12.5951 3.05944L12.5736 3.0422L11.3232 4.6031ZM10.7168 4.6311L9.32823 3.19167L9.31506 3.20437L9.30213 3.21731L10.7168 4.6311ZM11.3848 5.10699L9.80589 3.8794L9.79787 3.88972L9.78999 3.90014L11.3848 5.10699ZM7.57177 10.1459L9.11371 11.4196L9.14087 11.3867L9.16661 11.3527L7.57177 10.1459ZM7.54094 10.1832L5.999 8.90945L5.97125 8.94305L5.94499 8.97782L7.54094 10.1832ZM6.44122 10.3698L5.35301 12.0479L5.36851 12.0579L5.3842 12.0677L6.44122 10.3698ZM6.24594 10.1925L4.66237 11.4141L4.66819 11.4217L4.67408 11.4292L6.24594 10.1925ZM4.324 7.70108L2.72677 8.90477L2.73355 8.91376L2.74042 8.92268L4.324 7.70108ZM4.42678 7.15987L5.48213 8.85876L5.50892 8.84212L5.53518 8.82463L4.42678 7.15987ZM4.94066 7.17853L3.71236 8.75691L3.72819 8.76922L3.74426 8.78122L4.94066 7.17853ZM6.79066 8.55956L5.59425 10.1622L6.98153 11.1978L8.2053 9.97335L6.79066 8.55956ZM13 7.5C13 10.5376 10.5376 13 7.5 13V17C12.7467 17 17 12.7467 17 7.5H13ZM7.5 2C10.5376 2 13 4.46243 13 7.5H17C17 2.25329 12.7467 -2 7.5 -2V2ZM2 7.5C2 4.46243 4.46243 2 7.5 2V-2C2.25329 -2 -2 2.25329 -2 7.5H2ZM7.5 13C4.46243 13 2 10.5376 2 7.5H-2C-2 12.7467 2.25329 17 7.5 17V13ZM12.5736 3.0422C11.623 2.28067 10.225 2.32656 9.32823 3.19167L12.1053 6.07052C11.5374 6.61837 10.6739 6.64559 10.0727 6.164L12.5736 3.0422ZM12.9638 6.33458C13.7999 5.2591 13.5179 3.84143 12.6161 3.07725L10.0302 6.12895C9.43671 5.62605 9.2164 4.63761 9.80589 3.8794L12.9638 6.33458ZM9.16661 11.3527L12.9797 6.31385L9.78999 3.90014L5.97694 8.93902L9.16661 11.3527ZM9.08288 11.4569L9.11371 11.4196L6.02984 8.87212L5.999 8.90945L9.08288 11.4569ZM5.3842 12.0677C6.57521 12.8092 8.23351 12.5847 9.13689 11.3886L5.94499 8.97782C6.1621 8.69035 6.45202 8.55308 6.69854 8.51121C6.94576 8.46921 7.23358 8.5072 7.49824 8.67197L5.3842 12.0677ZM4.67408 11.4292C4.86564 11.6726 5.10262 11.8855 5.35301 12.0479L7.52942 8.69178C7.59192 8.73231 7.64101 8.77179 7.68026 8.80742C7.71912 8.8427 7.76655 8.89076 7.8178 8.95589L4.67408 11.4292ZM2.74042 8.92268L4.66237 11.4141L7.82951 8.97093L5.90757 6.47949L2.74042 8.92268ZM3.37143 5.46098C2.16753 6.20884 1.89287 7.79823 2.72677 8.90477L5.92123 6.49739C6.48791 7.24934 6.29547 8.35351 5.48213 8.85876L3.37143 5.46098ZM6.16897 5.60015C5.3495 4.96244 4.1927 4.91298 3.31837 5.4951L5.53518 8.82463C4.96918 9.20147 4.24405 9.17067 3.71236 8.75691L6.16897 5.60015ZM7.98707 6.95687L6.13707 5.57584L3.74426 8.78122L5.59425 10.1622L7.98707 6.95687ZM9.30213 3.21731L5.37603 7.14577L8.2053 9.97335L12.1314 6.04489L9.30213 3.21731Z", fill: "#38A611", mask: "url(#path-1-inside-1_8581_37376)" })] }));
|
|
4466
|
+
return (jsxs("svg", { width: width || '10', viewBox: "0 0 15 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", sx: style, children: [jsx$2("circle", { cx: "7.5", cy: "7.5", r: "7.5", fill: "white" }), jsx$2("mask", { id: "path-1-inside-1_8581_37376", fill: "white", children: jsx$2("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.5 15C11.6421 15 15 11.6421 15 7.5C15 3.35786 11.6421 0 7.5 0C3.35786 0 0 3.35786 0 7.5C0 11.6421 3.35786 15 7.5 15ZM10.7168 4.6311C10.8812 4.47247 11.1484 4.46313 11.3232 4.6031C11.4773 4.73374 11.5082 4.94836 11.3848 5.10699L7.57177 10.1459L7.54094 10.1832C7.29427 10.5098 6.80094 10.5938 6.44122 10.3698C6.36927 10.3232 6.29733 10.2578 6.24594 10.1925L4.324 7.70108C4.19039 7.52379 4.2315 7.28117 4.42678 7.15987C4.58094 7.05722 4.79678 7.06656 4.94066 7.17853L6.79066 8.55956L10.7168 4.6311Z" }) }), jsx$2("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.5 15C11.6421 15 15 11.6421 15 7.5C15 3.35786 11.6421 0 7.5 0C3.35786 0 0 3.35786 0 7.5C0 11.6421 3.35786 15 7.5 15ZM10.7168 4.6311C10.8812 4.47247 11.1484 4.46313 11.3232 4.6031C11.4773 4.73374 11.5082 4.94836 11.3848 5.10699L7.57177 10.1459L7.54094 10.1832C7.29427 10.5098 6.80094 10.5938 6.44122 10.3698C6.36927 10.3232 6.29733 10.2578 6.24594 10.1925L4.324 7.70108C4.19039 7.52379 4.2315 7.28117 4.42678 7.15987C4.58094 7.05722 4.79678 7.06656 4.94066 7.17853L6.79066 8.55956L10.7168 4.6311Z", fill: "#38A611" }), jsx$2("path", { d: "M11.3232 4.6031L12.6161 3.07725L12.5951 3.05944L12.5736 3.0422L11.3232 4.6031ZM10.7168 4.6311L9.32823 3.19167L9.31506 3.20437L9.30213 3.21731L10.7168 4.6311ZM11.3848 5.10699L9.80589 3.8794L9.79787 3.88972L9.78999 3.90014L11.3848 5.10699ZM7.57177 10.1459L9.11371 11.4196L9.14087 11.3867L9.16661 11.3527L7.57177 10.1459ZM7.54094 10.1832L5.999 8.90945L5.97125 8.94305L5.94499 8.97782L7.54094 10.1832ZM6.44122 10.3698L5.35301 12.0479L5.36851 12.0579L5.3842 12.0677L6.44122 10.3698ZM6.24594 10.1925L4.66237 11.4141L4.66819 11.4217L4.67408 11.4292L6.24594 10.1925ZM4.324 7.70108L2.72677 8.90477L2.73355 8.91376L2.74042 8.92268L4.324 7.70108ZM4.42678 7.15987L5.48213 8.85876L5.50892 8.84212L5.53518 8.82463L4.42678 7.15987ZM4.94066 7.17853L3.71236 8.75691L3.72819 8.76922L3.74426 8.78122L4.94066 7.17853ZM6.79066 8.55956L5.59425 10.1622L6.98153 11.1978L8.2053 9.97335L6.79066 8.55956ZM13 7.5C13 10.5376 10.5376 13 7.5 13V17C12.7467 17 17 12.7467 17 7.5H13ZM7.5 2C10.5376 2 13 4.46243 13 7.5H17C17 2.25329 12.7467 -2 7.5 -2V2ZM2 7.5C2 4.46243 4.46243 2 7.5 2V-2C2.25329 -2 -2 2.25329 -2 7.5H2ZM7.5 13C4.46243 13 2 10.5376 2 7.5H-2C-2 12.7467 2.25329 17 7.5 17V13ZM12.5736 3.0422C11.623 2.28067 10.225 2.32656 9.32823 3.19167L12.1053 6.07052C11.5374 6.61837 10.6739 6.64559 10.0727 6.164L12.5736 3.0422ZM12.9638 6.33458C13.7999 5.2591 13.5179 3.84143 12.6161 3.07725L10.0302 6.12895C9.43671 5.62605 9.2164 4.63761 9.80589 3.8794L12.9638 6.33458ZM9.16661 11.3527L12.9797 6.31385L9.78999 3.90014L5.97694 8.93902L9.16661 11.3527ZM9.08288 11.4569L9.11371 11.4196L6.02984 8.87212L5.999 8.90945L9.08288 11.4569ZM5.3842 12.0677C6.57521 12.8092 8.23351 12.5847 9.13689 11.3886L5.94499 8.97782C6.1621 8.69035 6.45202 8.55308 6.69854 8.51121C6.94576 8.46921 7.23358 8.5072 7.49824 8.67197L5.3842 12.0677ZM4.67408 11.4292C4.86564 11.6726 5.10262 11.8855 5.35301 12.0479L7.52942 8.69178C7.59192 8.73231 7.64101 8.77179 7.68026 8.80742C7.71912 8.8427 7.76655 8.89076 7.8178 8.95589L4.67408 11.4292ZM2.74042 8.92268L4.66237 11.4141L7.82951 8.97093L5.90757 6.47949L2.74042 8.92268ZM3.37143 5.46098C2.16753 6.20884 1.89287 7.79823 2.72677 8.90477L5.92123 6.49739C6.48791 7.24934 6.29547 8.35351 5.48213 8.85876L3.37143 5.46098ZM6.16897 5.60015C5.3495 4.96244 4.1927 4.91298 3.31837 5.4951L5.53518 8.82463C4.96918 9.20147 4.24405 9.17067 3.71236 8.75691L6.16897 5.60015ZM7.98707 6.95687L6.13707 5.57584L3.74426 8.78122L5.59425 10.1622L7.98707 6.95687ZM9.30213 3.21731L5.37603 7.14577L8.2053 9.97335L12.1314 6.04489L9.30213 3.21731Z", fill: "#38A611", mask: "url(#path-1-inside-1_8581_37376)" })] }));
|
|
4467
4467
|
};
|
|
4468
4468
|
|
|
4469
4469
|
const QuestionCircle = ({ direction = 'down', color = 'text', width, getStyles }) => {
|
|
@@ -19717,7 +19717,7 @@ const MINUTE_IN_SECONDS = 60;
|
|
|
19717
19717
|
const HOUR_IN_SECONDS = MINUTE_IN_SECONDS * 60;
|
|
19718
19718
|
const DAY_IN_SECONDS = HOUR_IN_SECONDS * 24;
|
|
19719
19719
|
const MONTH_IN_SECONDS = DAY_IN_SECONDS * 30; // Assuming 30 days in a month
|
|
19720
|
-
const getTimePeriods = (seconds, days) => {
|
|
19720
|
+
const getTimePeriods = (seconds = 0, days) => {
|
|
19721
19721
|
let delta = seconds;
|
|
19722
19722
|
const timeLeft = {
|
|
19723
19723
|
months: 0,
|
|
@@ -19753,7 +19753,7 @@ const getTimePeriods = (seconds, days) => {
|
|
|
19753
19753
|
* @param shorten determines whether you want to get just the highest value or the full string
|
|
19754
19754
|
*/
|
|
19755
19755
|
const formatTimeLeft = (timeLeft, useDays = true, shorten = false) => {
|
|
19756
|
-
const parsedTimeLeft = getTimePeriods(timeLeft
|
|
19756
|
+
const parsedTimeLeft = getTimePeriods(timeLeft, useDays);
|
|
19757
19757
|
if (shorten) {
|
|
19758
19758
|
if (parsedTimeLeft.months > 0) {
|
|
19759
19759
|
return `${parsedTimeLeft.months}Mo`;
|
|
@@ -19789,7 +19789,7 @@ const localeFormat = (number, precision = 2) => {
|
|
|
19789
19789
|
const formatNumberSI = (num, digits = 2) => {
|
|
19790
19790
|
if (!num)
|
|
19791
19791
|
return '0';
|
|
19792
|
-
const number = typeof num === 'string' ? parseFloat(num) : num;
|
|
19792
|
+
const number = typeof num === 'string' ? parseFloat(num) : typeof num === 'number' ? num : num.toNumber();
|
|
19793
19793
|
const suffixes = [
|
|
19794
19794
|
{ value: 1e12, symbol: 'T' },
|
|
19795
19795
|
{ value: 1e9, symbol: 'B' },
|
|
@@ -21006,9 +21006,7 @@ function requireZapTokens () {
|
|
|
21006
21006
|
_118,
|
|
21007
21007
|
_119,
|
|
21008
21008
|
_120,
|
|
21009
|
-
_121
|
|
21010
|
-
_122,
|
|
21011
|
-
_123;
|
|
21009
|
+
_121;
|
|
21012
21010
|
Object.defineProperty(zapTokens, '__esModule', { value: true });
|
|
21013
21011
|
zapTokens.zapInputTokens = zapTokens.WNATIVE = void 0;
|
|
21014
21012
|
var types_1 = requireTypes$1();
|
|
@@ -21182,141 +21180,124 @@ function requireZapTokens () {
|
|
|
21182
21180
|
decimals: ((_29 = {}), (_29[types_1.ChainId.BSC] = 18), _29),
|
|
21183
21181
|
active: true,
|
|
21184
21182
|
},
|
|
21185
|
-
// WMATIC or WPOL on BNB chain has been commented out up until we have clarity regarding the migration
|
|
21186
|
-
// {
|
|
21187
|
-
// symbol: 'wPOL',
|
|
21188
|
-
// address: {
|
|
21189
|
-
// [ChainId.BSC]: '0xCC42724C6683B7E57334c4E856f4c9965ED682bD',
|
|
21190
|
-
// },
|
|
21191
|
-
// decimals: {
|
|
21192
|
-
// [ChainId.BSC]: 18,
|
|
21193
|
-
// },
|
|
21194
|
-
// active: true,
|
|
21195
|
-
// },
|
|
21196
|
-
{
|
|
21197
|
-
symbol: 'AVAX',
|
|
21198
|
-
address: ((_30 = {}), (_30[types_1.ChainId.BSC] = '0x1ce0c2827e2ef14d5c4f29a091d735a204794041'), _30),
|
|
21199
|
-
decimals: ((_31 = {}), (_31[types_1.ChainId.BSC] = 18), _31),
|
|
21200
|
-
active: true,
|
|
21201
|
-
},
|
|
21202
21183
|
{
|
|
21203
21184
|
symbol: 'ADA',
|
|
21204
|
-
address: ((
|
|
21205
|
-
decimals: ((
|
|
21185
|
+
address: ((_30 = {}), (_30[types_1.ChainId.BSC] = '0x3ee2200efb3400fabb9aacf31297cbdd1d435d47'), _30),
|
|
21186
|
+
decimals: ((_31 = {}), (_31[types_1.ChainId.BSC] = 18), _31),
|
|
21206
21187
|
active: true,
|
|
21207
21188
|
},
|
|
21208
21189
|
]),
|
|
21209
21190
|
(_5[types_1.ChainId.MATIC] = [
|
|
21210
21191
|
{
|
|
21211
21192
|
symbol: 'wPOL',
|
|
21212
|
-
address: ((
|
|
21213
|
-
decimals: ((
|
|
21193
|
+
address: ((_32 = {}), (_32[types_1.ChainId.MATIC] = '0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270'), _32),
|
|
21194
|
+
decimals: ((_33 = {}), (_33[types_1.ChainId.MATIC] = 18), _33),
|
|
21214
21195
|
active: true,
|
|
21215
21196
|
},
|
|
21216
21197
|
{
|
|
21217
21198
|
symbol: 'USDC.e',
|
|
21218
|
-
address: ((
|
|
21219
|
-
decimals: ((
|
|
21199
|
+
address: ((_34 = {}), (_34[types_1.ChainId.MATIC] = '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174'), _34),
|
|
21200
|
+
decimals: ((_35 = {}), (_35[types_1.ChainId.MATIC] = 6), _35),
|
|
21220
21201
|
active: true,
|
|
21221
21202
|
},
|
|
21222
21203
|
{
|
|
21223
21204
|
symbol: 'USDC',
|
|
21224
|
-
address: ((
|
|
21225
|
-
decimals: ((
|
|
21205
|
+
address: ((_36 = {}), (_36[types_1.ChainId.MATIC] = '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359'), _36),
|
|
21206
|
+
decimals: ((_37 = {}), (_37[types_1.ChainId.MATIC] = 6), _37),
|
|
21226
21207
|
active: true,
|
|
21227
21208
|
},
|
|
21228
21209
|
{
|
|
21229
21210
|
symbol: 'USDT',
|
|
21230
|
-
address: ((
|
|
21231
|
-
decimals: ((
|
|
21211
|
+
address: ((_38 = {}), (_38[types_1.ChainId.MATIC] = '0xc2132D05D31c914a87C6611C10748AEb04B58e8F'), _38),
|
|
21212
|
+
decimals: ((_39 = {}), (_39[types_1.ChainId.MATIC] = 6), _39),
|
|
21232
21213
|
active: true,
|
|
21233
21214
|
},
|
|
21234
21215
|
{
|
|
21235
21216
|
symbol: 'DAI',
|
|
21236
|
-
address: ((
|
|
21237
|
-
decimals: ((
|
|
21217
|
+
address: ((_40 = {}), (_40[types_1.ChainId.MATIC] = '0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063'), _40),
|
|
21218
|
+
decimals: ((_41 = {}), (_41[types_1.ChainId.MATIC] = 18), _41),
|
|
21238
21219
|
active: true,
|
|
21239
21220
|
},
|
|
21240
21221
|
{
|
|
21241
21222
|
symbol: 'wETH',
|
|
21242
|
-
address: ((
|
|
21243
|
-
decimals: ((
|
|
21223
|
+
address: ((_42 = {}), (_42[types_1.ChainId.MATIC] = '0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619'), _42),
|
|
21224
|
+
decimals: ((_43 = {}), (_43[types_1.ChainId.MATIC] = 18), _43),
|
|
21244
21225
|
active: true,
|
|
21245
21226
|
},
|
|
21246
21227
|
{
|
|
21247
21228
|
symbol: 'BTC',
|
|
21248
|
-
address: ((
|
|
21249
|
-
decimals: ((
|
|
21229
|
+
address: ((_44 = {}), (_44[types_1.ChainId.MATIC] = '0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6'), _44),
|
|
21230
|
+
decimals: ((_45 = {}), (_45[types_1.ChainId.MATIC] = 18), _45),
|
|
21250
21231
|
active: true,
|
|
21251
21232
|
},
|
|
21252
21233
|
]),
|
|
21253
21234
|
(_5[types_1.ChainId.ARBITRUM] = [
|
|
21254
21235
|
{
|
|
21255
21236
|
symbol: 'wETH',
|
|
21256
|
-
address: ((
|
|
21257
|
-
decimals: ((
|
|
21237
|
+
address: ((_46 = {}), (_46[types_1.ChainId.ARBITRUM] = '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1'), _46),
|
|
21238
|
+
decimals: ((_47 = {}), (_47[types_1.ChainId.ARBITRUM] = 18), _47),
|
|
21258
21239
|
active: true,
|
|
21259
21240
|
},
|
|
21260
21241
|
{
|
|
21261
21242
|
symbol: 'USDC',
|
|
21262
|
-
address: ((
|
|
21263
|
-
decimals: ((
|
|
21243
|
+
address: ((_48 = {}), (_48[types_1.ChainId.ARBITRUM] = '0xaf88d065e77c8cC2239327C5EDb3A432268e5831'), _48),
|
|
21244
|
+
decimals: ((_49 = {}), (_49[types_1.ChainId.ARBITRUM] = 6), _49),
|
|
21264
21245
|
active: true,
|
|
21265
21246
|
},
|
|
21266
21247
|
{
|
|
21267
21248
|
symbol: 'USDT',
|
|
21268
|
-
address: ((
|
|
21269
|
-
decimals: ((
|
|
21249
|
+
address: ((_50 = {}), (_50[types_1.ChainId.ARBITRUM] = '0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9'), _50),
|
|
21250
|
+
decimals: ((_51 = {}), (_51[types_1.ChainId.ARBITRUM] = 6), _51),
|
|
21270
21251
|
active: true,
|
|
21271
21252
|
},
|
|
21272
21253
|
{
|
|
21273
21254
|
symbol: 'DAI',
|
|
21274
|
-
address: ((
|
|
21275
|
-
decimals: ((
|
|
21255
|
+
address: ((_52 = {}), (_52[types_1.ChainId.ARBITRUM] = '0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1'), _52),
|
|
21256
|
+
decimals: ((_53 = {}), (_53[types_1.ChainId.ARBITRUM] = 18), _53),
|
|
21276
21257
|
active: true,
|
|
21277
21258
|
},
|
|
21278
21259
|
{
|
|
21279
21260
|
symbol: 'BTC',
|
|
21280
|
-
address: ((
|
|
21281
|
-
decimals: ((
|
|
21261
|
+
address: ((_54 = {}), (_54[types_1.ChainId.ARBITRUM] = '0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f'), _54),
|
|
21262
|
+
decimals: ((_55 = {}), (_55[types_1.ChainId.ARBITRUM] = 8), _55),
|
|
21282
21263
|
active: true,
|
|
21283
21264
|
},
|
|
21284
21265
|
{
|
|
21285
21266
|
symbol: 'ARB',
|
|
21286
|
-
address: ((
|
|
21287
|
-
decimals: ((
|
|
21267
|
+
address: ((_56 = {}), (_56[types_1.ChainId.ARBITRUM] = '0x912CE59144191C1204E64559FE8253a0e49E6548'), _56),
|
|
21268
|
+
decimals: ((_57 = {}), (_57[types_1.ChainId.ARBITRUM] = 18), _57),
|
|
21288
21269
|
active: true,
|
|
21289
21270
|
},
|
|
21290
21271
|
]),
|
|
21291
21272
|
(_5[types_1.ChainId.LINEA] = [
|
|
21292
21273
|
{
|
|
21293
21274
|
symbol: 'wETH',
|
|
21294
|
-
address: ((
|
|
21295
|
-
decimals: ((
|
|
21275
|
+
address: ((_58 = {}), (_58[types_1.ChainId.LINEA] = '0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f'), _58),
|
|
21276
|
+
decimals: ((_59 = {}), (_59[types_1.ChainId.LINEA] = 18), _59),
|
|
21296
21277
|
active: true,
|
|
21297
21278
|
},
|
|
21298
21279
|
{
|
|
21299
21280
|
symbol: 'USDC.e',
|
|
21300
|
-
address: ((
|
|
21301
|
-
decimals: ((
|
|
21281
|
+
address: ((_60 = {}), (_60[types_1.ChainId.LINEA] = '0x176211869cA2b568f2A7D4EE941E073a821EE1ff'), _60),
|
|
21282
|
+
decimals: ((_61 = {}), (_61[types_1.ChainId.LINEA] = 6), _61),
|
|
21302
21283
|
active: true,
|
|
21303
21284
|
},
|
|
21304
21285
|
{
|
|
21305
21286
|
symbol: 'USDT',
|
|
21306
|
-
address: ((
|
|
21307
|
-
decimals: ((
|
|
21287
|
+
address: ((_62 = {}), (_62[types_1.ChainId.LINEA] = '0xA219439258ca9da29E9Cc4cE5596924745e12B93'), _62),
|
|
21288
|
+
decimals: ((_63 = {}), (_63[types_1.ChainId.LINEA] = 6), _63),
|
|
21308
21289
|
active: true,
|
|
21309
21290
|
},
|
|
21310
21291
|
{
|
|
21311
21292
|
symbol: 'DAI',
|
|
21312
|
-
address: ((
|
|
21313
|
-
decimals: ((
|
|
21293
|
+
address: ((_64 = {}), (_64[types_1.ChainId.LINEA] = '0x4AF15ec2A0BD43Db75dd04E62FAA3B8EF36b00d5'), _64),
|
|
21294
|
+
decimals: ((_65 = {}), (_65[types_1.ChainId.LINEA] = 18), _65),
|
|
21314
21295
|
active: true,
|
|
21315
21296
|
},
|
|
21316
21297
|
{
|
|
21317
21298
|
symbol: 'BTC',
|
|
21318
|
-
address: ((
|
|
21319
|
-
decimals: ((
|
|
21299
|
+
address: ((_66 = {}), (_66[types_1.ChainId.LINEA] = '0x3aAB2285ddcDdaD8edf438C1bAB47e1a9D05a9b4'), _66),
|
|
21300
|
+
decimals: ((_67 = {}), (_67[types_1.ChainId.LINEA] = 8), _67),
|
|
21320
21301
|
active: true,
|
|
21321
21302
|
},
|
|
21322
21303
|
// WMATIC or WPOL on Linea chain has been commented out up until we have clarity regarding the migration
|
|
@@ -21334,174 +21315,174 @@ function requireZapTokens () {
|
|
|
21334
21315
|
(_5[types_1.ChainId.BASE] = [
|
|
21335
21316
|
{
|
|
21336
21317
|
symbol: 'wETH',
|
|
21337
|
-
address: ((
|
|
21338
|
-
decimals: ((
|
|
21318
|
+
address: ((_68 = {}), (_68[types_1.ChainId.BASE] = '0x4200000000000000000000000000000000000006'), _68),
|
|
21319
|
+
decimals: ((_69 = {}), (_69[types_1.ChainId.BASE] = 18), _69),
|
|
21339
21320
|
active: true,
|
|
21340
21321
|
},
|
|
21341
21322
|
{
|
|
21342
21323
|
symbol: 'USDC',
|
|
21343
|
-
address: ((
|
|
21344
|
-
decimals: ((
|
|
21324
|
+
address: ((_70 = {}), (_70[types_1.ChainId.BASE] = '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913'), _70),
|
|
21325
|
+
decimals: ((_71 = {}), (_71[types_1.ChainId.BASE] = 6), _71),
|
|
21345
21326
|
active: true,
|
|
21346
21327
|
},
|
|
21347
21328
|
{
|
|
21348
21329
|
symbol: 'USDT',
|
|
21349
|
-
address: ((
|
|
21350
|
-
decimals: ((
|
|
21330
|
+
address: ((_72 = {}), (_72[types_1.ChainId.BASE] = '0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2'), _72),
|
|
21331
|
+
decimals: ((_73 = {}), (_73[types_1.ChainId.BASE] = 6), _73),
|
|
21351
21332
|
active: true,
|
|
21352
21333
|
},
|
|
21353
21334
|
{
|
|
21354
21335
|
symbol: 'DAI',
|
|
21355
|
-
address: ((
|
|
21356
|
-
decimals: ((
|
|
21336
|
+
address: ((_74 = {}), (_74[types_1.ChainId.BASE] = '0x50c5725949a6f0c72e6c4a641f24049a917db0cb'), _74),
|
|
21337
|
+
decimals: ((_75 = {}), (_75[types_1.ChainId.BASE] = 18), _75),
|
|
21357
21338
|
active: true,
|
|
21358
21339
|
},
|
|
21359
21340
|
{
|
|
21360
|
-
symbol: '
|
|
21361
|
-
address: ((
|
|
21362
|
-
decimals: ((
|
|
21341
|
+
symbol: 'cbBTC',
|
|
21342
|
+
address: ((_76 = {}), (_76[types_1.ChainId.BASE] = '0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf'), _76),
|
|
21343
|
+
decimals: ((_77 = {}), (_77[types_1.ChainId.BASE] = 8), _77),
|
|
21363
21344
|
active: true,
|
|
21364
21345
|
},
|
|
21365
21346
|
]),
|
|
21366
21347
|
(_5[types_1.ChainId.BLAST] = [
|
|
21367
21348
|
{
|
|
21368
21349
|
symbol: 'wETH',
|
|
21369
|
-
address: ((
|
|
21370
|
-
decimals: ((
|
|
21350
|
+
address: ((_78 = {}), (_78[types_1.ChainId.BLAST] = '0x4300000000000000000000000000000000000004'), _78),
|
|
21351
|
+
decimals: ((_79 = {}), (_79[types_1.ChainId.BLAST] = 18), _79),
|
|
21371
21352
|
active: true,
|
|
21372
21353
|
},
|
|
21373
21354
|
{
|
|
21374
21355
|
symbol: 'BTC',
|
|
21375
|
-
address: ((
|
|
21376
|
-
decimals: ((
|
|
21356
|
+
address: ((_80 = {}), (_80[types_1.ChainId.BLAST] = '0xF7bc58b8D8f97ADC129cfC4c9f45Ce3C0E1D2692'), _80),
|
|
21357
|
+
decimals: ((_81 = {}), (_81[types_1.ChainId.BLAST] = 18), _81),
|
|
21377
21358
|
active: true,
|
|
21378
21359
|
},
|
|
21379
21360
|
{
|
|
21380
21361
|
symbol: 'USDe',
|
|
21381
|
-
address: ((
|
|
21382
|
-
decimals: ((
|
|
21362
|
+
address: ((_82 = {}), (_82[types_1.ChainId.BLAST] = '0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34'), _82),
|
|
21363
|
+
decimals: ((_83 = {}), (_83[types_1.ChainId.BLAST] = 18), _83),
|
|
21383
21364
|
active: true,
|
|
21384
21365
|
},
|
|
21385
21366
|
]),
|
|
21386
21367
|
(_5[types_1.ChainId.BERACHAIN] = [
|
|
21387
21368
|
{
|
|
21388
21369
|
symbol: 'HONEY',
|
|
21389
|
-
address: ((
|
|
21390
|
-
decimals: ((
|
|
21370
|
+
address: ((_84 = {}), (_84[types_1.ChainId.BERACHAIN] = '0xFCBD14DC51f0A4d49d5E53C2E0950e0bC26d0Dce'), _84),
|
|
21371
|
+
decimals: ((_85 = {}), (_85[types_1.ChainId.BERACHAIN] = 18), _85),
|
|
21391
21372
|
active: true,
|
|
21392
21373
|
},
|
|
21393
21374
|
{
|
|
21394
21375
|
symbol: 'BTC',
|
|
21395
|
-
address: ((
|
|
21396
|
-
decimals: ((
|
|
21376
|
+
address: ((_86 = {}), (_86[types_1.ChainId.BERACHAIN] = '0x0555E30da8f98308EdB960aa94C0Db47230d2B9c'), _86),
|
|
21377
|
+
decimals: ((_87 = {}), (_87[types_1.ChainId.BERACHAIN] = 8), _87),
|
|
21397
21378
|
active: true,
|
|
21398
21379
|
},
|
|
21399
21380
|
{
|
|
21400
21381
|
symbol: 'USDe',
|
|
21401
|
-
address: ((
|
|
21402
|
-
decimals: ((
|
|
21382
|
+
address: ((_88 = {}), (_88[types_1.ChainId.BERACHAIN] = '0x5d3a1ff2b6bab83b63cd9ad0787074081a52ef34'), _88),
|
|
21383
|
+
decimals: ((_89 = {}), (_89[types_1.ChainId.BERACHAIN] = 18), _89),
|
|
21403
21384
|
active: true,
|
|
21404
21385
|
},
|
|
21405
21386
|
{
|
|
21406
21387
|
symbol: 'WETH',
|
|
21407
|
-
address: ((
|
|
21408
|
-
decimals: ((
|
|
21388
|
+
address: ((_90 = {}), (_90[types_1.ChainId.BERACHAIN] = '0x2F6F07CDcf3588944Bf4C42aC74ff24bF56e7590'), _90),
|
|
21389
|
+
decimals: ((_91 = {}), (_91[types_1.ChainId.BERACHAIN] = 18), _91),
|
|
21409
21390
|
active: true,
|
|
21410
21391
|
},
|
|
21411
21392
|
{
|
|
21412
21393
|
symbol: 'USDC.e',
|
|
21413
|
-
address: ((
|
|
21414
|
-
decimals: ((
|
|
21394
|
+
address: ((_92 = {}), (_92[types_1.ChainId.BERACHAIN] = '0x549943e04f40284185054145c6E4e9568C1D3241'), _92),
|
|
21395
|
+
decimals: ((_93 = {}), (_93[types_1.ChainId.BERACHAIN] = 6), _93),
|
|
21415
21396
|
active: true,
|
|
21416
21397
|
},
|
|
21417
21398
|
]),
|
|
21418
21399
|
(_5[types_1.ChainId.SONIC] = [
|
|
21419
21400
|
{
|
|
21420
21401
|
symbol: 'wS',
|
|
21421
|
-
address: ((
|
|
21422
|
-
decimals: ((
|
|
21402
|
+
address: ((_94 = {}), (_94[types_1.ChainId.SONIC] = '0x039e2fB66102314Ce7b64Ce5Ce3E5183bc94aD38'), _94),
|
|
21403
|
+
decimals: ((_95 = {}), (_95[types_1.ChainId.SONIC] = 18), _95),
|
|
21423
21404
|
active: true,
|
|
21424
21405
|
},
|
|
21425
21406
|
{
|
|
21426
21407
|
symbol: 'USDC',
|
|
21427
|
-
address: ((
|
|
21428
|
-
decimals: ((
|
|
21408
|
+
address: ((_96 = {}), (_96[types_1.ChainId.SONIC] = '0x29219dd400f2Bf60E5a23d13Be72B486D4038894'), _96),
|
|
21409
|
+
decimals: ((_97 = {}), (_97[types_1.ChainId.SONIC] = 6), _97),
|
|
21429
21410
|
active: true,
|
|
21430
21411
|
},
|
|
21431
21412
|
{
|
|
21432
21413
|
symbol: 'USDT',
|
|
21433
|
-
address: ((
|
|
21434
|
-
decimals: ((
|
|
21414
|
+
address: ((_98 = {}), (_98[types_1.ChainId.SONIC] = '0x6047828dc181963ba44974801FF68e538dA5eaF9'), _98),
|
|
21415
|
+
decimals: ((_99 = {}), (_99[types_1.ChainId.SONIC] = 6), _99),
|
|
21435
21416
|
active: true,
|
|
21436
21417
|
},
|
|
21437
21418
|
{
|
|
21438
21419
|
symbol: 'BTC',
|
|
21439
|
-
address: ((
|
|
21440
|
-
decimals: ((
|
|
21420
|
+
address: ((_100 = {}), (_100[types_1.ChainId.SONIC] = '0x0555E30da8f98308EdB960aa94C0Db47230d2B9c'), _100),
|
|
21421
|
+
decimals: ((_101 = {}), (_101[types_1.ChainId.SONIC] = 8), _101),
|
|
21441
21422
|
active: true,
|
|
21442
21423
|
},
|
|
21443
21424
|
{
|
|
21444
21425
|
symbol: 'wETH',
|
|
21445
|
-
address: ((
|
|
21446
|
-
decimals: ((
|
|
21426
|
+
address: ((_102 = {}), (_102[types_1.ChainId.SONIC] = '0x50c42dEAcD8Fc9773493ED674b675bE577f2634b'), _102),
|
|
21427
|
+
decimals: ((_103 = {}), (_103[types_1.ChainId.SONIC] = 18), _103),
|
|
21447
21428
|
active: true,
|
|
21448
21429
|
},
|
|
21449
21430
|
]),
|
|
21450
21431
|
(_5[types_1.ChainId.AVAX] = [
|
|
21451
21432
|
{
|
|
21452
21433
|
symbol: 'wAVAX',
|
|
21453
|
-
address: ((
|
|
21454
|
-
decimals: ((
|
|
21434
|
+
address: ((_104 = {}), (_104[types_1.ChainId.AVAX] = '0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7'), _104),
|
|
21435
|
+
decimals: ((_105 = {}), (_105[types_1.ChainId.AVAX] = 18), _105),
|
|
21455
21436
|
active: true,
|
|
21456
21437
|
},
|
|
21457
21438
|
{
|
|
21458
21439
|
symbol: 'USDT',
|
|
21459
|
-
address: ((
|
|
21460
|
-
decimals: ((
|
|
21440
|
+
address: ((_106 = {}), (_106[types_1.ChainId.AVAX] = '0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7'), _106),
|
|
21441
|
+
decimals: ((_107 = {}), (_107[types_1.ChainId.AVAX] = 6), _107),
|
|
21461
21442
|
active: true,
|
|
21462
21443
|
},
|
|
21463
21444
|
{
|
|
21464
21445
|
symbol: 'USDC',
|
|
21465
|
-
address: ((
|
|
21466
|
-
decimals: ((
|
|
21446
|
+
address: ((_108 = {}), (_108[types_1.ChainId.AVAX] = '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e'), _108),
|
|
21447
|
+
decimals: ((_109 = {}), (_109[types_1.ChainId.AVAX] = 6), _109),
|
|
21467
21448
|
active: true,
|
|
21468
21449
|
},
|
|
21469
21450
|
{
|
|
21470
21451
|
symbol: 'BTC',
|
|
21471
|
-
address: ((
|
|
21472
|
-
decimals: ((
|
|
21452
|
+
address: ((_110 = {}), (_110[types_1.ChainId.AVAX] = '0x0555E30da8f98308EdB960aa94C0Db47230d2B9c'), _110),
|
|
21453
|
+
decimals: ((_111 = {}), (_111[types_1.ChainId.AVAX] = 8), _111),
|
|
21473
21454
|
active: true,
|
|
21474
21455
|
},
|
|
21475
21456
|
{
|
|
21476
21457
|
symbol: 'SUPER',
|
|
21477
|
-
address: ((
|
|
21478
|
-
decimals: ((
|
|
21458
|
+
address: ((_112 = {}), (_112[types_1.ChainId.AVAX] = '0x09fa58228bb791ea355c90da1e4783452b9bd8c3'), _112),
|
|
21459
|
+
decimals: ((_113 = {}), (_113[types_1.ChainId.AVAX] = 18), _113),
|
|
21479
21460
|
active: true,
|
|
21480
21461
|
},
|
|
21481
21462
|
]),
|
|
21482
21463
|
(_5[types_1.ChainId.SOL] = [
|
|
21483
21464
|
{
|
|
21484
21465
|
symbol: 'wSOL',
|
|
21485
|
-
address: ((
|
|
21486
|
-
decimals: ((
|
|
21466
|
+
address: ((_114 = {}), (_114[types_1.ChainId.SOL] = 'So11111111111111111111111111111111111111112'), _114),
|
|
21467
|
+
decimals: ((_115 = {}), (_115[types_1.ChainId.SOL] = 9), _115),
|
|
21487
21468
|
active: true,
|
|
21488
21469
|
},
|
|
21489
21470
|
{
|
|
21490
21471
|
symbol: 'USDC',
|
|
21491
|
-
address: ((
|
|
21492
|
-
decimals: ((
|
|
21472
|
+
address: ((_116 = {}), (_116[types_1.ChainId.SOL] = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'), _116),
|
|
21473
|
+
decimals: ((_117 = {}), (_117[types_1.ChainId.SOL] = 6), _117),
|
|
21493
21474
|
active: true,
|
|
21494
21475
|
},
|
|
21495
21476
|
{
|
|
21496
21477
|
symbol: 'USDT',
|
|
21497
|
-
address: ((
|
|
21498
|
-
decimals: ((
|
|
21478
|
+
address: ((_118 = {}), (_118[types_1.ChainId.SOL] = 'Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB'), _118),
|
|
21479
|
+
decimals: ((_119 = {}), (_119[types_1.ChainId.SOL] = 6), _119),
|
|
21499
21480
|
active: true,
|
|
21500
21481
|
},
|
|
21501
21482
|
{
|
|
21502
21483
|
symbol: 'wETH',
|
|
21503
|
-
address: ((
|
|
21504
|
-
decimals: ((
|
|
21484
|
+
address: ((_120 = {}), (_120[types_1.ChainId.SOL] = '7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs'), _120),
|
|
21485
|
+
decimals: ((_121 = {}), (_121[types_1.ChainId.SOL] = 8), _121),
|
|
21505
21486
|
active: true,
|
|
21506
21487
|
},
|
|
21507
21488
|
]),
|
|
@@ -63360,8 +63341,8 @@ const sortBonds = (sortConfig, bonds) => {
|
|
|
63360
63341
|
bValue = remainingPercentage(b);
|
|
63361
63342
|
}
|
|
63362
63343
|
else if (sortConfig.key === 'terms') {
|
|
63363
|
-
aValue =
|
|
63364
|
-
bValue =
|
|
63344
|
+
aValue = getTimePeriods(a.vestingTerm, true).days;
|
|
63345
|
+
bValue = getTimePeriods(b.vestingTerm, true).days;
|
|
63365
63346
|
}
|
|
63366
63347
|
else {
|
|
63367
63348
|
aValue = (_f = (_e = findHighestTrueBondPrice(TIERS_WEIGHT[main.LaunchBondTiers.Legend], a === null || a === void 0 ? void 0 : a.trueBondPrices)) === null || _e === void 0 ? void 0 : _e.bonusWithFee) !== null && _f !== void 0 ? _f : 0;
|
|
@@ -63376,15 +63357,6 @@ const sortBonds = (sortConfig, bonds) => {
|
|
|
63376
63357
|
return 0;
|
|
63377
63358
|
});
|
|
63378
63359
|
};
|
|
63379
|
-
const vestingTime = (vestingTerm) => {
|
|
63380
|
-
return getTimePeriods(vestingTerm !== null && vestingTerm !== void 0 ? vestingTerm : 0, true);
|
|
63381
|
-
};
|
|
63382
|
-
const remainingPercentage = (bond) => {
|
|
63383
|
-
var _a, _b, _c, _d;
|
|
63384
|
-
const totalMaxPayout = new BigNumber$1((_a = bond.maxTotalPayout) !== null && _a !== void 0 ? _a : '0').div(new BigNumber$1(10).pow((_c = (_b = bond.earnToken.decimals) === null || _b === void 0 ? void 0 : _b[bond.chainId]) !== null && _c !== void 0 ? _c : 18));
|
|
63385
|
-
const remainingTokens = new BigNumber$1((_d = bond.tokensRemaining) !== null && _d !== void 0 ? _d : '0');
|
|
63386
|
-
return remainingTokens.div(totalMaxPayout).times(100).toNumber();
|
|
63387
|
-
};
|
|
63388
63360
|
const getDiscountColor = (discount) => {
|
|
63389
63361
|
if (!discount)
|
|
63390
63362
|
return '';
|
|
@@ -63401,7 +63373,7 @@ const calculateARR = (bond, useTiers) => {
|
|
|
63401
63373
|
const discount = bonus !== null && bonus !== void 0 ? bonus : 0;
|
|
63402
63374
|
if (discount < 0)
|
|
63403
63375
|
return '-';
|
|
63404
|
-
const vestingDays =
|
|
63376
|
+
const vestingDays = getTimePeriods(vestingTerm, true).days;
|
|
63405
63377
|
return `${((discount * 365) / vestingDays).toFixed(2)}%`;
|
|
63406
63378
|
};
|
|
63407
63379
|
const isBondSupported = (SDKVersion, bondVersion) => {
|
|
@@ -63425,19 +63397,6 @@ const isBondSupported = (SDKVersion, bondVersion) => {
|
|
|
63425
63397
|
// If none of the above conditions are met, version1 is less
|
|
63426
63398
|
return false;
|
|
63427
63399
|
};
|
|
63428
|
-
const getRemainingTokensString = (bond) => {
|
|
63429
|
-
const remainingTokensFormat = (bond) => {
|
|
63430
|
-
const tokensRemaining = 'tokensRemaining' in bond ? bond.tokensRemaining : '0';
|
|
63431
|
-
return formatNumberSI(parseFloat(tokensRemaining !== null && tokensRemaining !== void 0 ? tokensRemaining : '0'), 0);
|
|
63432
|
-
};
|
|
63433
|
-
const remainingTokensUsd = (bond) => {
|
|
63434
|
-
const tokensRemaining = 'tokensRemaining' in bond ? bond.tokensRemaining : '0';
|
|
63435
|
-
const payoutTokenPrice = 'payoutTokenPrice' in bond ? bond.payoutTokenPrice : 0;
|
|
63436
|
-
const tokens = new BigNumber$1(tokensRemaining !== null && tokensRemaining !== void 0 ? tokensRemaining : '0');
|
|
63437
|
-
return tokens.times(payoutTokenPrice !== null && payoutTokenPrice !== void 0 ? payoutTokenPrice : '0');
|
|
63438
|
-
};
|
|
63439
|
-
return `${remainingTokensFormat(bond)} ${bond.earnToken.symbol} ($${formatNumberSI(remainingTokensUsd(bond).toNumber())})`;
|
|
63440
|
-
};
|
|
63441
63400
|
/**
|
|
63442
63401
|
* Finds the highest TrueBondPrices element where userPoints is higher than points in the array.
|
|
63443
63402
|
* @param userPoints - The user's points as a string representing a BigNumber.
|
|
@@ -63504,12 +63463,6 @@ const claimedUSD = (userBill) => {
|
|
|
63504
63463
|
const claimedTokens = claimed(userBill);
|
|
63505
63464
|
return claimedTokens * parseFloat((_b = (_a = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _a === void 0 ? void 0 : _a.payoutTokenPrice) !== null && _b !== void 0 ? _b : '0');
|
|
63506
63465
|
};
|
|
63507
|
-
const vestingTimeRemaining = (userBill) => {
|
|
63508
|
-
var _a, _b;
|
|
63509
|
-
const currentTime = new Date().getTime() / 1000;
|
|
63510
|
-
const vestingCliff = (_b = (_a = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _a === void 0 ? void 0 : _a.vestingCliff) !== null && _b !== void 0 ? _b : 0;
|
|
63511
|
-
return getTimePeriods(parseInt(userBill.lastBlockTimestamp) + parseInt(userBill.vesting) - vestingCliff - currentTime, true);
|
|
63512
|
-
};
|
|
63513
63466
|
const getPercentageVested = (bond) => {
|
|
63514
63467
|
var _a;
|
|
63515
63468
|
const vestingTerm = parseInt((_a = bond === null || bond === void 0 ? void 0 : bond.vesting) !== null && _a !== void 0 ? _a : '0');
|
|
@@ -63520,10 +63473,10 @@ const getPercentageVested = (bond) => {
|
|
|
63520
63473
|
};
|
|
63521
63474
|
const getTimeLeftForFullyVested = (bond) => {
|
|
63522
63475
|
var _a, _b;
|
|
63523
|
-
const
|
|
63524
|
-
const
|
|
63525
|
-
const
|
|
63526
|
-
return
|
|
63476
|
+
const vestingTerm = parseInt((_a = bond === null || bond === void 0 ? void 0 : bond.vesting) !== null && _a !== void 0 ? _a : '0');
|
|
63477
|
+
const purchaseTimestamp = parseInt((_b = bond === null || bond === void 0 ? void 0 : bond.vestingStartTimestamp) !== null && _b !== void 0 ? _b : '0');
|
|
63478
|
+
const now = Math.round(Date.now() / 1000);
|
|
63479
|
+
return purchaseTimestamp + vestingTerm - now;
|
|
63527
63480
|
};
|
|
63528
63481
|
const getPendingVestingString = (bond) => {
|
|
63529
63482
|
const timeLeftForFullyVested = getTimeLeftForFullyVested(bond);
|
|
@@ -63574,19 +63527,34 @@ const discountEarnTokenPriceForUser = (bond, useTiers, userTier) => {
|
|
|
63574
63527
|
const trueBondPriceWithFee = getBalanceNumber(new BigNumber$1(trueBondPrice !== null && trueBondPrice !== void 0 ? trueBondPrice : '0').times((100 + fee) / 100));
|
|
63575
63528
|
return getFirstNonZeroDigits(principalTokenPrice * trueBondPriceWithFee);
|
|
63576
63529
|
};
|
|
63577
|
-
const
|
|
63578
|
-
|
|
63530
|
+
const SAFETY_THRESHOLD = 5; // in USD
|
|
63531
|
+
const getSafetyAvailable = (bond, allowLowValueBonds) => {
|
|
63532
|
+
var _a, _b, _c;
|
|
63579
63533
|
const available = new BigNumber$1((_a = bond === null || bond === void 0 ? void 0 : bond.tokensRemaining) !== null && _a !== void 0 ? _a : '0');
|
|
63580
|
-
const threshold = allowLowValueBonds ? 0 : 5;
|
|
63581
63534
|
const payoutTokenPrice = new BigNumber$1((_b = bond === null || bond === void 0 ? void 0 : bond.payoutTokenPrice) !== null && _b !== void 0 ? _b : 0);
|
|
63535
|
+
const threshold = allowLowValueBonds ? 0 : SAFETY_THRESHOLD;
|
|
63582
63536
|
const thresholdToShow = payoutTokenPrice.gt(0) ? new BigNumber$1(threshold).div(payoutTokenPrice) : new BigNumber$1(0);
|
|
63583
|
-
|
|
63537
|
+
const feeInPayoutAdjuster = (100 - ((_c = bond === null || bond === void 0 ? void 0 : bond.feeInPayout) !== null && _c !== void 0 ? _c : 0)) / 100;
|
|
63538
|
+
let safeAvailable = available.times(feeInPayoutAdjuster).minus(thresholdToShow);
|
|
63584
63539
|
if (safeAvailable.lt(0))
|
|
63585
63540
|
safeAvailable = new BigNumber$1(0);
|
|
63586
|
-
const singlePurchaseLimit = new BigNumber$1((_c = bond === null || bond === void 0 ? void 0 : bond.maxPayout) !== null && _c !== void 0 ? _c : 0).div(new BigNumber$1(10).pow((_f = (_e = (_d = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _d === void 0 ? void 0 : _d.decimals) === null || _e === void 0 ? void 0 : _e[bond === null || bond === void 0 ? void 0 : bond.chainId]) !== null && _f !== void 0 ? _f : 18));
|
|
63587
63541
|
if (available.isZero())
|
|
63588
63542
|
return new BigNumber$1(0);
|
|
63589
|
-
return
|
|
63543
|
+
return safeAvailable;
|
|
63544
|
+
};
|
|
63545
|
+
const getSafetyPurchaseLimit = (bond, allowLowValueBonds) => {
|
|
63546
|
+
var _a, _b, _c, _d, _e;
|
|
63547
|
+
const threshold = allowLowValueBonds ? 0 : SAFETY_THRESHOLD;
|
|
63548
|
+
const payoutTokenPrice = new BigNumber$1((_a = bond === null || bond === void 0 ? void 0 : bond.payoutTokenPrice) !== null && _a !== void 0 ? _a : 0);
|
|
63549
|
+
const thresholdToShow = payoutTokenPrice.gt(0) ? new BigNumber$1(threshold).div(payoutTokenPrice) : new BigNumber$1(0);
|
|
63550
|
+
return new BigNumber$1((_b = bond === null || bond === void 0 ? void 0 : bond.maxPayout) !== null && _b !== void 0 ? _b : 0)
|
|
63551
|
+
.div(new BigNumber$1(10).pow((_e = (_d = (_c = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _c === void 0 ? void 0 : _c.decimals) === null || _d === void 0 ? void 0 : _d[bond === null || bond === void 0 ? void 0 : bond.chainId]) !== null && _e !== void 0 ? _e : 18))
|
|
63552
|
+
.minus(thresholdToShow);
|
|
63553
|
+
};
|
|
63554
|
+
const getMaxBuy = (bond, allowLowValueBonds) => {
|
|
63555
|
+
const safeAvailable = getSafetyAvailable(bond, allowLowValueBonds);
|
|
63556
|
+
const safePurchaseLimit = getSafetyPurchaseLimit(bond, allowLowValueBonds);
|
|
63557
|
+
return safePurchaseLimit.lt(safeAvailable) ? safePurchaseLimit : safeAvailable;
|
|
63590
63558
|
};
|
|
63591
63559
|
function formatNumber$1(input) {
|
|
63592
63560
|
const number = new BigNumber$1(input);
|
|
@@ -63619,7 +63587,7 @@ const youSpendUSD = (bond, inputValue) => {
|
|
|
63619
63587
|
var _a;
|
|
63620
63588
|
return (parseFloat(inputValue) * parseFloat((_a = bond === null || bond === void 0 ? void 0 : bond.principalTokenPrice) !== null && _a !== void 0 ? _a : '0')).toString();
|
|
63621
63589
|
};
|
|
63622
|
-
// receives depositAmount and returns the payoutTokens the user will receive. IT DOES SUBTRACT FEE
|
|
63590
|
+
// receives depositAmount and returns the payoutTokens the user will receive. IT DOES SUBTRACT FEE IN PAYOUT
|
|
63623
63591
|
const getPayoutAmount = (bond, inputValue, userPoints) => {
|
|
63624
63592
|
var _a, _b;
|
|
63625
63593
|
if (!inputValue || !bond || !userPoints || !bond.trueBondPrices)
|
|
@@ -63633,26 +63601,60 @@ const getPayoutAmount = (bond, inputValue, userPoints) => {
|
|
|
63633
63601
|
return billValue.toNumber();
|
|
63634
63602
|
};
|
|
63635
63603
|
const youGetUSD = (bond, inputValue, userPoints) => {
|
|
63636
|
-
var _a
|
|
63637
|
-
if (!bond.trueBondPrices)
|
|
63638
|
-
return
|
|
63639
|
-
const
|
|
63640
|
-
|
|
63641
|
-
const fee = (_c = bond === null || bond === void 0 ? void 0 : bond.feeInPayout) !== null && _c !== void 0 ? _c : 0;
|
|
63642
|
-
const reverseFee = new BigNumber$1(fee / 100 / (1 - fee / 100));
|
|
63643
|
-
const trueBondPriceWithFee = new BigNumber$1(trueBondPrice).plus(new BigNumber$1(trueBondPrice).times(reverseFee));
|
|
63644
|
-
const billValue = bigValue.div(new BigNumber$1(trueBondPriceWithFee));
|
|
63645
|
-
return (billValue.toNumber() * parseFloat((_d = bond === null || bond === void 0 ? void 0 : bond.payoutTokenPrice) !== null && _d !== void 0 ? _d : '0')).toString();
|
|
63604
|
+
var _a;
|
|
63605
|
+
if (!inputValue || !bond || !userPoints || !bond.trueBondPrices)
|
|
63606
|
+
return 0;
|
|
63607
|
+
const payoutAmount = getPayoutAmount(bond, inputValue, userPoints);
|
|
63608
|
+
return payoutAmount * parseFloat((_a = bond === null || bond === void 0 ? void 0 : bond.payoutTokenPrice) !== null && _a !== void 0 ? _a : '0');
|
|
63646
63609
|
};
|
|
63647
63610
|
const getRawBonus$1 = (bond, inputValue, userPoints) => {
|
|
63648
63611
|
if (!bond || !inputValue || !userPoints)
|
|
63649
63612
|
return '0';
|
|
63650
|
-
const premiumUSD =
|
|
63613
|
+
const premiumUSD = youGetUSD(bond, inputValue, userPoints) - parseFloat(youSpendUSD(bond, inputValue));
|
|
63651
63614
|
return premiumUSD.toString();
|
|
63652
63615
|
};
|
|
63653
63616
|
const getBonusColor = (premiumString) => {
|
|
63654
63617
|
return parseFloat(premiumString) < 0 ? 'premium-negative' : 'premium-positive';
|
|
63655
63618
|
};
|
|
63619
|
+
/**
|
|
63620
|
+
* Calculates the principal token amount needed to receive a target payout amount.
|
|
63621
|
+
* This is the reverse of getRawPayoutAmount function (does NOT include fees).
|
|
63622
|
+
*
|
|
63623
|
+
* @param bond - The bond data
|
|
63624
|
+
* @param targetPayoutAmount - The desired payout amount in payout tokens
|
|
63625
|
+
* @param userPoints - User's tier points
|
|
63626
|
+
* @returns The principal token amount needed, or '0' if calculation cannot be performed
|
|
63627
|
+
*/
|
|
63628
|
+
const getPrincipalAmount = (bond, targetPayoutAmount, userPoints) => {
|
|
63629
|
+
var _a, _b;
|
|
63630
|
+
if (!targetPayoutAmount || !bond || !userPoints || !bond.trueBondPrices)
|
|
63631
|
+
return new BigNumber$1(0);
|
|
63632
|
+
const billValue = new BigNumber$1(targetPayoutAmount);
|
|
63633
|
+
const fee = (_a = bond === null || bond === void 0 ? void 0 : bond.feeInPayout) !== null && _a !== void 0 ? _a : 0;
|
|
63634
|
+
const trueBondPriceObject = findHighestTrueBondPrice(userPoints, bond === null || bond === void 0 ? void 0 : bond.trueBondPrices);
|
|
63635
|
+
const trueBondPrice = new BigNumber$1((_b = trueBondPriceObject === null || trueBondPriceObject === void 0 ? void 0 : trueBondPriceObject.trueBondPrice) !== null && _b !== void 0 ? _b : '0');
|
|
63636
|
+
if (trueBondPrice.isZero())
|
|
63637
|
+
return new BigNumber$1(0);
|
|
63638
|
+
const reverseFee = new BigNumber$1(fee / 100 / (1 - fee / 100));
|
|
63639
|
+
const trueBondPriceWithFee = trueBondPrice.plus(trueBondPrice.times(reverseFee));
|
|
63640
|
+
// Reverse the formula: bigValue = billValue * (trueBondPrice + trueBondPrice * reverseFee)
|
|
63641
|
+
const bigValue = billValue.times(trueBondPriceWithFee);
|
|
63642
|
+
// Convert from 18 decimals back to regular amount
|
|
63643
|
+
return bigValue.div(new BigNumber$1(10).pow(18));
|
|
63644
|
+
};
|
|
63645
|
+
const getRemainingTokensString = (bond, allowLowValueBonds) => {
|
|
63646
|
+
var _a;
|
|
63647
|
+
const remainingTokens = getSafetyAvailable(bond, allowLowValueBonds).toNumber();
|
|
63648
|
+
// const remainingTokens = parseFloat(bond?.tokensRemaining ?? '0')
|
|
63649
|
+
const remainingTokensUsd = remainingTokens * parseFloat((_a = bond.payoutTokenPrice) !== null && _a !== void 0 ? _a : '0');
|
|
63650
|
+
return `${formatNumberSI(remainingTokens, 0)} ${bond.earnToken.symbol} ($${formatNumberSI(remainingTokensUsd, 0)})`;
|
|
63651
|
+
};
|
|
63652
|
+
const remainingPercentage = (bond) => {
|
|
63653
|
+
var _a, _b, _c, _d;
|
|
63654
|
+
const totalMaxPayout = new BigNumber$1((_a = bond.maxTotalPayout) !== null && _a !== void 0 ? _a : '0').div(new BigNumber$1(10).pow((_c = (_b = bond.earnToken.decimals) === null || _b === void 0 ? void 0 : _b[bond.chainId]) !== null && _c !== void 0 ? _c : 18));
|
|
63655
|
+
const remainingTokens = new BigNumber$1((_d = bond.tokensRemaining) !== null && _d !== void 0 ? _d : '0');
|
|
63656
|
+
return remainingTokens.div(totalMaxPayout).times(100).toNumber();
|
|
63657
|
+
};
|
|
63656
63658
|
|
|
63657
63659
|
function useBondsList() {
|
|
63658
63660
|
const queryClient = useQueryClient();
|
|
@@ -64772,7 +64774,7 @@ const fetchUserOwnedBillsDataAsync = (chainId, account, bondData, tokenPrices, p
|
|
|
64772
64774
|
}
|
|
64773
64775
|
});
|
|
64774
64776
|
const fetchUserOwnedBills = (chainId, account, bonds, tokenPrices, priceApiUrl) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
64775
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
64777
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
64776
64778
|
// Maps all the bills in the list repo to make a call to each of them to get Bills Id, meaning purchased bill ids
|
|
64777
64779
|
const billIdCalls = bonds.map((b) => {
|
|
64778
64780
|
var _a;
|
|
@@ -64812,7 +64814,7 @@ const fetchUserOwnedBills = (chainId, account, bonds, tokenPrices, priceApiUrl)
|
|
|
64812
64814
|
console.log('Individual call for: ', bond.lpToken.symbol, '. Price: ', res.data.price);
|
|
64813
64815
|
principalTokenPrice = parseFloat((_g = res.data.price) !== null && _g !== void 0 ? _g : '0');
|
|
64814
64816
|
}
|
|
64815
|
-
catch (
|
|
64817
|
+
catch (_z) {
|
|
64816
64818
|
principalTokenPrice = 0;
|
|
64817
64819
|
}
|
|
64818
64820
|
}
|
|
@@ -64822,7 +64824,7 @@ const fetchUserOwnedBills = (chainId, account, bonds, tokenPrices, priceApiUrl)
|
|
|
64822
64824
|
console.log('Individual call for: ', bond.earnToken.symbol, '. Price: ', res.data.price);
|
|
64823
64825
|
payoutTokenPrice = parseFloat((_k = res.data.price) !== null && _k !== void 0 ? _k : '0');
|
|
64824
64826
|
}
|
|
64825
|
-
catch (
|
|
64827
|
+
catch (_0) {
|
|
64826
64828
|
payoutTokenPrice = 0;
|
|
64827
64829
|
}
|
|
64828
64830
|
}
|
|
@@ -64839,17 +64841,18 @@ const fetchUserOwnedBills = (chainId, account, bonds, tokenPrices, priceApiUrl)
|
|
|
64839
64841
|
billNftAddress: (_q = bond.billNnftAddress[bond.chainId]) !== null && _q !== void 0 ? _q : '',
|
|
64840
64842
|
vesting: (_r = billData[billPos][0]) === null || _r === void 0 ? void 0 : _r.vesting.toString(),
|
|
64841
64843
|
// TODO: sync this with solana so that both implementation have the same logic
|
|
64842
|
-
lastBlockTimestamp: (_s = billData[billPos][0]) === null || _s === void 0 ? void 0 : _s.
|
|
64843
|
-
|
|
64844
|
+
lastBlockTimestamp: (_s = billData[billPos][0]) === null || _s === void 0 ? void 0 : _s.lastClaimTimestamp.toString(),
|
|
64845
|
+
vestingStartTimestamp: (_t = billData[billPos][0]) === null || _t === void 0 ? void 0 : _t.vestingStartTimestamp.toString(),
|
|
64846
|
+
truePricePaid: (_u = billData[billPos][0]) === null || _u === void 0 ? void 0 : _u.truePricePaid.toString(),
|
|
64844
64847
|
pendingRewards: billData[billPos + 1][0].toString(),
|
|
64845
64848
|
bond,
|
|
64846
64849
|
}
|
|
64847
64850
|
: {
|
|
64848
64851
|
address: billDataCalls[billPos].address,
|
|
64849
64852
|
id: billDataCalls[billPos].params[0].toString(),
|
|
64850
|
-
payoutClaimed: (
|
|
64853
|
+
payoutClaimed: (_x = (_w = (_v = billData === null || billData === void 0 ? void 0 : billData[billPos]) === null || _v === void 0 ? void 0 : _v[0]) === null || _w === void 0 ? void 0 : _w.payoutClaimed) === null || _x === void 0 ? void 0 : _x.toString(),
|
|
64851
64854
|
payout: billData[billPos][0].toString(),
|
|
64852
|
-
billNftAddress: (
|
|
64855
|
+
billNftAddress: (_y = bond.billNnftAddress[bond.chainId]) !== null && _y !== void 0 ? _y : '',
|
|
64853
64856
|
vesting: billData[billPos][1].toString(),
|
|
64854
64857
|
lastBlockTimestamp: billData[billPos][2].toString(),
|
|
64855
64858
|
truePricePaid: billData[billPos][3].toString(),
|
|
@@ -75736,9 +75739,9 @@ const Actions = ({ userBill }) => {
|
|
|
75736
75739
|
const canPurchaseAgain = !!similarLiveBond;
|
|
75737
75740
|
const vestingCliff = (_b = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _b === void 0 ? void 0 : _b.vestingCliff;
|
|
75738
75741
|
const currentTime = Math.round(new Date().getTime() / 1000);
|
|
75739
|
-
const
|
|
75740
|
-
const isPendingCliff = vestingCliff ? currentTime -
|
|
75741
|
-
const cliffCountdown = getTimePeriods(
|
|
75742
|
+
const purchaseTimestamp = parseInt((_c = userBill === null || userBill === void 0 ? void 0 : userBill.vestingStartTimestamp) !== null && _c !== void 0 ? _c : '0');
|
|
75743
|
+
const isPendingCliff = vestingCliff ? currentTime - purchaseTimestamp < vestingCliff : false;
|
|
75744
|
+
const cliffCountdown = getTimePeriods(purchaseTimestamp + (vestingCliff !== null && vestingCliff !== void 0 ? vestingCliff : 0) - currentTime, true);
|
|
75742
75745
|
const handleClaim = (billId, billAddress) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
75743
75746
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
75744
75747
|
const address = billAddress;
|
|
@@ -75849,9 +75852,9 @@ const ActionsSolana = ({ userBill }) => {
|
|
|
75849
75852
|
const connection = new Connection(getRPC(main.ChainId.SOL), 'confirmed');
|
|
75850
75853
|
const vestingCliff = (_a = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _a === void 0 ? void 0 : _a.vestingCliff;
|
|
75851
75854
|
const currentTime = Math.round(new Date().getTime() / 1000);
|
|
75852
|
-
const
|
|
75853
|
-
const isPendingCliff = vestingCliff ? currentTime -
|
|
75854
|
-
const cliffCountdown = getTimePeriods(
|
|
75855
|
+
const purchaseTimestamp = parseInt((_b = userBill === null || userBill === void 0 ? void 0 : userBill.vestingStartTimestamp) !== null && _b !== void 0 ? _b : '0');
|
|
75856
|
+
const isPendingCliff = vestingCliff ? currentTime - purchaseTimestamp < vestingCliff : false;
|
|
75857
|
+
const cliffCountdown = getTimePeriods(purchaseTimestamp + (vestingCliff !== null && vestingCliff !== void 0 ? vestingCliff : 0) - currentTime, true);
|
|
75855
75858
|
const handleClaim = () => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
75856
75859
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
75857
75860
|
// Early return guard - prevent double execution
|
|
@@ -75970,9 +75973,9 @@ const YourBondsModal = ({ userBill, onDismiss }) => {
|
|
|
75970
75973
|
// Cliff display info:
|
|
75971
75974
|
const vestingCliff = (_l = userBill === null || userBill === void 0 ? void 0 : userBill.bond) === null || _l === void 0 ? void 0 : _l.vestingCliff;
|
|
75972
75975
|
const currentTime = Math.round(new Date().getTime() / 1000);
|
|
75973
|
-
const
|
|
75974
|
-
const isPendingCliff = vestingCliff ? currentTime -
|
|
75975
|
-
const cliffCountdown = getTimePeriods(
|
|
75976
|
+
const vestingStartTimestamp = parseInt((_m = userBill === null || userBill === void 0 ? void 0 : userBill.vestingStartTimestamp) !== null && _m !== void 0 ? _m : '0');
|
|
75977
|
+
const isPendingCliff = vestingCliff ? currentTime - vestingStartTimestamp < vestingCliff : false;
|
|
75978
|
+
const cliffCountdown = getTimePeriods(vestingStartTimestamp + (vestingCliff !== null && vestingCliff !== void 0 ? vestingCliff : 0) - currentTime, true);
|
|
75976
75979
|
return (jsx$2(Modal, { sx: {
|
|
75977
75980
|
width: '480px',
|
|
75978
75981
|
overflowY: 'unset !important',
|
|
@@ -76213,9 +76216,9 @@ const UserBondRow = ({ bill }) => {
|
|
|
76213
76216
|
const earnTokenPrice = parseFloat((_c = (_b = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _b === void 0 ? void 0 : _b.payoutTokenPrice) !== null && _c !== void 0 ? _c : '0');
|
|
76214
76217
|
const vestingCliff = (_d = bill === null || bill === void 0 ? void 0 : bill.bond) === null || _d === void 0 ? void 0 : _d.vestingCliff;
|
|
76215
76218
|
const currentTime = Math.round(new Date().getTime() / 1000);
|
|
76216
|
-
const
|
|
76217
|
-
const isPendingCliff = vestingCliff ? currentTime -
|
|
76218
|
-
const cliffCountdown = getTimePeriods(
|
|
76219
|
+
const purchaseTimestamp = parseInt((_e = bill === null || bill === void 0 ? void 0 : bill.vestingStartTimestamp) !== null && _e !== void 0 ? _e : '0');
|
|
76220
|
+
const isPendingCliff = vestingCliff ? currentTime - purchaseTimestamp < vestingCliff : false;
|
|
76221
|
+
const cliffCountdown = getTimePeriods(purchaseTimestamp + (vestingCliff !== null && vestingCliff !== void 0 ? vestingCliff : 0) - currentTime, true);
|
|
76219
76222
|
// Modals
|
|
76220
76223
|
const [openCircularModal] = useModal(jsx$2(CircularModal, {}), true, false, 'circularModal');
|
|
76221
76224
|
useEffect(() => {
|
|
@@ -76610,7 +76613,7 @@ const PreTgeActions = ({ userBond }) => {
|
|
|
76610
76613
|
};
|
|
76611
76614
|
|
|
76612
76615
|
const UserBondRowPreTGE = ({ userBond }) => {
|
|
76613
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y
|
|
76616
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
76614
76617
|
const saleFinalized = userBond.finalized;
|
|
76615
76618
|
const hasRedeemed = (_a = userBond === null || userBond === void 0 ? void 0 : userBond.accountInfo) === null || _a === void 0 ? void 0 : _a.hasRedeemed;
|
|
76616
76619
|
const isRedeemable = !hasRedeemed && saleFinalized;
|
|
@@ -76618,23 +76621,23 @@ const UserBondRowPreTGE = ({ userBond }) => {
|
|
|
76618
76621
|
const depositAmount = getBalanceNumber(new BigNumber$1((_d = (_c = userBond === null || userBond === void 0 ? void 0 : userBond.accountInfo) === null || _c === void 0 ? void 0 : _c.depositAmount) !== null && _d !== void 0 ? _d : '0'), (_f = (_e = userBond === null || userBond === void 0 ? void 0 : userBond.lpToken) === null || _e === void 0 ? void 0 : _e.decimals) === null || _f === void 0 ? void 0 : _f[userBond === null || userBond === void 0 ? void 0 : userBond.chainId]);
|
|
76619
76622
|
const truePricePaid = getBalanceNumber(new BigNumber$1((_h = (_g = userBond === null || userBond === void 0 ? void 0 : userBond.accountInfo) === null || _g === void 0 ? void 0 : _g.truePricePaid) !== null && _h !== void 0 ? _h : '0'), (_k = (_j = userBond === null || userBond === void 0 ? void 0 : userBond.lpToken) === null || _j === void 0 ? void 0 : _j.decimals) === null || _k === void 0 ? void 0 : _k[userBond === null || userBond === void 0 ? void 0 : userBond.chainId]);
|
|
76620
76623
|
const initialRelease = userBond === null || userBond === void 0 ? void 0 : userBond.initialRelease;
|
|
76621
|
-
const vestingTimePeriods = getTimePeriods(
|
|
76624
|
+
const vestingTimePeriods = getTimePeriods(userBond.vestingTerm, false);
|
|
76622
76625
|
const vestingString = hasRedeemed
|
|
76623
76626
|
? getPendingVestingString(userBond === null || userBond === void 0 ? void 0 : userBond.userOwnedBillsData)
|
|
76624
76627
|
: initialRelease === 1
|
|
76625
76628
|
? `0 D`
|
|
76626
76629
|
: `${vestingTimePeriods.months} Months`;
|
|
76627
|
-
const userAllocation = depositAmount / ((
|
|
76630
|
+
const userAllocation = depositAmount / ((_l = userBond === null || userBond === void 0 ? void 0 : userBond.initPrice) !== null && _l !== void 0 ? _l : 0);
|
|
76628
76631
|
const initialReleaseTokens = !hasRedeemed && saleFinalized && (userBond === null || userBond === void 0 ? void 0 : userBond.initialRelease) ? userAllocation * (userBond === null || userBond === void 0 ? void 0 : userBond.initialRelease) : 0;
|
|
76629
76632
|
// pendingRewards variable follows the naming of the SC, but it actually means currently claimable tokens
|
|
76630
|
-
const pendingRewards = getBalanceNumber(new BigNumber$1((
|
|
76633
|
+
const pendingRewards = getBalanceNumber(new BigNumber$1((_o = (_m = userBond === null || userBond === void 0 ? void 0 : userBond.userOwnedBillsData) === null || _m === void 0 ? void 0 : _m.pendingRewards) !== null && _o !== void 0 ? _o : '0'), (_q = (_p = userBond === null || userBond === void 0 ? void 0 : userBond.earnToken) === null || _p === void 0 ? void 0 : _p.decimals) === null || _q === void 0 ? void 0 : _q[userBond.chainId]);
|
|
76631
76634
|
// payout variable follows the naming of the SC, but it actually means total tokens vested
|
|
76632
|
-
const payout = getBalanceNumber(new BigNumber$1((
|
|
76635
|
+
const payout = getBalanceNumber(new BigNumber$1((_s = (_r = userBond === null || userBond === void 0 ? void 0 : userBond.userOwnedBillsData) === null || _r === void 0 ? void 0 : _r.payout) !== null && _s !== void 0 ? _s : '0'), (_u = (_t = userBond === null || userBond === void 0 ? void 0 : userBond.earnToken) === null || _t === void 0 ? void 0 : _t.decimals) === null || _u === void 0 ? void 0 : _u[userBond.chainId]);
|
|
76633
76636
|
const claimableAmount = hasRedeemed ? pendingRewards : initialReleaseTokens;
|
|
76634
|
-
const claimableUSD = claimableAmount * ((
|
|
76637
|
+
const claimableUSD = claimableAmount * ((_v = userBond.initPrice) !== null && _v !== void 0 ? _v : 0);
|
|
76635
76638
|
const pendingAmount = hasRedeemed ? payout : depositAmount / truePricePaid;
|
|
76636
|
-
const pendingUSD = pendingAmount * ((
|
|
76637
|
-
return (jsxs("div", { className: "your-bonds", onClick: () => null, children: [jsxs("div", { className: "token-info-container", children: [jsx$2(TokenInfoAndName, { tokenSymbol: userBond.earnToken.symbol, chain: userBond.chainId, tag: (
|
|
76639
|
+
const pendingUSD = pendingAmount * ((_w = userBond === null || userBond === void 0 ? void 0 : userBond.earnTokenPrice) !== null && _w !== void 0 ? _w : 0);
|
|
76640
|
+
return (jsxs("div", { className: "your-bonds", onClick: () => null, children: [jsxs("div", { className: "token-info-container", children: [jsx$2(TokenInfoAndName, { tokenSymbol: userBond.earnToken.symbol, chain: userBond.chainId, tag: (_x = userBond.tags) === null || _x === void 0 ? void 0 : _x[0], vestEnds: isRedeemable ? 'Claim now!' : !hasRedeemed ? `Claim in ${redeemableIn}` : `Ends in ${vestingString}`, isHotBond: true }), jsx$2("div", { className: "tooltip-column", children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(BondInfoTooltip, { earnTokenContract: (userBond === null || userBond === void 0 ? void 0 : userBond.earnToken.address[userBond === null || userBond === void 0 ? void 0 : userBond.chainId]) || '', earnTokenSymbol: (userBond === null || userBond === void 0 ? void 0 : userBond.earnToken.symbol) || '', bondContract: ((_y = userBond === null || userBond === void 0 ? void 0 : userBond.contractAddress) === null || _y === void 0 ? void 0 : _y[userBond === null || userBond === void 0 ? void 0 : userBond.chainId]) || '', projectLink: userBond === null || userBond === void 0 ? void 0 : userBond.projectLink, twitter: userBond === null || userBond === void 0 ? void 0 : userBond.twitter, audit: userBond === null || userBond === void 0 ? void 0 : userBond.audit, chain: userBond === null || userBond === void 0 ? void 0 : userBond.chainId }), width: "205px", placement: "bottomRight", transformTip: "translate(5%, 0%)", children: jsx$2(Flex$1, { sx: {
|
|
76638
76641
|
opacity: 0.8,
|
|
76639
76642
|
}, children: jsx$2(Svg, { icon: "more", width: "25px" }) }) }) })] }), jsxs("div", { className: "your-bonds-columns-container", children: [jsx$2(Flex$1, { sx: { display: ['none', 'none', 'none', 'flex'], width: '125px' } }), jsxs("div", { className: "your-bonds-content", children: [jsx$2("div", { className: "your-bonds-content-title", children: "Claimable" }), jsxs("div", { className: "your-bonds-content-tokens-amount", children: [formatNumberSI(claimableAmount, 3), jsxs("div", { className: "your-bonds-content-tokens-usd-amount", children: ["($", formatUSDNumber$1(claimableUSD), ")"] })] })] }), jsxs("div", { className: "your-bonds-content", children: [jsx$2("div", { className: "your-bonds-content-title", children: "Pending" }), jsxs("div", { className: "your-bonds-content-tokens-amount", children: [formatNumberSI(pendingAmount, 3), jsxs("div", { className: "your-bonds-content-tokens-usd-amount", children: ["($", formatUSDNumber$1(pendingUSD), ")"] })] })] }), jsx$2("div", { className: "your-bonds-content hide-mobile", children: vestingString }), jsx$2("div", { className: "your-bonds-column-button", children: jsx$2(PreTgeActions, { userBond: userBond }) })] })] }));
|
|
76640
76643
|
};
|
|
@@ -76737,12 +76740,9 @@ const YourBonds = ({ showOnly }) => {
|
|
|
76737
76740
|
bValue = pendingUSD(b);
|
|
76738
76741
|
}
|
|
76739
76742
|
else if (sortConfig.key === 'terms') {
|
|
76740
|
-
|
|
76741
|
-
|
|
76742
|
-
|
|
76743
|
-
const bRemainingTime = vestingTimeRemaining(b).days * 24 * 3600 +
|
|
76744
|
-
vestingTimeRemaining(b).hours * 3600 +
|
|
76745
|
-
vestingTimeRemaining(b).minutes * 60;
|
|
76743
|
+
// little nasty trick to have the lowest time (closest to being fully vested) show up first when sorting ascending
|
|
76744
|
+
const aRemainingTime = getTimeLeftForFullyVested(b);
|
|
76745
|
+
const bRemainingTime = getTimeLeftForFullyVested(a);
|
|
76746
76746
|
aValue = aRemainingTime;
|
|
76747
76747
|
bValue = bRemainingTime;
|
|
76748
76748
|
}
|
|
@@ -78936,7 +78936,7 @@ const BonusComponent = ({ trueBondPrices, minTier, bonus, airdropTooltip, toolti
|
|
|
78936
78936
|
}, children: [(_a = highestPointsElement === null || highestPointsElement === void 0 ? void 0 : highestPointsElement.bonusWithFee) === null || _a === void 0 ? void 0 : _a.toFixed(2), "%"] })] })] }) })) : (jsx$2(Flex, { sx: { height: '20px', width: '20px' }, children: jsx$2(TooltipBubble, { body: 'This bond is currently on cooldown and has no bonus. Please check back soon.', width: "205px", placement: "bottomRight", transformTip: "translate(10%, 0%)", children: jsx$2(Svg, { icon: "Timer", width: "20px", color: "#81CFEA" }) }) })) })) : baseTrueBondPrice ? (jsx$2(Flex, { sx: { alignItems: 'center', minWidth: '20px' }, className: `${getDiscountColor(+(baseTrueBondPrice === null || baseTrueBondPrice === void 0 ? void 0 : baseTrueBondPrice.bonusWithFee))}`, children: (baseTrueBondPrice === null || baseTrueBondPrice === void 0 ? void 0 : baseTrueBondPrice.bonusWithFee) > 0 ? (`${(_b = baseTrueBondPrice === null || baseTrueBondPrice === void 0 ? void 0 : baseTrueBondPrice.bonusWithFee) === null || _b === void 0 ? void 0 : _b.toFixed(2)}%`) : (jsx$2(Flex, { sx: { height: '20px', width: '20px' }, children: jsx$2(TooltipBubble, { body: 'This bond is currently on cooldown and has no bonus. Please check back soon.', width: "205px", placement: "bottomRight", transformTip: "translate(10%, 0%)", children: jsx$2(Svg, { icon: "Timer", width: "20px", color: "#81CFEA" }) }) })) })) : (jsxs(Flex, { sx: { color: bonus && 'success', alignItems: 'center', minWidth: '20px' }, children: [bonus || '-', airdropTooltip && (jsx$2(TooltipBubble, { body: jsx$2(Fragment$1, { children: airdropTooltip }), width: "230px", placement: isMobile ? 'bottomRight' : 'bottomLeft', transformTip: isMobile ? 'translate(9%, 6%)' : 'translate(-3%, 6%)', children: jsx$2(Flex, { sx: { width: '20px', height: '20px', alignItems: 'center', ml: '5px' }, children: jsx$2("img", { src: "https://res.cloudinary.com/dswmrqgwy/image/upload/v1750345773/airdrop_qvh4ow.png", alt: "airdrop-img", style: { width: '20px', height: '20px' } }) }) }))] })) }));
|
|
78937
78937
|
};
|
|
78938
78938
|
|
|
78939
|
-
const BondCards = ({ bondData }) => {
|
|
78939
|
+
const BondCards = ({ bondData, isDoingMaxBuy }) => {
|
|
78940
78940
|
var _a, _b, _c;
|
|
78941
78941
|
const isMobile = useIsMobile();
|
|
78942
78942
|
const SDKConfig = useSDKConfig();
|
|
@@ -78973,7 +78973,14 @@ const BondCards = ({ bondData }) => {
|
|
|
78973
78973
|
borderBottomLeftRadius: 'normal',
|
|
78974
78974
|
},
|
|
78975
78975
|
background: MCColorMapping.white3[bondData.marketingCampaign],
|
|
78976
|
-
|
|
78976
|
+
border: isDoingMaxBuy && '2px solid green !important',
|
|
78977
|
+
position: 'relative',
|
|
78978
|
+
}, children: [isDoingMaxBuy && (jsx$2(Flex, { sx: {
|
|
78979
|
+
position: 'absolute',
|
|
78980
|
+
top: '0px',
|
|
78981
|
+
right: '0px',
|
|
78982
|
+
transform: ['translate(50%,-50%)', 'translate(50%,-50%)', 'translate(50%,-50%)', 'translate(-50%,-50%)'],
|
|
78983
|
+
}, children: jsx$2(Svg, { icon: "success", width: isMobile ? 16 : 20 }) })), jsxs("div", { className: "bond-card-title", children: ["Max Buy", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.MaxBuy((_b = bondData === null || bondData === void 0 ? void 0 : bondData.earnToken) === null || _b === void 0 ? void 0 : _b.symbol) }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2("div", { className: "bond-card-tooltip", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), jsxs(Flex, { className: "bond-card-content", sx: { alignItems: 'center' }, children: [jsx$2("div", { style: { paddingRight: '3px' }, children: jsx$2(TokenImage, { symbol: (_c = bondData.showcaseTokenName) !== null && _c !== void 0 ? _c : bondData.earnToken.symbol, size: 22, chain: bondData.chainId }) }), formatNumberSI(getMaxBuy(bondData, SDKConfig.showLowValueBonds), 0)] })] }), jsxs("div", { className: "bond-card-block", sx: {
|
|
78977
78984
|
borderRadius: ['0px', '0px', '0px', 'normal'],
|
|
78978
78985
|
'&:first-of-type': {
|
|
78979
78986
|
borderTopRightRadius: 'normal',
|
|
@@ -78989,11 +78996,11 @@ const BondCards = ({ bondData }) => {
|
|
|
78989
78996
|
height: '25px',
|
|
78990
78997
|
flexDirection: 'column',
|
|
78991
78998
|
justifyContent: 'center',
|
|
78992
|
-
}, showTooltip: true, toolTip: getRemainingTokensString(bondData) })] })] }));
|
|
78999
|
+
}, showTooltip: true, toolTip: getRemainingTokensString(bondData, SDKConfig.showLowValueBonds) })] })] }));
|
|
78993
79000
|
};
|
|
78994
79001
|
|
|
78995
79002
|
const Estimations = ({ depositAmount, bondData, youSpendString, isZap, fetchingZapQuote, zapError, }) => {
|
|
78996
|
-
var _a, _b
|
|
79003
|
+
var _a, _b;
|
|
78997
79004
|
const { data: userPoints } = useTierPoints();
|
|
78998
79005
|
const trueBondPrice = findHighestTrueBondPrice(userPoints, bondData === null || bondData === void 0 ? void 0 : bondData.trueBondPrices);
|
|
78999
79006
|
const SDKConfig = useSDKConfig();
|
|
@@ -79003,7 +79010,7 @@ const Estimations = ({ depositAmount, bondData, youSpendString, isZap, fetchingZ
|
|
|
79003
79010
|
const bonusString = getRawBonus$1(bondData, depositAmount, '0');
|
|
79004
79011
|
// const fee = getFeeAmount(bondData, depositAmount, userPoints ?? '0')
|
|
79005
79012
|
// const feeUSD = fee * parseFloat(bondData?.payoutTokenPrice ?? '0')
|
|
79006
|
-
const estimatedOutputAmount = getPayoutAmount(bondData, depositAmount, userPoints
|
|
79013
|
+
const estimatedOutputAmount = getPayoutAmount(bondData, depositAmount, userPoints);
|
|
79007
79014
|
const estimatedOutputUSD = estimatedOutputAmount * parseFloat((_a = bondData === null || bondData === void 0 ? void 0 : bondData.payoutTokenPrice) !== null && _a !== void 0 ? _a : '0');
|
|
79008
79015
|
const noTierAmount = getRawBonus$1(bondData, depositAmount, '0');
|
|
79009
79016
|
const boostAmount = parseFloat(getRawBonus$1(bondData, depositAmount, userPoints !== null && userPoints !== void 0 ? userPoints : '0')) - parseFloat(noTierAmount);
|
|
@@ -79027,7 +79034,7 @@ const Estimations = ({ depositAmount, bondData, youSpendString, isZap, fetchingZ
|
|
|
79027
79034
|
background: '#9960C5',
|
|
79028
79035
|
opacity: 0.2,
|
|
79029
79036
|
borderRadius: 'normal',
|
|
79030
|
-
} }), jsxs(Flex, { className: "row-container premium", sx: { zIndex: 1 }, children: [jsx$2("img", { src: `https://ape.bond/images/launch/${tierName === null || tierName === void 0 ? void 0 : tierName.toLowerCase()}.png`, alt: "minTier", style: { width: '21px', height: '21px', marginRight: '3px', zIndex: 1 } }), jsx$2(Flex, { sx: { color: 'success', mr: '3px', fontWeight: 700 }, children: `+${(_b = trueBondPrice === null || trueBondPrice === void 0 ? void 0 : trueBondPrice.boost) !== null && _b !== void 0 ? _b : 0}%` }), "Boost:", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.Boost }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, 0%)", children: jsx$2(Flex, { className: "row-container premium-icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), isZap && fetchingZapQuote ? (jsx$2(Dots, {})) : isZap && zapError ? ('-') : (jsxs(Flex, { className: `row-container premium-val premium-positive`, children: ["$ ", formatNumberSI(boostAmount)] }))] })), jsxs(Flex, { className: "text-container row", children: [jsxs(Flex, { className: "row-container get", children: ["You Get (over ",
|
|
79037
|
+
} }), jsxs(Flex, { className: "row-container premium", sx: { zIndex: 1 }, children: [jsx$2("img", { src: `https://ape.bond/images/launch/${tierName === null || tierName === void 0 ? void 0 : tierName.toLowerCase()}.png`, alt: "minTier", style: { width: '21px', height: '21px', marginRight: '3px', zIndex: 1 } }), jsx$2(Flex, { sx: { color: 'success', mr: '3px', fontWeight: 700 }, children: `+${(_b = trueBondPrice === null || trueBondPrice === void 0 ? void 0 : trueBondPrice.boost) !== null && _b !== void 0 ? _b : 0}%` }), "Boost:", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.Boost }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, 0%)", children: jsx$2(Flex, { className: "row-container premium-icon", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), isZap && fetchingZapQuote ? (jsx$2(Dots, {})) : isZap && zapError ? ('-') : (jsxs(Flex, { className: `row-container premium-val premium-positive`, children: ["$ ", formatNumberSI(boostAmount)] }))] })), jsxs(Flex, { className: "text-container row", children: [jsxs(Flex, { className: "row-container get", children: ["You Get (over ", getTimePeriods(bondData === null || bondData === void 0 ? void 0 : bondData.vestingTerm, true).days, " days):"] }), isZap && fetchingZapQuote ? (jsx$2(Dots, {})) : isZap && zapError ? ('-') : (jsxs(Flex, { className: "row-container get-val", children: [formatNumberSI(estimatedOutputAmount, 4), " ", bondData === null || bondData === void 0 ? void 0 : bondData.showcaseTokenName, " = $", ' ', formatNumberSI(estimatedOutputUSD, 2)] }))] })] }));
|
|
79031
79038
|
};
|
|
79032
79039
|
|
|
79033
79040
|
const ProjectDescription = ({ description, isProjectView }) => {
|
|
@@ -79134,7 +79141,7 @@ const GetUpToComponent = ({ bond, depositAmount }) => {
|
|
|
79134
79141
|
// Hooks & Data
|
|
79135
79142
|
const { data: userPoints } = useTierPoints();
|
|
79136
79143
|
const userTier = getUserTier(userPoints);
|
|
79137
|
-
const bonusString = getRawBonus$1(bond, depositAmount, TIERS_WEIGHT[main.LaunchBondTiers.
|
|
79144
|
+
const bonusString = getRawBonus$1(bond, depositAmount, TIERS_WEIGHT[main.LaunchBondTiers.Mythical]);
|
|
79138
79145
|
const noTierAmount = getRawBonus$1(bond, depositAmount, '0');
|
|
79139
79146
|
const boostAmount = parseFloat(bonusString) - parseFloat(noTierAmount);
|
|
79140
79147
|
const trueBondPrice = findHighestTrueBondPriceUserAgnostic(bond);
|
|
@@ -79245,7 +79252,7 @@ const LoadingSpinner = ({ isLoading, size }) => {
|
|
|
79245
79252
|
|
|
79246
79253
|
const stepDelay = 1000;
|
|
79247
79254
|
const TransactionModal = ({ onDismiss, txChain, approvalState, approveCallback, loadingTx, txCallback, bondData, inputToken, inputValue, depositAmount, buyTxHash, rateChanged, }) => {
|
|
79248
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k
|
|
79255
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
79249
79256
|
// Hooks
|
|
79250
79257
|
const { chain } = useEVMAccount();
|
|
79251
79258
|
const { data: userPoints } = useTierPoints();
|
|
@@ -79370,14 +79377,14 @@ const TransactionModal = ({ onDismiss, txChain, approvalState, approveCallback,
|
|
|
79370
79377
|
borderRadius: 'normal',
|
|
79371
79378
|
color: 'textDisabledButton',
|
|
79372
79379
|
justifyContent: 'center',
|
|
79373
|
-
}, children: [bondData.earnToken.symbol, " (", getTimePeriods(
|
|
79380
|
+
}, children: [bondData.earnToken.symbol, " (", getTimePeriods(bondData === null || bondData === void 0 ? void 0 : bondData.vestingTerm).months, " Mo)"] }), jsxs(Flex, { sx: { width: '100%', background: 'white3', p: '10px', borderRadius: 'normal', mt: '10px' }, children: [jsx$2(TokenImage, { symbol: bondData.earnToken.symbol, size: 40, chain: txChain }), jsxs(Flex, { sx: { width: '100%', justifyContent: 'space-between', alignItems: 'center' }, children: [jsxs(Flex, { sx: { flexDirection: 'column', fontSize: '12px', ml: '10px' }, children: [jsxs(Flex, { sx: { color: 'textDisabledButton', fontWeight: 400, textDecoration: 'line-through' }, children: ["$", bondData.tgePrice] }), jsxs(Flex, { sx: { color: 'green', fontWeight: 600 }, children: ["$", bondData.initPrice] })] }), jsxs(Flex, { sx: {
|
|
79374
79381
|
p: '5px',
|
|
79375
79382
|
borderRadius: 'normal',
|
|
79376
79383
|
border: '1px solid var(--theme-ui-colors-success)',
|
|
79377
79384
|
background: 'rgba(56, 166, 17, 0.13)',
|
|
79378
79385
|
color: 'success',
|
|
79379
79386
|
lineHeight: '18px',
|
|
79380
|
-
}, children: [(
|
|
79387
|
+
}, children: [(_f = trueBondPrice === null || trueBondPrice === void 0 ? void 0 : trueBondPrice.bonusWithFee) === null || _f === void 0 ? void 0 : _f.toFixed(2), " % Bonus"] })] })] }), jsxs(Flex, { sx: { width: '100%', justifyContent: 'space-between', mt: '10px' }, children: [jsxs(Flex, { sx: { p: '10px', borderRadius: 'normal', background: 'white3', alignItems: 'center', width: '45%' }, children: [lodashExports.isArray(splited) ? (jsx$2(TokenImage, { symbol: splited[0], symbol2: splited[1], size: 20, chain: txChain })) : (jsx$2(TokenImage, { symbol: getSymbol(inputToken, txChain), size: 20, chain: txChain })), jsx$2(Flex, { sx: { fontSize: '14px', fontWeight: 600, mx: '5px' }, children: (_g = formatNumberSI(inputValue, 4)) !== null && _g !== void 0 ? _g : '0' }), jsxs(Flex, { sx: { color: 'textDisabledButton', fontSize: '12px', fontWeight: 400 }, children: ["(", (inputTokenPrice === null || inputTokenPrice === void 0 ? void 0 : inputTokenPrice.price) && inputValue
|
|
79381
79388
|
? `$${formatNumberSI((inputTokenPrice === null || inputTokenPrice === void 0 ? void 0 : inputTokenPrice.price) * parseFloat(inputValue))}`
|
|
79382
79389
|
: '0.00', ")"] })] }), jsx$2(Svg, { icon: 'arrow', direction: 'right', width: '10px' }), jsxs(Flex, { sx: { p: '10px', borderRadius: 'normal', background: 'white3', alignItems: 'center', width: '45%' }, children: [jsx$2(TokenImage, { symbol: getSymbol(bondData.earnToken, txChain), chain: txChain, size: 20 }), jsx$2(Flex, { sx: { fontSize: '14px', fontWeight: 600, mx: '5px' }, children: formatNumberSI(preTGEEstimatedOutput, 4) }), jsxs(Flex, { sx: { color: 'textDisabledButton', fontSize: '12px', fontWeight: 400 }, children: ["($", formatNumberSI(preTGEEstimatedOutputUSD), ")"] })] })] })] })) : (jsxs(Flex, { sx: { width: '100%', flexDirection: 'column', mt: '20px' }, children: [jsxs(Flex, { sx: {
|
|
79383
79390
|
width: '100%',
|
|
@@ -79386,14 +79393,14 @@ const TransactionModal = ({ onDismiss, txChain, approvalState, approveCallback,
|
|
|
79386
79393
|
borderRadius: 'normal',
|
|
79387
79394
|
color: 'textDisabledButton',
|
|
79388
79395
|
justifyContent: 'center',
|
|
79389
|
-
}, children: [bondData.earnToken.symbol, " (", getVestingTermsString(bondData), ")"] }), jsxs(Flex, { sx: { width: '100%', background: 'white3', p: '10px', borderRadius: 'normal', mt: '10px' }, children: [jsx$2(TokenImage, { symbol: bondData.earnToken.symbol, size: 40, chain: txChain }), jsxs(Flex, { sx: { width: '100%', justifyContent: 'space-between', alignItems: 'center' }, children: [jsxs(Flex, { sx: { flexDirection: 'column', fontSize: '12px', ml: '10px' }, children: [jsxs(Flex, { sx: { color: 'textDisabledButton', fontWeight: 400, textDecoration: 'line-through' }, children: ["$", earnTokenPrice(bondData)] }), jsxs(Flex, { sx: { color: 'green', fontWeight: 600 }, children: ["$", discountEarnTokenPriceForUser(bondData, SDKConfig.useTiers, (
|
|
79396
|
+
}, children: [bondData.earnToken.symbol, " (", getVestingTermsString(bondData), ")"] }), jsxs(Flex, { sx: { width: '100%', background: 'white3', p: '10px', borderRadius: 'normal', mt: '10px' }, children: [jsx$2(TokenImage, { symbol: bondData.earnToken.symbol, size: 40, chain: txChain }), jsxs(Flex, { sx: { width: '100%', justifyContent: 'space-between', alignItems: 'center' }, children: [jsxs(Flex, { sx: { flexDirection: 'column', fontSize: '12px', ml: '10px' }, children: [jsxs(Flex, { sx: { color: 'textDisabledButton', fontWeight: 400, textDecoration: 'line-through' }, children: ["$", earnTokenPrice(bondData)] }), jsxs(Flex, { sx: { color: 'green', fontWeight: 600 }, children: ["$", discountEarnTokenPriceForUser(bondData, SDKConfig.useTiers, (_h = getUserTier(userPoints)) !== null && _h !== void 0 ? _h : undefined)] })] }), jsxs(Flex, { sx: {
|
|
79390
79397
|
p: '5px',
|
|
79391
79398
|
borderRadius: 'normal',
|
|
79392
79399
|
border: '1px solid var(--theme-ui-colors-success)',
|
|
79393
79400
|
background: 'rgba(56, 166, 17, 0.13)',
|
|
79394
79401
|
color: 'success',
|
|
79395
79402
|
lineHeight: '18px',
|
|
79396
|
-
}, children: [(
|
|
79403
|
+
}, children: [(_j = trueBondPrice === null || trueBondPrice === void 0 ? void 0 : trueBondPrice.bonusWithFee) === null || _j === void 0 ? void 0 : _j.toFixed(2), " % Bonus"] })] })] }), jsxs(Flex, { sx: { width: '100%', justifyContent: 'space-between', mt: '10px' }, children: [jsxs(Flex, { sx: { p: '10px', borderRadius: 'normal', background: 'white3', alignItems: 'center', width: '45%' }, children: [lodashExports.isArray(splited) ? (jsx$2(TokenImage, { symbol: splited[0], symbol2: splited[1], size: 20, chain: txChain })) : (jsx$2(TokenImage, { symbol: getSymbol(inputToken, txChain), size: 20, chain: txChain })), jsx$2(Flex, { sx: { fontSize: '14px', fontWeight: 600, mx: '5px' }, children: (_k = formatNumberSI(inputValue, 4)) !== null && _k !== void 0 ? _k : '0' }), jsxs(Flex, { sx: { color: 'textDisabledButton', fontSize: '12px', fontWeight: 400 }, children: ["(", (inputTokenPrice === null || inputTokenPrice === void 0 ? void 0 : inputTokenPrice.price) && inputValue
|
|
79397
79404
|
? `$${formatNumberSI((inputTokenPrice === null || inputTokenPrice === void 0 ? void 0 : inputTokenPrice.price) * parseFloat(inputValue))}`
|
|
79398
79405
|
: '0.00', ")"] })] }), jsx$2(Svg, { icon: 'arrow', direction: 'right', width: '10px' }), jsxs(Flex, { sx: { p: '10px', borderRadius: 'normal', background: 'white3', alignItems: 'center', width: '45%' }, children: [jsx$2(TokenImage, { symbol: getSymbol(bondData.earnToken, txChain), chain: txChain, size: 20 }), jsx$2(Flex, { sx: { fontSize: '14px', fontWeight: 600, mx: '5px' }, children: formatNumberSI(estimatedOutputAmount, 4) }), jsxs(Flex, { sx: { color: 'textDisabledButton', fontSize: '12px', fontWeight: 400 }, children: ["($", formatNumberSI(estimatedOutputUSD), ")"] })] })] })] })), jsx$2(Flex, { sx: { mt: '20px' }, children: hasToSwitchChain ? (jsxs(Button, { load: loadingSwitchChain, disabled: loadingSwitchChain, onClick: handleSwitchChain, fullWidth: true, children: ["switch to ", NETWORK_LABEL[txChain]] })) : !hasToApprove ? (jsx$2(Button, { load: loadingTx || verifyingTx, disabled: loadingTx || verifyingTx, onClick: txCallback, fullWidth: true, children: "buy" })) : (jsx$2(Button, { className: "action-button", load: approvalState === ApprovalState.PENDING || approveLoading, disabled: approvalState === ApprovalState.PENDING || approveLoading, onClick: handleApprove, fullWidth: true, children: "Approve" })) })] })] }));
|
|
79399
79406
|
};
|
|
@@ -79401,6 +79408,7 @@ const TransactionModal = ({ onDismiss, txChain, approvalState, approveCallback,
|
|
|
79401
79408
|
const BuyComponent = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isProjectView, }) => {
|
|
79402
79409
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
79403
79410
|
// Hooks
|
|
79411
|
+
// const config = useConfig()
|
|
79404
79412
|
const SDKConfig = useSDKConfig();
|
|
79405
79413
|
const userChainId = useChainId();
|
|
79406
79414
|
const { address: account } = useEVMAccount();
|
|
@@ -79443,7 +79451,10 @@ const BuyComponent = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond,
|
|
|
79443
79451
|
$${formatUSDNumber((parseFloat(inputValue) * (inputTokenPrice !== null && inputTokenPrice !== void 0 ? inputTokenPrice : 0)).toString())}`;
|
|
79444
79452
|
// Validations
|
|
79445
79453
|
const zapEnabled = supportedByLIFI.includes(bondData === null || bondData === void 0 ? void 0 : bondData.chainId);
|
|
79446
|
-
const
|
|
79454
|
+
const exceedsRealMaxBuy = getMaxBuy(bondData, true).lte(getPayoutAmount(bondData, depositAmount, userPoints));
|
|
79455
|
+
const exceedsSafeMaxBuy = getMaxBuy(bondData, false)
|
|
79456
|
+
.times(isZap ? 0.995 : 0.9995)
|
|
79457
|
+
.lte(getPayoutAmount(bondData, depositAmount, userPoints));
|
|
79447
79458
|
const exceedsBalance = new BigNumber$1(inputCurrencyBalance !== null && inputCurrencyBalance !== void 0 ? inputCurrencyBalance : '0').lt(inputValue);
|
|
79448
79459
|
// Loading State
|
|
79449
79460
|
const [loadingTx, setLoadingTx] = useState(false);
|
|
@@ -79455,6 +79466,36 @@ const BuyComponent = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond,
|
|
|
79455
79466
|
setInputValue('');
|
|
79456
79467
|
setInputTokenString(newInputToken);
|
|
79457
79468
|
}, []);
|
|
79469
|
+
const handleMaxButton = useCallback(() => {
|
|
79470
|
+
var _a, _b, _c, _d, _e;
|
|
79471
|
+
const balance = new BigNumber$1(inputCurrencyBalance !== null && inputCurrencyBalance !== void 0 ? inputCurrencyBalance : '0');
|
|
79472
|
+
const maxBuyAmount = getMaxBuy(bondData, SDKConfig.showLowValueBonds);
|
|
79473
|
+
if (!isZap) {
|
|
79474
|
+
const maxPossibleUserPurchase = getPayoutAmount(bondData, balance.toString(), userPoints);
|
|
79475
|
+
const principalDecimals = (_c = (_b = (_a = bondData === null || bondData === void 0 ? void 0 : bondData.lpToken) === null || _a === void 0 ? void 0 : _a.decimals) === null || _b === void 0 ? void 0 : _b[bondData === null || bondData === void 0 ? void 0 : bondData.chainId]) !== null && _c !== void 0 ? _c : 18;
|
|
79476
|
+
if (maxPossibleUserPurchase > maxBuyAmount.toNumber()) {
|
|
79477
|
+
console.log('user balance exceeds max buy limit, setting to max buy');
|
|
79478
|
+
const principalForMaxBuy = getPrincipalAmount(bondData, maxBuyAmount.toString(), userPoints);
|
|
79479
|
+
setInputValue(principalForMaxBuy.toFixed(principalDecimals));
|
|
79480
|
+
}
|
|
79481
|
+
else {
|
|
79482
|
+
console.log('balance is ok, can be used');
|
|
79483
|
+
setInputValue(balance.toFixed(principalDecimals));
|
|
79484
|
+
}
|
|
79485
|
+
}
|
|
79486
|
+
else {
|
|
79487
|
+
const principalForMaxBuy = getPrincipalAmount(bondData, maxBuyAmount.toString(), userPoints);
|
|
79488
|
+
const principalForMaxBuyUSD = principalForMaxBuy.times((_d = bondData === null || bondData === void 0 ? void 0 : bondData.principalTokenPrice) !== null && _d !== void 0 ? _d : 0);
|
|
79489
|
+
const maxBuyAmountInSelectedToken = principalForMaxBuyUSD.div(inputTokenPrice !== null && inputTokenPrice !== void 0 ? inputTokenPrice : 0);
|
|
79490
|
+
const decimals = (enrichedTokenData === null || enrichedTokenData === void 0 ? void 0 : enrichedTokenData.token) === 'NATIVE' ? 18 : ((_e = enrichedTokenData === null || enrichedTokenData === void 0 ? void 0 : enrichedTokenData.token.decimals[bondData === null || bondData === void 0 ? void 0 : bondData.chainId]) !== null && _e !== void 0 ? _e : 18);
|
|
79491
|
+
if (balance.gte(maxBuyAmountInSelectedToken)) {
|
|
79492
|
+
setInputValue(maxBuyAmountInSelectedToken.toFixed(decimals));
|
|
79493
|
+
}
|
|
79494
|
+
else {
|
|
79495
|
+
setInputValue(balance.toFixed(decimals));
|
|
79496
|
+
}
|
|
79497
|
+
}
|
|
79498
|
+
}, [bondData, isZap, userPoints, SDKConfig.showLowValueBonds, inputTokenPrice, enrichedTokenData === null || enrichedTokenData === void 0 ? void 0 : enrichedTokenData.token]);
|
|
79458
79499
|
const handleOpenZapModal = () => {
|
|
79459
79500
|
var _a;
|
|
79460
79501
|
onOpenZapModal();
|
|
@@ -79500,6 +79541,18 @@ const BuyComponent = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond,
|
|
|
79500
79541
|
const amount = new BigNumber$1(rawAmount).times(new BigNumber$1(10).pow(decimals !== null && decimals !== void 0 ? decimals : 18)).toString();
|
|
79501
79542
|
const shouldUseSig = (bondData === null || bondData === void 0 ? void 0 : bondData.billVersion) === main.BillVersion.V4 && SDKConfig.useTiers;
|
|
79502
79543
|
const args = shouldUseSig ? [amount, maxPrice, account, tierProofSig] : [amount, maxPrice, account];
|
|
79544
|
+
// const simulationResult = await simulateContract(config, {
|
|
79545
|
+
// address: billAddress,
|
|
79546
|
+
// abi: ABI_DEPOSIT_SIG,
|
|
79547
|
+
// functionName: 'deposit',
|
|
79548
|
+
// args: args,
|
|
79549
|
+
// chainId: bondData?.chainId as any,
|
|
79550
|
+
// account,
|
|
79551
|
+
// })
|
|
79552
|
+
// .then((e) => console.log('success!', e))
|
|
79553
|
+
// .catch((e) => {
|
|
79554
|
+
// console.error(e)
|
|
79555
|
+
// })
|
|
79503
79556
|
const hash = yield writeContractAsync({
|
|
79504
79557
|
address: billAddress,
|
|
79505
79558
|
abi: shouldUseSig ? ABI_DEPOSIT_SIG : ABI_DEPOSIT,
|
|
@@ -79656,18 +79709,18 @@ const BuyComponent = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond,
|
|
|
79656
79709
|
}
|
|
79657
79710
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
79658
79711
|
}, [rateChanged]);
|
|
79659
|
-
return bondData ? (jsx$2(Flex, { className: "modal-content", sx: Object.assign({}, MCBuyComponentStyles[bondData === null || bondData === void 0 ? void 0 : bondData.marketingCampaign]), children: jsxs(Flex, { className: "modaltable-container", children: [jsx$2(BondModalHeader, { bondData: bondData, onDismiss: onDismiss, showProjectInfoButton: (SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.referenceId) === 'apebond' }), jsx$2(ProjectDescription, { description: bondData.shortDescription, isProjectView: true }), jsx$2(Flex, { sx: { width: '100%', display: isProjectView ? ['flex', 'flex', 'flex', 'none'] : 'flex' }, children: jsx$2(BondCards, { bondData: bondData }) }), jsx$2(Estimations, { depositAmount: depositAmount, bondData: bondData, youSpendString: youSpendString, isZap: isZap, fetchingZapQuote: fetchingZapQuote, zapError: zapError }), jsx$2(TokenSelectorPanel, { typedValue: inputValue, setTypedValue: setInputValue, selectedToken: inputToken, handleValueBtn:
|
|
79712
|
+
return bondData ? (jsx$2(Flex, { className: "modal-content", sx: Object.assign({}, MCBuyComponentStyles[bondData === null || bondData === void 0 ? void 0 : bondData.marketingCampaign]), children: jsxs(Flex, { className: "modaltable-container", children: [jsx$2(BondModalHeader, { bondData: bondData, onDismiss: onDismiss, showProjectInfoButton: (SDKConfig === null || SDKConfig === void 0 ? void 0 : SDKConfig.referenceId) === 'apebond' }), jsx$2(ProjectDescription, { description: bondData.shortDescription, isProjectView: true }), jsx$2(Flex, { sx: { width: '100%', display: isProjectView ? ['flex', 'flex', 'flex', 'none'] : 'flex' }, children: jsx$2(BondCards, { bondData: bondData, isDoingMaxBuy: exceedsSafeMaxBuy && !exceedsRealMaxBuy }) }), jsx$2(Estimations, { depositAmount: depositAmount, bondData: bondData, youSpendString: youSpendString, isZap: isZap, fetchingZapQuote: fetchingZapQuote, zapError: zapError }), jsx$2(TokenSelectorPanel, { typedValue: inputValue, setTypedValue: setInputValue, selectedToken: inputToken, handleValueBtn: handleMaxButton, handleCurrencySelect: handleCurrencySelect, bondChainId: bondData === null || bondData === void 0 ? void 0 : bondData.chainId, enableZap: zapEnabled, bondPrincipalToken: bondData === null || bondData === void 0 ? void 0 : bondData.lpToken, tokenBalance: inputCurrencyBalance, selectedTokenPrice: inputTokenPrice, inputDisabled: isUserRestricted, marketingCampaign: bondData === null || bondData === void 0 ? void 0 : bondData.marketingCampaign }), SDKConfig.useTiers && ((_k = (_j = bondData === null || bondData === void 0 ? void 0 : bondData.trueBondPrices) === null || _j === void 0 ? void 0 : _j.length) !== null && _k !== void 0 ? _k : 0) > 1 && (jsx$2(GetUpToComponent, { bond: bondData, depositAmount: depositAmount })), (bondData === null || bondData === void 0 ? void 0 : bondData.warningCard) && (jsx$2(Flex, { sx: {
|
|
79660
79713
|
width: '100%',
|
|
79661
79714
|
background: '#DE62F366',
|
|
79662
79715
|
// justifyContent: 'center',
|
|
79663
79716
|
mt: '10px',
|
|
79664
79717
|
borderRadius: 'normal',
|
|
79665
79718
|
p: '2px 10px',
|
|
79666
|
-
}, children: jsxs(Text, { sx: { fontSize: '12px', fontWeight: 400, display: 'flex', alignItems: 'center', gap: '10px' }, children: [jsx$2(SafeHTMLComponent, { html: bondData === null || bondData === void 0 ? void 0 : bondData.warningCard }), (bondData === null || bondData === void 0 ? void 0 : bondData.chainId) === main.ChainId.SONIC && (bondData === null || bondData === void 0 ? void 0 : bondData.earnToken.symbol.toLowerCase()) === 'moon' && (jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Text, { sx: { textTransform: 'none' }, children: "Open the 'cog' icon menu in the top right and set the Slippage Tolerance to 5% or more." }), width: "315px", placement: "topRight", transformTip: "translate(9%, -10%)", children: jsx$2(Svg, { icon: "questionCircle", width: 14, color: "textDisabledButton" }) }))] }) })), jsxs(Flex, { className: "modaltable-container button-container", children: [account && (jsx$2(Flex, { className: "button-container get", children: jsx$2(Button, { className: "action-button", onClick: () => bondData.billVersion === main.BillVersion.V4 && SDKConfig.useTiers
|
|
79667
|
-
? window.open('http://ape.bond/
|
|
79719
|
+
}, children: jsxs(Text, { sx: { fontSize: '12px', fontWeight: 400, display: 'flex', alignItems: 'center', gap: '10px' }, children: [jsx$2(SafeHTMLComponent, { html: bondData === null || bondData === void 0 ? void 0 : bondData.warningCard }), (bondData === null || bondData === void 0 ? void 0 : bondData.chainId) === main.ChainId.SONIC && (bondData === null || bondData === void 0 ? void 0 : bondData.earnToken.symbol.toLowerCase()) === 'moon' && (jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Text, { sx: { textTransform: 'none' }, children: "Open the 'cog' icon menu in the top right and set the Slippage Tolerance to 5% or more." }), width: "315px", placement: "topRight", transformTip: "translate(9%, -10%)", children: jsx$2(Svg, { icon: "questionCircle", width: 14, color: "textDisabledButton" }) }))] }) })), jsxs(Flex, { className: "modaltable-container button-container", children: [account && (jsx$2(Flex, { className: "button-container get", children: jsx$2(Button, { className: "action-button", onClick: () => bondData.billVersion === main.BillVersion.V4 && SDKConfig.useTiers
|
|
79720
|
+
? window.open('http://ape.bond/true-yield', '_blank')
|
|
79668
79721
|
: zapEnabled
|
|
79669
79722
|
? handleOpenZapModal()
|
|
79670
|
-
: openExternal(), variant: "secondary", fullWidth: true, children: bondData.billVersion === main.BillVersion.V4 && SDKConfig.useTiers
|
|
79723
|
+
: openExternal(), variant: "secondary", fullWidth: true, sx: { fontSize: ['14px', '14px', '14px', '16px'], height: '100%' }, children: bondData.billVersion === main.BillVersion.V4 && SDKConfig.useTiers
|
|
79671
79724
|
? `Get ${!isMobile ? 'your' : ''} Tier`
|
|
79672
79725
|
: `Get ${getSymbol(bondData === null || bondData === void 0 ? void 0 : bondData.lpToken)}` }) })), jsx$2(Flex, { className: "button-container buy", children: !account ? (jsx$2(ConnectButton, {})) : isUserRestricted ? (jsx$2(Button, { className: "action-button", disabled: true, children: "INSUFFICIENT TIER" })) : (jsx$2(Button, { className: "action-button", load: load || fetchingZapQuote, disabled: load ||
|
|
79673
79726
|
(bondData === null || bondData === void 0 ? void 0 : bondData.soldOut) ||
|
|
@@ -79676,13 +79729,13 @@ const BuyComponent = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond,
|
|
|
79676
79729
|
parseFloat(inputValue) === 0 ||
|
|
79677
79730
|
fetchingZapQuote ||
|
|
79678
79731
|
zapError ||
|
|
79679
|
-
|
|
79732
|
+
exceedsRealMaxBuy ||
|
|
79680
79733
|
exceedsBalance ||
|
|
79681
79734
|
(isZap && !zapData) ||
|
|
79682
|
-
SDKConfig.blockSales, onClick: handleOpenModal, children: SDKConfig.blockSales
|
|
79735
|
+
SDKConfig.blockSales, onClick: handleOpenModal, sx: { fontSize: ['14px', '14px', '14px', '16px'] }, children: SDKConfig.blockSales
|
|
79683
79736
|
? 'Complete KYC to Buy'
|
|
79684
|
-
:
|
|
79685
|
-
? 'Exceeds Max Buy'
|
|
79737
|
+
: exceedsRealMaxBuy
|
|
79738
|
+
? 'Exceeds Max Buy. Reduce amount'
|
|
79686
79739
|
: exceedsBalance
|
|
79687
79740
|
? 'Exceeds balance'
|
|
79688
79741
|
: zapError
|
|
@@ -80652,7 +80705,10 @@ const BuyComponentSolana = ({ onDismiss, bondAddress, bondChain, isProjectView,
|
|
|
80652
80705
|
const depositAmount = isZap ? zapDepositAmount : inputValue;
|
|
80653
80706
|
const youSpendString = `${formatNumber$1(inputValue)} ${getSymbol(inputToken, bondData === null || bondData === void 0 ? void 0 : bondData.chainId)} =
|
|
80654
80707
|
$${formatUSDNumber((parseFloat(inputValue) * (inputTokenPrice !== null && inputTokenPrice !== void 0 ? inputTokenPrice : 0)).toString())}`;
|
|
80655
|
-
const
|
|
80708
|
+
const exceedsRealMaxBuy = getMaxBuy(bondData, true).lte(getPayoutAmount(bondData, depositAmount, '0'));
|
|
80709
|
+
const exceedsSafeMaxBuy = getMaxBuy(bondData, false)
|
|
80710
|
+
.times(isZap ? 0.995 : 0.9995)
|
|
80711
|
+
.lte(getPayoutAmount(bondData, depositAmount, '0'));
|
|
80656
80712
|
const exceedsBalance = new BigNumber$1(inputCurrencyBalance !== null && inputCurrencyBalance !== void 0 ? inputCurrencyBalance : '0').lt(inputValue);
|
|
80657
80713
|
// Loading State - include zap loading
|
|
80658
80714
|
const [loadingTx, setLoadingTx] = useState(false);
|
|
@@ -80662,6 +80718,36 @@ const BuyComponentSolana = ({ onDismiss, bondAddress, bondChain, isProjectView,
|
|
|
80662
80718
|
setInputValue('');
|
|
80663
80719
|
setInputTokenString(newInputToken);
|
|
80664
80720
|
}, []);
|
|
80721
|
+
const handleMaxButton = () => {
|
|
80722
|
+
var _a, _b, _c, _d, _e;
|
|
80723
|
+
const balance = new BigNumber$1(inputCurrencyBalance !== null && inputCurrencyBalance !== void 0 ? inputCurrencyBalance : '0');
|
|
80724
|
+
const principalDecimals = (_c = (_b = (_a = bondData === null || bondData === void 0 ? void 0 : bondData.lpToken) === null || _a === void 0 ? void 0 : _a.decimals) === null || _b === void 0 ? void 0 : _b[bondData === null || bondData === void 0 ? void 0 : bondData.chainId]) !== null && _c !== void 0 ? _c : 18;
|
|
80725
|
+
const maxBuyAmount = getMaxBuy(bondData, SDKConfig.showLowValueBonds);
|
|
80726
|
+
if (!isZap) {
|
|
80727
|
+
const maxPossibleUserPurchase = getPayoutAmount(bondData, balance.toString(), '0');
|
|
80728
|
+
if (maxPossibleUserPurchase > maxBuyAmount.toNumber()) {
|
|
80729
|
+
console.log('user balance exceeds max buy limit, setting to max buy');
|
|
80730
|
+
const principalForMaxBuy = getPrincipalAmount(bondData, maxBuyAmount.toString(), '0');
|
|
80731
|
+
setInputValue(new BigNumber$1(principalForMaxBuy).toFixed(principalDecimals));
|
|
80732
|
+
}
|
|
80733
|
+
else {
|
|
80734
|
+
console.log('balance is ok, can be used');
|
|
80735
|
+
setInputValue(balance.toFixed(principalDecimals));
|
|
80736
|
+
}
|
|
80737
|
+
}
|
|
80738
|
+
else {
|
|
80739
|
+
const principalForMaxBuy = getPrincipalAmount(bondData, maxBuyAmount.toString(), '0');
|
|
80740
|
+
const principalForMaxBuyUSD = new BigNumber$1(principalForMaxBuy).times((_d = bondData === null || bondData === void 0 ? void 0 : bondData.principalTokenPrice) !== null && _d !== void 0 ? _d : 0);
|
|
80741
|
+
const maxBuyAmountInSelectedToken = principalForMaxBuyUSD.div(inputTokenPrice !== null && inputTokenPrice !== void 0 ? inputTokenPrice : 0);
|
|
80742
|
+
const decimals = (enrichedTokenData === null || enrichedTokenData === void 0 ? void 0 : enrichedTokenData.token) === 'NATIVE' ? 18 : ((_e = enrichedTokenData === null || enrichedTokenData === void 0 ? void 0 : enrichedTokenData.token.decimals[bondData === null || bondData === void 0 ? void 0 : bondData.chainId]) !== null && _e !== void 0 ? _e : 18);
|
|
80743
|
+
if (balance.gte(maxBuyAmountInSelectedToken)) {
|
|
80744
|
+
setInputValue(maxBuyAmountInSelectedToken.toFixed(decimals));
|
|
80745
|
+
}
|
|
80746
|
+
else {
|
|
80747
|
+
setInputValue(balance.toFixed(decimals));
|
|
80748
|
+
}
|
|
80749
|
+
}
|
|
80750
|
+
};
|
|
80665
80751
|
const handleBuyCallback = () => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
80666
80752
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
80667
80753
|
if (!accountSolana || !bondData || !inputValue || !inputToken || !bondData)
|
|
@@ -81118,7 +81204,7 @@ const BuyComponentSolana = ({ onDismiss, bondAddress, bondChain, isProjectView,
|
|
|
81118
81204
|
}
|
|
81119
81205
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
81120
81206
|
}, [inputCurrencyBalance, zapListFetched]);
|
|
81121
|
-
return bondData ? (jsx$2(Flex, { className: "modal-content", sx: Object.assign({}, MCBuyComponentStyles[bondData === null || bondData === void 0 ? void 0 : bondData.marketingCampaign]), children: jsxs(Flex, { className: "modaltable-container", children: [jsx$2(BondModalHeader, { bondData: bondData, onDismiss: onDismiss }), jsx$2(ProjectDescription, { description: bondData.shortDescription, isProjectView: true }), jsx$2(Flex, { sx: { width: '100%', display: isProjectView ? ['flex', 'flex', 'flex', 'none'] : 'flex' }, children: jsx$2(BondCards, { bondData: bondData }) }), jsx$2(Estimations, { depositAmount: depositAmount, bondData: bondData, youSpendString: youSpendString, isZap: isZap, fetchingZapQuote: fetchingZapQuote, zapError: zapError }), jsx$2(TokenSelectorPanel, { typedValue: inputValue, setTypedValue: setInputValue, selectedToken: inputToken, handleValueBtn:
|
|
81207
|
+
return bondData ? (jsx$2(Flex, { className: "modal-content", sx: Object.assign({}, MCBuyComponentStyles[bondData === null || bondData === void 0 ? void 0 : bondData.marketingCampaign]), children: jsxs(Flex, { className: "modaltable-container", children: [jsx$2(BondModalHeader, { bondData: bondData, onDismiss: onDismiss }), jsx$2(ProjectDescription, { description: bondData.shortDescription, isProjectView: true }), jsx$2(Flex, { sx: { width: '100%', display: isProjectView ? ['flex', 'flex', 'flex', 'none'] : 'flex' }, children: jsx$2(BondCards, { bondData: bondData, isDoingMaxBuy: exceedsSafeMaxBuy && !exceedsRealMaxBuy }) }), jsx$2(Estimations, { depositAmount: depositAmount, bondData: bondData, youSpendString: youSpendString, isZap: isZap, fetchingZapQuote: fetchingZapQuote, zapError: zapError }), jsx$2(TokenSelectorPanel, { typedValue: inputValue, setTypedValue: setInputValue, selectedToken: inputToken, handleValueBtn: handleMaxButton, handleCurrencySelect: handleCurrencySelect, bondChainId: bondData === null || bondData === void 0 ? void 0 : bondData.chainId, enableZap: true, bondPrincipalToken: bondData === null || bondData === void 0 ? void 0 : bondData.lpToken, tokenBalance: inputCurrencyBalance !== null && inputCurrencyBalance !== void 0 ? inputCurrencyBalance : undefined, selectedTokenPrice: inputTokenPrice }), (bondData === null || bondData === void 0 ? void 0 : bondData.warningCard) && (jsx$2(Flex, { sx: {
|
|
81122
81208
|
width: '100%',
|
|
81123
81209
|
background: '#DE62F366',
|
|
81124
81210
|
justifyContent: 'center',
|
|
@@ -81128,20 +81214,20 @@ const BuyComponentSolana = ({ onDismiss, bondAddress, bondChain, isProjectView,
|
|
|
81128
81214
|
}, children: jsxs(Text, { sx: { fontSize: '12px', fontWeight: 400, display: 'flex', alignItems: 'center', gap: '10px' }, children: [jsx$2(SafeHTMLComponent, { html: bondData === null || bondData === void 0 ? void 0 : bondData.warningCard }), (bondData === null || bondData === void 0 ? void 0 : bondData.chainId) === main.ChainId.SONIC && (bondData === null || bondData === void 0 ? void 0 : bondData.earnToken.symbol.toLowerCase()) === 'moon' && (jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Text, { sx: { textTransform: 'none' }, children: "Open the 'cog' icon menu in the top right and set the Slippage Tolerance to 5% or more." }), width: "315px", placement: "topRight", transformTip: "translate(9%, -10%)", children: jsx$2(Svg, { icon: "questionCircle", width: 14, color: "textDisabledButton" }) }))] }) })), jsx$2(Flex, { className: "modaltable-container button-container", children: jsx$2(Flex, { className: "button-container buy", children: !accountSolana ? (jsx$2(ConnectSolanaWallet, {})) : (jsxs(Flex, { sx: { width: '100%', gap: '10px', flexDirection: ['column', 'column', 'column', 'row'] }, children: [jsxs(Button, { variant: "secondary", onClick: () => {
|
|
81129
81215
|
var _a, _b;
|
|
81130
81216
|
return window.open(`https://jumper.exchange/?fromChain=1151111081099710&fromToken=11111111111111111111111111111111&toChain=1151111081099710&toToken=${(_b = (_a = bondData === null || bondData === void 0 ? void 0 : bondData.lpToken) === null || _a === void 0 ? void 0 : _a.address) === null || _b === void 0 ? void 0 : _b[bondData === null || bondData === void 0 ? void 0 : bondData.chainId]}`, '_blank', 'noopener noreferrer');
|
|
81131
|
-
}, sx: { width: ['100%', '100%', '100%', '35%'] }, children: ["get ", (_f = bondData === null || bondData === void 0 ? void 0 : bondData.lpToken) === null || _f === void 0 ? void 0 : _f.symbol] }), jsx$2(Button, { className: "action-button", load: load, disabled: load ||
|
|
81217
|
+
}, sx: { width: ['100%', '100%', '100%', '35%'], fontSize: ['14px', '14px', '14px', '16px'] }, children: ["get ", (_f = bondData === null || bondData === void 0 ? void 0 : bondData.lpToken) === null || _f === void 0 ? void 0 : _f.symbol] }), jsx$2(Button, { className: "action-button", load: load, disabled: load ||
|
|
81132
81218
|
(bondData === null || bondData === void 0 ? void 0 : bondData.soldOut) ||
|
|
81133
81219
|
!accountSolana ||
|
|
81134
81220
|
!inputValue ||
|
|
81135
81221
|
parseFloat(inputValue) === 0 ||
|
|
81136
81222
|
fetchingZapQuote ||
|
|
81137
81223
|
zapError ||
|
|
81138
|
-
|
|
81224
|
+
exceedsRealMaxBuy ||
|
|
81139
81225
|
exceedsBalance ||
|
|
81140
81226
|
(isZap && !jupiterQuote) ||
|
|
81141
|
-
SDKConfig.blockSales, onClick: handleOpenModal, sx: { width: ['100%', '100%', '100%', '65%'] }, children: SDKConfig.blockSales
|
|
81227
|
+
SDKConfig.blockSales, onClick: handleOpenModal, sx: { width: ['100%', '100%', '100%', '65%'], fontSize: ['14px', '14px', '14px', '16px'] }, children: SDKConfig.blockSales
|
|
81142
81228
|
? 'Complete KYC to Buy'
|
|
81143
|
-
:
|
|
81144
|
-
? 'Exceeds Max Buy'
|
|
81229
|
+
: exceedsRealMaxBuy
|
|
81230
|
+
? 'Exceeds Max Buy. Reduce amount'
|
|
81145
81231
|
: exceedsBalance
|
|
81146
81232
|
? 'Insufficient balance'
|
|
81147
81233
|
: zapError
|
|
@@ -81241,7 +81327,7 @@ const ModalHandler = ({ onDismiss, bondAddress, bondChain, }) => {
|
|
|
81241
81327
|
};
|
|
81242
81328
|
|
|
81243
81329
|
const ParticipationSuccessful = ({ onDismiss, bond, inputAmount, }) => {
|
|
81244
|
-
var _a, _b, _c, _d, _e, _f, _g
|
|
81330
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
81245
81331
|
const { data: tokenPrices } = useTokenPrices();
|
|
81246
81332
|
const principalTokenPrice = (_b = (_a = tokenPrices === null || tokenPrices === void 0 ? void 0 : tokenPrices[bond === null || bond === void 0 ? void 0 : bond.chainId]) === null || _a === void 0 ? void 0 : _a.find((token) => { var _a, _b, _c; return ((_a = token === null || token === void 0 ? void 0 : token.tokenAddress) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ((_c = (_b = bond === null || bond === void 0 ? void 0 : bond.lpToken) === null || _b === void 0 ? void 0 : _b.address[bond === null || bond === void 0 ? void 0 : bond.chainId]) === null || _c === void 0 ? void 0 : _c.toLowerCase()); })) === null || _b === void 0 ? void 0 : _b.price;
|
|
81247
81333
|
const inputValue = parseFloat(inputAmount !== null && inputAmount !== void 0 ? inputAmount : '0');
|
|
@@ -81287,7 +81373,7 @@ const ParticipationSuccessful = ({ onDismiss, bond, inputAmount, }) => {
|
|
|
81287
81373
|
}, children: [getFirstNonZeroDigits(initialReleaseAmount, 2), " ", bond === null || bond === void 0 ? void 0 : bond.earnToken.symbol, jsxs(Flex, { sx: {
|
|
81288
81374
|
color: 'textDisabledButton',
|
|
81289
81375
|
ml: '5px',
|
|
81290
|
-
}, children: ["($", initialReleaseUsd.toFixed(2), ")"] })] })] }), initialRelease !== 1 && (jsxs(Flex, { sx: { width: '100%', justifyContent: 'space-between', mt: '5px' }, children: [jsxs(Flex, { sx: { fontSize: '12px', fontWeight: 400 }, children: ["Vested Tokens", jsx$2(TooltipBubble, { placement: 'bottomLeft', transformTip: 'translate(-6%, 0%)', width: "250px", body: jsx$2(Flex, { sx: { justifyContent: 'center' }, children: `Remaining tokens will vest linearly over ${getTimePeriods(
|
|
81376
|
+
}, children: ["($", initialReleaseUsd.toFixed(2), ")"] })] })] }), initialRelease !== 1 && (jsxs(Flex, { sx: { width: '100%', justifyContent: 'space-between', mt: '5px' }, children: [jsxs(Flex, { sx: { fontSize: '12px', fontWeight: 400 }, children: ["Vested Tokens", jsx$2(TooltipBubble, { placement: 'bottomLeft', transformTip: 'translate(-6%, 0%)', width: "250px", body: jsx$2(Flex, { sx: { justifyContent: 'center' }, children: `Remaining tokens will vest linearly over ${getTimePeriods(bond.vestingTerm).months} months after claiming the initial release.` }), children: jsx$2(Flex, { sx: { alignItems: 'center', height: '100%', ml: '5px' }, children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), jsxs(Flex, { sx: {
|
|
81291
81377
|
fontSize: '12px',
|
|
81292
81378
|
fontWeight: 500,
|
|
81293
81379
|
}, children: [getFirstNonZeroDigits(vestedAmount, 2), " ", bond === null || bond === void 0 ? void 0 : bond.earnToken.symbol, jsxs(Flex, { sx: { color: 'textDisabledButton', ml: '5px' }, children: ["($", vestedAmountUsd.toFixed(2), ")"] })] })] })), jsx$2(Flex, { sx: { mt: '10px' }, children: `Your purchased bond can be found under the "Your Bonds" tab.` })] }), jsx$2(Button, { onClick: onDismiss, sx: { fontSize: '16px', width: '100%', mt: '15px' }, children: "Close" })] })] }));
|
|
@@ -81339,7 +81425,7 @@ function formatUTCDate(date, short = false) {
|
|
|
81339
81425
|
}
|
|
81340
81426
|
|
|
81341
81427
|
const BondCardsPreTGE = ({ bond }) => {
|
|
81342
|
-
var _a, _b, _c, _d, _e, _f
|
|
81428
|
+
var _a, _b, _c, _d, _e, _f;
|
|
81343
81429
|
const isMobile = useIsMobile();
|
|
81344
81430
|
const bonus = (_b = (_a = bond === null || bond === void 0 ? void 0 : bond.trueBondPrices) === null || _a === void 0 ? void 0 : _a[0].bonus) !== null && _b !== void 0 ? _b : 0;
|
|
81345
81431
|
const airdropBonus = (_c = bond.airdropBonus) !== null && _c !== void 0 ? _c : 0;
|
|
@@ -81386,7 +81472,7 @@ const BondCardsPreTGE = ({ bond }) => {
|
|
|
81386
81472
|
borderBottomRightRadius: 'normal',
|
|
81387
81473
|
borderBottomLeftRadius: 'normal',
|
|
81388
81474
|
},
|
|
81389
|
-
}, children: [jsxs("div", { className: "bond-card-title", children: ["Vesting Terms", initialRelease !== 100 && (jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsxs(Flex, { children: ["Remaining tokens will vest linearly over ", getTimePeriods(
|
|
81475
|
+
}, children: [jsxs("div", { className: "bond-card-title", children: ["Vesting Terms", initialRelease !== 100 && (jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsxs(Flex, { children: ["Remaining tokens will vest linearly over ", getTimePeriods(bond === null || bond === void 0 ? void 0 : bond.vestingTerm).months, " months after", ' ', formatUTCDate(new Date(parseInt((_e = bond.startVestingTimestamp) !== null && _e !== void 0 ? _e : '0') * 1000)), " UTC."] }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2("div", { className: "bond-card-tooltip", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) }))] }), initialRelease === 100 ? `0 D` : `${(_f = getTimePeriods(bond === null || bond === void 0 ? void 0 : bond.vestingTerm)) === null || _f === void 0 ? void 0 : _f.months} Mo`] })] }));
|
|
81390
81476
|
};
|
|
81391
81477
|
|
|
81392
81478
|
const BuyComponentPreTGE = ({ bondAddress, bondChain, onDismiss, handlePurchasedBond, }) => {
|
|
@@ -81588,8 +81674,7 @@ const styles$8 = {
|
|
|
81588
81674
|
};
|
|
81589
81675
|
|
|
81590
81676
|
const SmallRecommendationCard = ({ recommendation }) => {
|
|
81591
|
-
|
|
81592
|
-
const vestingTime = getTimePeriods((_a = recommendation.vestingTerm) !== null && _a !== void 0 ? _a : 0, true);
|
|
81677
|
+
const vestingTime = getTimePeriods(recommendation.vestingTerm, true);
|
|
81593
81678
|
return (jsxs(Flex, { sx: styles$8.smallCardContainer, onClick: () => window.open(`${window.location.origin}/bonds?bondAddress=${recommendation.contractAddress}&bondChain=${recommendation.chainId}`, '_self'), children: [jsxs(Flex, { sx: { alignItems: 'center' }, children: [jsx$2(TokenImage, { symbol: recommendation.payoutTokenName, size: 32, chain: recommendation.chainId }), jsxs(Flex, { sx: { mx: '10px', alignItems: 'center' }, children: [jsx$2(Flex, { sx: { fontSize: '14px', px: '6px' }, children: recommendation.payoutTokenName }), jsxs(Flex, { sx: styles$8.subTitle, children: [vestingTime.days, "D"] })] })] }), jsxs(Flex, { sx: { alignItems: 'center' }, children: [jsx$2(Flex, { sx: styles$8.subTitle, children: "Bonus" }), jsxs(Flex, { sx: { fontSize: '12px', color: recommendation.bonus > 0 ? 'success' : 'error', ml: '6px' }, children: [recommendation.bonus.toFixed(2), "%"] })] })] }));
|
|
81594
81679
|
};
|
|
81595
81680
|
|
|
@@ -81942,7 +82027,9 @@ const HotBondCard = ({ bond }) => {
|
|
|
81942
82027
|
},
|
|
81943
82028
|
});
|
|
81944
82029
|
};
|
|
81945
|
-
return (jsx$2(Flex, { sx: styles$7.desktopCard, className: "hot-bond-card", onClick: handleOpenModal, children: jsxs(Flex, { sx: { flexDirection: 'column', width: '100%' }, children: [jsxs(Flex, { sx: { width: '100%', height: '75px' }, children: [jsx$2(Flex, { sx: { width: '66.66%' }, children: jsx$2(TokenInfoAndName, { tokenSymbol: bond.earnToken.symbol, chain: bond.chainId, tag: (_d = bond.tags) === null || _d === void 0 ? void 0 : _d[0], isHotBond: true }) }), jsx$2(Flex, { className: "column column-tokenicons", sx: { width: '33.33% !important', justifyContent: 'center !important', alignItems: 'center' }, children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(BondInfoTooltip, { earnTokenContract: (_g = (_f = (_e = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _e === void 0 ? void 0 : _e.address) === null || _f === void 0 ? void 0 : _f[bond === null || bond === void 0 ? void 0 : bond.chainId]) !== null && _g !== void 0 ? _g : '', earnTokenSymbol: (_j = (_h = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _h === void 0 ? void 0 : _h.symbol) !== null && _j !== void 0 ? _j : '', bondContract: (_l = (_k = bond === null || bond === void 0 ? void 0 : bond.contractAddress) === null || _k === void 0 ? void 0 : _k[bond === null || bond === void 0 ? void 0 : bond.chainId]) !== null && _l !== void 0 ? _l : '', projectLink: bond === null || bond === void 0 ? void 0 : bond.projectLink, twitter: bond === null || bond === void 0 ? void 0 : bond.twitter, audit: bond === null || bond === void 0 ? void 0 : bond.audit, chain: bond === null || bond === void 0 ? void 0 : bond.chainId }), width: "205px", placement: "bottomRight", transformTip: "translate(11%, 0%)", children: jsx$2(Svg, { icon: "more", width: "20px" }) }) })] }), jsxs(Flex, { sx: { width: '100%', justifyContent: 'space-around' }, children: [jsxs(Flex, { sx: { flexDirection: 'column', alignItems: 'center', width: '100%' }, children: [jsx$2(Flex, { sx: { opacity: 0.6, fontSize: '12px', fontWeight: 400 }, children: "Bonus" }), jsx$2(Flex, { className: `${getDiscountColor(bonus)}`, sx: { width: '100%', justifyContent: 'center' }, children: bonus !== undefined ? (bonus < 0 ? '0%' : `${bonus === null || bonus === void 0 ? void 0 : bonus.toFixed(2)}%`) : '-' })] }), jsxs(Flex, { sx: { flexDirection: 'column', alignItems: 'center', width: '100%' }, children: [jsx$2(Flex, { sx: { opacity: 0.6, fontSize: '12px', fontWeight: 400, width: '100%', justifyContent: 'center' }, children: "ARR" }), jsx$2(Flex, { sx: { width: '100%', justifyContent: 'center' }, children: calculateARR(bond, SDKConfig.useTiers) })] }), jsxs(Flex, { sx: { flexDirection: 'column', alignItems: 'center', width: '100%' }, children: [jsx$2(Flex, { sx: { opacity: 0.6, fontSize: '12px', fontWeight: 400, width: '100%', justifyContent: 'center' }, children: "Terms" }), jsx$2(Flex, { sx: { width: '100%', justifyContent: 'center' }, children: ((_m =
|
|
82030
|
+
return (jsx$2(Flex, { sx: styles$7.desktopCard, className: "hot-bond-card", onClick: handleOpenModal, children: jsxs(Flex, { sx: { flexDirection: 'column', width: '100%' }, children: [jsxs(Flex, { sx: { width: '100%', height: '75px' }, children: [jsx$2(Flex, { sx: { width: '66.66%' }, children: jsx$2(TokenInfoAndName, { tokenSymbol: bond.earnToken.symbol, chain: bond.chainId, tag: (_d = bond.tags) === null || _d === void 0 ? void 0 : _d[0], isHotBond: true }) }), jsx$2(Flex, { className: "column column-tokenicons", sx: { width: '33.33% !important', justifyContent: 'center !important', alignItems: 'center' }, children: jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(BondInfoTooltip, { earnTokenContract: (_g = (_f = (_e = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _e === void 0 ? void 0 : _e.address) === null || _f === void 0 ? void 0 : _f[bond === null || bond === void 0 ? void 0 : bond.chainId]) !== null && _g !== void 0 ? _g : '', earnTokenSymbol: (_j = (_h = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _h === void 0 ? void 0 : _h.symbol) !== null && _j !== void 0 ? _j : '', bondContract: (_l = (_k = bond === null || bond === void 0 ? void 0 : bond.contractAddress) === null || _k === void 0 ? void 0 : _k[bond === null || bond === void 0 ? void 0 : bond.chainId]) !== null && _l !== void 0 ? _l : '', projectLink: bond === null || bond === void 0 ? void 0 : bond.projectLink, twitter: bond === null || bond === void 0 ? void 0 : bond.twitter, audit: bond === null || bond === void 0 ? void 0 : bond.audit, chain: bond === null || bond === void 0 ? void 0 : bond.chainId }), width: "205px", placement: "bottomRight", transformTip: "translate(11%, 0%)", children: jsx$2(Svg, { icon: "more", width: "20px" }) }) })] }), jsxs(Flex, { sx: { width: '100%', justifyContent: 'space-around' }, children: [jsxs(Flex, { sx: { flexDirection: 'column', alignItems: 'center', width: '100%' }, children: [jsx$2(Flex, { sx: { opacity: 0.6, fontSize: '12px', fontWeight: 400 }, children: "Bonus" }), jsx$2(Flex, { className: `${getDiscountColor(bonus)}`, sx: { width: '100%', justifyContent: 'center' }, children: bonus !== undefined ? (bonus < 0 ? '0%' : `${bonus === null || bonus === void 0 ? void 0 : bonus.toFixed(2)}%`) : '-' })] }), jsxs(Flex, { sx: { flexDirection: 'column', alignItems: 'center', width: '100%' }, children: [jsx$2(Flex, { sx: { opacity: 0.6, fontSize: '12px', fontWeight: 400, width: '100%', justifyContent: 'center' }, children: "ARR" }), jsx$2(Flex, { sx: { width: '100%', justifyContent: 'center' }, children: calculateARR(bond, SDKConfig.useTiers) })] }), jsxs(Flex, { sx: { flexDirection: 'column', alignItems: 'center', width: '100%' }, children: [jsx$2(Flex, { sx: { opacity: 0.6, fontSize: '12px', fontWeight: 400, width: '100%', justifyContent: 'center' }, children: "Terms" }), jsx$2(Flex, { sx: { width: '100%', justifyContent: 'center' }, children: ((_m = getTimePeriods(bond === null || bond === void 0 ? void 0 : bond.vestingTerm, true)) === null || _m === void 0 ? void 0 : _m.days)
|
|
82031
|
+
? `${(_o = getTimePeriods(bond === null || bond === void 0 ? void 0 : bond.vestingTerm, true)) === null || _o === void 0 ? void 0 : _o.days} D`
|
|
82032
|
+
: '-' })] })] })] }) }));
|
|
81946
82033
|
};
|
|
81947
82034
|
|
|
81948
82035
|
/**
|
|
@@ -87213,7 +87300,7 @@ const ActiveBondRows = ({ chain, bonds, hideTitles, showHotBonds }) => {
|
|
|
87213
87300
|
marginTop: '0px',
|
|
87214
87301
|
}, className: "bonds-card-container", children: [[main.ChainId.SOL, main.ChainId.MONAD].includes(chain) && !hideTitles && jsx$2(ChainBanner, { chainId: chain }), bonds === null || bonds === void 0 ? void 0 : bonds.map((bondFromMap, index) => {
|
|
87215
87302
|
// PRE TGE ROWS
|
|
87216
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w
|
|
87303
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
87217
87304
|
if (bondFromMap.billType === 'fcfs') {
|
|
87218
87305
|
const bond = bondFromMap;
|
|
87219
87306
|
const totalPrincipalBilled = Math.round(getBalanceNumber(new BigNumber$1((_a = bond === null || bond === void 0 ? void 0 : bond.totalPrincipalBilled) !== null && _a !== void 0 ? _a : '0'), (_c = (_b = bond === null || bond === void 0 ? void 0 : bond.lpToken) === null || _b === void 0 ? void 0 : _b.decimals) === null || _c === void 0 ? void 0 : _c[bond === null || bond === void 0 ? void 0 : bond.chainId])) / ((_d = bond.initPrice) !== null && _d !== void 0 ? _d : 0);
|
|
@@ -87235,14 +87322,14 @@ const ActiveBondRows = ({ chain, bonds, hideTitles, showHotBonds }) => {
|
|
|
87235
87322
|
? '-'
|
|
87236
87323
|
: initialRelease === 100
|
|
87237
87324
|
? `0 D`
|
|
87238
|
-
: `${getTimePeriods(
|
|
87325
|
+
: `${getTimePeriods(bond.vestingTerm).months} Mo`, projectURL: bond.projectLink, twitterURL: bond.twitter, auditURL: bond.audit, bondSoldOut: saleHasFinished, shortDescription: bond.shortDescription }, `${bond.contractAddress}-${bond.chainId}-${index}`));
|
|
87239
87326
|
}
|
|
87240
87327
|
else {
|
|
87241
87328
|
// POST TGE BONDS AKA NORMAL BONDS
|
|
87242
87329
|
const bond = bondFromMap;
|
|
87243
|
-
const bondAddress = (
|
|
87330
|
+
const bondAddress = (_u = bond === null || bond === void 0 ? void 0 : bond.contractAddress) === null || _u === void 0 ? void 0 : _u[bond === null || bond === void 0 ? void 0 : bond.chainId];
|
|
87244
87331
|
const remainingTokensString = getRemainingTokensString(bond);
|
|
87245
|
-
return (jsx$2(BondRow, { bondAddress: bondAddress, bondChain: bond.chainId, marketingCampaign: bond.marketingCampaign, payoutToken: bond.earnToken, billType: bond.billType, tag: (
|
|
87332
|
+
return (jsx$2(BondRow, { bondAddress: bondAddress, bondChain: bond.chainId, marketingCampaign: bond.marketingCampaign, payoutToken: bond.earnToken, billType: bond.billType, tag: (_v = bond.tags) === null || _v === void 0 ? void 0 : _v[0], trueBondPrices: namingPreference === 'Bonus' ? bond.trueBondPrices : undefined, minTier: bond === null || bond === void 0 ? void 0 : bond.minTier, vestingTermString: getVestingTermsString(bond), vestingCliffString: getVestingTermsTooltipString(bond), percentageAvailable: remainingPercentage(bond), remainingTokensString: remainingTokensString, projectURL: bond.projectLink, twitterURL: bond.twitter, auditURL: bond.audit, bonus: namingPreference === 'Discount' ? `${(_w = bond === null || bond === void 0 ? void 0 : bond.discountWithFee) === null || _w === void 0 ? void 0 : _w.toFixed(2)}%` : undefined, shortDescription: bond.shortDescription }, `${bondAddress}-${bond.chainId}-${index}`));
|
|
87246
87333
|
}
|
|
87247
87334
|
}), showHotBonds && (jsx$2(SwiperProvider, { children: jsx$2(HotBondCards, {}) }))] }, key))] }) }, key));
|
|
87248
87335
|
};
|