@ape.swap/bonds-sdk 1.0.778 → 1.0.779

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 (279) hide show
  1. package/dist/components/BondMenu/BondMenu.js +2 -13
  2. package/dist/components/BondRows/BondRow.d.ts +0 -1
  3. package/dist/components/BondRows/BondRow.js +2 -13
  4. package/dist/components/BondRows/BondRowHeader.js +1 -12
  5. package/dist/components/BondRows/BondRowsByChain.d.ts +2 -3
  6. package/dist/components/BondRows/BondRowsByChain.js +2 -13
  7. package/dist/components/BondRows/BondRowsWithTitle.d.ts +1 -2
  8. package/dist/components/BondRows/BondRowsWithTitle.js +2 -13
  9. package/dist/components/BondRows/ChainTitle.d.ts +1 -1
  10. package/dist/components/BondRows/ChainTitle.js +2 -13
  11. package/dist/components/MenuSelect/MenuSelect.d.ts +5 -1
  12. package/dist/components/MenuSelect/MenuSelect.js +1 -1
  13. package/dist/components/MenuSelect/RecommendationSelector.js +5 -16
  14. package/dist/components/NetworkFilter/index.js +6 -17
  15. package/dist/components/ProgressBar/ProgressBar.js +2 -13
  16. package/dist/components/ProgressBar/ProgressBarWrapper.js +1 -12
  17. package/dist/components/TokenInfoAndName/index.d.ts +1 -1
  18. package/dist/components/TokenInfoAndName/index.js +6 -17
  19. package/dist/components/Tooltip/ButtonsRow.js +1 -1
  20. package/dist/components/Tooltip/Tooltip.js +1 -12
  21. package/dist/components/uikit-sdk/Button/IconButton.js +1 -1
  22. package/dist/components/uikit-sdk/Checkbox/index.d.ts +0 -1
  23. package/dist/components/uikit-sdk/Checkbox/index.js +2 -2
  24. package/dist/components/uikit-sdk/Flex/index.d.ts +3 -1
  25. package/dist/components/uikit-sdk/Input/Input.d.ts +7 -2
  26. package/dist/components/uikit-sdk/Input/Input.js +5 -5
  27. package/dist/components/uikit-sdk/Input/NumericInput.d.ts +4 -5
  28. package/dist/components/uikit-sdk/Input/StyledInput.js +1 -12
  29. package/dist/components/uikit-sdk/Modal/ModalFooter.d.ts +4 -0
  30. package/dist/components/uikit-sdk/Modal/ModalFooter.js +21 -0
  31. package/dist/components/uikit-sdk/Modal/ModalHeader.d.ts +4 -0
  32. package/dist/components/uikit-sdk/Modal/ModalHeader.js +31 -0
  33. package/dist/components/uikit-sdk/Modal/index.d.ts +4 -0
  34. package/dist/components/uikit-sdk/Modal/index.js +46 -0
  35. package/dist/components/uikit-sdk/Modal/styles.d.ts +3 -0
  36. package/dist/components/uikit-sdk/Modal/styles.js +62 -0
  37. package/dist/components/uikit-sdk/Modal/types.d.ts +17 -0
  38. package/dist/components/uikit-sdk/Modal/types.js +1 -0
  39. package/dist/components/uikit-sdk/Select/Select.js +4 -4
  40. package/dist/components/uikit-sdk/Select/SelectItem.d.ts +0 -1
  41. package/dist/components/uikit-sdk/Select/SelectItem.js +1 -1
  42. package/dist/components/uikit-sdk/Svg/Icons/AbondFullLogo.js +1 -12
  43. package/dist/components/uikit-sdk/Svg/Icons/AbondSmallLogo.js +1 -12
  44. package/dist/components/uikit-sdk/Svg/Icons/AccountMonkey.js +1 -12
  45. package/dist/components/uikit-sdk/Svg/Icons/AllChains.js +1 -12
  46. package/dist/components/uikit-sdk/Svg/Icons/ApebondLogo.js +1 -12
  47. package/dist/components/uikit-sdk/Svg/Icons/ApeswapSmallLogo.js +1 -12
  48. package/dist/components/uikit-sdk/Svg/Icons/Arrow.js +1 -12
  49. package/dist/components/uikit-sdk/Svg/Icons/Audit.js +1 -12
  50. package/dist/components/uikit-sdk/Svg/Icons/BananaIcon.js +1 -12
  51. package/dist/components/uikit-sdk/Svg/Icons/BillsM1.js +1 -12
  52. package/dist/components/uikit-sdk/Svg/Icons/BillsM2.js +1 -12
  53. package/dist/components/uikit-sdk/Svg/Icons/BillsM3.js +1 -12
  54. package/dist/components/uikit-sdk/Svg/Icons/Bridge.js +1 -12
  55. package/dist/components/uikit-sdk/Svg/Icons/Bubble.js +1 -12
  56. package/dist/components/uikit-sdk/Svg/Icons/Calculator.js +1 -12
  57. package/dist/components/uikit-sdk/Svg/Icons/Calendar.js +1 -12
  58. package/dist/components/uikit-sdk/Svg/Icons/Cancelled.js +1 -12
  59. package/dist/components/uikit-sdk/Svg/Icons/Card.js +1 -12
  60. package/dist/components/uikit-sdk/Svg/Icons/Caret.js +1 -12
  61. package/dist/components/uikit-sdk/Svg/Icons/Chain.js +1 -12
  62. package/dist/components/uikit-sdk/Svg/Icons/Chart.js +1 -12
  63. package/dist/components/uikit-sdk/Svg/Icons/Chat.js +1 -12
  64. package/dist/components/uikit-sdk/Svg/Icons/Close.js +1 -12
  65. package/dist/components/uikit-sdk/Svg/Icons/Cog.d.ts +0 -1
  66. package/dist/components/uikit-sdk/Svg/Icons/Cog.js +1 -12
  67. package/dist/components/uikit-sdk/Svg/Icons/Collapse.js +1 -12
  68. package/dist/components/uikit-sdk/Svg/Icons/Copy.js +1 -12
  69. package/dist/components/uikit-sdk/Svg/Icons/Discord.js +1 -12
  70. package/dist/components/uikit-sdk/Svg/Icons/DiscordNew.js +1 -12
  71. package/dist/components/uikit-sdk/Svg/Icons/Docs.js +1 -12
  72. package/dist/components/uikit-sdk/Svg/Icons/DocsV2.js +1 -12
  73. package/dist/components/uikit-sdk/Svg/Icons/Ellipse.js +1 -12
  74. package/dist/components/uikit-sdk/Svg/Icons/Error.js +1 -12
  75. package/dist/components/uikit-sdk/Svg/Icons/Expand.js +1 -12
  76. package/dist/components/uikit-sdk/Svg/Icons/Explorer.js +1 -12
  77. package/dist/components/uikit-sdk/Svg/Icons/External.js +1 -12
  78. package/dist/components/uikit-sdk/Svg/Icons/Farm.js +1 -12
  79. package/dist/components/uikit-sdk/Svg/Icons/Fav.js +1 -12
  80. package/dist/components/uikit-sdk/Svg/Icons/FilledURL.js +1 -12
  81. package/dist/components/uikit-sdk/Svg/Icons/Fire.js +1 -12
  82. package/dist/components/uikit-sdk/Svg/Icons/Frame.js +1 -12
  83. package/dist/components/uikit-sdk/Svg/Icons/FullLogo.js +1 -12
  84. package/dist/components/uikit-sdk/Svg/Icons/Gnana.js +1 -12
  85. package/dist/components/uikit-sdk/Svg/Icons/GreenShield.d.ts +0 -1
  86. package/dist/components/uikit-sdk/Svg/Icons/GreenShield.js +1 -12
  87. package/dist/components/uikit-sdk/Svg/Icons/Hamburger.js +1 -12
  88. package/dist/components/uikit-sdk/Svg/Icons/HamburgerClosed.js +1 -12
  89. package/dist/components/uikit-sdk/Svg/Icons/Home.js +1 -12
  90. package/dist/components/uikit-sdk/Svg/Icons/Hot.js +1 -12
  91. package/dist/components/uikit-sdk/Svg/Icons/Info.js +1 -12
  92. package/dist/components/uikit-sdk/Svg/Icons/InfoSolid.js +1 -12
  93. package/dist/components/uikit-sdk/Svg/Icons/Insight.js +1 -12
  94. package/dist/components/uikit-sdk/Svg/Icons/Instagram.js +1 -12
  95. package/dist/components/uikit-sdk/Svg/Icons/Island.js +1 -12
  96. package/dist/components/uikit-sdk/Svg/Icons/LanguageIcon.js +1 -12
  97. package/dist/components/uikit-sdk/Svg/Icons/LineChart.js +1 -12
  98. package/dist/components/uikit-sdk/Svg/Icons/LiquidityIcon.js +1 -12
  99. package/dist/components/uikit-sdk/Svg/Icons/Logout.js +1 -12
  100. package/dist/components/uikit-sdk/Svg/Icons/Medium.js +1 -12
  101. package/dist/components/uikit-sdk/Svg/Icons/MenuSettings.js +1 -12
  102. package/dist/components/uikit-sdk/Svg/Icons/Message.js +1 -12
  103. package/dist/components/uikit-sdk/Svg/Icons/Migrate.js +1 -12
  104. package/dist/components/uikit-sdk/Svg/Icons/Moon.js +1 -12
  105. package/dist/components/uikit-sdk/Svg/Icons/More.js +1 -12
  106. package/dist/components/uikit-sdk/Svg/Icons/NFA.js +1 -12
  107. package/dist/components/uikit-sdk/Svg/Icons/NavCaret.js +1 -12
  108. package/dist/components/uikit-sdk/Svg/Icons/PlaceholderMonkey.d.ts +0 -1
  109. package/dist/components/uikit-sdk/Svg/Icons/PlaceholderMonkey.js +1 -12
  110. package/dist/components/uikit-sdk/Svg/Icons/Play.js +1 -12
  111. package/dist/components/uikit-sdk/Svg/Icons/Pool.js +1 -12
  112. package/dist/components/uikit-sdk/Svg/Icons/Positions.js +1 -12
  113. package/dist/components/uikit-sdk/Svg/Icons/ProfileDark.js +1 -12
  114. package/dist/components/uikit-sdk/Svg/Icons/ProfileLight.js +1 -12
  115. package/dist/components/uikit-sdk/Svg/Icons/Question.js +1 -12
  116. package/dist/components/uikit-sdk/Svg/Icons/QuestionCircle.js +1 -12
  117. package/dist/components/uikit-sdk/Svg/Icons/QuestionFill.js +1 -12
  118. package/dist/components/uikit-sdk/Svg/Icons/Quiz.js +1 -12
  119. package/dist/components/uikit-sdk/Svg/Icons/Receipt.js +1 -12
  120. package/dist/components/uikit-sdk/Svg/Icons/Reddit.js +1 -12
  121. package/dist/components/uikit-sdk/Svg/Icons/Rocket.js +1 -12
  122. package/dist/components/uikit-sdk/Svg/Icons/ScrollTop.js +1 -12
  123. package/dist/components/uikit-sdk/Svg/Icons/Search.js +1 -12
  124. package/dist/components/uikit-sdk/Svg/Icons/Send.js +1 -12
  125. package/dist/components/uikit-sdk/Svg/Icons/Settings.js +1 -12
  126. package/dist/components/uikit-sdk/Svg/Icons/Share.js +1 -12
  127. package/dist/components/uikit-sdk/Svg/Icons/Sort.js +1 -12
  128. package/dist/components/uikit-sdk/Svg/Icons/Success.js +1 -12
  129. package/dist/components/uikit-sdk/Svg/Icons/SuccessOutline.js +1 -12
  130. package/dist/components/uikit-sdk/Svg/Icons/SwapArrows.js +1 -12
  131. package/dist/components/uikit-sdk/Svg/Icons/SwitchArrows.d.ts +0 -1
  132. package/dist/components/uikit-sdk/Svg/Icons/SwitchArrows.js +1 -12
  133. package/dist/components/uikit-sdk/Svg/Icons/Tag.js +1 -12
  134. package/dist/components/uikit-sdk/Svg/Icons/Telegram.js +1 -12
  135. package/dist/components/uikit-sdk/Svg/Icons/TelegramNew.js +1 -12
  136. package/dist/components/uikit-sdk/Svg/Icons/TextLogo.js +1 -12
  137. package/dist/components/uikit-sdk/Svg/Icons/TickShield.js +1 -12
  138. package/dist/components/uikit-sdk/Svg/Icons/Trade.js +1 -12
  139. package/dist/components/uikit-sdk/Svg/Icons/Trash.js +1 -12
  140. package/dist/components/uikit-sdk/Svg/Icons/Twitter.js +1 -12
  141. package/dist/components/uikit-sdk/Svg/Icons/URL.js +1 -12
  142. package/dist/components/uikit-sdk/Svg/Icons/Vaults.js +1 -12
  143. package/dist/components/uikit-sdk/Svg/Icons/Verified.js +1 -12
  144. package/dist/components/uikit-sdk/Svg/Icons/Wallet.js +1 -12
  145. package/dist/components/uikit-sdk/Svg/Icons/Warning.js +1 -12
  146. package/dist/components/uikit-sdk/Svg/Icons/Watch.js +1 -12
  147. package/dist/components/uikit-sdk/Svg/Icons/Website.js +1 -12
  148. package/dist/components/uikit-sdk/Svg/Icons/WebsiteNew.js +1 -12
  149. package/dist/components/uikit-sdk/Svg/Icons/WhitepaperNew.js +1 -12
  150. package/dist/components/uikit-sdk/Svg/Icons/XNew.js +1 -12
  151. package/dist/components/uikit-sdk/Svg/Icons/YellowQuestionMark.js +1 -12
  152. package/dist/components/uikit-sdk/Svg/Icons/ZapArrow.js +1 -12
  153. package/dist/components/uikit-sdk/Svg/Icons/ZapIcon.js +1 -12
  154. package/dist/components/uikit-sdk/Svg/Icons/polygonNew.js +1 -12
  155. package/dist/components/uikit-sdk/Svg/index.d.ts +0 -1
  156. package/dist/components/uikit-sdk/Svg/tokens/ABOND.js +1 -12
  157. package/dist/components/uikit-sdk/Svg/tokens/ARBITRUM.js +1 -12
  158. package/dist/components/uikit-sdk/Svg/tokens/AVAX.js +1 -12
  159. package/dist/components/uikit-sdk/Svg/tokens/BANANA.js +1 -12
  160. package/dist/components/uikit-sdk/Svg/tokens/BASE.js +1 -12
  161. package/dist/components/uikit-sdk/Svg/tokens/BNB.js +1 -12
  162. package/dist/components/uikit-sdk/Svg/tokens/BSC.js +1 -12
  163. package/dist/components/uikit-sdk/Svg/tokens/CELO.js +1 -12
  164. package/dist/components/uikit-sdk/Svg/tokens/CRONOS.js +1 -12
  165. package/dist/components/uikit-sdk/Svg/tokens/ETH.js +1 -12
  166. package/dist/components/uikit-sdk/Svg/tokens/FANTOM.js +1 -12
  167. package/dist/components/uikit-sdk/Svg/tokens/GNANA.js +1 -12
  168. package/dist/components/uikit-sdk/Svg/tokens/GNOSIS.js +1 -12
  169. package/dist/components/uikit-sdk/Svg/tokens/INEVM.js +1 -12
  170. package/dist/components/uikit-sdk/Svg/tokens/IOTA.js +1 -12
  171. package/dist/components/uikit-sdk/Svg/tokens/LIGHTLINK.js +1 -12
  172. package/dist/components/uikit-sdk/Svg/tokens/LINEA.js +1 -12
  173. package/dist/components/uikit-sdk/Svg/tokens/OKX.js +1 -12
  174. package/dist/components/uikit-sdk/Svg/tokens/OPTIMISM.js +2 -13
  175. package/dist/components/uikit-sdk/Svg/tokens/POLYGON.js +1 -12
  176. package/dist/components/uikit-sdk/Svg/tokens/POLYGONZK.js +1 -12
  177. package/dist/components/uikit-sdk/Svg/tokens/TLOS.js +1 -12
  178. package/dist/components/uikit-sdk/Svg/walletIcons/BinanceChain.d.ts +0 -1
  179. package/dist/components/uikit-sdk/Svg/walletIcons/BinanceChain.js +1 -12
  180. package/dist/components/uikit-sdk/Svg/walletIcons/Bitkeep.d.ts +0 -1
  181. package/dist/components/uikit-sdk/Svg/walletIcons/Bitkeep.js +1 -12
  182. package/dist/components/uikit-sdk/Svg/walletIcons/Brave.d.ts +0 -1
  183. package/dist/components/uikit-sdk/Svg/walletIcons/Brave.js +1 -12
  184. package/dist/components/uikit-sdk/Svg/walletIcons/Coinbase.d.ts +0 -1
  185. package/dist/components/uikit-sdk/Svg/walletIcons/Coinbase.js +1 -12
  186. package/dist/components/uikit-sdk/Svg/walletIcons/MadWallet.js +1 -12
  187. package/dist/components/uikit-sdk/Svg/walletIcons/MathWallet.d.ts +0 -1
  188. package/dist/components/uikit-sdk/Svg/walletIcons/MathWallet.js +1 -12
  189. package/dist/components/uikit-sdk/Svg/walletIcons/Metamask.d.ts +0 -1
  190. package/dist/components/uikit-sdk/Svg/walletIcons/Metamask.js +1 -12
  191. package/dist/components/uikit-sdk/Svg/walletIcons/Nabox.d.ts +0 -1
  192. package/dist/components/uikit-sdk/Svg/walletIcons/Nabox.js +1 -12
  193. package/dist/components/uikit-sdk/Svg/walletIcons/OKX.d.ts +0 -1
  194. package/dist/components/uikit-sdk/Svg/walletIcons/OKX.js +1 -12
  195. package/dist/components/uikit-sdk/Svg/walletIcons/OntoWallet.d.ts +0 -1
  196. package/dist/components/uikit-sdk/Svg/walletIcons/OntoWallet.js +1 -12
  197. package/dist/components/uikit-sdk/Svg/walletIcons/SafePalWallet.d.ts +0 -1
  198. package/dist/components/uikit-sdk/Svg/walletIcons/SafePalWallet.js +1 -12
  199. package/dist/components/uikit-sdk/Svg/walletIcons/SocialLogin.d.ts +0 -1
  200. package/dist/components/uikit-sdk/Svg/walletIcons/SocialLogin.js +1 -12
  201. package/dist/components/uikit-sdk/Svg/walletIcons/TokenPocket.d.ts +0 -1
  202. package/dist/components/uikit-sdk/Svg/walletIcons/TokenPocket.js +1 -12
  203. package/dist/components/uikit-sdk/Svg/walletIcons/TorusWallet.d.ts +0 -1
  204. package/dist/components/uikit-sdk/Svg/walletIcons/TorusWallet.js +1 -12
  205. package/dist/components/uikit-sdk/Svg/walletIcons/TrustWallet.d.ts +0 -1
  206. package/dist/components/uikit-sdk/Svg/walletIcons/TrustWallet.js +1 -12
  207. package/dist/components/uikit-sdk/Svg/walletIcons/Unstoppable.js +1 -12
  208. package/dist/components/uikit-sdk/Svg/walletIcons/WalletConnect.d.ts +0 -1
  209. package/dist/components/uikit-sdk/Svg/walletIcons/WalletConnect.js +1 -12
  210. package/dist/components/uikit-sdk/Svg/walletIcons/WalletImage.js +1 -12
  211. package/dist/components/uikit-sdk/Tag/ListTag.js +1 -1
  212. package/dist/components/uikit-sdk/Tag/styles.d.ts +2 -3
  213. package/dist/components/uikit-sdk/Text/index.js +1 -1
  214. package/dist/components/uikit-sdk/TokenImage/index.d.ts +1 -1
  215. package/dist/components/uikit-sdk/TokenImage/index.js +2 -13
  216. package/dist/components/uikit-sdk/TooltipBubble/index.js +1 -1
  217. package/dist/components/uikit-sdk/index.d.ts +1 -0
  218. package/dist/components/uikit-sdk/index.js +1 -0
  219. package/dist/config/abi/types/factories/Banana__factory.js +2 -1
  220. package/dist/config/abi/types/factories/BondNft__factory.js +2 -1
  221. package/dist/config/abi/types/factories/Bond__factory.js +2 -1
  222. package/dist/config/abi/types/factories/EnsPublicResolver__factory.js +2 -1
  223. package/dist/config/abi/types/factories/EnsRegistrar__factory.js +2 -1
  224. package/dist/config/abi/types/factories/Erc20__factory.js +2 -1
  225. package/dist/config/abi/types/factories/Erc20_bytes32__factory.js +2 -1
  226. package/dist/config/abi/types/factories/JungleChef__factory.js +2 -1
  227. package/dist/config/abi/types/factories/LaunchBonds__factory.js +2 -1
  228. package/dist/config/abi/types/factories/LensContract__factory.js +2 -1
  229. package/dist/config/abi/types/factories/LockVeAbond__factory.js +2 -1
  230. package/dist/config/abi/types/factories/MigrationBond__factory.js +2 -1
  231. package/dist/config/abi/types/factories/MigrationFveAbond__factory.js +2 -1
  232. package/dist/config/abi/types/factories/MiniComplexRewarder__factory.js +2 -1
  233. package/dist/config/abi/types/factories/Multicallv2__factory.js +2 -1
  234. package/dist/config/abi/types/factories/Multicallv3__factory.js +2 -1
  235. package/dist/config/abi/types/factories/NonFungibleApes__factory.js +2 -1
  236. package/dist/config/abi/types/factories/NonFungibleBananas__factory.js +2 -1
  237. package/dist/config/abi/types/factories/PriceGetterLinea__factory.js +2 -1
  238. package/dist/config/abi/types/factories/PriceGetterV2__factory.js +2 -1
  239. package/dist/config/abi/types/factories/PriceGetter__factory.js +2 -1
  240. package/dist/config/abi/types/factories/SousChef__factory.js +2 -1
  241. package/dist/config/abi/types/factories/Treasury__factory.js +2 -1
  242. package/dist/config/abi/types/factories/Weth__factory.js +2 -1
  243. package/dist/config/abi/types/factories/Zap__factory.js +2 -1
  244. package/dist/config/constants/addresses.js +4 -4
  245. package/dist/config/constants/api.d.ts +4 -4
  246. package/dist/config/constants/api.js +4 -4
  247. package/dist/config/constants/lists.d.ts +3 -3
  248. package/dist/contexts/Localization/Provider.js +3 -3
  249. package/dist/contexts/Localization/helpers.js +2 -2
  250. package/dist/contexts/ModalContext.js +3 -14
  251. package/dist/contexts/RefreshContext.js +3 -14
  252. package/dist/index.d.ts +4 -4
  253. package/dist/index.js +4 -4
  254. package/dist/providers/index.d.ts +8 -0
  255. package/dist/providers/index.js +12 -0
  256. package/dist/scss/BondModal.scss +1 -1
  257. package/dist/theme/colors.js +2 -2
  258. package/dist/utils/index.js +2 -2
  259. package/dist/utils/multicall.js +2 -2
  260. package/dist/{components/Modals → views}/BondModal/BondModal.d.ts +2 -2
  261. package/dist/{components/Modals → views}/BondModal/BondModal.js +37 -36
  262. package/dist/{components/Modals → views}/BondModal/helper.d.ts +1 -1
  263. package/dist/{components/Modals → views}/BondModal/helper.js +1 -1
  264. package/dist/views/BondModal/index.d.ts +4 -0
  265. package/dist/views/BondModal/index.js +18 -0
  266. package/dist/{pages → views}/Bonds/Bonds.js +2 -13
  267. package/dist/{pages → views}/YourBonds/YourBonds.js +11 -22
  268. package/dist/{pages → views}/YourBonds/fetchBillsUser.js +7 -9
  269. package/dist/{pages → views}/YourBonds/getBillNftData.js +2 -2
  270. package/dist/{components/Modals → views}/YourBondsModal/YourBondsModal.d.ts +2 -2
  271. package/dist/views/YourBondsModal/YourBondsModal.js +173 -0
  272. package/dist/{components/Modals → views}/YourBondsModal/styles.js +1 -1
  273. package/package.json +1 -1
  274. package/dist/components/Modals/YourBondsModal/YourBondsModal.js +0 -184
  275. /package/dist/{pages → views}/Bonds/Bonds.d.ts +0 -0
  276. /package/dist/{pages → views}/YourBonds/YourBonds.d.ts +0 -0
  277. /package/dist/{pages → views}/YourBonds/fetchBillsUser.d.ts +0 -0
  278. /package/dist/{pages → views}/YourBonds/getBillNftData.d.ts +0 -0
  279. /package/dist/{components/Modals → views}/YourBondsModal/styles.d.ts +0 -0
