@multiversx/sdk-dapp-liquidity 2.0.0 → 2.1.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (375) hide show
  1. package/all-networks--dfVLHLJ.js +2 -0
  2. package/all-networks-Czd8zS1n.mjs +4 -0
  3. package/api/checkAccount.js +1 -21
  4. package/api/checkAccount.mjs +13 -13
  5. package/api/confirmRate.js +1 -29
  6. package/api/confirmRate.mjs +17 -22
  7. package/api/getChains.js +1 -17
  8. package/api/getChains.mjs +10 -10
  9. package/api/getRate.js +1 -27
  10. package/api/getRate.mjs +17 -20
  11. package/api/getTokens.js +1 -22
  12. package/api/getTokens.mjs +14 -15
  13. package/api/getTokensBalances.js +1 -21
  14. package/api/getTokensBalances.mjs +13 -13
  15. package/api/getTransactions.js +1 -38
  16. package/api/getTransactions.mjs +25 -31
  17. package/api/index.js +1 -18
  18. package/api/index.mjs +16 -16
  19. package/api/sendTransactions.js +1 -32
  20. package/api/sendTransactions.mjs +19 -19
  21. package/api/tests/confirmRate.spec.js +1 -130
  22. package/api/tests/confirmRate.spec.mjs +44 -58
  23. package/api/tests/getChains.spec.js +1 -43
  24. package/api/tests/getChains.spec.mjs +15 -18
  25. package/api/tests/getRate.spec.js +1 -87
  26. package/api/tests/getRate.spec.mjs +35 -49
  27. package/api/tests/getTokens.spec.js +1 -68
  28. package/api/tests/getTokens.spec.mjs +23 -29
  29. package/api/tests/getTransactions.spec.js +1 -94
  30. package/api/tests/getTransactions.spec.mjs +35 -51
  31. package/api/tests/sendTransactions.spec.js +1 -96
  32. package/api/tests/sendTransactions.spec.mjs +44 -52
  33. package/constants/index.js +1 -4
  34. package/constants/index.mjs +2 -2
  35. package/default-D0Jk5ROI.mjs +4 -0
  36. package/default-DbU6vPaB.js +2 -0
  37. package/helpers/assertRateConfirmationMatchesIntent.d.ts +8 -0
  38. package/helpers/assertRateConfirmationMatchesIntent.js +2 -0
  39. package/helpers/assertRateConfirmationMatchesIntent.mjs +20 -0
  40. package/helpers/base64Utils.js +1 -31
  41. package/helpers/base64Utils.mjs +14 -24
  42. package/helpers/decodeLoginToken.js +1 -27
  43. package/helpers/decodeLoginToken.mjs +13 -18
  44. package/helpers/decodeToken.js +1 -39
  45. package/helpers/decodeToken.mjs +20 -31
  46. package/helpers/getApiURL.js +1 -7
  47. package/helpers/getApiURL.mjs +3 -5
  48. package/helpers/getBridgeURL.js +1 -7
  49. package/helpers/getBridgeURL.mjs +3 -5
  50. package/helpers/getDisplayName.js +1 -11
  51. package/helpers/getDisplayName.mjs +3 -8
  52. package/helpers/getMvxApiURL.js +1 -7
  53. package/helpers/getMvxApiURL.mjs +3 -5
  54. package/helpers/getMvxChainId.js +1 -7
  55. package/helpers/getMvxChainId.mjs +3 -5
  56. package/helpers/getMvxExplorerAddress.js +1 -7
  57. package/helpers/getMvxExplorerAddress.mjs +3 -5
  58. package/helpers/index.d.ts +2 -0
  59. package/helpers/index.js +1 -22
  60. package/helpers/index.mjs +24 -20
  61. package/helpers/safeImageUrl.d.ts +1 -0
  62. package/helpers/safeImageUrl.js +2 -0
  63. package/helpers/safeImageUrl.mjs +13 -0
  64. package/helpers/serializeTransaction.js +1 -8
  65. package/helpers/serializeTransaction.mjs +3 -5
  66. package/helpers/tests/assertRateConfirmationMatchesIntent.spec.d.ts +1 -0
  67. package/helpers/tests/assertRateConfirmationMatchesIntent.spec.js +2 -0
  68. package/helpers/tests/assertRateConfirmationMatchesIntent.spec.mjs +52 -0
  69. package/helpers/tests/base64Utils.spec.js +1 -29
  70. package/helpers/tests/base64Utils.spec.mjs +11 -24
  71. package/helpers/tests/decodeLoginToken.spec.js +1 -34
  72. package/helpers/tests/decodeLoginToken.spec.mjs +13 -24
  73. package/helpers/tests/decodeToken.spec.js +1 -27
  74. package/helpers/tests/decodeToken.spec.mjs +7 -12
  75. package/helpers/tests/safeImageUrl.spec.d.ts +1 -0
  76. package/helpers/tests/safeImageUrl.spec.js +2 -0
  77. package/helpers/tests/safeImageUrl.spec.mjs +32 -0
  78. package/helpers/tests/serializeTransaction.spec.d.ts +1 -0
  79. package/helpers/tests/serializeTransaction.spec.js +2 -0
  80. package/helpers/tests/serializeTransaction.spec.mjs +24 -0
  81. package/index.js +1 -228
  82. package/index.mjs +196 -192
  83. package/package.json +14 -9
  84. package/react.esm-B0AMOHxa.js +73 -0
  85. package/react.esm-BxvJJ86Q.mjs +9949 -0
  86. package/reactjs/adapters/SuiAdapter.d.ts +14 -0
  87. package/reactjs/adapters/SuiAdapter.js +1 -349
  88. package/reactjs/adapters/SuiAdapter.mjs +171 -199
  89. package/reactjs/components/AccountAddress/AccountAddress.js +1 -31
  90. package/reactjs/components/AccountAddress/AccountAddress.mjs +16 -16
  91. package/reactjs/components/AccountAddress/index.js +1 -4
  92. package/reactjs/components/AccountAddress/index.mjs +2 -2
  93. package/reactjs/components/AmountCard/AmountCard.js +1 -33
  94. package/reactjs/components/AmountCard/AmountCard.mjs +19 -21
  95. package/reactjs/components/AmountCard/index.js +1 -4
  96. package/reactjs/components/AmountCard/index.mjs +2 -2
  97. package/reactjs/components/AmountInput/AmountInput.js +1 -71
  98. package/reactjs/components/AmountInput/AmountInput.mjs +42 -46
  99. package/reactjs/components/AmountInput/index.js +1 -4
  100. package/reactjs/components/AmountInput/index.mjs +2 -2
  101. package/reactjs/components/BridgeForm/BridgeForm.d.ts +9 -0
  102. package/reactjs/components/BridgeForm/BridgeForm.js +1 -89
  103. package/reactjs/components/BridgeForm/BridgeForm.mjs +72 -79
  104. package/reactjs/components/BridgeForm/Deposit.js +1 -673
  105. package/reactjs/components/BridgeForm/Deposit.mjs +381 -503
  106. package/reactjs/components/BridgeForm/Transfer.js +1 -559
  107. package/reactjs/components/BridgeForm/Transfer.mjs +316 -427
  108. package/reactjs/components/BridgeForm/hooks/useBridgeAmounts.js +1 -78
  109. package/reactjs/components/BridgeForm/hooks/useBridgeAmounts.mjs +47 -70
  110. package/reactjs/components/BridgeForm/hooks/useBridgeRateFetching.js +1 -58
  111. package/reactjs/components/BridgeForm/hooks/useBridgeRateFetching.mjs +36 -47
  112. package/reactjs/components/BridgeForm/hooks/useBridgeTokenSelection.js +1 -266
  113. package/reactjs/components/BridgeForm/hooks/useBridgeTokenSelection.mjs +163 -231
  114. package/reactjs/components/BridgeForm/index.js +1 -4
  115. package/reactjs/components/BridgeForm/index.mjs +2 -2
  116. package/reactjs/components/BridgeForm/utils/bridgeFormHelpers.js +1 -76
  117. package/reactjs/components/BridgeForm/utils/bridgeFormHelpers.mjs +35 -65
  118. package/reactjs/components/BridgeHistory/BridgeHistory.js +1 -367
  119. package/reactjs/components/BridgeHistory/BridgeHistory.mjs +177 -193
  120. package/reactjs/components/BridgeHistory/index.js +1 -4
  121. package/reactjs/components/BridgeHistory/index.mjs +2 -2
  122. package/reactjs/components/Connect/BridgeAccountDisplay.js +1 -150
  123. package/reactjs/components/Connect/BridgeAccountDisplay.mjs +99 -115
  124. package/reactjs/components/Connect/BridgeConnectButton.js +1 -34
  125. package/reactjs/components/Connect/BridgeConnectButton.mjs +20 -19
  126. package/reactjs/components/Connect/ChainSelectConnect.js +1 -144
  127. package/reactjs/components/Connect/ChainSelectConnect.mjs +70 -83
  128. package/reactjs/components/Connect/CustomConnectButton.js +1 -40
  129. package/reactjs/components/Connect/CustomConnectButton.mjs +24 -30
  130. package/reactjs/components/Connect/MvxAccountDisplay.js +1 -97
  131. package/reactjs/components/Connect/MvxAccountDisplay.mjs +47 -50
  132. package/reactjs/components/Connect/MvxConnectButton.js +1 -43
  133. package/reactjs/components/Connect/MvxConnectButton.mjs +35 -40
  134. package/reactjs/components/Connect/SwitchChainButton.js +1 -29
  135. package/reactjs/components/Connect/SwitchChainButton.mjs +15 -18
  136. package/reactjs/components/Connect/index.js +1 -16
  137. package/reactjs/components/Connect/index.mjs +14 -14
  138. package/reactjs/components/CopyButton/CopyButton.js +1 -46
  139. package/reactjs/components/CopyButton/CopyButton.mjs +33 -36
  140. package/reactjs/components/CopyButton/index.js +1 -4
  141. package/reactjs/components/CopyButton/index.mjs +2 -2
  142. package/reactjs/components/CopyButton/utils/copyToClipboard.js +1 -38
  143. package/reactjs/components/CopyButton/utils/copyToClipboard.mjs +20 -32
  144. package/reactjs/components/CopyButton/utils/index.js +1 -4
  145. package/reactjs/components/CopyButton/utils/index.mjs +2 -2
  146. package/reactjs/components/DisplayAmount/DisplayAmount.js +1 -90
  147. package/reactjs/components/DisplayAmount/DisplayAmount.mjs +68 -75
  148. package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.js +1 -39
  149. package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.mjs +26 -33
  150. package/reactjs/components/DisplayAmount/components/PrecisedAmount/PrecisedAmount.js +1 -61
  151. package/reactjs/components/DisplayAmount/components/PrecisedAmount/PrecisedAmount.mjs +38 -46
  152. package/reactjs/components/DisplayAmount/index.js +1 -4
  153. package/reactjs/components/DisplayAmount/index.mjs +2 -2
  154. package/reactjs/components/DisplayAmount/utils/index.js +1 -4
  155. package/reactjs/components/DisplayAmount/utils/index.mjs +2 -2
  156. package/reactjs/components/DisplayAmount/utils/truncateAmount.js +1 -21
  157. package/reactjs/components/DisplayAmount/utils/truncateAmount.mjs +9 -13
  158. package/reactjs/components/Error/Error.js +1 -66
  159. package/reactjs/components/Error/Error.mjs +29 -29
  160. package/reactjs/components/Error/index.js +1 -4
  161. package/reactjs/components/Error/index.mjs +2 -2
  162. package/reactjs/components/SmallLoader/SmallLoader.js +1 -21
  163. package/reactjs/components/SmallLoader/SmallLoader.mjs +13 -18
  164. package/reactjs/components/SmallLoader/index.js +1 -4
  165. package/reactjs/components/SmallLoader/index.mjs +2 -2
  166. package/reactjs/components/ToggleDirection/ToggleDirection.js +1 -30
  167. package/reactjs/components/ToggleDirection/ToggleDirection.mjs +22 -28
  168. package/reactjs/components/TokenSelector/TokenSelector.js +1 -172
  169. package/reactjs/components/TokenSelector/TokenSelector.mjs +98 -118
  170. package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.js +1 -94
  171. package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.mjs +48 -57
  172. package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.js +1 -51
  173. package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.mjs +45 -44
  174. package/reactjs/components/TokenSelector/components/ChainSelect/components/FormatChainOptionLabel.js +1 -18
  175. package/reactjs/components/TokenSelector/components/ChainSelect/components/FormatChainOptionLabel.mjs +9 -14
  176. package/reactjs/components/TokenSelector/components/ChainSelect/components/IndicatorSeparator.js +1 -6
  177. package/reactjs/components/TokenSelector/components/ChainSelect/components/IndicatorSeparator.mjs +2 -4
  178. package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.js +1 -39
  179. package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.mjs +22 -18
  180. package/reactjs/components/TokenSelector/components/SelectContainer.js +1 -40
  181. package/reactjs/components/TokenSelector/components/SelectContainer.mjs +36 -38
  182. package/reactjs/components/TokenSelector/components/SelectContent.js +1 -136
  183. package/reactjs/components/TokenSelector/components/SelectContent.mjs +79 -103
  184. package/reactjs/components/TokenSelector/components/SelectedOption.js +1 -28
  185. package/reactjs/components/TokenSelector/components/SelectedOption.mjs +22 -24
  186. package/reactjs/components/TokenSelector/components/TokenIcon.js +1 -81
  187. package/reactjs/components/TokenSelector/components/TokenIcon.mjs +52 -57
  188. package/reactjs/components/TokenSelector/components/TokenItem.js +1 -80
  189. package/reactjs/components/TokenSelector/components/TokenItem.mjs +41 -54
  190. package/reactjs/components/TokenSelector/components/TokenList.js +1 -23
  191. package/reactjs/components/TokenSelector/components/TokenList.mjs +19 -21
  192. package/reactjs/components/TokenSelector/components/TokenSymbol.js +1 -25
  193. package/reactjs/components/TokenSelector/components/TokenSymbol.mjs +14 -15
  194. package/reactjs/components/TokenSelector/index.js +1 -4
  195. package/reactjs/components/TokenSelector/index.mjs +2 -2
  196. package/reactjs/components/TransactionToast/TransactionToast.js +1 -53
  197. package/reactjs/components/TransactionToast/TransactionToast.mjs +27 -28
  198. package/reactjs/components/TransactionToast/TransactionToastContainer.js +1 -20
  199. package/reactjs/components/TransactionToast/TransactionToastContainer.mjs +16 -18
  200. package/reactjs/components/TransactionToast/index.js +1 -6
  201. package/reactjs/components/TransactionToast/index.mjs +4 -4
  202. package/reactjs/components/TrimAddress/TrimAddress.js +1 -27
  203. package/reactjs/components/TrimAddress/TrimAddress.mjs +19 -24
  204. package/reactjs/components/TrimAddress/index.js +1 -4
  205. package/reactjs/components/TrimAddress/index.mjs +2 -2
  206. package/reactjs/components/base/MxButton/MxButton.js +1 -71
  207. package/reactjs/components/base/MxButton/MxButton.mjs +46 -46
  208. package/reactjs/components/base/MxButton/index.js +1 -4
  209. package/reactjs/components/base/MxButton/index.mjs +2 -2
  210. package/reactjs/components/base/MxCard/MxCard.js +1 -54
  211. package/reactjs/components/base/MxCard/MxCard.mjs +34 -34
  212. package/reactjs/components/base/MxCard/index.js +1 -4
  213. package/reactjs/components/base/MxCard/index.mjs +2 -2
  214. package/reactjs/components/base/MxCircleLoader/MxCircleLoader.js +1 -28
  215. package/reactjs/components/base/MxCircleLoader/MxCircleLoader.mjs +24 -26
  216. package/reactjs/components/base/MxCircleLoader/index.js +1 -4
  217. package/reactjs/components/base/MxCircleLoader/index.mjs +2 -2
  218. package/reactjs/components/base/MxLink/MxLink.js +1 -70
  219. package/reactjs/components/base/MxLink/MxLink.mjs +44 -46
  220. package/reactjs/components/base/MxLink/index.js +1 -4
  221. package/reactjs/components/base/MxLink/index.mjs +2 -2
  222. package/reactjs/components/base/MxSearch/MxSearch.js +1 -69
  223. package/reactjs/components/base/MxSearch/MxSearch.mjs +37 -41
  224. package/reactjs/components/base/MxSearch/index.js +1 -4
  225. package/reactjs/components/base/MxSearch/index.mjs +2 -2
  226. package/reactjs/components/base/MxSlideover/MxSlideover.js +1 -78
  227. package/reactjs/components/base/MxSlideover/MxSlideover.mjs +72 -74
  228. package/reactjs/components/base/MxSlideover/index.js +1 -4
  229. package/reactjs/components/base/MxSlideover/index.mjs +2 -2
  230. package/reactjs/components/base/MxTooltip/MxTooltip.js +1 -163
  231. package/reactjs/components/base/MxTooltip/MxTooltip.mjs +92 -135
  232. package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.js +1 -33
  233. package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.mjs +29 -31
  234. package/reactjs/components/base/MxTooltip/components/TooltipContainer/index.js +1 -4
  235. package/reactjs/components/base/MxTooltip/components/TooltipContainer/index.mjs +2 -2
  236. package/reactjs/components/base/MxTooltip/components/TooltipContent/TooltipContent.js +1 -27
  237. package/reactjs/components/base/MxTooltip/components/TooltipContent/TooltipContent.mjs +23 -25
  238. package/reactjs/components/base/MxTooltip/components/TooltipContent/index.js +1 -4
  239. package/reactjs/components/base/MxTooltip/components/TooltipContent/index.mjs +2 -2
  240. package/reactjs/components/base/MxTooltip/components/index.js +1 -6
  241. package/reactjs/components/base/MxTooltip/components/index.mjs +4 -4
  242. package/reactjs/components/base/MxTooltip/index.js +1 -4
  243. package/reactjs/components/base/MxTooltip/index.mjs +2 -2
  244. package/reactjs/components/base/index.js +1 -14
  245. package/reactjs/components/base/index.mjs +12 -12
  246. package/reactjs/components/index.js +1 -54
  247. package/reactjs/components/index.mjs +52 -52
  248. package/reactjs/constants/chains.js +1 -54
  249. package/reactjs/constants/chains.mjs +33 -52
  250. package/reactjs/constants/index.js +1 -13
  251. package/reactjs/constants/index.mjs +9 -10
  252. package/reactjs/context/Web3AppProvider.js +1 -40
  253. package/reactjs/context/Web3AppProvider.mjs +34 -34
  254. package/reactjs/context/queryClient.js +1 -11
  255. package/reactjs/context/queryClient.mjs +5 -8
  256. package/reactjs/context/useWeb3App.js +1 -12
  257. package/reactjs/context/useWeb3App.mjs +7 -8
  258. package/reactjs/helpers/index.js +1 -6
  259. package/reactjs/helpers/index.mjs +4 -4
  260. package/reactjs/helpers/resolveBridgeApiChainId.js +1 -40
  261. package/reactjs/helpers/resolveBridgeApiChainId.mjs +21 -34
  262. package/reactjs/hooks/index.js +1 -35
  263. package/reactjs/hooks/index.mjs +33 -33
  264. package/reactjs/hooks/tests/useGenericSignMessage.spec.d.ts +1 -0
  265. package/reactjs/hooks/tests/useGenericSignMessage.spec.js +2 -0
  266. package/reactjs/hooks/tests/useGenericSignMessage.spec.mjs +52 -0
  267. package/reactjs/hooks/tests/useSignTransaction.spec.d.ts +1 -0
  268. package/reactjs/hooks/tests/useSignTransaction.spec.js +2 -0
  269. package/reactjs/hooks/tests/useSignTransaction.spec.mjs +156 -0
  270. package/reactjs/hooks/useAccount.js +1 -13
  271. package/reactjs/hooks/useAccount.mjs +7 -8
  272. package/reactjs/hooks/useBalances.js +1 -53
  273. package/reactjs/hooks/useBalances.mjs +28 -40
  274. package/reactjs/hooks/useBridgeApiChainId.js +1 -13
  275. package/reactjs/hooks/useBridgeApiChainId.mjs +9 -9
  276. package/reactjs/hooks/useBridgeFormik.js +1 -162
  277. package/reactjs/hooks/useBridgeFormik.mjs +110 -150
  278. package/reactjs/hooks/useDebounce.js +1 -13
  279. package/reactjs/hooks/useDebounce.mjs +8 -10
  280. package/reactjs/hooks/useFetchBridgeData.js +1 -45
  281. package/reactjs/hooks/useFetchBridgeData.mjs +37 -38
  282. package/reactjs/hooks/useFetchTokens.js +1 -113
  283. package/reactjs/hooks/useFetchTokens.mjs +80 -106
  284. package/reactjs/hooks/useGenericSignMessage.js +1 -55
  285. package/reactjs/hooks/useGenericSignMessage.mjs +47 -47
  286. package/reactjs/hooks/useGetChainId.js +1 -11
  287. package/reactjs/hooks/useGetChainId.mjs +7 -8
  288. package/reactjs/hooks/useResolveTokenChain.js +1 -20
  289. package/reactjs/hooks/useResolveTokenChain.mjs +11 -14
  290. package/reactjs/hooks/useSendTransactions.js +1 -25
  291. package/reactjs/hooks/useSendTransactions.mjs +19 -23
  292. package/reactjs/hooks/useSignTransaction.js +1 -86
  293. package/reactjs/hooks/useSignTransaction.mjs +59 -59
  294. package/reactjs/hooks/useSuiConnect.js +1 -86
  295. package/reactjs/hooks/useSuiConnect.mjs +52 -70
  296. package/reactjs/hooks/validation/index.js +1 -10
  297. package/reactjs/hooks/validation/index.mjs +8 -8
  298. package/reactjs/hooks/validation/useAmountSchema.js +1 -32
  299. package/reactjs/hooks/validation/useAmountSchema.mjs +8 -11
  300. package/reactjs/hooks/validation/useSecondAmountSchema.js +1 -26
  301. package/reactjs/hooks/validation/useSecondAmountSchema.mjs +5 -6
  302. package/reactjs/hooks/validation/useTestHasEnoughFunds.js +1 -37
  303. package/reactjs/hooks/validation/useTestHasEnoughFunds.mjs +20 -29
  304. package/reactjs/hooks/validation/useTestIsConnected.js +1 -27
  305. package/reactjs/hooks/validation/useTestIsConnected.mjs +13 -19
  306. package/reactjs/index.js +1 -190
  307. package/reactjs/index.mjs +154 -154
  308. package/reactjs/init/index.js +1 -5
  309. package/reactjs/init/index.mjs +3 -3
  310. package/reactjs/init/init.d.ts +1 -0
  311. package/reactjs/init/init.js +1 -139
  312. package/reactjs/init/init.mjs +59 -72
  313. package/reactjs/queries/index.js +1 -17
  314. package/reactjs/queries/index.mjs +15 -15
  315. package/reactjs/queries/useCheckAccount.query.js +1 -39
  316. package/reactjs/queries/useCheckAccount.query.mjs +29 -33
  317. package/reactjs/queries/useGetAllTokens.query.js +1 -35
  318. package/reactjs/queries/useGetAllTokens.query.mjs +26 -30
  319. package/reactjs/queries/useGetChains.query.js +1 -34
  320. package/reactjs/queries/useGetChains.query.mjs +26 -28
  321. package/reactjs/queries/useGetHistory.query.d.ts +1 -1
  322. package/reactjs/queries/useGetHistory.query.js +1 -68
  323. package/reactjs/queries/useGetHistory.query.mjs +55 -58
  324. package/reactjs/queries/useGetMvxTokensBalances.query.d.ts +1 -1
  325. package/reactjs/queries/useGetMvxTokensBalances.query.js +1 -71
  326. package/reactjs/queries/useGetMvxTokensBalances.query.mjs +40 -53
  327. package/reactjs/queries/useGetNonMvxTokensBalances.query.d.ts +1 -1
  328. package/reactjs/queries/useGetNonMvxTokensBalances.query.js +1 -81
  329. package/reactjs/queries/useGetNonMvxTokensBalances.query.mjs +51 -59
  330. package/reactjs/queries/useGetRate.mutation.js +1 -18
  331. package/reactjs/queries/useGetRate.mutation.mjs +12 -15
  332. package/reactjs/reexports.js +1 -48
  333. package/reactjs/reexports.mjs +13 -13
  334. package/reactjs/utils/delay.js +1 -6
  335. package/reactjs/utils/delay.mjs +3 -3
  336. package/reactjs/utils/formatAmount.js +1 -23
  337. package/reactjs/utils/formatAmount.mjs +16 -17
  338. package/reactjs/utils/getCleanStringAmount.js +1 -11
  339. package/reactjs/utils/getCleanStringAmount.mjs +6 -8
  340. package/reactjs/utils/getCompletePathname.js +1 -5
  341. package/reactjs/utils/getCompletePathname.mjs +3 -3
  342. package/reactjs/utils/getInitialTokens.js +1 -12
  343. package/reactjs/utils/getInitialTokens.mjs +6 -7
  344. package/reactjs/utils/hasEnoughFunds.js +1 -19
  345. package/reactjs/utils/hasEnoughFunds.mjs +11 -14
  346. package/reactjs/utils/index.js +1 -26
  347. package/reactjs/utils/index.mjs +24 -24
  348. package/reactjs/utils/isStringFloat.js +1 -21
  349. package/reactjs/utils/isStringFloat.mjs +11 -18
  350. package/reactjs/utils/mxClsx.js +1 -8
  351. package/reactjs/utils/mxClsx.mjs +4 -6
  352. package/reactjs/utils/pipe.js +1 -25
  353. package/reactjs/utils/pipe.mjs +13 -17
  354. package/reactjs/utils/removeCommas.js +1 -6
  355. package/reactjs/utils/removeCommas.mjs +2 -4
  356. package/reactjs/utils/roundAmount.js +1 -40
  357. package/reactjs/utils/roundAmount.mjs +16 -36
  358. package/reactjs/utils/testNumber.js +1 -4
  359. package/reactjs/utils/testNumber.mjs +2 -2
  360. package/store/inMemoryStore.js +1 -39
  361. package/store/inMemoryStore.mjs +17 -21
  362. package/style.css +1 -2274
  363. package/types/chainType.js +1 -11
  364. package/types/chainType.mjs +2 -9
  365. package/types/errors.d.ts +3 -0
  366. package/types/errors.js +2 -0
  367. package/types/errors.mjs +8 -0
  368. package/types/providerType.js +1 -9
  369. package/types/providerType.mjs +2 -7
  370. package/types/transaction.d.ts +2 -0
  371. package/all-networks-EJIVYZ_i.mjs +0 -4
  372. package/all-networks-NYACMyeN.js +0 -4
  373. package/default-BYtXv70Z.mjs +0 -4
  374. package/default-H3AbmzFV.js +0 -4
  375. package/reactjs/hooks/useSignTransaction.d.ts +0 -511
