@ape.swap/bonds-sdk 1.0.779 → 1.1.0-seedify

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 (455) hide show
  1. package/dist/components/AccordionText/index.d.ts +9 -0
  2. package/dist/components/BondRows/BondRow.d.ts +3 -2
  3. package/dist/components/BondRows/BondRowHeader.d.ts +2 -3
  4. package/dist/components/BondRows/BondRowsByChain.d.ts +3 -3
  5. package/dist/components/BondRows/BondRowsWithTitle.d.ts +3 -3
  6. package/dist/components/DisconnectedPlaceholder/index.d.ts +3 -0
  7. package/dist/components/SlippageModal/index.d.ts +3 -0
  8. package/dist/components/TokenInfoAndName/index.d.ts +3 -2
  9. package/dist/components/TokenSelectorModal/TokenRow.d.ts +8 -0
  10. package/dist/components/TokenSelectorModal/index.d.ts +11 -0
  11. package/dist/components/TokenSelectorPanel/index.d.ts +15 -0
  12. package/dist/components/uikit-sdk/Modal/index.d.ts +1 -1
  13. package/dist/components/uikit-sdk/Toggle/index.d.ts +8 -0
  14. package/dist/components/uikit-sdk/Toggle/styles.d.ts +3 -0
  15. package/dist/components/uikit-sdk/TokenImage/index.d.ts +3 -2
  16. package/dist/components/uikit-sdk/index.d.ts +1 -0
  17. package/dist/config/abi/types/Banana.d.ts +103 -126
  18. package/dist/config/abi/types/Bond.d.ts +176 -221
  19. package/dist/config/abi/types/BondNft.d.ts +160 -207
  20. package/dist/config/abi/types/EnsPublicResolver.d.ts +129 -205
  21. package/dist/config/abi/types/EnsRegistrar.d.ts +62 -82
  22. package/dist/config/abi/types/Erc20.d.ts +40 -52
  23. package/dist/config/abi/types/Erc20_bytes32.d.ts +11 -11
  24. package/dist/config/abi/types/JungleChef.d.ts +64 -79
  25. package/dist/config/abi/types/LaunchBonds.d.ts +299 -355
  26. package/dist/config/abi/types/LensContract.d.ts +58 -77
  27. package/dist/config/abi/types/LockVeAbond.d.ts +328 -434
  28. package/dist/config/abi/types/MigrationBond.d.ts +268 -330
  29. package/dist/config/abi/types/MigrationFveAbond.d.ts +83 -89
  30. package/dist/config/abi/types/MiniComplexRewarder.d.ts +99 -145
  31. package/dist/config/abi/types/Multicallv2.d.ts +35 -46
  32. package/dist/config/abi/types/Multicallv3.d.ts +14 -14
  33. package/dist/config/abi/types/NonFungibleApes.d.ts +130 -170
  34. package/dist/config/abi/types/NonFungibleBananas.d.ts +135 -172
  35. package/dist/config/abi/types/PriceGetter.d.ts +218 -255
  36. package/dist/config/abi/types/PriceGetterLinea.d.ts +254 -287
  37. package/dist/config/abi/types/PriceGetterV2.d.ts +239 -276
  38. package/dist/config/abi/types/SousChef.d.ts +140 -177
  39. package/dist/config/abi/types/Treasury.d.ts +66 -69
  40. package/dist/config/abi/types/Weth.d.ts +53 -68
  41. package/dist/config/abi/types/Zap.d.ts +97 -141
  42. package/dist/config/abi/types/common.d.ts +3 -3
  43. package/dist/config/abi/types/factories/Banana__factory.d.ts +3 -3
  44. package/dist/config/abi/types/factories/BondNft__factory.d.ts +3 -3
  45. package/dist/config/abi/types/factories/Bond__factory.d.ts +3 -3
  46. package/dist/config/abi/types/factories/EnsPublicResolver__factory.d.ts +3 -3
  47. package/dist/config/abi/types/factories/EnsRegistrar__factory.d.ts +3 -3
  48. package/dist/config/abi/types/factories/Erc20__factory.d.ts +3 -3
  49. package/dist/config/abi/types/factories/Erc20_bytes32__factory.d.ts +3 -3
  50. package/dist/config/abi/types/factories/JungleChef__factory.d.ts +3 -3
  51. package/dist/config/abi/types/factories/LaunchBonds__factory.d.ts +3 -3
  52. package/dist/config/abi/types/factories/LensContract__factory.d.ts +3 -3
  53. package/dist/config/abi/types/factories/LockVeAbond__factory.d.ts +3 -3
  54. package/dist/config/abi/types/factories/MigrationBond__factory.d.ts +3 -3
  55. package/dist/config/abi/types/factories/MigrationFveAbond__factory.d.ts +3 -3
  56. package/dist/config/abi/types/factories/MiniComplexRewarder__factory.d.ts +3 -3
  57. package/dist/config/abi/types/factories/Multicallv2__factory.d.ts +3 -3
  58. package/dist/config/abi/types/factories/Multicallv3__factory.d.ts +3 -3
  59. package/dist/config/abi/types/factories/NonFungibleApes__factory.d.ts +3 -3
  60. package/dist/config/abi/types/factories/NonFungibleBananas__factory.d.ts +3 -3
  61. package/dist/config/abi/types/factories/PriceGetterLinea__factory.d.ts +3 -3
  62. package/dist/config/abi/types/factories/PriceGetterV2__factory.d.ts +3 -3
  63. package/dist/config/abi/types/factories/PriceGetter__factory.d.ts +3 -3
  64. package/dist/config/abi/types/factories/SousChef__factory.d.ts +3 -3
  65. package/dist/config/abi/types/factories/Treasury__factory.d.ts +3 -3
  66. package/dist/config/abi/types/factories/Weth__factory.d.ts +3 -3
  67. package/dist/config/abi/types/factories/Zap__factory.d.ts +3 -3
  68. package/dist/config/abi/types/factories/index.d.ts +25 -25
  69. package/dist/config/abi/types/index.d.ts +51 -51
  70. package/dist/config/constants/addresses.d.ts +0 -8
  71. package/dist/config/constants/queryKeys.d.ts +10 -2
  72. package/dist/config/constants/tokens.d.ts +3 -6
  73. package/dist/config/constants/zapInputTokens.d.ts +2 -0
  74. package/dist/hooks/useTokenFromZapList.d.ts +3 -0
  75. package/dist/hooks/useTopThreeTags.d.ts +2 -2
  76. package/dist/main.d.ts +7 -0
  77. package/dist/main.js +73492 -0
  78. package/dist/providers/index.d.ts +0 -3
  79. package/dist/scss/AccordionText.scss +11 -0
  80. package/dist/scss/BondMenu.scss +2 -2
  81. package/dist/scss/BondModal.scss +305 -234
  82. package/dist/scss/BondRow.scss +5 -5
  83. package/dist/scss/BondRowHeader.scss +7 -7
  84. package/dist/scss/Bonds.scss +2 -1
  85. package/dist/scss/TokenInfoName.scss +60 -0
  86. package/dist/scss/YourBonds.scss +19 -14
  87. package/dist/scss/YourBondsModal.scss +3 -3
  88. package/dist/scss/index.scss +12 -0
  89. package/dist/state/allowance/useAllowance.d.ts +15 -0
  90. package/dist/state/balance/useCurrencyBalance.d.ts +4 -0
  91. package/dist/state/bonds/useBondNFTData.d.ts +5 -0
  92. package/dist/state/bonds/useBondsData.d.ts +4 -0
  93. package/dist/state/bonds/useBondsList.d.ts +4 -0
  94. package/dist/state/bonds/useHotBonds.d.ts +3 -0
  95. package/dist/state/bonds/useUserBonds.d.ts +5 -0
  96. package/dist/state/price/useCurrencyPrice.d.ts +3 -0
  97. package/dist/state/slippage/useSlippage.d.ts +1 -0
  98. package/dist/state/tokenPrices/useTokenPrices.d.ts +29 -0
  99. package/dist/state/zap/getChainParam.d.ts +12 -0
  100. package/dist/state/zap/useSoulZapBondQuote.d.ts +4 -0
  101. package/dist/state/zap/useSoulZapTokenQuote.d.ts +3 -0
  102. package/dist/types/bonds.d.ts +4 -41
  103. package/dist/types/yourbonds.d.ts +54 -69
  104. package/dist/utils/displayHelpers.d.ts +13 -0
  105. package/dist/utils/getNativeTicker.d.ts +3 -0
  106. package/dist/utils/index.d.ts +1 -1
  107. package/dist/views/BondModal/BondModal.d.ts +7 -6
  108. package/dist/views/BondModal/helper.d.ts +6 -6
  109. package/dist/views/BondModal/index.d.ts +2 -2
  110. package/dist/views/Bonds/Bonds.d.ts +7 -10
  111. package/dist/views/Bonds/components/CheckURL/index.d.ts +4 -0
  112. package/dist/views/Bonds/index.d.ts +4 -0
  113. package/dist/views/Bonds/utils.d.ts +14 -0
  114. package/dist/views/FullBondsView/FullBondsView.d.ts +7 -0
  115. package/dist/views/FullBondsView/index.d.ts +3 -0
  116. package/dist/views/YourBonds/YourBonds.d.ts +1 -11
  117. package/dist/views/YourBonds/components/UserBondRow/index.d.ts +6 -0
  118. package/dist/views/YourBonds/fetchBillsUser.d.ts +4 -5
  119. package/dist/views/YourBonds/index.d.ts +3 -0
  120. package/dist/views/YourBondsModal/YourBondsModal.d.ts +4 -5
  121. package/dist/views/ZapModal/index.d.ts +14 -0
  122. package/dist/views/ZapModal/styles.d.ts +2 -0
  123. package/package.json +24 -24
  124. package/dist/components/BondMenu/BondMenu.js +0 -40
  125. package/dist/components/BondMenu/useChainFilterOption.js +0 -30
  126. package/dist/components/BondRows/BondRow.js +0 -81
  127. package/dist/components/BondRows/BondRowHeader.js +0 -12
  128. package/dist/components/BondRows/BondRowsByChain.js +0 -13
  129. package/dist/components/BondRows/BondRowsWithTitle.js +0 -20
  130. package/dist/components/BondRows/ChainTitle.js +0 -18
  131. package/dist/components/MenuSelect/MenuSelect.js +0 -36
  132. package/dist/components/MenuSelect/RecommendationSelector.js +0 -32
  133. package/dist/components/MenuSelect/types.js +0 -1
  134. package/dist/components/NetworkFilter/index.js +0 -66
  135. package/dist/components/ProgressBar/ProgressBar.js +0 -10
  136. package/dist/components/ProgressBar/ProgressBarWrapper.js +0 -9
  137. package/dist/components/ProgressBar/styles.js +0 -82
  138. package/dist/components/TokenInfoAndName/index.js +0 -61
  139. package/dist/components/Tooltip/ButtonsRow.js +0 -21
  140. package/dist/components/Tooltip/Tooltip.js +0 -13
  141. package/dist/components/Tooltip/styles.js +0 -44
  142. package/dist/components/uikit-sdk/Button/Button.js +0 -91
  143. package/dist/components/uikit-sdk/Button/IconButton.js +0 -33
  144. package/dist/components/uikit-sdk/Button/index.js +0 -2
  145. package/dist/components/uikit-sdk/Button/styles.js +0 -30
  146. package/dist/components/uikit-sdk/Button/types.js +0 -37
  147. package/dist/components/uikit-sdk/Checkbox/index.js +0 -46
  148. package/dist/components/uikit-sdk/Checkbox/types.js +0 -5
  149. package/dist/components/uikit-sdk/Flex/index.js +0 -29
  150. package/dist/components/uikit-sdk/Input/Input.js +0 -72
  151. package/dist/components/uikit-sdk/Input/NumericInput.js +0 -35
  152. package/dist/components/uikit-sdk/Input/StyledInput.js +0 -26
  153. package/dist/components/uikit-sdk/Input/index.js +0 -3
  154. package/dist/components/uikit-sdk/Modal/ModalFooter.js +0 -21
  155. package/dist/components/uikit-sdk/Modal/ModalHeader.js +0 -31
  156. package/dist/components/uikit-sdk/Modal/index.js +0 -46
  157. package/dist/components/uikit-sdk/Modal/styles.js +0 -62
  158. package/dist/components/uikit-sdk/Modal/types.js +0 -1
  159. package/dist/components/uikit-sdk/Select/Select.js +0 -61
  160. package/dist/components/uikit-sdk/Select/SelectItem.js +0 -40
  161. package/dist/components/uikit-sdk/Select/index.js +0 -2
  162. package/dist/components/uikit-sdk/Select/styles.js +0 -50
  163. package/dist/components/uikit-sdk/Select/types.js +0 -37
  164. package/dist/components/uikit-sdk/Skeleton/index.js +0 -31
  165. package/dist/components/uikit-sdk/Skeleton/styles.js +0 -40
  166. package/dist/components/uikit-sdk/Skeleton/types.js +0 -10
  167. package/dist/components/uikit-sdk/Svg/Icons/AbondFullLogo.js +0 -16
  168. package/dist/components/uikit-sdk/Svg/Icons/AbondSmallLogo.js +0 -6
  169. package/dist/components/uikit-sdk/Svg/Icons/AccountMonkey.js +0 -16
  170. package/dist/components/uikit-sdk/Svg/Icons/AllChains.js +0 -6
  171. package/dist/components/uikit-sdk/Svg/Icons/ApebondLogo.js +0 -17
  172. package/dist/components/uikit-sdk/Svg/Icons/ApeswapSmallLogo.js +0 -6
  173. package/dist/components/uikit-sdk/Svg/Icons/Arrow.js +0 -16
  174. package/dist/components/uikit-sdk/Svg/Icons/Audit.js +0 -16
  175. package/dist/components/uikit-sdk/Svg/Icons/BananaIcon.js +0 -6
  176. package/dist/components/uikit-sdk/Svg/Icons/BillsM1.js +0 -16
  177. package/dist/components/uikit-sdk/Svg/Icons/BillsM2.js +0 -17
  178. package/dist/components/uikit-sdk/Svg/Icons/BillsM3.js +0 -16
  179. package/dist/components/uikit-sdk/Svg/Icons/Bridge.js +0 -16
  180. package/dist/components/uikit-sdk/Svg/Icons/Bubble.js +0 -16
  181. package/dist/components/uikit-sdk/Svg/Icons/Calculator.js +0 -16
  182. package/dist/components/uikit-sdk/Svg/Icons/Calendar.js +0 -5
  183. package/dist/components/uikit-sdk/Svg/Icons/Cancelled.js +0 -16
  184. package/dist/components/uikit-sdk/Svg/Icons/Card.js +0 -16
  185. package/dist/components/uikit-sdk/Svg/Icons/Caret.js +0 -16
  186. package/dist/components/uikit-sdk/Svg/Icons/Chain.js +0 -9
  187. package/dist/components/uikit-sdk/Svg/Icons/Chart.js +0 -16
  188. package/dist/components/uikit-sdk/Svg/Icons/Chat.js +0 -16
  189. package/dist/components/uikit-sdk/Svg/Icons/Close.js +0 -9
  190. package/dist/components/uikit-sdk/Svg/Icons/Cog.js +0 -16
  191. package/dist/components/uikit-sdk/Svg/Icons/Collapse.js +0 -16
  192. package/dist/components/uikit-sdk/Svg/Icons/Copy.js +0 -16
  193. package/dist/components/uikit-sdk/Svg/Icons/Discord.js +0 -16
  194. package/dist/components/uikit-sdk/Svg/Icons/DiscordNew.js +0 -16
  195. package/dist/components/uikit-sdk/Svg/Icons/Docs.js +0 -16
  196. package/dist/components/uikit-sdk/Svg/Icons/DocsV2.js +0 -16
  197. package/dist/components/uikit-sdk/Svg/Icons/Ellipse.js +0 -16
  198. package/dist/components/uikit-sdk/Svg/Icons/Error.js +0 -16
  199. package/dist/components/uikit-sdk/Svg/Icons/Expand.js +0 -16
  200. package/dist/components/uikit-sdk/Svg/Icons/Explorer.js +0 -16
  201. package/dist/components/uikit-sdk/Svg/Icons/External.js +0 -16
  202. package/dist/components/uikit-sdk/Svg/Icons/Farm.js +0 -16
  203. package/dist/components/uikit-sdk/Svg/Icons/Fav.js +0 -16
  204. package/dist/components/uikit-sdk/Svg/Icons/FilledURL.js +0 -16
  205. package/dist/components/uikit-sdk/Svg/Icons/Fire.js +0 -6
  206. package/dist/components/uikit-sdk/Svg/Icons/Frame.js +0 -16
  207. package/dist/components/uikit-sdk/Svg/Icons/FullLogo.js +0 -6
  208. package/dist/components/uikit-sdk/Svg/Icons/Gnana.js +0 -16
  209. package/dist/components/uikit-sdk/Svg/Icons/GreenShield.js +0 -6
  210. package/dist/components/uikit-sdk/Svg/Icons/Hamburger.js +0 -16
  211. package/dist/components/uikit-sdk/Svg/Icons/HamburgerClosed.js +0 -16
  212. package/dist/components/uikit-sdk/Svg/Icons/Home.js +0 -16
  213. package/dist/components/uikit-sdk/Svg/Icons/Hot.js +0 -6
  214. package/dist/components/uikit-sdk/Svg/Icons/Info.js +0 -16
  215. package/dist/components/uikit-sdk/Svg/Icons/InfoSolid.js +0 -16
  216. package/dist/components/uikit-sdk/Svg/Icons/Insight.js +0 -16
  217. package/dist/components/uikit-sdk/Svg/Icons/Instagram.js +0 -16
  218. package/dist/components/uikit-sdk/Svg/Icons/Island.js +0 -16
  219. package/dist/components/uikit-sdk/Svg/Icons/Language.js +0 -16
  220. package/dist/components/uikit-sdk/Svg/Icons/LanguageIcon.js +0 -16
  221. package/dist/components/uikit-sdk/Svg/Icons/LineChart.js +0 -6
  222. package/dist/components/uikit-sdk/Svg/Icons/LiquidityIcon.js +0 -16
  223. package/dist/components/uikit-sdk/Svg/Icons/Logout.js +0 -16
  224. package/dist/components/uikit-sdk/Svg/Icons/Medium.js +0 -16
  225. package/dist/components/uikit-sdk/Svg/Icons/MenuSettings.js +0 -16
  226. package/dist/components/uikit-sdk/Svg/Icons/Message.js +0 -9
  227. package/dist/components/uikit-sdk/Svg/Icons/Migrate.js +0 -16
  228. package/dist/components/uikit-sdk/Svg/Icons/Moon.js +0 -16
  229. package/dist/components/uikit-sdk/Svg/Icons/More.js +0 -16
  230. package/dist/components/uikit-sdk/Svg/Icons/NFA.js +0 -16
  231. package/dist/components/uikit-sdk/Svg/Icons/NavCaret.js +0 -16
  232. package/dist/components/uikit-sdk/Svg/Icons/PlaceholderMonkey.js +0 -16
  233. package/dist/components/uikit-sdk/Svg/Icons/Play.js +0 -5
  234. package/dist/components/uikit-sdk/Svg/Icons/Pool.js +0 -16
  235. package/dist/components/uikit-sdk/Svg/Icons/Positions.js +0 -16
  236. package/dist/components/uikit-sdk/Svg/Icons/ProfileDark.js +0 -6
  237. package/dist/components/uikit-sdk/Svg/Icons/ProfileIcon.js +0 -16
  238. package/dist/components/uikit-sdk/Svg/Icons/ProfileLight.js +0 -6
  239. package/dist/components/uikit-sdk/Svg/Icons/Question.js +0 -6
  240. package/dist/components/uikit-sdk/Svg/Icons/QuestionCircle.js +0 -16
  241. package/dist/components/uikit-sdk/Svg/Icons/QuestionFill.js +0 -16
  242. package/dist/components/uikit-sdk/Svg/Icons/Quiz.js +0 -16
  243. package/dist/components/uikit-sdk/Svg/Icons/Receipt.js +0 -16
  244. package/dist/components/uikit-sdk/Svg/Icons/Reddit.js +0 -16
  245. package/dist/components/uikit-sdk/Svg/Icons/Rocket.js +0 -16
  246. package/dist/components/uikit-sdk/Svg/Icons/ScrollTop.js +0 -16
  247. package/dist/components/uikit-sdk/Svg/Icons/Search.js +0 -16
  248. package/dist/components/uikit-sdk/Svg/Icons/Send.js +0 -16
  249. package/dist/components/uikit-sdk/Svg/Icons/Settings.js +0 -16
  250. package/dist/components/uikit-sdk/Svg/Icons/Share.js +0 -16
  251. package/dist/components/uikit-sdk/Svg/Icons/Sort.js +0 -16
  252. package/dist/components/uikit-sdk/Svg/Icons/Success.js +0 -16
  253. package/dist/components/uikit-sdk/Svg/Icons/SuccessOutline.js +0 -16
  254. package/dist/components/uikit-sdk/Svg/Icons/SwapArrows.js +0 -16
  255. package/dist/components/uikit-sdk/Svg/Icons/SwitchArrows.js +0 -16
  256. package/dist/components/uikit-sdk/Svg/Icons/Tag.js +0 -5
  257. package/dist/components/uikit-sdk/Svg/Icons/Telegram.js +0 -16
  258. package/dist/components/uikit-sdk/Svg/Icons/TelegramNew.js +0 -16
  259. package/dist/components/uikit-sdk/Svg/Icons/TextLogo.js +0 -6
  260. package/dist/components/uikit-sdk/Svg/Icons/TickShield.js +0 -16
  261. package/dist/components/uikit-sdk/Svg/Icons/Trade.js +0 -16
  262. package/dist/components/uikit-sdk/Svg/Icons/Trash.js +0 -16
  263. package/dist/components/uikit-sdk/Svg/Icons/Twitter.js +0 -16
  264. package/dist/components/uikit-sdk/Svg/Icons/URL.js +0 -16
  265. package/dist/components/uikit-sdk/Svg/Icons/Vaults.js +0 -16
  266. package/dist/components/uikit-sdk/Svg/Icons/Verified.js +0 -6
  267. package/dist/components/uikit-sdk/Svg/Icons/Wallet.js +0 -16
  268. package/dist/components/uikit-sdk/Svg/Icons/Warning.js +0 -16
  269. package/dist/components/uikit-sdk/Svg/Icons/Watch.js +0 -16
  270. package/dist/components/uikit-sdk/Svg/Icons/Website.js +0 -16
  271. package/dist/components/uikit-sdk/Svg/Icons/WebsiteNew.js +0 -16
  272. package/dist/components/uikit-sdk/Svg/Icons/WhitepaperNew.js +0 -16
  273. package/dist/components/uikit-sdk/Svg/Icons/XNew.js +0 -16
  274. package/dist/components/uikit-sdk/Svg/Icons/YellowQuestionMark.js +0 -6
  275. package/dist/components/uikit-sdk/Svg/Icons/ZapArrow.js +0 -16
  276. package/dist/components/uikit-sdk/Svg/Icons/ZapIcon.js +0 -16
  277. package/dist/components/uikit-sdk/Svg/Icons/index.js +0 -112
  278. package/dist/components/uikit-sdk/Svg/Icons/polygonNew.js +0 -16
  279. package/dist/components/uikit-sdk/Svg/Icons/types.js +0 -1
  280. package/dist/components/uikit-sdk/Svg/index.js +0 -347
  281. package/dist/components/uikit-sdk/Svg/styles.js +0 -16
  282. package/dist/components/uikit-sdk/Svg/tokens/ABOND.js +0 -6
  283. package/dist/components/uikit-sdk/Svg/tokens/ARBITRUM.js +0 -6
  284. package/dist/components/uikit-sdk/Svg/tokens/AVAX.js +0 -6
  285. package/dist/components/uikit-sdk/Svg/tokens/BANANA.js +0 -6
  286. package/dist/components/uikit-sdk/Svg/tokens/BASE.js +0 -6
  287. package/dist/components/uikit-sdk/Svg/tokens/BNB.js +0 -6
  288. package/dist/components/uikit-sdk/Svg/tokens/BSC.js +0 -6
  289. package/dist/components/uikit-sdk/Svg/tokens/CELO.js +0 -5
  290. package/dist/components/uikit-sdk/Svg/tokens/CRONOS.js +0 -6
  291. package/dist/components/uikit-sdk/Svg/tokens/ETH.js +0 -6
  292. package/dist/components/uikit-sdk/Svg/tokens/FANTOM.js +0 -6
  293. package/dist/components/uikit-sdk/Svg/tokens/GNANA.js +0 -6
  294. package/dist/components/uikit-sdk/Svg/tokens/GNOSIS.js +0 -6
  295. package/dist/components/uikit-sdk/Svg/tokens/INEVM.js +0 -6
  296. package/dist/components/uikit-sdk/Svg/tokens/IOTA.js +0 -6
  297. package/dist/components/uikit-sdk/Svg/tokens/LIGHTLINK.js +0 -6
  298. package/dist/components/uikit-sdk/Svg/tokens/LINEA.js +0 -6
  299. package/dist/components/uikit-sdk/Svg/tokens/OKX.js +0 -5
  300. package/dist/components/uikit-sdk/Svg/tokens/OPTIMISM.js +0 -8
  301. package/dist/components/uikit-sdk/Svg/tokens/POLYGON.js +0 -6
  302. package/dist/components/uikit-sdk/Svg/tokens/POLYGONZK.js +0 -6
  303. package/dist/components/uikit-sdk/Svg/tokens/TLOS.js +0 -6
  304. package/dist/components/uikit-sdk/Svg/tokens/index.js +0 -22
  305. package/dist/components/uikit-sdk/Svg/types.js +0 -165
  306. package/dist/components/uikit-sdk/Svg/walletIcons/BinanceChain.js +0 -6
  307. package/dist/components/uikit-sdk/Svg/walletIcons/Bitkeep.js +0 -6
  308. package/dist/components/uikit-sdk/Svg/walletIcons/Brave.js +0 -6
  309. package/dist/components/uikit-sdk/Svg/walletIcons/Coinbase.js +0 -6
  310. package/dist/components/uikit-sdk/Svg/walletIcons/MadWallet.js +0 -6
  311. package/dist/components/uikit-sdk/Svg/walletIcons/MathWallet.js +0 -6
  312. package/dist/components/uikit-sdk/Svg/walletIcons/Metamask.js +0 -6
  313. package/dist/components/uikit-sdk/Svg/walletIcons/Nabox.js +0 -6
  314. package/dist/components/uikit-sdk/Svg/walletIcons/OKX.js +0 -6
  315. package/dist/components/uikit-sdk/Svg/walletIcons/OntoWallet.js +0 -6
  316. package/dist/components/uikit-sdk/Svg/walletIcons/SafePalWallet.js +0 -6
  317. package/dist/components/uikit-sdk/Svg/walletIcons/SocialLogin.js +0 -6
  318. package/dist/components/uikit-sdk/Svg/walletIcons/TokenPocket.js +0 -6
  319. package/dist/components/uikit-sdk/Svg/walletIcons/TorusWallet.js +0 -6
  320. package/dist/components/uikit-sdk/Svg/walletIcons/TrustWallet.js +0 -6
  321. package/dist/components/uikit-sdk/Svg/walletIcons/Unstoppable.js +0 -6
  322. package/dist/components/uikit-sdk/Svg/walletIcons/WalletConnect.js +0 -6
  323. package/dist/components/uikit-sdk/Svg/walletIcons/WalletImage.js +0 -5
  324. package/dist/components/uikit-sdk/Svg/walletIcons/index.js +0 -18
  325. package/dist/components/uikit-sdk/Tag/ListTag.js +0 -20
  326. package/dist/components/uikit-sdk/Tag/Tag.js +0 -42
  327. package/dist/components/uikit-sdk/Tag/index.js +0 -2
  328. package/dist/components/uikit-sdk/Tag/styles.js +0 -44
  329. package/dist/components/uikit-sdk/Tag/types.js +0 -34
  330. package/dist/components/uikit-sdk/Text/index.js +0 -35
  331. package/dist/components/uikit-sdk/Text/types.js +0 -13
  332. package/dist/components/uikit-sdk/TokenImage/index.js +0 -18
  333. package/dist/components/uikit-sdk/TooltipBubble/index.js +0 -66
  334. package/dist/components/uikit-sdk/TooltipBubble/styles.js +0 -60
  335. package/dist/components/uikit-sdk/TooltipBubble/types.js +0 -8
  336. package/dist/components/uikit-sdk/index.js +0 -12
  337. package/dist/config/abi/bond.json +0 -450
  338. package/dist/config/abi/erc20.json +0 -117
  339. package/dist/config/abi/multicallv2.json +0 -143
  340. package/dist/config/abi/types/Banana.js +0 -1
  341. package/dist/config/abi/types/Bond.js +0 -1
  342. package/dist/config/abi/types/BondNft.js +0 -1
  343. package/dist/config/abi/types/EnsPublicResolver.js +0 -1
  344. package/dist/config/abi/types/EnsRegistrar.js +0 -1
  345. package/dist/config/abi/types/Erc20.js +0 -1
  346. package/dist/config/abi/types/Erc20_bytes32.js +0 -1
  347. package/dist/config/abi/types/JungleChef.js +0 -1
  348. package/dist/config/abi/types/LaunchBonds.js +0 -1
  349. package/dist/config/abi/types/LensContract.js +0 -1
  350. package/dist/config/abi/types/LockVeAbond.js +0 -1
  351. package/dist/config/abi/types/MigrationBond.js +0 -1
  352. package/dist/config/abi/types/MigrationFveAbond.js +0 -1
  353. package/dist/config/abi/types/MiniComplexRewarder.js +0 -1
  354. package/dist/config/abi/types/Multicallv2.js +0 -1
  355. package/dist/config/abi/types/Multicallv3.js +0 -1
  356. package/dist/config/abi/types/NonFungibleApes.js +0 -1
  357. package/dist/config/abi/types/NonFungibleBananas.js +0 -1
  358. package/dist/config/abi/types/PriceGetter.js +0 -1
  359. package/dist/config/abi/types/PriceGetterLinea.js +0 -1
  360. package/dist/config/abi/types/PriceGetterV2.js +0 -1
  361. package/dist/config/abi/types/SousChef.js +0 -1
  362. package/dist/config/abi/types/Treasury.js +0 -1
  363. package/dist/config/abi/types/Weth.js +0 -1
  364. package/dist/config/abi/types/Zap.js +0 -1
  365. package/dist/config/abi/types/common.js +0 -1
  366. package/dist/config/abi/types/factories/Banana__factory.js +0 -628
  367. package/dist/config/abi/types/factories/BondNft__factory.js +0 -951
  368. package/dist/config/abi/types/factories/Bond__factory.js +0 -1042
  369. package/dist/config/abi/types/factories/EnsPublicResolver__factory.js +0 -833
  370. package/dist/config/abi/types/factories/EnsRegistrar__factory.js +0 -439
  371. package/dist/config/abi/types/factories/Erc20__factory.js +0 -239
  372. package/dist/config/abi/types/factories/Erc20_bytes32__factory.js +0 -47
  373. package/dist/config/abi/types/factories/JungleChef__factory.js +0 -326
  374. package/dist/config/abi/types/factories/LaunchBonds__factory.js +0 -2031
  375. package/dist/config/abi/types/factories/LensContract__factory.js +0 -338
  376. package/dist/config/abi/types/factories/LockVeAbond__factory.js +0 -2215
  377. package/dist/config/abi/types/factories/MigrationBond__factory.js +0 -1656
  378. package/dist/config/abi/types/factories/MigrationFveAbond__factory.js +0 -346
  379. package/dist/config/abi/types/factories/MiniComplexRewarder__factory.js +0 -586
  380. package/dist/config/abi/types/factories/Multicallv2__factory.js +0 -160
  381. package/dist/config/abi/types/factories/Multicallv3__factory.js +0 -109
  382. package/dist/config/abi/types/factories/NonFungibleApes__factory.js +0 -810
  383. package/dist/config/abi/types/factories/NonFungibleBananas__factory.js +0 -756
  384. package/dist/config/abi/types/factories/PriceGetterLinea__factory.js +0 -1465
  385. package/dist/config/abi/types/factories/PriceGetterV2__factory.js +0 -1364
  386. package/dist/config/abi/types/factories/PriceGetter__factory.js +0 -1326
  387. package/dist/config/abi/types/factories/SousChef__factory.js +0 -666
  388. package/dist/config/abi/types/factories/Treasury__factory.js +0 -309
  389. package/dist/config/abi/types/factories/Weth__factory.js +0 -296
  390. package/dist/config/abi/types/factories/Zap__factory.js +0 -889
  391. package/dist/config/abi/types/factories/index.js +0 -28
  392. package/dist/config/abi/types/index.js +0 -26
  393. package/dist/config/constants/addresses.js +0 -116
  394. package/dist/config/constants/api.js +0 -6
  395. package/dist/config/constants/chains.js +0 -436
  396. package/dist/config/constants/lifiRouting.js +0 -6
  397. package/dist/config/constants/lists.js +0 -21
  398. package/dist/config/constants/meta.js +0 -92
  399. package/dist/config/constants/misc.js +0 -4
  400. package/dist/config/constants/networks.js +0 -44
  401. package/dist/config/constants/products.js +0 -58
  402. package/dist/config/constants/queryKeys.js +0 -24
  403. package/dist/config/constants/tokens.js +0 -452
  404. package/dist/config/constants/tutorials.js +0 -80
  405. package/dist/config/localization/languages.js +0 -83
  406. package/dist/config/localization/translations.json +0 -918
  407. package/dist/contexts/Localization/Provider.js +0 -134
  408. package/dist/contexts/Localization/helpers.js +0 -63
  409. package/dist/contexts/Localization/index.js +0 -2
  410. package/dist/contexts/Localization/types.js +0 -1
  411. package/dist/contexts/Localization/useTranslation.js +0 -10
  412. package/dist/contexts/ModalContext.js +0 -67
  413. package/dist/contexts/RefreshContext.js +0 -78
  414. package/dist/enum/apeswaplists.d.ts +0 -418
  415. package/dist/enum/apeswaplists.js +0 -152
  416. package/dist/enum/tooltips.js +0 -13
  417. package/dist/hooks/useCookie.js +0 -29
  418. package/dist/hooks/useIsAbond.js +0 -10
  419. package/dist/hooks/useModal.js +0 -39
  420. package/dist/hooks/usePendingVesting.js +0 -13
  421. package/dist/hooks/useRefresh.js +0 -7
  422. package/dist/hooks/useTimer.js +0 -13
  423. package/dist/hooks/useTopThreeTags.js +0 -25
  424. package/dist/index.d.ts +0 -5
  425. package/dist/index.js +0 -6
  426. package/dist/providers/index.js +0 -12
  427. package/dist/theme/base.js +0 -123
  428. package/dist/theme/colors.js +0 -93
  429. package/dist/theme/components.js +0 -338
  430. package/dist/theme/display.js +0 -2
  431. package/dist/theme/index.js +0 -15
  432. package/dist/theme/types.js +0 -1
  433. package/dist/types/bonds.js +0 -1
  434. package/dist/types/yourbonds.js +0 -1
  435. package/dist/utils/convertToTokenValue.js +0 -24
  436. package/dist/utils/formatNumber.js +0 -34
  437. package/dist/utils/formatNumbers.js +0 -148
  438. package/dist/utils/getBalanceNumber.js +0 -18
  439. package/dist/utils/getTimePeriods.js +0 -44
  440. package/dist/utils/index.js +0 -127
  441. package/dist/utils/localStorageHelpers.js +0 -47
  442. package/dist/utils/multicall.js +0 -90
  443. package/dist/utils/numbers.js +0 -111
  444. package/dist/utils/roundNumber.js +0 -14
  445. package/dist/utils/track.js +0 -17
  446. package/dist/views/BondModal/BondModal.js +0 -277
  447. package/dist/views/BondModal/helper.js +0 -54
  448. package/dist/views/BondModal/index.js +0 -18
  449. package/dist/views/Bonds/Bonds.js +0 -174
  450. package/dist/views/YourBonds/YourBonds.js +0 -276
  451. package/dist/views/YourBonds/fetchBillsUser.js +0 -235
  452. package/dist/views/YourBonds/getBillNftData.js +0 -109
  453. package/dist/views/YourBondsModal/YourBondsModal.js +0 -173
  454. package/dist/views/YourBondsModal/styles.js +0 -12
  455. /package/dist/{enum → config/constants}/tooltips.d.ts +0 -0