@@ -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) {
@@ -19,8 +8,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
19
8
  });
20
9
  };
21
10
  var __generator = (this && this.__generator) || function (thisArg, body) {
22
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
12
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
13
  function verb(n) { return function (v) { return step([n, v]); }; }
25
14
  function step(op) {
26
15
  if (f) throw new TypeError("Generator is already executing.");
@@ -45,28 +34,28 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
45
34
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
35
  }
47
36
  };
48
- import { jsx as _jsx, jsxs as _jsxs } from "theme-ui/jsx-runtime";
37
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "theme-ui/jsx-runtime";
49
38
  /** @jsxImportSource theme-ui */
50
39
  import React, { useEffect, useState } from 'react';
51
- import { Flex, Input, ThemeUIProvider } from 'theme-ui';
52
- import { defaultTheme } from '../../../theme';
53
- import getTimePeriods from '../../../utils/getTimePeriods';
40
+ import { Flex, Input } from 'theme-ui';
41
+ import getTimePeriods from '../../utils/getTimePeriods';
54
42
  import axios from 'axios';
55
43
  import { BigNumber } from 'bignumber.js';
56
- import { getFirstNonZeroDigits } from '../../../utils/roundNumber';
57
- import { isNumber } from '../../../utils/numbers';
58
- import { TooltipBubble, Button, Svg, ListTag } from '../../uikit-sdk';
59
- import { TooltipText } from '../../../enum/tooltips';
44
+ import { getFirstNonZeroDigits } from '../../utils/roundNumber';
45
+ import { isNumber } from '../../utils/numbers';
46
+ import { TooltipBubble, Button, Svg, ListTag, Modal } from '../../components/uikit-sdk';
47
+ import { TooltipText } from '../../enum/tooltips';
60
48
  import { ethers } from 'ethers';
