@ape.swap/bonds-sdk 3.0.34 → 3.0.35
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 +39 -10
- package/dist/styles.css +3 -18
- package/dist/utils/displayHelpers.d.ts +1 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -58384,11 +58384,13 @@ const getVestingTermsTooltipString = (bond) => {
|
|
|
58384
58384
|
const vestingCliffString = getTimePeriods(vestingCliff);
|
|
58385
58385
|
return `${vestingCliffString.days} days cliff + ${vestingTime.days} days linear vesting.`;
|
|
58386
58386
|
};
|
|
58387
|
-
const discountEarnTokenPrice = (bond) => {
|
|
58388
|
-
var _a, _b;
|
|
58389
|
-
const
|
|
58390
|
-
const
|
|
58391
|
-
|
|
58387
|
+
const discountEarnTokenPrice = (bond, useTiers) => {
|
|
58388
|
+
var _a, _b, _c;
|
|
58389
|
+
const fee = (_a = bond === null || bond === void 0 ? void 0 : bond.feeInPayout) !== null && _a !== void 0 ? _a : 0;
|
|
58390
|
+
const principalTokenPrice = parseFloat((_b = bond.principalTokenPrice) !== null && _b !== void 0 ? _b : '0');
|
|
58391
|
+
const trueBondPrice = (_c = findHighestTrueBondPrice(useTiers ? TIERS_WEIGHT[types.LaunchBondTiers.Legend] : '0', bond)) === null || _c === void 0 ? void 0 : _c.trueBondPrice;
|
|
58392
|
+
const trueBondPriceWithFee = getBalanceNumber(new BigNumber$1(trueBondPrice).times((100 + fee) / 100));
|
|
58393
|
+
return getFirstNonZeroDigits(principalTokenPrice * trueBondPriceWithFee);
|
|
58392
58394
|
};
|
|
58393
58395
|
const maxBuy = (bond) => {
|
|
58394
58396
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -70868,7 +70870,7 @@ const ButtonsRow = ({ projectLink, twitter, bubble, audit, chain }) => {
|
|
|
70868
70870
|
};
|
|
70869
70871
|
|
|
70870
70872
|
const ExpandedViewButton = ({ handleNavigation, rightPos }) => {
|
|
70871
|
-
return (jsx$2(Flex, { sx: { justifyContent: 'flex-end', position: 'absolute', top: '6px', right: rightPos !== null && rightPos !== void 0 ? rightPos : '
|
|
70873
|
+
return (jsx$2(Flex, { sx: { justifyContent: 'flex-end', position: 'absolute', top: '6px', right: rightPos !== null && rightPos !== void 0 ? rightPos : '35px', width: '122px' }, children: jsxs(Flex, { sx: {
|
|
70872
70874
|
fontSize: '12px',
|
|
70873
70875
|
fontWeight: 500,
|
|
70874
70876
|
mr: '15px',
|
|
@@ -71531,7 +71533,7 @@ const ClaimAll = () => {
|
|
|
71531
71533
|
fontWeight: 600,
|
|
71532
71534
|
width: '100%',
|
|
71533
71535
|
opacity: 1,
|
|
71534
|
-
ml: '10px',
|
|
71536
|
+
ml: ['10px', '10px', '10px', '0'],
|
|
71535
71537
|
}, children: "Claim All" }));
|
|
71536
71538
|
};
|
|
71537
71539
|
|
|
@@ -76247,13 +76249,14 @@ const BondModalMinTierHeader = ({ minTier }) => {
|
|
|
76247
76249
|
width: ['100%', '100%', '100%', 'auto', 'auto'],
|
|
76248
76250
|
}, children: Object.values(TIERS_NAMES).map((tier, index) => {
|
|
76249
76251
|
if (index >= minTier) {
|
|
76250
|
-
return (jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { sx: { justifyContent: 'center' }, children: tier }), width: "100px", placement: "bottomLeft", transformTip: "translate(1%, -5%)", children: jsx$2("img", { src: `/images/launch/${tier.toLowerCase()}.png`, alt: "minTier", style: { width: '
|
|
76252
|
+
return (jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { sx: { justifyContent: 'center' }, children: tier }), width: "100px", placement: "bottomLeft", transformTip: "translate(1%, -5%)", children: jsx$2("img", { src: `/images/launch/${tier.toLowerCase()}.png`, alt: "minTier", style: { width: '25px', height: '25px', marginLeft: '3px', zIndex: 1 } }, `tier-logo-${index}`) }, tier));
|
|
76251
76253
|
}
|
|
76252
76254
|
}) })) }));
|
|
76253
76255
|
};
|
|
76254
76256
|
|
|
76255
76257
|
const BondModalHeader = ({ bondData, onDismiss, showProjectInfoButton, }) => {
|
|
76256
76258
|
var _a, _b;
|
|
76259
|
+
const SDKConfig = useSDKConfig();
|
|
76257
76260
|
const [onOpenSlippageModal] = useModal(jsx$2(SlippageModal, {}));
|
|
76258
76261
|
const minTier = bondData.minTier !== undefined ? bondData.minTier : null;
|
|
76259
76262
|
const handleClose = () => {
|
|
@@ -76274,7 +76277,32 @@ const BondModalHeader = ({ bondData, onDismiss, showProjectInfoButton, }) => {
|
|
|
76274
76277
|
},
|
|
76275
76278
|
});
|
|
76276
76279
|
};
|
|
76277
|
-
return (jsxs(Flex, { className: "modaltable-container title-container", sx: { flexDirection: 'column', justifyContent: 'center', alignItems: 'start' }, children: [jsxs(Flex, {
|
|
76280
|
+
return (jsxs(Flex, { className: "modaltable-container title-container", sx: { flexDirection: 'column', justifyContent: 'center', alignItems: 'start' }, children: [jsxs(Flex, { sx: {
|
|
76281
|
+
width: '100%',
|
|
76282
|
+
height: '30px',
|
|
76283
|
+
mb: ['10px', '10px', '10px', '0px'],
|
|
76284
|
+
justifyContent: ['space-between', 'space-between', 'space-between', 'flex-end'],
|
|
76285
|
+
}, children: [jsx$2(Flex, { sx: { display: ['flex', 'flex', 'flex', 'none'] }, children: jsx$2(BondModalMinTierHeader, { minTier: minTier }) }), jsx$2(Flex, { sx: { cursor: 'pointer' }, children: onDismiss ? (jsxs(Fragment$1, { children: [showProjectInfoButton && jsx$2(ExpandedViewButton, { handleNavigation: handleProjectViewNavigation }), jsx$2(Flex, { sx: { mx: '10px' }, onClick: onOpenSlippageModal, children: jsx$2(Svg, { icon: "cog", width: "16px" }) }), jsx$2(Flex, { onClick: handleClose, children: jsx$2(Svg, { icon: "close", color: "text" }) })] })) : (jsx$2(Flex, { sx: { py: '3px', mt: '10px' }, onClick: onOpenSlippageModal, children: jsx$2(Svg, { icon: "cog", width: "16px" }) })) })] }), jsxs(Flex, { sx: { width: '100%' }, children: [jsx$2(Flex, { className: "title-container bondicon", children: jsx$2(TokenImage, { symbol: (_a = bondData.showcaseTokenName) !== null && _a !== void 0 ? _a : bondData.earnToken.symbol, size: 50, chain: bondData.chainId }) }), jsxs(Flex, { className: "title-container bondname", children: [bondData === null || bondData === void 0 ? void 0 : bondData.showcaseTokenName, jsx$2(ListTag, { text: (_b = bondData === null || bondData === void 0 ? void 0 : bondData.tags) === null || _b === void 0 ? void 0 : _b[0] })] }), jsxs(Flex, { className: "title-container price-container", sx: { flexDirection: 'column', pl: '20px' }, children: [jsxs(Flex, { className: "price-container price", children: ["$", earnTokenPrice(bondData)] }), SDKConfig.useTiers ? (jsxs(Flex, { sx: {
|
|
76286
|
+
p: '3px 6px',
|
|
76287
|
+
border: '1px solid var(--theme-ui-colors-primaryButton)',
|
|
76288
|
+
borderRadius: 'normal',
|
|
76289
|
+
background: 'transparent',
|
|
76290
|
+
position: 'relative',
|
|
76291
|
+
overflow: 'hidden',
|
|
76292
|
+
}, children: [jsx$2(Flex, { sx: {
|
|
76293
|
+
position: 'absolute',
|
|
76294
|
+
width: '100%',
|
|
76295
|
+
height: '100%',
|
|
76296
|
+
top: 0,
|
|
76297
|
+
left: 0,
|
|
76298
|
+
zIndex: 1,
|
|
76299
|
+
background: 'primaryButton',
|
|
76300
|
+
opacity: 0.3,
|
|
76301
|
+
} }), jsxs(Flex, { sx: { width: '100%', zIndex: 2, alignItems: 'center' }, children: [jsx$2("img", { src: `/images/launch/legend.png`, alt: "minTier", style: { width: '21px', height: '21px', marginRight: '3px', zIndex: 1 } }), jsx$2(Flex, { sx: { fontSize: '14px', mr: '3px' }, children: "Up to" }), jsxs(Flex, { sx: {
|
|
76302
|
+
color: findHighestTrueBondPrice(TIERS_WEIGHT[types.LaunchBondTiers.Legend], bondData).bonusWithFee > 0
|
|
76303
|
+
? 'success'
|
|
76304
|
+
: 'error',
|
|
76305
|
+
}, children: ["$", discountEarnTokenPrice(bondData, true)] })] })] })) : (jsxs(Flex, { sx: { fontSize: '24px', fontWeight: 700 }, children: ["$", discountEarnTokenPrice(bondData)] }))] }), jsx$2(Flex, { sx: { display: ['none', 'none', 'none', 'flex'], ml: '10px' }, children: jsx$2(BondModalMinTierHeader, { minTier: minTier }) })] })] }));
|
|
76278
76306
|
};
|
|
76279
76307
|
|
|
76280
76308
|
const YouTooltip = () => {
|
|
@@ -77725,7 +77753,7 @@ const SelectItem = (_a) => {
|
|
|
77725
77753
|
};
|
|
77726
77754
|
|
|
77727
77755
|
const ListTag = ({ text = '' }) => {
|
|
77728
|
-
return (jsx$2(Flex, {
|
|
77756
|
+
return (jsx$2(Flex, { sx: {
|
|
77729
77757
|
background: '#3C6AB530',
|
|
77730
77758
|
color: '#3b78d3',
|
|
77731
77759
|
fontSize: '10px',
|
|
@@ -77734,6 +77762,7 @@ const ListTag = ({ text = '' }) => {
|
|
|
77734
77762
|
p: '2px 6px',
|
|
77735
77763
|
borderRadius: '5px',
|
|
77736
77764
|
ml: '5px',
|
|
77765
|
+
width: 'fit-content',
|
|
77737
77766
|
}, children: text }));
|
|
77738
77767
|
};
|
|
77739
77768
|
|
package/dist/styles.css
CHANGED
|
@@ -169,14 +169,6 @@
|
|
|
169
169
|
flex-direction: column;
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
-
.modaltable-container.title-container {
|
|
173
|
-
width: 100%;
|
|
174
|
-
font-weight: bold;
|
|
175
|
-
font-size: 1.5rem;
|
|
176
|
-
display: flex;
|
|
177
|
-
align-items: center;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
172
|
.title-container.bondicon {
|
|
181
173
|
display: flex;
|
|
182
174
|
flex-direction: row;
|
|
@@ -219,8 +211,9 @@
|
|
|
219
211
|
.title-container.bondname {
|
|
220
212
|
display: flex;
|
|
221
213
|
flex-direction: column;
|
|
222
|
-
align-items: center;
|
|
223
214
|
padding-left: 20px;
|
|
215
|
+
font-size: 24px;
|
|
216
|
+
font-weight: 700;
|
|
224
217
|
}
|
|
225
218
|
|
|
226
219
|
.title-container.bondname-small {
|
|
@@ -234,11 +227,7 @@
|
|
|
234
227
|
font-size: 14px;
|
|
235
228
|
text-decoration: line-through;
|
|
236
229
|
opacity: 0.5;
|
|
237
|
-
font-weight:
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
.price-container.discounted {
|
|
241
|
-
display: flex;
|
|
230
|
+
font-weight: 400;
|
|
242
231
|
}
|
|
243
232
|
|
|
244
233
|
.title-container.tokentags {
|
|
@@ -713,10 +702,6 @@ span.flex-inline {
|
|
|
713
702
|
.bond-row.gold-rush {
|
|
714
703
|
background: linear-gradient(90deg, rgba(227, 164, 85, 0.6) 7%, rgba(103, 61, 34, 0.6) 18%, rgba(246, 219, 166, 0.6) 36%, rgba(255, 235, 195, 0.6) 43%, rgba(240, 190, 121, 0.6) 53%, rgba(238, 188, 112, 0.6) 77%, rgba(63, 31, 15, 0.6) 92%), linear-gradient(0deg, #FFAE00 0%, #FFAE00 100%), var(--Neutral-Elevation-1, #161420);
|
|
715
704
|
}
|
|
716
|
-
.bond-row.gold-rush .list-tag {
|
|
717
|
-
color: white;
|
|
718
|
-
background: linear-gradient(99.09deg, #A16552 0%, #FFB300 106.96%);
|
|
719
|
-
}
|
|
720
705
|
.bond-row.gold-rush .gold-ribbon {
|
|
721
706
|
display: block;
|
|
722
707
|
}
|
|
@@ -19,7 +19,7 @@ export declare const vestingTimeRemainingString: (userBill?: UserBill) => string
|
|
|
19
19
|
export declare const getPendingVestingString: (bond?: UserBill) => string;
|
|
20
20
|
export declare const getVestingTermsString: (bond?: BondsData | BillsConfig) => string;
|
|
21
21
|
export declare const getVestingTermsTooltipString: (bond?: BondsData | BillsConfig) => string;
|
|
22
|
-
export declare const discountEarnTokenPrice: (bond: BondsData) => string;
|
|
22
|
+
export declare const discountEarnTokenPrice: (bond: BondsData, useTiers?: boolean) => string;
|
|
23
23
|
export declare const maxBuy: (bond: BondsData) => BigNumber;
|
|
24
24
|
export declare function formatNumber(input: string): string;
|
|
25
25
|
export declare function formatUSDNumber(input: string): string;
|