@ape.swap/bonds-sdk 7.0.3 → 7.0.4-test.0

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.
Files changed (125) hide show
  1. package/dist/adapters/evm/index.d.ts +3 -2
  2. package/dist/adapters/evm/index.js +11 -2
  3. package/dist/adapters/evm/index.js.map +1 -1
  4. package/dist/adapters/evm/state/balances.js +1 -1
  5. package/dist/adapters/evm/state/balances.js.map +1 -1
  6. package/dist/adapters/evm/state/fetchBondsDataEVM.js +65 -2
  7. package/dist/adapters/evm/state/fetchBondsDataEVM.js.map +1 -1
  8. package/dist/adapters/evm/state/fetchUsersBondsEVM.js +234 -2
  9. package/dist/adapters/evm/state/fetchUsersBondsEVM.js.map +1 -1
  10. package/dist/adapters/evm/state/lpStaking/fetchLpStakingLimits.d.ts +24 -0
  11. package/dist/adapters/evm/state/lpStaking/fetchLpStakingLimits.js +118 -0
  12. package/dist/adapters/evm/state/lpStaking/fetchLpStakingLimits.js.map +1 -0
  13. package/dist/adapters/evm/state/lpStaking/useSoulZapLpStakingQuote.d.ts +4 -0
  14. package/dist/adapters/evm/state/lpStaking/useSoulZapLpStakingQuote.js +140 -0
  15. package/dist/adapters/evm/state/lpStaking/useSoulZapLpStakingQuote.js.map +1 -0
  16. package/dist/adapters/evm/state/useSoulZapBondQuote.js +1 -1
  17. package/dist/adapters/evm/views/BuyComponent.js +1 -1
  18. package/dist/adapters/evm/views/BuyComponent.js.map +1 -1
  19. package/dist/adapters/evm/views/lpStaking/BuyComponentLpStaking.d.ts +4 -0
  20. package/dist/adapters/evm/views/lpStaking/BuyComponentLpStaking.js +212 -0
  21. package/dist/adapters/evm/views/lpStaking/BuyComponentLpStaking.js.map +1 -0
  22. package/dist/adapters/evm/views/lpStaking/LpBondModalHeader.d.ts +7 -0
  23. package/dist/adapters/evm/views/lpStaking/LpBondModalHeader.js +66 -0
  24. package/dist/adapters/evm/views/lpStaking/LpBondModalHeader.js.map +1 -0
  25. package/dist/adapters/evm/views/lpStaking/LpStakingEstimations.d.ts +23 -0
  26. package/dist/adapters/evm/views/lpStaking/LpStakingEstimations.js +40 -0
  27. package/dist/adapters/evm/views/lpStaking/LpStakingEstimations.js.map +1 -0
  28. package/dist/adapters/evm/views/lpStaking/ModalHandlerLpStaking.d.ts +3 -0
  29. package/dist/adapters/evm/views/lpStaking/ModalHandlerLpStaking.js +90 -0
  30. package/dist/adapters/evm/views/lpStaking/ModalHandlerLpStaking.js.map +1 -0
  31. package/dist/adapters/evm/views/lpStaking/UserLpStakingBondRow.d.ts +5 -0
  32. package/dist/adapters/evm/views/lpStaking/UserLpStakingBondRow.js +32 -0
  33. package/dist/adapters/evm/views/lpStaking/UserLpStakingBondRow.js.map +1 -0
  34. package/dist/adapters/evm/views/lpStaking/YourLpBondModalHeader.d.ts +7 -0
  35. package/dist/adapters/evm/views/lpStaking/YourLpBondModalHeader.js +20 -0
  36. package/dist/adapters/evm/views/lpStaking/YourLpBondModalHeader.js.map +1 -0
  37. package/dist/adapters/evm/views/lpStaking/YourLpStakingBondModal.d.ts +7 -0
  38. package/dist/adapters/evm/views/lpStaking/YourLpStakingBondModal.js +78 -0
  39. package/dist/adapters/evm/views/lpStaking/YourLpStakingBondModal.js.map +1 -0
  40. package/dist/adapters/types.d.ts +20 -5
  41. package/dist/components/TokenInfoAndName/index.js +4 -1
  42. package/dist/components/TokenInfoAndName/index.js.map +1 -1
  43. package/dist/components/Tooltip/ButtonsRow.js +1 -1
  44. package/dist/components/Tooltip/ButtonsRow.js.map +1 -1
  45. package/dist/components/Tooltip/Tooltip.js +3 -2
  46. package/dist/components/Tooltip/Tooltip.js.map +1 -1
  47. package/dist/components/uikit-sdk/TokenImage/index.js +3 -1
  48. package/dist/components/uikit-sdk/TokenImage/index.js.map +1 -1
  49. package/dist/config/abi/apeBondPositionAdapter.json.js +1347 -0
  50. package/dist/config/abi/apeBondPositionAdapter.json.js.map +1 -0
  51. package/dist/config/abi/bonusEscrow.json.js +33 -0
  52. package/dist/config/abi/bonusEscrow.json.js.map +1 -0
  53. package/dist/config/abi/lpStakingVault.json.js +34 -0
  54. package/dist/config/abi/lpStakingVault.json.js.map +1 -0
  55. package/dist/config/abi/uniswapV3Pool.json.js +47 -0
  56. package/dist/config/abi/uniswapV3Pool.json.js.map +1 -0
  57. package/dist/config/abi/uniswapV3QuoterV2.json.js +66 -0
  58. package/dist/config/abi/uniswapV3QuoterV2.json.js.map +1 -0
  59. package/dist/config/constants/addresses.d.ts +1 -0
  60. package/dist/config/constants/addresses.js +7 -1
  61. package/dist/config/constants/addresses.js.map +1 -1
  62. package/dist/config/constants/chains.js +3 -1
  63. package/dist/config/constants/chains.js.map +1 -1
  64. package/dist/config/constants/networks.js +1 -1
  65. package/dist/config/constants/networks.js.map +1 -1
  66. package/dist/config/constants/variables.d.ts +2 -2
  67. package/dist/config/constants/variables.js +3 -1
  68. package/dist/config/constants/variables.js.map +1 -1
  69. package/dist/state/bonds/useBondsData.js +1 -0
  70. package/dist/state/bonds/useBondsData.js.map +1 -1
  71. package/dist/state/bonds/useUserBonds.d.ts +10 -1
  72. package/dist/state/bonds/useUserBonds.js +18 -11
  73. package/dist/state/bonds/useUserBonds.js.map +1 -1
  74. package/dist/state/useSDKConfig.js +2 -2
  75. package/dist/state/useSDKConfig.js.map +1 -1
  76. package/dist/state/zap/getChainParam.d.ts +1 -16
  77. package/dist/state/zap/getChainParam.js +16 -40
  78. package/dist/state/zap/getChainParam.js.map +1 -1
  79. package/dist/styles.css +1 -1
  80. package/dist/types/yourbonds.d.ts +24 -0
  81. package/dist/views/Bonds/components/BondRows/ActiveBondRows.js +19 -2
  82. package/dist/views/Bonds/components/BondRows/ActiveBondRows.js.map +1 -1
  83. package/dist/views/Bonds/components/BondRows/BondRow.d.ts +3 -2
  84. package/dist/views/Bonds/components/BondRows/BondRow.js +15 -10
  85. package/dist/views/Bonds/components/BondRows/BondRow.js.map +1 -1
  86. package/dist/views/Bonds/components/BondRows/ModalHandler.js +1 -1
  87. package/dist/views/Bonds/components/BondRows/ModalHandler.js.map +1 -1
  88. package/dist/views/Bonds/components/BondRows/SoldOutRows.js +1 -1
  89. package/dist/views/Bonds/components/BondRows/SoldOutRows.js.map +1 -1
  90. package/dist/views/Bonds/components/BondsMenu/BondsMenu.js +1 -1
  91. package/dist/views/Bonds/components/BondsMenu/BondsMenu.js.map +1 -1
  92. package/dist/views/Bonds/components/BonusComponents/BonusComponent.js +1 -1
  93. package/dist/views/Bonds/components/BonusComponents/BonusComponent.js.map +1 -1
  94. package/dist/views/Bonds/components/BuyAgainRow/index.js +1 -1
  95. package/dist/views/Bonds/components/BuyAgainRow/index.js.map +1 -1
  96. package/dist/views/Bonds/components/CheckURL/index.js +20 -15
  97. package/dist/views/Bonds/components/CheckURL/index.js.map +1 -1
  98. package/dist/views/BuyBond/ChainBuyComponent.d.ts +4 -1
  99. package/dist/views/BuyBond/ChainBuyComponent.js +14 -2
  100. package/dist/views/BuyBond/ChainBuyComponent.js.map +1 -1
  101. package/dist/views/BuyBond/components/BondCards/BondCards.js +1 -7
  102. package/dist/views/BuyBond/components/BondCards/BondCards.js.map +1 -1
  103. package/dist/views/BuyBond/components/BondModalHeader.d.ts +1 -2
  104. package/dist/views/BuyBond/components/BondModalHeader.js +13 -5
  105. package/dist/views/BuyBond/components/BondModalHeader.js.map +1 -1
  106. package/dist/views/BuyBond/components/Estimations.js +1 -1
  107. package/dist/views/BuyBond/components/Estimations.js.map +1 -1
  108. package/dist/views/BuyBond/components/ExpandedViewButton.d.ts +2 -2
  109. package/dist/views/BuyBond/components/ExpandedViewButton.js +2 -2
  110. package/dist/views/BuyBond/components/ExpandedViewButton.js.map +1 -1
  111. package/dist/views/FullBondsView/FullBondsView.js +2 -1
  112. package/dist/views/FullBondsView/FullBondsView.js.map +1 -1
  113. package/dist/views/FullBondsView/YourBondsStatus.d.ts +3 -0
  114. package/dist/views/FullBondsView/YourBondsStatus.js +54 -0
  115. package/dist/views/FullBondsView/YourBondsStatus.js.map +1 -0
  116. package/dist/views/SingleBond/SoldOutBuyBondPlaceholder.js +2 -5
  117. package/dist/views/SingleBond/SoldOutBuyBondPlaceholder.js.map +1 -1
  118. package/dist/views/YourBonds/YourBonds.js +6 -1
  119. package/dist/views/YourBonds/YourBonds.js.map +1 -1
  120. package/dist/views/YourBonds/components/YourBondsMenu/YourBondsMenu.js +2 -1
  121. package/dist/views/YourBonds/components/YourBondsMenu/YourBondsMenu.js.map +1 -1
  122. package/dist/views/YourBondsModal/components/YourBondModalHeader/YourBondModalHeader.d.ts +2 -1
  123. package/dist/views/YourBondsModal/components/YourBondModalHeader/YourBondModalHeader.js +2 -2
  124. package/dist/views/YourBondsModal/components/YourBondModalHeader/YourBondModalHeader.js.map +1 -1
  125. package/package.json +2 -2