61
- import convertToTokenValue, { adjustDecimals } from "../../../utils/convertToTokenValue";
62
- import TokenImage from '../../uikit-sdk/TokenImage';
63
- import BOND_ABI from '../../../config/abi/bond.json';
64
- import ERC_20_ABI from '../../../config/abi/erc20.json';
65
- import { NETWORK_ICONS, NETWORK_LABEL } from '../../../config/constants/chains';
49
+ import convertToTokenValue, { adjustDecimals } from "../../utils/convertToTokenValue";
50
+ import TokenImage from '../../components/uikit-sdk/TokenImage';
51
+ import BOND_ABI from '../../config/abi/bond.json';
52
+ import ERC_20_ABI from '../../config/abi/erc20.json';
53
+ import { NETWORK_ICONS, NETWORK_LABEL } from '../../config/constants/chains';
66
54
  import { formatUSDNumber, getPremiumColor, premium, youGet, youGetUSD, youSpend, youSpendUSD } from './helper';
67
- import '../../../scss/BondModal.scss';
55
+ import '../../scss/BondModal.scss';
68
56
  import { useChainId, useSwitchChain, useWaitForTransactionReceipt, useWriteContract } from "wagmi";
69
- import { PUBLIC_RPC_URLS } from "../../../config/constants/networks";
57
+ import { PUBLIC_RPC_URLS } from "../../config/constants/networks";
58
+ import useModal from "../../hooks/useModal";
70
59
  var BondModal = function (_a) {
71
60
  var account = _a.account, isActive = _a.isActive, isOpen = _a.isOpen, accountChainId = _a.accountChainId, onClose = _a.onClose, bondAddress = _a.bondAddress;
72
61
  if (!isOpen)
@@ -243,9 +232,19 @@ var BondModal = function (_a) {
243
232
  var singlePurchaseLimit = new BigNumber((_c = bond === null || bond === void 0 ? void 0 : bond.maxPayout) !== null && _c !== void 0 ? _c : 0).div(new BigNumber(10).pow((_d = bond === null || bond === void 0 ? void 0 : bond.earnToken.decimals[chainId]) !== null && _d !== void 0 ? _d : 18));
244
233
  return !available ? 0 : (singlePurchaseLimit.lt(safeAvailable) ? singlePurchaseLimit : safeAvailable);
245
234
  };
246
- return (_jsx(ThemeUIProvider, __assign({ theme: defaultTheme }, { children: bondData.map(function (bond) {
235
+ var onAsd = useModal(_jsx(Modal, { sx: { zIndex: 5000 }, children: _jsx(_Fragment, { children: "asd!" }) }))[0];
236
+ // const ref = React.useRef<boolean>(false);
237
+ //
238
+ // useEffect(() => {
239
+ // if (!ref.current) {
240
+ // console.log('open modal!!')
241
+ // onAsd();
242
+ // ref.current = true;
243
+ // }
244
+ // }, []);
245
+ return (_jsx(_Fragment, { children: bondData.map(function (bond) {
247
246
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
248
- return (_jsx(React.Fragment, { children: _jsx(Flex, __assign({ className: "modal-backdrop", onClick: onClose }, { children: _jsxs(Flex, __assign({ className: "modal-content", onClick: function (event) { return event.stopPropagation(); } }, { children: [toastMessage && (_jsx(Flex, __assign({ className: "toast" }, { children: toastMessage }))), _jsx(Flex, __assign({ className: "modal-header" }, { children: _jsx(Flex, __assign({ className: "svg-close", onClick: onClose }, { children: _jsx(Svg, { icon: "close" }) })) })), _jsxs(Flex, __assign({ className: "modaltable-container" }, { children: [_jsxs(Flex, __assign({ className: "modaltable-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.earnToken.symbol, 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: "modaltable-container description-container" }, { children: bond === null || bond === void 0 ? void 0 : bond.shortDescription })), _jsxs(Flex, __assign({ className: "modaltable-container blocks-container" }, { children: [_jsxs(Flex, __assign({ className: "modal-block block-discount ".concat(getDiscountColor(bond === null || bond === void 0 ? void 0 : bond.discount)) }, { children: [_jsxs(Flex, __assign({ className: "block-header" }, { children: ["Discount", _jsx(TooltipBubble, __assign({ className: "tooltip-bubble", body: _jsx(Flex, { children: TooltipText.Discount }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)" }, { children: _jsx(Flex, __assign({ className: "header-icon" }, { children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) })) }))] })), _jsx(Flex, __assign({ className: "block-content" }, { children: "".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 block-arr" }, { children: [_jsxs(Flex, __assign({ className: "block-header" }, { children: ["ARR", _jsx(TooltipBubble, __assign({ className: "tooltip-bubble", body: _jsx(Flex, { children: TooltipText.ARR }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)" }, { children: _jsx(Flex, __assign({ className: "header-icon" }, { children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) })) }))] })), _jsx(Flex, __assign({ className: "block-content" }, { children: "".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 block-term" }, { children: [_jsxs(Flex, __assign({ className: "block-header" }, { children: ["Terms", _jsx(TooltipBubble, __assign({ className: "tooltip-bubble", body: _jsx(Flex, { children: TooltipText.Terms }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)" }, { children: _jsx(Flex, __assign({ className: "header-icon" }, { children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) })) }))] })), _jsx(Flex, __assign({ className: "block-content" }, { children: 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 block-maxbuy" }, { children: [_jsxs(Flex, __assign({ className: "block-header" }, { children: ["Max Buy", _jsx(TooltipBubble, __assign({ className: "tooltip-bubble", body: _jsx(Flex, { children: TooltipText.MaxBuy(bond.earnToken.symbol) }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)" }, { children: _jsx(Flex, __assign({ className: "header-icon" }, { children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) })) }))] })), _jsx(Flex, __assign({ className: "block-content" }, { children: (_k = parseFloat(maxBuy(bond).toFixed(0))) === null || _k === void 0 ? void 0 : _k.toLocaleString('en-US') }))] }))] })), _jsxs(Flex, __assign({ className: "modaltable-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.lpToken.symbol, " = $ ", formatUSDNumber(youSpendUSD(bond, inputValue))] }))] })), _jsxs(Flex, __assign({ className: "text-container row" }, { children: [_jsxs(Flex, __assign({ className: "row-container premium" }, { children: ["Premium:", _jsx(TooltipBubble, __assign({ className: "tooltip-bubble", 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: "modaltable-container buy-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) {
247
+ return (_jsx(React.Fragment, { children: _jsx(Flex, { className: "modal-backdrop", onClick: onClose, children: _jsxs(Flex, { className: "modal-content", onClick: function (event) { return event.stopPropagation(); }, children: [toastMessage && (_jsx(Flex, { className: "toast", children: toastMessage })), _jsx(Flex, { className: "modal-header", children: _jsx(Flex, { className: "svg-close", onClick: onClose, children: _jsx(Svg, { icon: "close" }) }) }), _jsxs(Flex, { className: "modaltable-container", children: [_jsxs(Flex, { className: "modaltable-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.earnToken.symbol, 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: "modaltable-container description-container", children: bond === null || bond === void 0 ? void 0 : bond.shortDescription }), _jsxs(Flex, { className: "modaltable-container blocks-container", children: [_jsxs(Flex, { className: "modal-block block-discount ".concat(getDiscountColor(bond === null || bond === void 0 ? void 0 : bond.discount)), children: [_jsxs(Flex, { className: "block-header", children: ["Discount", _jsx(TooltipBubble, { className: "tooltip-bubble", body: _jsx(Flex, { children: TooltipText.Discount }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: _jsx(Flex, { className: "header-icon", children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), _jsx(Flex, { className: "block-content", children: "".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 block-arr", children: [_jsxs(Flex, { className: "block-header", children: ["ARR", _jsx(TooltipBubble, { className: "tooltip-bubble", body: _jsx(Flex, { children: TooltipText.ARR }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: _jsx(Flex, { className: "header-icon", children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), _jsx(Flex, { className: "block-content", children: "".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 block-term", children: [_jsxs(Flex, { className: "block-header", children: ["Terms", _jsx(TooltipBubble, { className: "tooltip-bubble", body: _jsx(Flex, { children: TooltipText.Terms }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: _jsx(Flex, { className: "header-icon", children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), _jsx(Flex, { className: "block-content", children: 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 block-maxbuy", children: [_jsxs(Flex, { className: "block-header", children: ["Max Buy", _jsx(TooltipBubble, { className: "tooltip-bubble", body: _jsx(Flex, { children: TooltipText.MaxBuy(bond.earnToken.symbol) }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: _jsx(Flex, { className: "header-icon", children: _jsx(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), _jsx(Flex, { className: "block-content", children: (_k = parseFloat(maxBuy(bond).toFixed(0))) === null || _k === void 0 ? void 0 : _k.toLocaleString('en-US') })] })] }), _jsxs(Flex, { className: "modaltable-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.lpToken.symbol, " = $ ", formatUSDNumber(youSpendUSD(bond, inputValue))] })] }), _jsxs(Flex, { className: "text-container row", children: [_jsxs(Flex, { className: "row-container premium", children: ["Premium:", _jsx(TooltipBubble, { className: "tooltip-bubble", 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: "modaltable-container buy-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) {
249
248
  if (v.currentTarget.value.includes(',')) {
250
249
  v.currentTarget.value = v.currentTarget.value.replace(/,/g, '.');
251
250
  }
@@ -259,18 +258,20 @@ var BondModal = function (_a) {
259
258
  !!v.currentTarget.value && isNumber(v.currentTarget.value) && parseFloat(v.currentTarget.value) >= 0
260
259
  ? v.currentTarget.value
261
260
  : v.currentTarget.value.slice(0, v.currentTarget.value.length - 1);
262
- } }) })), _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.lpToken.symbol) !== null && _o !== void 0 ? _o : bond.earnToken.symbol, size: 30 })] })) })), _jsx(Flex, __assign({ className: "title-container tokenname-small" }, { children: bond === null || bond === void 0 ? void 0 : bond.lpToken.symbol }))] }))] })), isActive && account && (_jsxs(Flex, __assign({ className: "input-container balancerow" }, { children: [_jsxs(Flex, __assign({ className: "balancerow text" }, { children: ["Balance: ", tokenBalance] })), _jsx(Flex, __assign({ className: "balancerow max" }, { children: _jsx(Button, __assign({ className: "max-button", onClick: function () { setInputValue(tokenBalance !== null && tokenBalance !== void 0 ? tokenBalance : '0'); } }, { children: "Max" })) }))] })))] })), _jsxs(Flex, __assign({ className: "modaltable-container button-container" }, { children: [_jsx(Flex, __assign({ className: "button-container get" }, { children: _jsxs(Button, __assign({ className: "action-button", onClick: function () { window.open('https://ape.bond/swap', '_blank'); } }, { children: ["Get ", bond === null || bond === void 0 ? void 0 : bond.lpToken.symbol] })) })), _jsx(Flex, __assign({ className: "button-container buy" }, { children: chainId !== bond.chainId
261
+ } }) }), _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.lpToken.symbol) !== null && _o !== void 0 ? _o : bond.earnToken.symbol, size: 30 })] }) }), _jsx(Flex, { className: "title-container tokenname-small", children: bond === null || bond === void 0 ? void 0 : bond.lpToken.symbol })] })] }), isActive && account && (_jsxs(Flex, { className: "input-container balancerow", children: [_jsxs(Flex, { className: "balancerow text", children: ["Balance: ", tokenBalance] }), _jsx(Flex, { className: "balancerow max", children: _jsx(Button, { className: "max-button", onClick: function () {
262
+ setInputValue(tokenBalance !== null && tokenBalance !== void 0 ? tokenBalance : '0');
263
+ }, children: "Max" }) })] }))] }), _jsxs(Flex, { className: "modaltable-container button-container", children: [_jsx(Flex, { className: "button-container get", children: _jsxs(Button, { className: "action-button", onClick: onAsd, children: ["Get ", bond === null || bond === void 0 ? void 0 : bond.lpToken.symbol] }) }), _jsx(Flex, { className: "button-container buy", children: chainId !== bond.chainId
263
264
  ?
264
- _jsxs(Button, __assign({ className: "switch-button", disabled: isPending || isConfirming || (bond === null || bond === void 0 ? void 0 : bond.soldOut), onClick: function (event) {
265
+ _jsxs(Button, { className: "switch-button", disabled: isPending || isConfirming || (bond === null || bond === void 0 ? void 0 : bond.soldOut), onClick: function (event) {
265
266
  event.stopPropagation();
266
267
  // Add your claim logic here
267
268
  switchChain({ chainId: bond.chainId });
268
- } }, { children: ["Switch to ", NETWORK_LABEL[bond.chainId]] }))
269
+ }, children: ["Switch to ", NETWORK_LABEL[bond.chainId]] })
269
270
  :
270
271
  approveTx != null && isConfirmed ?
271
- _jsx(Button, __assign({ className: "action-button", disabled: isPending || isConfirming || (bond === null || bond === void 0 ? void 0 : bond.soldOut), onClick: handleBuy }, { children: isConfirming ? 'Confirming...' : "Buy ".concat(bond === null || bond === void 0 ? void 0 : bond.showcaseTokenName) }))
272
+ _jsx(Button, { className: "action-button", disabled: isPending || isConfirming || (bond === null || bond === void 0 ? void 0 : bond.soldOut), onClick: handleBuy, children: isConfirming ? 'Confirming...' : "Buy ".concat(bond === null || bond === void 0 ? void 0 : bond.showcaseTokenName) })
272
273
  :
273
- _jsx(Button, __assign({ className: "action-button", disabled: isPending || isConfirming || (bond === null || bond === void 0 ? void 0 : bond.soldOut), onClick: handleApprove }, { children: isConfirming ? 'Confirming...' : 'Approve' })) }))] }))] }))] })) })) }, bond.billAddress));
274
- }) })));
274
+ _jsx(Button, { className: "action-button", disabled: isPending || isConfirming || (bond === null || bond === void 0 ? void 0 : bond.soldOut), onClick: handleApprove, children: isConfirming ? 'Confirming...' : 'Approve' }) })] })] })] }) }) }, bond.billAddress));
275
+ }) }));
275
276
  };