@@ -1,5 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";
3
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
- const reactjs_components_CopyButton_utils_copyToClipboard = require("./copyToClipboard.js");
5
- exports.copyTextToClipboard = reactjs_components_CopyButton_utils_copyToClipboard.copyTextToClipboard;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./copyToClipboard.js");exports.copyTextToClipboard=o.copyTextToClipboard;
@@ -1,4 +1,4 @@
1
- import { copyTextToClipboard } from "./copyToClipboard.mjs";
1
+ import { copyTextToClipboard as r } from "./copyToClipboard.mjs";
2
2
  export {
3
- copyTextToClipboard
3
+ r as copyTextToClipboard
4
4
  };
@@ -1,91 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";
3
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
- const jsxRuntime = require("react/jsx-runtime");
5
- const BigNumber = require("bignumber.js");
6
- const isString = require("lodash/isString");
7
- const reactjs_components_DisplayAmount_components_AnimateNumber_AnimateNumber = require("./components/AnimateNumber/AnimateNumber.js");
8
- const reactjs_components_DisplayAmount_components_PrecisedAmount_PrecisedAmount = require("./components/PrecisedAmount/PrecisedAmount.js");
9
- const reactjs_components_DisplayAmount_utils_truncateAmount = require("./utils/truncateAmount.js");
10
- const reactjs_utils_formatAmount = require("../../utils/formatAmount.js");
11
- const reactjs_utils_getCleanStringAmount = require("../../utils/getCleanStringAmount.js");
12
- const reactjs_utils_isStringFloat = require("../../utils/isStringFloat.js");
13
- const reactjs_utils_mxClsx = require("../../utils/mxClsx.js");
14
- const reactjs_utils_roundAmount = require("../../utils/roundAmount.js");
15
- const reactjs_components_base_MxTooltip_MxTooltip = require("../base/MxTooltip/MxTooltip.js");
16
- const DisplayAmount = ({
17
- amount,
18
- decimals,
19
- sufix = "",
20
- prefix = "",
21
- className = "",
22
- tooltipThreshold = 0,
23
- shouldAnimate = false,
24
- shouldTruncate = false,
25
- shouldBePrecised = true,
26
- tooltipPlacement = "top",
27
- showLastNonZeroDecimal = true,
28
- digits = 4,
29
- shouldShowTooltip = true,
30
- ...rest
31
- }) => {
32
- const stringAmount = isString(amount) ? reactjs_utils_getCleanStringAmount.getCleanStringAmount(amount).amountWithoutCommas : String(amount);
33
- const isValidStringAmount = reactjs_utils_isStringFloat.isStringFloat(stringAmount);
34
- const isZero = new BigNumber(
35
- isValidStringAmount ? stringAmount : "0"
36
- ).isEqualTo(0);
37
- if (!isValidStringAmount || isZero) {
38
- return /* @__PURE__ */ jsxRuntime.jsxs("span", { ...rest, className: reactjs_utils_mxClsx.mxClsx(className), children: [
39
- prefix,
40
- amount,
41
- sufix
42
- ] });
43
- }
44
- const formattedAmount = decimals ? reactjs_utils_formatAmount.formatAmount({
45
- digits,
46
- decimals,
47
- addCommas: true,
48
- amount: stringAmount,
49
- showLastNonZeroDecimal
50
- }) : reactjs_utils_roundAmount.roundAmount(stringAmount, digits, true);
51
- const bnAmount = new BigNumber(formattedAmount);
52
- const bnTooltipThreshold = new BigNumber(tooltipThreshold);
53
- const tooltipThresholdReached = bnAmount.isLessThan(bnTooltipThreshold);
54
- if (shouldBePrecised && new BigNumber(formattedAmount).isLessThan(1)) {
55
- return /* @__PURE__ */ jsxRuntime.jsx(
56
- reactjs_components_DisplayAmount_components_PrecisedAmount_PrecisedAmount.PrecisedAmount,
57
- {
58
- ...rest,
59
- sufix,
60
- prefix,
61
- digits,
62
- className,
63
- amount: formattedAmount,
64
- shouldShowTooltip
65
- }
66
- );
67
- }
68
- if (tooltipThresholdReached) {
69
- const prefixWhenTooltip = prefix.includes("<") ? prefix : "< ";
70
- return /* @__PURE__ */ jsxRuntime.jsx(
71
- reactjs_components_base_MxTooltip_MxTooltip.MxTooltip,
72
- {
73
- placement: tooltipPlacement,
74
- buttonText: /* @__PURE__ */ jsxRuntime.jsxs("span", { ...rest, className: reactjs_utils_mxClsx.mxClsx("liq-max-w-fit", className), children: [
75
- prefixWhenTooltip,
76
- tooltipThreshold,
77
- sufix
78
- ] }),
79
- hideTooltip: !shouldShowTooltip,
80
- children: formattedAmount
81
- }
82
- );
83
- }
84
- const truncatedAmount = shouldTruncate ? reactjs_components_DisplayAmount_utils_truncateAmount.truncateAmount(formattedAmount) : formattedAmount;
85
- return /* @__PURE__ */ jsxRuntime.jsxs("span", { ...rest, className: reactjs_utils_mxClsx.mxClsx(className), children: [
86
- prefix,
87
- shouldAnimate && !shouldTruncate ? /* @__PURE__ */ jsxRuntime.jsx(reactjs_components_DisplayAmount_components_AnimateNumber_AnimateNumber.AnimateNumber, { ...rest, amount: formattedAmount }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: truncatedAmount }),
88
- sufix
89
- ] });
90
- };
91
- exports.DisplayAmount = DisplayAmount;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),c=require("bignumber.js"),D=require("lodash/isString"),f=require("./components/AnimateNumber/AnimateNumber.js"),w=require("./components/PrecisedAmount/PrecisedAmount.js"),M=require("./utils/truncateAmount.js"),N=require("../../utils/formatAmount.js"),P=require("../../utils/getCleanStringAmount.js"),F=require("../../utils/isStringFloat.js"),a=require("../../utils/mxClsx.js"),v=require("../../utils/roundAmount.js"),L=require("../base/MxTooltip/MxTooltip.js"),R=({amount:s,decimals:l,sufix:r="",prefix:e="",className:u="",tooltipThreshold:_=0,shouldAnimate:d=!1,shouldTruncate:A=!1,shouldBePrecised:x=!0,tooltipPlacement:q="top",showLastNonZeroDecimal:g=!0,digits:m=4,shouldShowTooltip:p=!0,...o})=>{const i=D(s)?P.getCleanStringAmount(s).amountWithoutCommas:String(s),j=F.isStringFloat(i),b=new c(j?i:"0").isEqualTo(0);if(!j||b)return t.jsxs("span",{...o,className:a.mxClsx(u),children:[e,s,r]});const n=l?N.formatAmount({digits:m,decimals:l,addCommas:!0,amount:i,showLastNonZeroDecimal:g}):v.roundAmount(i,m,!0),h=new c(n),T=new c(_),C=h.isLessThan(T);if(x&&new c(n).isLessThan(1))return t.jsx(w.PrecisedAmount,{...o,sufix:r,prefix:e,digits:m,className:u,amount:n,shouldShowTooltip:p});if(C){const y=e.includes("<")?e:"< ";return t.jsx(L.MxTooltip,{placement:q,buttonText:t.jsxs("span",{...o,className:a.mxClsx("liq-max-w-fit",u),children:[y,_,r]}),hideTooltip:!p,children:n})}const S=A?M.truncateAmount(n):n;return t.jsxs("span",{...o,className:a.mxClsx(u),children:[e,d&&!A?t.jsx(f.AnimateNumber,{...o,amount:n}):t.jsx(t.Fragment,{children:S}),r]})};exports.DisplayAmount=R;
@@ -1,90 +1,83 @@
1
- import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
- import BigNumber from "bignumber.js";
3
- import isString from "lodash/isString";
4
- import { AnimateNumber } from "./components/AnimateNumber/AnimateNumber.mjs";
5
- import { PrecisedAmount } from "./components/PrecisedAmount/PrecisedAmount.mjs";
6
- import { truncateAmount } from "./utils/truncateAmount.mjs";
7
- import { formatAmount } from "../../utils/formatAmount.mjs";
8
- import { getCleanStringAmount } from "../../utils/getCleanStringAmount.mjs";
9
- import { isStringFloat } from "../../utils/isStringFloat.mjs";
10
- import { mxClsx } from "../../utils/mxClsx.mjs";
11
- import { roundAmount } from "../../utils/roundAmount.mjs";
12
- import { MxTooltip } from "../base/MxTooltip/MxTooltip.mjs";
13
- const DisplayAmount = ({
14
- amount,
15
- decimals,
16
- sufix = "",
17
- prefix = "",
18
- className = "",
19
- tooltipThreshold = 0,
20
- shouldAnimate = false,
21
- shouldTruncate = false,
22
- shouldBePrecised = true,
23
- tooltipPlacement = "top",
24
- showLastNonZeroDecimal = true,
25
- digits = 4,
26
- shouldShowTooltip = true,
27
- ...rest
1
+ import { jsxs as c, jsx as s, Fragment as L } from "react/jsx-runtime";
2
+ import u from "bignumber.js";
3
+ import N from "lodash/isString";
4
+ import { AnimateNumber as W } from "./components/AnimateNumber/AnimateNumber.mjs";
5
+ import { PrecisedAmount as y } from "./components/PrecisedAmount/PrecisedAmount.mjs";
6
+ import { truncateAmount as B } from "./utils/truncateAmount.mjs";
7
+ import { formatAmount as D } from "../../utils/formatAmount.mjs";
8
+ import { getCleanStringAmount as E } from "../../utils/getCleanStringAmount.mjs";
9
+ import { isStringFloat as M } from "../../utils/isStringFloat.mjs";
10
+ import { mxClsx as p } from "../../utils/mxClsx.mjs";
11
+ import { roundAmount as P } from "../../utils/roundAmount.mjs";
12
+ import { MxTooltip as R } from "../base/MxTooltip/MxTooltip.mjs";
13
+ const U = ({
14
+ amount: r,
15
+ decimals: l,
16
+ sufix: m = "",
17
+ prefix: o = "",
18
+ className: e = "",
19
+ tooltipThreshold: f = 0,
20
+ shouldAnimate: g = !1,
21
+ shouldTruncate: A = !1,
22
+ shouldBePrecised: T = !0,
23
+ tooltipPlacement: b = "top",
24
+ showLastNonZeroDecimal: w = !0,
25
+ digits: a = 4,
26
+ shouldShowTooltip: d = !0,
27
+ ...n
28
28
  }) => {
29
- const stringAmount = isString(amount) ? getCleanStringAmount(amount).amountWithoutCommas : String(amount);
30
- const isValidStringAmount = isStringFloat(stringAmount);
31
- const isZero = new BigNumber(
32
- isValidStringAmount ? stringAmount : "0"
29
+ const i = N(r) ? E(r).amountWithoutCommas : String(r), h = M(i), C = new u(
30
+ h ? i : "0"
33
31
  ).isEqualTo(0);
34
- if (!isValidStringAmount || isZero) {
35
- return /* @__PURE__ */ jsxs("span", { ...rest, className: mxClsx(className), children: [
36
- prefix,
37
- amount,
38
- sufix
32
+ if (!h || C)
33
+ return /* @__PURE__ */ c("span", { ...n, className: p(e), children: [
34
+ o,
35
+ r,
36
+ m
39
37
  ] });
40
- }
41
- const formattedAmount = decimals ? formatAmount({
42
- digits,
43
- decimals,
44
- addCommas: true,
45
- amount: stringAmount,
46
- showLastNonZeroDecimal
47
- }) : roundAmount(stringAmount, digits, true);
48
- const bnAmount = new BigNumber(formattedAmount);
49
- const bnTooltipThreshold = new BigNumber(tooltipThreshold);
50
- const tooltipThresholdReached = bnAmount.isLessThan(bnTooltipThreshold);
51
- if (shouldBePrecised && new BigNumber(formattedAmount).isLessThan(1)) {
52
- return /* @__PURE__ */ jsx(
53
- PrecisedAmount,
38
+ const t = l ? D({
39
+ digits: a,
40
+ decimals: l,
41
+ addCommas: !0,
42
+ amount: i,
43
+ showLastNonZeroDecimal: w
44
+ }) : P(i, a, !0), S = new u(t), j = new u(f), q = S.isLessThan(j);
45
+ if (T && new u(t).isLessThan(1))
46
+ return /* @__PURE__ */ s(
47
+ y,
54
48
  {
55
- ...rest,
56
- sufix,
57
- prefix,
58
- digits,
59
- className,
60
- amount: formattedAmount,
61
- shouldShowTooltip
49
+ ...n,
50
+ sufix: m,
51
+ prefix: o,
52
+ digits: a,
53
+ className: e,
54
+ amount: t,
55
+ shouldShowTooltip: d
62
56
  }
63
57
  );
64
- }
65
- if (tooltipThresholdReached) {
66
- const prefixWhenTooltip = prefix.includes("<") ? prefix : "< ";
67
- return /* @__PURE__ */ jsx(
68
- MxTooltip,
58
+ if (q) {
59
+ const F = o.includes("<") ? o : "< ";
60
+ return /* @__PURE__ */ s(
61
+ R,
69
62
  {
70
- placement: tooltipPlacement,
71
- buttonText: /* @__PURE__ */ jsxs("span", { ...rest, className: mxClsx("liq-max-w-fit", className), children: [
72
- prefixWhenTooltip,
73
- tooltipThreshold,
74
- sufix
63
+ placement: b,
64
+ buttonText: /* @__PURE__ */ c("span", { ...n, className: p("liq-max-w-fit", e), children: [
65
+ F,
66
+ f,
67
+ m
75
68
  ] }),
76
- hideTooltip: !shouldShowTooltip,
77
- children: formattedAmount
69
+ hideTooltip: !d,
70
+ children: t
78
71
  }
79
72
  );
80
73
  }
81
- const truncatedAmount = shouldTruncate ? truncateAmount(formattedAmount) : formattedAmount;
82
- return /* @__PURE__ */ jsxs("span", { ...rest, className: mxClsx(className), children: [
83
- prefix,
84
- shouldAnimate && !shouldTruncate ? /* @__PURE__ */ jsx(AnimateNumber, { ...rest, amount: formattedAmount }) : /* @__PURE__ */ jsx(Fragment, { children: truncatedAmount }),
85
- sufix
74
+ const x = A ? B(t) : t;
75
+ return /* @__PURE__ */ c("span", { ...n, className: p(e), children: [
76
+ o,
77
+ g && !A ? /* @__PURE__ */ s(W, { ...n, amount: t }) : /* @__PURE__ */ s(L, { children: x }),
78
+ m
86
79
  ] });
87
80
  };
88
81
  export {
89
- DisplayAmount
82
+ U as DisplayAmount
90
83
  };
@@ -1,40 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";
3
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
- const jsxRuntime = require("react/jsx-runtime");
5
- const AnimatedNumber = require("animated-number-react");
6
- const React = require("react");
7
- const reactjs_utils_getCleanStringAmount = require("../../../../utils/getCleanStringAmount.js");
8
- const reactjs_utils_roundAmount = require("../../../../utils/roundAmount.js");
9
- const AnimateNumber = ({
10
- amount,
11
- onClick,
12
- ...rest
13
- }) => {
14
- const [digits, setDigits] = React.useState(0);
15
- const [updateCount, setUpdateCount] = React.useState(0);
16
- const [valueToAnimate, setValueToAnimate] = React.useState();
17
- React.useEffect(() => {
18
- const { amountWithoutCommas, parts } = reactjs_utils_getCleanStringAmount.getCleanStringAmount(amount);
19
- setUpdateCount((existing) => existing + 1);
20
- setDigits(parts.length > 1 ? parts[1].length : 0);
21
- const parsedAmount = parseFloat(amountWithoutCommas);
22
- const isScientificNotation = parsedAmount.toString().includes("e");
23
- setValueToAnimate(isScientificNotation ? void 0 : parsedAmount);
24
- }, [amount]);
25
- const formatValue = (val) => reactjs_utils_roundAmount.roundAmount(`${val}`, digits, true);
26
- if (!valueToAnimate) {
27
- return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: amount });
28
- }
29
- return /* @__PURE__ */ jsxRuntime.jsx(
30
- AnimatedNumber,
31
- {
32
- value: valueToAnimate,
33
- duration: updateCount > 1 ? 300 : 0,
34
- formatValue,
35
- onClick,
36
- ...rest
37
- }
38
- );
39
- };
40
- exports.AnimateNumber = AnimateNumber;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),f=require("animated-number-react"),t=require("react"),j=require("../../../../utils/getCleanStringAmount.js"),p=require("../../../../utils/roundAmount.js"),q=({amount:e,onClick:i,...a})=>{const[c,m]=t.useState(0),[l,d]=t.useState(0),[u,g]=t.useState();t.useEffect(()=>{const{amountWithoutCommas:n,parts:o}=j.getCleanStringAmount(e);d(b=>b+1),m(o.length>1?o[1].length:0);const r=parseFloat(n),S=r.toString().includes("e");g(S?void 0:r)},[e]);const A=n=>p.roundAmount(`${n}`,c,!0);return u?s.jsx(f,{value:u,duration:l>1?300:0,formatValue:A,onClick:i,...a}):s.jsx(s.Fragment,{children:e})};exports.AnimateNumber=q;
@@ -1,39 +1,32 @@
1
- import { jsx, Fragment } from "react/jsx-runtime";
2
- import AnimatedNumber from "animated-number-react";
3
- import { useState, useEffect } from "react";
4
- import { getCleanStringAmount } from "../../../../utils/getCleanStringAmount.mjs";
5
- import { roundAmount } from "../../../../utils/roundAmount.mjs";
6
- const AnimateNumber = ({
7
- amount,
8
- onClick,
9
- ...rest
1
+ import { jsx as m, Fragment as h } from "react/jsx-runtime";
2
+ import C from "animated-number-react";
3
+ import { useState as e, useEffect as S } from "react";
4
+ import { getCleanStringAmount as v } from "../../../../utils/getCleanStringAmount.mjs";
5
+ import { roundAmount as N } from "../../../../utils/roundAmount.mjs";
6
+ const j = ({
7
+ amount: t,
8
+ onClick: s,
9
+ ...a
10
10
  }) => {
11
- const [digits, setDigits] = useState(0);
12
- const [updateCount, setUpdateCount] = useState(0);
13
- const [valueToAnimate, setValueToAnimate] = useState();
14
- useEffect(() => {
15
- const { amountWithoutCommas, parts } = getCleanStringAmount(amount);
16
- setUpdateCount((existing) => existing + 1);
17
- setDigits(parts.length > 1 ? parts[1].length : 0);
18
- const parsedAmount = parseFloat(amountWithoutCommas);
19
- const isScientificNotation = parsedAmount.toString().includes("e");
20
- setValueToAnimate(isScientificNotation ? void 0 : parsedAmount);
21
- }, [amount]);
22
- const formatValue = (val) => roundAmount(`${val}`, digits, true);
23
- if (!valueToAnimate) {
24
- return /* @__PURE__ */ jsx(Fragment, { children: amount });
25
- }
26
- return /* @__PURE__ */ jsx(
27
- AnimatedNumber,
11
+ const [u, c] = e(0), [p, d] = e(0), [n, f] = e();
12
+ S(() => {
13
+ const { amountWithoutCommas: o, parts: r } = v(t);
14
+ d((A) => A + 1), c(r.length > 1 ? r[1].length : 0);
15
+ const i = parseFloat(o), g = i.toString().includes("e");
16
+ f(g ? void 0 : i);
17
+ }, [t]);
18
+ const l = (o) => N(`${o}`, u, !0);
19
+ return n ? /* @__PURE__ */ m(
20
+ C,
28
21
  {
29
- value: valueToAnimate,
30
- duration: updateCount > 1 ? 300 : 0,
31
- formatValue,
32
- onClick,
33
- ...rest
22
+ value: n,
23
+ duration: p > 1 ? 300 : 0,
24
+ formatValue: l,
25
+ onClick: s,
26
+ ...a
34
27
  }
35
- );
28
+ ) : /* @__PURE__ */ m(h, { children: t });
36
29
  };
37
30
  export {
38
- AnimateNumber
31
+ j as AnimateNumber
39
32
  };
@@ -1,62 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";
3
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
- const jsxRuntime = require("react/jsx-runtime");
5
- const reactjs_utils_mxClsx = require("../../../../utils/mxClsx.js");
6
- const reactjs_components_base_MxTooltip_MxTooltip = require("../../../base/MxTooltip/MxTooltip.js");
7
- const MAX_DISPLAY_ZERO_DECIMALS = 5;
8
- const PrecisedAmount = ({
9
- amount,
10
- digits,
11
- className,
12
- prefix,
13
- sufix,
14
- tooltipPlacement,
15
- shouldShowTooltip = true,
16
- ...rest
17
- }) => {
18
- var _a, _b;
19
- const valueParts = (_a = String(amount)) == null ? void 0 : _a.split(".");
20
- const decimalArray = ((_b = valueParts[1]) == null ? void 0 : _b.split("")) ?? [];
21
- const areAllDigitsZeroes = decimalArray == null ? void 0 : decimalArray.every((digit) => digit === "0");
22
- const firstNonZeroIndex = decimalArray == null ? void 0 : decimalArray.findIndex((digit) => digit !== "0");
23
- const nonZeroDecimalsArr = [];
24
- for (let i = firstNonZeroIndex; i <= (decimalArray == null ? void 0 : decimalArray.length) - 1; i++) {
25
- if (nonZeroDecimalsArr.length < Math.max(digits, 2)) {
26
- nonZeroDecimalsArr.push(decimalArray[i]);
27
- }
28
- }
29
- if (firstNonZeroIndex > MAX_DISPLAY_ZERO_DECIMALS) {
30
- const nonZeroDecimals = nonZeroDecimalsArr == null ? void 0 : nonZeroDecimalsArr.join("");
31
- return /* @__PURE__ */ jsxRuntime.jsx(
32
- reactjs_components_base_MxTooltip_MxTooltip.MxTooltip,
33
- {
34
- placement: tooltipPlacement,
35
- buttonText: /* @__PURE__ */ jsxRuntime.jsxs("span", { ...rest, className: reactjs_utils_mxClsx.mxClsx(className), children: [
36
- prefix,
37
- valueParts[0],
38
- ".0",
39
- /* @__PURE__ */ jsxRuntime.jsx("sub", { className: reactjs_utils_mxClsx.mxClsx(className, "liq-text-[60%]"), children: firstNonZeroIndex - 2 }),
40
- "0",
41
- nonZeroDecimals,
42
- sufix
43
- ] }),
44
- containerClassName: "leading-none",
45
- hideTooltip: !shouldShowTooltip,
46
- children: amount
47
- }
48
- );
49
- }
50
- const hasDecimals = valueParts[1] && !areAllDigitsZeroes;
51
- return /* @__PURE__ */ jsxRuntime.jsxs("span", { ...rest, className: reactjs_utils_mxClsx.mxClsx(className), children: [
52
- prefix,
53
- valueParts[0],
54
- hasDecimals && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
55
- ".",
56
- valueParts[1]
57
- ] }),
58
- sufix
59
- ] });
60
- };
61
- exports.MAX_DISPLAY_ZERO_DECIMALS = MAX_DISPLAY_ZERO_DECIMALS;
62
- exports.PrecisedAmount = PrecisedAmount;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),c=require("../../../../utils/mxClsx.js"),C=require("../../../base/MxTooltip/MxTooltip.js"),p=5,S=({amount:r,digits:d,className:i,prefix:x,sufix:u,tooltipPlacement:j,shouldShowTooltip:m=!0,..._})=>{var a,h;const n=(a=String(r))==null?void 0:a.split("."),e=((h=n[1])==null?void 0:h.split(""))??[],M=e==null?void 0:e.every(s=>s==="0"),l=e==null?void 0:e.findIndex(s=>s!=="0"),o=[];for(let s=l;s<=(e==null?void 0:e.length)-1;s++)o.length<Math.max(d,2)&&o.push(e[s]);if(l>p){const s=o==null?void 0:o.join("");return t.jsx(C.MxTooltip,{placement:j,buttonText:t.jsxs("span",{..._,className:c.mxClsx(i),children:[x,n[0],".0",t.jsx("sub",{className:c.mxClsx(i,"liq-text-[60%]"),children:l-2}),"0",s,u]}),containerClassName:"leading-none",hideTooltip:!m,children:r})}const g=n[1]&&!M;return t.jsxs("span",{..._,className:c.mxClsx(i),children:[x,n[0],g&&t.jsxs(t.Fragment,{children:[".",n[1]]}),u]})};exports.MAX_DISPLAY_ZERO_DECIMALS=p;exports.PrecisedAmount=S;
@@ -1,61 +1,53 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { mxClsx } from "../../../../utils/mxClsx.mjs";
3
- import { MxTooltip } from "../../../base/MxTooltip/MxTooltip.mjs";
4
- const MAX_DISPLAY_ZERO_DECIMALS = 5;
5
- const PrecisedAmount = ({
6
- amount,
7
- digits,
8
- className,
9
- prefix,
10
- sufix,
11
- tooltipPlacement,
12
- shouldShowTooltip = true,
13
- ...rest
1
+ import { jsx as d, jsxs as l, Fragment as M } from "react/jsx-runtime";
2
+ import { mxClsx as c } from "../../../../utils/mxClsx.mjs";
3
+ import { MxTooltip as j } from "../../../base/MxTooltip/MxTooltip.mjs";
4
+ const C = 5, T = ({
5
+ amount: r,
6
+ digits: f,
7
+ className: s,
8
+ prefix: h,
9
+ sufix: p,
10
+ tooltipPlacement: g,
11
+ shouldShowTooltip: u = !0,
12
+ ...x
14
13
  }) => {
15
- var _a, _b;
16
- const valueParts = (_a = String(amount)) == null ? void 0 : _a.split(".");
17
- const decimalArray = ((_b = valueParts[1]) == null ? void 0 : _b.split("")) ?? [];
18
- const areAllDigitsZeroes = decimalArray == null ? void 0 : decimalArray.every((digit) => digit === "0");
19
- const firstNonZeroIndex = decimalArray == null ? void 0 : decimalArray.findIndex((digit) => digit !== "0");
20
- const nonZeroDecimalsArr = [];
21
- for (let i = firstNonZeroIndex; i <= (decimalArray == null ? void 0 : decimalArray.length) - 1; i++) {
22
- if (nonZeroDecimalsArr.length < Math.max(digits, 2)) {
23
- nonZeroDecimalsArr.push(decimalArray[i]);
24
- }
25
- }
26
- if (firstNonZeroIndex > MAX_DISPLAY_ZERO_DECIMALS) {
27
- const nonZeroDecimals = nonZeroDecimalsArr == null ? void 0 : nonZeroDecimalsArr.join("");
28
- return /* @__PURE__ */ jsx(
29
- MxTooltip,
14
+ var m, a;
15
+ const e = (m = String(r)) == null ? void 0 : m.split("."), t = ((a = e[1]) == null ? void 0 : a.split("")) ?? [], D = t == null ? void 0 : t.every((n) => n === "0"), i = t == null ? void 0 : t.findIndex((n) => n !== "0"), o = [];
16
+ for (let n = i; n <= (t == null ? void 0 : t.length) - 1; n++)
17
+ o.length < Math.max(f, 2) && o.push(t[n]);
18
+ if (i > C) {
19
+ const n = o == null ? void 0 : o.join("");
20
+ return /* @__PURE__ */ d(
21
+ j,
30
22
  {
31
- placement: tooltipPlacement,
32
- buttonText: /* @__PURE__ */ jsxs("span", { ...rest, className: mxClsx(className), children: [
33
- prefix,
34
- valueParts[0],
23
+ placement: g,
24
+ buttonText: /* @__PURE__ */ l("span", { ...x, className: c(s), children: [
25
+ h,
26
+ e[0],
35
27
  ".0",
36
- /* @__PURE__ */ jsx("sub", { className: mxClsx(className, "liq-text-[60%]"), children: firstNonZeroIndex - 2 }),
28
+ /* @__PURE__ */ d("sub", { className: c(s, "liq-text-[60%]"), children: i - 2 }),
37
29
  "0",
38
- nonZeroDecimals,
39
- sufix
30
+ n,
31
+ p
40
32
  ] }),
41
33
  containerClassName: "leading-none",
42
- hideTooltip: !shouldShowTooltip,
43
- children: amount
34
+ hideTooltip: !u,
35
+ children: r
44
36
  }
45
37
  );
46
38
  }
47
- const hasDecimals = valueParts[1] && !areAllDigitsZeroes;
48
- return /* @__PURE__ */ jsxs("span", { ...rest, className: mxClsx(className), children: [
49
- prefix,
50
- valueParts[0],
51
- hasDecimals && /* @__PURE__ */ jsxs(Fragment, { children: [
39
+ const I = e[1] && !D;
40
+ return /* @__PURE__ */ l("span", { ...x, className: c(s), children: [
41
+ h,
42
+ e[0],
43
+ I && /* @__PURE__ */ l(M, { children: [
52
44
  ".",
53
- valueParts[1]
45
+ e[1]
54
46
  ] }),
55
- sufix
47
+ p
56
48
  ] });
57
49
  };
58
50
  export {
59
- MAX_DISPLAY_ZERO_DECIMALS,
60
- PrecisedAmount
51
+ C as MAX_DISPLAY_ZERO_DECIMALS,
52
+ T as PrecisedAmount
61
53
  };
@@ -1,5 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";
3
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
- const reactjs_components_DisplayAmount_DisplayAmount = require("./DisplayAmount.js");
5
- exports.DisplayAmount = reactjs_components_DisplayAmount_DisplayAmount.DisplayAmount;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./DisplayAmount.js");exports.DisplayAmount=e.DisplayAmount;
@@ -1,4 +1,4 @@
1
- import { DisplayAmount } from "./DisplayAmount.mjs";
1
+ import { DisplayAmount as p } from "./DisplayAmount.mjs";
2
2
  export {
3
- DisplayAmount
3
+ p as DisplayAmount
4
4
  };
@@ -1,5 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";
3
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
- const reactjs_components_DisplayAmount_utils_truncateAmount = require("./truncateAmount.js");
5
- exports.truncateAmount = reactjs_components_DisplayAmount_utils_truncateAmount.truncateAmount;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./truncateAmount.js");exports.truncateAmount=t.truncateAmount;
@@ -1,4 +1,4 @@
1
- import { truncateAmount } from "./truncateAmount.mjs";
1
+ import { truncateAmount as r } from "./truncateAmount.mjs";
2
2
  export {
3
- truncateAmount
3
+ r as truncateAmount
4
4
  };
@@ -1,22 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";
3
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
- const numeral = require("numeral");
5
- const reactjs_utils_removeCommas = require("../../../utils/removeCommas.js");
6
- const truncateAmount = (formattedAmount) => {
7
- const cleanFormattedAmount = reactjs_utils_removeCommas.removeCommas(formattedAmount);
8
- const number = Number(cleanFormattedAmount);
9
- const abbreviations = {
10
- T: 1e12,
11
- B: 1e9,
12
- M: 1e6,
13
- K: 1e3
14
- };
15
- for (const key in abbreviations) {
16
- if (Math.abs(number) >= abbreviations[key]) {
17
- return numeral(number / abbreviations[key]).format("0.[00]") + key;
18
- }
19
- }
20
- return number;
21
- };
22
- exports.truncateAmount = truncateAmount;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("numeral"),s=require("../../../utils/removeCommas.js"),a=n=>{const o=s.removeCommas(n),e=Number(o),t={T:1e12,B:1e9,M:1e6,K:1e3};for(const r in t)if(Math.abs(e)>=t[r])return u(e/t[r]).format("0.[00]")+r;return e};exports.truncateAmount=a;
@@ -1,21 +1,17 @@
1
- import numeral from "numeral";
2
- import { removeCommas } from "../../../utils/removeCommas.mjs";
3
- const truncateAmount = (formattedAmount) => {
4
- const cleanFormattedAmount = removeCommas(formattedAmount);
5
- const number = Number(cleanFormattedAmount);
6
- const abbreviations = {
1
+ import m from "numeral";
2
+ import { removeCommas as a } from "../../../utils/removeCommas.mjs";
3
+ const c = (e) => {
4
+ const n = a(e), t = Number(n), o = {
7
5
  T: 1e12,
8
6
  B: 1e9,
9
7
  M: 1e6,
10
8
  K: 1e3
11
9
  };
12
- for (const key in abbreviations) {
13
- if (Math.abs(number) >= abbreviations[key]) {
14
- return numeral(number / abbreviations[key]).format("0.[00]") + key;
15
- }
16
- }
17
- return number;
10
+ for (const r in o)
11
+ if (Math.abs(t) >= o[r])
12
+ return m(t / o[r]).format("0.[00]") + r;
13
+ return t;
18
14
  };
19
15
  export {
20
- truncateAmount
16
+ c as truncateAmount
21
17
  };