@@ -0,0 +1,23 @@
1
+ import { BondsData } from '../../../../types/bonds';
2
+ declare const LpStakingEstimations: ({ inputValue, inputTokenPrice, bondData, youSpendString, fetchingZapQuote, zapError, protocolQuote, lpQuote, }: {
3
+ inputValue?: string;
4
+ inputTokenPrice?: number;
5
+ bondData: BondsData;
6
+ youSpendString?: string;
7
+ isZap?: boolean;
8
+ fetchingZapQuote?: boolean;
9
+ zapError?: boolean;
10
+ protocolQuote?: {
11
+ positionValue?: string;
12
+ bonusAmount?: string;
13
+ };
14
+ lpQuote?: {
15
+ token0?: {
16
+ fromAmountEstimate?: string;
17
+ };
18
+ token1?: {
19
+ fromAmountEstimate?: string;
20
+ };
21
+ };
22
+ }) => import("react/jsx-runtime").JSX.Element;
23
+ export default LpStakingEstimations;
@@ -0,0 +1,40 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { getBalanceNumber } from '../../../../utils/getBalanceNumber.js';
3
+ import useCurrencyPrice from '../../../../state/price/useCurrencyPrice.js';
4
+ import { formatNumberSI } from '../../../../utils/formatNumber.js';
5
+ import Flex from '../../../../components/uikit-sdk/Flex/index.js';
6
+ import TooltipBubble from '../../../../components/uikit-sdk/TooltipBubble/index.js';
7
+ import Dots from '../../../../components/uikit-sdk/LoadingDots/index.js';
8
+ import QuestionCircle from '../../../../components/uikit-sdk/Svg/Icons/QuestionCircle.js';
9
+ import { getTimePeriods } from '../../../../utils/getTimePeriods.js';
10
+
11
+ const LpStakingEstimations = ({ inputValue, inputTokenPrice, bondData, youSpendString, fetchingZapQuote, zapError, protocolQuote, lpQuote, }) => {
12
+ // Estimations
13
+ // REAL's adapter previews the bonus on the position the zap mints: bonusBps of its value, or 0 below the campaign's
14
+ // minimum. Priced with the bonus token's price; without one, it's worth that share of what the user spends (minus
15
+ // the zap's fees)
16
+ const bonusToken = bondData.lpStakingConfig?.bonusRewardToken;
17
+ const bonusTokenDecimals = bonusToken?.decimals?.[bondData.chainId] ?? 18;
18
+ const bonusTokenPrice = useCurrencyPrice(bonusToken, bondData.chainId)?.price ?? 0;
19
+ const bonusAmount = getBalanceNumber(protocolQuote?.bonusAmount ?? '0', bonusTokenDecimals);
20
+ const positionValue = Number(protocolQuote?.positionValue ?? '0');
21
+ const spendUSD = parseFloat(inputValue || '0') * (inputTokenPrice ?? 0);
22
+ const bonusUSD = bonusTokenPrice > 0
23
+ ? bonusAmount * bonusTokenPrice
24
+ : positionValue > 0
25
+ ? (spendUSD * Number(protocolQuote?.bonusAmount ?? '0')) / positionValue
26
+ : 0;
27
+ const isBelowMinimum = !!protocolQuote && bonusAmount === 0;
28
+ // The position the zap mints: both pool tokens, priced only when both have a price (half of it would mislead)
29
+ const lpToken0 = bondData.lpStakingConfig?.lpToken0;
30
+ const lpToken1 = bondData.lpStakingConfig?.lpToken1;
31
+ const token0Price = useCurrencyPrice(lpToken0, bondData.chainId)?.price ?? 0;
32
+ const token1Price = useCurrencyPrice(lpToken1, bondData.chainId)?.price ?? 0;
33
+ const token0Amount = getBalanceNumber(lpQuote?.token0?.fromAmountEstimate ?? '0', lpToken0?.decimals?.[bondData.chainId] ?? 18);
34
+ const token1Amount = getBalanceNumber(lpQuote?.token1?.fromAmountEstimate ?? '0', lpToken1?.decimals?.[bondData.chainId] ?? 18);
35
+ const positionUSD = token0Price > 0 && token1Price > 0 ? token0Amount * token0Price + token1Amount * token1Price : 0;
36
+ return (jsxs(Flex, { className: "modaltable-container text-container ape:w-full ape:flex ape:relative ape:flex-col ape:justify-center ape:text-[12px]", children: [jsxs(Flex, { className: "text-container row ape:pt-[2px] ape:pb-[2px] ape:flex ape:flex-row ape:justify-between", children: [jsx(Flex, { className: "row-container spend ape:flex ape:font-normal ape:items-center", children: "You Spend:" }), jsx(Flex, { className: "row-container spend-val ape:flex ape:font-normal ape:items-center", children: youSpendString })] }), jsxs(Flex, { className: "text-container row ape:pt-[2px] ape:pb-[2px] ape:flex ape:flex-row ape:justify-between", children: [jsxs(Flex, { className: "row-container premium ape:flex ape:font-normal ape:items-center", children: ["Bonus (unlocks after ", getTimePeriods(bondData?.vestingTerm, true).days, " days):"] }), fetchingZapQuote ? (jsx(Dots, {})) : zapError ? ('-') : isBelowMinimum ? (jsx(Flex, { className: "row-container premium-val ape:flex ape:font-normal ape:items-center", children: "No bonus at this size" })) : (jsxs(Flex, { className: "row-container premium-val premium-positive ape:flex ape:font-normal ape:items-center ape:gap-[5px]", children: [formatNumberSI(bonusAmount, 2), " ", bonusToken?.symbol, bonusUSD > 0 && jsxs("span", { className: "ape:opacity-60", children: ["($", formatNumberSI(bonusUSD, 2), ")"] })] }))] }), jsxs(Flex, { className: "ape:border ape:border-solid ape:border-[#9960C5] ape:rounded-normal ape:mx-[-5px] ape:px-[5px] ape:py-[2px] ape:my-[2px] ape:relative", children: [jsx(Flex, { className: "ape:absolute ape:w-full ape:h-full ape:top-0 ape:left-0 ape:z-0 ape:bg-[#9960C5] ape:opacity-20 ape:rounded-normal" }), jsxs(Flex, { className: "ape:w-full ape:justify-between ape:h-[21px]", children: [jsx(Flex, { className: "row-container get ape:flex ape:font-normal ape:items-center ape:z-[1]", children: "You Get:" }), fetchingZapQuote ? (jsx(Dots, {})) : zapError ? ('-') : (jsxs(Flex, { className: "row-container get-val ape:flex ape:font-normal ape:items-center ape:z-[1]", children: [formatNumberSI(token0Amount, 2), " ", lpToken0?.symbol, " - ", formatNumberSI(token1Amount, 2), ' ', lpToken1?.symbol, positionUSD > 0 && ` ($${formatNumberSI(positionUSD, 2)})`] }))] })] }), jsx(Flex, { className: "ape:mx-[-5px] ape:px-[5px] ape:py-[2px] ape:my-[2px] ape:relative", children: jsxs(Flex, { className: "ape:w-full ape:justify-between ape:h-[21px]", children: [jsxs(Flex, { className: "row-container get ape:flex ape:font-normal ape:items-center", children: ["Dual Rewards:", jsx(TooltipBubble, { className: "tooltip-bubble", body: jsx(Flex, { children: "Pool rewards are accrued immediately after purchase after the end of each epoch in Real Finance." }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, 0%)", children: jsx(Flex, { className: "row-container premium-icon ape:flex ape:font-normal ape:items-start ape:pl-[5px] ape:cursor-pointer", children: jsx(QuestionCircle, { width: "12px" }) }) })] }), jsx(Flex, { className: "row-container get ape:flex ape:font-normal ape:items-center ", children: "Payable in $ASSET & $ORVT" })] }) })] }));
37
+ };
38
+
39
+ export { LpStakingEstimations as default };
40
+ //# sourceMappingURL=LpStakingEstimations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LpStakingEstimations.js","sources":["../../../../../src/adapters/evm/views/lpStaking/LpStakingEstimations.tsx"],"sourcesContent":["import React from 'react'\nimport { getBalanceNumber } from '../../../../utils/getBalanceNumber'\nimport useCurrencyPrice from '../../../../state/price/useCurrencyPrice'\nimport { BondsData } from '../../../../types/bonds'\nimport { formatNumberSI } from '../../../../utils/formatNumber'\nimport Flex from '../../../../components/uikit-sdk/Flex'\nimport TooltipBubble from '../../../../components/uikit-sdk/TooltipBubble'\nimport LoadingDots from '../../../../components/uikit-sdk/LoadingDots'\nimport QuestionCircle from '../../../../components/uikit-sdk/Svg/Icons/QuestionCircle'\nimport { getTimePeriods } from '../../../../utils/getTimePeriods'\n\nconst LpStakingEstimations = ({\n inputValue,\n inputTokenPrice,\n bondData,\n youSpendString,\n fetchingZapQuote,\n zapError,\n protocolQuote,\n lpQuote,\n}: {\n inputValue?: string // input amount selected on the UI\n inputTokenPrice?: number\n bondData: BondsData\n youSpendString?: string\n isZap?: boolean\n fetchingZapQuote?: boolean\n zapError?: boolean\n // The zap quote's preview of REAL's bonus, both in bonus token wei\n protocolQuote?: { positionValue?: string; bonusAmount?: string }\n // The zap quote's estimate of each pool token going into the position, in wei\n lpQuote?: { token0?: { fromAmountEstimate?: string }; token1?: { fromAmountEstimate?: string } }\n}) => {\n // Estimations\n // REAL's adapter previews the bonus on the position the zap mints: bonusBps of its value, or 0 below the campaign's\n // minimum. Priced with the bonus token's price; without one, it's worth that share of what the user spends (minus\n // the zap's fees)\n const bonusToken = bondData.lpStakingConfig?.bonusRewardToken\n const bonusTokenDecimals = bonusToken?.decimals?.[bondData.chainId] ?? 18\n const bonusTokenPrice = useCurrencyPrice(bonusToken, bondData.chainId)?.price ?? 0\n const bonusAmount = getBalanceNumber(protocolQuote?.bonusAmount ?? '0', bonusTokenDecimals)\n const positionValue = Number(protocolQuote?.positionValue ?? '0')\n const spendUSD = parseFloat(inputValue || '0') * (inputTokenPrice ?? 0)\n const bonusUSD =\n bonusTokenPrice > 0\n ? bonusAmount * bonusTokenPrice\n : positionValue > 0\n ? (spendUSD * Number(protocolQuote?.bonusAmount ?? '0')) / positionValue\n : 0\n const isBelowMinimum = !!protocolQuote && bonusAmount === 0\n\n // The position the zap mints: both pool tokens, priced only when both have a price (half of it would mislead)\n const lpToken0 = bondData.lpStakingConfig?.lpToken0\n const lpToken1 = bondData.lpStakingConfig?.lpToken1\n const token0Price = useCurrencyPrice(lpToken0, bondData.chainId)?.price ?? 0\n const token1Price = useCurrencyPrice(lpToken1, bondData.chainId)?.price ?? 0\n const token0Amount = getBalanceNumber(\n lpQuote?.token0?.fromAmountEstimate ?? '0',\n lpToken0?.decimals?.[bondData.chainId] ?? 18,\n )\n const token1Amount = getBalanceNumber(\n lpQuote?.token1?.fromAmountEstimate ?? '0',\n lpToken1?.decimals?.[bondData.chainId] ?? 18,\n )\n const positionUSD = token0Price > 0 && token1Price > 0 ? token0Amount * token0Price + token1Amount * token1Price : 0\n\n return (\n <Flex className=\"modaltable-container text-container ape:w-full ape:flex ape:relative ape:flex-col ape:justify-center ape:text-[12px]\">\n {/* ----------- YOU SPEND ROW -----------*/}\n\n <Flex className=\"text-container row ape:pt-[2px] ape:pb-[2px] ape:flex ape:flex-row ape:justify-between\">\n <Flex className=\"row-container spend ape:flex ape:font-normal ape:items-center\">You Spend:</Flex>\n <Flex className=\"row-container spend-val ape:flex ape:font-normal ape:items-center\">{youSpendString}</Flex>\n </Flex>\n\n {/* ----------- BONUS ROW -----------*/}\n\n <Flex className=\"text-container row ape:pt-[2px] ape:pb-[2px] ape:flex ape:flex-row ape:justify-between\">\n <Flex className=\"row-container premium ape:flex ape:font-normal ape:items-center\">\n Bonus (unlocks after {getTimePeriods(bondData?.vestingTerm, true).days} days):\n </Flex>\n {/* LP staking purchases always go through the zap, so the bonus row follows its quote */}\n {fetchingZapQuote ? (\n <LoadingDots />\n ) : zapError ? (\n '-'\n ) : isBelowMinimum ? (\n <Flex className=\"row-container premium-val ape:flex ape:font-normal ape:items-center\">\n No bonus at this size\n </Flex>\n ) : (\n <Flex className=\"row-container premium-val premium-positive ape:flex ape:font-normal ape:items-center ape:gap-[5px]\">\n {formatNumberSI(bonusAmount, 2)} {bonusToken?.symbol}\n {bonusUSD > 0 && <span className=\"ape:opacity-60\">(${formatNumberSI(bonusUSD, 2)})</span>}\n </Flex>\n )}\n </Flex>\n\n {/* ----------- YOU GET ROW -----------*/}\n\n <Flex className=\"ape:border ape:border-solid ape:border-[#9960C5] ape:rounded-normal ape:mx-[-5px] ape:px-[5px] ape:py-[2px] ape:my-[2px] ape:relative\">\n <Flex className=\"ape:absolute ape:w-full ape:h-full ape:top-0 ape:left-0 ape:z-0 ape:bg-[#9960C5] ape:opacity-20 ape:rounded-normal\" />\n <Flex className=\"ape:w-full ape:justify-between ape:h-[21px]\">\n <Flex className=\"row-container get ape:flex ape:font-normal ape:items-center ape:z-[1]\">You Get:</Flex>\n {fetchingZapQuote ? (\n <LoadingDots />\n ) : zapError ? (\n '-'\n ) : (\n <Flex className=\"row-container get-val ape:flex ape:font-normal ape:items-center ape:z-[1]\">\n {formatNumberSI(token0Amount, 2)} {lpToken0?.symbol} - {formatNumberSI(token1Amount, 2)}{' '}\n {lpToken1?.symbol}\n {positionUSD > 0 && ` ($${formatNumberSI(positionUSD, 2)})`}\n </Flex>\n )}\n </Flex>\n </Flex>\n\n {/* ----------- ADITIONAL REWARDS -----------*/}\n\n <Flex className=\"ape:mx-[-5px] ape:px-[5px] ape:py-[2px] ape:my-[2px] ape:relative\">\n <Flex className=\"ape:w-full ape:justify-between ape:h-[21px]\">\n <Flex className=\"row-container get ape:flex ape:font-normal ape:items-center\">\n Dual Rewards:\n <TooltipBubble\n className=\"tooltip-bubble\"\n body={\n <Flex>\n Pool rewards are accrued immediately after purchase after the end of each epoch in Real Finance.\n </Flex>\n }\n width=\"230px\"\n placement=\"bottomLeft\"\n transformTip=\"translate(-5%, 0%)\"\n >\n <Flex className=\"row-container premium-icon ape:flex ape:font-normal ape:items-start ape:pl-[5px] ape:cursor-pointer\">\n <QuestionCircle width=\"12px\" />\n </Flex>\n </TooltipBubble>\n </Flex>\n <Flex className=\"row-container get ape:flex ape:font-normal ape:items-center \">\n Payable in $ASSET & $ORVT\n </Flex>\n </Flex>\n </Flex>\n </Flex>\n )\n}\n\nexport default LpStakingEstimations\n"],"names":["_jsxs","_jsx","LoadingDots"],"mappings":";;;;;;;;;;AAWA,MAAM,oBAAoB,GAAG,CAAC,EAC5B,UAAU,EACV,eAAe,EACf,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,QAAQ,EACR,aAAa,EACb,OAAO,GAaR,KAAI;;;;;AAKH,IAAA,MAAM,UAAU,GAAG,QAAQ,CAAC,eAAe,EAAE,gBAAgB;AAC7D,IAAA,MAAM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,kGAAA,EAAA,CAEE,EAET,KAAK,EAAC,OAAO,EACb,SAAS,EAAC,YAAY,EACtB,YAAY,EAAC,oBAAoB,EAAA,QAAA,EAEjCA,GAAA,CAAC,IAAI,EAAA,EAAC,SAAS,EAAC,qGAAqG,EAAA,QAAA,EACnHA,GAAA,CAAC,cAAc,EAAA,EAAC,KAAK,EAAC,MAAM,GAAG,EAAA,CAC1B,EAAA,CACO,CAAA,EAAA,CACX,EACPA,IAAC,IAAI,EAAA,EAAC,SAAS,EAAC,8DAA8D,EAAA,QAAA,EAAA,2BAAA,EAAA,CAEvE,CAAA,EAAA,CACF,EAAA,CACF,CAAA,EAAA,CACF;AAEX;;;;"}
@@ -0,0 +1,3 @@
1
+ import type { BondModalHandlerProps } from '../../../types';
2
+ declare const ModalHandlerLpStaking: ({ onDismiss, bondAddress, bondChain, isProjectView }: BondModalHandlerProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default ModalHandlerLpStaking;
@@ -0,0 +1,90 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useState, useEffect } from 'react';
3
+ import { useQueryClient } from '@tanstack/react-query';
4
+ import Modal from '../../../../components/uikit-sdk/Modal/index.js';
5
+ import BuyComponentLpStaking from './BuyComponentLpStaking.js';
6
+ import YourLpStakingBondModal from './YourLpStakingBondModal.js';
7
+ import useBondsData from '../../../../state/bonds/useBondsData.js';
8
+ import useChainAccount from '../../../../state/chainAccount/useChainAccount.js';
9
+ import { getUserBonds } from '../../../../state/bonds/useUserBonds.js';
10
+ import { QUERY_KEYS } from '../../../../config/constants/queryKeys.js';
11
+
12
+ // REAL's API lists a purchase about 10 seconds after the tx, behind a 10-second cache, so the position is polled for
13
+ const POSITION_POLL_INTERVAL = 5000;
14
+ const POSITION_POLL_TIMEOUT = 60000;
15
+ /*
16
+ * Basically this is a handler that controls which Modal is displayed to the user for LP staking bonds.
17
+ * It will start by showing the buy modal; once a purchase is confirmed, the buy component reports the new position's
18
+ * NFT id through setBillId, and YourLpStakingBondModal is shown for it: with skeletons until REAL's API lists the
19
+ * position, then with its data. If the API doesn't list it within a minute, the modal is closed.
20
+ * */
21
+ const ModalHandlerLpStaking = ({ onDismiss, bondAddress, bondChain, isProjectView }) => {
22
+ // State
23
+ const [billId, setBillId] = useState('');
24
+ const [userBill, setUserBill] = useState();
25
+ // Hooks
26
+ const { data: bondsData } = useBondsData();
27
+ const { address } = useChainAccount('evm');
28
+ const queryClient = useQueryClient();
29
+ const handleDismiss = () => {
30
+ if (typeof window !== 'undefined') {
31
+ const locationPath = window.location.pathname;
32
+ window.history.pushState({}, '', `${locationPath !== '/bonds' ? locationPath : '/bonds'}`);
33
+ }
34
+ onDismiss?.();
35
+ };
36
+ // Poll REAL's API (through the user bonds fetcher, for this bond only) until it lists the purchased position
37
+ useEffect(() => {
38
+ if (!billId)
39
+ return;
40
+ const bond = bondsData?.find((bond) => bondAddress?.toLowerCase() === bond?.contractAddress?.[bond?.chainId]?.toLowerCase() &&
41
+ bondChain === bond?.chainId);
42
+ // Nothing to poll for: close rather than leave the skeletons up
43
+ if (!bond || !address) {
44
+ handleDismiss();
45
+ return;
46
+ }
47
+ let cancelled = false;
48
+ let pollTimeout;
49
+ const startedAt = Date.now();
50
+ const findPosition = async () => {
51
+ // The position may already be in the cache from a Your Bonds refetch
52
+ const cached = queryClient.getQueriesData({ queryKey: [QUERY_KEYS.USER_BONDS] });
53
+ const cachedBill = cached.flatMap(([, result]) => result?.bills ?? []).find((bill) => bill.id === billId);
54
+ if (cachedBill)
55
+ return cachedBill;
56
+ const bills = await getUserBonds({ evm: address }, { [bondChain]: [bond] }, queryClient).catch((e) => {
57
+ console.error(e);
58
+ return [];
59
+ });
60
+ return bills.find((bill) => bill.bond?.billType === 'lpStaking' && bill.id === billId);
61
+ };
62
+ const poll = async () => {
63
+ const purchasedBill = await findPosition();
64
+ if (cancelled)
65
+ return;
66
+ if (purchasedBill) {
67
+ setUserBill(purchasedBill);
68
+ // So Your Bonds lists the new position too
69
+ queryClient.invalidateQueries({ queryKey: [QUERY_KEYS.USER_BONDS] });
70
+ return;
71
+ }
72
+ if (Date.now() - startedAt + POSITION_POLL_INTERVAL > POSITION_POLL_TIMEOUT) {
73
+ console.error(`LP staking position ${billId} not found in REAL's API`);
74
+ handleDismiss();
75
+ return;
76
+ }
77
+ pollTimeout = setTimeout(poll, POSITION_POLL_INTERVAL);
78
+ };
79
+ poll();
80
+ return () => {
81
+ cancelled = true;
82
+ clearTimeout(pollTimeout);
83
+ };
84
+ // eslint-disable-next-line react-hooks/exhaustive-deps
85
+ }, [billId]);
86
+ return billId ? (jsx(YourLpStakingBondModal, { userBill: userBill, onDismiss: handleDismiss })) : (jsx(Modal, { className: "modal ape:w-85 ape:md:w-175 ape:p-0! ", onDismiss: handleDismiss, children: jsx(BuyComponentLpStaking, { bondAddress: bondAddress, bondChain: bondChain, setBillId: setBillId, onDismiss: handleDismiss, isProjectView: isProjectView }) }));
87
+ };
88
+
89
+ export { ModalHandlerLpStaking as default };
90
+ //# sourceMappingURL=ModalHandlerLpStaking.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModalHandlerLpStaking.js","sources":["../../../../../src/adapters/evm/views/lpStaking/ModalHandlerLpStaking.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { BillsConfig, ChainId } from '@ape.swap/apeswap-lists'\nimport type { BondModalHandlerProps } from '../../../types'\nimport Modal from '../../../../components/uikit-sdk/Modal'\nimport BuyComponentLpStaking from './BuyComponentLpStaking'\nimport YourLpStakingBondModal from './YourLpStakingBondModal'\nimport useBondsData from '../../../../state/bonds/useBondsData'\nimport useChainAccount from '../../../../state/chainAccount/useChainAccount'\nimport { getUserBonds, UserBondsResult } from '../../../../state/bonds/useUserBonds'\nimport { UserBill } from '../../../../types/yourbonds'\nimport { QUERY_KEYS } from '../../../../config/constants/queryKeys'\n\n// REAL's API lists a purchase about 10 seconds after the tx, behind a 10-second cache, so the position is polled for\nconst POSITION_POLL_INTERVAL = 5000\nconst POSITION_POLL_TIMEOUT = 60000\n\n/*\n * Basically this is a handler that controls which Modal is displayed to the user for LP staking bonds.\n * It will start by showing the buy modal; once a purchase is confirmed, the buy component reports the new position's\n * NFT id through setBillId, and YourLpStakingBondModal is shown for it: with skeletons until REAL's API lists the\n * position, then with its data. If the API doesn't list it within a minute, the modal is closed.\n * */\n\nconst ModalHandlerLpStaking = ({ onDismiss, bondAddress, bondChain, isProjectView }: BondModalHandlerProps) => {\n // State\n const [billId, setBillId] = useState('')\n const [userBill, setUserBill] = useState<UserBill>()\n\n // Hooks\n const { data: bondsData } = useBondsData()\n const { address } = useChainAccount('evm')\n const queryClient = useQueryClient()\n\n const handleDismiss = () => {\n if (typeof window !== 'undefined') {\n const locationPath = window.location.pathname\n window.history.pushState({}, '', `${locationPath !== '/bonds' ? locationPath : '/bonds'}`)\n }\n onDismiss?.()\n }\n\n // Poll REAL's API (through the user bonds fetcher, for this bond only) until it lists the purchased position\n useEffect(() => {\n if (!billId) return\n const bond = bondsData?.find(\n (bond) =>\n bondAddress?.toLowerCase() === bond?.contractAddress?.[bond?.chainId]?.toLowerCase() &&\n bondChain === bond?.chainId,\n )\n // Nothing to poll for: close rather than leave the skeletons up\n if (!bond || !address) {\n handleDismiss()\n return\n }\n\n let cancelled = false\n let pollTimeout: ReturnType<typeof setTimeout> | undefined\n const startedAt = Date.now()\n\n const findPosition = async () => {\n // The position may already be in the cache from a Your Bonds refetch\n const cached = queryClient.getQueriesData<UserBondsResult | undefined>({ queryKey: [QUERY_KEYS.USER_BONDS] })\n const cachedBill = cached.flatMap(([, result]) => result?.bills ?? []).find((bill) => bill.id === billId)\n if (cachedBill) return cachedBill\n const bills = await getUserBonds(\n { evm: address },\n { [bondChain]: [bond] } as Record<ChainId, BillsConfig[]>,\n queryClient,\n ).catch((e) => {\n console.error(e)\n return []\n })\n return bills.find((bill) => bill.bond?.billType === 'lpStaking' && bill.id === billId)\n }\n\n const poll = async () => {\n const purchasedBill = await findPosition()\n if (cancelled) return\n if (purchasedBill) {\n setUserBill(purchasedBill)\n // So Your Bonds lists the new position too\n queryClient.invalidateQueries({ queryKey: [QUERY_KEYS.USER_BONDS] })\n return\n }\n if (Date.now() - startedAt + POSITION_POLL_INTERVAL > POSITION_POLL_TIMEOUT) {\n console.error(`LP staking position ${billId} not found in REAL's API`)\n handleDismiss()\n return\n }\n pollTimeout = setTimeout(poll, POSITION_POLL_INTERVAL)\n }\n poll()\n\n return () => {\n cancelled = true\n clearTimeout(pollTimeout)\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [billId])\n\n return billId ? (\n <YourLpStakingBondModal userBill={userBill} onDismiss={handleDismiss} />\n ) : (\n <Modal className=\"modal ape:w-85 ape:md:w-175 ape:p-0! \" onDismiss={handleDismiss}>\n <BuyComponentLpStaking\n bondAddress={bondAddress}\n bondChain={bondChain}\n setBillId={setBillId}\n onDismiss={handleDismiss}\n isProjectView={isProjectView}\n />\n </Modal>\n )\n}\n\nexport default ModalHandlerLpStaking\n"],"names":["_jsx"],"mappings":";;;;;;;;;;;AAaA;AACA,MAAM,sBAAsB,GAAG,IAAI;AACnC,MAAM,qBAAqB,GAAG,KAAK;AAEnC;;;;;AAKK;AAEL,MAAM,qBAAqB,GAAG,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAyB,KAAI;;IAE5G,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC;IACxC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,EAAY;;IAGpD,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,YAAY,EAAE;IAC1C,MAAM,EAAE,OAAO,EAAE,GAAG,eAAe,CAAC,KAAK,CAAC;AAC1C,IAAA,MAAM,WAAW,GAAG,cAAc,EAAE;IAEpC,MAAM,aAAa,GAAG,MAAK;AACzB,QAAA,IAAI,OAAO,MAAM,KAAK,W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AAuC,EAAC,SAAS,EAAE,aAAa,EAAA,QAAA,EAC/EA,GAAA,CAAC,qBAAqB,EAAA,EACpB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,aAAa,EACxB,aAAa,EAAE,aAAa,EAAA,CAC5B,EAAA,CACI,CACT;AACH;;;;"}
@@ -0,0 +1,5 @@
1
+ import { UserBill } from '../../../../types/yourbonds';
2
+ declare const UserLpStakingBondRow: ({ bill }: {
3
+ bill: UserBill;
4
+ }) => import("react/jsx-runtime").JSX.Element;
5
+ export default UserLpStakingBondRow;
@@ -0,0 +1,32 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import Flex from '../../../../components/uikit-sdk/Flex/index.js';
3
+ import TokenInfoAndName from '../../../../components/TokenInfoAndName/index.js';
4
+ import { formatNumberSI } from '../../../../utils/formatNumber.js';
5
+ import Button from '../../../../components/uikit-sdk/Button/Button.js';
6
+ import TooltipBubble from '../../../../components/uikit-sdk/TooltipBubble/index.js';
7
+ import { getTimeLeftForFullyVested, getPendingVestingString, claimable, pending, getPercentageVested } from '../../../../utils/displayHelpers.js';
8
+ import useModal from '../../../../hooks/useModal.js';
9
+ import YourLpStakingBondModal from './YourLpStakingBondModal.js';
10
+ import BondInfoTooltip from '../../../../components/Tooltip/Tooltip.js';
11
+ import ProfitCard from '../../../../views/YourBonds/components/ProfitCard/ProfitCard.js';
12
+ import ProgressBarWrapper from '../../../../components/ProgressBar/ProgressBarWrapper.js';
13
+ import ProgressBar from '../../../../components/ProgressBar/ProgressBar.js';
14
+ import More from '../../../../components/uikit-sdk/Svg/Icons/More.js';
15
+
16
+ const UserLpStakingBondRow = ({ bill }) => {
17
+ // Hooks
18
+ const [onOpenPurchasedBond] = useModal(jsx(YourLpStakingBondModal, { userBill: bill }));
19
+ // Display Info
20
+ const earnTokenPrice = parseFloat(bill?.bond?.payoutTokenPrice ?? '0');
21
+ return (jsxs("div", { className: "your-bonds ape:flex ape:flex-col ape:w-full ape:justify-around ape:bg-white2 ape:mb-[5px] ape:rounded-[10px] ape:cursor-pointer ape:hover:bg-white3 ape:min-[1000px]:flex-row ape:min-[1000px]:h-[70px]", onClick: onOpenPurchasedBond, children: [jsxs("div", { className: "token-info-container ape:flex ape:w-full ape:min-[1000px]:w-[30%] ape:min-[1000px]:min-w-[300px]", children: [jsx(TokenInfoAndName, { tokenSymbol: `${bill?.bond?.lpStakingConfig?.lpToken0.symbol}-${bill?.bond?.lpStakingConfig?.lpToken1.symbol}`, chain: bill?.bond?.chainId, tag: bill?.bond?.tags?.[0], vestEnds: getTimeLeftForFullyVested(bill) > 0 ? `Ends in ${getPendingVestingString(bill)}` : `Fully Vested`, isHotBond: true }), jsx("div", { className: "tooltip-column ape:flex ape:w-[50px] ape:items-center ape:ml-[10px] ape:min-[1000px]:hidden", children: jsx(TooltipBubble, { className: "tooltip-bubble", body: jsx(BondInfoTooltip, { earnTokenContract: bill?.bond?.earnToken.address[bill?.bond.chainId] || '', earnTokenSymbol: bill?.bond?.earnToken.symbol || '', bondContract: bill?.address ?? '', projectLink: bill?.bond?.projectLink, twitter: bill?.bond?.twitter, chain: bill?.bond?.chainId, cgId: bill?.bond?.cgId, dexscreener: bill?.bond?.dexscreener }), width: "205px", placement: "bottomRight", transformTip: "translate(5%, 0%)", children: jsx(Flex, { className: "ape:opacity-80", children: jsx(More, { width: "25px" }) }) }) })] }), jsxs("div", { className: "your-bonds-columns-container ape:flex ape:flex-col ape:items-center ape:justify-end ape:w-full ape:min-[1000px]:w-[70%] ape:min-[1000px]:justify-between ape:min-[1000px]:flex-row ape:min-[1000px]:pr-[20px]", children: [jsx(Flex, { className: "ape:w-[125px]", children: jsx(ProfitCard, { userBond: bill }) }), jsxs("div", { className: "your-bonds-content ape:flex ape:items-center ape:justify-between ape:w-full ape:px-[10px] ape:text-[14px] ape:min-[1000px]:w-[130px] ape:min-[1000px]:justify-center ape:min-[1000px]:mt-0", children: [jsx("div", { className: "your-bonds-content-title ape:flex ape:text-[12px] ape:font-medium ape:opacity-60 ape:min-[1000px]:hidden", children: "Claimable" }), jsxs("div", { className: "your-bonds-content-tokens-amount ape:flex ape:items-center ape:text-[14px] ape:font-semibold", children: [formatNumberSI(claimable(bill), 3), jsx("div", { className: "your-bonds-content-tokens-usd-amount ape:opacity-60 ape:text-[12px] ape:font-normal ape:ml-[4px] ape:text-text-disabled-button", children: `($${(claimable(bill) * earnTokenPrice).toFixed(2)})` })] })] }), jsxs("div", { className: "your-bonds-content ape:flex ape:items-center ape:justify-between ape:w-full ape:px-[10px] ape:text-[14px] ape:min-[1000px]:w-[130px] ape:min-[1000px]:justify-center ape:min-[1000px]:mt-0", children: [jsx("div", { className: "your-bonds-content-title ape:flex ape:text-[12px] ape:font-medium ape:opacity-60 ape:min-[1000px]:hidden", children: "Pending" }), jsxs("div", { className: "your-bonds-content-tokens-amount ape:flex ape:items-center ape:text-[14px] ape:font-semibold", children: [formatNumberSI(pending(bill), 3), jsx("div", { className: "your-bonds-content-tokens-usd-amount ape:opacity-60 ape:text-[12px] ape:font-normal ape:ml-[4px] ape:text-text-disabled-button", children: `($${(pending(bill) * earnTokenPrice).toFixed(2)})` })] })] }), jsx("div", { className: "your-bonds-content hide-mobile ape:hidden ape:min-[1000px]:flex", children: jsx(ProgressBarWrapper, { title: '', value: jsx(ProgressBar, { value: getPercentageVested(bill) }), style: {
22
+ width: '127px',
23
+ height: '25px',
24
+ flexDirection: 'column',
25
+ justifyContent: 'center',
26
+ }, hideOnMobile: true, showTooltip: true, toolTip: getTimeLeftForFullyVested(bill) > 0
27
+ ? `Fully vested in ${getPendingVestingString(bill)}.`
28
+ : `Fully Vested.` }) }), jsx("div", { className: "your-bonds-column-button ape:flex ape:w-full ape:items-center ape:justify-center ape:p-[10px] ape:min-[1000px]:w-[210px] ape:min-[1000px]:p-0", children: jsx(Button, { className: "button ape:text-[14px]! ape:p-[6px] ape:h-[30px]", fullWidth: true, children: "Claim" }) })] })] }));
29
+ };
30
+
31
+ export { UserLpStakingBondRow as default };
32
+ //# sourceMappingURL=UserLpStakingBondRow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserLpStakingBondRow.js","sources":["../../../../../src/adapters/evm/views/lpStaking/UserLpStakingBondRow.tsx"],"sourcesContent":["import React from 'react'\nimport Flex from '../../../../components/uikit-sdk/Flex'\nimport TokenInfoAndName from '../../../../components/TokenInfoAndName'\nimport { formatNumberSI } from '../../../../utils/formatNumber'\nimport Button from '../../../../components/uikit-sdk/Button/Button'\nimport TooltipBubble from '../../../../components/uikit-sdk/TooltipBubble'\nimport { UserBill } from '../../../../types/yourbonds'\nimport {\n claimable,\n getPendingVestingString,\n getPercentageVested,\n getTimeLeftForFullyVested,\n pending,\n} from '../../../../utils/displayHelpers'\nimport useModal from '../../../../hooks/useModal'\nimport YourLpStakingBondModal from './YourLpStakingBondModal'\nimport Tooltip from '../../../../components/Tooltip/Tooltip'\nimport ProfitCard from '../../../../views/YourBonds/components/ProfitCard/ProfitCard'\nimport ProgressBarWrapper from '../../../../components/ProgressBar/ProgressBarWrapper'\nimport ProgressBar from '../../../../components/ProgressBar/ProgressBar'\nimport More from '../../../../components/uikit-sdk/Svg/Icons/More'\n\nconst UserLpStakingBondRow = ({ bill }: { bill: UserBill }) => {\n // Hooks\n const [onOpenPurchasedBond] = useModal(<YourLpStakingBondModal userBill={bill} />)\n\n // Display Info\n const earnTokenPrice = parseFloat(bill?.bond?.payoutTokenPrice ?? '0')\n\n return (\n <div\n className=\"your-bonds ape:flex ape:flex-col ape:w-full ape:justify-around ape:bg-white2 ape:mb-[5px] ape:rounded-[10px] ape:cursor-pointer ape:hover:bg-white3 ape:min-[1000px]:flex-row ape:min-[1000px]:h-[70px]\"\n onClick={onOpenPurchasedBond}\n >\n <div className=\"token-info-container ape:flex ape:w-full ape:min-[1000px]:w-[30%] ape:min-[1000px]:min-w-[300px]\">\n <TokenInfoAndName\n tokenSymbol={`${bill?.bond?.lpStakingConfig?.lpToken0.symbol}-${bill?.bond?.lpStakingConfig?.lpToken1.symbol}`}\n chain={bill?.bond?.chainId}\n tag={bill?.bond?.tags?.[0]}\n vestEnds={getTimeLeftForFullyVested(bill) > 0 ? `Ends in ${getPendingVestingString(bill)}` : `Fully Vested`}\n isHotBond\n />\n <div className=\"tooltip-column ape:flex ape:w-[50px] ape:items-center ape:ml-[10px] ape:min-[1000px]:hidden\">\n <TooltipBubble\n className=\"tooltip-bubble\"\n body={\n <Tooltip\n earnTokenContract={bill?.bond?.earnToken.address[bill?.bond.chainId] || ''}\n earnTokenSymbol={bill?.bond?.earnToken.symbol || ''}\n bondContract={bill?.address ?? ''}\n projectLink={bill?.bond?.projectLink}\n twitter={bill?.bond?.twitter}\n chain={bill?.bond?.chainId!}\n cgId={bill?.bond?.cgId}\n dexscreener={bill?.bond?.dexscreener}\n />\n }\n width=\"205px\"\n placement=\"bottomRight\"\n transformTip=\"translate(5%, 0%)\"\n >\n <Flex className=\"ape:opacity-80\">\n <More width=\"25px\" />\n </Flex>\n </TooltipBubble>\n </div>\n </div>\n <div className=\"your-bonds-columns-container ape:flex ape:flex-col ape:items-center ape:justify-end ape:w-full ape:min-[1000px]:w-[70%] ape:min-[1000px]:justify-between ape:min-[1000px]:flex-row ape:min-[1000px]:pr-[20px]\">\n <Flex className=\"ape:w-[125px]\">\n <ProfitCard userBond={bill} />\n </Flex>\n <div className=\"your-bonds-content ape:flex ape:items-center ape:justify-between ape:w-full ape:px-[10px] ape:text-[14px] ape:min-[1000px]:w-[130px] ape:min-[1000px]:justify-center ape:min-[1000px]:mt-0\">\n <div className=\"your-bonds-content-title ape:flex ape:text-[12px] ape:font-medium ape:opacity-60 ape:min-[1000px]:hidden\">\n Claimable\n </div>\n <div className=\"your-bonds-content-tokens-amount ape:flex ape:items-center ape:text-[14px] ape:font-semibold\">\n {formatNumberSI(claimable(bill), 3)}\n <div className=\"your-bonds-content-tokens-usd-amount ape:opacity-60 ape:text-[12px] ape:font-normal ape:ml-[4px] ape:text-text-disabled-button\">\n {`($${(claimable(bill) * earnTokenPrice).toFixed(2)})`}\n </div>\n </div>\n </div>\n <div className=\"your-bonds-content ape:flex ape:items-center ape:justify-between ape:w-full ape:px-[10px] ape:text-[14px] ape:min-[1000px]:w-[130px] ape:min-[1000px]:justify-center ape:min-[1000px]:mt-0\">\n <div className=\"your-bonds-content-title ape:flex ape:text-[12px] ape:font-medium ape:opacity-60 ape:min-[1000px]:hidden\">\n Pending\n </div>\n <div className=\"your-bonds-content-tokens-amount ape:flex ape:items-center ape:text-[14px] ape:font-semibold\">\n {formatNumberSI(pending(bill), 3)}\n <div className=\"your-bonds-content-tokens-usd-amount ape:opacity-60 ape:text-[12px] ape:font-normal ape:ml-[4px] ape:text-text-disabled-button\">\n {`($${(pending(bill) * earnTokenPrice).toFixed(2)})`}\n </div>\n </div>\n </div>\n <div className=\"your-bonds-content hide-mobile ape:hidden ape:min-[1000px]:flex\">\n <ProgressBarWrapper\n title={''}\n value={<ProgressBar value={getPercentageVested(bill)} />}\n style={{\n width: '127px',\n height: '25px',\n flexDirection: 'column',\n justifyContent: 'center',\n }}\n hideOnMobile\n showTooltip={true}\n toolTip={\n getTimeLeftForFullyVested(bill) > 0\n ? `Fully vested in ${getPendingVestingString(bill)}.`\n : `Fully Vested.`\n }\n />\n </div>\n <div className=\"your-bonds-column-button ape:flex ape:w-full ape:items-center ape:justify-center ape:p-[10px] ape:min-[1000px]:w-[210px] ape:min-[1000px]:p-0\">\n <Button className=\"button ape:text-[14px]! ape:p-[6px] ape:h-[30px]\" fullWidth>\n Claim\n </Button>\n </div>\n </div>\n </div>\n )\n}\n\nexport default UserLpStakingBondRow\n"],"names":["_jsx","_jsxs","Tooltip"],"mappings":";;;;;;;;;;;;;;;AAsBA,MAAM,oBAAoB,GAAG,CAAC,EAAE,IAAI,EAAsB,KAAI;;AAE5D,IAAA,MAAM,CAAC,mBAAmB,CAAC,GAAG,QAAQ,CAACA,GAAA,CAAC,sBAAsB,EAAA,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pBondModalHeader: ({ userBill, onDismiss, }: {
3
+ userBill?: UserBill;
4
+ onDismiss?: () => void;
5
+ disableTransfers?: boolean;
6
+ }) => import("react/jsx-runtime").JSX.Element;
7
+ export default YourLpBondModalHeader;
@@ -0,0 +1,20 @@
1
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
+ import TokenImage from '../../../../components/uikit-sdk/TokenImage/index.js';
3
+ import { useIsMobile } from '../../../../hooks/useIsMobile.js';
4
+ import Flex from '../../../../components/uikit-sdk/Flex/index.js';
5
+ import Skeleton from '../../../../components/uikit-sdk/Skeleton/index.js';
6
+ import Text from '../../../../components/uikit-sdk/Text/index.js';
7
+ import Close from '../../../../components/uikit-sdk/Svg/Icons/Close.js';
8
+
9
+ const YourLpBondModalHeader = ({ userBill, onDismiss, }) => {
10
+ // Hooks
11
+ const isMobile = useIsMobile();
12
+ // Static Data
13
+ // Undefined until the bill is loaded, so the header shows its skeleton
14
+ const lpStakingConfig = userBill?.bond?.lpStakingConfig;
15
+ const payoutTokenSymbol = lpStakingConfig && `${lpStakingConfig.lpToken0.symbol}-${lpStakingConfig.lpToken1.symbol}`;
16
+ return (jsxs(Flex, { className: "ape:w-full ape:justify-between ape:items-center", children: [jsxs(Flex, { className: "ape:items-center ape:gap-[7px]", children: [payoutTokenSymbol ? (jsxs(Fragment, { children: [jsx(TokenImage, { symbol: userBill?.bond?.lpStakingConfig?.lpToken0.symbol, symbol2: userBill?.bond?.lpStakingConfig?.lpToken1.symbol, size: 30 }), jsx("div", { className: "ape:text-[16px] ape:md:text-[18px] ape:font-bold ape:opacity-70 ape:overflow-hidden ape:whitespace-nowrap ape:text-ellipsis ape:max-w-[150px]", children: payoutTokenSymbol })] })) : (jsxs(Fragment, { children: [jsx(Skeleton, { animation: "waves", style: { width: '30px', height: '30px', borderRadius: '55px', marginRight: '10px' } }), jsx(Skeleton, { animation: "waves", style: { width: '100px', borderRadius: 'var(--ape-radius-normal)' } })] })), jsx(Text, { className: "ape:opacity-60 ape:text-[11px] ape:md:text-[14px] ape:hidden ape:md:flex", children: userBill?.id && `#${userBill.id}` })] }), jsx(Flex, { className: "svg-close ape:cursor-pointer ape:p-[2px_5px]", onClick: onDismiss, children: jsx(Close, { width: isMobile ? '12px' : '18px' }) })] }));
17
+ };
18
+
19
+ export { YourLpBondModalHeader as default };
20
+ //# sourceMappingURL=YourLpBondModalHeader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"YourLpBondModalHeader.js","sources":["../../../../../src/adapters/evm/views/lpStaking/YourLpBondModalHeader.tsx"],"sourcesContent":["import React from 'react'\nimport TokenImage from '../../../../components/uikit-sdk/TokenImage'\nimport { UserBill } from '../../../../types/yourbonds'\nimport { useIsMobile } from '../../../../hooks/useIsMobile'\nimport Flex from '../../../../components/uikit-sdk/Flex'\nimport Skeleton from '../../../../components/uikit-sdk/Skeleton'\nimport Text from '../../../../components/uikit-sdk/Text'\nimport Close from '../../../../components/uikit-sdk/Svg/Icons/Close'\n\nconst YourLpBondModalHeader = ({\n userBill,\n onDismiss,\n}: {\n userBill?: UserBill\n onDismiss?: () => void\n disableTransfers?: boolean\n}) => {\n // Hooks\n const isMobile = useIsMobile()\n\n // Static Data\n // Undefined until the bill is loaded, so the header shows its skeleton\n const lpStakingConfig = userBill?.bond?.lpStakingConfig\n const payoutTokenSymbol = lpStakingConfig && `${lpStakingConfig.lpToken0.symbol}-${lpStakingConfig.lpToken1.symbol}`\n\n return (\n <Flex className=\"ape:w-full ape:justify-between ape:items-center\">\n <Flex className=\"ape:items-center ape:gap-[7px]\">\n {payoutTokenSymbol ? (\n <>\n <TokenImage\n symbol={userBill?.bond?.lpStakingConfig?.lpToken0.symbol}\n symbol2={userBill?.bond?.lpStakingConfig?.lpToken1.symbol}\n size={30}\n />\n <div className=\"ape:text-[16px] ape:md:text-[18px] ape:font-bold ape:opacity-70 ape:overflow-hidden ape:whitespace-nowrap ape:text-ellipsis ape:max-w-[150px]\">\n {payoutTokenSymbol}\n </div>\n </>\n ) : (\n <>\n <Skeleton\n animation=\"waves\"\n style={{ width: '30px', height: '30px', borderRadius: '55px', marginRight: '10px' }}\n />\n <Skeleton animation=\"waves\" style={{ width: '100px', borderRadius: 'var(--ape-radius-normal)' }} />\n </>\n )}\n <Text className=\"ape:opacity-60 ape:text-[11px] ape:md:text-[14px] ape:hidden ape:md:flex\">\n {userBill?.id && `#${userBill.id}`}\n </Text>\n </Flex>\n <Flex className=\"svg-close ape:cursor-pointer ape:p-[2px_5px]\" onClick={onDismiss}>\n <Close width={isMobile ? '12px' : '18px'} />\n </Flex>\n </Flex>\n )\n}\n\nexport default YourLpBondModalHeader\n"],"names":["_jsxs","_Fragment","_jsx"],"mappings":";;;;;;;;AASA,MAAM,qBAAqB,GAAG,CAAC,EAC7B,QAAQ,EACR,SAAS,GAKV,KAAI;;AAEH,IAAA,MAAM,QAAQ,GAAG,WAAW,EAAE;;;AAI9B,IAAA,MAAM,eAAe,GAAG,QAAQ,EAAE,IAAI,EAAE,eAAe;AACvD,IAAA,MAAM,iBAAiB,GAAG,eAAe,IAAI,CAAA,EAAG,eAAe,CAAC,QAAQ,CAAC,MAAM,IAAI,eAAe,CAAC,QAAQ,CAAC,MAAM,EAAE;AAEpH,IAAA,QACEA,IAAA,CAAC,IAAI,EAAA,EAAC,SAAS,EAAC,iDAAiD,EAAA,QAAA,EAAA,CAC/DA,IAAA,CAAC,IAAI,IAAC,SAAS,EAAC,gCAAgC,EAAA,QAAA,EAAA,CAC7C,iBAAiB,IAChBA,IAAA,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAA,CACEC,IAAC,UAAU,EAAA,EACT,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,CAAC,MAAM,EACxD,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,CAAC,MAAM,EACzD,IAAI,EAAE,EAAE,EAAA,CACR,EACFA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,+IAA+I,EAAA,QAAA,EAC3J,iBAAiB,EAAA,CACd,CAAA,EAAA,CACL,KAEHF,IAAA,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAA,CACEC,GAAA,CAAC,QAAQ,EAAA,EACP,SAAS,EAAC,OAAO,EACjB,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,EAAA,CACnF,EACFA,GAAA,CAAC,QAAQ,IAAC,SAAS,EAAC,OAAO,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,0BAA0B,EAAE,EAAA,CAAI,CAAA,EAAA,CAClG,CACJ,EACDA,GAAA,CAAC,IAAI,EAAA,EAAC,SAAS,EAAC,0EAA0E,EAAA,QAAA,EACvF,QAAQ,EAAE,EAAE,IAAI,CAAA,CAAA,EAAI,QAAQ,CAAC,EAAE,CAAA,CAAE,EAAA,CAC7B,CAAA,EAAA,CACF,EACPA,IAAC,IAAI,EAAA,EAAC,SAAS,EAAC,8CAA8C,EAAC,OAAO,EAAE,SAAS,EAAA,QAAA,EAC/EA,IAAC,KAAK,EAAA,EAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAI,EAAA,CACvC,CAAA,EAAA,CACF;AAEX;;;;"}
@@ -0,0 +1,7 @@
1
+ import { UserBill } from '../../../../types/yourbonds';
2
+ declare const YourLpStakingBondModal: ({ userBill: userBillProp, lostProfit, onDismiss, }: {
3
+ userBill?: UserBill;
4
+ lostProfit?: string;
5
+ onDismiss?: () => void;
6
+ }) => import("react/jsx-runtime").JSX.Element;
7
+ export default YourLpStakingBondModal;
@@ -0,0 +1,78 @@
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import React, { useState } from 'react';
3
+ import clsx from 'clsx';
4
+ import { formatNumberSI } from '../../../../utils/formatNumber.js';
5
+ import { UserBillTooltipText } from '../../../../config/constants/tooltips.js';
6
+ import { pending, claimable, pendingUSD, claimableUSD, claimed } from '../../../../utils/displayHelpers.js';
7
+ import { getTimePeriods } from '../../../../utils/getTimePeriods.js';
8
+ import SafeHTMLComponent from '../../../../components/SafeHTMLComponent/index.js';
9
+ import NftImage from '../../../../views/YourBondsModal/components/NFTImage/NFTImage.js';
10
+ import { ChainId } from '@ape.swap/apeswap-lists';
11
+ import Modal from '../../../../components/uikit-sdk/Modal/index.js';
12
+ import Flex from '../../../../components/uikit-sdk/Flex/index.js';
13
+ import Button from '../../../../components/uikit-sdk/Button/Button.js';
14
+ import TooltipBubble from '../../../../components/uikit-sdk/TooltipBubble/index.js';
15
+ import Text from '../../../../components/uikit-sdk/Text/index.js';
16
+ import useBondsData from '../../../../state/bonds/useBondsData.js';
17
+ import useUserBonds from '../../../../state/bonds/useUserBonds.js';
18
+ import Arrow from '../../../../components/uikit-sdk/Svg/Icons/Arrow.js';
19
+ import QuestionCircle from '../../../../components/uikit-sdk/Svg/Icons/QuestionCircle.js';
20
+ import Skeleton from '../../../../components/uikit-sdk/Skeleton/index.js';
21
+ import YourLpBondModalHeader from './YourLpBondModalHeader.js';
22
+
23
+ // Stands in for a value while the position isn't loaded yet
24
+ const ValueSkeleton = ({ width }) => (jsx(Skeleton, { animation: "waves", style: { width, height: '14px', borderRadius: 'var(--ape-radius-normal)' } }));
25
+ const YourLpStakingBondModal = ({ userBill: userBillProp, lostProfit, onDismiss, }) => {
26
+ // Hooks
27
+ const { data: liveBonds } = useBondsData();
28
+ // Subscribes the modal to the user bonds query (refetched every 2 minutes), so the position updates while it's
29
+ // open: the bill passed in is a snapshot from when the modal was opened (e.g. the deposit still "Indexing...")
30
+ const { data: userBonds } = useUserBonds();
31
+ const userBill = userBonds?.find((bill) => bill.bond?.billType === 'lpStaking' &&
32
+ bill.id === userBillProp?.id &&
33
+ bill.bond?.chainId === userBillProp?.bond?.chainId) ?? userBillProp;
34
+ // State
35
+ const [showNFTImg, setShowNFTImg] = useState(false);
36
+ // Static Data
37
+ // Right after a purchase the modal opens before REAL's API lists the position (see ModalHandlerLpStaking)
38
+ const isLoading = !userBill;
39
+ // REAL's API only prices a fresh purchase some minutes after it shows up, so 0 means it's still being indexed
40
+ const depositUSD = userBill?.nftData?.data?.dollarValue;
41
+ // Minimum position value for a purchase to earn the bonus, in the bonus token
42
+ const bonusThreshold = userBill?.lpStakingData?.bonusThreshold;
43
+ const payoutTokenPrice = parseFloat(userBill?.bond?.payoutTokenPrice ?? '0');
44
+ // The position's two pool tokens, as staked now
45
+ const stakedTokens = userBill?.lpStakingData ? [userBill.lpStakingData.token0, userBill.lpStakingData.token1] : [];
46
+ const payoutSymbol = userBill?.bond?.showcaseTokenName ?? userBill?.bond?.earnToken.symbol;
47
+ const payoutTokenSymbol = payoutSymbol === 'AIX' && userBill?.bond?.chainId === ChainId.SOL ? 'SOLAIX' : payoutSymbol;
48
+ // The same bond, if it's still on sale. Matched by index: the bill's copy of the bond has the bonus token as
49
+ // earnToken, so matching by earn token symbol like the regular Actions do wouldn't find it.
50
+ const liveBond = liveBonds?.find((bond) => !bond?.soldOut && !bond?.hide && bond.index === userBill?.bond?.index && bond.chainId === userBill?.bond?.chainId);
51
+ const canPurchaseAgain = !!liveBond;
52
+ const positionUrl = userBill?.lpStakingData?.positionUrl;
53
+ const poolRewards = userBill?.lpStakingData?.poolRewards;
54
+ // Cliff display info:
55
+ const vestingCliff = Number(userBill?.bond?.vestingCliff);
56
+ const currentTime = Math.round(new Date().getTime() / 1000);
57
+ const vestingStartTimestamp = parseInt(userBill?.vestingStartTimestamp ?? '0');
58
+ const isPendingCliff = vestingCliff ? currentTime - vestingStartTimestamp < vestingCliff : false;
59
+ const cliffCountdown = getTimePeriods(vestingStartTimestamp + (vestingCliff ?? 0) - currentTime, true);
60
+ // The cliff's length, from the campaign (90 days on mainnet, 5 minutes on the Sepolia test stack). Unknown (0)
61
+ // for purchases with no bonus.
62
+ const cliffPeriods = getTimePeriods(vestingCliff || 0, true);
63
+ const cliffLength = !vestingCliff
64
+ ? undefined
65
+ : cliffPeriods.days > 0
66
+ ? `${cliffPeriods.days} days`
67
+ : cliffPeriods.hours > 0
68
+ ? `${cliffPeriods.hours} hours`
69
+ : `${cliffPeriods.minutes} minutes`;
70
+ return (jsx(Modal, { className: clsx('ape:w-[480px] ape:[overflow-y:unset]! ape:p-0! ape:top-[56%] ape:overflow-x-visible', showNFTImg ? 'ape:bg-transparent!' : 'ape:bg-white2'), children: jsxs(Flex, { className: clsx('ape:flex-col ape:rounded-normal ape:relative ape:p-[20px]', showNFTImg ? 'ape:bg-transparent!' : 'ape:bg-white2'), children: [jsx(NftImage, { userBill: userBill, showNFTImg: showNFTImg, setShowNFTImg: setShowNFTImg }), !showNFTImg && (jsxs(Flex, { className: "ape:flex-col", children: [jsx(YourLpBondModalHeader, { userBill: userBill, onDismiss: onDismiss }), jsxs(Flex, { className: "ape:mt-[10px] ape:flex-col ape:gap-[10px]", children: [jsxs(Flex, { className: "ape:w-full ape:gap-[15px] ape:relative", children: [jsxs(Flex, { className: "ape:bg-white3 ape:rounded-normal ape:flex-col ape:md:flex-row ape:justify-center ape:md:justify-between ape:gap-[4px] ape:md:gap-0 ape:p-[10px] ape:w-1/2 ape:items-center ape:text-[14px]", children: [jsx(Flex, { children: "Deposit" }), isLoading ? (jsx(ValueSkeleton, { width: "60px" })) : depositUSD ? (jsxs(Flex, { children: ["$", formatNumberSI(depositUSD)] })) : (jsxs(Flex, { className: "ape:items-center ape:gap-[5px]", children: ["Indexing...", jsx(TooltipBubble, { className: "tooltip-bubble", body: jsx(Flex, { children: "Our services are indexing the tx and deposit amount will be calculated shortly" }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, 0%)", children: jsx(Flex, { className: "block-header icon ape:text-white ape:font-normal ape:text-[12px]", children: jsx(QuestionCircle, { width: "12px" }) }) })] }))] }), jsx(Flex, { className: "ape:absolute ape:top-1/2 ape:left-1/2 ape:-translate-y-1/2 ape:-translate-x-1/2", children: jsx(Arrow, { direction: "right", width: '5px' }) }), jsxs(Flex, { className: "ape:bg-white3 ape:rounded-normal ape:flex-col ape:md:flex-row ape:justify-center ape:md:justify-between ape:gap-[4px] ape:md:gap-0 ape:p-[10px] ape:w-1/2 ape:items-center ape:text-[14px]", children: [jsx(Flex, { children: "Staked" }), jsxs(Flex, { className: "ape:flex-col ape:gap-[4px]", children: [isLoading && (jsxs(Fragment, { children: [jsx(ValueSkeleton, { width: "100px" }), jsx(ValueSkeleton, { width: "100px" })] })), stakedTokens.map((token) => (jsxs(Flex, { className: "ape:items-center ape:justify-center ape:md:justify-end ape:gap-[5px]", children: [jsxs(Flex, { className: "ape:text-[12px]", children: [formatNumberSI(token.amount), " ", token.symbol] }), jsxs(Flex, { className: "ape:text-[10px] ape:font-normal ape:opacity-60", children: ["($", formatNumberSI(token.amountUsd), ")"] })] }, token.address)))] })] })] }), lostProfit && (jsxs(Flex, { className: "ape:bg-white3 ape:rounded-normal ape:w-full ape:p-[10px] ape:justify-between", children: [jsx(Flex, { className: "ape:w-1/5", children: jsx("img", { src: `https://ape.bond/images/launch/mythical.png`, alt: "mythical", style: { width: '90px', height: '90px' } }) }), jsxs(Flex, { className: "ape:w-[75%] ape:flex-col ape:gap-[3px]", children: [jsxs(Flex, { children: ["You missed a", ' ', jsxs(Flex, { className: "ape:px-[3px]", style: { color: 'var(--ape-color-success)' }, children: ["$", lostProfit] }), ' ', "bonus"] }), jsx(Flex, { className: "ape:text-[12px] ape:font-normal", style: { lineHeight: '16px' }, children: "Holding an Ape Tier would\u2019ve gotten you an extra 5% bonus on this purchase and all future ones." }), jsx(Button, { variant: "secondary", className: "ape:w-full ape:text-[14px]! ape:h-[30px] ape:font-semibold", onClick: () => window.open('https://ape.bond/true-yield', '_blank'), children: "Upgrade Your Tier" })] })] })), jsxs(Flex, { className: "ape:flex-col ape:text-[12px] ape:font-normal", children: [jsxs(Flex, { className: "ape:w-full ape:justify-between ape:items-center ape:p-[4px_10px] ape:bg-white3 ape:h-[26px] ape:rounded-[10px_10px_0px_0px]", children: [jsxs(Flex, { className: "ape:items-center ape:gap-[5px]", children: [jsx(Flex, { className: "ape:opacity-60", children: "Bonus Reward" }), jsx(TooltipBubble, { className: "tooltip-bubble", body: jsx(Flex, { children: `Your Bonus Reward unlocks ${cliffLength} after your purchase. Unstaking before it unlocks forfeits the bonus. Once unlocked, you can claim it on REAL's site.` }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, 0%)", children: jsx(Flex, { className: "block-header icon ape:text-white ape:font-normal ape:text-[12px]", children: jsx(QuestionCircle, { width: "12px" }) }) })] }), isLoading ? (jsx(ValueSkeleton, { width: "90px" })) : (jsxs(Flex, { className: "ape:items-center", children: [jsxs(Text, { weight: 700, className: "ape:ml-[10px]", size: "12px", children: [formatNumberSI(pending(userBill) + claimable(userBill), 2), " ", payoutTokenSymbol] }), jsxs(Text, { weight: 400, className: "ape:ml-[5px] ape:opacity-60 ape:text-[10px]!", children: ["($", formatNumberSI(pendingUSD(userBill) + claimableUSD(userBill)), ")"] })] }))] }), jsxs(Flex, { className: "ape:w-full ape:justify-between ape:items-center ape:p-[4px_10px] ape:bg-white4 ape:h-[26px]", children: [jsxs(Flex, { className: "ape:items-center ape:gap-[5px]", children: [jsx(Flex, { className: "ape:opacity-60", children: "Claim Status" }), jsx(TooltipBubble, { className: "tooltip-bubble", body: jsx(Flex, { children: UserBillTooltipText.FullyVested }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, 0%)", children: jsx(Flex, { className: "block-header icon ape:text-white ape:font-normal ape:text-[12px]", children: jsx(QuestionCircle, { width: "12px" }) }) })] }), jsx(Flex, { className: "ape:items-center", children: isLoading ? (jsx(ValueSkeleton, { width: "90px" })) : userBill?.lpStakingData?.bonusStatus === null ? (jsxs(Flex, { className: "ape:items-center ape:gap-[5px]", children: ["Not eligible", jsx(TooltipBubble, { className: "tooltip-bubble", body: jsx(Flex, { children: bonusThreshold !== undefined
71
+ ? `This sale was not eligible for Bonus Rewards as its value was below the minimum threshold of ${formatNumberSI(bonusThreshold)} ${payoutTokenSymbol} ($${formatNumberSI(bonusThreshold * payoutTokenPrice)}).`
72
+ : 'This sale was not eligible for Bonus Rewards as its value was below the minimum threshold.' }), width: "230px", placement: "bottomRight", transformTip: "translate(5%, 0%)", children: jsx(Flex, { className: "block-header icon ape:text-white ape:font-normal ape:text-[12px]", children: jsx(QuestionCircle, { width: "12px" }) }) })] })) : isPendingCliff ? (`Claiming starts in ${cliffCountdown.days !== 0 ? `${cliffCountdown.days} days` : cliffCountdown.hours !== 0 ? `${cliffCountdown.hours} hours` : `${cliffCountdown.minutes} mins`}`) : claimable(userBill) > 0 ? ('Claim now!') : claimed(userBill) > 0 ? ('Claimed') : (
73
+ // Forfeited: unstaked before the cliff
74
+ '-') })] }), jsxs(Flex, { className: "ape:w-full ape:justify-between ape:items-center ape:p-[4px_10px] ape:bg-white3 ape:min-h-[26px] ape:md:h-[26px] ape:rounded-[0px_0px_10px_10px]", children: [jsxs(Flex, { className: "ape:items-center ape:gap-[5px]", children: [jsx(Flex, { className: "ape:opacity-60", children: "Pool Rewards" }), jsx(TooltipBubble, { className: "tooltip-bubble", body: jsx(Flex, { children: "Pool Rewards are accrued per epoch, by the position's weight among all staked positions, and only while it's in range." }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, 0%)", children: jsx(Flex, { className: "block-header icon ape:text-white ape:font-normal ape:text-[12px]", children: jsx(QuestionCircle, { width: "12px" }) }) })] }), jsx(Flex, { className: "ape:flex-col ape:md:flex-row ape:items-end ape:md:items-center ape:gap-[2px] ape:md:gap-[10px]", children: isLoading ? (jsx(ValueSkeleton, { width: "90px" })) : poolRewards ? (poolRewards.map((reward, index) => (jsxs(React.Fragment, { children: [index > 0 && (jsx(Text, { as: "span", weight: 700, className: "ape:hidden ape:md:inline", size: "12px", children: "\u00B7" })), jsxs(Flex, { className: "ape:items-center ape:gap-[5px]", children: [jsxs(Text, { weight: 700, size: "12px", children: [formatNumberSI(reward.amount, 2), " ", reward.symbol] }), reward.amountUsd !== undefined && (jsxs(Flex, { className: "ape:text-[10px] ape:font-normal ape:opacity-60", children: ["($", formatNumberSI(reward.amountUsd), ")"] }))] })] }, reward.address)))) : ('-') })] })] }), userBill?.bond?.warningCard && (jsx(Flex, { className: "ape:w-full ape:justify-center ape:rounded-normal ape:bg-[#DE62F366]", children: jsx(Text, { as: "div", weight: 400, size: "12px", className: "ape:p-[4px_10px]", style: { lineHeight: '16px' }, children: jsx(SafeHTMLComponent, { html: userBill?.bond?.warningCard }) }) })), jsxs(Flex, { className: "ape:w-full ape:justify-between ape:gap-[10px] ape:md:gap-[15px] ape:h-[40px]", children: [jsx(Button, { className: "ape:w-full ape:text-[14px]!", disabled: !positionUrl, onClick: () => window.open(positionUrl, '_blank', 'noopener,noreferrer'), children: "Manage on REAL" }), isLoading ? (jsx(Button, { className: "ape:text-[14px]! ape:w-full", disabled: true, children: "Buy again" })) : canPurchaseAgain ? (jsx(Button, { className: "ape:text-[14px]! ape:w-full", onClick: () => (window.location.href = `/bonds?bondAddress=${liveBond.contractAddress[liveBond.chainId]}&bondChain=${liveBond.chainId}`), children: "Buy again" })) : (jsx("div", { className: "ape:w-full ape:flex ape:*:w-full ape:*:*:w-full", children: jsx(TooltipBubble, { className: "tooltip-bubble", body: jsx(Flex, { children: "Bond sold out" }), width: "150px", placement: "topRight", children: jsx(Button, { className: "ape:text-[14px]! ape:w-full ape:pointer-events-none", disabled: true, children: "Buy again" }) }) }))] })] })] }))] }) }));
75
+ };
76
+
77
+ export { YourLpStakingBondModal as default };
78
+ //# sourceMappingURL=YourLpStakingBondModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"YourLpStakingBondModal.js","sources":["../../../../../src/adapters/evm/views/lpStaking/YourLpStakingBondModal.tsx"],"sourcesContent":["import React, { useState } from 'react'\nimport clsx from 'clsx'\nimport { UserBill } from '../../../../types/yourbonds'\nimport { formatNumberSI } from '../../../../utils/formatNumber'\nimport { UserBillTooltipText } from '../../../../config/constants/tooltips'\nimport { claimable, claimableUSD, claimed, pending, pendingUSD } from '../../../../utils/displayHelpers'\nimport { getTimePeriods } from '../../../../utils/getTimePeriods'\nimport SafeHTMLComponent from '../../../../components/SafeHTMLComponent'\nimport NFTImage from '../../../../views/YourBondsModal/components/NFTImage/NFTImage'\nimport { ChainId } from '@ape.swap/apeswap-lists'\nimport Modal from '../../../../components/uikit-sdk/Modal'\nimport Flex from '../../../../components/uikit-sdk/Flex'\nimport Button from '../../../../components/uikit-sdk/Button/Button'\nimport TooltipBubble from '../../../../components/uikit-sdk/TooltipBubble'\nimport Text from '../../../../components/uikit-sdk/Text'\nimport useBondsData from '../../../../state/bonds/useBondsData'\nimport useUserBonds from '../../../../state/bonds/useUserBonds'\nimport Arrow from '../../../../components/uikit-sdk/Svg/Icons/Arrow'\nimport QuestionCircle from '../../../../components/uikit-sdk/Svg/Icons/QuestionCircle'\nimport Skeleton from '../../../../components/uikit-sdk/Skeleton'\nimport YourLpBondModalHeader from './YourLpBondModalHeader'\n\n// Stands in for a value while the position isn't loaded yet\nconst ValueSkeleton = ({ width }: { width: string }) => (\n <Skeleton animation=\"waves\" style={{ width, height: '14px', borderRadius: 'var(--ape-radius-normal)' }} />\n)\n\nconst YourLpStakingBondModal = ({\n userBill: userBillProp,\n lostProfit,\n onDismiss,\n}: {\n userBill?: UserBill\n lostProfit?: string\n onDismiss?: () => void\n}) => {\n // Hooks\n const { data: liveBonds } = useBondsData()\n // Subscribes the modal to the user bonds query (refetched every 2 minutes), so the position updates while it's\n // open: the bill passed in is a snapshot from when the modal was opened (e.g. the deposit still \"Indexing...\")\n const { data: userBonds } = useUserBonds()\n const userBill =\n userBonds?.find(\n (bill) =>\n bill.bond?.billType === 'lpStaking' &&\n bill.id === userBillProp?.id &&\n bill.bond?.chainId === userBillProp?.bond?.chainId,\n ) ?? userBillProp\n\n // State\n const [showNFTImg, setShowNFTImg] = useState(false)\n\n // Static Data\n // Right after a purchase the modal opens before REAL's API lists the position (see ModalHandlerLpStaking)\n const isLoading = !userBill\n // REAL's API only prices a fresh purchase some minutes after it shows up, so 0 means it's still being indexed\n const depositUSD = userBill?.nftData?.data?.dollarValue\n // Minimum position value for a purchase to earn the bonus, in the bonus token\n const bonusThreshold = userBill?.lpStakingData?.bonusThreshold\n const payoutTokenPrice = parseFloat(userBill?.bond?.payoutTokenPrice ?? '0')\n // The position's two pool tokens, as staked now\n const stakedTokens = userBill?.lpStakingData ? [userBill.lpStakingData.token0, userBill.lpStakingData.token1] : []\n const payoutSymbol = userBill?.bond?.showcaseTokenName ?? userBill?.bond?.earnToken.symbol\n const payoutTokenSymbol = payoutSymbol === 'AIX' && userBill?.bond?.chainId === ChainId.SOL ? 'SOLAIX' : payoutSymbol\n // The same bond, if it's still on sale. Matched by index: the bill's copy of the bond has the bonus token as\n // earnToken, so matching by earn token symbol like the regular Actions do wouldn't find it.\n const liveBond = liveBonds?.find(\n (bond) =>\n !bond?.soldOut && !bond?.hide && bond.index === userBill?.bond?.index && bond.chainId === userBill?.bond?.chainId,\n )\n const canPurchaseAgain = !!liveBond\n const positionUrl = userBill?.lpStakingData?.positionUrl\n const poolRewards = userBill?.lpStakingData?.poolRewards\n\n // Cliff display info:\n const vestingCliff = Number(userBill?.bond?.vestingCliff)\n const currentTime = Math.round(new Date().getTime() / 1000)\n const vestingStartTimestamp = parseInt(userBill?.vestingStartTimestamp ?? '0')\n const isPendingCliff = vestingCliff ? currentTime - vestingStartTimestamp < vestingCliff : false\n const cliffCountdown = getTimePeriods(vestingStartTimestamp + (vestingCliff ?? 0) - currentTime, true)\n // The cliff's length, from the campaign (90 days on mainnet, 5 minutes on the Sepolia test stack). Unknown (0)\n // for purchases with no bonus.\n const cliffPeriods = getTimePeriods(vestingCliff || 0, true)\n const cliffLength = !vestingCliff\n ? undefined\n : cliffPeriods.days > 0\n ? `${cliffPeriods.days} days`\n : cliffPeriods.hours > 0\n ? `${cliffPeriods.hours} hours`\n : `${cliffPeriods.minutes} minutes`\n\n return (\n <Modal\n className={clsx(\n 'ape:w-[480px] ape:[overflow-y:unset]! ape:p-0! ape:top-[56%] ape:overflow-x-visible',\n showNFTImg ? 'ape:bg-transparent!' : 'ape:bg-white2',\n )}\n >\n <Flex\n className={clsx(\n 'ape:flex-col ape:rounded-normal ape:relative ape:p-[20px]',\n showNFTImg ? 'ape:bg-transparent!' : 'ape:bg-white2',\n )}\n >\n <NFTImage userBill={userBill} showNFTImg={showNFTImg} setShowNFTImg={setShowNFTImg} />\n\n {/* Modal Content */}\n\n {!showNFTImg && (\n <Flex className=\"ape:flex-col\">\n <YourLpBondModalHeader userBill={userBill} onDismiss={onDismiss} />\n <Flex className=\"ape:mt-[10px] ape:flex-col ape:gap-[10px]\">\n <Flex className=\"ape:w-full ape:gap-[15px] ape:relative\">\n {/* On mobile the label goes on top and the amount below it */}\n <Flex className=\"ape:bg-white3 ape:rounded-normal ape:flex-col ape:md:flex-row ape:justify-center ape:md:justify-between ape:gap-[4px] ape:md:gap-0 ape:p-[10px] ape:w-1/2 ape:items-center ape:text-[14px]\">\n <Flex>Deposit</Flex>\n {isLoading ? (\n <ValueSkeleton width=\"60px\" />\n ) : depositUSD ? (\n <Flex>${formatNumberSI(depositUSD)}</Flex>\n ) : (\n <Flex className=\"ape:items-center ape:gap-[5px]\">\n Indexing...\n <TooltipBubble\n className=\"tooltip-bubble\"\n body={\n <Flex>Our services are indexing the tx and deposit amount will be calculated shortly</Flex>\n }\n width=\"230px\"\n placement=\"bottomLeft\"\n transformTip=\"translate(-5%, 0%)\"\n >\n <Flex className=\"block-header icon ape:text-white ape:font-normal ape:text-[12px]\">\n <QuestionCircle width=\"12px\" />\n </Flex>\n </TooltipBubble>\n </Flex>\n )}\n </Flex>\n <Flex className=\"ape:absolute ape:top-1/2 ape:left-1/2 ape:-translate-y-1/2 ape:-translate-x-1/2\">\n <Arrow direction=\"right\" width={'5px'} />\n </Flex>\n <Flex className=\"ape:bg-white3 ape:rounded-normal ape:flex-col ape:md:flex-row ape:justify-center ape:md:justify-between ape:gap-[4px] ape:md:gap-0 ape:p-[10px] ape:w-1/2 ape:items-center ape:text-[14px]\">\n <Flex>Staked</Flex>\n <Flex className=\"ape:flex-col ape:gap-[4px]\">\n {isLoading && (\n <>\n <ValueSkeleton width=\"100px\" />\n <ValueSkeleton width=\"100px\" />\n </>\n )}\n {stakedTokens.map((token) => (\n <Flex\n key={token.address}\n className=\"ape:items-center ape:justify-center ape:md:justify-end ape:gap-[5px]\"\n >\n <Flex className=\"ape:text-[12px]\">\n {formatNumberSI(token.amount)} {token.symbol}\n </Flex>\n <Flex className=\"ape:text-[10px] ape:font-normal ape:opacity-60\">\n (${formatNumberSI(token.amountUsd)})\n </Flex>\n </Flex>\n ))}\n </Flex>\n </Flex>\n </Flex>\n {lostProfit && (\n <Flex className=\"ape:bg-white3 ape:rounded-normal ape:w-full ape:p-[10px] ape:justify-between\">\n <Flex className=\"ape:w-1/5\">\n <img\n src={`https://ape.bond/images/launch/mythical.png`}\n alt=\"mythical\"\n style={{ width: '90px', height: '90px' }}\n />\n </Flex>\n <Flex className=\"ape:w-[75%] ape:flex-col ape:gap-[3px]\">\n <Flex>\n You missed a{' '}\n <Flex className=\"ape:px-[3px]\" style={{ color: 'var(--ape-color-success)' }}>\n ${lostProfit}\n </Flex>{' '}\n bonus\n </Flex>\n <Flex className=\"ape:text-[12px] ape:font-normal\" style={{ lineHeight: '16px' }}>\n Holding an Ape Tier would’ve gotten you an extra 5% bonus on this purchase and all future ones.\n </Flex>\n <Button\n variant=\"secondary\"\n className=\"ape:w-full ape:text-[14px]! ape:h-[30px] ape:font-semibold\"\n onClick={() => window.open('https://ape.bond/true-yield', '_blank')}\n >\n Upgrade Your Tier\n </Button>\n </Flex>\n </Flex>\n )}\n <Flex className=\"ape:flex-col ape:text-[12px] ape:font-normal\">\n <Flex className=\"ape:w-full ape:justify-between ape:items-center ape:p-[4px_10px] ape:bg-white3 ape:h-[26px] ape:rounded-[10px_10px_0px_0px]\">\n <Flex className=\"ape:items-center ape:gap-[5px]\">\n <Flex className=\"ape:opacity-60\">Bonus Reward</Flex>\n <TooltipBubble\n className=\"tooltip-bubble\"\n body={\n <Flex>\n {`Your Bonus Reward unlocks ${cliffLength} after your purchase. Unstaking before it unlocks forfeits the bonus. Once unlocked, you can claim it on REAL's site.`}\n </Flex>\n }\n width=\"230px\"\n placement=\"bottomLeft\"\n transformTip=\"translate(-5%, 0%)\"\n >\n <Flex className=\"block-header icon ape:text-white ape:font-normal ape:text-[12px]\">\n <QuestionCircle width=\"12px\" />\n </Flex>\n </TooltipBubble>\n </Flex>\n {isLoading ? (\n <ValueSkeleton width=\"90px\" />\n ) : (\n <Flex className=\"ape:items-center\">\n <Text weight={700} className=\"ape:ml-[10px]\" size=\"12px\">\n {/* The bonus, locked or claimable; 0 once claimed */}\n {formatNumberSI(pending(userBill) + claimable(userBill), 2)} {payoutTokenSymbol}\n </Text>\n <Text weight={400} className=\"ape:ml-[5px] ape:opacity-60 ape:text-[10px]!\">\n (${formatNumberSI(pendingUSD(userBill) + claimableUSD(userBill))})\n </Text>\n </Flex>\n )}\n </Flex>\n <Flex className=\"ape:w-full ape:justify-between ape:items-center ape:p-[4px_10px] ape:bg-white4 ape:h-[26px]\">\n <Flex className=\"ape:items-center ape:gap-[5px]\">\n <Flex className=\"ape:opacity-60\">Claim Status</Flex>\n <TooltipBubble\n className=\"tooltip-bubble\"\n body={<Flex>{UserBillTooltipText.FullyVested}</Flex>}\n width=\"230px\"\n placement=\"bottomLeft\"\n transformTip=\"translate(-5%, 0%)\"\n >\n <Flex className=\"block-header icon ape:text-white ape:font-normal ape:text-[12px]\">\n <QuestionCircle width=\"12px\" />\n </Flex>\n </TooltipBubble>\n </Flex>\n <Flex className=\"ape:items-center\">\n {isLoading ? (\n <ValueSkeleton width=\"90px\" />\n ) : userBill?.lpStakingData?.bonusStatus === null ? (\n // The purchase was below the campaign's minimum bonus, so it has no bonus at all\n <Flex className=\"ape:items-center ape:gap-[5px]\">\n Not eligible\n <TooltipBubble\n className=\"tooltip-bubble\"\n body={\n <Flex>\n {bonusThreshold !== undefined\n ? `This sale was not eligible for Bonus Rewards as its value was below the minimum threshold of ${formatNumberSI(bonusThreshold)} ${payoutTokenSymbol} ($${formatNumberSI(bonusThreshold * payoutTokenPrice)}).`\n : 'This sale was not eligible for Bonus Rewards as its value was below the minimum threshold.'}\n </Flex>\n }\n width=\"230px\"\n placement=\"bottomRight\"\n transformTip=\"translate(5%, 0%)\"\n >\n <Flex className=\"block-header icon ape:text-white ape:font-normal ape:text-[12px]\">\n <QuestionCircle width=\"12px\" />\n </Flex>\n </TooltipBubble>\n </Flex>\n ) : isPendingCliff ? (\n `Claiming starts in ${cliffCountdown.days !== 0 ? `${cliffCountdown.days} days` : cliffCountdown.hours !== 0 ? `${cliffCountdown.hours} hours` : `${cliffCountdown.minutes} mins`}`\n ) : claimable(userBill) > 0 ? (\n 'Claim now!'\n ) : claimed(userBill) > 0 ? (\n 'Claimed'\n ) : (\n // Forfeited: unstaked before the cliff\n '-'\n )}\n </Flex>\n </Flex>\n {/* On mobile the rewards stack one per line, so the row grows to fit them */}\n <Flex className=\"ape:w-full ape:justify-between ape:items-center ape:p-[4px_10px] ape:bg-white3 ape:min-h-[26px] ape:md:h-[26px] ape:rounded-[0px_0px_10px_10px]\">\n <Flex className=\"ape:items-center ape:gap-[5px]\">\n <Flex className=\"ape:opacity-60\">Pool Rewards</Flex>\n <TooltipBubble\n className=\"tooltip-bubble\"\n body={\n <Flex>\n Pool Rewards are accrued per epoch, by the position&apos;s weight among all staked positions,\n and only while it&apos;s in range.\n </Flex>\n }\n width=\"230px\"\n placement=\"bottomLeft\"\n transformTip=\"translate(-5%, 0%)\"\n >\n <Flex className=\"block-header icon ape:text-white ape:font-normal ape:text-[12px]\">\n <QuestionCircle width=\"12px\" />\n </Flex>\n </TooltipBubble>\n </Flex>\n <Flex className=\"ape:flex-col ape:md:flex-row ape:items-end ape:md:items-center ape:gap-[2px] ape:md:gap-[10px]\">\n {isLoading ? (\n <ValueSkeleton width=\"90px\" />\n ) : poolRewards ? (\n poolRewards.map((reward, index) => (\n <React.Fragment key={reward.address}>\n {/* Separator between the rewards on one line; on mobile they're stacked instead */}\n {index > 0 && (\n <Text as=\"span\" weight={700} className=\"ape:hidden ape:md:inline\" size=\"12px\">\n ·\n </Text>\n )}\n <Flex className=\"ape:items-center ape:gap-[5px]\">\n <Text weight={700} size=\"12px\">\n {formatNumberSI(reward.amount, 2)} {reward.symbol}\n </Text>\n {reward.amountUsd !== undefined && (\n <Flex className=\"ape:text-[10px] ape:font-normal ape:opacity-60\">\n (${formatNumberSI(reward.amountUsd)})\n </Flex>\n )}\n </Flex>\n </React.Fragment>\n ))\n ) : (\n '-'\n )}\n </Flex>\n </Flex>\n </Flex>\n {userBill?.bond?.warningCard && (\n <Flex className=\"ape:w-full ape:justify-center ape:rounded-normal ape:bg-[#DE62F366]\">\n <Text as=\"div\" weight={400} size=\"12px\" className=\"ape:p-[4px_10px]\" style={{ lineHeight: '16px' }}>\n <SafeHTMLComponent html={userBill?.bond?.warningCard} />\n </Text>\n </Flex>\n )}\n <Flex className=\"ape:w-full ape:justify-between ape:gap-[10px] ape:md:gap-[15px] ape:h-[40px]\">\n {/* Every claim (bonus and pool rewards) happens on REAL's site, on the position's page */}\n <Button\n className=\"ape:w-full ape:text-[14px]!\"\n disabled={!positionUrl}\n onClick={() => window.open(positionUrl, '_blank', 'noopener,noreferrer')}\n >\n Manage on REAL\n </Button>\n {isLoading ? (\n // Not known yet whether the bond is still on sale, so no \"sold out\" tooltip\n <Button className=\"ape:text-[14px]! ape:w-full\" disabled>\n Buy again\n </Button>\n ) : canPurchaseAgain ? (\n <Button\n className=\"ape:text-[14px]! ape:w-full\"\n onClick={() =>\n (window.location.href = `/bonds?bondAddress=${liveBond.contractAddress[liveBond.chainId]}&bondChain=${liveBond.chainId}`)\n }\n >\n Buy again\n </Button>\n ) : (\n // The tooltip's wrappers are sized to their content, so they're stretched to the button's half.\n // The disabled button lets the pointer through, so hovering or tapping it opens the tooltip.\n <div className=\"ape:w-full ape:flex ape:*:w-full ape:*:*:w-full\">\n <TooltipBubble\n className=\"tooltip-bubble\"\n body={<Flex>Bond sold out</Flex>}\n width=\"150px\"\n placement=\"topRight\"\n >\n <Button className=\"ape:text-[14px]! ape:w-full ape:pointer-events-none\" disabled>\n Buy again\n </Button>\n </TooltipBubble>\n </div>\n )}\n </Flex>\n </Flex>\n </Flex>\n )}\n </Flex>\n </Modal>\n )\n}\n\nexport default YourLpStakingBondModal\n"],"names":["_jsx","_jsxs","NFTImage","_Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAsBA;AACA,MAAM,aAAa,GAAG,CAAC,EAAE,KAAK,EAAqB,MACjDA,GAAA,CAAC,QAAQ,EAAA,EAAC,SAAS,EAAC,OAAO,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,0BAA0B,EAAE,EAAA,CAAI,CAC3G;AAED,MAAM,sBAAsB,GAAG,CAAC,EAC9B,QAAQ,EAAE,YAAY,EACtB,UAAU,EACV,SAAS,GAKV,KAAI;;IAEH,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,YAAY,EAAE;;;IAG1C,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,YAAY,EAAE;AAC1C,IAAA,MAAM,QAAQ,GACZ,SAAS,EAAE,IAAI,CACb,CAAC,IAAI,KACH,IAAI,CAAC,IAAI,EAAE,QAAQ,KAAK,WAAW;AACnC,QAAA,IAAI,CAAC,EAAE,KAAK,YAAY,EAAE,EAAE;AAC5B,QAAA,IAAI,CAAC,IAAI,EAAE,OAAO,KAAK,YAAY,EAAE,IAAI,EAAE,OAAO,CACrD,IAAI,YAAY;;IAGnB,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC;;;AAInD,IAAA,MAAM,SAAS,GAAG,CAAC,QAAQ;;IAE3B,MAAM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mBAAA,EAAsB,QAAQ,CAAC,eAAe,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA,WAAA,EAAc,QAAQ,CAAC,OAAO,CAAA,CAAE,CAAC,0BAIpH,KAITA,aAAK,SAAS,EAAC,iDAAiD,EAAA,QAAA,EAC9DA,GAAA,CAAC,aAAa,IACZ,SAAS,EAAC,gBAAgB,EAC1B,IAAI,EAAEA,GAAA,CAAC,IAAI,EAAA,EAAA,QAAA,EAAA,eAAA,EAAA,CAAqB,EAChC,KAAK,EAAC,OAAO,EACb,SAAS,EAAC,UAAU,EAAA,QAAA,EAEpBA,IAAC,MAAM,EAAA,EAAC,SAAS,EAAC,qDAAqD,EAAC,QAAQ,EAAA,IAAA,EAAA,QAAA,EAAA,WAAA,EAAA,CAEvE,EAAA,CACK,EAAA,CACZ,CACP,CAAA,EAAA,CACI,CAAA,EAAA,CACF,IACF,CACR,CAAA,EAAA,CACI,EAAA,CACD;AAEZ;;;;"}
@@ -37,17 +37,20 @@ export type TokenBalance = {
37
37
  address: string;
38
38
  balance: string;
39
39
  };
40
+ /** A bond type's own modal flow (buy, then what follows it), opened from the bond list and from URL params. */
41
+ export interface BondModalHandlerProps {
42
+ bondAddress: string;
43
+ bondChain: number;
44
+ onDismiss?: () => void;
45
+ isProjectView?: boolean;
46
+ }
40
47
  /** PreTGE / launch bonds and their Yield variant (EVM-only today). */
41
48
  export interface PreTGEAdapter {
42
49
  fetchBondsData(chainId: ChainId, tokenPrices: Partial<Record<ChainId, TokenPrices[]>>, bonds: PreTGEConfig[], apiUrl: string): Promise<BondsData[]>;
43
50
  /** Read by core's useUserBondsPreTGE; a plain function, so core owns the query (no adapter hooks in core). */
44
51
  fetchUserBonds(chains: number[], tokenPrices: Partial<Record<ChainId, TokenPrices[]>>, preTGEList: PreTGEConfig[], account: string, apiUrl: string): Promise<PreTGEUserBonds[]>;
45
52
  /** Buy flow of a PreTGE bond, opened from the bond list and from URL params. */
46
- ModalHandler: React.FC<{
47
- bondAddress: string;
48
- bondChain: number;
49
- onDismiss?: () => void;
50
- }>;
53
+ ModalHandler: React.FC<BondModalHandlerProps>;
51
54
  UserBondRow: React.FC<{
52
55
  userBond: PreTGEUserBonds;
53
56
  }>;
@@ -55,6 +58,17 @@ export interface PreTGEAdapter {
55
58
  userBond: PreTGEUserBonds;
56
59
  }>;
57
60
  }
61
+ /** LP staking bonds (`billType === 'lpStaking'`, EVM-only today), with their own buy flow apart from regular bonds. */
62
+ export interface LpStakingAdapter {
63
+ /** Buy flow opened from the bond list and from URL params; owns what is shown after a purchase. */
64
+ ModalHandler: React.FC<BondModalHandlerProps>;
65
+ /** The buy form alone, rendered by `ChainBuyComponent` (SingleBond, ProjectView, hot bonds, BuyBondModal). */
66
+ BuyComponent: React.FC<ChainBuyComponentProps>;
67
+ /** A purchased LP staking position in Your Bonds (with its own modal) */
68
+ UserBondRow: React.FC<{
69
+ bill: UserBill;
70
+ }>;
71
+ }
58
72
  /**
59
73
  * A chain family's integration (EVM, Solana, Aptos, Sui). Core code reaches chain-specific code only through
60
74
  * registered adapters, never by importing it, so a consumer only installs the libraries of the families it uses.
@@ -94,6 +108,7 @@ export interface ChainAdapter {
94
108
  /** Tier points of an address. Tiers live on an EVM lens contract, so only the EVM adapter provides this. */
95
109
  getTierPoints?(account: string, apiUrl: string): Promise<TierPoints>;
96
110
  preTGE?: PreTGEAdapter;
111
+ lpStaking?: LpStakingAdapter;
97
112
  }
98
113
  export interface BridgeModalProps {
99
114
  bondChain: ChainId;