@@ -1,34 +0,0 @@
1
- export var formatNumber = function (number, minPrecision, maxPrecision) {
2
- if (minPrecision === void 0) { minPrecision = 2; }
3
- if (maxPrecision === void 0) { maxPrecision = 2; }
4
- var options = {
5
- minimumFractionDigits: minPrecision,
6
- maximumFractionDigits: maxPrecision,
7
- };
8
- return number.toLocaleString('en-US', options);
9
- };
10
- // Formats a number with SI (International System of Units) sufixes
11
- export var formatNumberSI = function (number, digits) {
12
- if (digits === void 0) { digits = 2; }
13
- var lookupSI = [
14
- { value: 1, symbol: '' },
15
- { value: 1e6, symbol: 'M' },
16
- { value: 1e9, symbol: 'B' },
17
- { value: 1e12, symbol: 'T' },
18
- ];
19
- var regEx = /\.0+$|(\.[0-9]*[1-9])0+$/;
20
- var formatted;
21
- if (number >= 1e18) {
22
- formatted = '∞';
23
- }
24
- else {
25
- var i = void 0;
26
- for (i = lookupSI.length - 1; i > 0; i--) {
27
- if (number >= lookupSI[i].value) {
28
- break;
29
- }
30
- }
31
- formatted = formatNumber(number / lookupSI[i].value, digits, digits).replace(regEx, '$1') + lookupSI[i].symbol;
32
- }
33
- return formatted;
34
- };
@@ -1,148 +0,0 @@
1
- import numbro from 'numbro';
2
- // Convert [CurrencyAmount] to number with necessary precision for price formatting.
3
- export var currencyAmountToPreciseFloat = function (currencyAmount) {
4
- if (!currencyAmount)
5
- return undefined;
6
- var floatForLargerNumbers = parseFloat(currencyAmount.toExact());
7
- if (floatForLargerNumbers < 0.1) {
8
- return parseFloat(currencyAmount.toSignificant(6));
9
- }
10
- return floatForLargerNumbers;
11
- };
12
- // Convert [Price] to number with necessary precision for price formatting.
13
- export var priceToPreciseFloat = function (price) {
14
- if (!price)
15
- return undefined;
16
- var floatForLargerNumbers = parseFloat(price.toFixed(9));
17
- if (floatForLargerNumbers < 0.1) {
18
- return parseFloat(price.toSignificant(6));
19
- }
20
- return floatForLargerNumbers;
21
- };
22
- /**
23
- * Returns a USD dollar or equivalent denominated numerical value formatted
24
- * in human readable string for use in template.
25
- *
26
- * Adheres to guidelines for prices and other numbers defined here:
27
- * https://www.notion.so/uniswaplabs/Number-standards-fbb9f533f10e4e22820722c2f66d23c0
28
- * @param num numerical value denominated in USD or USD equivalent
29
- * @param isPrice whether the amount represents a price or not
30
- * @param lessPreciseStablecoinValues whether or not we should show less precise values for
31
- * stablecoins (around 1$ in value always) for the sake of readability
32
- * @param digits number of digits after the decimal for non-price amounts
33
- * @param round whether or not to round up non-price amounts
34
- */
35
- export var formatDollar = function (_a) {
36
- var num = _a.num, _b = _a.isPrice, isPrice = _b === void 0 ? false : _b, _c = _a.lessPreciseStablecoinValues, lessPreciseStablecoinValues = _c === void 0 ? false : _c, _d = _a.digits, digits = _d === void 0 ? 2 : _d, _e = _a.round, round = _e === void 0 ? true : _e;
37
- // For USD dollar denominated prices.
38
- if (isPrice) {
39
- if (num === 0)
40
- return '$0.00';
41
- if (!num)
42
- return '-';
43
- if (num < 0.000001) {
44
- return "$".concat(num.toExponential(2));
45
- }
46
- if ((num >= 0.000001 && num < 0.1) || num > 1000000) {
47
- return "$".concat(Number(num).toPrecision(3));
48
- }
49
- // We only show 2 decimal places in explore table for stablecoin value ranges
50
- // for the sake of readability (as opposed to the usual 3 elsewhere).
51
- if (num >= 0.1 && num < (lessPreciseStablecoinValues ? 0.9995 : 1.05)) {
52
- return "$".concat(num.toFixed(3));
53
- }
54
- return "$".concat(Number(num.toFixed(2)).toLocaleString('en-US', { minimumFractionDigits: 2 }));
55
- }
56
- // For volume dollar amounts, like market cap, total value locked, etc.
57
- else {
58
- if (num === 0)
59
- return '$0.00';
60
- if (!num)
61
- return '-';
62
- if (num < 0.000001) {
63
- return '$<0.000001';
64
- }
65
- if (num >= 0.000001 && num < 0.1) {
66
- return "$".concat(Number(num).toPrecision(3));
67
- }
68
- if (num >= 0.1 && num < 1.05) {
69
- return "$".concat(num.toFixed(3));
70
- }
71
- return numbro(num)
72
- .formatCurrency({
73
- average: round,
74
- mantissa: num > 1000 ? 2 : digits,
75
- abbreviations: {
76
- million: 'M',
77
- billion: 'B',
78
- },
79
- })
80
- .toUpperCase();
81
- }
82
- };
83
- export var formatValue = function (_a) {
84
- var num = _a.num, _b = _a.digits, digits = _b === void 0 ? 2 : _b, _c = _a.round, round = _c === void 0 ? true : _c;
85
- if (num === 0)
86
- return '0.00';
87
- if (!num)
88
- return '-';
89
- if (num < 0.000001) {
90
- return '<0.000001';
91
- }
92
- if (num >= 0.000001 && num < 0.1) {
93
- return "".concat(Number(num).toPrecision(3));
94
- }
95
- if (num >= 0.1 && num < 1.05) {
96
- return "".concat(num.toFixed(3));
97
- }
98
- return numbro(num)
99
- .format({
100
- average: round,
101
- mantissa: num > 1000 ? 2 : digits,
102
- abbreviations: {
103
- million: 'M',
104
- billion: 'B',
105
- },
106
- })
107
- .toUpperCase();
108
- };
109
- /**
110
- * Returns a numerical amount of any token formatted in human readable string for use in template.
111
- *
112
- * For transaction review numbers, such as token quantities, NFT price (token-denominated),
113
- * network fees, transaction history items. Adheres to guidelines defined here:
114
- * https://www.notion.so/uniswaplabs/Number-standards-fbb9f533f10e4e22820722c2f66d23c0
115
- * @param num numerical value denominated in any token
116
- * @param maxDigits the maximum number of digits that should be shown for the quantity
117
- */
118
- export var formatTransactionAmount = function (num, maxDigits) {
119
- if (maxDigits === void 0) { maxDigits = 9; }
120
- if (num === 0)
121
- return '0.00';
122
- if (!num)
123
- return '';
124
- if (num < 0.00001) {
125
- return '<0.00001';
126
- }
127
- if (num >= 0.00001 && num < 1) {
128
- return "".concat(Number(num.toFixed(5)).toLocaleString('en-US', {
129
- minimumFractionDigits: 2,
130
- maximumFractionDigits: 5,
131
- }));
132
- }
133
- if (num >= 1 && num < 10000) {
134
- return "".concat(Number(num.toPrecision(6)).toLocaleString('en-US', {
135
- minimumFractionDigits: 2,
136
- maximumFractionDigits: 6,
137
- }));
138
- }
139
- if (num >= 10000 && num < 1000000) {
140
- return "".concat(Number(num.toFixed(2)).toLocaleString('en-US', { minimumFractionDigits: 2 }));
141
- }
142
- // For very large numbers, switch to scientific notation and show as much precision
143
- // as permissible by maxDigits param.
144
- if (num >= Math.pow(10, maxDigits - 1)) {
145
- return "".concat(num.toExponential(maxDigits - 3));
146
- }
147
- return "".concat(Number(num.toFixed(2)).toLocaleString('en-US', { minimumFractionDigits: 2 }));
148
- };
@@ -1,18 +0,0 @@
1
- import BigNumber from 'bignumber.js';
2
- export var getBalanceNumber = function (balance, decimals) {
3
- if (decimals === void 0) { decimals = 18; }
4
- // use with caution. JS can only safely represent up to 15-17 digits of precision
5
- // so you will lose precision in decimals and really big numbers, for those cases use getBNWithDecimals
6
- var displayBalance = new BigNumber(balance).dividedBy(new BigNumber(10).pow(decimals));
7
- return displayBalance.toNumber();
8
- };
9
- export var getFullDisplayBalance = function (balance, decimals) {
10
- if (decimals === void 0) { decimals = 18; }
11
- return balance.dividedBy(new BigNumber(10).pow(decimals)).toFixed();
12
- };
13
- export var getBNWithDecimals = function (balance, decimals) {
14
- if (decimals === void 0) { decimals = 18; }
15
- if (!balance)
16
- return undefined;
17
- return new BigNumber(balance).dividedBy(new BigNumber(10).pow(decimals));
18
- };
@@ -1,44 +0,0 @@
1
- var MINUTE_IN_SECONDS = 60;
2
- var HOUR_IN_SECONDS = 3600;
3
- var DAY_IN_SECONDS = 86400;
4
- var MONTH_IN_SECONDS = 2629800;
5
- var YEAR_IN_SECONDS = 31557600;
6
- /**
7
- * Format number of seconds into year, month, day, hour, minute, seconds
8
- *
9
- * @param seconds
10
- */
11
- var getTimePeriods = function (seconds, days) {
12
- var delta = seconds;
13
- var timeLeft = {
14
- years: 0,
15
- months: 0,
16
- days: 0,
17
- hours: 0,
18
- minutes: 0,
19
- seconds: 0,
20
- };
21
- if (delta >= YEAR_IN_SECONDS && !days) {
22
- timeLeft.years = Math.floor(delta / YEAR_IN_SECONDS);
23
- delta -= timeLeft.years * YEAR_IN_SECONDS;
24
- }
25
- if (delta >= MONTH_IN_SECONDS && !days) {
26
- timeLeft.months = Math.floor(delta / MONTH_IN_SECONDS);
27
- delta -= timeLeft.months * MONTH_IN_SECONDS;
28
- }
29
- if (delta >= DAY_IN_SECONDS) {
30
- timeLeft.days = Math.floor(delta / DAY_IN_SECONDS);
31
- delta -= timeLeft.days * DAY_IN_SECONDS;
32
- }
33
- if (delta >= HOUR_IN_SECONDS) {
34
- timeLeft.hours = Math.floor(delta / HOUR_IN_SECONDS);
35
- delta -= timeLeft.hours * HOUR_IN_SECONDS;
36
- }
37
- if (delta >= MINUTE_IN_SECONDS) {
38
- timeLeft.minutes = Math.floor(delta / MINUTE_IN_SECONDS);
39
- delta -= timeLeft.minutes * MINUTE_IN_SECONDS;
40
- }
41
- timeLeft.seconds = delta;
42
- return timeLeft;
43
- };
44
- export default getTimePeriods;
@@ -1,127 +0,0 @@
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 { getAddress } from '@ethersproject/address';
38
- import { AddressZero } from '@ethersproject/constants';
39
- import { Contract } from '@ethersproject/contracts';
40
- import { BLOCK_EXPLORER, ChainId } from '../config/constants/chains';
41
- // returns the checksummed address if the address is valid, otherwise returns false
42
- export function isAddress(value) {
43
- try {
44
- // Alphabetical letters must be made lowercase for getAddress to work.
45
- // See documentation here: https://docs.ethers.io/v5/api/utils/address/
46
- return getAddress(value.toLowerCase());
47
- }
48
- catch (_a) {
49
- return false;
50
- }
51
- }
52
- // account is not optional
53
- function getSigner(provider, account) {
54
- return provider.getSigner(account).connectUnchecked();
55
- }
56
- // account is optional
57
- function getProviderOrSigner(provider, account) {
58
- return account ? getSigner(provider, account) : provider;
59
- }
60
- // account is optional
61
- export function getContract(address, ABI, provider, account) {
62
- if (!isAddress(address) || address === AddressZero) {
63
- throw Error("Invalid 'address' parameter '".concat(address, "'."));
64
- }
65
- return new Contract(address, ABI, getProviderOrSigner(provider, account));
66
- }
67
- export function isSupportedChain(chainId) {
68
- return !!chainId && !!ChainId[chainId];
69
- }
70
- export function getEtherscanLink(data, type, chainId) {
71
- switch (type) {
72
- case 'transaction': {
73
- return "".concat(BLOCK_EXPLORER[chainId], "/tx/").concat(data);
74
- }
75
- case 'token': {
76
- return "".concat(BLOCK_EXPLORER[chainId], "/token/").concat(data);
77
- }
78
- case 'block': {
79
- return "".concat(BLOCK_EXPLORER[chainId], "/block/").concat(data);
80
- }
81
- case 'countdown': {
82
- return "".concat(BLOCK_EXPLORER[chainId], "/block/countdown/").concat(data);
83
- }
84
- default: {
85
- return "".concat(BLOCK_EXPLORER[chainId], "/address/").concat(data);
86
- }
87
- }
88
- }
89
- /**
90
- * Prompt the user to add a custom token to metamask
91
- * @param tokenAddress
92
- * @param tokenSymbol
93
- * @param tokenDecimals
94
- * @param tokenImage
95
- * @returns {boolean} true if the token has been added, false otherwise
96
- */
97
- export var registerToken = function (tokenAddress, tokenSymbol, tokenDecimals, tokenImage) { return __awaiter(void 0, void 0, void 0, function () {
98
- var tokenAdded, _a;
99
- var _b;
100
- return __generator(this, function (_c) {
101
- switch (_c.label) {
102
- case 0:
103
- if (!((_b = window === null || window === void 0 ? void 0 : window.ethereum) === null || _b === void 0 ? void 0 : _b.request)) return [3 /*break*/, 2];
104
- return [4 /*yield*/, window.ethereum.request({
105
- method: 'wallet_watchAsset',
106
- params: {
107
- type: 'ERC20',
108
- options: {
109
- address: tokenAddress,
110
- symbol: tokenSymbol,
111
- decimals: tokenDecimals,
112
- image: tokenImage,
113
- },
114
- },
115
- })];
116
- case 1:
117
- _a = _c.sent();
118
- return [3 /*break*/, 3];
119
- case 2:
120
- _a = null;
121
- _c.label = 3;
122
- case 3:
123
- tokenAdded = _a;
124
- return [2 /*return*/, tokenAdded];
125
- }
126
- });
127
- }); };
@@ -1,47 +0,0 @@
1
- export var getLocalStorage = function (key) {
2
- if (typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.self) === (window === null || window === void 0 ? void 0 : window.top)) {
3
- // Not in an iframe, safe to access localStorage
4
- try {
5
- var item = localStorage.getItem(key);
6
- return item ? JSON.parse(item) : null;
7
- }
8
- catch (error) {
9
- console.error('Failed to get value from localStorage:', error);
10
- return null;
11
- }
12
- }
13
- else {
14
- // Inside an iframe, don't access localStorage
15
- return null;
16
- }
17
- };
18
- export var setLocalStorage = function (key, value) {
19
- if (typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.self) === (window === null || window === void 0 ? void 0 : window.top)) {
20
- // Not in an iframe, safe to access localStorage
21
- try {
22
- localStorage.setItem(key, JSON.stringify(value));
23
- }
24
- catch (error) {
25
- console.error('Failed to set value in localStorage:', error);
26
- }
27
- }
28
- else {
29
- // Inside an iframe, don't access localStorage
30
- console.log('Running inside an iframe');
31
- }
32
- };
33
- export var removeLocalStorage = function (key) {
34
- if (window.self === window.top) {
35
- // Not in an iframe, safe to access localStorage
36
- try {
37
- localStorage.removeItem(key);
38
- }
39
- catch (error) {
40
- console.error('Failed to remove value from localStorage:', error);
41
- }
42
- }
43
- else {
44
- // Inside an iframe, don't access localStorage
45
- console.log('Running inside an iframe');
46
- }
47
- };
@@ -1,90 +0,0 @@
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 { Interface } from '@ethersproject/abi';
38
- import multicallV2Abi from '../config/abi/multicallv2.json';
39
- import { ethers } from 'ethers';
40
- import { chunk, flatten } from 'lodash';
41
- import { PUBLIC_RPC_URLS } from '../config/constants/networks';
42
- import { MULTICALL_V2 } from '../config/constants/addresses';
43
- // This is the legacy multicall
44
- // Try to use multicall hooks
45
- var multicall = function (chainId, abi, calls, batch, batchSize) { return __awaiter(void 0, void 0, void 0, function () {
46
- var multicallAddress, provider, multi_1, itf_1, calldata, chunkedCalls, chunkedCallNames_1, chunkedData, resolveCall, flattenCalls, returnData, e_1;
47
- return __generator(this, function (_a) {
48
- switch (_a.label) {
49
- case 0:
50
- _a.trys.push([0, 5, , 6]);
51
- multicallAddress = MULTICALL_V2[chainId];
52
- provider = new ethers.providers.JsonRpcProvider(PUBLIC_RPC_URLS[chainId][0], chainId);
53
- multi_1 = new ethers.Contract(multicallAddress, multicallV2Abi, provider);
54
- itf_1 = new Interface(abi);
55
- calldata = calls.map(function (call) { return [call.address.toLowerCase(), itf_1.encodeFunctionData(call.name, call.params)]; });
56
- if (!batch) return [3 /*break*/, 2];
57
- chunkedCalls = chunk(calldata, batchSize);
58
- chunkedCallNames_1 = chunk(calls, batchSize);
59
- chunkedData = chunkedCalls.flatMap(function (chunkedCallSet, i) { return __awaiter(void 0, void 0, void 0, function () {
60
- var returnData;
61
- return __generator(this, function (_a) {
62
- switch (_a.label) {
63
- case 0: return [4 /*yield*/, multi_1.aggregate(chunkedCallSet)];
64
- case 1:
65
- returnData = (_a.sent()).returnData;
66
- return [2 /*return*/, returnData.map(function (call, j) { return itf_1.decodeFunctionResult(chunkedCallNames_1[i][j].name, call); })];
67
- }
68
- });
69
- }); });
70
- return [4 /*yield*/, Promise.all(chunkedData)];
71
- case 1:
72
- resolveCall = _a.sent();
73
- flattenCalls = flatten(resolveCall);
74
- return [2 /*return*/, flattenCalls];
75
- case 2: return [4 /*yield*/, multi_1.aggregate(calldata)];
76
- case 3:
77
- returnData = (_a.sent()).returnData;
78
- return [2 /*return*/, returnData.map(function (call, i) { return itf_1.decodeFunctionResult(calls[i].name, call); })];
79
- case 4: return [3 /*break*/, 6];
80
- case 5:
81
- e_1 = _a.sent();
82
- console.error(e_1);
83
- console.error(chainId);
84
- console.error(calls);
85
- return [3 /*break*/, 6];
86
- case 6: return [2 /*return*/];
87
- }
88
- });
89
- }); };
90
- export default multicall;
@@ -1,111 +0,0 @@
1
- import numbro from 'numbro';
2
- export var isNumber = function (s) {
3
- var reg = /^-?\d+\.?\d*$/;
4
- return reg.test(s) && !isNaN(parseFloat(s)) && isFinite(parseFloat(s));
5
- };
6
- export var floorFormatter = function (n) {
7
- if (n === 0)
8
- return '0.00';
9
- if (!n)
10
- return '';
11
- if (n < 0.001) {
12
- return '<0.001';
13
- }
14
- if (n >= 0.001 && n < 1) {
15
- return "".concat(parseFloat(n.toFixed(3)).toLocaleString('en-US', {
16
- minimumFractionDigits: 1,
17
- maximumFractionDigits: 3,
18
- }));
19
- }
20
- if (n >= 1 && n < 1e6) {
21
- return "".concat(parseFloat(n.toPrecision(6)).toLocaleString('en-US', {
22
- minimumFractionDigits: 0,
23
- maximumFractionDigits: 2,
24
- }));
25
- }
26
- if (n >= 1e6 && n < 1e15) {
27
- return numbro(n)
28
- .format({
29
- average: true,
30
- mantissa: 2,
31
- optionalMantissa: true,
32
- abbreviations: {
33
- million: 'M',
34
- billion: 'B',
35
- trillion: 'T',
36
- },
37
- })
38
- .toUpperCase();
39
- }
40
- if (n >= 1e15) {
41
- return "".concat(n.toExponential(3).replace(/(\.[0-9]*[1-9])0*|(\.0*)/, '$1'));
42
- }
43
- return "".concat(Number(n.toFixed(2)).toLocaleString('en-US', { minimumFractionDigits: 2 }));
44
- };
45
- export var volumeFormatter = function (n) {
46
- if (n === 0)
47
- return '0.00';
48
- if (!n)
49
- return '';
50
- if (n < 0.01) {
51
- return '<0.01';
52
- }
53
- if (n >= 0.01 && n < 1) {
54
- return "".concat(parseFloat(n.toFixed(2)).toLocaleString('en-US'));
55
- }
56
- if (n >= 1 && n < 1000) {
57
- return "".concat(Number(Math.round(n).toLocaleString('en-US')));
58
- }
59
- if (n >= 1000) {
60
- return numbro(n)
61
- .format({
62
- average: true,
63
- mantissa: 1,
64
- optionalMantissa: true,
65
- abbreviations: {
66
- thousand: 'K',
67
- million: 'M',
68
- billion: 'B',
69
- trillion: 'T',
70
- },
71
- })
72
- .toUpperCase();
73
- }
74
- return "".concat(Number(n.toFixed(1)).toLocaleString('en-US', { minimumFractionDigits: 1 }));
75
- };
76
- export var quantityFormatter = function (n) {
77
- if (n === 0)
78
- return '0.00';
79
- if (!n)
80
- return '';
81
- if (n >= 1 && n < 1000) {
82
- return "".concat(Number(Math.round(n).toLocaleString('en-US')));
83
- }
84
- if (n >= 1000) {
85
- return numbro(n)
86
- .format({
87
- average: true,
88
- mantissa: 1,
89
- thousandSeparated: true,
90
- optionalMantissa: true,
91
- abbreviations: {
92
- thousand: 'K',
93
- million: 'M',
94
- billion: 'B',
95
- trillion: 'T',
96
- },
97
- })
98
- .toUpperCase();
99
- }
100
- return "".concat(Number(n.toFixed(2)).toLocaleString('en-US', { minimumFractionDigits: 2 }));
101
- };
102
- export var roundWholePercentage = function (n) {
103
- if (n === 0)
104
- return '0';
105
- if (!n)
106
- return '';
107
- if (n < 1) {
108
- return '<1';
109
- }
110
- return Math.round(n).toString();
111
- };
@@ -1,14 +0,0 @@
1
- /**
2
- * Rounds a number to precision amount of signifant numbers
3
- * @param n the number
4
- * @param precision how many significant numbers to show
5
- * @returns @number
6
- */
7
- export var getFirstNonZeroDigits = function (numberToParse, precision) {
8
- if (precision === void 0) { precision = 3; }
9
- var n = parseFloat(numberToParse.toFixed(18));
10
- var amountToShow = precision - 1;
11
- if (n !== 0)
12
- amountToShow -= Math.floor(Math.log(n) / Math.log(10));
13
- return n.toFixed(amountToShow < 0 ? 0 : amountToShow);
14
- };
@@ -1,17 +0,0 @@
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
- function track(_a) {
13
- var _b;
14
- var event = _a.event, chain = _a.chain, data = _a.data, value = _a.value;
15
- (_b = window.dataLayer) === null || _b === void 0 ? void 0 : _b.push(__assign({ event: event, value: value, chain: chain }, data));
16
- }
17
- export default track;