@ape.swap/bonds-sdk 1.0.502 → 1.0.504

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 (223) hide show
  1. package/dist/components/BondRows/BondRow.d.ts +0 -1
  2. package/dist/components/BondRows/BondRow.js +2 -13
  3. package/dist/components/BondRows/BondRowHeader.js +1 -12
  4. package/dist/components/BondRows/BondRowsByChain.d.ts +1 -1
  5. package/dist/components/BondRows/BondRowsByChain.js +2 -13
  6. package/dist/components/BondRows/BondRowsWithTitle.d.ts +1 -2
  7. package/dist/components/BondRows/BondRowsWithTitle.js +2 -13
  8. package/dist/components/BondRows/ChainTitle.d.ts +1 -1
  9. package/dist/components/BondRows/ChainTitle.js +2 -13
  10. package/dist/components/MenuSelect/MenuSelect.d.ts +5 -1
  11. package/dist/components/MenuSelect/MenuSelect.js +1 -1
  12. package/dist/components/MenuSelect/RecommendationSelector.js +5 -16
  13. package/dist/components/Modals/BondModal/BondModal.js +41 -48
  14. package/dist/components/Modals/YourBondsModal/YourBondsModal.d.ts +2 -2
  15. package/dist/components/Modals/YourBondsModal/YourBondsModal.js +27 -34
  16. package/dist/components/NetworkFilter/index.js +6 -17
  17. package/dist/components/ProgressBar/ProgressBar.js +3 -14
  18. package/dist/components/ProgressBar/ProgressBarWrapper.js +1 -12
  19. package/dist/components/TokenInfoAndName/index.d.ts +1 -1
  20. package/dist/components/TokenInfoAndName/index.js +6 -17
  21. package/dist/components/Tooltip/ButtonsRow.js +1 -1
  22. package/dist/components/Tooltip/Tooltip.js +1 -12
  23. package/dist/components/YourBondsModal/YourBondsModal.js +9 -20
  24. package/dist/components/uikit-sdk/Button/IconButton.js +1 -1
  25. package/dist/components/uikit-sdk/Checkbox/index.d.ts +0 -1
  26. package/dist/components/uikit-sdk/Checkbox/index.js +2 -2
  27. package/dist/components/uikit-sdk/Flex/index.d.ts +3 -1
  28. package/dist/components/uikit-sdk/Input/Input.d.ts +7 -2
  29. package/dist/components/uikit-sdk/Input/Input.js +5 -5
  30. package/dist/components/uikit-sdk/Input/NumericInput.d.ts +4 -5
  31. package/dist/components/uikit-sdk/Input/StyledInput.js +1 -12
  32. package/dist/components/uikit-sdk/Select/Select.js +4 -4
  33. package/dist/components/uikit-sdk/Select/SelectItem.d.ts +0 -1
  34. package/dist/components/uikit-sdk/Select/SelectItem.js +1 -1
  35. package/dist/components/uikit-sdk/Svg/Icons/AbondFullLogo.js +1 -12
  36. package/dist/components/uikit-sdk/Svg/Icons/AbondSmallLogo.js +1 -12
  37. package/dist/components/uikit-sdk/Svg/Icons/AccountMonkey.js +1 -12
  38. package/dist/components/uikit-sdk/Svg/Icons/AllChains.js +1 -12
  39. package/dist/components/uikit-sdk/Svg/Icons/ApebondLogo.js +1 -12
  40. package/dist/components/uikit-sdk/Svg/Icons/ApeswapSmallLogo.js +1 -12
  41. package/dist/components/uikit-sdk/Svg/Icons/Arrow.js +1 -12
  42. package/dist/components/uikit-sdk/Svg/Icons/Audit.js +1 -12
  43. package/dist/components/uikit-sdk/Svg/Icons/BananaIcon.js +1 -12
  44. package/dist/components/uikit-sdk/Svg/Icons/BillsM1.js +1 -12
  45. package/dist/components/uikit-sdk/Svg/Icons/BillsM2.js +1 -12
  46. package/dist/components/uikit-sdk/Svg/Icons/BillsM3.js +1 -12
  47. package/dist/components/uikit-sdk/Svg/Icons/Bridge.js +1 -12
  48. package/dist/components/uikit-sdk/Svg/Icons/Bubble.js +1 -12
  49. package/dist/components/uikit-sdk/Svg/Icons/Calculator.js +1 -12
  50. package/dist/components/uikit-sdk/Svg/Icons/Calendar.js +1 -12
  51. package/dist/components/uikit-sdk/Svg/Icons/Cancelled.js +1 -12
  52. package/dist/components/uikit-sdk/Svg/Icons/Card.js +1 -12
  53. package/dist/components/uikit-sdk/Svg/Icons/Caret.js +1 -12
  54. package/dist/components/uikit-sdk/Svg/Icons/Chain.js +1 -12
  55. package/dist/components/uikit-sdk/Svg/Icons/Chart.js +1 -12
  56. package/dist/components/uikit-sdk/Svg/Icons/Chat.js +1 -12
  57. package/dist/components/uikit-sdk/Svg/Icons/Close.js +1 -12
  58. package/dist/components/uikit-sdk/Svg/Icons/Cog.d.ts +0 -1
  59. package/dist/components/uikit-sdk/Svg/Icons/Cog.js +1 -12
  60. package/dist/components/uikit-sdk/Svg/Icons/Collapse.js +1 -12
  61. package/dist/components/uikit-sdk/Svg/Icons/Copy.js +1 -12
  62. package/dist/components/uikit-sdk/Svg/Icons/Discord.js +1 -12
  63. package/dist/components/uikit-sdk/Svg/Icons/DiscordNew.js +1 -12
  64. package/dist/components/uikit-sdk/Svg/Icons/Docs.js +1 -12
  65. package/dist/components/uikit-sdk/Svg/Icons/DocsV2.js +1 -12
  66. package/dist/components/uikit-sdk/Svg/Icons/Ellipse.js +1 -12
  67. package/dist/components/uikit-sdk/Svg/Icons/Error.js +1 -12
  68. package/dist/components/uikit-sdk/Svg/Icons/Expand.js +1 -12
  69. package/dist/components/uikit-sdk/Svg/Icons/Explorer.js +1 -12
  70. package/dist/components/uikit-sdk/Svg/Icons/External.js +1 -12
  71. package/dist/components/uikit-sdk/Svg/Icons/Farm.js +1 -12
  72. package/dist/components/uikit-sdk/Svg/Icons/Fav.js +1 -12
  73. package/dist/components/uikit-sdk/Svg/Icons/FilledURL.js +1 -12
  74. package/dist/components/uikit-sdk/Svg/Icons/Fire.js +1 -12
  75. package/dist/components/uikit-sdk/Svg/Icons/Frame.js +1 -12
  76. package/dist/components/uikit-sdk/Svg/Icons/FullLogo.js +1 -12
  77. package/dist/components/uikit-sdk/Svg/Icons/Gnana.js +1 -12
  78. package/dist/components/uikit-sdk/Svg/Icons/GreenShield.d.ts +0 -1
  79. package/dist/components/uikit-sdk/Svg/Icons/GreenShield.js +1 -12
  80. package/dist/components/uikit-sdk/Svg/Icons/Hamburger.js +1 -12
  81. package/dist/components/uikit-sdk/Svg/Icons/HamburgerClosed.js +1 -12
  82. package/dist/components/uikit-sdk/Svg/Icons/Home.js +1 -12
  83. package/dist/components/uikit-sdk/Svg/Icons/Hot.js +1 -12
  84. package/dist/components/uikit-sdk/Svg/Icons/Info.js +1 -12
  85. package/dist/components/uikit-sdk/Svg/Icons/InfoSolid.js +1 -12
  86. package/dist/components/uikit-sdk/Svg/Icons/Insight.js +1 -12
  87. package/dist/components/uikit-sdk/Svg/Icons/Instagram.js +1 -12
  88. package/dist/components/uikit-sdk/Svg/Icons/Island.js +1 -12
  89. package/dist/components/uikit-sdk/Svg/Icons/LanguageIcon.js +1 -12
  90. package/dist/components/uikit-sdk/Svg/Icons/LineChart.js +1 -12
  91. package/dist/components/uikit-sdk/Svg/Icons/LiquidityIcon.js +1 -12
  92. package/dist/components/uikit-sdk/Svg/Icons/Logout.js +1 -12
  93. package/dist/components/uikit-sdk/Svg/Icons/Medium.js +1 -12
  94. package/dist/components/uikit-sdk/Svg/Icons/MenuSettings.js +1 -12
  95. package/dist/components/uikit-sdk/Svg/Icons/Message.js +1 -12
  96. package/dist/components/uikit-sdk/Svg/Icons/Migrate.js +1 -12
  97. package/dist/components/uikit-sdk/Svg/Icons/Moon.js +1 -12
  98. package/dist/components/uikit-sdk/Svg/Icons/More.js +1 -12
  99. package/dist/components/uikit-sdk/Svg/Icons/NFA.js +1 -12
  100. package/dist/components/uikit-sdk/Svg/Icons/NavCaret.js +1 -12
  101. package/dist/components/uikit-sdk/Svg/Icons/PlaceholderMonkey.d.ts +0 -1
  102. package/dist/components/uikit-sdk/Svg/Icons/PlaceholderMonkey.js +1 -12
  103. package/dist/components/uikit-sdk/Svg/Icons/Play.js +1 -12
  104. package/dist/components/uikit-sdk/Svg/Icons/Pool.js +1 -12
  105. package/dist/components/uikit-sdk/Svg/Icons/Positions.js +1 -12
  106. package/dist/components/uikit-sdk/Svg/Icons/ProfileDark.js +1 -12
  107. package/dist/components/uikit-sdk/Svg/Icons/ProfileLight.js +1 -12
  108. package/dist/components/uikit-sdk/Svg/Icons/Question.js +1 -12
  109. package/dist/components/uikit-sdk/Svg/Icons/QuestionCircle.js +1 -12
  110. package/dist/components/uikit-sdk/Svg/Icons/QuestionFill.js +1 -12
  111. package/dist/components/uikit-sdk/Svg/Icons/Quiz.js +1 -12
  112. package/dist/components/uikit-sdk/Svg/Icons/Receipt.js +1 -12
  113. package/dist/components/uikit-sdk/Svg/Icons/Reddit.js +1 -12
  114. package/dist/components/uikit-sdk/Svg/Icons/Rocket.js +1 -12
  115. package/dist/components/uikit-sdk/Svg/Icons/ScrollTop.js +1 -12
  116. package/dist/components/uikit-sdk/Svg/Icons/Search.js +1 -12
  117. package/dist/components/uikit-sdk/Svg/Icons/Send.js +1 -12
  118. package/dist/components/uikit-sdk/Svg/Icons/Settings.js +1 -12
  119. package/dist/components/uikit-sdk/Svg/Icons/Share.js +1 -12
  120. package/dist/components/uikit-sdk/Svg/Icons/Sort.js +1 -12
  121. package/dist/components/uikit-sdk/Svg/Icons/Success.js +1 -12
  122. package/dist/components/uikit-sdk/Svg/Icons/SuccessOutline.js +1 -12
  123. package/dist/components/uikit-sdk/Svg/Icons/SwapArrows.js +1 -12
  124. package/dist/components/uikit-sdk/Svg/Icons/SwitchArrows.d.ts +0 -1
  125. package/dist/components/uikit-sdk/Svg/Icons/SwitchArrows.js +1 -12
  126. package/dist/components/uikit-sdk/Svg/Icons/Tag.js +1 -12
  127. package/dist/components/uikit-sdk/Svg/Icons/Telegram.js +1 -12
  128. package/dist/components/uikit-sdk/Svg/Icons/TelegramNew.js +1 -12
  129. package/dist/components/uikit-sdk/Svg/Icons/TextLogo.js +1 -12
  130. package/dist/components/uikit-sdk/Svg/Icons/TickShield.js +1 -12
  131. package/dist/components/uikit-sdk/Svg/Icons/Trade.js +1 -12
  132. package/dist/components/uikit-sdk/Svg/Icons/Trash.js +1 -12
  133. package/dist/components/uikit-sdk/Svg/Icons/Twitter.js +1 -12
  134. package/dist/components/uikit-sdk/Svg/Icons/URL.js +1 -12
  135. package/dist/components/uikit-sdk/Svg/Icons/Vaults.js +1 -12
  136. package/dist/components/uikit-sdk/Svg/Icons/Verified.js +1 -12
  137. package/dist/components/uikit-sdk/Svg/Icons/Wallet.js +1 -12
  138. package/dist/components/uikit-sdk/Svg/Icons/Warning.js +1 -12
  139. package/dist/components/uikit-sdk/Svg/Icons/Watch.js +1 -12
  140. package/dist/components/uikit-sdk/Svg/Icons/Website.js +1 -12
  141. package/dist/components/uikit-sdk/Svg/Icons/WebsiteNew.js +1 -12
  142. package/dist/components/uikit-sdk/Svg/Icons/WhitepaperNew.js +1 -12
  143. package/dist/components/uikit-sdk/Svg/Icons/XNew.js +1 -12
  144. package/dist/components/uikit-sdk/Svg/Icons/YellowQuestionMark.js +1 -12
  145. package/dist/components/uikit-sdk/Svg/Icons/ZapArrow.js +1 -12
  146. package/dist/components/uikit-sdk/Svg/Icons/ZapIcon.js +1 -12
  147. package/dist/components/uikit-sdk/Svg/Icons/polygonNew.js +1 -12
  148. package/dist/components/uikit-sdk/Svg/index.d.ts +0 -1
  149. package/dist/components/uikit-sdk/Svg/tokens/ABOND.js +1 -12
  150. package/dist/components/uikit-sdk/Svg/tokens/ARBITRUM.js +1 -12
  151. package/dist/components/uikit-sdk/Svg/tokens/AVAX.js +1 -12
  152. package/dist/components/uikit-sdk/Svg/tokens/BANANA.js +1 -12
  153. package/dist/components/uikit-sdk/Svg/tokens/BASE.js +1 -12
  154. package/dist/components/uikit-sdk/Svg/tokens/BNB.js +1 -12
  155. package/dist/components/uikit-sdk/Svg/tokens/BSC.js +1 -12
  156. package/dist/components/uikit-sdk/Svg/tokens/CELO.js +1 -12
  157. package/dist/components/uikit-sdk/Svg/tokens/CRONOS.js +1 -12
  158. package/dist/components/uikit-sdk/Svg/tokens/ETH.js +1 -12
  159. package/dist/components/uikit-sdk/Svg/tokens/FANTOM.js +1 -12
  160. package/dist/components/uikit-sdk/Svg/tokens/GNANA.js +1 -12
  161. package/dist/components/uikit-sdk/Svg/tokens/GNOSIS.js +1 -12
  162. package/dist/components/uikit-sdk/Svg/tokens/INEVM.js +1 -12
  163. package/dist/components/uikit-sdk/Svg/tokens/IOTA.js +1 -12
  164. package/dist/components/uikit-sdk/Svg/tokens/LIGHTLINK.js +1 -12
  165. package/dist/components/uikit-sdk/Svg/tokens/LINEA.js +1 -12
  166. package/dist/components/uikit-sdk/Svg/tokens/OKX.js +1 -12
  167. package/dist/components/uikit-sdk/Svg/tokens/OPTIMISM.js +2 -13
  168. package/dist/components/uikit-sdk/Svg/tokens/POLYGON.js +1 -12
  169. package/dist/components/uikit-sdk/Svg/tokens/POLYGONZK.js +1 -12
  170. package/dist/components/uikit-sdk/Svg/tokens/TLOS.js +1 -12
  171. package/dist/components/uikit-sdk/Svg/walletIcons/BinanceChain.d.ts +0 -1
  172. package/dist/components/uikit-sdk/Svg/walletIcons/BinanceChain.js +1 -12
  173. package/dist/components/uikit-sdk/Svg/walletIcons/Bitkeep.d.ts +0 -1
  174. package/dist/components/uikit-sdk/Svg/walletIcons/Bitkeep.js +1 -12
  175. package/dist/components/uikit-sdk/Svg/walletIcons/Brave.d.ts +0 -1
  176. package/dist/components/uikit-sdk/Svg/walletIcons/Brave.js +1 -12
  177. package/dist/components/uikit-sdk/Svg/walletIcons/Coinbase.d.ts +0 -1
  178. package/dist/components/uikit-sdk/Svg/walletIcons/Coinbase.js +1 -12
  179. package/dist/components/uikit-sdk/Svg/walletIcons/MadWallet.js +1 -12
  180. package/dist/components/uikit-sdk/Svg/walletIcons/MathWallet.d.ts +0 -1
  181. package/dist/components/uikit-sdk/Svg/walletIcons/MathWallet.js +1 -12
  182. package/dist/components/uikit-sdk/Svg/walletIcons/Metamask.d.ts +0 -1
  183. package/dist/components/uikit-sdk/Svg/walletIcons/Metamask.js +1 -12
  184. package/dist/components/uikit-sdk/Svg/walletIcons/Nabox.d.ts +0 -1
  185. package/dist/components/uikit-sdk/Svg/walletIcons/Nabox.js +1 -12
  186. package/dist/components/uikit-sdk/Svg/walletIcons/OKX.d.ts +0 -1
  187. package/dist/components/uikit-sdk/Svg/walletIcons/OKX.js +1 -12
  188. package/dist/components/uikit-sdk/Svg/walletIcons/OntoWallet.d.ts +0 -1
  189. package/dist/components/uikit-sdk/Svg/walletIcons/OntoWallet.js +1 -12
  190. package/dist/components/uikit-sdk/Svg/walletIcons/SafePalWallet.d.ts +0 -1
  191. package/dist/components/uikit-sdk/Svg/walletIcons/SafePalWallet.js +1 -12
  192. package/dist/components/uikit-sdk/Svg/walletIcons/SocialLogin.d.ts +0 -1
  193. package/dist/components/uikit-sdk/Svg/walletIcons/SocialLogin.js +1 -12
  194. package/dist/components/uikit-sdk/Svg/walletIcons/TokenPocket.d.ts +0 -1
  195. package/dist/components/uikit-sdk/Svg/walletIcons/TokenPocket.js +1 -12
  196. package/dist/components/uikit-sdk/Svg/walletIcons/TorusWallet.d.ts +0 -1
  197. package/dist/components/uikit-sdk/Svg/walletIcons/TorusWallet.js +1 -12
  198. package/dist/components/uikit-sdk/Svg/walletIcons/TrustWallet.d.ts +0 -1
  199. package/dist/components/uikit-sdk/Svg/walletIcons/TrustWallet.js +1 -12
  200. package/dist/components/uikit-sdk/Svg/walletIcons/Unstoppable.js +1 -12
  201. package/dist/components/uikit-sdk/Svg/walletIcons/WalletConnect.d.ts +0 -1
  202. package/dist/components/uikit-sdk/Svg/walletIcons/WalletConnect.js +1 -12
  203. package/dist/components/uikit-sdk/Svg/walletIcons/WalletImage.js +1 -12
  204. package/dist/components/uikit-sdk/Tag/ListTag.js +1 -1
  205. package/dist/components/uikit-sdk/Tag/styles.d.ts +2 -3
  206. package/dist/components/uikit-sdk/Text/index.js +1 -1
  207. package/dist/components/uikit-sdk/TokenImage/index.d.ts +1 -1
  208. package/dist/components/uikit-sdk/TokenImage/index.js +2 -13
  209. package/dist/components/uikit-sdk/TooltipBubble/index.js +1 -1
  210. package/dist/config/constants/addresses.js +4 -4
  211. package/dist/contexts/Localization/Provider.js +1 -1
  212. package/dist/contexts/ModalContext.js +3 -14
  213. package/dist/contexts/RefreshContext.js +1 -12
  214. package/dist/hooks/PriceGetter/usePricesFromPriceGetter.js +3 -3
  215. package/dist/pages/BondSingle/BondSingle.js +4 -15
  216. package/dist/pages/Bonds/Bonds.js +1 -12
  217. package/dist/pages/YourBonds/YourBonds.js +7 -18
  218. package/dist/pages/YourBonds/fetchBillsUser.js +5 -7
  219. package/dist/state/tokenPrices/fetchTokenPricesForMultipleChains.js +16 -3
  220. package/dist/state/tokenPrices/useTokenPricesNew.d.ts +1 -1
  221. package/dist/state/tokenPrices/useTokenPricesNew.js +1 -1
  222. package/dist/theme/colors.js +2 -2
  223. package/package.json +4 -3
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { BondsDataResponse } from "../../types/bonds";
3
2
  import '../../scss/BondRow.scss';