276
277
  export default BondModal;
@@ -1,4 +1,4 @@
1
- import { BondsDataResponse } from "../../../types/bonds";
1
+ import { BondsDataResponse } from "../../types/bonds";
2
2
  declare function formatNumber(input: string): string;
3
3
  declare function formatUSDNumber(input: string): string;
4
4
  declare const youSpend: (inputValue: string) => string;
@@ -1,5 +1,5 @@
1
1
  import BigNumber from "bignumber.js";
2
- import { formatNumberSI } from "../../../utils/formatNumber";
2
+ import { formatNumberSI } from "../../utils/formatNumber";
3
3
  function formatNumber(input) {
4
4
  var number = new BigNumber(input);
5
5
  if (number.isNaN())
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { BondModalProps } from "./BondModal";
3
+ declare const BondModalWithProviders: React.FC<BondModalProps>;
4
+ export default BondModalWithProviders;
@@ -0,0 +1,18 @@
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
+ import { jsx as _jsx } from "theme-ui/jsx-runtime";
13
+ import Providers from "../../providers";
14
+ import BondModal from "./BondModal";
15
+ var BondModalWithProviders = function (props) {
16
+ return (_jsx(Providers, { children: _jsx(BondModal, __assign({}, props)) }));
17
+ };
18
+ export default BondModalWithProviders;
@@ -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 __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
13
2
  if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
14
3
  if (ar || !(i in from)) {
@@ -179,7 +168,7 @@ var Bonds = function (_a) {
179
168
  setBondsRendered(true);
180
169
  }
181
170
  }, [billstoRender]);
