@ape.swap/bonds-sdk 3.0.90 → 3.0.92
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 +62 -54
- package/dist/views/Bonds/components/BondRows/BondRow.d.ts +1 -0
- package/dist/views/Bonds/components/BonusComponents/BonusComponent.d.ts +2 -1
- package/dist/views/Bonds/components/BonusComponents/BonusContainer.d.ts +2 -1
- package/package.json +2 -2
- package/dist/views/Bonds/components/BonusComponents/PreTGEBonusTable.d.ts +0 -6
package/dist/main.js
CHANGED
|
@@ -22499,6 +22499,7 @@ const SoulZapTokenManager = {
|
|
|
22499
22499
|
[types.ChainId.AVAX]: '0xC4dE46cBE21400dabE2E7c66E04F43acE4b5b910',
|
|
22500
22500
|
[types.ChainId.BLAST]: '0xde9Eb844AD9e8B067309205707e2fFaA6a049cc0',
|
|
22501
22501
|
[types.ChainId.BERACHAIN]: '0xcFd581f15433899d093ca1ADfc3aC13c37DBfbe7',
|
|
22502
|
+
[types.ChainId.SONIC]: '0x70005da62e17041977f7f99f91098b125ccde1a7',
|
|
22502
22503
|
};
|
|
22503
22504
|
const ACF_TO_ABOND = '0xEce2b9C3704632Ce760271B0b84E3A4A698Ca962';
|
|
22504
22505
|
const LENS_CONTRACT = {
|
|
@@ -58352,7 +58353,7 @@ const stagingUrls = {
|
|
|
58352
58353
|
};
|
|
58353
58354
|
const useSDKConfig = (config) => {
|
|
58354
58355
|
const urls = process.env.NODE_ENV === 'production' ? defaultUrls : stagingUrls;
|
|
58355
|
-
const initialData = Object.assign(Object.assign({ referenceId: '', chains: [], useHotBonds: true, useRainbowKit: false, useTiers: false, useTGEBonds: false, showLowValueBonds: false, bondPartner: undefined }, config), { urls: Object.assign(Object.assign({}, urls), config === null || config === void 0 ? void 0 : config.urls), highestCompatibleVersion: '2.1.
|
|
58356
|
+
const initialData = Object.assign(Object.assign({ referenceId: '', chains: [], useHotBonds: true, useRainbowKit: false, useTiers: false, useTGEBonds: false, showLowValueBonds: false, bondPartner: undefined }, config), { urls: Object.assign(Object.assign({}, urls), config === null || config === void 0 ? void 0 : config.urls), highestCompatibleVersion: '2.1.3' });
|
|
58356
58357
|
const { data } = useQuery({
|
|
58357
58358
|
queryKey: [QUERY_KEYS.SDK_CONFIG],
|
|
58358
58359
|
initialData,
|
|
@@ -78482,7 +78483,7 @@ const ZapModal = ({ onDismiss, outputToken, account, chainId }) => {
|
|
|
78482
78483
|
};
|
|
78483
78484
|
|
|
78484
78485
|
const useSoulZapBondQuote = (typedValue, inputCurrency, bond, account, tierProofSig) => {
|
|
78485
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11;
|
|
78486
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13;
|
|
78486
78487
|
const debouncedInput = useDebounce(typedValue, 400);
|
|
78487
78488
|
const [slippage] = useSlippage();
|
|
78488
78489
|
const principalToken = bond === null || bond === void 0 ? void 0 : bond.lpToken;
|
|
@@ -78493,12 +78494,12 @@ const useSoulZapBondQuote = (typedValue, inputCurrency, bond, account, tierProof
|
|
|
78493
78494
|
const principalContractAddress = principalToken === null || principalToken === void 0 ? void 0 : principalToken.address[chainId];
|
|
78494
78495
|
const chainName = getChainParam(chainId);
|
|
78495
78496
|
const isReserveBond = (bond === null || bond === void 0 ? void 0 : bond.billType) === 'reserve' || (bond === null || bond === void 0 ? void 0 : bond.billType) === 'staking';
|
|
78496
|
-
const liquidityDex = (_a = principalToken === null || principalToken === void 0 ? void 0 : principalToken.
|
|
78497
|
-
const protocol = (
|
|
78497
|
+
const liquidityDex = (_b = (_a = principalToken === null || principalToken === void 0 ? void 0 : principalToken.liquiditySource) === null || _a === void 0 ? void 0 : _a[chainId]) !== null && _b !== void 0 ? _b : (_c = principalToken === null || principalToken === void 0 ? void 0 : principalToken.liquidityDex) === null || _c === void 0 ? void 0 : _c[chainId];
|
|
78498
|
+
const protocol = (_e = (_d = types.dexFactories[chainId]) === null || _d === void 0 ? void 0 : _d[liquidityDex]) === null || _e === void 0 ? void 0 : _e.protocol;
|
|
78498
78499
|
const lpType = isReserveBond ? 'single' : getLpType(protocol);
|
|
78499
78500
|
const ichiUnderlyingDex = principalToken === null || principalToken === void 0 ? void 0 : principalToken.ichiUnderlyingDex;
|
|
78500
|
-
const vault = (
|
|
78501
|
-
const router = (
|
|
78501
|
+
const vault = (_f = principalToken === null || principalToken === void 0 ? void 0 : principalToken.address) === null || _f === void 0 ? void 0 : _f[chainId];
|
|
78502
|
+
const router = (_h = (_g = types.dexFactories[chainId]) === null || _g === void 0 ? void 0 : _g[liquidityDex]) === null || _h === void 0 ? void 0 : _h.router;
|
|
78502
78503
|
// Validates that the user did not pass an amount with 19 decimals or more
|
|
78503
78504
|
const validated18DecimalAmount = new BigNumber$1(debouncedInput !== null && debouncedInput !== void 0 ? debouncedInput : '0').toFixed(18, 5);
|
|
78504
78505
|
const bigishInputAmount = new BigNumber$1(validated18DecimalAmount !== null && validated18DecimalAmount !== void 0 ? validated18DecimalAmount : '0')
|
|
@@ -78586,29 +78587,29 @@ const useSoulZapBondQuote = (typedValue, inputCurrency, bond, account, tierProof
|
|
|
78586
78587
|
const zapError = !!error;
|
|
78587
78588
|
const tokenList = zapInputTokens[chainId] ? zapInputTokens[chainId] : [];
|
|
78588
78589
|
// toToken0 data
|
|
78589
|
-
const toToken0Estimate = (
|
|
78590
|
-
const toToken0 = (
|
|
78590
|
+
const toToken0Estimate = (_k = (_j = response === null || response === void 0 ? void 0 : response.lpQuote) === null || _j === void 0 ? void 0 : _j.token0) === null || _k === void 0 ? void 0 : _k.fromAmountEstimate;
|
|
78591
|
+
const toToken0 = (_l = [...tokenList, principalToken]) === null || _l === void 0 ? void 0 : _l.find((token) => { var _a, _b, _c, _d, _e; return ((_b = (_a = token === null || token === void 0 ? void 0 : token.address) === null || _a === void 0 ? void 0 : _a[chainId]) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === ((_e = (_d = (_c = response === null || response === void 0 ? void 0 : response.lpQuote) === null || _c === void 0 ? void 0 : _c.token0) === null || _d === void 0 ? void 0 : _d.address) === null || _e === void 0 ? void 0 : _e.toLowerCase()); });
|
|
78591
78592
|
const toToken0Price = useCurrencyPrice(toToken0 !== null && toToken0 !== void 0 ? toToken0 : null, chainId);
|
|
78592
78593
|
// toToken1 data
|
|
78593
|
-
const toToken1Estimate = (
|
|
78594
|
-
const toToken1 = (
|
|
78594
|
+
const toToken1Estimate = (_o = (_m = response === null || response === void 0 ? void 0 : response.lpQuote) === null || _m === void 0 ? void 0 : _m.token1) === null || _o === void 0 ? void 0 : _o.fromAmountEstimate;
|
|
78595
|
+
const toToken1 = (_p = zapInputTokens[chainId]) === null || _p === void 0 ? void 0 : _p.find((token) => { var _a, _b, _c, _d; return ((_a = token.address[chainId]) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ((_d = (_c = (_b = response === null || response === void 0 ? void 0 : response.lpQuote) === null || _b === void 0 ? void 0 : _b.token1) === null || _c === void 0 ? void 0 : _c.address) === null || _d === void 0 ? void 0 : _d.toLowerCase()); });
|
|
78595
78596
|
const toToken1Price = useCurrencyPrice(toToken1 !== null && toToken1 !== void 0 ? toToken1 : null, chainId);
|
|
78596
|
-
let toToken0USD = (
|
|
78597
|
-
) === null ||
|
|
78598
|
-
if ((
|
|
78599
|
-
toToken0USD = new BigNumber$1((
|
|
78597
|
+
let toToken0USD = (_s = (_q = new BigNumber$1(toToken0Estimate !== null && toToken0Estimate !== void 0 ? toToken0Estimate : '0')) === null || _q === void 0 ? void 0 : _q.div(new BigNumber$1(10).pow((_r = toToken0 === null || toToken0 === void 0 ? void 0 : toToken0.decimals[chainId]) !== null && _r !== void 0 ? _r : 18)) // this is amount of swap output
|
|
78598
|
+
) === null || _s === void 0 ? void 0 : _s.times(new BigNumber$1((_t = toToken0Price === null || toToken0Price === void 0 ? void 0 : toToken0Price.price) !== null && _t !== void 0 ? _t : 0)); // convert it to usd price
|
|
78599
|
+
if ((_v = (_u = response === null || response === void 0 ? void 0 : response.lpQuote) === null || _u === void 0 ? void 0 : _u.token0) === null || _v === void 0 ? void 0 : _v.fromAmountUSD) {
|
|
78600
|
+
toToken0USD = new BigNumber$1((_x = (_w = response === null || response === void 0 ? void 0 : response.lpQuote) === null || _w === void 0 ? void 0 : _w.token0) === null || _x === void 0 ? void 0 : _x.fromAmountUSD);
|
|
78600
78601
|
}
|
|
78601
|
-
let toToken1USD = (
|
|
78602
|
-
) === null ||
|
|
78603
|
-
if ((
|
|
78604
|
-
toToken1USD = new BigNumber$1((
|
|
78602
|
+
let toToken1USD = (_0 = (_y = new BigNumber$1(toToken1Estimate !== null && toToken1Estimate !== void 0 ? toToken1Estimate : '0')) === null || _y === void 0 ? void 0 : _y.div(new BigNumber$1(10).pow((_z = toToken1 === null || toToken1 === void 0 ? void 0 : toToken1.decimals[chainId]) !== null && _z !== void 0 ? _z : 18)) // this is amount of swap output
|
|
78603
|
+
) === null || _0 === void 0 ? void 0 : _0.times(new BigNumber$1((_1 = toToken1Price === null || toToken1Price === void 0 ? void 0 : toToken1Price.price) !== null && _1 !== void 0 ? _1 : 0)); // convert it to usd price
|
|
78604
|
+
if ((_3 = (_2 = response === null || response === void 0 ? void 0 : response.lpQuote) === null || _2 === void 0 ? void 0 : _2.token1) === null || _3 === void 0 ? void 0 : _3.fromAmountUSD) {
|
|
78605
|
+
toToken1USD = new BigNumber$1((_5 = (_4 = response === null || response === void 0 ? void 0 : response.lpQuote) === null || _4 === void 0 ? void 0 : _4.token1) === null || _5 === void 0 ? void 0 : _5.fromAmountUSD);
|
|
78605
78606
|
}
|
|
78606
78607
|
const youSpendUSD = toToken0USD.plus(toToken1USD); // youSpendUSD
|
|
78607
|
-
const estimatedDepositAmount = youSpendUSD.div((
|
|
78608
|
+
const estimatedDepositAmount = youSpendUSD.div((_6 = bond === null || bond === void 0 ? void 0 : bond.principalTokenPrice) !== null && _6 !== void 0 ? _6 : '0');
|
|
78608
78609
|
const isWrap = inputCurrency === 'NATIVE' &&
|
|
78609
|
-
((
|
|
78610
|
+
((_9 = (_8 = (_7 = bond === null || bond === void 0 ? void 0 : bond.lpToken) === null || _7 === void 0 ? void 0 : _7.address) === null || _8 === void 0 ? void 0 : _8[chainId]) === null || _9 === void 0 ? void 0 : _9.toLowerCase()) === ((_12 = (_11 = (_10 = WNATIVE[chainId]) === null || _10 === void 0 ? void 0 : _10.address) === null || _11 === void 0 ? void 0 : _11[chainId]) === null || _12 === void 0 ? void 0 : _12.toLowerCase());
|
|
78610
78611
|
const estimatedDepositAmountToReturn = isWrap ? typedValue : estimatedDepositAmount.toString();
|
|
78611
|
-
const trueBondPrice = (
|
|
78612
|
+
const trueBondPrice = (_13 = response === null || response === void 0 ? void 0 : response.protocolQuote) === null || _13 === void 0 ? void 0 : _13.trueBondPrice;
|
|
78612
78613
|
const zapLoading = isLoading || isFetching;
|
|
78613
78614
|
if (zapLoading)
|
|
78614
78615
|
return [true, undefined, '', false, undefined];
|
|
@@ -78750,9 +78751,28 @@ const BonusTable = ({ trueBondPrices, minTier, hideTitle, }) => {
|
|
|
78750
78751
|
}), !hideTitle && (jsx$2(Button, { variant: "secondary", sx: { width: '100%', mt: '10px' }, onClick: () => window.open('https://ape.bond/tier-staking', '_blank'), children: "get tier" }))] }));
|
|
78751
78752
|
};
|
|
78752
78753
|
|
|
78753
|
-
const
|
|
78754
|
+
const useIsMobile = () => {
|
|
78755
|
+
const [isMobile, setIsMobile] = useState(window.innerWidth < 852);
|
|
78756
|
+
// Hardcoded toggle for debounce
|
|
78757
|
+
const useDebounce = false;
|
|
78758
|
+
useEffect(() => {
|
|
78759
|
+
const resizeHandler = () => {
|
|
78760
|
+
{
|
|
78761
|
+
setIsMobile(window.innerWidth < 852);
|
|
78762
|
+
}
|
|
78763
|
+
};
|
|
78764
|
+
window.addEventListener('resize', resizeHandler);
|
|
78765
|
+
return () => {
|
|
78766
|
+
window.removeEventListener('resize', resizeHandler);
|
|
78767
|
+
};
|
|
78768
|
+
}, [useDebounce]);
|
|
78769
|
+
return isMobile;
|
|
78770
|
+
};
|
|
78771
|
+
|
|
78772
|
+
const BonusComponent = ({ trueBondPrices, minTier, bonus, airdropTooltip, tooltipPosition, }) => {
|
|
78754
78773
|
var _a, _b;
|
|
78755
78774
|
const SDKConfig = useSDKConfig();
|
|
78775
|
+
const isMobile = useIsMobile();
|
|
78756
78776
|
const highestPointsElement = trueBondPrices === null || trueBondPrices === void 0 ? void 0 : trueBondPrices.reduce((max, current) => {
|
|
78757
78777
|
return new BigNumber$1(current.points).isGreaterThan(new BigNumber$1(max.points)) ? current : max;
|
|
78758
78778
|
}, trueBondPrices[0]);
|
|
@@ -78780,25 +78800,7 @@ const BonusComponent = ({ trueBondPrices, minTier, bonus, tooltipPosition, }) =>
|
|
|
78780
78800
|
? 'success'
|
|
78781
78801
|
: 'error',
|
|
78782
78802
|
fontSize: ['14px', '14px', '16px', '16px'],
|
|
78783
|
-
}, 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' }, 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" }) }) })) })) : (
|
|
78784
|
-
};
|
|
78785
|
-
|
|
78786
|
-
const useIsMobile = () => {
|
|
78787
|
-
const [isMobile, setIsMobile] = useState(window.innerWidth < 852);
|
|
78788
|
-
// Hardcoded toggle for debounce
|
|
78789
|
-
const useDebounce = false;
|
|
78790
|
-
useEffect(() => {
|
|
78791
|
-
const resizeHandler = () => {
|
|
78792
|
-
{
|
|
78793
|
-
setIsMobile(window.innerWidth < 852);
|
|
78794
|
-
}
|
|
78795
|
-
};
|
|
78796
|
-
window.addEventListener('resize', resizeHandler);
|
|
78797
|
-
return () => {
|
|
78798
|
-
window.removeEventListener('resize', resizeHandler);
|
|
78799
|
-
};
|
|
78800
|
-
}, [useDebounce]);
|
|
78801
|
-
return isMobile;
|
|
78803
|
+
}, 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' }, 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' }, 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' } }) }) }))] })) }));
|
|
78802
78804
|
};
|
|
78803
78805
|
|
|
78804
78806
|
const ProgressBar = ({ value }) => {
|
|
@@ -79667,9 +79669,12 @@ const styles$8 = {
|
|
|
79667
79669
|
});
|
|
79668
79670
|
|
|
79669
79671
|
const BondCards = ({ bond }) => {
|
|
79670
|
-
var _a, _b, _c, _d, _e;
|
|
79671
|
-
const
|
|
79672
|
-
const
|
|
79672
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
79673
|
+
const isMobile = useIsMobile();
|
|
79674
|
+
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;
|
|
79675
|
+
const airdropBonus = (_c = bond.airdropBonus) !== null && _c !== void 0 ? _c : 0;
|
|
79676
|
+
const bonusToUse = bonus + airdropBonus;
|
|
79677
|
+
const initialRelease = ((_d = bond === null || bond === void 0 ? void 0 : bond.initialRelease) !== null && _d !== void 0 ? _d : 0) * 100;
|
|
79673
79678
|
return (jsxs("div", { className: "bonds-cards", children: [jsxs("div", { className: "bond-card-block", sx: {
|
|
79674
79679
|
borderRadius: ['0px', '0px', '0px', 'normal'],
|
|
79675
79680
|
'&:first-of-type': {
|
|
@@ -79680,7 +79685,7 @@ const BondCards = ({ bond }) => {
|
|
|
79680
79685
|
borderBottomRightRadius: 'normal',
|
|
79681
79686
|
borderBottomLeftRadius: 'normal',
|
|
79682
79687
|
},
|
|
79683
|
-
}, children: [jsxs(Flex, { className: "bond-card-title", sx: { alignItems: 'center' }, children: ["Bonus", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: "This is the percentage of additional tokens you\u2019ll get compared to buying at market price." }), 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, { sx: { color: 'success' }, children: [
|
|
79688
|
+
}, children: [jsxs(Flex, { className: "bond-card-title", sx: { alignItems: 'center' }, children: ["Bonus", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: "This is the percentage of additional tokens you\u2019ll get compared to buying at market price." }), 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, { sx: { color: 'success', alignItems: 'center' }, children: [bonusToUse === null || bonusToUse === void 0 ? void 0 : bonusToUse.toFixed(0), "%", bond.airdropTooltip && (jsx$2(TooltipBubble, { body: jsx$2(Fragment$1, { children: bond.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' } }) }) }))] })] }), jsxs("div", { className: "bond-card-block", sx: {
|
|
79684
79689
|
fontSize: '13px !important',
|
|
79685
79690
|
borderRadius: ['0px', '0px', '0px', 'normal'],
|
|
79686
79691
|
'&:first-of-type': {
|
|
@@ -79711,7 +79716,7 @@ const BondCards = ({ bond }) => {
|
|
|
79711
79716
|
borderBottomRightRadius: 'normal',
|
|
79712
79717
|
borderBottomLeftRadius: 'normal',
|
|
79713
79718
|
},
|
|
79714
|
-
}, children: [jsxs("div", { className: "bond-card-title", children: ["Vesting Terms", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsxs(Flex, { children: ["Remaining tokens will vest linearly over ", getTimePeriods((
|
|
79719
|
+
}, children: [jsxs("div", { className: "bond-card-title", children: ["Vesting Terms", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsxs(Flex, { children: ["Remaining tokens will vest linearly over ", getTimePeriods((_e = bond === null || bond === void 0 ? void 0 : bond.vestingTerm) !== null && _e !== void 0 ? _e : 0).months, " months after claiming the initial release."] }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2("div", { className: "bond-card-tooltip", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), (_g = getTimePeriods((_f = bond === null || bond === void 0 ? void 0 : bond.vestingTerm) !== null && _f !== void 0 ? _f : 0)) === null || _g === void 0 ? void 0 : _g.months, " Mo"] })] }));
|
|
79715
79720
|
};
|
|
79716
79721
|
|
|
79717
79722
|
const PreTGEBuyComponent = ({ bondAddress, bondChain, onDismiss, handlePurchasedBond, }) => {
|
|
@@ -79957,12 +79962,12 @@ const ChainTitle = ({ chain, pt, hideTitles, isOpen, }) => {
|
|
|
79957
79962
|
}, children: [NETWORK_LABEL[chain], " Bonds", jsx$2(Flex, { sx: { ml: '7px' }, children: jsx$2(Svg, { icon: "caret", direction: isOpen ? 'down' : 'up', width: 8, color: "textDisabledButton" }) }), ((_a = NETWORK_LABEL[chain]) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes('testnet')) && (jsxs(Flex, { sx: { ml: '15px' }, children: [jsx$2(Text, { sx: { fontSize: '12px', color: '#DE62F3', fontWeight: 700, mr: '7px' }, children: "TESTNET" }), jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Text, { sx: { textTransform: 'none' }, children: "Testnet Bonds let you experiment with fake tokens for free on upcoming chains still in development." }), width: isMobile ? '272px' : '280px', placement: isMobile ? 'bottomRight' : 'bottomLeft', transformTip: isMobile ? 'translate(10%, -5%)' : 'translate(-5%, -5%)', children: jsx$2(Svg, { icon: "questionCircle", width: 14, color: "textDisabledButton" }) })] }))] }));
|
|
79958
79963
|
};
|
|
79959
79964
|
|
|
79960
|
-
const BonusContainer = ({ trueBondPrices, minTier, bonus, tooltipPosition = 'bottomRight', }) => {
|
|
79965
|
+
const BonusContainer = ({ trueBondPrices, minTier, bonus, airdropTooltip, tooltipPosition = 'bottomRight', }) => {
|
|
79961
79966
|
const isMobile = useIsMobile();
|
|
79962
|
-
return (jsx$2("div", { className: `discount-column`, children: jsx$2(BonusComponent, { trueBondPrices: trueBondPrices, minTier: minTier, bonus: bonus, tooltipPosition: isMobile ? tooltipPosition : 'bottomLeft' }) }));
|
|
79967
|
+
return (jsx$2("div", { className: `discount-column`, children: jsx$2(BonusComponent, { trueBondPrices: trueBondPrices, minTier: minTier, bonus: bonus, airdropTooltip: airdropTooltip, tooltipPosition: isMobile ? tooltipPosition : 'bottomLeft' }) }));
|
|
79963
79968
|
};
|
|
79964
79969
|
|
|
79965
|
-
const BondRow = ({ bondAddress, bondChain, payoutToken, billType, tag, bondSoldOut, trueBondPrices, minTier, bonus, vestingTermString, vestingCliffString, percentageAvailable, remainingTokensString, projectURL, twitterURL, auditURL, }) => {
|
|
79970
|
+
const BondRow = ({ bondAddress, bondChain, payoutToken, billType, tag, bondSoldOut, trueBondPrices, minTier, bonus, airdropTooltip, vestingTermString, vestingCliffString, percentageAvailable, remainingTokensString, projectURL, twitterURL, auditURL, }) => {
|
|
79966
79971
|
var _a, _b, _c;
|
|
79967
79972
|
const locationPath = window.location.pathname.replace('/', '');
|
|
79968
79973
|
// Modal
|
|
@@ -79991,7 +79996,7 @@ const BondRow = ({ bondAddress, bondChain, payoutToken, billType, tag, bondSoldO
|
|
|
79991
79996
|
});
|
|
79992
79997
|
};
|
|
79993
79998
|
return (jsxs("div", { className: "bond-row" // Insert special campaign styles here
|
|
79994
|
-
, onClick: handleOpenModal, sx: { borderRadius: 'normal' }, children: [jsx$2("div", { className: "gold-ribbon" }), jsx$2("div", { className: "token-info-container", sx: { width: ['70%', '70%', '65%', '30%'] }, children: jsx$2(TokenInfoAndName, { tokenSymbol: payoutToken === null || payoutToken === void 0 ? void 0 : payoutToken.symbol, chain: bondChain, tag: tag }) }), jsxs("div", { className: "bond-info-columns", sx: { width: '55%' }, children: [jsx$2(BonusContainer, { trueBondPrices: trueBondPrices, minTier: minTier, bonus: bonus }), jsxs("div", { className: "terms-column", children: [vestingTermString, vestingCliffString && (jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: vestingCliffString }), width: "180px", placement: "bottomRight", transformTip: "translate(13%, 0%)", children: jsx$2(Flex, { sx: { opacity: 0.6, ml: '6px' }, children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) }))] }), jsx$2("div", { className: "tokens-remaining-column", children: jsx$2(ProgressBarWrapper$1, { title: '', value: jsx$2(ProgressBar, { value: percentageAvailable }), style: {
|
|
79999
|
+
, onClick: handleOpenModal, sx: { borderRadius: 'normal' }, children: [jsx$2("div", { className: "gold-ribbon" }), jsx$2("div", { className: "token-info-container", sx: { width: ['70%', '70%', '65%', '30%'] }, children: jsx$2(TokenInfoAndName, { tokenSymbol: payoutToken === null || payoutToken === void 0 ? void 0 : payoutToken.symbol, chain: bondChain, tag: tag }) }), jsxs("div", { className: "bond-info-columns", sx: { width: '55%' }, children: [jsx$2(BonusContainer, { trueBondPrices: trueBondPrices, minTier: minTier, bonus: bonus, airdropTooltip: airdropTooltip }), jsxs("div", { className: "terms-column", children: [vestingTermString, vestingCliffString && (jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: vestingCliffString }), width: "180px", placement: "bottomRight", transformTip: "translate(13%, 0%)", children: jsx$2(Flex, { sx: { opacity: 0.6, ml: '6px' }, children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) }))] }), jsx$2("div", { className: "tokens-remaining-column", children: jsx$2(ProgressBarWrapper$1, { title: '', value: jsx$2(ProgressBar, { value: percentageAvailable }), style: {
|
|
79995
80000
|
width: '127px',
|
|
79996
80001
|
height: '25px',
|
|
79997
80002
|
flexDirection: 'column',
|
|
@@ -80148,7 +80153,7 @@ const BondRowsWithTitle = ({ chain, bonds, showHotBonds }) => {
|
|
|
80148
80153
|
width: '100%',
|
|
80149
80154
|
marginTop: '0px',
|
|
80150
80155
|
}, className: "bonds-card-container", children: [TESTNET_CHAINS.includes(chain) && jsx$2(BannerTestnet, { chainId: chain }), bonds === null || bonds === void 0 ? void 0 : bonds.map((bondFromMap, index) => {
|
|
80151
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
80156
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
80152
80157
|
if (bondFromMap.soldOut) {
|
|
80153
80158
|
const bond = bondFromMap;
|
|
80154
80159
|
return (jsx$2(BondRow, { bondAddress: (_a = bond.contractAddress) === null || _a === void 0 ? void 0 : _a[bond.chainId], bondChain: bond.chainId, payoutToken: bond.earnToken, billType: bond.billType, tag: (_b = bond.tags) === null || _b === void 0 ? void 0 : _b[0], bondSoldOut: true, percentageAvailable: 100, remainingTokensString: `${formatNumberSI(0, 0)} ${bond.earnToken.symbol} ($${formatNumberSI(0, 2)})`, vestingTermString: "-", projectURL: bond.projectLink, twitterURL: bond.twitter, auditURL: bond.audit }, `${bond.contractAddress}-${bond.chainId}-${index}`));
|
|
@@ -80161,13 +80166,16 @@ const BondRowsWithTitle = ({ chain, bonds, showHotBonds }) => {
|
|
|
80161
80166
|
const tokensRemainingUSD = tokensRemaining * ((_l = bond === null || bond === void 0 ? void 0 : bond.initPrice) !== null && _l !== void 0 ? _l : 0);
|
|
80162
80167
|
const percentageAvailable = 100 - Math.floor((totalPrincipalBilled * 100) / raiseGoal);
|
|
80163
80168
|
const earnToken = (_m = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _m === void 0 ? void 0 : _m.symbol;
|
|
80164
|
-
|
|
80169
|
+
const baseBonus = (_q = (_p = (_o = bond === null || bond === void 0 ? void 0 : bond.trueBondPrices) === null || _o === void 0 ? void 0 : _o[0]) === null || _p === void 0 ? void 0 : _p.bonus) !== null && _q !== void 0 ? _q : 0;
|
|
80170
|
+
const airdropBonus = (_r = bond === null || bond === void 0 ? void 0 : bond.airdropBonus) !== null && _r !== void 0 ? _r : 0;
|
|
80171
|
+
const bonus = baseBonus + airdropBonus;
|
|
80172
|
+
return (jsx$2(BondRow, { bondAddress: (_s = bond.contractAddress) === null || _s === void 0 ? void 0 : _s[bond.chainId], bondChain: bond.chainId, payoutToken: bond.earnToken, billType: bond.billType, tag: (_t = bond.tags) === null || _t === void 0 ? void 0 : _t[0], bonus: `${bonus}%`, airdropTooltip: bond.airdropTooltip, percentageAvailable: percentageAvailable, remainingTokensString: `${formatNumberSI(tokensRemaining, 0)} ${earnToken} ($${formatNumberSI(tokensRemainingUSD, 2)})`, vestingTermString: `${getTimePeriods((_u = bond.vestingTerm) !== null && _u !== void 0 ? _u : 0).months} Mo`, projectURL: bond.projectLink, twitterURL: bond.twitter, auditURL: bond.audit }, `${bond.contractAddress}-${bond.chainId}-${index}`));
|
|
80165
80173
|
}
|
|
80166
80174
|
else {
|
|
80167
80175
|
const bond = bondFromMap;
|
|
80168
|
-
const bondAddress = (
|
|
80176
|
+
const bondAddress = (_v = bond === null || bond === void 0 ? void 0 : bond.contractAddress) === null || _v === void 0 ? void 0 : _v[bond === null || bond === void 0 ? void 0 : bond.chainId];
|
|
80169
80177
|
const remainingTokensString = getRemainingTokensString(bond);
|
|
80170
|
-
return (jsx$2(BondRow, { bondAddress: bondAddress, bondChain: bond.chainId, payoutToken: bond.earnToken, billType: bond.billType, tag: (
|
|
80178
|
+
return (jsx$2(BondRow, { bondAddress: bondAddress, bondChain: bond.chainId, payoutToken: bond.earnToken, billType: bond.billType, tag: (_w = bond.tags) === null || _w === void 0 ? void 0 : _w[0], trueBondPrices: bond.trueBondPrices, 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 }, `${bondAddress}-${bond.chainId}-${index}`));
|
|
80171
80179
|
}
|
|
80172
80180
|
}), showHotBonds && (jsx$2(SwiperProvider, { children: jsx$2(HotBondCards, {}) }))] }, key))] }) }, key));
|
|
80173
80181
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TrueBondPrices } from '../../../../types/bonds';
|
|
3
3
|
import { LaunchBondTiers } from '@ape.swap/apeswap-lists';
|
|
4
|
-
declare const BonusComponent: ({ trueBondPrices, minTier, bonus, tooltipPosition, }: {
|
|
4
|
+
declare const BonusComponent: ({ trueBondPrices, minTier, bonus, airdropTooltip, tooltipPosition, }: {
|
|
5
5
|
trueBondPrices?: TrueBondPrices[];
|
|
6
6
|
minTier?: LaunchBondTiers;
|
|
7
7
|
bonus?: string;
|
|
8
|
+
airdropTooltip?: string;
|
|
8
9
|
tooltipPosition: "bottomRight" | "bottomLeft";
|
|
9
10
|
}) => React.JSX.Element;
|
|
10
11
|
export default BonusComponent;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LaunchBondTiers } from '@ape.swap/apeswap-lists';
|
|
3
3
|
import { TrueBondPrices } from '../../../../types/bonds';
|
|
4
|
-
declare const BonusContainer: ({ trueBondPrices, minTier, bonus, tooltipPosition, }: {
|
|
4
|
+
declare const BonusContainer: ({ trueBondPrices, minTier, bonus, airdropTooltip, tooltipPosition, }: {
|
|
5
5
|
trueBondPrices?: TrueBondPrices[];
|
|
6
6
|
minTier?: LaunchBondTiers;
|
|
7
7
|
bonus?: string;
|
|
8
|
+
airdropTooltip?: string;
|
|
8
9
|
tooltipPosition?: "bottomRight" | "bottomLeft";
|
|
9
10
|
}) => React.JSX.Element;
|
|
10
11
|
export default BonusContainer;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Ape Bond SDK",
|
|
4
4
|
"author": "Ape Bond",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "3.0.
|
|
6
|
+
"version": "3.0.92",
|
|
7
7
|
"module": "dist/main.js",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"types": "dist/main.d.ts",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"yalc": "^1.0.0-pre.53"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@ape.swap/apeswap-lists": "4.3.
|
|
71
|
+
"@ape.swap/apeswap-lists": "4.3.28",
|
|
72
72
|
"@emotion/react": "11.11.4",
|
|
73
73
|
"bignumber.js": "^9.1.2",
|
|
74
74
|
"chart.js": "4.2.0",
|