@ape.swap/bonds-sdk 2.5.2-test3 → 2.5.2-testxmas.1
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 +500 -33
- package/dist/state/bonds/useGetUserEscrowWeight.d.ts +11 -0
- package/dist/state/useSDKConfig.d.ts +2 -0
- package/dist/styles.css +98 -7
- package/dist/types/bonds.d.ts +1 -0
- package/package.json +1 -1
- 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
|
@@ -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
|
|
|
@@ -71933,7 +71936,25 @@ function useBondsData() {
|
|
|
71933
71936
|
const getBondsData = (realTimeApiURL, tokenPrices, bondList) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
71934
71937
|
try {
|
|
71935
71938
|
const response = yield axios.get(realTimeApiURL);
|
|
71936
|
-
|
|
71939
|
+
const mockBonds = response.data.bonds.map((bond) => {
|
|
71940
|
+
let minTier = null;
|
|
71941
|
+
let tags = bond.tags;
|
|
71942
|
+
if (bond.index === 1110) {
|
|
71943
|
+
minTier = 4;
|
|
71944
|
+
tags = ['CHRISTMAS SALE'];
|
|
71945
|
+
}
|
|
71946
|
+
if (bond.index === 1108 || bond.index === 1104) {
|
|
71947
|
+
minTier = 3;
|
|
71948
|
+
tags = ['CHRISTMAS SALE'];
|
|
71949
|
+
}
|
|
71950
|
+
if (bond.index === 167) {
|
|
71951
|
+
minTier = 2;
|
|
71952
|
+
tags = ['CHRISTMAS SALE'];
|
|
71953
|
+
}
|
|
71954
|
+
return Object.assign(Object.assign({}, bond), { minTier,
|
|
71955
|
+
tags });
|
|
71956
|
+
});
|
|
71957
|
+
return mockBonds;
|
|
71937
71958
|
}
|
|
71938
71959
|
catch (_a) {
|
|
71939
71960
|
const billData = [];
|
|
@@ -72557,7 +72578,7 @@ const TokenSelectorModal = ({ bondPrincipalToken, bondEarnToken, handleCurrencyS
|
|
|
72557
72578
|
}) })] }) }) }));
|
|
72558
72579
|
};
|
|
72559
72580
|
|
|
72560
|
-
const TokenSelectorPanel = ({ typedValue, setTypedValue, selectedToken, chainId, handleValueBtn, handleCurrencySelect, enableZap, tokenBalance, selectedTokenPrice, bondPrincipalToken, bondEarnToken, modalVariant, }) => {
|
|
72581
|
+
const TokenSelectorPanel = ({ typedValue, setTypedValue, selectedToken, chainId, handleValueBtn, handleCurrencySelect, enableZap, tokenBalance, selectedTokenPrice, bondPrincipalToken, bondEarnToken, modalVariant, inputDisabled = false, }) => {
|
|
72561
72582
|
var _a, _b;
|
|
72562
72583
|
const { address: account } = useAccount();
|
|
72563
72584
|
const tokenBalanceString = tokenBalance ? new BigNumber$1(tokenBalance).toPrecision(5) : 'loading';
|
|
@@ -72580,7 +72601,7 @@ const TokenSelectorPanel = ({ typedValue, setTypedValue, selectedToken, chainId,
|
|
|
72580
72601
|
!!v.currentTarget.value && isNumber$1(v.currentTarget.value) && parseFloat(v.currentTarget.value) >= 0
|
|
72581
72602
|
? v.currentTarget.value
|
|
72582
72603
|
: 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
|
|
72604
|
+
}, 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
72605
|
? `$${formatUSDNumber((selectedTokenPrice * parseFloat(typedValue)).toFixed(2))}`
|
|
72585
72606
|
: '' }), 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
72607
|
};
|
|
@@ -74067,12 +74088,12 @@ const BondModalHeader = ({ bondData, onDismiss, showProjectInfoButton, }) => {
|
|
|
74067
74088
|
},
|
|
74068
74089
|
});
|
|
74069
74090
|
};
|
|
74070
|
-
return (jsxs(Flex, { className: "modaltable-container title-container", children: [
|
|
74091
|
+
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
74092
|
};
|
|
74072
74093
|
|
|
74073
74094
|
const BondCards = ({ bondData }) => {
|
|
74074
74095
|
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:
|
|
74096
|
+
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
74097
|
? `${daysLeftOnBasepadPool()} D Lock`
|
|
74077
74098
|
: vestingTime((_d = bondData === null || bondData === void 0 ? void 0 : bondData.vestingTerm) !== null && _d !== void 0 ? _d : 0).days
|
|
74078
74099
|
? `${vestingTime((_e = bondData === null || bondData === void 0 ? void 0 : bondData.vestingTerm) !== null && _e !== void 0 ? _e : 0).days} D`
|
|
@@ -74086,7 +74107,7 @@ const Estimations = ({ bondData, inputValue, inputToken, estimatedOutput, inputT
|
|
|
74086
74107
|
const estimatedInputUSD = parseFloat(inputValue) * (inputTokenPrice !== null && inputTokenPrice !== void 0 ? inputTokenPrice : 0);
|
|
74087
74108
|
const normalPremium = premium(bondData, inputValue);
|
|
74088
74109
|
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
|
|
74110
|
+
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
74111
|
};
|
|
74091
74112
|
|
|
74092
74113
|
// Custom HTML sanitizer
|
|
@@ -74218,13 +74239,425 @@ const RestrictedRegionModal = ({ onDismiss }) => {
|
|
|
74218
74239
|
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
74240
|
};
|
|
74220
74241
|
|
|
74221
|
-
|
|
74222
|
-
|
|
74223
|
-
|
|
74224
|
-
|
|
74225
|
-
|
|
74226
|
-
|
|
74227
|
-
|
|
74242
|
+
var lensContractABI = [
|
|
74243
|
+
{
|
|
74244
|
+
inputs: [
|
|
74245
|
+
],
|
|
74246
|
+
stateMutability: "nonpayable",
|
|
74247
|
+
type: "constructor"
|
|
74248
|
+
},
|
|
74249
|
+
{
|
|
74250
|
+
inputs: [
|
|
74251
|
+
],
|
|
74252
|
+
name: "DurationsNotDescendingOrder",
|
|
74253
|
+
type: "error"
|
|
74254
|
+
},
|
|
74255
|
+
{
|
|
74256
|
+
inputs: [
|
|
74257
|
+
],
|
|
74258
|
+
name: "MismatchedLengths",
|
|
74259
|
+
type: "error"
|
|
74260
|
+
},
|
|
74261
|
+
{
|
|
74262
|
+
inputs: [
|
|
74263
|
+
],
|
|
74264
|
+
name: "MultiplierBelowPrecision",
|
|
74265
|
+
type: "error"
|
|
74266
|
+
},
|
|
74267
|
+
{
|
|
74268
|
+
inputs: [
|
|
74269
|
+
],
|
|
74270
|
+
name: "NotLockOwner",
|
|
74271
|
+
type: "error"
|
|
74272
|
+
},
|
|
74273
|
+
{
|
|
74274
|
+
anonymous: false,
|
|
74275
|
+
inputs: [
|
|
74276
|
+
{
|
|
74277
|
+
indexed: false,
|
|
74278
|
+
internalType: "uint8",
|
|
74279
|
+
name: "version",
|
|
74280
|
+
type: "uint8"
|
|
74281
|
+
}
|
|
74282
|
+
],
|
|
74283
|
+
name: "Initialized",
|
|
74284
|
+
type: "event"
|
|
74285
|
+
},
|
|
74286
|
+
{
|
|
74287
|
+
anonymous: false,
|
|
74288
|
+
inputs: [
|
|
74289
|
+
{
|
|
74290
|
+
indexed: false,
|
|
74291
|
+
internalType: "uint256[]",
|
|
74292
|
+
name: "durationThresholds",
|
|
74293
|
+
type: "uint256[]"
|
|
74294
|
+
},
|
|
74295
|
+
{
|
|
74296
|
+
indexed: false,
|
|
74297
|
+
internalType: "uint256[]",
|
|
74298
|
+
name: "multipliers",
|
|
74299
|
+
type: "uint256[]"
|
|
74300
|
+
}
|
|
74301
|
+
],
|
|
74302
|
+
name: "MultipliersUpdated",
|
|
74303
|
+
type: "event"
|
|
74304
|
+
},
|
|
74305
|
+
{
|
|
74306
|
+
anonymous: false,
|
|
74307
|
+
inputs: [
|
|
74308
|
+
{
|
|
74309
|
+
indexed: true,
|
|
74310
|
+
internalType: "address",
|
|
74311
|
+
name: "previousOwner",
|
|
74312
|
+
type: "address"
|
|
74313
|
+
},
|
|
74314
|
+
{
|
|
74315
|
+
indexed: true,
|
|
74316
|
+
internalType: "address",
|
|
74317
|
+
name: "newOwner",
|
|
74318
|
+
type: "address"
|
|
74319
|
+
}
|
|
74320
|
+
],
|
|
74321
|
+
name: "OwnershipTransferred",
|
|
74322
|
+
type: "event"
|
|
74323
|
+
},
|
|
74324
|
+
{
|
|
74325
|
+
inputs: [
|
|
74326
|
+
],
|
|
74327
|
+
name: "MULTIPLIER_PRECISION",
|
|
74328
|
+
outputs: [
|
|
74329
|
+
{
|
|
74330
|
+
internalType: "uint256",
|
|
74331
|
+
name: "",
|
|
74332
|
+
type: "uint256"
|
|
74333
|
+
}
|
|
74334
|
+
],
|
|
74335
|
+
stateMutability: "view",
|
|
74336
|
+
type: "function"
|
|
74337
|
+
},
|
|
74338
|
+
{
|
|
74339
|
+
inputs: [
|
|
74340
|
+
{
|
|
74341
|
+
internalType: "uint256",
|
|
74342
|
+
name: "",
|
|
74343
|
+
type: "uint256"
|
|
74344
|
+
}
|
|
74345
|
+
],
|
|
74346
|
+
name: "durationDaysThresholds",
|
|
74347
|
+
outputs: [
|
|
74348
|
+
{
|
|
74349
|
+
internalType: "uint256",
|
|
74350
|
+
name: "",
|
|
74351
|
+
type: "uint256"
|
|
74352
|
+
}
|
|
74353
|
+
],
|
|
74354
|
+
stateMutability: "view",
|
|
74355
|
+
type: "function"
|
|
74356
|
+
},
|
|
74357
|
+
{
|
|
74358
|
+
inputs: [
|
|
74359
|
+
{
|
|
74360
|
+
internalType: "address",
|
|
74361
|
+
name: "escrowOwner",
|
|
74362
|
+
type: "address"
|
|
74363
|
+
}
|
|
74364
|
+
],
|
|
74365
|
+
name: "getEscrowWeight",
|
|
74366
|
+
outputs: [
|
|
74367
|
+
{
|
|
74368
|
+
internalType: "uint256",
|
|
74369
|
+
name: "totalWeight",
|
|
74370
|
+
type: "uint256"
|
|
74371
|
+
},
|
|
74372
|
+
{
|
|
74373
|
+
internalType: "uint256",
|
|
74374
|
+
name: "maxMultiplier",
|
|
74375
|
+
type: "uint256"
|
|
74376
|
+
},
|
|
74377
|
+
{
|
|
74378
|
+
internalType: "uint256",
|
|
74379
|
+
name: "maxTier",
|
|
74380
|
+
type: "uint256"
|
|
74381
|
+
}
|
|
74382
|
+
],
|
|
74383
|
+
stateMutability: "view",
|
|
74384
|
+
type: "function"
|
|
74385
|
+
},
|
|
74386
|
+
{
|
|
74387
|
+
inputs: [
|
|
74388
|
+
{
|
|
74389
|
+
internalType: "address",
|
|
74390
|
+
name: "escrowOwner",
|
|
74391
|
+
type: "address"
|
|
74392
|
+
},
|
|
74393
|
+
{
|
|
74394
|
+
internalType: "uint256[]",
|
|
74395
|
+
name: "tokenIds",
|
|
74396
|
+
type: "uint256[]"
|
|
74397
|
+
}
|
|
74398
|
+
],
|
|
74399
|
+
name: "getEscrowWeightForTokenIds",
|
|
74400
|
+
outputs: [
|
|
74401
|
+
{
|
|
74402
|
+
internalType: "uint256",
|
|
74403
|
+
name: "totalWeight",
|
|
74404
|
+
type: "uint256"
|
|
74405
|
+
},
|
|
74406
|
+
{
|
|
74407
|
+
internalType: "uint256",
|
|
74408
|
+
name: "maxMultiplier",
|
|
74409
|
+
type: "uint256"
|
|
74410
|
+
},
|
|
74411
|
+
{
|
|
74412
|
+
internalType: "uint256",
|
|
74413
|
+
name: "maxTier",
|
|
74414
|
+
type: "uint256"
|
|
74415
|
+
}
|
|
74416
|
+
],
|
|
74417
|
+
stateMutability: "view",
|
|
74418
|
+
type: "function"
|
|
74419
|
+
},
|
|
74420
|
+
{
|
|
74421
|
+
inputs: [
|
|
74422
|
+
{
|
|
74423
|
+
internalType: "uint256",
|
|
74424
|
+
name: "durationDays",
|
|
74425
|
+
type: "uint256"
|
|
74426
|
+
}
|
|
74427
|
+
],
|
|
74428
|
+
name: "getMultiplierForDaysLocked",
|
|
74429
|
+
outputs: [
|
|
74430
|
+
{
|
|
74431
|
+
internalType: "uint256",
|
|
74432
|
+
name: "multiplier",
|
|
74433
|
+
type: "uint256"
|
|
74434
|
+
},
|
|
74435
|
+
{
|
|
74436
|
+
internalType: "uint256",
|
|
74437
|
+
name: "tier",
|
|
74438
|
+
type: "uint256"
|
|
74439
|
+
}
|
|
74440
|
+
],
|
|
74441
|
+
stateMutability: "view",
|
|
74442
|
+
type: "function"
|
|
74443
|
+
},
|
|
74444
|
+
{
|
|
74445
|
+
inputs: [
|
|
74446
|
+
],
|
|
74447
|
+
name: "getMultipliers",
|
|
74448
|
+
outputs: [
|
|
74449
|
+
{
|
|
74450
|
+
internalType: "uint256[]",
|
|
74451
|
+
name: "_durationDaysThresholds",
|
|
74452
|
+
type: "uint256[]"
|
|
74453
|
+
},
|
|
74454
|
+
{
|
|
74455
|
+
internalType: "uint256[]",
|
|
74456
|
+
name: "_multipliers",
|
|
74457
|
+
type: "uint256[]"
|
|
74458
|
+
}
|
|
74459
|
+
],
|
|
74460
|
+
stateMutability: "view",
|
|
74461
|
+
type: "function"
|
|
74462
|
+
},
|
|
74463
|
+
{
|
|
74464
|
+
inputs: [
|
|
74465
|
+
{
|
|
74466
|
+
internalType: "address",
|
|
74467
|
+
name: "_votingEscrowAddress",
|
|
74468
|
+
type: "address"
|
|
74469
|
+
},
|
|
74470
|
+
{
|
|
74471
|
+
internalType: "uint256[]",
|
|
74472
|
+
name: "_durationDaysThresholds",
|
|
74473
|
+
type: "uint256[]"
|
|
74474
|
+
},
|
|
74475
|
+
{
|
|
74476
|
+
internalType: "uint256[]",
|
|
74477
|
+
name: "_multipliers",
|
|
74478
|
+
type: "uint256[]"
|
|
74479
|
+
}
|
|
74480
|
+
],
|
|
74481
|
+
name: "initialize",
|
|
74482
|
+
outputs: [
|
|
74483
|
+
],
|
|
74484
|
+
stateMutability: "nonpayable",
|
|
74485
|
+
type: "function"
|
|
74486
|
+
},
|
|
74487
|
+
{
|
|
74488
|
+
inputs: [
|
|
74489
|
+
{
|
|
74490
|
+
internalType: "uint256",
|
|
74491
|
+
name: "",
|
|
74492
|
+
type: "uint256"
|
|
74493
|
+
}
|
|
74494
|
+
],
|
|
74495
|
+
name: "multipliers",
|
|
74496
|
+
outputs: [
|
|
74497
|
+
{
|
|
74498
|
+
internalType: "uint256",
|
|
74499
|
+
name: "",
|
|
74500
|
+
type: "uint256"
|
|
74501
|
+
}
|
|
74502
|
+
],
|
|
74503
|
+
stateMutability: "view",
|
|
74504
|
+
type: "function"
|
|
74505
|
+
},
|
|
74506
|
+
{
|
|
74507
|
+
inputs: [
|
|
74508
|
+
],
|
|
74509
|
+
name: "owner",
|
|
74510
|
+
outputs: [
|
|
74511
|
+
{
|
|
74512
|
+
internalType: "address",
|
|
74513
|
+
name: "",
|
|
74514
|
+
type: "address"
|
|
74515
|
+
}
|
|
74516
|
+
],
|
|
74517
|
+
stateMutability: "view",
|
|
74518
|
+
type: "function"
|
|
74519
|
+
},
|
|
74520
|
+
{
|
|
74521
|
+
inputs: [
|
|
74522
|
+
],
|
|
74523
|
+
name: "renounceOwnership",
|
|
74524
|
+
outputs: [
|
|
74525
|
+
],
|
|
74526
|
+
stateMutability: "nonpayable",
|
|
74527
|
+
type: "function"
|
|
74528
|
+
},
|
|
74529
|
+
{
|
|
74530
|
+
inputs: [
|
|
74531
|
+
{
|
|
74532
|
+
internalType: "uint256[]",
|
|
74533
|
+
name: "_durationDaysThresholds",
|
|
74534
|
+
type: "uint256[]"
|
|
74535
|
+
},
|
|
74536
|
+
{
|
|
74537
|
+
internalType: "uint256[]",
|
|
74538
|
+
name: "_multipliers",
|
|
74539
|
+
type: "uint256[]"
|
|
74540
|
+
}
|
|
74541
|
+
],
|
|
74542
|
+
name: "setMultipliers",
|
|
74543
|
+
outputs: [
|
|
74544
|
+
],
|
|
74545
|
+
stateMutability: "nonpayable",
|
|
74546
|
+
type: "function"
|
|
74547
|
+
},
|
|
74548
|
+
{
|
|
74549
|
+
inputs: [
|
|
74550
|
+
{
|
|
74551
|
+
internalType: "address",
|
|
74552
|
+
name: "newOwner",
|
|
74553
|
+
type: "address"
|
|
74554
|
+
}
|
|
74555
|
+
],
|
|
74556
|
+
name: "transferOwnership",
|
|
74557
|
+
outputs: [
|
|
74558
|
+
],
|
|
74559
|
+
stateMutability: "nonpayable",
|
|
74560
|
+
type: "function"
|
|
74561
|
+
},
|
|
74562
|
+
{
|
|
74563
|
+
inputs: [
|
|
74564
|
+
],
|
|
74565
|
+
name: "votingEscrow",
|
|
74566
|
+
outputs: [
|
|
74567
|
+
{
|
|
74568
|
+
internalType: "contract IVotingEscrowV2Upgradeable",
|
|
74569
|
+
name: "",
|
|
74570
|
+
type: "address"
|
|
74571
|
+
}
|
|
74572
|
+
],
|
|
74573
|
+
stateMutability: "view",
|
|
74574
|
+
type: "function"
|
|
74575
|
+
}
|
|
74576
|
+
];
|
|
74577
|
+
|
|
74578
|
+
const TIERS_WEIGHT = {
|
|
74579
|
+
[types.LaunchBondTiers.Bronze]: '1000000000000000000000',
|
|
74580
|
+
[types.LaunchBondTiers.Silver]: '10000000000000000000000',
|
|
74581
|
+
[types.LaunchBondTiers.Gold]: '25000000000000000000000',
|
|
74582
|
+
[types.LaunchBondTiers.Diamond]: '100000000000000000000000',
|
|
74583
|
+
[types.LaunchBondTiers.Legend]: '500000000000000000000000',
|
|
74584
|
+
};
|
|
74585
|
+
const TIERS_NAMES = {
|
|
74586
|
+
[types.LaunchBondTiers.Bronze]: 'Bronze',
|
|
74587
|
+
[types.LaunchBondTiers.Silver]: 'Silver',
|
|
74588
|
+
[types.LaunchBondTiers.Gold]: 'Gold',
|
|
74589
|
+
[types.LaunchBondTiers.Diamond]: 'Diamond',
|
|
74590
|
+
[types.LaunchBondTiers.Legend]: 'Legend',
|
|
74591
|
+
};
|
|
74592
|
+
const getUserTier = (weight) => {
|
|
74593
|
+
const weightBG = new BigNumber$1(weight);
|
|
74594
|
+
const bronze = new BigNumber$1(TIERS_WEIGHT[types.LaunchBondTiers.Bronze]);
|
|
74595
|
+
const silver = new BigNumber$1(TIERS_WEIGHT[types.LaunchBondTiers.Silver]);
|
|
74596
|
+
const gold = new BigNumber$1(TIERS_WEIGHT[types.LaunchBondTiers.Gold]);
|
|
74597
|
+
const diamond = new BigNumber$1(TIERS_WEIGHT[types.LaunchBondTiers.Diamond]);
|
|
74598
|
+
const legend = new BigNumber$1(TIERS_WEIGHT[types.LaunchBondTiers.Legend]);
|
|
74599
|
+
if (weightBG.gte(legend)) {
|
|
74600
|
+
return types.LaunchBondTiers.Legend;
|
|
74601
|
+
}
|
|
74602
|
+
else if (weightBG.gte(diamond)) {
|
|
74603
|
+
return types.LaunchBondTiers.Diamond;
|
|
74604
|
+
}
|
|
74605
|
+
else if (weightBG.gte(gold)) {
|
|
74606
|
+
return types.LaunchBondTiers.Gold;
|
|
74607
|
+
}
|
|
74608
|
+
else if (weightBG.gte(silver)) {
|
|
74609
|
+
return types.LaunchBondTiers.Silver;
|
|
74610
|
+
}
|
|
74611
|
+
else if (weightBG.gte(bronze)) {
|
|
74612
|
+
return types.LaunchBondTiers.Bronze;
|
|
74613
|
+
}
|
|
74614
|
+
else
|
|
74615
|
+
return null;
|
|
74616
|
+
};
|
|
74617
|
+
const fetchEscrowWeight = (account) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
74618
|
+
const lensContractAddress = LENS_CONTRACT[types.ChainId.BSC];
|
|
74619
|
+
if (account) {
|
|
74620
|
+
try {
|
|
74621
|
+
const res = yield multicall(types.ChainId.BSC, lensContractABI, [
|
|
74622
|
+
{
|
|
74623
|
+
address: lensContractAddress,
|
|
74624
|
+
name: 'getEscrowWeight',
|
|
74625
|
+
params: [account],
|
|
74626
|
+
},
|
|
74627
|
+
]);
|
|
74628
|
+
return res[0][0].toString();
|
|
74629
|
+
}
|
|
74630
|
+
catch (e) {
|
|
74631
|
+
console.error(e);
|
|
74632
|
+
return '0';
|
|
74633
|
+
}
|
|
74634
|
+
}
|
|
74635
|
+
else
|
|
74636
|
+
return null;
|
|
74637
|
+
});
|
|
74638
|
+
function useGetUserEscrowWeight(account) {
|
|
74639
|
+
return useQuery({
|
|
74640
|
+
queryKey: [`${QUERY_KEYS.TIERS}-${account}`],
|
|
74641
|
+
queryFn: () => fetchEscrowWeight(account),
|
|
74642
|
+
staleTime: 60000,
|
|
74643
|
+
refetchInterval: 30000, // i.e. 30 secs
|
|
74644
|
+
refetchOnWindowFocus: false,
|
|
74645
|
+
});
|
|
74646
|
+
}
|
|
74647
|
+
|
|
74648
|
+
const TagXmasFlashBond = ({ userTier, minTier }) => {
|
|
74649
|
+
return (jsxs(Flex, { sx: {
|
|
74650
|
+
p: '5px 10px',
|
|
74651
|
+
width: '100%',
|
|
74652
|
+
background: '#DF4141',
|
|
74653
|
+
borderRadius: 'normal',
|
|
74654
|
+
mt: '10px',
|
|
74655
|
+
fontSize: '12px',
|
|
74656
|
+
fontWeight: 400,
|
|
74657
|
+
justifyContent: 'center',
|
|
74658
|
+
textAlign: 'center',
|
|
74659
|
+
display: 'block',
|
|
74660
|
+
}, 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
74661
|
};
|
|
74229
74662
|
|
|
74230
74663
|
const BondModal = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond }) => {
|
|
@@ -74242,8 +74675,11 @@ const BondModal = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond }) =
|
|
|
74242
74675
|
const { sendTransactionAsync } = useSendTransaction();
|
|
74243
74676
|
const { data: bonds } = useBondsData();
|
|
74244
74677
|
const sendReferenceId = useSendReferenceId();
|
|
74678
|
+
const { data: userEscrowWeight } = useGetUserEscrowWeight(account);
|
|
74679
|
+
const userTier = getUserTier(userEscrowWeight !== null && userEscrowWeight !== void 0 ? userEscrowWeight : '0');
|
|
74245
74680
|
// State
|
|
74246
74681
|
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]);
|
|
74682
|
+
const isXmasStyle = (bondData === null || bondData === void 0 ? void 0 : bondData.minTier) ? bondData.minTier : null;
|
|
74247
74683
|
const [buyTxHash, setBuyTxHash] = useState();
|
|
74248
74684
|
const [inputValue, setInputValue] = useState('');
|
|
74249
74685
|
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 +74856,6 @@ const BondModal = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond }) =
|
|
|
74420
74856
|
}
|
|
74421
74857
|
}
|
|
74422
74858
|
};
|
|
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
74859
|
const openExternal = () => {
|
|
74434
74860
|
if ((bondData === null || bondData === void 0 ? void 0 : bondData.chainId) === types.ChainId.LIGHTLINK) {
|
|
74435
74861
|
window.open('https://bridge.lightlink.io/bridge?from=ETHEREUM&to=LIGHTLINK&token=ETH', '_blank');
|
|
@@ -74441,7 +74867,7 @@ const BondModal = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond }) =
|
|
|
74441
74867
|
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
74868
|
}
|
|
74443
74869
|
};
|
|
74444
|
-
return (jsx$2(Modal, { className:
|
|
74870
|
+
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
74871
|
p: '5px 10px',
|
|
74446
74872
|
width: '100%',
|
|
74447
74873
|
background: '#8E568F',
|
|
@@ -74451,7 +74877,8 @@ const BondModal = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond }) =
|
|
|
74451
74877
|
fontWeight: 400,
|
|
74452
74878
|
justifyContent: 'center',
|
|
74453
74879
|
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."] })),
|
|
74880
|
+
}, 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 &&
|
|
74881
|
+
(!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
74882
|
event.stopPropagation();
|
|
74456
74883
|
switchChain({ chainId: bondData.chainId });
|
|
74457
74884
|
}, 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 +74887,7 @@ const BondModal = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond }) =
|
|
|
74460
74887
|
!inputValue ||
|
|
74461
74888
|
parseFloat(inputValue) === 0 ||
|
|
74462
74889
|
fetchingZapQuote ||
|
|
74463
|
-
zapError, onClick:
|
|
74890
|
+
zapError, onClick: handleBothPurchases, children: zapError ? 'something went wrong' : `buy` })) : (jsx$2(Button, { className: "action-button", load: approvalState === ApprovalState.PENDING, disabled: approvalState === ApprovalState.PENDING ||
|
|
74464
74891
|
(bondData === null || bondData === void 0 ? void 0 : bondData.soldOut) ||
|
|
74465
74892
|
!account ||
|
|
74466
74893
|
!inputValue ||
|
|
@@ -74502,6 +74929,7 @@ const BondModal = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond }) =
|
|
|
74502
74929
|
* */
|
|
74503
74930
|
const ModalHandler = ({ onDismiss, bondAddress, bondChain, }) => {
|
|
74504
74931
|
var _a;
|
|
74932
|
+
const locationPath = window.location.pathname;
|
|
74505
74933
|
const [billId, setBillId] = useState('');
|
|
74506
74934
|
const [buyTxHash, setBuyTxHash] = useState('');
|
|
74507
74935
|
const { data: txReceipt } = useMonitorTxHash(buyTxHash, bondChain);
|
|
@@ -74533,7 +74961,7 @@ const ModalHandler = ({ onDismiss, bondAddress, bondChain, }) => {
|
|
|
74533
74961
|
}
|
|
74534
74962
|
}, [billId]);
|
|
74535
74963
|
return billId ? (jsx$2(YourBondsModal, { userBill: userBill, onDismiss: onDismiss })) : (jsx$2(BondModal, { bondAddress: bondAddress, bondChain: bondChain, handlePurchasedBond: setBuyTxHash, onDismiss: () => {
|
|
74536
|
-
window.history.pushState({}, '',
|
|
74964
|
+
window.history.pushState({}, '', `${locationPath !== '/bonds' ? locationPath : '/bonds'}`);
|
|
74537
74965
|
onDismiss === null || onDismiss === void 0 ? void 0 : onDismiss();
|
|
74538
74966
|
} }));
|
|
74539
74967
|
};
|
|
@@ -74681,18 +75109,20 @@ var ProgressBarWrapper$1 = React__default.memo(ProgressBarWrapper);
|
|
|
74681
75109
|
|
|
74682
75110
|
const BondRow = ({ bond }) => {
|
|
74683
75111
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
75112
|
+
const locationPath = window.location.pathname.replace('/', '');
|
|
74684
75113
|
const billAddress = 'billAddress' in bond
|
|
74685
75114
|
? bond.billAddress
|
|
74686
75115
|
: 'contractAddress' in bond
|
|
74687
75116
|
? bond.contractAddress[bond.chainId]
|
|
74688
75117
|
: undefined;
|
|
74689
75118
|
const bonus = 'bonus' in bond ? bond.bonus : undefined;
|
|
75119
|
+
const isXmasStyle = 'minTier' in bond ? bond.minTier : null;
|
|
74690
75120
|
// Modal
|
|
74691
75121
|
const [openBuyModal] = useModal(jsx$2(ModalHandler, { bondAddress: billAddress, bondChain: bond.chainId }), true, true, `buyBondModal-${billAddress}-${bond.chainId}`);
|
|
74692
75122
|
const handleOpenModal = () => {
|
|
74693
75123
|
openBuyModal();
|
|
74694
75124
|
if (typeof window !== 'undefined') {
|
|
74695
|
-
window.history.pushState({}, '',
|
|
75125
|
+
window.history.pushState({}, '', `${locationPath}?bondAddress=${billAddress}&bondChain=${bond.chainId}`);
|
|
74696
75126
|
}
|
|
74697
75127
|
track({
|
|
74698
75128
|
event: 'buyModalOpen',
|
|
@@ -74724,7 +75154,7 @@ const BondRow = ({ bond }) => {
|
|
|
74724
75154
|
const tokens = new BigNumber$1(tokensRemaining);
|
|
74725
75155
|
return tokens.times(payoutTokenPrice);
|
|
74726
75156
|
};
|
|
74727
|
-
return (jsxs("div", { className:
|
|
75157
|
+
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
75158
|
? `${daysLeftOnBasepadPool()} D Lock`
|
|
74729
75159
|
: vestingTime((_a = bond === null || bond === void 0 ? void 0 : bond.vestingTerm) !== null && _a !== void 0 ? _a : 0).days
|
|
74730
75160
|
? `${vestingTime((_b = bond === null || bond === void 0 ? void 0 : bond.vestingTerm) !== null && _b !== void 0 ? _b : 0).days} D`
|
|
@@ -74756,7 +75186,7 @@ const HotBondCard = ({ bond }) => {
|
|
|
74756
75186
|
},
|
|
74757
75187
|
});
|
|
74758
75188
|
};
|
|
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 ?
|
|
75189
|
+
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
75190
|
};
|
|
74761
75191
|
|
|
74762
75192
|
function useHotBondContracts() {
|
|
@@ -75049,8 +75479,30 @@ const Bonds = () => {
|
|
|
75049
75479
|
const topTags = useTopTags(sortedBonds);
|
|
75050
75480
|
// remove favorites for seedify
|
|
75051
75481
|
const filterOptions = SDKConfig.referenceId !== 'seedify' ? ['ALL', 'FAVORITES', ...topTags, 'SOLD OUT'] : ['ALL', ...topTags, 'SOLD OUT'];
|
|
75482
|
+
let campaign = 'noCampaign';
|
|
75483
|
+
if (typeof window !== 'undefined' &&
|
|
75484
|
+
(window.location.host.includes('ape.bond') ||
|
|
75485
|
+
window.location.host.includes('apebond') ||
|
|
75486
|
+
window.location.host.includes('localhost'))) {
|
|
75487
|
+
if (window.location.pathname.includes('christmas-sale'))
|
|
75488
|
+
campaign = 'xmas';
|
|
75489
|
+
if (window.location.pathname.includes('bonds'))
|
|
75490
|
+
campaign = 'combined';
|
|
75491
|
+
}
|
|
75052
75492
|
const billsToRender = useMemo(() => {
|
|
75053
75493
|
let billsToReturn = filterOption === 'SOLD OUT' ? (allBonds !== null && allBonds !== void 0 ? allBonds : []) : (sortedBonds !== null && sortedBonds !== void 0 ? sortedBonds : []);
|
|
75494
|
+
if (campaign === undefined || campaign === 'noCampaign') {
|
|
75495
|
+
billsToReturn = billsToReturn === null || billsToReturn === void 0 ? void 0 : billsToReturn.filter((bill) => {
|
|
75496
|
+
const isXmasStyle = 'minTier' in bill ? bill.minTier : null;
|
|
75497
|
+
return !isXmasStyle;
|
|
75498
|
+
});
|
|
75499
|
+
}
|
|
75500
|
+
if (campaign === 'xmas') {
|
|
75501
|
+
billsToReturn = billsToReturn === null || billsToReturn === void 0 ? void 0 : billsToReturn.filter((bill) => {
|
|
75502
|
+
const isXmasStyle = 'minTier' in bill ? bill.minTier : null;
|
|
75503
|
+
return isXmasStyle;
|
|
75504
|
+
});
|
|
75505
|
+
}
|
|
75054
75506
|
if (searchQuery) {
|
|
75055
75507
|
billsToReturn = billsToReturn === null || billsToReturn === void 0 ? void 0 : billsToReturn.filter((bill) => {
|
|
75056
75508
|
var _a, _b;
|
|
@@ -91462,7 +91914,7 @@ const styles = {
|
|
|
91462
91914
|
pr: '0px',
|
|
91463
91915
|
alignItems: 'center',
|
|
91464
91916
|
mt: ['15px', '15px', '15px', '5px'],
|
|
91465
|
-
|
|
91917
|
+
minHeight: ['330px', '330px', '330px', '430px'],
|
|
91466
91918
|
ml: ['0px', '0px', '0px', '5px'],
|
|
91467
91919
|
},
|
|
91468
91920
|
container: {
|
|
@@ -91523,6 +91975,7 @@ const ProjectView = ({ bondAddress, bondChain, historicalPrices }) => {
|
|
|
91523
91975
|
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
91976
|
bondChain === bond.chainId.toString();
|
|
91525
91977
|
});
|
|
91978
|
+
const isXmasStyle = (bondData === null || bondData === void 0 ? void 0 : bondData.minTier) ? bondData.minTier : null;
|
|
91526
91979
|
// Hooks
|
|
91527
91980
|
const userChainId = useChainId();
|
|
91528
91981
|
const { address: account } = useAccount();
|
|
@@ -91530,6 +91983,8 @@ const ProjectView = ({ bondAddress, bondChain, historicalPrices }) => {
|
|
|
91530
91983
|
const { writeContractAsync } = useWriteContract();
|
|
91531
91984
|
const { sendTransactionAsync } = useSendTransaction();
|
|
91532
91985
|
const sendReferenceId = useSendReferenceId();
|
|
91986
|
+
const { data: userEscrowWeight } = useGetUserEscrowWeight(account);
|
|
91987
|
+
const userTier = getUserTier(userEscrowWeight !== null && userEscrowWeight !== void 0 ? userEscrowWeight : '0');
|
|
91533
91988
|
const [buyTxHash, setBuyTxHash] = useState();
|
|
91534
91989
|
const [inputValue, setInputValue] = useState('');
|
|
91535
91990
|
const [inputTokenString, setInputTokenString] = useState('');
|
|
@@ -91663,14 +92118,26 @@ const ProjectView = ({ bondAddress, bondChain, historicalPrices }) => {
|
|
|
91663
92118
|
'&& > div > div': {
|
|
91664
92119
|
background: 'white2',
|
|
91665
92120
|
},
|
|
91666
|
-
}, children: jsx$2(BondCards, { bondData: bondData }) }), jsxs(Flex, { sx: { width: '100%', flexDirection: ['column', 'column', 'column', 'row'] }, children: [jsxs(Flex, { sx: {
|
|
92121
|
+
}, children: jsx$2(BondCards, { bondData: bondData }) }), jsxs(Flex, { sx: { width: '100%', flexDirection: ['column', 'column', 'column', 'row'], alignItems: 'stretch' }, children: [jsxs(Flex, { sx: {
|
|
91667
92122
|
width: ['100%', '100%', '100%', '50%'],
|
|
91668
92123
|
flexDirection: 'column',
|
|
91669
92124
|
background: 'white2',
|
|
91670
92125
|
p: '20px',
|
|
91671
92126
|
borderRadius: '10px',
|
|
91672
92127
|
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 }),
|
|
92128
|
+
}, 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: {
|
|
92129
|
+
p: '5px 10px',
|
|
92130
|
+
width: '100%',
|
|
92131
|
+
background: '#8E568F',
|
|
92132
|
+
borderRadius: 'normal',
|
|
92133
|
+
mt: '10px',
|
|
92134
|
+
fontSize: '12px',
|
|
92135
|
+
fontWeight: 400,
|
|
92136
|
+
justifyContent: 'center',
|
|
92137
|
+
display: 'block',
|
|
92138
|
+
}, 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 &&
|
|
92139
|
+
(!isXmasStyle ||
|
|
92140
|
+
(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
92141
|
event.stopPropagation();
|
|
91675
92142
|
switchChain({ chainId: bondData.chainId });
|
|
91676
92143
|
}, 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>;
|
|
@@ -6,6 +6,7 @@ export interface SDKProps {
|
|
|
6
6
|
useHotBonds: boolean;
|
|
7
7
|
modalVariant: 'alt' | 'standard';
|
|
8
8
|
urls?: Partial<Record<URLKeys, string>>;
|
|
9
|
+
campaign?: 'combined' | 'xmas' | 'noCampaign';
|
|
9
10
|
};
|
|
10
11
|
}
|
|
11
12
|
export declare const useSDKConfig: (config?: SDKProps) => {
|
|
@@ -20,6 +21,7 @@ export declare const useSDKConfig: (config?: SDKProps) => {
|
|
|
20
21
|
useRainbowKit?: boolean | undefined;
|
|
21
22
|
useHotBonds?: boolean | undefined;
|
|
22
23
|
modalVariant?: "alt" | "standard" | undefined;
|
|
24
|
+
campaign?: "combined" | "xmas" | "noCampaign";
|
|
23
25
|
};
|
|
24
26
|
export type URLKeys = 'apiV2' | 'realTimeApi' | 'apeswapLists' | 'mainUrl';
|
|
25
27
|
export declare const useURLByEnvironment: (key: URLKeys) => string;
|
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
package/package.json
CHANGED