4
3
  interface BondRowProps {
@@ -1,14 +1,3 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import { jsx as _jsx, jsxs as _jsxs } from "theme-ui/jsx-runtime";
13
2
  import BigNumber from "bignumber.js";
14
3
  import { ChainId } from "../../enum/apeswaplists";
@@ -69,7 +58,7 @@ var BondRow = function (_a) {
69
58
  var vestingDays = vestingTime(bond.vestingTerm).days;
70
59
  return parseFloat((((discount * 365) / vestingDays).toFixed(2)));
71
60
  };
72
- return (_jsxs(Flex, __assign({ className: "container bondrow-container", onClick: function () { return rowClick(bond); } }, { children: [_jsxs(Flex, __assign({ className: "column column-tokens" }, { children: [_jsx(Flex, __assign({ className: "column column-tokeninfoname" }, { children: _jsx(TokenInfoAndName, { bill: bond }) })), _jsx(Flex, __assign({ className: "column column-tokenicons" }, { children: _jsx(TooltipBubble, __assign({ body: _jsx(Tooltip, { tokenContract: (bond === null || bond === void 0 ? void 0 : bond.payoutToken) || '', secondURL: getBillContractURL(bond), secondURLTitle: 'View Bond Contract', thirdURL: "https://dashboard.ape.bond/bond/".concat((_b = bond === null || bond === void 0 ? void 0 : bond.billAddress) === null || _b === void 0 ? void 0 : _b.toLowerCase()), thirdURLTitle: 'View Insights', twitter: bond === null || bond === void 0 ? void 0 : bond.twitter, projectLink: bond === null || bond === void 0 ? void 0 : bond.projectLink, audit: bond === null || bond === void 0 ? void 0 : bond.audit, chain: (_c = bond.chainId) !== null && _c !== void 0 ? _c : ChainId.BSC }), width: "205px", placement: "bottomRight", transformTip: "translate(11%, 0%)" }, { children: _jsx(Svg, { icon: "more", width: "20px" }) })) }))] })), _jsxs(Flex, __assign({ className: "column column-bondinfo" }, { children: [_jsx(Flex, __assign({ className: "column column-discount ".concat(getDiscountColor(bond === null || bond === void 0 ? void 0 : bond.discount)) }, { children: (bond === null || bond === void 0 ? void 0 : bond.discount) !== undefined ? "".concat(bond.discount.toFixed(2), "%") : '-' })), _jsx(Flex, __assign({ className: "column column-arr" }, { children: calculateARR(bond) !== undefined ? "".concat(calculateARR(bond), "%") : '-' })), _jsx(Flex, __assign({ className: "column column-terms" }, { children: vestingTime(bond.vestingTerm).days ? "".concat(vestingTime(bond.vestingTerm).days, " D") : '-' })), _jsx(Flex, __assign({ className: "column column-tokensremaining" }, { children: _jsx(ProgressBarWrapper, { title: '', value: _jsx(ProgressBar, { value: remainingPercentage(bond) }), style: {
61
+ return (_jsxs(Flex, { className: "container bondrow-container", onClick: function () { return rowClick(bond); }, children: [_jsxs(Flex, { className: "column column-tokens", children: [_jsx(Flex, { className: "column column-tokeninfoname", children: _jsx(TokenInfoAndName, { bill: bond }) }), _jsx(Flex, { className: "column column-tokenicons", children: _jsx(TooltipBubble, { body: _jsx(Tooltip, { tokenContract: (bond === null || bond === void 0 ? void 0 : bond.payoutToken) || '', secondURL: getBillContractURL(bond), secondURLTitle: 'View Bond Contract', thirdURL: "https://dashboard.ape.bond/bond/".concat((_b = bond === null || bond === void 0 ? void 0 : bond.billAddress) === null || _b === void 0 ? void 0 : _b.toLowerCase()), thirdURLTitle: 'View Insights', twitter: bond === null || bond === void 0 ? void 0 : bond.twitter, projectLink: bond === null || bond === void 0 ? void 0 : bond.projectLink, audit: bond === null || bond === void 0 ? void 0 : bond.audit, chain: (_c = bond.chainId) !== null && _c !== void 0 ? _c : ChainId.BSC }), width: "205px", placement: "bottomRight", transformTip: "translate(11%, 0%)", children: _jsx(Svg, { icon: "more", width: "20px" }) }) })] }), _jsxs(Flex, { className: "column column-bondinfo", children: [_jsx(Flex, { className: "column column-discount ".concat(getDiscountColor(bond === null || bond === void 0 ? void 0 : bond.discount)), children: (bond === null || bond === void 0 ? void 0 : bond.discount) !== undefined ? "".concat(bond.discount.toFixed(2), "%") : '-' }), _jsx(Flex, { className: "column column-arr", children: calculateARR(bond) !== undefined ? "".concat(calculateARR(bond), "%") : '-' }), _jsx(Flex, { className: "column column-terms", children: vestingTime(bond.vestingTerm).days ? "".concat(vestingTime(bond.vestingTerm).days, " D") : '-' }), _jsx(Flex, { className: "column column-tokensremaining", children: _jsx(ProgressBarWrapper, { title: '', value: _jsx(ProgressBar, { value: remainingPercentage(bond) }), style: {
73
62
  width: '127px',
74
63
  height: '25px',
75
64
  flexDirection: 'column',
@@ -78,6 +67,6 @@ var BondRow = function (_a) {
78
67
  }, showTooltip: true, toolTip: "".concat(remainingTokensFormat(bond), " ").concat(bond.payoutTokenName, " (").concat(formatDollar({
79
68
  num: remainingTokensUsd(bond).toNumber(),
80
69
  isPrice: true,
81
- }), ")") }) })), _jsx(Flex, __assign({ className: "column column-hotbond" }, { children: _jsx(Flex, __assign({ className: "column column-icon" }, { children: (hotBonds === null || hotBonds === void 0 ? void 0 : hotBonds.includes(bond.billAddress.toLowerCase())) && ((_d = bond.discount) !== null && _d !== void 0 ? _d : 0) > 0 && (_jsx(Svg, { icon: "hot", width: "20px" })) })) }))] }))] }), bond.billAddress));
70
+ }), ")") }) }), _jsx(Flex, { className: "column column-hotbond", children: _jsx(Flex, { className: "column column-icon", children: (hotBonds === null || hotBonds === void 0 ? void 0 : hotBonds.includes(bond.billAddress.toLowerCase())) && ((_d = bond.discount) !== null && _d !== void 0 ? _d : 0) > 0 && (_jsx(Svg, { icon: "hot", width: "20px" })) }) })] })] }, bond.billAddress));
82
71
  };
