@ape.swap/bonds-sdk 2.5.2-test3 → 2.5.2-testxmas.2
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/components/TagXmasFlashBond/TagXmasFlashBond.d.ts +8 -0
- package/dist/components/TokenSelectorPanel/index.d.ts +2 -1
- package/dist/config/constants/addresses.d.ts +1 -0
- package/dist/main.js +503 -35
- package/dist/state/bonds/useGetUserEscrowWeight.d.ts +11 -0
- package/dist/styles.css +98 -7
- package/dist/types/bonds.d.ts +2 -1
- package/package.json +2 -2
- package/dist/views/BondModal/NoBonusModal.d.ts +0 -6
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LaunchBondTiers } from '@ape.swap/apeswap-lists';
|
|
3
|
+
interface XmasFlashBondProps {
|
|
4
|
+
userTier: LaunchBondTiers | null;
|
|
5
|
+
minTier: number | undefined;
|
|
6
|
+
}
|
|
7
|
+
declare const TagXmasFlashBond: React.FC<XmasFlashBondProps>;
|
|
8
|
+
export default TagXmasFlashBond;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ChainId, Token } from '@ape.swap/apeswap-lists';
|
|
3
|
-
declare const TokenSelectorPanel: ({ typedValue, setTypedValue, selectedToken, chainId, handleValueBtn, handleCurrencySelect, enableZap, tokenBalance, selectedTokenPrice, bondPrincipalToken, bondEarnToken, modalVariant, }: {
|
|
3
|
+
declare const TokenSelectorPanel: ({ typedValue, setTypedValue, selectedToken, chainId, handleValueBtn, handleCurrencySelect, enableZap, tokenBalance, selectedTokenPrice, bondPrincipalToken, bondEarnToken, modalVariant, inputDisabled, }: {
|
|
4
4
|
typedValue: string;
|
|
5
5
|
setTypedValue: (value: React.SetStateAction<string>) => void;
|
|
6
6
|
selectedToken?: "NATIVE" | Token;
|
|
@@ -13,5 +13,6 @@ declare const TokenSelectorPanel: ({ typedValue, setTypedValue, selectedToken, c
|
|
|
13
13
|
bondPrincipalToken?: Token;
|
|
14
14
|
bondEarnToken?: Token;
|
|
15
15
|
modalVariant?: "alt" | "standard";
|
|
16
|
+
inputDisabled?: boolean;
|
|
16
17
|
}) => React.JSX.Element;
|
|
17
18
|
export default TokenSelectorPanel;
|
|
@@ -7,4 +7,5 @@ export declare const PRICE_GETTER_ADDRESSES: AddressMap;
|
|
|
7
7
|
export declare const MULTICALL_V2: AddressMap;
|
|
8
8
|
export declare const SoulZapTokenManager: Partial<Record<ChainId, string>>;
|
|
9
9
|
export declare const ACF_TO_ABOND: string;
|
|
10
|
+
export declare const LENS_CONTRACT: AddressMap;
|
|
10
11
|
export {};
|
package/dist/main.js
CHANGED
|
@@ -39230,7 +39230,7 @@ const vestingTimeRemaining = (userBill) => {
|
|
|
39230
39230
|
};
|
|
39231
39231
|
const vestingTimeRemainingYourBonds = (userBill) => {
|
|
39232
39232
|
const currentTime = new Date().getTime() / 1000;
|
|
39233
|
-
return
|
|
39233
|
+
return parseInt(userBill.lastBlockTimestamp) + parseInt(userBill.vesting) - currentTime;
|
|
39234
39234
|
};
|
|
39235
39235
|
const discountEarnTokenPrice = (bond) => {
|
|
39236
39236
|
var _a, _b;
|
|
@@ -49086,6 +49086,9 @@ const SoulZapTokenManager = {
|
|
|
49086
49086
|
[types.ChainId.AVAX]: '0xC4dE46cBE21400dabE2E7c66E04F43acE4b5b910',
|
|
49087
49087
|
};
|
|
49088
49088
|
const ACF_TO_ABOND = '0xEce2b9C3704632Ce760271B0b84E3A4A698Ca962';
|
|
49089
|
+
const LENS_CONTRACT = {
|
|
49090
|
+
[types.ChainId.BSC]: '0x6Fb7A34A271cc0F4016db6A3BAA6206757a9a164',
|
|
49091
|
+
};
|
|
49089
49092
|
|
|
49090
49093
|
var bn$1 = {exports: {}};
|
|
49091
49094
|
|
|
@@ -71732,7 +71735,8 @@ const YourBonds = () => {
|
|
|
71732
71735
|
return;
|
|
71733
71736
|
if (sortConfig === null) {
|
|
71734
71737
|
const sortedBills = (_a = [...userBonds]) === null || _a === void 0 ? void 0 : _a.sort((a, b) => {
|
|
71735
|
-
const vestingDifference = parseFloat(vestingTimeRemainingYourBonds(b).toFixed(3)) -
|
|
71738
|
+
const vestingDifference = parseFloat(vestingTimeRemainingYourBonds(b).toFixed(3)) -
|
|
71739
|
+
parseFloat(vestingTimeRemainingYourBonds(a).toFixed(3));
|
|
71736
71740
|
if (vestingDifference !== 0) {
|
|
71737
71741
|
return vestingDifference;
|
|
71738
71742
|
}
|
|
@@ -71933,7 +71937,25 @@ function useBondsData() {
|
|
|
71933
71937
|
const getBondsData = (realTimeApiURL, tokenPrices, bondList) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
71934
71938
|
try {
|
|
71935
71939
|
const response = yield axios.get(realTimeApiURL);
|
|
71936
|
-
|
|
71940
|
+
const mockBonds = response.data.bonds.map((bond) => {
|
|
71941
|
+
let minTier = null;
|
|
71942
|
+
let tags = bond.tags;
|
|
71943
|
+
if (bond.index === 1110) {
|
|
71944
|
+
minTier = 4;
|
|
71945
|
+
tags = ['CHRISTMAS SALE'];
|
|
71946
|
+
}
|
|
71947
|
+
if (bond.index === 1108 || bond.index === 1104) {
|
|
71948
|
+
minTier = 3;
|
|
71949
|
+
tags = ['CHRISTMAS SALE'];
|
|
71950
|
+
}
|
|
71951
|
+
if (bond.index === 167) {
|
|
71952
|
+
minTier = 2;
|
|
71953
|
+
tags = ['CHRISTMAS SALE'];
|
|
71954
|
+
}
|
|
71955
|
+
return Object.assign(Object.assign({}, bond), { minTier,
|
|
71956
|
+
tags });
|
|
71957
|
+
});
|
|
71958
|
+
return mockBonds;
|
|
71937
71959
|
}
|
|
71938
71960
|
catch (_a) {
|
|
71939
71961
|
const billData = [];
|
|
@@ -72557,7 +72579,7 @@ const TokenSelectorModal = ({ bondPrincipalToken, bondEarnToken, handleCurrencyS
|
|
|
72557
72579
|
}) })] }) }) }));
|
|
72558
72580
|
};
|
|
72559
72581
|
|
|
72560
|
-
const TokenSelectorPanel = ({ typedValue, setTypedValue, selectedToken, chainId, handleValueBtn, handleCurrencySelect, enableZap, tokenBalance, selectedTokenPrice, bondPrincipalToken, bondEarnToken, modalVariant, }) => {
|
|
72582
|
+
const TokenSelectorPanel = ({ typedValue, setTypedValue, selectedToken, chainId, handleValueBtn, handleCurrencySelect, enableZap, tokenBalance, selectedTokenPrice, bondPrincipalToken, bondEarnToken, modalVariant, inputDisabled = false, }) => {
|
|
72561
72583
|
var _a, _b;
|
|
72562
72584
|
const { address: account } = useAccount();
|
|
72563
72585
|
const tokenBalanceString = tokenBalance ? new BigNumber$1(tokenBalance).toPrecision(5) : 'loading';
|
|
@@ -72580,7 +72602,7 @@ const TokenSelectorPanel = ({ typedValue, setTypedValue, selectedToken, chainId,
|
|
|
72580
72602
|
!!v.currentTarget.value && isNumber$1(v.currentTarget.value) && parseFloat(v.currentTarget.value) >= 0
|
|
72581
72603
|
? v.currentTarget.value
|
|
72582
72604
|
: v.currentTarget.value.slice(0, v.currentTarget.value.length - 1);
|
|
72583
|
-
} }) }), jsxs(Flex$1, { className: "input-container token", onClick: () => (enableZap ? onTokenSelectorModal() : null), sx: { cursor: enableZap ? 'pointer' : 'default' }, children: [jsxs(Flex$1, { children: [jsx$2(Flex$1, { className: "input-container bondicon", children: lodashExports.isArray(splited) ? (jsx$2(TokenImage, { symbol: splited[0], symbol2: splited[1], size: 28, chain: chainId })) : (jsx$2(TokenImage, { symbol: getSymbol(selectedToken, chainId), size: 28, chain: chainId })) }), jsx$2(Flex$1, { className: "title-container tokenname", children: getSymbol(selectedToken, chainId) })] }), enableZap && (jsx$2(Flex$1, { sx: { mr: '8px' }, children: jsx$2(Svg, { icon: "caret" }) }))] })] }), jsxs(Flex$1, { className: "input-container balancerow", children: [jsx$2(Flex$1, { children: selectedTokenPrice && typedValue
|
|
72605
|
+
}, disabled: inputDisabled }) }), jsxs(Flex$1, { className: "input-container token", onClick: () => (enableZap ? onTokenSelectorModal() : null), sx: { cursor: enableZap ? 'pointer' : 'default' }, children: [jsxs(Flex$1, { children: [jsx$2(Flex$1, { className: "input-container bondicon", children: lodashExports.isArray(splited) ? (jsx$2(TokenImage, { symbol: splited[0], symbol2: splited[1], size: 28, chain: chainId })) : (jsx$2(TokenImage, { symbol: getSymbol(selectedToken, chainId), size: 28, chain: chainId })) }), jsx$2(Flex$1, { className: "title-container tokenname", children: getSymbol(selectedToken, chainId) })] }), enableZap && (jsx$2(Flex$1, { sx: { mr: '8px' }, children: jsx$2(Svg, { icon: "caret" }) }))] })] }), jsxs(Flex$1, { className: "input-container balancerow", children: [jsx$2(Flex$1, { children: selectedTokenPrice && typedValue
|
|
72584
72606
|
? `$${formatUSDNumber((selectedTokenPrice * parseFloat(typedValue)).toFixed(2))}`
|
|
72585
72607
|
: '' }), jsxs(Flex$1, { children: [account && jsxs(Flex$1, { className: "balancerow text", children: ["Balance: ", tokenBalanceString] }), jsxs(Flex$1, { className: "balancerow max", children: [tokenBalance && tokenBalance !== '0' && handleValueBtn && modalVariant !== 'alt' && (jsx$2(Fragment$1, { children: jsx$2(Button, { className: "max-button", onClick: () => { var _a; return handleValueBtn((_a = new BigNumber$1(tokenBalance !== null && tokenBalance !== void 0 ? tokenBalance : '0')) === null || _a === void 0 ? void 0 : _a.toString()); }, children: "Max" }) })), tokenBalance && tokenBalance !== '0' && handleValueBtn && modalVariant === 'alt' && (jsxs(Flex$1, { children: [jsx$2(Button, { className: "max-button", onClick: () => handleValueBtn((parseFloat(tokenBalance) / 4).toString()), children: "25%" }), jsx$2(Button, { className: "max-button", onClick: () => handleValueBtn((parseFloat(tokenBalance) / 2).toString()), children: "50%" }), jsx$2(Button, { className: "max-button", onClick: () => handleValueBtn((parseFloat(tokenBalance) * 0.75).toString()), children: "75%" }), jsx$2(Button, { className: "max-button", onClick: () => { var _a; return handleValueBtn((_a = new BigNumber$1(tokenBalance !== null && tokenBalance !== void 0 ? tokenBalance : '0')) === null || _a === void 0 ? void 0 : _a.toString()); }, children: "Max" })] }))] })] })] })] }));
|
|
72586
72608
|
};
|
|
@@ -74067,12 +74089,12 @@ const BondModalHeader = ({ bondData, onDismiss, showProjectInfoButton, }) => {
|
|
|
74067
74089
|
},
|
|
74068
74090
|
});
|
|
74069
74091
|
};
|
|
74070
|
-
return (jsxs(Flex, { className: "modaltable-container title-container", children: [
|
|
74092
|
+
return (jsxs(Flex, { className: "modaltable-container title-container", children: [jsxs(Flex, { className: "title-container bondicon", children: [jsx$2("img", { src: "/images/bills/xmasHat.png", alt: "xmas-hat", className: "xmas-hat" }), 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", children: [jsxs(Flex, { className: "price-container price", children: ["$", earnTokenPrice(bondData)] }), jsxs(Flex, { className: "price-container discounted", children: ["$", discountEarnTokenPrice(bondData)] })] }), jsx$2(Flex, { className: "slipagge-close-icons", children: onDismiss ? (jsxs(Fragment$1, { children: [showProjectInfoButton && jsx$2(ExpandedViewButton, { handleNavigation: handleProjectViewNavigation }), jsx$2(IconButton, { icon: "close", color: "text", variant: "transparent", onClick: handleClose }), jsx$2(Flex, { sx: { py: '3px' }, onClick: onOpenSlippageModal, children: jsx$2(Svg, { icon: "cog", width: "16px" }) })] })) : (jsx$2(Flex, { sx: { py: '3px' }, onClick: onOpenSlippageModal, children: jsx$2(Svg, { icon: "cog", width: "16px" }) })) })] }));
|
|
74071
74093
|
};
|
|
74072
74094
|
|
|
74073
74095
|
const BondCards = ({ bondData }) => {
|
|
74074
74096
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
74075
|
-
return (jsxs("div", { className: "bonds-cards", children: [jsxs("div", { className: "bond-card-block", style: { color: getDiscountColor(bondData === null || bondData === void 0 ? void 0 : bondData.bonus) }, children: [jsxs("div", { className: "bond-card-title", children: ["Bonus", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.Discount }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2("div", { className: "bond-card-tooltip", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), jsx$2("div", { className: "bond-card-content", children:
|
|
74097
|
+
return (jsxs("div", { className: "bonds-cards", children: [jsxs("div", { className: "bond-card-block", style: { color: getDiscountColor(bondData === null || bondData === void 0 ? void 0 : bondData.bonus) }, children: [jsxs("div", { className: "bond-card-title", children: ["Bonus", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.Discount }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2("div", { className: "bond-card-tooltip", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), jsx$2("div", { className: "bond-card-content", children: `${(_a = bondData === null || bondData === void 0 ? void 0 : bondData.bonus) === null || _a === void 0 ? void 0 : _a.toFixed(2)}%` })] }), bondData.type !== 'staking' && (jsxs("div", { className: "bond-card-block hide-mobile", children: [jsxs("div", { className: "bond-card-title", children: ["ARR", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.ARR }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2("div", { className: "bond-card-tooltip", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), jsx$2("div", { className: "bond-card-content", children: `${((((_b = bondData === null || bondData === void 0 ? void 0 : bondData.bonus) !== null && _b !== void 0 ? _b : 0) * 365) / vestingTime((_c = bondData === null || bondData === void 0 ? void 0 : bondData.vestingTerm) !== null && _c !== void 0 ? _c : 0).days).toFixed(2)}%` })] })), jsxs("div", { className: "bond-card-block", children: [jsxs("div", { className: "bond-card-title", children: ["Terms", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.Terms }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2("div", { className: "bond-card-tooltip", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), jsx$2("div", { className: "bond-card-content", children: bondData.type === 'staking'
|
|
74076
74098
|
? `${daysLeftOnBasepadPool()} D Lock`
|
|
74077
74099
|
: vestingTime((_d = bondData === null || bondData === void 0 ? void 0 : bondData.vestingTerm) !== null && _d !== void 0 ? _d : 0).days
|
|
74078
74100
|
? `${vestingTime((_e = bondData === null || bondData === void 0 ? void 0 : bondData.vestingTerm) !== null && _e !== void 0 ? _e : 0).days} D`
|
|
@@ -74086,7 +74108,7 @@ const Estimations = ({ bondData, inputValue, inputToken, estimatedOutput, inputT
|
|
|
74086
74108
|
const estimatedInputUSD = parseFloat(inputValue) * (inputTokenPrice !== null && inputTokenPrice !== void 0 ? inputTokenPrice : 0);
|
|
74087
74109
|
const normalPremium = premium(bondData, inputValue);
|
|
74088
74110
|
const premiumString = isZap ? formatUSDNumber((estimatedOutputUSD - estimatedInputUSD).toString()) : normalPremium;
|
|
74089
|
-
return (jsxs(Flex, { className: "modaltable-container text-container", children: [jsxs(Flex, { className: "text-container row", children: [jsx$2(Flex, { className: "row-container spend", children: "You
|
|
74111
|
+
return (jsxs(Flex, { className: "modaltable-container text-container", children: [jsxs(Flex, { className: "text-container row", children: [jsx$2(Flex, { className: "row-container spend", children: "You spend:" }), jsxs(Flex, { className: "row-container spend-val", children: [youSpend(inputValue), " ", getSymbol(inputToken, bondData.chainId), " = $", ' ', formatUSDNumber(estimatedInputUSD === null || estimatedInputUSD === void 0 ? void 0 : estimatedInputUSD.toString())] })] }), jsxs(Flex, { className: "text-container row", children: [jsxs(Flex, { className: "row-container premium", children: ["Bonus:", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.Premium }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", 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 ${getPremiumColor(premiumString)}`, children: ["$ ", premiumString] }))] }), jsxs(Flex, { className: "text-container row", children: [jsxs(Flex, { className: "row-container get", children: ["You get (over ", vestingTime((_b = bondData === null || bondData === void 0 ? void 0 : bondData.vestingTerm) !== null && _b !== void 0 ? _b : 0).days, " days):"] }), isZap && fetchingZapQuote ? (jsx$2(Dots, {})) : isZap && zapError ? ('-') : (jsxs(Flex, { className: "row-container get-val", children: [formatNumber$2(estimatedOutput.toString()), " ", bondData === null || bondData === void 0 ? void 0 : bondData.showcaseTokenName, " = $", ' ', formatUSDNumber(estimatedOutputUSD.toString())] }))] })] }));
|
|
74090
74112
|
};
|
|
74091
74113
|
|
|
74092
74114
|
// Custom HTML sanitizer
|
|
@@ -74218,13 +74240,425 @@ const RestrictedRegionModal = ({ onDismiss }) => {
|
|
|
74218
74240
|
return (jsxs(Modal, { className: "modal", title: "Notice", sx: { maxWidth: '200px' }, children: [jsxs(Flex, { sx: { my: '20px' }, children: ["Unfortunately, this bond is restricted for your region: ", geoData === null || geoData === void 0 ? void 0 : geoData.countryCode, "."] }), jsx$2(Button, { fullWidth: true, onClick: onDismiss, children: "Close" })] }));
|
|
74219
74241
|
};
|
|
74220
74242
|
|
|
74221
|
-
|
|
74222
|
-
|
|
74223
|
-
|
|
74224
|
-
|
|
74225
|
-
|
|
74226
|
-
|
|
74227
|
-
|
|
74243
|
+
var lensContractABI = [
|
|
74244
|
+
{
|
|
74245
|
+
inputs: [
|
|
74246
|
+
],
|
|
74247
|
+
stateMutability: "nonpayable",
|
|
74248
|
+
type: "constructor"
|
|
74249
|
+
},
|
|
74250
|
+
{
|
|
74251
|
+
inputs: [
|
|
74252
|
+
],
|
|
74253
|
+
name: "DurationsNotDescendingOrder",
|
|
74254
|
+
type: "error"
|
|
74255
|
+
},
|
|
74256
|
+
{
|
|
74257
|
+
inputs: [
|
|
74258
|
+
],
|
|
74259
|
+
name: "MismatchedLengths",
|
|
74260
|
+
type: "error"
|
|
74261
|
+
},
|
|
74262
|
+
{
|
|
74263
|
+
inputs: [
|
|
74264
|
+
],
|
|
74265
|
+
name: "MultiplierBelowPrecision",
|
|
74266
|
+
type: "error"
|
|
74267
|
+
},
|
|
74268
|
+
{
|
|
74269
|
+
inputs: [
|
|
74270
|
+
],
|
|
74271
|
+
name: "NotLockOwner",
|
|
74272
|
+
type: "error"
|
|
74273
|
+
},
|
|
74274
|
+
{
|
|
74275
|
+
anonymous: false,
|
|
74276
|
+
inputs: [
|
|
74277
|
+
{
|
|
74278
|
+
indexed: false,
|
|
74279
|
+
internalType: "uint8",
|
|
74280
|
+
name: "version",
|
|
74281
|
+
type: "uint8"
|
|
74282
|
+
}
|
|
74283
|
+
],
|
|
74284
|
+
name: "Initialized",
|
|
74285
|
+
type: "event"
|
|
74286
|
+
},
|
|
74287
|
+
{
|
|
74288
|
+
anonymous: false,
|
|
74289
|
+
inputs: [
|
|
74290
|
+
{
|
|
74291
|
+
indexed: false,
|
|
74292
|
+
internalType: "uint256[]",
|
|
74293
|
+
name: "durationThresholds",
|
|
74294
|
+
type: "uint256[]"
|
|
74295
|
+
},
|
|
74296
|
+
{
|
|
74297
|
+
indexed: false,
|
|
74298
|
+
internalType: "uint256[]",
|
|
74299
|
+
name: "multipliers",
|
|
74300
|
+
type: "uint256[]"
|
|
74301
|
+
}
|
|
74302
|
+
],
|
|
74303
|
+
name: "MultipliersUpdated",
|
|
74304
|
+
type: "event"
|
|
74305
|
+
},
|
|
74306
|
+
{
|
|
74307
|
+
anonymous: false,
|
|
74308
|
+
inputs: [
|
|
74309
|
+
{
|
|
74310
|
+
indexed: true,
|
|
74311
|
+
internalType: "address",
|
|
74312
|
+
name: "previousOwner",
|
|
74313
|
+
type: "address"
|
|
74314
|
+
},
|
|
74315
|
+
{
|
|
74316
|
+
indexed: true,
|
|
74317
|
+
internalType: "address",
|
|
74318
|
+
name: "newOwner",
|
|
74319
|
+
type: "address"
|
|
74320
|
+
}
|
|
74321
|
+
],
|
|
74322
|
+
name: "OwnershipTransferred",
|
|
74323
|
+
type: "event"
|
|
74324
|
+
},
|
|
74325
|
+
{
|
|
74326
|
+
inputs: [
|
|
74327
|
+
],
|
|
74328
|
+
name: "MULTIPLIER_PRECISION",
|
|
74329
|
+
outputs: [
|
|
74330
|
+
{
|
|
74331
|
+
internalType: "uint256",
|
|
74332
|
+
name: "",
|
|
74333
|
+
type: "uint256"
|
|
74334
|
+
}
|
|
74335
|
+
],
|
|
74336
|
+
stateMutability: "view",
|
|
74337
|
+
type: "function"
|
|
74338
|
+
},
|
|
74339
|
+
{
|
|
74340
|
+
inputs: [
|
|
74341
|
+
{
|
|
74342
|
+
internalType: "uint256",
|
|
74343
|
+
name: "",
|
|
74344
|
+
type: "uint256"
|
|
74345
|
+
}
|
|
74346
|
+
],
|
|
74347
|
+
name: "durationDaysThresholds",
|
|
74348
|
+
outputs: [
|
|
74349
|
+
{
|
|
74350
|
+
internalType: "uint256",
|
|
74351
|
+
name: "",
|
|
74352
|
+
type: "uint256"
|
|
74353
|
+
}
|
|
74354
|
+
],
|
|
74355
|
+
stateMutability: "view",
|
|
74356
|
+
type: "function"
|
|
74357
|
+
},
|
|
74358
|
+
{
|
|
74359
|
+
inputs: [
|
|
74360
|
+
{
|
|
74361
|
+
internalType: "address",
|
|
74362
|
+
name: "escrowOwner",
|
|
74363
|
+
type: "address"
|
|
74364
|
+
}
|
|
74365
|
+
],
|
|
74366
|
+
name: "getEscrowWeight",
|
|
74367
|
+
outputs: [
|
|
74368
|
+
{
|
|
74369
|
+
internalType: "uint256",
|
|
74370
|
+
name: "totalWeight",
|
|
74371
|
+
type: "uint256"
|
|
74372
|
+
},
|
|
74373
|
+
{
|
|
74374
|
+
internalType: "uint256",
|
|
74375
|
+
name: "maxMultiplier",
|
|
74376
|
+
type: "uint256"
|
|
74377
|
+
},
|
|
74378
|
+
{
|
|
74379
|
+
internalType: "uint256",
|
|
74380
|
+
name: "maxTier",
|
|
74381
|
+
type: "uint256"
|
|
74382
|
+
}
|
|
74383
|
+
],
|
|
74384
|
+
stateMutability: "view",
|
|
74385
|
+
type: "function"
|
|
74386
|
+
},
|
|
74387
|
+
{
|
|
74388
|
+
inputs: [
|
|
74389
|
+
{
|
|
74390
|
+
internalType: "address",
|
|
74391
|
+
name: "escrowOwner",
|
|
74392
|
+
type: "address"
|
|
74393
|
+
},
|
|
74394
|
+
{
|
|
74395
|
+
internalType: "uint256[]",
|
|
74396
|
+
name: "tokenIds",
|
|
74397
|
+
type: "uint256[]"
|
|
74398
|
+
}
|
|
74399
|
+
],
|
|
74400
|
+
name: "getEscrowWeightForTokenIds",
|
|
74401
|
+
outputs: [
|
|
74402
|
+
{
|
|
74403
|
+
internalType: "uint256",
|
|
74404
|
+
name: "totalWeight",
|
|
74405
|
+
type: "uint256"
|
|
74406
|
+
},
|
|
74407
|
+
{
|
|
74408
|
+
internalType: "uint256",
|
|
74409
|
+
name: "maxMultiplier",
|
|
74410
|
+
type: "uint256"
|
|
74411
|
+
},
|
|
74412
|
+
{
|
|
74413
|
+
internalType: "uint256",
|
|
74414
|
+
name: "maxTier",
|
|
74415
|
+
type: "uint256"
|
|
74416
|
+
}
|
|
74417
|
+
],
|
|
74418
|
+
stateMutability: "view",
|
|
74419
|
+
type: "function"
|
|
74420
|
+
},
|
|
74421
|
+
{
|
|
74422
|
+
inputs: [
|
|
74423
|
+
{
|
|
74424
|
+
internalType: "uint256",
|
|
74425
|
+
name: "durationDays",
|
|
74426
|
+
type: "uint256"
|
|
74427
|
+
}
|
|
74428
|
+
],
|
|
74429
|
+
name: "getMultiplierForDaysLocked",
|
|
74430
|
+
outputs: [
|
|
74431
|
+
{
|
|
74432
|
+
internalType: "uint256",
|
|
74433
|
+
name: "multiplier",
|
|
74434
|
+
type: "uint256"
|
|
74435
|
+
},
|
|
74436
|
+
{
|
|
74437
|
+
internalType: "uint256",
|
|
74438
|
+
name: "tier",
|
|
74439
|
+
type: "uint256"
|
|
74440
|
+
}
|
|
74441
|
+
],
|
|
74442
|
+
stateMutability: "view",
|
|
74443
|
+
type: "function"
|
|
74444
|
+
},
|
|
74445
|
+
{
|
|
74446
|
+
inputs: [
|
|
74447
|
+
],
|
|
74448
|
+
name: "getMultipliers",
|
|
74449
|
+
outputs: [
|
|
74450
|
+
{
|
|
74451
|
+
internalType: "uint256[]",
|
|
74452
|
+
name: "_durationDaysThresholds",
|
|
74453
|
+
type: "uint256[]"
|
|
74454
|
+
},
|
|
74455
|
+
{
|
|
74456
|
+
internalType: "uint256[]",
|
|
74457
|
+
name: "_multipliers",
|
|
74458
|
+
type: "uint256[]"
|
|
74459
|
+
}
|
|
74460
|
+
],
|
|
74461
|
+
stateMutability: "view",
|
|
74462
|
+
type: "function"
|
|
74463
|
+
},
|
|
74464
|
+
{
|
|
74465
|
+
inputs: [
|
|
74466
|
+
{
|
|
74467
|
+
internalType: "address",
|
|
74468
|
+
name: "_votingEscrowAddress",
|
|
74469
|
+
type: "address"
|
|
74470
|
+
},
|
|
74471
|
+
{
|
|
74472
|
+
internalType: "uint256[]",
|
|
74473
|
+
name: "_durationDaysThresholds",
|
|
74474
|
+
type: "uint256[]"
|
|
74475
|
+
},
|
|
74476
|
+
{
|
|
74477
|
+
internalType: "uint256[]",
|
|
74478
|
+
name: "_multipliers",
|
|
74479
|
+
type: "uint256[]"
|
|
74480
|
+
}
|
|
74481
|
+
],
|
|
74482
|
+
name: "initialize",
|
|
74483
|
+
outputs: [
|
|
74484
|
+
],
|
|
74485
|
+
stateMutability: "nonpayable",
|
|
74486
|
+
type: "function"
|
|
74487
|
+
},
|
|
74488
|
+
{
|
|
74489
|
+
inputs: [
|
|
74490
|
+
{
|
|
74491
|
+
internalType: "uint256",
|
|
74492
|
+
name: "",
|
|
74493
|
+
type: "uint256"
|
|
74494
|
+
}
|
|
74495
|
+
],
|
|
74496
|
+
name: "multipliers",
|
|
74497
|
+
outputs: [
|
|
74498
|
+
{
|
|
74499
|
+
internalType: "uint256",
|
|
74500
|
+
name: "",
|
|
74501
|
+
type: "uint256"
|
|
74502
|
+
}
|
|
74503
|
+
],
|
|
74504
|
+
stateMutability: "view",
|
|
74505
|
+
type: "function"
|
|
74506
|
+
},
|
|
74507
|
+
{
|
|
74508
|
+
inputs: [
|
|
74509
|
+
],
|
|
74510
|
+
name: "owner",
|
|
74511
|
+
outputs: [
|
|
74512
|
+
{
|
|
74513
|
+
internalType: "address",
|
|
74514
|
+
name: "",
|
|
74515
|
+
type: "address"
|
|
74516
|
+
}
|
|
74517
|
+
],
|
|
74518
|
+
stateMutability: "view",
|
|
74519
|
+
type: "function"
|
|
74520
|
+
},
|
|
74521
|
+
{
|
|
74522
|
+
inputs: [
|
|
74523
|
+
],
|
|
74524
|
+
name: "renounceOwnership",
|
|
74525
|
+
outputs: [
|
|
74526
|
+
],
|
|
74527
|
+
stateMutability: "nonpayable",
|
|
74528
|
+
type: "function"
|
|
74529
|
+
},
|
|
74530
|
+
{
|
|
74531
|
+
inputs: [
|
|
74532
|
+
{
|
|
74533
|
+
internalType: "uint256[]",
|
|
74534
|
+
name: "_durationDaysThresholds",
|
|
74535
|
+
type: "uint256[]"
|
|
74536
|
+
},
|
|
74537
|
+
{
|
|
74538
|
+
internalType: "uint256[]",
|
|
74539
|
+
name: "_multipliers",
|
|
74540
|
+
type: "uint256[]"
|
|
74541
|
+
}
|
|
74542
|
+
],
|
|
74543
|
+
name: "setMultipliers",
|
|
74544
|
+
outputs: [
|
|
74545
|
+
],
|
|
74546
|
+
stateMutability: "nonpayable",
|
|
74547
|
+
type: "function"
|
|
74548
|
+
},
|
|
74549
|
+
{
|
|
74550
|
+
inputs: [
|
|
74551
|
+
{
|
|
74552
|
+
internalType: "address",
|
|
74553
|
+
name: "newOwner",
|
|
74554
|
+
type: "address"
|
|
74555
|
+
}
|
|
74556
|
+
],
|
|
74557
|
+
name: "transferOwnership",
|
|
74558
|
+
outputs: [
|
|
74559
|
+
],
|
|
74560
|
+
stateMutability: "nonpayable",
|
|
74561
|
+
type: "function"
|
|
74562
|
+
},
|
|
74563
|
+
{
|
|
74564
|
+
inputs: [
|
|
74565
|
+
],
|
|
74566
|
+
name: "votingEscrow",
|
|
74567
|
+
outputs: [
|
|
74568
|
+
{
|
|
74569
|
+
internalType: "contract IVotingEscrowV2Upgradeable",
|
|
74570
|
+
name: "",
|
|
74571
|
+
type: "address"
|
|
74572
|
+
}
|
|
74573
|
+
],
|
|
74574
|
+
stateMutability: "view",
|
|
74575
|
+
type: "function"
|
|
74576
|
+
}
|
|
74577
|
+
];
|
|
74578
|
+
|
|
74579
|
+
const TIERS_WEIGHT = {
|
|
74580
|
+
[types.LaunchBondTiers.Bronze]: '1000000000000000000000',
|
|
74581
|
+
[types.LaunchBondTiers.Silver]: '10000000000000000000000',
|
|
74582
|
+
[types.LaunchBondTiers.Gold]: '25000000000000000000000',
|
|
74583
|
+
[types.LaunchBondTiers.Diamond]: '100000000000000000000000',
|
|
74584
|
+
[types.LaunchBondTiers.Legend]: '500000000000000000000000',
|
|
74585
|
+
};
|
|
74586
|
+
const TIERS_NAMES = {
|
|
74587
|
+
[types.LaunchBondTiers.Bronze]: 'Bronze',
|
|
74588
|
+
[types.LaunchBondTiers.Silver]: 'Silver',
|
|
74589
|
+
[types.LaunchBondTiers.Gold]: 'Gold',
|
|
74590
|
+
[types.LaunchBondTiers.Diamond]: 'Diamond',
|
|
74591
|
+
[types.LaunchBondTiers.Legend]: 'Legend',
|
|
74592
|
+
};
|
|
74593
|
+
const getUserTier = (weight) => {
|
|
74594
|
+
const weightBG = new BigNumber$1(weight);
|
|
74595
|
+
const bronze = new BigNumber$1(TIERS_WEIGHT[types.LaunchBondTiers.Bronze]);
|
|
74596
|
+
const silver = new BigNumber$1(TIERS_WEIGHT[types.LaunchBondTiers.Silver]);
|
|
74597
|
+
const gold = new BigNumber$1(TIERS_WEIGHT[types.LaunchBondTiers.Gold]);
|
|
74598
|
+
const diamond = new BigNumber$1(TIERS_WEIGHT[types.LaunchBondTiers.Diamond]);
|
|
74599
|
+
const legend = new BigNumber$1(TIERS_WEIGHT[types.LaunchBondTiers.Legend]);
|
|
74600
|
+
if (weightBG.gte(legend)) {
|
|
74601
|
+
return types.LaunchBondTiers.Legend;
|
|
74602
|
+
}
|
|
74603
|
+
else if (weightBG.gte(diamond)) {
|
|
74604
|
+
return types.LaunchBondTiers.Diamond;
|
|
74605
|
+
}
|
|
74606
|
+
else if (weightBG.gte(gold)) {
|
|
74607
|
+
return types.LaunchBondTiers.Gold;
|
|
74608
|
+
}
|
|
74609
|
+
else if (weightBG.gte(silver)) {
|
|
74610
|
+
return types.LaunchBondTiers.Silver;
|
|
74611
|
+
}
|
|
74612
|
+
else if (weightBG.gte(bronze)) {
|
|
74613
|
+
return types.LaunchBondTiers.Bronze;
|
|
74614
|
+
}
|
|
74615
|
+
else
|
|
74616
|
+
return null;
|
|
74617
|
+
};
|
|
74618
|
+
const fetchEscrowWeight = (account) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
74619
|
+
const lensContractAddress = LENS_CONTRACT[types.ChainId.BSC];
|
|
74620
|
+
if (account) {
|
|
74621
|
+
try {
|
|
74622
|
+
const res = yield multicall(types.ChainId.BSC, lensContractABI, [
|
|
74623
|
+
{
|
|
74624
|
+
address: lensContractAddress,
|
|
74625
|
+
name: 'getEscrowWeight',
|
|
74626
|
+
params: [account],
|
|
74627
|
+
},
|
|
74628
|
+
]);
|
|
74629
|
+
return res[0][0].toString();
|
|
74630
|
+
}
|
|
74631
|
+
catch (e) {
|
|
74632
|
+
console.error(e);
|
|
74633
|
+
return '0';
|
|
74634
|
+
}
|
|
74635
|
+
}
|
|
74636
|
+
else
|
|
74637
|
+
return null;
|
|
74638
|
+
});
|
|
74639
|
+
function useGetUserEscrowWeight(account) {
|
|
74640
|
+
return useQuery({
|
|
74641
|
+
queryKey: [`${QUERY_KEYS.TIERS}-${account}`],
|
|
74642
|
+
queryFn: () => fetchEscrowWeight(account),
|
|
74643
|
+
staleTime: 60000,
|
|
74644
|
+
refetchInterval: 30000, // i.e. 30 secs
|
|
74645
|
+
refetchOnWindowFocus: false,
|
|
74646
|
+
});
|
|
74647
|
+
}
|
|
74648
|
+
|
|
74649
|
+
const TagXmasFlashBond = ({ userTier, minTier }) => {
|
|
74650
|
+
return (jsxs(Flex, { sx: {
|
|
74651
|
+
p: '5px 10px',
|
|
74652
|
+
width: '100%',
|
|
74653
|
+
background: '#DF4141',
|
|
74654
|
+
borderRadius: 'normal',
|
|
74655
|
+
mt: '10px',
|
|
74656
|
+
fontSize: '12px',
|
|
74657
|
+
fontWeight: 400,
|
|
74658
|
+
justifyContent: 'center',
|
|
74659
|
+
textAlign: 'center',
|
|
74660
|
+
display: 'block',
|
|
74661
|
+
}, children: ["This is a special ", jsx$2("span", { style: { fontWeight: 700 }, children: "Christmas Flash Bond." }), !userTier || (minTier !== undefined && userTier < minTier) ? (jsxs(Fragment$1, { children: [' ', "You need to achieve", ' ', jsxs("span", { style: { fontWeight: 700 }, children: [TIERS_NAMES[minTier], " Ape Tier"] }), " to be elegible!"] })) : (jsxs(Fragment$1, { children: [' ', "You are eligible to buy it thanks to your", ' ', jsxs("span", { style: { fontWeight: 700 }, children: [TIERS_NAMES[userTier], " Ape Tier!"] }), ' '] }))] }));
|
|
74228
74662
|
};
|
|
74229
74663
|
|
|
74230
74664
|
const BondModal = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond }) => {
|
|
@@ -74242,8 +74676,11 @@ const BondModal = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond }) =
|
|
|
74242
74676
|
const { sendTransactionAsync } = useSendTransaction();
|
|
74243
74677
|
const { data: bonds } = useBondsData();
|
|
74244
74678
|
const sendReferenceId = useSendReferenceId();
|
|
74679
|
+
const { data: userEscrowWeight } = useGetUserEscrowWeight(account);
|
|
74680
|
+
const userTier = getUserTier(userEscrowWeight !== null && userEscrowWeight !== void 0 ? userEscrowWeight : '0');
|
|
74245
74681
|
// State
|
|
74246
74682
|
const bondData = useMemo(() => bonds === null || bonds === void 0 ? void 0 : bonds.find((bond) => { var _a; return ((_a = bond === null || bond === void 0 ? void 0 : bond.billAddress) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === (bondAddress === null || bondAddress === void 0 ? void 0 : bondAddress.toLowerCase()); }), [bondAddress]);
|
|
74683
|
+
const isXmasStyle = (bondData === null || bondData === void 0 ? void 0 : bondData.minTier) ? bondData.minTier : null;
|
|
74247
74684
|
const [buyTxHash, setBuyTxHash] = useState();
|
|
74248
74685
|
const [inputValue, setInputValue] = useState('');
|
|
74249
74686
|
const [inputTokenString, setInputTokenString] = useState((_c = (_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.chainId]) !== null && _c !== void 0 ? _c : 'NATIVE');
|
|
@@ -74420,16 +74857,6 @@ const BondModal = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond }) =
|
|
|
74420
74857
|
}
|
|
74421
74858
|
}
|
|
74422
74859
|
};
|
|
74423
|
-
const [openNoBonusModal] = useModal(jsx$2(NoBonusModal, { onAcknowledge: handleBothPurchases }), true, true);
|
|
74424
|
-
const handleOpenModal = () => {
|
|
74425
|
-
var _a;
|
|
74426
|
-
if ((_a = bondData === null || bondData === void 0 ? void 0 : bondData.bonus) !== null && _a !== void 0 ? _a : 0 < 0) {
|
|
74427
|
-
openNoBonusModal();
|
|
74428
|
-
}
|
|
74429
|
-
else {
|
|
74430
|
-
handleBothPurchases();
|
|
74431
|
-
}
|
|
74432
|
-
};
|
|
74433
74860
|
const openExternal = () => {
|
|
74434
74861
|
if ((bondData === null || bondData === void 0 ? void 0 : bondData.chainId) === types.ChainId.LIGHTLINK) {
|
|
74435
74862
|
window.open('https://bridge.lightlink.io/bridge?from=ETHEREUM&to=LIGHTLINK&token=ETH', '_blank');
|
|
@@ -74441,7 +74868,7 @@ const BondModal = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond }) =
|
|
|
74441
74868
|
window.open(`https://ape.bond/swap?outputcurrency=${bondData === null || bondData === void 0 ? void 0 : bondData.lpToken.address[bondData === null || bondData === void 0 ? void 0 : bondData.chainId]}&outputChain=${bondData === null || bondData === void 0 ? void 0 : bondData.chainId}`, '_blank');
|
|
74442
74869
|
}
|
|
74443
74870
|
};
|
|
74444
|
-
return (jsx$2(Modal, { className:
|
|
74871
|
+
return (jsx$2(Modal, { className: `modal ${isXmasStyle ? 'xmas-style' : ''}`, onDismiss: onDismiss, children: modalVariant === 'standard' ? (jsx$2(Fragment$1, { children: bondData && (jsxs(Flex, { className: "modal-content", children: [typeof window !== 'undefined' && window.location.origin === 'http://localhost:5173' && (jsxs(Text, { sx: { borderBottom: '1px solid white', fontSize: '14px', mb: '10px' }, children: ["Dev mode - Current view: \"standard\"", jsx$2(Text, { onClick: () => setModalVariant('alt'), sx: { ml: '15px', textDecoration: 'underline', cursor: 'pointer' }, children: "Switch view" })] })), 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 }), jsx$2(BondCards, { bondData: bondData }), jsx$2(Estimations, { bondData: bondData, inputValue: inputValue, inputToken: inputToken, estimatedOutput: estimatedOutput, inputTokenPrice: inputTokenPrice === null || inputTokenPrice === void 0 ? void 0 : inputTokenPrice.price, isZap: isZap, fetchingZapQuote: fetchingZapQuote, zapError: zapError }), jsx$2(TokenSelectorPanel, { typedValue: inputValue, setTypedValue: setInputValue, selectedToken: inputToken, handleValueBtn: () => { var _a; return setInputValue((_a = new BigNumber$1(inputCurrencyBalance !== null && inputCurrencyBalance !== void 0 ? inputCurrencyBalance : '0')) === null || _a === void 0 ? void 0 : _a.toString()); }, handleCurrencySelect: handleCurrencySelect, chainId: bondData === null || bondData === void 0 ? void 0 : bondData.chainId, enableZap: supportedByLIFI.includes(bondData === null || bondData === void 0 ? void 0 : bondData.chainId), bondPrincipalToken: bondData === null || bondData === void 0 ? void 0 : bondData.lpToken, tokenBalance: inputCurrencyBalance, selectedTokenPrice: inputTokenPrice === null || inputTokenPrice === void 0 ? void 0 : inputTokenPrice.price, inputDisabled: isXmasStyle && bondData.minTier && (!userTier || userTier < bondData.minTier) ? true : false }), bondData.type === 'staking' && (jsxs(Flex, { sx: {
|
|
74445
74872
|
p: '5px 10px',
|
|
74446
74873
|
width: '100%',
|
|
74447
74874
|
background: '#8E568F',
|
|
@@ -74451,7 +74878,8 @@ const BondModal = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond }) =
|
|
|
74451
74878
|
fontWeight: 400,
|
|
74452
74879
|
justifyContent: 'center',
|
|
74453
74880
|
display: 'block',
|
|
74454
|
-
}, children: ["Tokens bought through this bond will go directly to the", ' ', jsx$2("span", { onClick: () => window.open('https://basepad.finance/earn', '_blank'), style: { textDecoration: 'underline', cursor: 'pointer', color: 'blue' }, children: "$BPAD staking pool" }), ' ', "with a ", daysLeftOnBasepadPool(), " days lock."] })),
|
|
74881
|
+
}, children: ["Tokens bought through this bond will go directly to the", ' ', jsx$2("span", { onClick: () => window.open('https://basepad.finance/earn', '_blank'), style: { textDecoration: 'underline', cursor: 'pointer', color: 'blue' }, children: "$BPAD staking pool" }), ' ', "with a ", daysLeftOnBasepadPool(), " days lock."] })), isXmasStyle && (bondData === null || bondData === void 0 ? void 0 : bondData.minTier) !== undefined && (jsx$2(TagXmasFlashBond, { userTier: userTier, minTier: bondData.minTier })), jsxs(Flex, { className: "modaltable-container button-container", children: [account &&
|
|
74882
|
+
(!isXmasStyle || (isXmasStyle && bondData.minTier && userTier && userTier >= bondData.minTier)) && (jsx$2(Flex, { className: "button-container get", children: jsxs(Button, { className: "action-button", onClick: () => supportedByLIFI.includes(bondData === null || bondData === void 0 ? void 0 : bondData.chainId) ? handleOpenZapModal() : openExternal(), variant: "secondary", children: ["Get ", getSymbol(bondData === null || bondData === void 0 ? void 0 : bondData.lpToken)] }) })), jsx$2(Flex, { className: "button-container buy", children: !account ? (jsx$2(ConnectButton, {})) : isXmasStyle && bondData.minTier && (!userTier || userTier < bondData.minTier) ? (jsx$2(Button, { className: "action-button", onClick: () => window.open(`https://www.ape.bond/tier-staking`, '_blank'), children: "GET YOUR TIER" })) : userChainId !== bondData.chainId ? (jsx$2(Button, { className: "switch-button", disabled: loadingTx || isConfirming || (bondData === null || bondData === void 0 ? void 0 : bondData.soldOut), onClick: (event) => {
|
|
74455
74883
|
event.stopPropagation();
|
|
74456
74884
|
switchChain({ chainId: bondData.chainId });
|
|
74457
74885
|
}, style: { fontSize: '14px', padding: '6px', marginLeft: '0px' }, children: `Switch to ${NETWORK_LABEL[bondData.chainId]}` })) : approvalState === ApprovalState.APPROVED ? (jsx$2(Button, { className: "action-button", load: load || fetchingZapQuote, disabled: load ||
|
|
@@ -74460,7 +74888,7 @@ const BondModal = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond }) =
|
|
|
74460
74888
|
!inputValue ||
|
|
74461
74889
|
parseFloat(inputValue) === 0 ||
|
|
74462
74890
|
fetchingZapQuote ||
|
|
74463
|
-
zapError, onClick:
|
|
74891
|
+
zapError, onClick: handleBothPurchases, children: zapError ? 'something went wrong' : `buy` })) : (jsx$2(Button, { className: "action-button", load: approvalState === ApprovalState.PENDING, disabled: approvalState === ApprovalState.PENDING ||
|
|
74464
74892
|
(bondData === null || bondData === void 0 ? void 0 : bondData.soldOut) ||
|
|
74465
74893
|
!account ||
|
|
74466
74894
|
!inputValue ||
|
|
@@ -74502,6 +74930,7 @@ const BondModal = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond }) =
|
|
|
74502
74930
|
* */
|
|
74503
74931
|
const ModalHandler = ({ onDismiss, bondAddress, bondChain, }) => {
|
|
74504
74932
|
var _a;
|
|
74933
|
+
const locationPath = window.location.pathname;
|
|
74505
74934
|
const [billId, setBillId] = useState('');
|
|
74506
74935
|
const [buyTxHash, setBuyTxHash] = useState('');
|
|
74507
74936
|
const { data: txReceipt } = useMonitorTxHash(buyTxHash, bondChain);
|
|
@@ -74533,7 +74962,7 @@ const ModalHandler = ({ onDismiss, bondAddress, bondChain, }) => {
|
|
|
74533
74962
|
}
|
|
74534
74963
|
}, [billId]);
|
|
74535
74964
|
return billId ? (jsx$2(YourBondsModal, { userBill: userBill, onDismiss: onDismiss })) : (jsx$2(BondModal, { bondAddress: bondAddress, bondChain: bondChain, handlePurchasedBond: setBuyTxHash, onDismiss: () => {
|
|
74536
|
-
window.history.pushState({}, '',
|
|
74965
|
+
window.history.pushState({}, '', `${locationPath !== '/bonds' ? locationPath : '/bonds'}`);
|
|
74537
74966
|
onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss();
|
|
74538
74967
|
} }));
|
|
74539
74968
|
};
|
|
@@ -74681,18 +75110,20 @@ var ProgressBarWrapper$1 = React__default.memo(ProgressBarWrapper);
|
|
|
74681
75110
|
|
|
74682
75111
|
const BondRow = ({ bond }) => {
|
|
74683
75112
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
75113
|
+
const locationPath = window.location.pathname.replace('/', '');
|
|
74684
75114
|
const billAddress = 'billAddress' in bond
|
|
74685
75115
|
? bond.billAddress
|
|
74686
75116
|
: 'contractAddress' in bond
|
|
74687
75117
|
? bond.contractAddress[bond.chainId]
|
|
74688
75118
|
: undefined;
|
|
74689
75119
|
const bonus = 'bonus' in bond ? bond.bonus : undefined;
|
|
75120
|
+
const isXmasStyle = 'minTier' in bond ? bond.minTier : null;
|
|
74690
75121
|
// Modal
|
|
74691
75122
|
const [openBuyModal] = useModal(jsx$2(ModalHandler, { bondAddress: billAddress, bondChain: bond.chainId }), true, true, `buyBondModal-${billAddress}-${bond.chainId}`);
|
|
74692
75123
|
const handleOpenModal = () => {
|
|
74693
75124
|
openBuyModal();
|
|
74694
75125
|
if (typeof window !== 'undefined') {
|
|
74695
|
-
window.history.pushState({}, '',
|
|
75126
|
+
window.history.pushState({}, '', `${locationPath}?bondAddress=${billAddress}&bondChain=${bond.chainId}`);
|
|
74696
75127
|
}
|
|
74697
75128
|
track({
|
|
74698
75129
|
event: 'buyModalOpen',
|
|
@@ -74724,7 +75155,7 @@ const BondRow = ({ bond }) => {
|
|
|
74724
75155
|
const tokens = new BigNumber$1(tokensRemaining);
|
|
74725
75156
|
return tokens.times(payoutTokenPrice);
|
|
74726
75157
|
};
|
|
74727
|
-
return (jsxs("div", { className:
|
|
75158
|
+
return (jsxs("div", { className: `bond-row ${isXmasStyle ? 'xmas-border' : ''}`, onClick: handleOpenModal, children: [jsxs("div", { className: "token-info-container", children: [isXmasStyle && jsx$2("img", { src: "/images/bills/xmasHat.png", alt: "xmas-hat", className: "xmas-hat" }), jsx$2(TokenInfoAndName, { bill: bond })] }), jsxs("div", { className: "bond-info-columns", children: [jsx$2("div", { className: `discount-column ${getDiscountColor(bonus)}`, children: bonus !== undefined ? `${bonus === null || bonus === void 0 ? void 0 : bonus.toFixed(2)}%` : '-' }), jsx$2("div", { className: "arr-column", children: calculateARR(bond) !== undefined ? calculateARR(bond) : '-' }), jsx$2("div", { className: "terms-column", children: bond.type === 'staking'
|
|
74728
75159
|
? `${daysLeftOnBasepadPool()} D Lock`
|
|
74729
75160
|
: vestingTime((_a = bond === null || bond === void 0 ? void 0 : bond.vestingTerm) !== null && _a !== void 0 ? _a : 0).days
|
|
74730
75161
|
? `${vestingTime((_b = bond === null || bond === void 0 ? void 0 : bond.vestingTerm) !== null && _b !== void 0 ? _b : 0).days} D`
|
|
@@ -74756,7 +75187,7 @@ const HotBondCard = ({ bond }) => {
|
|
|
74756
75187
|
},
|
|
74757
75188
|
});
|
|
74758
75189
|
};
|
|
74759
|
-
return (jsx$2(Flex, { sx: styles$a.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, { bill: bond, 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: (_c = (_b = (_a = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _a === void 0 ? void 0 : _a.address) === null || _b === void 0 ? void 0 : _b[bond === null || bond === void 0 ? void 0 : bond.chainId]) !== null && _c !== void 0 ? _c : '', earnTokenSymbol: (_e = (_d = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _d === void 0 ? void 0 : _d.symbol) !== null && _e !== void 0 ? _e : '', bondContract: (_f = bond === null || bond === void 0 ? void 0 : bond.billAddress) !== null && _f !== void 0 ? _f : '', 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 ?
|
|
75190
|
+
return (jsx$2(Flex, { sx: styles$a.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, { bill: bond, 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: (_c = (_b = (_a = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _a === void 0 ? void 0 : _a.address) === null || _b === void 0 ? void 0 : _b[bond === null || bond === void 0 ? void 0 : bond.chainId]) !== null && _c !== void 0 ? _c : '', earnTokenSymbol: (_e = (_d = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _d === void 0 ? void 0 : _d.symbol) !== null && _e !== void 0 ? _e : '', bondContract: (_f = bond === null || bond === void 0 ? void 0 : bond.billAddress) !== null && _f !== void 0 ? _f : '', 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 === 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) !== undefined ? calculateARR(bond) : '-' })] }), 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: ((_g = vestingTime(bond === null || bond === void 0 ? void 0 : bond.vestingTerm)) === null || _g === void 0 ? void 0 : _g.days) ? `${(_h = vestingTime(bond === null || bond === void 0 ? void 0 : bond.vestingTerm)) === null || _h === void 0 ? void 0 : _h.days} D` : '-' })] })] })] }) }));
|
|
74760
75191
|
};
|
|
74761
75192
|
|
|
74762
75193
|
function useHotBondContracts() {
|
|
@@ -75049,8 +75480,30 @@ const Bonds = () => {
|
|
|
75049
75480
|
const topTags = useTopTags(sortedBonds);
|
|
75050
75481
|
// remove favorites for seedify
|
|
75051
75482
|
const filterOptions = SDKConfig.referenceId !== 'seedify' ? ['ALL', 'FAVORITES', ...topTags, 'SOLD OUT'] : ['ALL', ...topTags, 'SOLD OUT'];
|
|
75483
|
+
let campaign = 'noCampaign';
|
|
75484
|
+
if (typeof window !== 'undefined' &&
|
|
75485
|
+
(window.location.host.includes('ape.bond') ||
|
|
75486
|
+
window.location.host.includes('apebond') ||
|
|
75487
|
+
window.location.host.includes('localhost'))) {
|
|
75488
|
+
if (window.location.pathname.includes('christmas-sale'))
|
|
75489
|
+
campaign = 'xmas';
|
|
75490
|
+
if (window.location.pathname.includes('bonds'))
|
|
75491
|
+
campaign = 'combined';
|
|
75492
|
+
}
|
|
75052
75493
|
const billsToRender = useMemo(() => {
|
|
75053
75494
|
let billsToReturn = filterOption === 'SOLD OUT' ? (allBonds !== null && allBonds !== void 0 ? allBonds : []) : (sortedBonds !== null && sortedBonds !== void 0 ? sortedBonds : []);
|
|
75495
|
+
if (campaign === undefined || campaign === 'noCampaign') {
|
|
75496
|
+
billsToReturn = billsToReturn === null || billsToReturn === void 0 ? void 0 : billsToReturn.filter((bill) => {
|
|
75497
|
+
const isXmasStyle = 'minTier' in bill ? bill.minTier : null;
|
|
75498
|
+
return !isXmasStyle;
|
|
75499
|
+
});
|
|
75500
|
+
}
|
|
75501
|
+
if (campaign === 'xmas') {
|
|
75502
|
+
billsToReturn = billsToReturn === null || billsToReturn === void 0 ? void 0 : billsToReturn.filter((bill) => {
|
|
75503
|
+
const isXmasStyle = 'minTier' in bill ? bill.minTier : null;
|
|
75504
|
+
return isXmasStyle;
|
|
75505
|
+
});
|
|
75506
|
+
}
|
|
75054
75507
|
if (searchQuery) {
|
|
75055
75508
|
billsToReturn = billsToReturn === null || billsToReturn === void 0 ? void 0 : billsToReturn.filter((bill) => {
|
|
75056
75509
|
var _a, _b;
|
|
@@ -91462,7 +91915,7 @@ const styles = {
|
|
|
91462
91915
|
pr: '0px',
|
|
91463
91916
|
alignItems: 'center',
|
|
91464
91917
|
mt: ['15px', '15px', '15px', '5px'],
|
|
91465
|
-
|
|
91918
|
+
minHeight: ['330px', '330px', '330px', '430px'],
|
|
91466
91919
|
ml: ['0px', '0px', '0px', '5px'],
|
|
91467
91920
|
},
|
|
91468
91921
|
container: {
|
|
@@ -91523,6 +91976,7 @@ const ProjectView = ({ bondAddress, bondChain, historicalPrices }) => {
|
|
|
91523
91976
|
return ((_a = bond === null || bond === void 0 ? void 0 : bond.billAddress) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === (bondAddress === null || bondAddress === void 0 ? void 0 : bondAddress.toLowerCase()) &&
|
|
91524
91977
|
bondChain === bond.chainId.toString();
|
|
91525
91978
|
});
|
|
91979
|
+
const isXmasStyle = (bondData === null || bondData === void 0 ? void 0 : bondData.minTier) ? bondData.minTier : null;
|
|
91526
91980
|
// Hooks
|
|
91527
91981
|
const userChainId = useChainId();
|
|
91528
91982
|
const { address: account } = useAccount();
|
|
@@ -91530,6 +91984,8 @@ const ProjectView = ({ bondAddress, bondChain, historicalPrices }) => {
|
|
|
91530
91984
|
const { writeContractAsync } = useWriteContract();
|
|
91531
91985
|
const { sendTransactionAsync } = useSendTransaction();
|
|
91532
91986
|
const sendReferenceId = useSendReferenceId();
|
|
91987
|
+
const { data: userEscrowWeight } = useGetUserEscrowWeight(account);
|
|
91988
|
+
const userTier = getUserTier(userEscrowWeight !== null && userEscrowWeight !== void 0 ? userEscrowWeight : '0');
|
|
91533
91989
|
const [buyTxHash, setBuyTxHash] = useState();
|
|
91534
91990
|
const [inputValue, setInputValue] = useState('');
|
|
91535
91991
|
const [inputTokenString, setInputTokenString] = useState('');
|
|
@@ -91663,14 +92119,26 @@ const ProjectView = ({ bondAddress, bondChain, historicalPrices }) => {
|
|
|
91663
92119
|
'&& > div > div': {
|
|
91664
92120
|
background: 'white2',
|
|
91665
92121
|
},
|
|
91666
|
-
}, children: jsx$2(BondCards, { bondData: bondData }) }), jsxs(Flex, { sx: { width: '100%', flexDirection: ['column', 'column', 'column', 'row'] }, children: [jsxs(Flex, { sx: {
|
|
92122
|
+
}, children: jsx$2(BondCards, { bondData: bondData }) }), jsxs(Flex, { sx: { width: '100%', flexDirection: ['column', 'column', 'column', 'row'], alignItems: 'stretch' }, children: [jsxs(Flex, { sx: {
|
|
91667
92123
|
width: ['100%', '100%', '100%', '50%'],
|
|
91668
92124
|
flexDirection: 'column',
|
|
91669
92125
|
background: 'white2',
|
|
91670
92126
|
p: '20px',
|
|
91671
92127
|
borderRadius: '10px',
|
|
91672
92128
|
mt: '5px',
|
|
91673
|
-
}, children: [jsx$2(BondModalHeader, { bondData: bondData }), jsx$2(ProjectDescription, { description: bondData.shortDescription }), jsx$2(Estimations, { bondData: bondData, inputValue: inputValue, inputToken: inputToken, estimatedOutput: estimatedOutput, inputTokenPrice: inputTokenPrice === null || inputTokenPrice === void 0 ? void 0 : inputTokenPrice.price, isZap: isZap, fetchingZapQuote: fetchingZapQuote, zapError: zapError }), jsx$2(TokenSelectorPanel, { typedValue: inputValue, setTypedValue: setInputValue, selectedToken: inputToken, handleValueBtn: () => { var _a; return setInputValue((_a = new BigNumber$1(inputCurrencyBalance !== null && inputCurrencyBalance !== void 0 ? inputCurrencyBalance : '0')) === null || _a === void 0 ? void 0 : _a.toString()); }, handleCurrencySelect: handleCurrencySelect, chainId: bondData === null || bondData === void 0 ? void 0 : bondData.chainId, enableZap: supportedByLIFI.includes(bondData === null || bondData === void 0 ? void 0 : bondData.chainId), bondPrincipalToken: bondData === null || bondData === void 0 ? void 0 : bondData.lpToken, tokenBalance: inputCurrencyBalance, selectedTokenPrice: inputTokenPrice === null || inputTokenPrice === void 0 ? void 0 : inputTokenPrice.price }),
|
|
92129
|
+
}, className: `project-view ${isXmasStyle ? 'xmas-style' : ''}`, children: [jsx$2(BondModalHeader, { bondData: bondData }), jsx$2(ProjectDescription, { description: bondData.shortDescription }), jsx$2(Estimations, { bondData: bondData, inputValue: inputValue, inputToken: inputToken, estimatedOutput: estimatedOutput, inputTokenPrice: inputTokenPrice === null || inputTokenPrice === void 0 ? void 0 : inputTokenPrice.price, isZap: isZap, fetchingZapQuote: fetchingZapQuote, zapError: zapError }), jsx$2(TokenSelectorPanel, { typedValue: inputValue, setTypedValue: setInputValue, selectedToken: inputToken, handleValueBtn: () => { var _a; return setInputValue((_a = new BigNumber$1(inputCurrencyBalance !== null && inputCurrencyBalance !== void 0 ? inputCurrencyBalance : '0')) === null || _a === void 0 ? void 0 : _a.toString()); }, handleCurrencySelect: handleCurrencySelect, chainId: bondData === null || bondData === void 0 ? void 0 : bondData.chainId, enableZap: supportedByLIFI.includes(bondData === null || bondData === void 0 ? void 0 : bondData.chainId), bondPrincipalToken: bondData === null || bondData === void 0 ? void 0 : bondData.lpToken, tokenBalance: inputCurrencyBalance, selectedTokenPrice: inputTokenPrice === null || inputTokenPrice === void 0 ? void 0 : inputTokenPrice.price }), bondData.type === 'staking' && (jsxs(Flex, { sx: {
|
|
92130
|
+
p: '5px 10px',
|
|
92131
|
+
width: '100%',
|
|
92132
|
+
background: '#8E568F',
|
|
92133
|
+
borderRadius: 'normal',
|
|
92134
|
+
mt: '10px',
|
|
92135
|
+
fontSize: '12px',
|
|
92136
|
+
fontWeight: 400,
|
|
92137
|
+
justifyContent: 'center',
|
|
92138
|
+
display: 'block',
|
|
92139
|
+
}, children: ["Tokens bought through this bond will go directly to the", ' ', jsx$2("span", { onClick: () => window.open('https://basepad.finance/earn', '_blank'), style: { textDecoration: 'underline', cursor: 'pointer', color: 'blue' }, children: "$BPAD staking pool" }), ' ', "with a ", daysLeftOnBasepadPool(), " days lock."] })), isXmasStyle && (bondData === null || bondData === void 0 ? void 0 : bondData.minTier) !== undefined && (jsx$2(TagXmasFlashBond, { userTier: userTier, minTier: bondData === null || bondData === void 0 ? void 0 : bondData.minTier })), jsxs(Flex, { className: "modaltable-container button-container", children: [account &&
|
|
92140
|
+
(!isXmasStyle ||
|
|
92141
|
+
(isXmasStyle && bondData.minTier && (!userTier || userTier >= bondData.minTier))) && (jsx$2(Flex, { className: "button-container get", children: jsxs(Button, { className: "action-button", onClick: () => supportedByLIFI.includes(bondData === null || bondData === void 0 ? void 0 : bondData.chainId) ? handleOpenZapModal() : openExternal(), variant: "secondary", children: ["Get ", getSymbol(bondData === null || bondData === void 0 ? void 0 : bondData.lpToken)] }) })), jsx$2(Flex, { className: "button-container buy", children: !account ? (jsx$2(ConnectButton, {})) : isXmasStyle && bondData.minTier && (!userTier || userTier < bondData.minTier) ? (jsx$2(Button, { className: "action-button", onClick: () => window.open(`https://www.ape.bond/tier-staking`, '_blank'), children: "GET YOUR TIER" })) : userChainId !== bondData.chainId ? (jsx$2(Button, { className: "switch-button", disabled: loadingTx || isConfirming || (bondData === null || bondData === void 0 ? void 0 : bondData.soldOut), onClick: (event) => {
|
|
91674
92142
|
event.stopPropagation();
|
|
91675
92143
|
switchChain({ chainId: bondData.chainId });
|
|
91676
92144
|
}, style: { fontSize: '14px', padding: '6px', marginLeft: '0px' }, children: `Switch to ${NETWORK_LABEL[bondData.chainId]}` })) : approvalState === ApprovalState.APPROVED ? (jsx$2(Button, { className: "action-button", load: load || fetchingZapQuote, disabled: load ||
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LaunchBondTiers } from '@ape.swap/apeswap-lists';
|
|
2
|
+
export declare const TIERS_NAMES: {
|
|
3
|
+
0: string;
|
|
4
|
+
1: string;
|
|
5
|
+
2: string;
|
|
6
|
+
3: string;
|
|
7
|
+
4: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const getUserTier: (weight: string) => LaunchBondTiers | null;
|
|
10
|
+
export declare const fetchEscrowWeight: (account?: string) => Promise<string | null>;
|
|
11
|
+
export default function useGetUserEscrowWeight(account?: string): import("@tanstack/react-query").UseQueryResult<string | null, Error>;
|
package/dist/styles.css
CHANGED
|
@@ -131,10 +131,70 @@
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
+
.project-view .xmas-hat {
|
|
135
|
+
display: none;
|
|
136
|
+
}
|
|
137
|
+
.project-view .xmas-tag {
|
|
138
|
+
display: none;
|
|
139
|
+
}
|
|
140
|
+
|
|
134
141
|
.modal {
|
|
135
142
|
width: fit-content !important;
|
|
136
143
|
max-width: 95%;
|
|
137
144
|
}
|
|
145
|
+
.modal .xmas-hat {
|
|
146
|
+
display: none;
|
|
147
|
+
}
|
|
148
|
+
.modal .xmas-tag {
|
|
149
|
+
display: none;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.project-view.xmas-style {
|
|
153
|
+
background: url("/images/bills/xmasRowBG.png");
|
|
154
|
+
background-size: contain;
|
|
155
|
+
}
|
|
156
|
+
.project-view.xmas-style .bond-card-block, .project-view.xmas-style .token-selector-panel {
|
|
157
|
+
background-color: rgb(38, 51, 63);
|
|
158
|
+
}
|
|
159
|
+
.project-view.xmas-style .input-container.token {
|
|
160
|
+
background-color: rgb(45, 58, 71);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.modal.xmas-style, .project-view.xmas-style {
|
|
164
|
+
background-color: rgb(31, 44, 56);
|
|
165
|
+
}
|
|
166
|
+
.modal.xmas-style .title-container.bondicon .xmas-hat, .project-view.xmas-style .title-container.bondicon .xmas-hat {
|
|
167
|
+
display: block;
|
|
168
|
+
position: absolute;
|
|
169
|
+
z-index: 9;
|
|
170
|
+
left: 13px;
|
|
171
|
+
top: -18px;
|
|
172
|
+
}
|
|
173
|
+
.modal.xmas-style .title-container.bondname, .project-view.xmas-style .title-container.bondname {
|
|
174
|
+
display: block;
|
|
175
|
+
}
|
|
176
|
+
.modal.xmas-style .title-container.bondname .list-tag, .project-view.xmas-style .title-container.bondname .list-tag {
|
|
177
|
+
background: #DF4141;
|
|
178
|
+
color: white;
|
|
179
|
+
}
|
|
180
|
+
.modal.xmas-style .modal-content, .project-view.xmas-style .modal-content {
|
|
181
|
+
background: url("/images/bills/xmasRowBG.png");
|
|
182
|
+
background-size: contain;
|
|
183
|
+
}
|
|
184
|
+
.modal.xmas-style .modal-content .bond-card-block, .modal.xmas-style .modal-content .token-selector-panel, .project-view.xmas-style .modal-content .bond-card-block, .project-view.xmas-style .modal-content .token-selector-panel {
|
|
185
|
+
background-color: rgb(38, 51, 63);
|
|
186
|
+
}
|
|
187
|
+
.modal.xmas-style .modal-content .input-container.token, .project-view.xmas-style .modal-content .input-container.token {
|
|
188
|
+
background-color: rgb(45, 58, 71);
|
|
189
|
+
}
|
|
190
|
+
.modal.xmas-style .hide-mobile, .project-view.xmas-style .hide-mobile {
|
|
191
|
+
display: none;
|
|
192
|
+
}
|
|
193
|
+
@media screen and (min-width: 800px) {
|
|
194
|
+
.modal.xmas-style .hide-mobile, .project-view.xmas-style .hide-mobile {
|
|
195
|
+
display: flex;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
138
198
|
|
|
139
199
|
.project-image {
|
|
140
200
|
border-radius: 6px;
|
|
@@ -185,6 +245,7 @@
|
|
|
185
245
|
display: flex;
|
|
186
246
|
flex-direction: row;
|
|
187
247
|
align-items: center;
|
|
248
|
+
position: relative;
|
|
188
249
|
}
|
|
189
250
|
|
|
190
251
|
.icon-container {
|
|
@@ -495,15 +556,13 @@
|
|
|
495
556
|
justify-content: center;
|
|
496
557
|
align-items: center;
|
|
497
558
|
cursor: pointer;
|
|
498
|
-
width:
|
|
559
|
+
width: 100%;
|
|
499
560
|
}
|
|
500
561
|
.button-container.buy .action-button {
|
|
501
|
-
width:
|
|
502
|
-
margin-left: 10px;
|
|
562
|
+
width: 100%;
|
|
503
563
|
}
|
|
504
564
|
.button-container.buy .switch-button {
|
|
505
|
-
width:
|
|
506
|
-
margin-left: 10px;
|
|
565
|
+
width: 100%;
|
|
507
566
|
}
|
|
508
567
|
|
|
509
568
|
.modaltable-container.accordion-container {
|
|
@@ -628,6 +687,18 @@ span.flex-inline {
|
|
|
628
687
|
min-height: 92px;
|
|
629
688
|
}
|
|
630
689
|
|
|
690
|
+
.show-alert-tier-xmas {
|
|
691
|
+
padding: 5px 10px;
|
|
692
|
+
width: 100%;
|
|
693
|
+
background: #DF4141;
|
|
694
|
+
border-radius: 4px;
|
|
695
|
+
margin-top: 10px !important;
|
|
696
|
+
font-size: 12px;
|
|
697
|
+
font-weight: 400;
|
|
698
|
+
justify-content: center;
|
|
699
|
+
text-align: center;
|
|
700
|
+
}
|
|
701
|
+
|
|
631
702
|
.bond-row {
|
|
632
703
|
display: flex;
|
|
633
704
|
flex-direction: row;
|
|
@@ -645,6 +716,13 @@ span.flex-inline {
|
|
|
645
716
|
.bond-row .token-info-container {
|
|
646
717
|
display: flex;
|
|
647
718
|
width: 40%;
|
|
719
|
+
position: relative;
|
|
720
|
+
}
|
|
721
|
+
.bond-row .token-info-container .xmas-hat {
|
|
722
|
+
position: absolute;
|
|
723
|
+
z-index: 9;
|
|
724
|
+
left: 25px;
|
|
725
|
+
top: 3px;
|
|
648
726
|
}
|
|
649
727
|
.bond-row .bond-info-columns {
|
|
650
728
|
display: flex;
|
|
@@ -702,6 +780,19 @@ span.flex-inline {
|
|
|
702
780
|
display: flex;
|
|
703
781
|
}
|
|
704
782
|
|
|
783
|
+
.bond-row.xmas-border {
|
|
784
|
+
background: url("/images/bills/xmasRowBG.png");
|
|
785
|
+
background-color: rgb(31, 44, 56);
|
|
786
|
+
}
|
|
787
|
+
.bond-row.xmas-border .tokeninfoname.container .list-tag {
|
|
788
|
+
background: #DF4141;
|
|
789
|
+
color: white;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
.bond-row.xmas-border:hover {
|
|
793
|
+
background-color: rgb(42, 64, 84);
|
|
794
|
+
}
|
|
795
|
+
|
|
705
796
|
.column.column-tokens {
|
|
706
797
|
display: flex;
|
|
707
798
|
align-items: center;
|
|
@@ -753,12 +844,12 @@ span.flex-inline {
|
|
|
753
844
|
}
|
|
754
845
|
|
|
755
846
|
.discount-positive {
|
|
756
|
-
color: #
|
|
847
|
+
color: #38A611;
|
|
757
848
|
width: 20%;
|
|
758
849
|
}
|
|
759
850
|
|
|
760
851
|
.discount-negative {
|
|
761
|
-
color: #
|
|
852
|
+
color: #DF4141;
|
|
762
853
|
width: 20%;
|
|
763
854
|
}
|
|
764
855
|
|
package/dist/types/bonds.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChainId, Token } from '@ape.swap/apeswap-lists';
|
|
1
|
+
import { ChainId, LaunchBondTiers, Token } from '@ape.swap/apeswap-lists';
|
|
2
2
|
export interface BondsData {
|
|
3
3
|
index?: number;
|
|
4
4
|
cmcId?: number;
|
|
@@ -27,4 +27,5 @@ export interface BondsData {
|
|
|
27
27
|
audit?: string;
|
|
28
28
|
earnToken: Token;
|
|
29
29
|
lpToken: Token;
|
|
30
|
+
minTier?: LaunchBondTiers;
|
|
30
31
|
}
|
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": "2.5.2-
|
|
6
|
+
"version": "2.5.2-testxmas.2",
|
|
7
7
|
"module": "dist/main.js",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"types": "dist/main.d.ts",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"yalc": "^1.0.0-pre.53"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@ape.swap/apeswap-lists": "3.73.
|
|
59
|
+
"@ape.swap/apeswap-lists": "3.73.5",
|
|
60
60
|
"@emotion/react": "11.11.4",
|
|
61
61
|
"bignumber.js": "^9.1.2",
|
|
62
62
|
"chart.js": "4.2.0",
|