182
- return (_jsx(ThemeUIProvider, __assign({ theme: defaultTheme }, { children: !bondsRendered ? (_jsxs(Flex, __assign({ className: "bonds-spinner" }, { children: [" ", _jsx(Spinner, { size: 100 }), " "] })))
183
- : (_jsxs(Flex, __assign({ className: "bonds-container table-container" }, { children: [_jsx(BondRowHeader, { inputValue: inputValue, setChainFilterOption: setChainFilterOption, chainFilterOption: chainFilterOption !== null && chainFilterOption !== void 0 ? chainFilterOption : ['All Chains'], filterOptions: filterOptions, filterOption: filterOption, setFilterOption: handleChangeFilterOption, onInputChange: handleInputChange, onHandleQueryChange: setInputValue, onSort: handleSort }), _jsx(BondRowsByChain, { chains: chains, bonds: billstoRender, hotBonds: hotBonds, hideTitles: inputValue !== '' })] }))) })));
171
+ return (_jsx(ThemeUIProvider, { theme: defaultTheme, children: !bondsRendered ? (_jsxs(Flex, { className: "bonds-spinner", children: [" ", _jsx(Spinner, { size: 100 }), " "] }))
172
+ : (_jsxs(Flex, { className: "bonds-container table-container", children: [_jsx(BondRowHeader, { inputValue: inputValue, setChainFilterOption: setChainFilterOption, chainFilterOption: chainFilterOption !== null && chainFilterOption !== void 0 ? chainFilterOption : ['All Chains'], filterOptions: filterOptions, filterOption: filterOption, setFilterOption: handleChangeFilterOption, onInputChange: handleInputChange, onHandleQueryChange: setInputValue, onSort: handleSort }), _jsx(BondRowsByChain, { chains: chains, bonds: billstoRender, hotBonds: hotBonds, hideTitles: inputValue !== '' })] })) }));
184
173
  };