83
72
  export default BondRow;
@@ -1,14 +1,3 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import { jsx as _jsx, jsxs as _jsxs } from "theme-ui/jsx-runtime";
13
2
  /** @jsxImportSource theme-ui */
14
3
  import { useCallback } from 'react';
@@ -31,6 +20,6 @@ var BondRowHeader = function (_a) {
31
20
  //setChainFilterOption(['All Chains'])
32
21
  setFilterOption(newOption);
33
22
  }, [setFilterOption]);
34
- return (_jsxs(Flex, __assign({ className: "header-container" }, { children: [_jsxs(Flex, __assign({ className: "header-container filters" }, { children: [_jsx(Flex, __assign({ sx: { display: ['none', 'none', 'none', 'flex'], mr: '20px' } }, { children: _jsx(RecommendationSelector, { options: filterOptions, activeOption: filterOption, setActiveOption: handleFilterSelection }) })), _jsx(Flex, __assign({ sx: { display: ['flex', 'flex', 'flex', 'none'], width: '100%' } }, { children: _jsx(MenuSelect, { selectedOption: filterOption, setOption: setFilterOption, options: mappedFilters, sx: { background: 'white2' } }) }))] })), _jsxs(Flex, __assign({ className: "header-container rows" }, { children: [_jsxs(Flex, __assign({ className: "column column-tokens" }, { children: [_jsx(Flex, __assign({ className: "column column-search", sx: { width: '100%', maxWidth: ['200px', '200px', '200px', '340px'] } }, { children: _jsx(Input, { value: inputValue, onChange: onInputChange, variant: "search", sx: { fontWeight: 400, background: 'white2', height: '30px', fontSize: '14px', color: 'white' }, width: '100%', placeholder: 'Search...' }) })), _jsx(Flex, { className: "column column-tokenicons" })] })), _jsxs(Flex, __assign({ className: "column column-bondinfo" }, { children: [_jsxs(Flex, __assign({ className: "column column-discount" }, { children: [_jsx(Flex, __assign({ className: "column tooltip" }, { children: _jsxs(TooltipBubble, __assign({ body: _jsx(Flex, { children: TooltipText.Discount }), width: "230px", placement: "bottomLeft", transformTip: "translate(18%, -4%)" }, { children: ["DISCOUNT", _jsx(Flex, __assign({ className: "column header-icon" }, { children: _jsx(Svg, { icon: "questionCircle", width: "12px", color: "textDisabledButton" }) }))] })) })), _jsx(Flex, __assign({ className: "column header-icon", onClick: function () { return onSort('discount'); } }, { children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) }))] })), _jsxs(Flex, __assign({ className: "column column-arr" }, { children: [_jsx(Flex, __assign({ className: "column tooltip" }, { children: _jsxs(TooltipBubble, __assign({ body: _jsx(Flex, { children: TooltipText.ARR }), width: "230px", placement: "bottomLeft", transformTip: "translate(8%, -5%)" }, { children: ["ARR", _jsx(Flex, __assign({ className: "column header-icon" }, { children: _jsx(Svg, { icon: "questionCircle", width: "12px", color: "textDisabledButton" }) }))] })) })), _jsx(Flex, __assign({ className: "column header-icon", onClick: function () { return onSort('arr'); } }, { children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) }))] })), _jsxs(Flex, __assign({ className: "column column-terms" }, { children: [_jsx(Flex, __assign({ className: "column tooltip" }, { children: _jsxs(TooltipBubble, __assign({ body: _jsx(Flex, { children: TooltipText.Terms }), width: "230px", placement: "bottomRight", transformTip: "translate(11%, -5%)" }, { children: ["TERMS", _jsx(Flex, __assign({ className: "column header-icon" }, { children: _jsx(Svg, { icon: "questionCircle", width: "12px", color: "textDisabledButton" }) }))] })) })), _jsx(Flex, __assign({ className: "column header-icon", onClick: function () { return onSort('terms'); } }, { children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) }))] })), _jsxs(Flex, __assign({ className: "column column-tokensremaining" }, { children: [_jsx(Flex, __assign({ className: "column tooltip" }, { children: _jsxs(TooltipBubble, __assign({ body: _jsx(Flex, { children: TooltipText.TokensRemaining }), width: "230px", placement: "bottomRight", transformTip: "translate(12%, -4%)" }, { children: ["TOKENS REMAINING", _jsx(Flex, __assign({ className: "column header-icon" }, { children: _jsx(Svg, { icon: "questionCircle", width: "12px", color: "textDisabledButton" }) }))] })) })), _jsx(Flex, __assign({ className: "column header-icon", onClick: function () { return onSort('tokensRemaining'); } }, { children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) }))] })), _jsx(Flex, { className: "column column-hotbond" })] }))] }))] })));
23
+ return (_jsxs(Flex, { className: "header-container", children: [_jsxs(Flex, { className: "header-container filters", children: [_jsx(Flex, { sx: { display: ['none', 'none', 'none', 'flex'], mr: '20px' }, children: _jsx(RecommendationSelector, { options: filterOptions, activeOption: filterOption, setActiveOption: handleFilterSelection }) }), _jsx(Flex, { sx: { display: ['flex', 'flex', 'flex', 'none'], width: '100%' }, children: _jsx(MenuSelect, { selectedOption: filterOption, setOption: setFilterOption, options: mappedFilters, sx: { background: 'white2' } }) })] }), _jsxs(Flex, { className: "header-container rows", children: [_jsxs(Flex, { className: "column column-tokens", children: [_jsx(Flex, { className: "column column-search", sx: { width: '100%', maxWidth: ['200px', '200px', '200px', '340px'] }, children: _jsx(Input, { value: inputValue, onChange: onInputChange, variant: "search", sx: { fontWeight: 400, background: 'white2', height: '30px', fontSize: '14px', color: 'white' }, width: '100%', placeholder: 'Search...' }) }), _jsx(Flex, { className: "column column-tokenicons" })] }), _jsxs(Flex, { className: "column column-bondinfo", children: [_jsxs(Flex, { className: "column column-discount", children: [_jsx(Flex, { className: "column tooltip", children: _jsxs(TooltipBubble, { body: _jsx(Flex, { children: TooltipText.Discount }), width: "230px", placement: "bottomLeft", transformTip: "translate(18%, -4%)", children: ["DISCOUNT", _jsx(Flex, { className: "column header-icon", children: _jsx(Svg, { icon: "questionCircle", width: "12px", color: "textDisabledButton" }) })] }) }), _jsx(Flex, { className: "column header-icon", onClick: function () { return onSort('discount'); }, children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), _jsxs(Flex, { className: "column column-arr", children: [_jsx(Flex, { className: "column tooltip", children: _jsxs(TooltipBubble, { body: _jsx(Flex, { children: TooltipText.ARR }), width: "230px", placement: "bottomLeft", transformTip: "translate(8%, -5%)", children: ["ARR", _jsx(Flex, { className: "column header-icon", children: _jsx(Svg, { icon: "questionCircle", width: "12px", color: "textDisabledButton" }) })] }) }), _jsx(Flex, { className: "column header-icon", onClick: function () { return onSort('arr'); }, children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), _jsxs(Flex, { className: "column column-terms", children: [_jsx(Flex, { className: "column tooltip", children: _jsxs(TooltipBubble, { body: _jsx(Flex, { children: TooltipText.Terms }), width: "230px", placement: "bottomRight", transformTip: "translate(11%, -5%)", children: ["TERMS", _jsx(Flex, { className: "column header-icon", children: _jsx(Svg, { icon: "questionCircle", width: "12px", color: "textDisabledButton" }) })] }) }), _jsx(Flex, { className: "column header-icon", onClick: function () { return onSort('terms'); }, children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), _jsxs(Flex, { className: "column column-tokensremaining", children: [_jsx(Flex, { className: "column tooltip", children: _jsxs(TooltipBubble, { body: _jsx(Flex, { children: TooltipText.TokensRemaining }), width: "230px", placement: "bottomRight", transformTip: "translate(12%, -4%)", children: ["TOKENS REMAINING", _jsx(Flex, { className: "column header-icon", children: _jsx(Svg, { icon: "questionCircle", width: "12px", color: "textDisabledButton" }) })] }) }), _jsx(Flex, { className: "column header-icon", onClick: function () { return onSort('tokensRemaining'); }, children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), _jsx(Flex, { className: "column column-hotbond" })] })] })] }));
35
24
  };
36
25
  export default BondRowHeader;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { BondsDataResponse } from '../../types/bonds';
3
3
  declare const BondRowsByChain: ({ bonds, hotBonds, hideTitles, rowClick }: {
4
4
  bonds: BondsDataResponse[];
5
- hotBonds?: string[] | undefined;
5
+ hotBonds?: string[];
6
6
  hideTitles: boolean;
7
7
  rowClick: (bond: BondsDataResponse) => void;
8
8
  }) => React.JSX.Element;
@@ -1,14 +1,3 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import { jsx as _jsx, jsxs as _jsxs } from "theme-ui/jsx-runtime";
13
2
  import BondRowsWithTitle from './BondRowsWithTitle';
14
3
  import { ChainId } from '../../enum/apeswaplists';
@@ -16,12 +5,12 @@ import { Flex } from '../uikit-sdk';
16
5
  import { MAINNET_CHAINS } from '../../config/constants/chains';
17
6
  var BondRowsByChain = function (_a) {
18
7
  var bonds = _a.bonds, hotBonds = _a.hotBonds, hideTitles = _a.hideTitles, rowClick = _a.rowClick;
19
- return (_jsxs(Flex, __assign({ sx: { width: '100%', flexDirection: 'column', mt: '5px' } }, { children: [[ChainId.MAINNET].map(function (chain, index) {
8
+ return (_jsxs(Flex, { sx: { width: '100%', flexDirection: 'column', mt: '5px' }, children: [[ChainId.MAINNET].map(function (chain, index) {
20
9
  return (_jsx(BondRowsWithTitle, { chain: chain, bonds: bonds, hotBonds: hotBonds, hideTitles: hideTitles, rowClick: rowClick }, chain));
21
10
  }), [ChainId.BSC].map(function (chain, index) {
22
11
  return (_jsx(BondRowsWithTitle, { chain: chain, bonds: bonds, hotBonds: hotBonds, hideTitles: hideTitles, rowClick: rowClick }, chain));
23
12
  }), (MAINNET_CHAINS.slice(2, MAINNET_CHAINS.length).map(function (chain, index) {
24
13
  return (_jsx(BondRowsWithTitle, { chain: chain, bonds: bonds, hotBonds: hotBonds, hideTitles: hideTitles, rowClick: rowClick }, chain));
25
- }))] })));
14
+ }))] }));
26
15
  };
27
16
  export default BondRowsByChain;
@@ -1,9 +1,8 @@
1
- /// <reference types="react" />
2
1
  import { BondsDataResponse } from "../../types/bonds";
3
2
  declare const BondRowsWithTitle: ({ chain, bonds, hotBonds, hideTitles, rowClick, }: {
4
3
  chain: number;
5
4
  bonds: BondsDataResponse[];
6
- hotBonds?: string[] | undefined;
5
+ hotBonds?: string[];
7
6
  hideTitles: boolean;
8
7
  rowClick: (bond: BondsDataResponse) => void;
9
8
  }) => import("react").JSX.Element;
@@ -1,14 +1,3 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import { jsx as _jsx, jsxs as _jsxs } from "theme-ui/jsx-runtime";
13
2
  import { AnimatePresence, motion } from "framer-motion";
14
3
  import ChainTitle from "./ChainTitle";
@@ -20,11 +9,11 @@ var BondRowsWithTitle = function (_a) {
20
9
  var billsFilteredByChain = bonds.filter(function (bill) { return bill.chainId === chain; });
21
10
  var key = chain;
22
11
  var _b = useState(true), isOpen = _b[0], setIsOpen = _b[1];
23
- return (_jsx(Flex, __assign({ sx: { width: '100%', flexDirection: 'column' } }, { children: _jsxs(AnimatePresence, __assign({ initial: false }, { children: [_jsx(Flex, __assign({ onClick: function () { return setIsOpen(!isOpen); } }, { children: _jsx(ChainTitle, { chain: chain, pt: '5px', hideTitles: hideTitles, isOpen: isOpen }) })), billsFilteredByChain.length > 0 && isOpen && (_jsx(motion.div, __assign({ initial: { height: 0, overflow: 'hidden' }, animate: { height: 'fit-content', overflow: 'hidden', transitionEnd: { overflow: 'visible' } }, exit: { height: 0, overflow: 'hidden' }, sx: {
12
+ return (_jsx(Flex, { sx: { width: '100%', flexDirection: 'column' }, children: _jsxs(AnimatePresence, { initial: false, children: [_jsx(Flex, { onClick: function () { return setIsOpen(!isOpen); }, children: _jsx(ChainTitle, { chain: chain, pt: '5px', hideTitles: hideTitles, isOpen: isOpen }) }), billsFilteredByChain.length > 0 && isOpen && (_jsx(motion.div, { initial: { height: 0, overflow: 'hidden' }, animate: { height: 'fit-content', overflow: 'hidden', transitionEnd: { overflow: 'visible' } }, exit: { height: 0, overflow: 'hidden' }, sx: {
24
13
  position: 'relative',
25
14
  overflow: 'hidden',
26
15
  width: '100%',
27
16
  marginTop: '0px',
28
- } }, { children: billsFilteredByChain === null || billsFilteredByChain === void 0 ? void 0 : billsFilteredByChain.map(function (bill) { return (_jsx(BondRow, { bond: bill, hotBonds: hotBonds, rowClick: rowClick }, bill.billAddress)); }) }), key))] })) }), key));
17
+ }, children: billsFilteredByChain === null || billsFilteredByChain === void 0 ? void 0 : billsFilteredByChain.map(function (bill) { return (_jsx(BondRow, { bond: bill, hotBonds: hotBonds, rowClick: rowClick }, bill.billAddress)); }) }, key))] }) }, key));
29
18
  };
30
19
  export default BondRowsWithTitle;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  declare const ChainTitle: ({ chain, pt, hideTitles, isOpen, }: {
3
3
  chain: number;
4
4
  pt: string;
5
- hideTitles?: boolean | undefined;
5
+ hideTitles?: boolean;
6
6
  isOpen: boolean;
7
7
  }) => React.JSX.Element;
8
8
  export default ChainTitle;
@@ -1,20 +1,9 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import { jsx as _jsx, jsxs as _jsxs } from "theme-ui/jsx-runtime";
13
2
  import { Flex, Svg } from '../uikit-sdk';
14
3
  import { NETWORK_LABEL } from '../../config/constants/chains';
15
4
  var ChainTitle = function (_a) {
16
5
  var chain = _a.chain, pt = _a.pt, hideTitles = _a.hideTitles, isOpen = _a.isOpen;
17
- return (_jsxs(Flex, __assign({ sx: {
6
+ return (_jsxs(Flex, { sx: {
18
7
  pt: pt,
19
8
  pb: '10px',
20
9
  color: 'textDisabledButton',
@@ -24,6 +13,6 @@ var ChainTitle = function (_a) {
24
13
  textTransform: 'uppercase',
25
14
  display: hideTitles ? 'none' : 'flex',
26
15
  width: '200px',
27
- } }, { children: [NETWORK_LABEL[chain], " Bonds", _jsx(Flex, __assign({ sx: { ml: '7px' } }, { children: _jsx(Svg, { icon: "caret", direction: isOpen ? 'down' : 'up', width: 8, color: "textDisabledButton" }) }))] })));
16
+ }, children: [NETWORK_LABEL[chain], " Bonds", _jsx(Flex, { sx: { ml: '7px' }, children: _jsx(Svg, { icon: "caret", direction: isOpen ? 'down' : 'up', width: 8, color: "textDisabledButton" }) })] }));
28
17
  };
29
18
  export default ChainTitle;
@@ -1,4 +1,8 @@
1
1
  import React from 'react';
2
2
  import { Option } from './types';
3
- declare const MenuSelect: ({ selectedOption, setOption, options, ...props }: any) => React.JSX.Element;
3
+ declare const MenuSelect: ({ selectedOption, setOption, options, ...props }: {
4
+ selectedOption: string;
5
+ setOption: (option: string) => void;
6
+ options: Option[] | undefined;
7
+ } | any) => React.JSX.Element;
4
8
  export default MenuSelect;
@@ -30,7 +30,7 @@ var MenuSelect = function (_a) {
30
30
  width: '100%',
31
31
  paddingRight: '4px',
32
32
  } }, props, { children: options === null || options === void 0 ? void 0 : options.map(function (option) {
33
- return (_jsx(SelectItem, __assign({ size: "xsm", value: option.value }, { children: _jsx(Text, __assign({ sx: { fontWeight: 400, pl: '10px' } }, { children: option.label })) }), option.label));
33
+ return (_jsx(SelectItem, { size: "xsm", value: option.value, children: _jsx(Text, { sx: { fontWeight: 400, pl: '10px' }, children: option.label }) }, option.label));
34
34
  }) })));
35
35
  };
36
36
  export default MenuSelect;
@@ -1,14 +1,3 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import { jsx as _jsx } from "theme-ui/jsx-runtime";
13
2
  import { Flex } from '../uikit-sdk';
14
3
  import { useWeb3React } from '@web3-react/core';
@@ -18,7 +7,7 @@ var RecommendationSelector = function (_a) {
18
7
  var handleClick = function (option) {
19
8
  setActiveOption(option);
20
9
  };
21
- return (_jsx(Flex, __assign({ sx: {
10
+ return (_jsx(Flex, { sx: {
22
11
  alignItems: 'center',
23
12
  color: 'grey',
24
13
  fontSize: ['11px'],
@@ -26,9 +15,9 @@ var RecommendationSelector = function (_a) {
26
15
  '& > div:last-child': {
27
16
  marginRight: '0',
28
17
  },
29
- } }, { children: options.map(function (option) {
18
+ }, children: options.map(function (option) {
30
19
  var isActive = option === activeOption;
31
- return (_jsx(Flex, __assign({ sx: {
20
+ return (_jsx(Flex, { sx: {
32
21
  background: isActive ? 'primaryShade' : 'white2',
33
22
  color: isActive ? 'primaryButton' : 'textDisabledButton',
34
23
  px: ['6px', '6px', '6px', '10px'],
@@ -39,7 +28,7 @@ var RecommendationSelector = function (_a) {
39
28
  lineHeight: '11px',
40
29
  alignItems: 'center',
41
30
  height: '24px',
42
- }, onClick: function () { return handleClick(option); } }, { children: option }), option));
43
- }) })));
31
+ }, onClick: function () { return handleClick(option); }, children: option }, option));
32
+ }) }));
44
33
  };
45
34
  export default RecommendationSelector;
@@ -1,14 +1,3 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -62,14 +51,16 @@ import { ethers } from 'ethers';
62
51
  import { adjustDecimals } from "../../../utils/convertToTokenValue";
63
52
  import TokenImage from '../../uikit-sdk/TokenImage';
64
53
  import BOND_ABI from '../../../config/abi/bond.json';
65
- import ERC_20_ABI from '../../../config/abi/bond.json';
54
+ import ERC_20_ABI from '../../../config/abi/erc20.json';
66
55
  import { NETWORK_ICONS } from '../../../config/constants/chains';
67
56
  import { formatUSDNumber, getPremiumColor, premium, youGet, youGetUSD, youSpend, youSpendUSD } from './helper';
68
57
  import '../../../scss/BondModal.scss';
58
+ import { useWriteContract } from "wagmi";
69
59
  var BondModal = function (_a) {
70
60
  var account = _a.account, accountChainId = _a.accountChainId, isActive = _a.isActive, isOpen = _a.isOpen, onClose = _a.onClose, bondAddress = _a.bondAddress;
71
61
  if (!isOpen)
72
62
  return null;
63
+ var writeContract = useWriteContract().writeContract;
73
64
  //const { account, isActive } = useWeb3React();
74
65
  var _b = useState([]), bondData = _b[0], setBondData = _b[1];
75
66
  var _c = useState(false), approvalStatus = _c[0], setApprovalStatus = _c[1];
@@ -114,37 +105,39 @@ var BondModal = function (_a) {
114
105
  }); };
115
106
  //You approve the token, not the contract (this code will have to be updated for zap)
116
107
  var handleApprove = function () { return __awaiter(void 0, void 0, void 0, function () {
117
- var provider, signer, tokenContract, amount, tx, error_2;
118
- var _a, _b, _c;
119
- return __generator(this, function (_d) {
120
- switch (_d.label) {
121
- case 0:
122
- console.log('handle approve clicked');
123
- if (!window.ethereum) {
124
- console.error('No Ethereum provider found');
125
- alert('No Ethereum provider found');
126
- return [2 /*return*/];
127
- }
128
- console.log('---!');
129
- console.log((_a = bondData[0]) === null || _a === void 0 ? void 0 : _a.principalToken);
130
- provider = new ethers.providers.Web3Provider(window.ethereum);
131
- signer = provider.getSigner();
132
- tokenContract = new ethers.Contract((_c = (_b = bondData[0]) === null || _b === void 0 ? void 0 : _b.principalToken) !== null && _c !== void 0 ? _c : "", ERC_20_ABI, signer);
133
- _d.label = 1;
134
- case 1:
135
- _d.trys.push([1, 3, , 4]);
136
- amount = adjustDecimals(inputValue);
137
- return [4 /*yield*/, tokenContract.approve(bondAddress, amount)];
138
- case 2:
139
- tx = _d.sent();
140
- return [3 /*break*/, 4];
141
- case 3:
142
- error_2 = _d.sent();
143
- console.error('Approval error', error_2);
144
- alert('Approval Failed');
145
- return [3 /*break*/, 4];
146
- case 4: return [2 /*return*/];
108
+ var tokenAddress;
109
+ var _a;
110
+ return __generator(this, function (_b) {
111
+ console.log('handle approve clicked');
112
+ if (!window.ethereum) {
113
+ console.error('No Ethereum provider found');
114
+ alert('No Ethereum provider found');
115
+ return [2 /*return*/];
147
116
  }
117
+ console.log('---!');
118
+ console.log((_a = bondData[0]) === null || _a === void 0 ? void 0 : _a.principalToken);
119
+ //Here we need to approve the token, not the bond
120
+ // const provider = new ethers.providers.Web3Provider(window.ethereum);
121
+ // const signer = provider.getSigner();
122
+ //
123
+ // console.log(signer)
124
+ console.log(account);
125
+ tokenAddress = bondData[0].principalToken;
126
+ //
127
+ // const { writeAsync, isLoading, isSuccess, error } = useContractWrite({
128
+ // addressOrName: tokenAddress,
129
+ // contractInterface: ERC_20_ABI,
130
+ // functionName: 'approve',
131
+ // args: [account, adjustDecimals(inputValue)],
132
+ // });
133
+ // @ts-ignore
134
+ writeContract({
135
+ address: tokenAddress,
136
+ abi: ERC_20_ABI,
137
+ functionName: 'approve',
138
+ args: [account, adjustDecimals(inputValue)],
139
+ });
140
+ return [2 /*return*/];
148
141
  });
149
142
  }); };
150
143
  // Fetch data
@@ -189,9 +182,9 @@ var BondModal = function (_a) {
189
182
  setSelectedBond(bond);
190
183
  navigate("/bondsingle/".concat(bond.billAddress));
191
184
  };
192
- return (_jsx(ThemeUIProvider, __assign({ theme: defaultTheme }, { children: bondData.map(function (bond) {
185
+ return (_jsx(ThemeUIProvider, { theme: defaultTheme, children: bondData.map(function (bond) {
193
186
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
194
- return (_jsx(React.Fragment, { children: _jsx(Flex, __assign({ className: "modal modal-backdrop" }, { children: _jsxs(Flex, __assign({ className: "modal modal-content" }, { children: [isActive && account && (_jsxs("p", { children: ["Wallet Address: ", account] })), _jsx(Flex, __assign({ className: "modal modal-header" }, { children: _jsx(Flex, __assign({ className: "svg-close", onClick: onClose }, { children: _jsx(Svg, { icon: "close" }) })) })), _jsxs(Flex, __assign({ className: "modal-container table-container" }, { children: [_jsxs(Flex, __assign({ className: "modal-container title-container" }, { children: [_jsx(Flex, __assign({ className: "title-container bondicon" }, { children: _jsxs("div", __assign({ className: "icon-container" }, { children: [_jsx(Svg, { width: 20, height: 20, icon: (_a = NETWORK_ICONS === null || NETWORK_ICONS === void 0 ? void 0 : NETWORK_ICONS[bond.chainId]) !== null && _a !== void 0 ? _a : 'question' }), _jsx(TokenImage, { symbol: (_b = bond.showcaseTokenName) !== null && _b !== void 0 ? _b : bond.payoutTokenName, size: 50 })] })) })), _jsx(Flex, __assign({ className: "title-container bondname" }, { children: bond === null || bond === void 0 ? void 0 : bond.showcaseTokenName })), _jsxs(Flex, __assign({ className: "title-container price-container" }, { children: [_jsxs(Flex, __assign({ className: "price-container price" }, { children: ["$", earnTokenPrice(bond)] })), _jsxs(Flex, __assign({ className: "price-container discounted" }, { children: ["$", discountEarnTokenPrice(bond)] }))] })), _jsx(Flex, __assign({ className: "title-container tokentags" }, { children: _jsx(ListTag, { text: (_c = bond === null || bond === void 0 ? void 0 : bond.tags) === null || _c === void 0 ? void 0 : _c[0], variant: ((_d = bond === null || bond === void 0 ? void 0 : bond.tags) === null || _d === void 0 ? void 0 : _d[0]) === 'Cex Fund' ? 'cex_fund' : 'liquidity' }) }))] })), _jsx(Flex, __assign({ className: "modal-container description-container" }, { children: bond === null || bond === void 0 ? void 0 : bond.shortDescription })), _jsxs(Flex, __assign({ className: "modal-container blocks-container" }, { children: [_jsxs(Flex, __assign({ className: "modal-block column-discount ".concat(getDiscountColor(bond === null || bond === void 0 ? void 0 : bond.discount)) }, { children: [_jsxs(Flex, __assign({ className: "block-header header" }, { children: ["Discount", _jsx(TooltipBubble, __assign({ body: _jsx(Flex, { children: TooltipText.Discount }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)" }, { children: _jsx(Flex, __assign({ className: "block-header icon" }, { children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) })) }))] })), "".concat((_e = bond === null || bond === void 0 ? void 0 : bond.discount) === null || _e === void 0 ? void 0 : _e.toFixed(2), "%")] })), _jsxs(Flex, __assign({ className: "modal-block column-arr" }, { children: [_jsxs(Flex, __assign({ className: "block-header header" }, { children: ["ARR", _jsx(TooltipBubble, __assign({ body: _jsx(Flex, { children: TooltipText.ARR }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)" }, { children: _jsx(Flex, __assign({ className: "block-header icon" }, { children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) })) }))] })), "".concat(((((_f = bond === null || bond === void 0 ? void 0 : bond.discount) !== null && _f !== void 0 ? _f : 0) * 365) / vestingTime((_g = bond === null || bond === void 0 ? void 0 : bond.vestingTerm) !== null && _g !== void 0 ? _g : 0).days).toFixed(2), "%")] })), _jsxs(Flex, __assign({ className: "modal-block column-term" }, { children: [_jsxs(Flex, __assign({ className: "block-header header" }, { children: ["Terms", _jsx(TooltipBubble, __assign({ body: _jsx(Flex, { children: TooltipText.Terms }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)" }, { children: _jsx(Flex, __assign({ className: "block-header icon" }, { children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) })) }))] })), vestingTime((_h = bond === null || bond === void 0 ? void 0 : bond.vestingTerm) !== null && _h !== void 0 ? _h : 0).days ? "".concat(vestingTime((_j = bond === null || bond === void 0 ? void 0 : bond.vestingTerm) !== null && _j !== void 0 ? _j : 0).days, " D") : '-'] })), _jsxs(Flex, __assign({ className: "modal-block column-maxbuy" }, { children: [_jsxs(Flex, __assign({ className: "block-header header" }, { children: ["Max Buy", _jsx(TooltipBubble, __assign({ body: _jsx(Flex, { children: TooltipText.MaxBuy(bond.payoutTokenName) }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)" }, { children: _jsx(Flex, __assign({ className: "block-header icon" }, { children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) })) }))] })), (_k = parseFloat(maxBuy(bond).toFixed(0))) === null || _k === void 0 ? void 0 : _k.toLocaleString('en-US')] }))] })), _jsxs(Flex, __assign({ className: "modal-container text-container" }, { children: [_jsxs(Flex, __assign({ className: "text-container row" }, { children: [_jsx(Flex, __assign({ className: "row-container spend" }, { children: "You spend:" })), _jsxs(Flex, __assign({ className: "row-container spend-val" }, { children: [youSpend(inputValue), " ", bond.principalTokenName, " = $ ", formatUSDNumber(youSpendUSD(bond, inputValue))] }))] })), _jsxs(Flex, __assign({ className: "text-container row" }, { children: [_jsxs(Flex, __assign({ className: "row-container premium" }, { children: ["Premium:", _jsx(TooltipBubble, __assign({ body: _jsx(Flex, { children: TooltipText.Premium }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)" }, { children: _jsx(Flex, __assign({ className: "row-container premium-icon" }, { children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) })) }))] })), _jsxs(Flex, __assign({ className: "row-container premium-val ".concat(getPremiumColor(bond, inputValue)) }, { children: ["$ ", premium(bond, inputValue)] }))] })), _jsxs(Flex, __assign({ className: "text-container row" }, { children: [_jsxs(Flex, __assign({ className: "row-container get" }, { children: ["You get (over ", vestingTime((_l = bond === null || bond === void 0 ? void 0 : bond.vestingTerm) !== null && _l !== void 0 ? _l : 0).days, " days):"] })), _jsxs(Flex, __assign({ className: "row-container get-val" }, { children: [youGet(bond, inputValue), " ", bond === null || bond === void 0 ? void 0 : bond.showcaseTokenName, " = $ ", formatUSDNumber(youGetUSD(bond, inputValue))] }))] }))] })), _jsxs(Flex, __assign({ className: "modal-container input-container" }, { children: [_jsxs(Flex, __assign({ className: "input-container inputrow" }, { children: [_jsx(Flex, __assign({ className: "input-container input" }, { children: _jsx(Input, { placeholder: "0.0", value: inputValue, pattern: "^[0-9]*[.,]?[0-9]*$", onChange: handleInputChange, onInput: function (v) {
187
+ return (_jsx(React.Fragment, { children: _jsx(Flex, { className: "modal modal-backdrop", children: _jsxs(Flex, { className: "modal modal-content", children: [isActive && account && (_jsxs("p", { children: ["Wallet Address: ", account] })), _jsx(Flex, { className: "modal modal-header", children: _jsx(Flex, { className: "svg-close", onClick: onClose, children: _jsx(Svg, { icon: "close" }) }) }), _jsxs(Flex, { className: "modal-container table-container", children: [_jsxs(Flex, { className: "modal-container title-container", children: [_jsx(Flex, { className: "title-container bondicon", children: _jsxs("div", { className: "icon-container", children: [_jsx(Svg, { width: 20, height: 20, icon: (_a = NETWORK_ICONS === null || NETWORK_ICONS === void 0 ? void 0 : NETWORK_ICONS[bond.chainId]) !== null && _a !== void 0 ? _a : 'question' }), _jsx(TokenImage, { symbol: (_b = bond.showcaseTokenName) !== null && _b !== void 0 ? _b : bond.payoutTokenName, size: 50 })] }) }), _jsx(Flex, { className: "title-container bondname", children: bond === null || bond === void 0 ? void 0 : bond.showcaseTokenName }), _jsxs(Flex, { className: "title-container price-container", children: [_jsxs(Flex, { className: "price-container price", children: ["$", earnTokenPrice(bond)] }), _jsxs(Flex, { className: "price-container discounted", children: ["$", discountEarnTokenPrice(bond)] })] }), _jsx(Flex, { className: "title-container tokentags", children: _jsx(ListTag, { text: (_c = bond === null || bond === void 0 ? void 0 : bond.tags) === null || _c === void 0 ? void 0 : _c[0], variant: ((_d = bond === null || bond === void 0 ? void 0 : bond.tags) === null || _d === void 0 ? void 0 : _d[0]) === 'Cex Fund' ? 'cex_fund' : 'liquidity' }) })] }), _jsx(Flex, { className: "modal-container description-container", children: bond === null || bond === void 0 ? void 0 : bond.shortDescription }), _jsxs(Flex, { className: "modal-container blocks-container", children: [_jsxs(Flex, { className: "modal-block column-discount ".concat(getDiscountColor(bond === null || bond === void 0 ? void 0 : bond.discount)), children: [_jsxs(Flex, { className: "block-header header", children: ["Discount", _jsx(TooltipBubble, { body: _jsx(Flex, { children: TooltipText.Discount }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: _jsx(Flex, { className: "block-header icon", children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), "".concat((_e = bond === null || bond === void 0 ? void 0 : bond.discount) === null || _e === void 0 ? void 0 : _e.toFixed(2), "%")] }), _jsxs(Flex, { className: "modal-block column-arr", children: [_jsxs(Flex, { className: "block-header header", children: ["ARR", _jsx(TooltipBubble, { body: _jsx(Flex, { children: TooltipText.ARR }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: _jsx(Flex, { className: "block-header icon", children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), "".concat(((((_f = bond === null || bond === void 0 ? void 0 : bond.discount) !== null && _f !== void 0 ? _f : 0) * 365) / vestingTime((_g = bond === null || bond === void 0 ? void 0 : bond.vestingTerm) !== null && _g !== void 0 ? _g : 0).days).toFixed(2), "%")] }), _jsxs(Flex, { className: "modal-block column-term", children: [_jsxs(Flex, { className: "block-header header", children: ["Terms", _jsx(TooltipBubble, { body: _jsx(Flex, { children: TooltipText.Terms }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: _jsx(Flex, { className: "block-header icon", children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), vestingTime((_h = bond === null || bond === void 0 ? void 0 : bond.vestingTerm) !== null && _h !== void 0 ? _h : 0).days ? "".concat(vestingTime((_j = bond === null || bond === void 0 ? void 0 : bond.vestingTerm) !== null && _j !== void 0 ? _j : 0).days, " D") : '-'] }), _jsxs(Flex, { className: "modal-block column-maxbuy", children: [_jsxs(Flex, { className: "block-header header", children: ["Max Buy", _jsx(TooltipBubble, { body: _jsx(Flex, { children: TooltipText.MaxBuy(bond.payoutTokenName) }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: _jsx(Flex, { className: "block-header icon", children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), (_k = parseFloat(maxBuy(bond).toFixed(0))) === null || _k === void 0 ? void 0 : _k.toLocaleString('en-US')] })] }), _jsxs(Flex, { className: "modal-container text-container", children: [_jsxs(Flex, { className: "text-container row", children: [_jsx(Flex, { className: "row-container spend", children: "You spend:" }), _jsxs(Flex, { className: "row-container spend-val", children: [youSpend(inputValue), " ", bond.principalTokenName, " = $ ", formatUSDNumber(youSpendUSD(bond, inputValue))] })] }), _jsxs(Flex, { className: "text-container row", children: [_jsxs(Flex, { className: "row-container premium", children: ["Premium:", _jsx(TooltipBubble, { body: _jsx(Flex, { children: TooltipText.Premium }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: _jsx(Flex, { className: "row-container premium-icon", children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), _jsxs(Flex, { className: "row-container premium-val ".concat(getPremiumColor(bond, inputValue)), children: ["$ ", premium(bond, inputValue)] })] }), _jsxs(Flex, { className: "text-container row", children: [_jsxs(Flex, { className: "row-container get", children: ["You get (over ", vestingTime((_l = bond === null || bond === void 0 ? void 0 : bond.vestingTerm) !== null && _l !== void 0 ? _l : 0).days, " days):"] }), _jsxs(Flex, { className: "row-container get-val", children: [youGet(bond, inputValue), " ", bond === null || bond === void 0 ? void 0 : bond.showcaseTokenName, " = $ ", formatUSDNumber(youGetUSD(bond, inputValue))] })] })] }), _jsxs(Flex, { className: "modal-container input-container", children: [_jsxs(Flex, { className: "input-container inputrow", children: [_jsx(Flex, { className: "input-container input", children: _jsx(Input, { placeholder: "0.0", value: inputValue, pattern: "^[0-9]*[.,]?[0-9]*$", onChange: handleInputChange, onInput: function (v) {
195
188
  if (v.currentTarget.value.includes(',')) {
196
189
  v.currentTarget.value = v.currentTarget.value.replace(/,/g, '.');
197
190
  }
@@ -205,10 +198,10 @@ var BondModal = function (_a) {
205
198
  !!v.currentTarget.value && isNumber(v.currentTarget.value) && parseFloat(v.currentTarget.value) >= 0
206
199
  ? v.currentTarget.value
207
200
  : v.currentTarget.value.slice(0, v.currentTarget.value.length - 1);
208
- } }) })), _jsxs(Flex, __assign({ className: "input-container token" }, { children: [_jsx(Flex, __assign({ className: "input-container bondicon" }, { children: _jsxs("div", __assign({ className: "icon-container-small" }, { children: [_jsx(Svg, { width: 12, height: 12, icon: (_m = NETWORK_ICONS === null || NETWORK_ICONS === void 0 ? void 0 : NETWORK_ICONS[bond.chainId]) !== null && _m !== void 0 ? _m : 'question' }), _jsx(TokenImage, { symbol: (_o = bond.principalTokenName) !== null && _o !== void 0 ? _o : bond.payoutTokenName, size: 30 })] })) })), _jsx(Flex, __assign({ className: "title-container tokenname-small" }, { children: bond === null || bond === void 0 ? void 0 : bond.principalTokenName }))] }))] })), isActive && account && (_jsxs(Flex, __assign({ className: "input-container balancerow" }, { children: [_jsx(Flex, __assign({ className: "balancerow text" }, { children: "Balance: BALANCE NUMBER PLACEHOLDER" })), _jsx(Flex, __assign({ className: "balancerow max" }, { children: _jsx(Button, { children: "Max" }) }))] })))] })), _jsxs(Flex, __assign({ className: "modal-container button-container" }, { children: [_jsx(Flex, __assign({ className: "button-container get" }, { children: _jsxs(Button, { children: ["Get ", bond === null || bond === void 0 ? void 0 : bond.principalTokenName] }) })), _jsx(Flex, __assign({ className: "button-container buy" }, { children: approvalStatus === true ?
209
- _jsxs(Button, __assign({ onClick: handleBuy }, { children: ["Buy ", bond === null || bond === void 0 ? void 0 : bond.showcaseTokenName] }))
201
+ } }) }), _jsxs(Flex, { className: "input-container token", children: [_jsx(Flex, { className: "input-container bondicon", children: _jsxs("div", { className: "icon-container-small", children: [_jsx(Svg, { width: 12, height: 12, icon: (_m = NETWORK_ICONS === null || NETWORK_ICONS === void 0 ? void 0 : NETWORK_ICONS[bond.chainId]) !== null && _m !== void 0 ? _m : 'question' }), _jsx(TokenImage, { symbol: (_o = bond.principalTokenName) !== null && _o !== void 0 ? _o : bond.payoutTokenName, size: 30 })] }) }), _jsx(Flex, { className: "title-container tokenname-small", children: bond === null || bond === void 0 ? void 0 : bond.principalTokenName })] })] }), isActive && account && (_jsxs(Flex, { className: "input-container balancerow", children: [_jsx(Flex, { className: "balancerow text", children: "Balance: BALANCE NUMBER PLACEHOLDER" }), _jsx(Flex, { className: "balancerow max", children: _jsx(Button, { children: "Max" }) })] }))] }), _jsxs(Flex, { className: "modal-container button-container", children: [_jsx(Flex, { className: "button-container get", children: _jsxs(Button, { children: ["Get ", bond === null || bond === void 0 ? void 0 : bond.principalTokenName] }) }), _jsx(Flex, { className: "button-container buy", children: approvalStatus === true ?
202
+ _jsxs(Button, { onClick: handleBuy, children: ["Buy ", bond === null || bond === void 0 ? void 0 : bond.showcaseTokenName] })
210
203
  :
211
- _jsx(Button, __assign({ onClick: handleApprove }, { children: "Approve" })) }))] }))] }))] })) })) }, bond.billAddress));
212
- }) })));
204
+ _jsx(Button, { onClick: handleApprove, children: "Approve" }) })] })] })] }) }) }, bond.billAddress));
205
+ }) }));
213
206
  };
214
207
  export default BondModal;
@@ -2,9 +2,9 @@
2
2
  import React from 'react';
3
3
  import { UserBill } from '../../../types/yourbonds';
4
4
  import '../../../scss/YourBondsModal.scss';
5
- declare const YourBondsModal: ({ isOpen, onClose, userBill }: {
5
+ declare const YourBondsModal: ({ isOpen, onClose, bond }: {
6
6
  isOpen: boolean;
7
7
  onClose: () => void;
8
- userBill: UserBill | undefined;
8
+ bond: UserBill | null;
9
9
  }) => React.JSX.Element | null;
10
10
  export default YourBondsModal;
@@ -1,24 +1,14 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "theme-ui/jsx-runtime";
13
2
  /** @jsxImportSource theme-ui */
14
3
  import React, { useState } from 'react';
15
- import { Flex } from 'theme-ui';
4
+ import { Flex, ThemeUIProvider } from 'theme-ui';
16
5
  import { useWeb3React } from '@web3-react/core';
17
6
  import { BigNumber } from 'bignumber.js';
18
7
  import { AnimatePresence, motion } from 'framer-motion';
19
8
  import { NETWORK_ICONS } from '../../../config/constants/chains';
20
9
  import { getBalanceNumber } from '../../../utils/getBalanceNumber';
21
10
  import { getFirstNonZeroDigits } from '../../../utils/roundNumber';
11
+ import { defaultTheme } from '../../../theme';
22
12
  import TokenImage from '../../uikit-sdk/TokenImage';
23
13
  import { Button, ListTag, Skeleton, Svg, Text, TooltipBubble } from '../../uikit-sdk';
24
14
  import { UserBillTooltipText } from '../../../enum/tooltips';
@@ -27,14 +17,13 @@ import { formatNumberSI } from '../../../utils/formatNumber';
27
17
  import { StyledHeadingText, TraitsContentContainer } from './styles';
28
18
  import '../../../scss/YourBondsModal.scss';
29
19
  var YourBondsModal = function (_a) {
30
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
31
- var isOpen = _a.isOpen, onClose = _a.onClose, userBill = _a.userBill;
20
+ var isOpen = _a.isOpen, onClose = _a.onClose, bond = _a.bond;
32
21
  if (!isOpen)
33
22
  return null;
34
- var _s = useWeb3React(), account = _s.account, chainId = _s.chainId, isActive = _s.isActive;
23
+ var _b = useWeb3React(), account = _b.account, chainId = _b.chainId, isActive = _b.isActive;
35
24
  // Fetch data for user owned bill
36
- var _t = useState([]), bondData = _t[0], setBondData = _t[1];
37
- var _u = useState([]), userOwnedBillsData = _u[0], setUserOwnedBillsData = _u[1];
25
+ var _c = useState([]), bondData = _c[0], setBondData = _c[1];
26
+ var _d = useState([]), userOwnedBillsData = _d[0], setUserOwnedBillsData = _d[1];
38
27
  // Functions to calculate display values for modal
39
28
  var totalPending = function (userBill) {
40
29
  var _a, _b, _c, _d;
@@ -49,22 +38,26 @@ var YourBondsModal = function (_a) {
49
38
  return getFirstNonZeroDigits(parseFloat((_a = bond === null || bond === void 0 ? void 0 : bond.payoutTokenPrice) !== null && _a !== void 0 ? _a : '0'));
50
39
  };
51
40
  var BILL_ATTRIBUTES = ['The Legend', 'The Location', 'The Moment', 'The Trend', 'The Innovation'];
52
- var _v = useState(false), isOpenTraits = _v[0], setIsOpenTraits = _v[1];
53
- var _w = useState(false), billRendered = _w[0], setBillRendered = _w[1];
54
- var attributes = (_c = (_b = userBill.nftData) === null || _b === void 0 ? void 0 : _b.data.attributes) === null || _c === void 0 ? void 0 : _c.filter(function (attrib) { return BILL_ATTRIBUTES.includes(attrib.trait_type); });
55
- return (_jsx(_Fragment, { children: _jsx(React.Fragment, { children: _jsx(Flex, __assign({ className: "yourbondsmodal backdrop" }, { children: _jsxs(Flex, __assign({ className: "yourbondsmodal content" }, { children: [_jsx(Flex, __assign({ className: "yourbondsmodal header" }, { children: _jsx(Flex, __assign({ className: "svg-close", onClick: onClose }, { children: _jsx(Svg, { icon: "close" }) })) })), _jsxs(Flex, __assign({ className: "yourbondsmodal table-container" }, { children: [_jsx(Flex, __assign({ className: "yourbondsmodal bondimage" }, { children: _jsx("img", { src: (_d = userBill.nftData) === null || _d === void 0 ? void 0 : _d.data.image }) })), _jsxs(Flex, __assign({ className: "yourbondsmodal yourbondinfo" }, { children: [_jsxs(Flex, __assign({ className: "yourbondinfo title-container" }, { children: [_jsx(Flex, __assign({ className: "title-container bondicon" }, { children: _jsxs("div", __assign({ className: "icon-container" }, { children: [_jsx(Svg, { width: 18, height: 18, icon: (_e = NETWORK_ICONS === null || NETWORK_ICONS === void 0 ? void 0 : NETWORK_ICONS[userBill.bond.chainId]) !== null && _e !== void 0 ? _e : 'question' }), _jsx(TokenImage, { symbol: (_f = userBill.bond.showcaseTokenName) !== null && _f !== void 0 ? _f : userBill.bond.payoutTokenName, size: 40 })] })) })), _jsx(Flex, __assign({ className: "title-container tokenname" }, { children: _jsx(StyledHeadingText, { children: (_g = userBill.bond) === null || _g === void 0 ? void 0 : _g.showcaseTokenName }) })), _jsx(Flex, __assign({ className: "title-container tokentags" }, { children: (_h = userBill.bond.tags) === null || _h === void 0 ? void 0 : _h.slice(0, 1).map(function (tag) {
56
- return (_jsx(Flex, __assign({ sx: { marginRight: '10px' } }, { children: _jsx(ListTag, { variant: tag === 'Cex Fund' ? 'cex_fund' : 'liquidity', text: tag === null || tag === void 0 ? void 0 : tag.toUpperCase() }) }), tag));
57
- }) })), _jsxs(Text, __assign({ sx: { color: 'text', opacity: '0.6', fontSize: ['12px', '12px', '12px', '16px'] } }, { children: ["#", userBill.id] }))] })), _jsxs(Flex, __assign({ className: "yourbondinfo blocks-container" }, { children: [_jsx(Flex, __assign({ className: "yourbondinfo-block attributes" }, { children: _jsxs(Flex, __assign({ sx: { flexDirection: 'column', width: '100%' } }, { children: [_jsxs(Flex, __assign({ sx: {
58
- justifyContent: 'space-between',
59
- height: '24px',
60
- background: 'white3',
61
- px: '15px',
62
- borderRadius: "".concat(isOpenTraits ? '6px 6px 0px 0px' : 'normal'),
63
- display: ['none', 'none', 'none', 'flex'],
64
- }, onClick: function () { return setIsOpenTraits(!isOpenTraits); } }, { children: [_jsxs(Flex, __assign({ sx: { gap: '10px', alignItems: 'center' } }, { children: [_jsx(Svg, { icon: "tag", direction: "down" }), _jsx(Text, __assign({ sx: { fontSize: '12px', fontWeight: 400, color: 'text', opacity: '0.6' } }, { children: "Traits" }))] })), _jsx(Svg, { icon: "caret", direction: isOpenTraits ? 'up' : 'down' })] })), _jsx(AnimatePresence, { children: isOpenTraits && (_jsx(motion.div, __assign({ initial: { height: 0 }, animate: { height: 'fit-content' }, transition: { opacity: { duration: 0.2 } }, exit: { height: 0 }, sx: { overflow: 'hidden', width: '100%' } }, { children: _jsx(Flex, __assign({ sx: { flexDirection: 'column', gap: '1px' } }, { children: attributes
65
- ? attributes.map(function (a) { return (_jsxs(TraitsContentContainer, { children: [_jsx(Text, __assign({ sx: { fontSize: '10px', fontWeight: 500 } }, { children: a === null || a === void 0 ? void 0 : a.trait_type })), _jsx(Text, __assign({ sx: { fontSize: '10px', fontWeight: 500 } }, { children: a === null || a === void 0 ? void 0 : a.value }))] }, a.value)); })
66
- : BILL_ATTRIBUTES.map(function (attrib) {
67
- return (_jsxs(TraitsContentContainer, { children: [_jsx(Text, __assign({ sx: { fontSize: '10px', fontWeight: 500 } }, { children: attrib })), _jsx(Skeleton, { width: "150px" })] }, attrib));
68
- }) })) }))) })] })) })), _jsxs(Flex, __assign({ className: "yourbondinfo-block row-vested" }, { children: [_jsxs(Flex, __assign({ className: "yourbondinfo-block header" }, { children: [_jsx(Flex, __assign({ className: "yourbondinfo-block header-title" }, { children: "Fully Vested" })), _jsx(Flex, __assign({ className: "yourbondinfo-block header-tooltip" }, { children: _jsx(TooltipBubble, __assign({ body: _jsx(Flex, { children: UserBillTooltipText.FullyVested }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)" }, { children: _jsx(Flex, __assign({ className: "block-header icon" }, { children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) })) })) }))] })), _jsxs(Flex, __assign({ className: "yourbondinfo-block info" }, { children: [_jsx(Flex, { className: "block-info icon" }), _jsx(Flex, __assign({ className: "block-info text" }, { children: _jsx(Text, __assign({ sx: { fontSize: ['12px', '12px', '12px', '19px'], fontWeight: 700 } }, { children: getPendingVesting((_j = userBill.lastBlockTimestamp) !== null && _j !== void 0 ? _j : '', (_k = userBill.vesting) !== null && _k !== void 0 ? _k : '') })) }))] }))] })), _jsxs(Flex, __assign({ className: "yourbondinfo-block row-pending" }, { children: [_jsxs(Flex, __assign({ className: "yourbondinfo-block header" }, { children: [_jsx(Flex, __assign({ className: "yourbondinfo-block header-title" }, { children: "Pending" })), _jsx(Flex, __assign({ className: "yourbondinfo-block header-tooltip" }, { children: _jsx(TooltipBubble, __assign({ body: _jsx(Flex, { children: UserBillTooltipText.Pending }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)" }, { children: _jsx(Flex, __assign({ className: "block-header icon" }, { children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) })) })) }))] })), _jsxs(Flex, __assign({ className: "yourbondinfo-block info" }, { children: [_jsx(Flex, __assign({ className: "block-info icon" }, { children: _jsxs("div", __assign({ className: "icon-container-small" }, { children: [_jsx(Svg, { width: 10, height: 10, icon: (_l = NETWORK_ICONS === null || NETWORK_ICONS === void 0 ? void 0 : NETWORK_ICONS[userBill.bond.chainId]) !== null && _l !== void 0 ? _l : 'question' }), _jsx(TokenImage, { symbol: (_m = userBill.bond.showcaseTokenName) !== null && _m !== void 0 ? _m : userBill.bond.payoutTokenName, size: 25 })] })) })), _jsxs(Flex, __assign({ className: "block-info text" }, { children: [_jsx(Text, __assign({ sx: { fontSize: ['12px', '12px', '12px', '19px'], fontWeight: 700 } }, { children: formatNumberSI(parseFloat(totalPending(userBill).toFixed(4)), 4) })), _jsx(Text, __assign({ sx: { fontSize: ['10px', '10px', '10px', '12px'], fontWeight: [500, 500, 500, 400], paddingLeft: '10px' } }, { children: "($".concat((totalPending(userBill) * ((_o = parseFloat(earnTokenPrice(userBill.bond))) !== null && _o !== void 0 ? _o : 0)).toFixed(2), ")") }))] }))] }))] })), _jsxs(Flex, __assign({ className: "yourbondinfo-block row-claimable" }, { children: [_jsxs(Flex, __assign({ className: "yourbondinfo-block header" }, { children: [_jsx(Flex, __assign({ className: "yourbondinfo-block header-title" }, { children: "Claimable" })), _jsx(Flex, __assign({ className: "yourbondinfo-block header-tooltip" }, { children: _jsx(TooltipBubble, __assign({ body: _jsx(Flex, { children: UserBillTooltipText.Claimable }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)" }, { children: _jsx(Flex, __assign({ className: "block-header icon" }, { children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) })) })) }))] })), _jsxs(Flex, __assign({ className: "yourbondinfo-block info" }, { children: [_jsx(Flex, __assign({ className: "block-info icon" }, { children: _jsxs("div", __assign({ className: "icon-container-small" }, { children: [_jsx(Svg, { width: 10, height: 10, icon: (_p = NETWORK_ICONS === null || NETWORK_ICONS === void 0 ? void 0 : NETWORK_ICONS[userBill.bond.chainId]) !== null && _p !== void 0 ? _p : 'question' }), _jsx(TokenImage, { symbol: (_q = userBill.bond.showcaseTokenName) !== null && _q !== void 0 ? _q : userBill.bond.payoutTokenName, size: 25 })] })) })), _jsxs(Flex, __assign({ className: "block-info text" }, { children: [_jsx(Text, __assign({ sx: { fontSize: ['12px', '12px', '12px', '19px'], fontWeight: 700 } }, { children: formatNumberSI(parseFloat(claimable(userBill).toFixed(4)), 4) })), _jsx(Text, __assign({ sx: { fontSize: ['10px', '10px', '10px', '12px'], fontWeight: [500, 500, 500, 400], paddingLeft: '10px' } }, { children: "($".concat((claimable(userBill) * ((_r = parseFloat(earnTokenPrice(userBill.bond))) !== null && _r !== void 0 ? _r : 0)).toFixed(2), ")") }))] }))] }))] }))] })), _jsxs(Flex, __assign({ className: "yourbondinfo button-container" }, { children: [_jsx(Flex, __assign({ className: "button-container claim" }, { children: _jsx(Button, { children: "CLAIM" }) })), _jsx(Flex, __assign({ className: "button-container transfer" }, { children: _jsx(Button, __assign({ variant: "secondary" }, { children: "TRANSFER" })) }))] }))] }))] }))] })) })) }, userBill.address) }));
41
+ var _e = useState(false), isOpenTraits = _e[0], setIsOpenTraits = _e[1];
42
+ var _f = useState(false), billRendered = _f[0], setBillRendered = _f[1];
43
+ return (_jsx(ThemeUIProvider, { theme: defaultTheme, children: _jsx(_Fragment, { children: userOwnedBillsData.flat().map(function (data) {
44
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
45
+ var userBill = data.userOwnedBills.find(function (bill) { var _a; return bill.bond.billAddress.toLowerCase() === ((_a = bond === null || bond === void 0 ? void 0 : bond.address) === null || _a === void 0 ? void 0 : _a.toLowerCase()); });
46
+ var attributes = (_b = (_a = userBill === null || userBill === void 0 ? void 0 : userBill.nftData) === null || _a === void 0 ? void 0 : _a.data.attributes) === null || _b === void 0 ? void 0 : _b.filter(function (attrib) { return BILL_ATTRIBUTES.includes(attrib.trait_type); });
47
+ return userBill ? (_jsx(React.Fragment, { children: _jsx(Flex, { className: "yourbondsmodal backdrop", children: _jsxs(Flex, { className: "yourbondsmodal content", children: [_jsx(Flex, { className: "yourbondsmodal header", children: _jsx(Flex, { className: "svg-close", onClick: onClose, children: _jsx(Svg, { icon: "close" }) }) }), _jsxs(Flex, { className: "yourbondsmodal table-container", children: [_jsx(Flex, { className: "yourbondsmodal bondimage", children: _jsx("img", { src: (_c = userBill.nftData) === null || _c === void 0 ? void 0 : _c.data.image }) }), _jsxs(Flex, { className: "yourbondsmodal yourbondinfo", children: [_jsxs(Flex, { className: "yourbondinfo title-container", children: [_jsx(Flex, { className: "title-container bondicon", children: _jsxs("div", { className: "icon-container", children: [_jsx(Svg, { width: 18, height: 18, icon: (_d = NETWORK_ICONS === null || NETWORK_ICONS === void 0 ? void 0 : NETWORK_ICONS[userBill.bond.chainId]) !== null && _d !== void 0 ? _d : 'question' }), _jsx(TokenImage, { symbol: (_e = userBill.bond.showcaseTokenName) !== null && _e !== void 0 ? _e : userBill.bond.payoutTokenName, size: 40 })] }) }), _jsx(Flex, { className: "title-container tokenname", children: _jsx(StyledHeadingText, { children: (_f = userBill.bond) === null || _f === void 0 ? void 0 : _f.showcaseTokenName }) }), _jsx(Flex, { className: "title-container tokentags", children: (_g = userBill.bond.tags) === null || _g === void 0 ? void 0 : _g.slice(0, 1).map(function (tag) {
48
+ return (_jsx(Flex, { sx: { marginRight: '10px' }, children: _jsx(ListTag, { variant: tag === 'Cex Fund' ? 'cex_fund' : 'liquidity', text: tag === null || tag === void 0 ? void 0 : tag.toUpperCase() }) }, tag));
49
+ }) }), _jsxs(Text, { sx: { color: 'text', opacity: '0.6', fontSize: ['12px', '12px', '12px', '16px'] }, children: ["#", userBill.id] })] }), _jsxs(Flex, { className: "yourbondinfo blocks-container", children: [_jsx(Flex, { className: "yourbondinfo-block attributes", children: _jsxs(Flex, { sx: { flexDirection: 'column', width: '100%' }, children: [_jsxs(Flex, { sx: {
50
+ justifyContent: 'space-between',
51
+ height: '24px',
52
+ background: 'white3',
53
+ px: '15px',
54
+ borderRadius: "".concat(isOpenTraits ? '6px 6px 0px 0px' : 'normal'),
55
+ display: ['none', 'none', 'none', 'flex'],
56
+ }, onClick: function () { return setIsOpenTraits(!isOpenTraits); }, children: [_jsxs(Flex, { sx: { gap: '10px', alignItems: 'center' }, children: [_jsx(Svg, { icon: "tag", direction: "down" }), _jsx(Text, { sx: { fontSize: '12px', fontWeight: 400, color: 'text', opacity: '0.6' }, children: "Traits" })] }), _jsx(Svg, { icon: "caret", direction: isOpenTraits ? 'up' : 'down' })] }), _jsx(AnimatePresence, { children: isOpenTraits && (_jsx(motion.div, { initial: { height: 0 }, animate: { height: 'fit-content' }, transition: { opacity: { duration: 0.2 } }, exit: { height: 0 }, sx: { overflow: 'hidden', width: '100%' }, children: _jsx(Flex, { sx: { flexDirection: 'column', gap: '1px' }, children: attributes
57
+ ? attributes.map(function (a) { return (_jsxs(TraitsContentContainer, { children: [_jsx(Text, { sx: { fontSize: '10px', fontWeight: 500 }, children: a === null || a === void 0 ? void 0 : a.trait_type }), _jsx(Text, { sx: { fontSize: '10px', fontWeight: 500 }, children: a === null || a === void 0 ? void 0 : a.value })] }, a.value)); })
58
+ : BILL_ATTRIBUTES.map(function (attrib) {
59
+ return (_jsxs(TraitsContentContainer, { children: [_jsx(Text, { sx: { fontSize: '10px', fontWeight: 500 }, children: attrib }), _jsx(Skeleton, { width: "150px" })] }, attrib));
60
+ }) }) })) })] }) }), _jsxs(Flex, { className: "yourbondinfo-block row-vested", children: [_jsxs(Flex, { className: "yourbondinfo-block header", children: [_jsx(Flex, { className: "yourbondinfo-block header-title", children: "Fully Vested" }), _jsx(Flex, { className: "yourbondinfo-block header-tooltip", children: _jsx(TooltipBubble, { body: _jsx(Flex, { children: UserBillTooltipText.FullyVested }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: _jsx(Flex, { className: "block-header icon", children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) }) }) })] }), _jsxs(Flex, { className: "yourbondinfo-block info", children: [_jsx(Flex, { className: "block-info icon" }), _jsx(Flex, { className: "block-info text", children: _jsx(Text, { sx: { fontSize: ['12px', '12px', '12px', '19px'], fontWeight: 700 }, children: getPendingVesting(userBill.lastBlockTimestamp, userBill.vesting) }) })] })] }), _jsxs(Flex, { className: "yourbondinfo-block row-pending", children: [_jsxs(Flex, { className: "yourbondinfo-block header", children: [_jsx(Flex, { className: "yourbondinfo-block header-title", children: "Pending" }), _jsx(Flex, { className: "yourbondinfo-block header-tooltip", children: _jsx(TooltipBubble, { body: _jsx(Flex, { children: UserBillTooltipText.Pending }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: _jsx(Flex, { className: "block-header icon", children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) }) }) })] }), _jsxs(Flex, { className: "yourbondinfo-block info", children: [_jsx(Flex, { className: "block-info icon", children: _jsxs("div", { className: "icon-container-small", children: [_jsx(Svg, { width: 10, height: 10, icon: (_h = NETWORK_ICONS === null || NETWORK_ICONS === void 0 ? void 0 : NETWORK_ICONS[userBill.bond.chainId]) !== null && _h !== void 0 ? _h : 'question' }), _jsx(TokenImage, { symbol: (_j = userBill.bond.showcaseTokenName) !== null && _j !== void 0 ? _j : userBill.bond.payoutTokenName, size: 25 })] }) }), _jsxs(Flex, { className: "block-info text", children: [_jsx(Text, { sx: { fontSize: ['12px', '12px', '12px', '19px'], fontWeight: 700 }, children: formatNumberSI(parseFloat(totalPending(userBill).toFixed(4)), 4) }), _jsx(Text, { sx: { fontSize: ['10px', '10px', '10px', '12px'], fontWeight: [500, 500, 500, 400], paddingLeft: '10px' }, children: "($".concat((totalPending(userBill) * ((_k = parseFloat(earnTokenPrice(userBill.bond))) !== null && _k !== void 0 ? _k : 0)).toFixed(2), ")") })] })] })] }), _jsxs(Flex, { className: "yourbondinfo-block row-claimable", children: [_jsxs(Flex, { className: "yourbondinfo-block header", children: [_jsx(Flex, { className: "yourbondinfo-block header-title", children: "Claimable" }), _jsx(Flex, { className: "yourbondinfo-block header-tooltip", children: _jsx(TooltipBubble, { body: _jsx(Flex, { children: UserBillTooltipText.Claimable }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: _jsx(Flex, { className: "block-header icon", children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) }) }) })] }), _jsxs(Flex, { className: "yourbondinfo-block info", children: [_jsx(Flex, { className: "block-info icon", children: _jsxs("div", { className: "icon-container-small", children: [_jsx(Svg, { width: 10, height: 10, icon: (_l = NETWORK_ICONS === null || NETWORK_ICONS === void 0 ? void 0 : NETWORK_ICONS[userBill.bond.chainId]) !== null && _l !== void 0 ? _l : 'question' }), _jsx(TokenImage, { symbol: (_m = userBill.bond.showcaseTokenName) !== null && _m !== void 0 ? _m : userBill.bond.payoutTokenName, size: 25 })] }) }), _jsxs(Flex, { className: "block-info text", children: [_jsx(Text, { sx: { fontSize: ['12px', '12px', '12px', '19px'], fontWeight: 700 }, children: formatNumberSI(parseFloat(claimable(userBill).toFixed(4)), 4) }), _jsx(Text, { sx: { fontSize: ['10px', '10px', '10px', '12px'], fontWeight: [500, 500, 500, 400], paddingLeft: '10px' }, children: "($".concat((claimable(userBill) * ((_o = parseFloat(earnTokenPrice(userBill.bond))) !== null && _o !== void 0 ? _o : 0)).toFixed(2), ")") })] })] })] })] }), _jsxs(Flex, { className: "yourbondinfo button-container", children: [_jsx(Flex, { className: "button-container claim", children: _jsx(Button, { children: "CLAIM" }) }), _jsx(Flex, { className: "button-container transfer", children: _jsx(Button, { variant: "secondary", children: "TRANSFER" }) })] })] })] })] }) }) }, userBill.bond.billAddress)) : null;
61
+ }) }) }));
69
62
  };
70
63
  export default YourBondsModal;