185
174
  export default Bonds;
@@ -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) {
@@ -19,8 +8,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
19
8
  });
20
9
  };
21
10
  var __generator = (this && this.__generator) || function (thisArg, body) {
22
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
12
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
13
  function verb(n) { return function (v) { return step([n, v]); }; }
25
14
  function step(op) {
26
15
  if (f) throw new TypeError("Generator is already executing.");
@@ -266,22 +255,22 @@ var YourBonds = function (_a) {
266
255
  var closeModal = function () {
267
256
  setIsModalOpen(false);
268
257
  };
269
- return (_jsxs(ThemeUIProvider, __assign({ theme: defaultTheme }, { children: [isModalOpen &&
270
- _jsx(YourBondsModal, { isOpen: true, onClose: closeModal, userBill: selectedBill }), toastMessage && (_jsx(Flex, __assign({ className: "toast" }, { children: toastMessage }))), !bondsRendered ? (_jsxs(Flex, __assign({ className: "yourbonds-spinner" }, { children: [" ", _jsx(Spinner, { size: 100 }), " "] })))
271
- : (_jsxs(Flex, __assign({ className: "yourbonds table-container" }, { children: [_jsxs(Flex, __assign({ className: "yourbonds header-container" }, { children: [_jsx(Flex, __assign({ className: "yourbonds column-tokens" }, { children: _jsx(Flex, __assign({ className: "yourbonds column-search", sx: { width: '100%', maxWidth: ['200px', '200px', '200px', '340px'] } }, { children: _jsx(Input, { value: inputValue, onChange: handleInputChange, variant: "search", sx: { fontWeight: 400, background: 'white2', height: '30px', fontSize: '14px', color: 'white' }, width: '100%', placeholder: 'Search...' }) })) })), _jsxs(Flex, __assign({ className: "yourbonds column-bondinfo" }, { children: [_jsxs(Flex, __assign({ className: "yourbonds header-claimable" }, { children: ["CLAIMABLE", _jsx(Flex, __assign({ className: "yourbonds header-icon", onClick: function () { return handleSort('claimable'); } }, { children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) }))] })), _jsxs(Flex, __assign({ className: "yourbonds header-pending" }, { children: ["PENDING", _jsx(Flex, __assign({ className: "yourbonds header-icon", onClick: function () { return handleSort('pending'); } }, { children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) }))] })), _jsxs(Flex, __assign({ className: "yourbonds header-terms" }, { children: ["TERMS", _jsx(Flex, __assign({ className: "yourbonds header-icon", onClick: function () { return handleSort('terms'); } }, { children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) }))] })), _jsx(Flex, { className: "yourbonds header-claimall" })] }))] })), filteredBonds.map(function (bill) {
258
+ return (_jsxs(ThemeUIProvider, { theme: defaultTheme, children: [isModalOpen &&
259
+ _jsx(YourBondsModal, { isOpen: true, onClose: closeModal, userBill: selectedBill }), toastMessage && (_jsx(Flex, { className: "toast", children: toastMessage })), !bondsRendered ? (_jsxs(Flex, { className: "yourbonds-spinner", children: [" ", _jsx(Spinner, { size: 100 }), " "] }))
260
+ : (_jsxs(Flex, { className: "yourbonds table-container", children: [_jsxs(Flex, { className: "yourbonds header-container", children: [_jsx(Flex, { className: "yourbonds column-tokens", children: _jsx(Flex, { className: "yourbonds column-search", sx: { width: '100%', maxWidth: ['200px', '200px', '200px', '340px'] }, children: _jsx(Input, { value: inputValue, onChange: handleInputChange, variant: "search", sx: { fontWeight: 400, background: 'white2', height: '30px', fontSize: '14px', color: 'white' }, width: '100%', placeholder: 'Search...' }) }) }), _jsxs(Flex, { className: "yourbonds column-bondinfo", children: [_jsxs(Flex, { className: "yourbonds header-claimable", children: ["CLAIMABLE", _jsx(Flex, { className: "yourbonds header-icon", onClick: function () { return handleSort('claimable'); }, children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), _jsxs(Flex, { className: "yourbonds header-pending", children: ["PENDING", _jsx(Flex, { className: "yourbonds header-icon", onClick: function () { return handleSort('pending'); }, children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), _jsxs(Flex, { className: "yourbonds header-terms", children: ["TERMS", _jsx(Flex, { className: "yourbonds header-icon", onClick: function () { return handleSort('terms'); }, children: _jsx(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), _jsx(Flex, { className: "yourbonds header-claimall" })] })] }), filteredBonds.map(function (bill) {
272
261
  var _a, _b;
273
- return (_jsxs(Flex, __assign({ className: "yourbonds bondrow-container", onClick: function () { return rowClick(bill); } }, { children: [_jsx(Flex, __assign({ className: "yourbonds column-tokens" }, { children: _jsx(Flex, __assign({ className: "yourbonds column-tokeninfoname" }, { children: _jsx(TokenInfoAndName, { bill: bill.bond, vestEnds: "Ends in ".concat(getPendingVesting(bill.lastBlockTimestamp, bill.vesting)) }) })) })), _jsxs(Flex, __assign({ className: "yourbonds column-bondinfo" }, { children: [_jsxs(Flex, __assign({ className: "yourbonds column-claimable" }, { children: [formatNumberSI(parseFloat(claimable(bill).toFixed(4)), 4), _jsx(Text, __assign({ sx: { opacity: '0.6', fontSize: '12px', paddingLeft: '5px' } }, { children: "($".concat((claimable(bill) * ((_a = parseFloat(earnTokenPrice(bill.bond))) !== null && _a !== void 0 ? _a : 0)).toFixed(2), ")") }))] })), _jsxs(Flex, __assign({ className: "yourbonds column-pending" }, { children: [formatNumberSI(parseFloat(totalPending(bill).toFixed(0)), 0), _jsx(Text, __assign({ sx: { opacity: '0.6', fontSize: '12px', paddingLeft: '5px' } }, { children: "($".concat((totalPending(bill) * ((_b = parseFloat(earnTokenPrice(bill.bond))) !== null && _b !== void 0 ? _b : 0)).toFixed(2), ")") }))] })), _jsx(Flex, __assign({ className: "yourbonds column-terms" }, { children: "".concat(vestingTimeRemaining(bill).days, "d, ").concat(vestingTimeRemaining(bill).hours, "h, ").concat(vestingTimeRemaining(bill).minutes, "m") })), _jsx(Flex, __assign({ className: "yourbonds column-claimall" }, { children: chainId !== bill.bond.chainId ?
274
- _jsxs(Button, __assign({ className: "switch-button", disabled: claimable(bill) === 0 || isPending, onClick: function (event) {
262
+ return (_jsxs(Flex, { className: "yourbonds bondrow-container", onClick: function () { return rowClick(bill); }, children: [_jsx(Flex, { className: "yourbonds column-tokens", children: _jsx(Flex, { className: "yourbonds column-tokeninfoname", children: _jsx(TokenInfoAndName, { bill: bill.bond, vestEnds: "Ends in ".concat(getPendingVesting(bill.lastBlockTimestamp, bill.vesting)) }) }) }), _jsxs(Flex, { className: "yourbonds column-bondinfo", children: [_jsxs(Flex, { className: "yourbonds column-claimable", children: [formatNumberSI(parseFloat(claimable(bill).toFixed(4)), 4), _jsx(Text, { sx: { opacity: '0.6', fontSize: '12px', paddingLeft: '5px' }, children: "($".concat((claimable(bill) * ((_a = parseFloat(earnTokenPrice(bill.bond))) !== null && _a !== void 0 ? _a : 0)).toFixed(2), ")") })] }), _jsxs(Flex, { className: "yourbonds column-pending", children: [formatNumberSI(parseFloat(totalPending(bill).toFixed(0)), 0), _jsx(Text, { sx: { opacity: '0.6', fontSize: '12px', paddingLeft: '5px' }, children: "($".concat((totalPending(bill) * ((_b = parseFloat(earnTokenPrice(bill.bond))) !== null && _b !== void 0 ? _b : 0)).toFixed(2), ")") })] }), _jsx(Flex, { className: "yourbonds column-terms", children: "".concat(vestingTimeRemaining(bill).days, "d, ").concat(vestingTimeRemaining(bill).hours, "h, ").concat(vestingTimeRemaining(bill).minutes, "m") }), _jsx(Flex, { className: "yourbonds column-claimall", children: chainId !== bill.bond.chainId ?
263
+ _jsxs(Button, { className: "switch-button", disabled: claimable(bill) === 0 || isPending, onClick: function (event) {
275
264
  event.stopPropagation();
276
265
  // Add your claim logic here
277
266
  switchChain({ chainId: bill.bond.chainId });
278
- } }, { children: ["Switch to ", NETWORK_LABEL[bill.bond.chainId]] }))
267
+ }, children: ["Switch to ", NETWORK_LABEL[bill.bond.chainId]] })
279
268
  :
280
- _jsx(Button, __assign({ className: "claim-button", disabled: claimable(bill) === 0 || isPending, onClick: function (event) {
269
+ _jsx(Button, { className: "claim-button", disabled: claimable(bill) === 0 || isPending, onClick: function (event) {
281
270
  event.stopPropagation();
282
271
  // Add your claim logic here
283
272
  handleClaim(bill.id, bill.address);
284
- } }, { children: "Claim" })) }))] }))] }), bill.id));
285
- })] })))] })));
273
+ }, children: "Claim" }) })] })] }, bill.id));
274
+ })] }))] }));
286
275
  };
287
276
  export default YourBonds;
@@ -19,8 +19,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
19
19
  });
20
20
  };
21
21
  var __generator = (this && this.__generator) || function (thisArg, body) {
22
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
22
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
23
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
24
  function verb(n) { return function (v) { return step([n, v]); }; }
25
25
  function step(op) {
26
26
  if (f) throw new TypeError("Generator is already executing.");
@@ -91,14 +91,12 @@ export var fetchUserOwnedBillNftData = function (ownedBillsData, chainId, bills)
91
91
  return acc;
92
92
  }, {});
93
93
  groupedBillsToFetchArray = Object.values(groupedBillsToFetch);
94
- return [4 /*yield*/, Promise.all(groupedBillsToFetchArray.map(function (_a) {
95
- var billNftAddress = _a.billNftAddress, chainId = _a.chainId, ids = _a.ids;
96
- return __awaiter(void 0, void 0, void 0, function () {
97
- return __generator(this, function (_b) {
98
- return [2 /*return*/, getBillNftBatchData(ids, billNftAddress, chainId)];
99
- });
94
+ return [4 /*yield*/, Promise.all(groupedBillsToFetchArray.map(function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
95
+ var billNftAddress = _b.billNftAddress, chainId = _b.chainId, ids = _b.ids;
96
+ return __generator(this, function (_c) {
97
+ return [2 /*return*/, getBillNftBatchData(ids, billNftAddress, chainId)];
100
98
  });
101
- }))
99
+ }); }))
102
100
  // Flatten the resulting array of arrays into a single array
103
101
  ];
104
102
  case 1:
@@ -8,8 +8,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  var __generator = (this && this.__generator) || function (thisArg, body) {
11
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
12
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
13
  function verb(n) { return function (v) { return step([n, v]); }; }
14
14
  function step(op) {
15
15
  if (f) throw new TypeError("Generator is already executing.");
@@ -1,7 +1,7 @@
1
1
  /** @jsxImportSource theme-ui */
2
2
  import React from 'react';
3
- import { UserBill } from '../../../types/yourbonds';
4
- import '../../../scss/YourBondsModal.scss';
3
+ import { UserBill } from '../../types/yourbonds';
4
+ import '../../scss/YourBondsModal.scss';
5
5
  declare const YourBondsModal: ({ isOpen, onClose, userBill }: {
6
6
  isOpen: boolean;
7
7
  onClose: () => void;
@@ -0,0 +1,173 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
12
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
37
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "theme-ui/jsx-runtime";
38
+ /** @jsxImportSource theme-ui */
39
+ import React, { useEffect, useState } from 'react';
40
+ import { Flex, Spinner } from 'theme-ui';
41
+ import { BigNumber } from 'bignumber.js';
42
+ import { AnimatePresence, motion } from 'framer-motion';
43
+ import { NETWORK_ICONS, NETWORK_LABEL } from '../../config/constants/chains';
44
+ import { getBalanceNumber } from '../../utils/getBalanceNumber';
45
+ import { getFirstNonZeroDigits } from '../../utils/roundNumber';
46
+ import TokenImage from '../../components/uikit-sdk/TokenImage';
47
+ import { Button, ListTag, Skeleton, Svg, Text, TooltipBubble } from '../../components/uikit-sdk';
48
+ import { UserBillTooltipText } from '../../enum/tooltips';
49
+ import { getPendingVesting } from '../../hooks/usePendingVesting';
50
+ import { formatNumberSI } from '../../utils/formatNumber';
51
+ import { StyledHeadingText, TraitsContentContainer } from './styles';
52
+ import '../../scss/YourBondsModal.scss';
53
+ import { useChainId, useSwitchChain, useWaitForTransactionReceipt, useWriteContract } from 'wagmi';
54
+ import BOND_ABI from '../../config/abi/bond.json';
55
+ var YourBondsModal = function (_a) {
56
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
57
+ var isOpen = _a.isOpen, onClose = _a.onClose, userBill = _a.userBill;
58
+ if (!isOpen)
59
+ return null;
60
+ var chainId = useChainId();
61
+ var _r = useSwitchChain(), chains = _r.chains, switchChain = _r.switchChain;
62
+ var _s = useWriteContract(), hash = _s.data, isPending = _s.isPending, writeContract = _s.writeContract, writeContractAsync = _s.writeContractAsync;
63
+ var _t = useWaitForTransactionReceipt({
64
+ confirmations: 4,
65
+ chainId: userBill === null || userBill === void 0 ? void 0 : userBill.bond.chainId,
66
+ hash: hash,
67
+ }), isConfirming = _t.isLoading, isConfirmed = _t.isSuccess;
68
+ var _u = useState(null), claimTx = _u[0], setClaimTx = _u[1];
69
+ var _v = useState(null), toastMessage = _v[0], setToastMessage = _v[1];
70
+ var handleClaim = function (billId, billAddress) { return __awaiter(void 0, void 0, void 0, function () {
71
+ var address, tx, error_1;
72
+ return __generator(this, function (_a) {
73
+ switch (_a.label) {
74
+ case 0:
75
+ address = billAddress;
76
+ _a.label = 1;
77
+ case 1:
78
+ _a.trys.push([1, 3, , 4]);
79
+ return [4 /*yield*/, writeContractAsync({
80
+ address: address,
81
+ abi: BOND_ABI,
82
+ functionName: 'redeem',
83
+ args: [billId],
84
+ })];
85
+ case 2:
86
+ tx = _a.sent();
87
+ if (tx) {
88
+ setClaimTx(tx);
89
+ }
90
+ return [3 /*break*/, 4];
91
+ case 3:
92
+ error_1 = _a.sent();
93
+ console.error('Approval failed:', error_1);
94
+ return [3 /*break*/, 4];
95
+ case 4: return [2 /*return*/];
96
+ }
97
+ });
98
+ }); };
99
+ // Confirmation message
100
+ useEffect(function () {
101
+ if (isConfirmed) {
102
+ setToastMessage("Transaction Complete.");
103
+ setTimeout(function () { return setToastMessage(null); }, 10000);
104
+ }
105
+ }, [claimTx, isConfirmed]);
106
+ // Functions to calculate display values for modal
107
+ var totalPending = function (userBill) {
108
+ var _a, _b, _c, _d;
109
+ return getBalanceNumber(new BigNumber((_a = userBill === null || userBill === void 0 ? void 0 : userBill.payout) !== null && _a !== void 0 ? _a : 0), (_d = (_c = (_b = userBill.bond.earnToken) === null || _b === void 0 ? void 0 : _b.decimals) === null || _c === void 0 ? void 0 : _c[chainId]) !== null && _d !== void 0 ? _d : 18);
110
+ };
111
+ var claimable = function (userBill) {
112
+ var _a, _b, _c;
113
+ return getBalanceNumber(new BigNumber(userBill.pendingRewards), (_c = (_b = (_a = userBill.bond.earnToken) === null || _a === void 0 ? void 0 : _a.decimals) === null || _b === void 0 ? void 0 : _b[chainId]) !== null && _c !== void 0 ? _c : 18);
114
+ };
115
+ var earnTokenPrice = function (bond) {
116
+ var _a;
117
+ return getFirstNonZeroDigits(parseFloat((_a = bond === null || bond === void 0 ? void 0 : bond.payoutTokenPrice) !== null && _a !== void 0 ? _a : '0'));
118
+ };
119
+ var BILL_ATTRIBUTES = ['The Legend', 'The Location', 'The Moment', 'The Trend', 'The Innovation'];
120
+ var _w = useState(false), isOpenTraits = _w[0], setIsOpenTraits = _w[1];
121
+ 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); });
122
+ var _x = useState(false), isImageLoaded = _x[0], setIsImageLoaded = _x[1];
123
+ var _y = useState(null), imageSrc = _y[0], setImageSrc = _y[1];
124
+ useEffect(function () {
125
+ var loadImage = function () { return __awaiter(void 0, void 0, void 0, function () {
126
+ var image_1, error_2;
127
+ var _a;
128
+ return __generator(this, function (_b) {
129
+ switch (_b.label) {
130
+ case 0:
131
+ _b.trys.push([0, 2, , 3]);
132
+ image_1 = new Image();
133
+ image_1.src = (_a = userBill.nftData) === null || _a === void 0 ? void 0 : _a.data.image;
134
+ return [4 /*yield*/, new Promise(function (resolve, reject) {
135
+ image_1.onload = resolve;
136
+ image_1.onerror = reject;
137
+ })];
138
+ case 1:
139
+ _b.sent();
140
+ setImageSrc(image_1.src);
141
+ setIsImageLoaded(true);
142
+ return [3 /*break*/, 3];
143
+ case 2:
144
+ error_2 = _b.sent();
145
+ console.error('Error loading image:', error_2);
146
+ setIsImageLoaded(false);
147
+ return [3 /*break*/, 3];
148
+ case 3: return [2 /*return*/];
149
+ }
150
+ });
151
+ }); };
152
+ loadImage();
153
+ }, [userBill]);
154
+ return (_jsx(_Fragment, { children: _jsx(React.Fragment, { children: _jsx(Flex, { className: "yourbondsmodal-backdrop", onClick: onClose, children: !isImageLoaded ? (_jsxs(Flex, { className: "yourbondsmodal-spinner", children: [" ", _jsx(Spinner, { size: 100 }), " "] }))
155
+ : (_jsxs(Flex, { className: "yourbondsmodal-content", onClick: function (event) { return event.stopPropagation(); }, children: [toastMessage && (_jsx(Flex, { className: "toast", children: toastMessage })), _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: imageSrc, style: { display: isImageLoaded ? "block" : "none" } }) }), _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.earnToken.symbol, 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) {
156
+ 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));
157
+ }) }), _jsxs(Text, { sx: { color: 'text', opacity: '0.6', fontSize: ['12px', '12px', '12px', '16px'] }, children: ["#", userBill.id] })] }), _jsxs(Flex, { className: "yourbondinfo blocks-container", children: [_jsxs(Flex, { className: "attributes-container", children: [_jsxs(Flex, { className: "attributes-header", sx: { borderRadius: "".concat(isOpenTraits ? '6px 6px 0px 0px' : 'normal'),
158
+ display: ['none', 'none', 'none', 'flex'] }, 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
159
+ ? 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)); })
160
+ : BILL_ATTRIBUTES.map(function (attrib) {
161
+ return (_jsxs(TraitsContentContainer, { children: [_jsx(Text, { sx: { fontSize: '10px', fontWeight: 500 }, children: attrib }), _jsx(Skeleton, { width: "150px" })] }, attrib));
162
+ }) }) })) })] }), _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, { className: "tooltip-bubble", 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((_h = userBill.lastBlockTimestamp) !== null && _h !== void 0 ? _h : '', (_j = userBill.vesting) !== null && _j !== void 0 ? _j : '') }) })] })] }), _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, { className: "tooltip-bubble", 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: (_k = NETWORK_ICONS === null || NETWORK_ICONS === void 0 ? void 0 : NETWORK_ICONS[userBill.bond.chainId]) !== null && _k !== void 0 ? _k : 'question' }), _jsx(TokenImage, { symbol: (_l = userBill.bond.showcaseTokenName) !== null && _l !== void 0 ? _l : userBill.bond.earnToken.symbol, 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) * ((_m = parseFloat(earnTokenPrice(userBill.bond))) !== null && _m !== void 0 ? _m : 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, { className: "tooltip-bubble", 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: (_o = NETWORK_ICONS === null || NETWORK_ICONS === void 0 ? void 0 : NETWORK_ICONS[userBill.bond.chainId]) !== null && _o !== void 0 ? _o : 'question' }), _jsx(TokenImage, { symbol: (_p = userBill.bond.showcaseTokenName) !== null && _p !== void 0 ? _p : userBill.bond.earnToken.symbol, 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) * ((_q = parseFloat(earnTokenPrice(userBill.bond))) !== null && _q !== void 0 ? _q : 0)).toFixed(2), ")") })] })] })] })] }), _jsxs(Flex, { className: "yourbondinfo button-container", children: [_jsx(Flex, { className: "button-container claim", children: chainId !== (userBill === null || userBill === void 0 ? void 0 : userBill.bond.chainId) ?
163
+ _jsxs(Button, { className: "switch-button", disabled: claimable(userBill) === 0 || isPending, onClick: function (event) {
164
+ event.stopPropagation();
165
+ switchChain({ chainId: userBill.bond.chainId });
166
+ }, children: ["Switch to ", NETWORK_LABEL[userBill.bond.chainId]] })
167
+ :
168
+ _jsx(Button, { className: "claim-button", disabled: claimable(userBill) === 0 || isPending, onClick: function (event) {
169
+ event.stopPropagation();
170
+ handleClaim(userBill.id, userBill.address);
171
+ }, children: "Claim" }) }), _jsx(Flex, { className: "button-container transfer", children: _jsx(Button, { className: "transfer-button", variant: "secondary", disabled: true, onClick: function () { window.open('https://ape.bond/swap', '_blank'); }, children: "TRANSFER" }) })] })] })] })] })) }) }, userBill.address) }));
172
+ };
173
+ export default YourBondsModal;
@@ -3,7 +3,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
3
3
  return cooked;
4
4
  };
5
5
  import styled from "@emotion/styled";
6
- import { Flex, Text } from "../../uikit-sdk";
6
+ import { Flex, Text } from "../../components/uikit-sdk";
7
7
  export var StyledHeadingText = styled(Text)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-size: 12px;\n align-self: center;\n @media screen and (min-width: 1180px) {\n font-size: 22px;\n }\n"], ["\n font-size: 12px;\n align-self: center;\n @media screen and (min-width: 1180px) {\n font-size: 22px;\n }\n"])));
8
8
  export var TraitsContentContainer = styled(Flex)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n justify-content: space-between;\n background: ", ";\n padding: 0px 15px;\n &:last-child {\n border-radius: 0px 0px 6px 6px;\n }\n @media screen and (max-width: 667px) {\n :first-of-type {\n border-radius: 6px 6px 0px 0px;\n }\n }\n"], ["\n justify-content: space-between;\n background: ", ";\n padding: 0px 15px;\n &:last-child {\n border-radius: 0px 0px 6px 6px;\n }\n @media screen and (max-width: 667px) {\n :first-of-type {\n border-radius: 6px 6px 0px 0px;\n }\n }\n"])), function (_a) {
9
9
  var theme = _a.theme;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Ape Bond SDK",
4
4
  "author": "Ape Bond",
5
5
  "license": "MIT",
6
- "version": "1.0.778",
6
+ "version": "1.0.779",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.es.js",
9
9
  "types": "dist/index.d.ts",