@multiversx/sdk-dapp-liquidity 2.1.0-alpha.0 → 2.1.0-alpha.2

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 (362) 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.js +1 -23
  38. package/helpers/assertRateConfirmationMatchesIntent.mjs +13 -16
  39. package/helpers/base64Utils.js +1 -31
  40. package/helpers/base64Utils.mjs +14 -24
  41. package/helpers/decodeLoginToken.js +1 -27
  42. package/helpers/decodeLoginToken.mjs +13 -18
  43. package/helpers/decodeToken.js +1 -39
  44. package/helpers/decodeToken.mjs +20 -31
  45. package/helpers/getApiURL.js +1 -7
  46. package/helpers/getApiURL.mjs +3 -5
  47. package/helpers/getBridgeURL.js +1 -7
  48. package/helpers/getBridgeURL.mjs +3 -5
  49. package/helpers/getDisplayName.js +1 -11
  50. package/helpers/getDisplayName.mjs +3 -8
  51. package/helpers/getMvxApiURL.js +1 -7
  52. package/helpers/getMvxApiURL.mjs +3 -5
  53. package/helpers/getMvxChainId.js +1 -7
  54. package/helpers/getMvxChainId.mjs +3 -5
  55. package/helpers/getMvxExplorerAddress.js +1 -7
  56. package/helpers/getMvxExplorerAddress.mjs +3 -5
  57. package/helpers/index.js +1 -26
  58. package/helpers/index.mjs +24 -24
  59. package/helpers/safeImageUrl.js +1 -23
  60. package/helpers/safeImageUrl.mjs +10 -20
  61. package/helpers/serializeTransaction.js +1 -8
  62. package/helpers/serializeTransaction.mjs +3 -5
  63. package/helpers/tests/assertRateConfirmationMatchesIntent.spec.js +1 -63
  64. package/helpers/tests/assertRateConfirmationMatchesIntent.spec.mjs +31 -41
  65. package/helpers/tests/base64Utils.spec.js +1 -29
  66. package/helpers/tests/base64Utils.spec.mjs +11 -24
  67. package/helpers/tests/decodeLoginToken.spec.js +1 -34
  68. package/helpers/tests/decodeLoginToken.spec.mjs +13 -24
  69. package/helpers/tests/decodeToken.spec.js +1 -27
  70. package/helpers/tests/decodeToken.spec.mjs +7 -12
  71. package/helpers/tests/safeImageUrl.spec.js +1 -48
  72. package/helpers/tests/safeImageUrl.spec.mjs +28 -43
  73. package/helpers/tests/serializeTransaction.spec.js +1 -36
  74. package/helpers/tests/serializeTransaction.spec.mjs +13 -24
  75. package/index.js +1 -232
  76. package/index.mjs +196 -196
  77. package/package.json +5 -4
  78. package/react.esm-B0AMOHxa.js +73 -0
  79. package/react.esm-BxvJJ86Q.mjs +9949 -0
  80. package/reactjs/adapters/SuiAdapter.js +1 -378
  81. package/reactjs/adapters/SuiAdapter.mjs +160 -217
  82. package/reactjs/components/AccountAddress/AccountAddress.js +1 -31
  83. package/reactjs/components/AccountAddress/AccountAddress.mjs +16 -16
  84. package/reactjs/components/AccountAddress/index.js +1 -4
  85. package/reactjs/components/AccountAddress/index.mjs +2 -2
  86. package/reactjs/components/AmountCard/AmountCard.js +1 -33
  87. package/reactjs/components/AmountCard/AmountCard.mjs +19 -21
  88. package/reactjs/components/AmountCard/index.js +1 -4
  89. package/reactjs/components/AmountCard/index.mjs +2 -2
  90. package/reactjs/components/AmountInput/AmountInput.js +1 -71
  91. package/reactjs/components/AmountInput/AmountInput.mjs +42 -46
  92. package/reactjs/components/AmountInput/index.js +1 -4
  93. package/reactjs/components/AmountInput/index.mjs +2 -2
  94. package/reactjs/components/BridgeForm/BridgeForm.d.ts +9 -0
  95. package/reactjs/components/BridgeForm/BridgeForm.js +1 -89
  96. package/reactjs/components/BridgeForm/BridgeForm.mjs +72 -79
  97. package/reactjs/components/BridgeForm/Deposit.js +1 -675
  98. package/reactjs/components/BridgeForm/Deposit.mjs +380 -504
  99. package/reactjs/components/BridgeForm/Transfer.js +1 -561
  100. package/reactjs/components/BridgeForm/Transfer.mjs +315 -428
  101. package/reactjs/components/BridgeForm/hooks/useBridgeAmounts.js +1 -78
  102. package/reactjs/components/BridgeForm/hooks/useBridgeAmounts.mjs +47 -70
  103. package/reactjs/components/BridgeForm/hooks/useBridgeRateFetching.js +1 -58
  104. package/reactjs/components/BridgeForm/hooks/useBridgeRateFetching.mjs +36 -47
  105. package/reactjs/components/BridgeForm/hooks/useBridgeTokenSelection.js +1 -266
  106. package/reactjs/components/BridgeForm/hooks/useBridgeTokenSelection.mjs +163 -231
  107. package/reactjs/components/BridgeForm/index.js +1 -4
  108. package/reactjs/components/BridgeForm/index.mjs +2 -2
  109. package/reactjs/components/BridgeForm/utils/bridgeFormHelpers.js +1 -76
  110. package/reactjs/components/BridgeForm/utils/bridgeFormHelpers.mjs +33 -65
  111. package/reactjs/components/BridgeHistory/BridgeHistory.js +1 -381
  112. package/reactjs/components/BridgeHistory/BridgeHistory.mjs +170 -200
  113. package/reactjs/components/BridgeHistory/index.js +1 -4
  114. package/reactjs/components/BridgeHistory/index.mjs +2 -2
  115. package/reactjs/components/Connect/BridgeAccountDisplay.js +1 -150
  116. package/reactjs/components/Connect/BridgeAccountDisplay.mjs +99 -115
  117. package/reactjs/components/Connect/BridgeConnectButton.js +1 -35
  118. package/reactjs/components/Connect/BridgeConnectButton.mjs +20 -20
  119. package/reactjs/components/Connect/ChainSelectConnect.js +1 -144
  120. package/reactjs/components/Connect/ChainSelectConnect.mjs +70 -83
  121. package/reactjs/components/Connect/CustomConnectButton.js +1 -40
  122. package/reactjs/components/Connect/CustomConnectButton.mjs +24 -30
  123. package/reactjs/components/Connect/MvxAccountDisplay.js +1 -97
  124. package/reactjs/components/Connect/MvxAccountDisplay.mjs +47 -50
  125. package/reactjs/components/Connect/MvxConnectButton.js +1 -43
  126. package/reactjs/components/Connect/MvxConnectButton.mjs +35 -40
  127. package/reactjs/components/Connect/SwitchChainButton.js +1 -29
  128. package/reactjs/components/Connect/SwitchChainButton.mjs +15 -18
  129. package/reactjs/components/Connect/index.js +1 -16
  130. package/reactjs/components/Connect/index.mjs +14 -14
  131. package/reactjs/components/CopyButton/CopyButton.js +1 -46
  132. package/reactjs/components/CopyButton/CopyButton.mjs +33 -36
  133. package/reactjs/components/CopyButton/index.js +1 -4
  134. package/reactjs/components/CopyButton/index.mjs +2 -2
  135. package/reactjs/components/CopyButton/utils/copyToClipboard.js +1 -38
  136. package/reactjs/components/CopyButton/utils/copyToClipboard.mjs +20 -32
  137. package/reactjs/components/CopyButton/utils/index.js +1 -4
  138. package/reactjs/components/CopyButton/utils/index.mjs +2 -2
  139. package/reactjs/components/DisplayAmount/DisplayAmount.js +1 -90
  140. package/reactjs/components/DisplayAmount/DisplayAmount.mjs +68 -75
  141. package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.js +1 -39
  142. package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.mjs +26 -33
  143. package/reactjs/components/DisplayAmount/components/PrecisedAmount/PrecisedAmount.js +1 -61
  144. package/reactjs/components/DisplayAmount/components/PrecisedAmount/PrecisedAmount.mjs +38 -46
  145. package/reactjs/components/DisplayAmount/index.js +1 -4
  146. package/reactjs/components/DisplayAmount/index.mjs +2 -2
  147. package/reactjs/components/DisplayAmount/utils/index.js +1 -4
  148. package/reactjs/components/DisplayAmount/utils/index.mjs +2 -2
  149. package/reactjs/components/DisplayAmount/utils/truncateAmount.js +1 -21
  150. package/reactjs/components/DisplayAmount/utils/truncateAmount.mjs +9 -13
  151. package/reactjs/components/Error/Error.js +1 -66
  152. package/reactjs/components/Error/Error.mjs +29 -29
  153. package/reactjs/components/Error/index.js +1 -4
  154. package/reactjs/components/Error/index.mjs +2 -2
  155. package/reactjs/components/SmallLoader/SmallLoader.js +1 -21
  156. package/reactjs/components/SmallLoader/SmallLoader.mjs +13 -18
  157. package/reactjs/components/SmallLoader/index.js +1 -4
  158. package/reactjs/components/SmallLoader/index.mjs +2 -2
  159. package/reactjs/components/ToggleDirection/ToggleDirection.js +1 -30
  160. package/reactjs/components/ToggleDirection/ToggleDirection.mjs +22 -28
  161. package/reactjs/components/TokenSelector/TokenSelector.js +1 -172
  162. package/reactjs/components/TokenSelector/TokenSelector.mjs +98 -118
  163. package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.js +1 -94
  164. package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.mjs +48 -57
  165. package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.js +1 -55
  166. package/reactjs/components/TokenSelector/components/ChainSelect/components/ChainOptionLabel.mjs +45 -48
  167. package/reactjs/components/TokenSelector/components/ChainSelect/components/FormatChainOptionLabel.js +1 -18
  168. package/reactjs/components/TokenSelector/components/ChainSelect/components/FormatChainOptionLabel.mjs +9 -14
  169. package/reactjs/components/TokenSelector/components/ChainSelect/components/IndicatorSeparator.js +1 -6
  170. package/reactjs/components/TokenSelector/components/ChainSelect/components/IndicatorSeparator.mjs +2 -4
  171. package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.js +1 -43
  172. package/reactjs/components/TokenSelector/components/ChainSelect/components/SelectedChainOption.mjs +21 -21
  173. package/reactjs/components/TokenSelector/components/SelectContainer.js +1 -40
  174. package/reactjs/components/TokenSelector/components/SelectContainer.mjs +36 -38
  175. package/reactjs/components/TokenSelector/components/SelectContent.js +1 -136
  176. package/reactjs/components/TokenSelector/components/SelectContent.mjs +79 -103
  177. package/reactjs/components/TokenSelector/components/SelectedOption.js +1 -28
  178. package/reactjs/components/TokenSelector/components/SelectedOption.mjs +22 -24
  179. package/reactjs/components/TokenSelector/components/TokenIcon.js +1 -82
  180. package/reactjs/components/TokenSelector/components/TokenIcon.mjs +52 -58
  181. package/reactjs/components/TokenSelector/components/TokenItem.js +1 -80
  182. package/reactjs/components/TokenSelector/components/TokenItem.mjs +41 -54
  183. package/reactjs/components/TokenSelector/components/TokenList.js +1 -23
  184. package/reactjs/components/TokenSelector/components/TokenList.mjs +19 -21
  185. package/reactjs/components/TokenSelector/components/TokenSymbol.js +1 -25
  186. package/reactjs/components/TokenSelector/components/TokenSymbol.mjs +14 -15
  187. package/reactjs/components/TokenSelector/index.js +1 -4
  188. package/reactjs/components/TokenSelector/index.mjs +2 -2
  189. package/reactjs/components/TransactionToast/TransactionToast.js +1 -53
  190. package/reactjs/components/TransactionToast/TransactionToast.mjs +27 -28
  191. package/reactjs/components/TransactionToast/TransactionToastContainer.js +1 -20
  192. package/reactjs/components/TransactionToast/TransactionToastContainer.mjs +16 -18
  193. package/reactjs/components/TransactionToast/index.js +1 -6
  194. package/reactjs/components/TransactionToast/index.mjs +4 -4
  195. package/reactjs/components/TrimAddress/TrimAddress.js +1 -27
  196. package/reactjs/components/TrimAddress/TrimAddress.mjs +19 -24
  197. package/reactjs/components/TrimAddress/index.js +1 -4
  198. package/reactjs/components/TrimAddress/index.mjs +2 -2
  199. package/reactjs/components/base/MxButton/MxButton.js +1 -71
  200. package/reactjs/components/base/MxButton/MxButton.mjs +46 -46
  201. package/reactjs/components/base/MxButton/index.js +1 -4
  202. package/reactjs/components/base/MxButton/index.mjs +2 -2
  203. package/reactjs/components/base/MxCard/MxCard.js +1 -54
  204. package/reactjs/components/base/MxCard/MxCard.mjs +34 -34
  205. package/reactjs/components/base/MxCard/index.js +1 -4
  206. package/reactjs/components/base/MxCard/index.mjs +2 -2
  207. package/reactjs/components/base/MxCircleLoader/MxCircleLoader.js +1 -28
  208. package/reactjs/components/base/MxCircleLoader/MxCircleLoader.mjs +24 -26
  209. package/reactjs/components/base/MxCircleLoader/index.js +1 -4
  210. package/reactjs/components/base/MxCircleLoader/index.mjs +2 -2
  211. package/reactjs/components/base/MxLink/MxLink.js +1 -70
  212. package/reactjs/components/base/MxLink/MxLink.mjs +44 -46
  213. package/reactjs/components/base/MxLink/index.js +1 -4
  214. package/reactjs/components/base/MxLink/index.mjs +2 -2
  215. package/reactjs/components/base/MxSearch/MxSearch.js +1 -69
  216. package/reactjs/components/base/MxSearch/MxSearch.mjs +37 -41
  217. package/reactjs/components/base/MxSearch/index.js +1 -4
  218. package/reactjs/components/base/MxSearch/index.mjs +2 -2
  219. package/reactjs/components/base/MxSlideover/MxSlideover.js +1 -78
  220. package/reactjs/components/base/MxSlideover/MxSlideover.mjs +72 -74
  221. package/reactjs/components/base/MxSlideover/index.js +1 -4
  222. package/reactjs/components/base/MxSlideover/index.mjs +2 -2
  223. package/reactjs/components/base/MxTooltip/MxTooltip.js +1 -163
  224. package/reactjs/components/base/MxTooltip/MxTooltip.mjs +92 -135
  225. package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.js +1 -33
  226. package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.mjs +29 -31
  227. package/reactjs/components/base/MxTooltip/components/TooltipContainer/index.js +1 -4
  228. package/reactjs/components/base/MxTooltip/components/TooltipContainer/index.mjs +2 -2
  229. package/reactjs/components/base/MxTooltip/components/TooltipContent/TooltipContent.js +1 -27
  230. package/reactjs/components/base/MxTooltip/components/TooltipContent/TooltipContent.mjs +23 -25
  231. package/reactjs/components/base/MxTooltip/components/TooltipContent/index.js +1 -4
  232. package/reactjs/components/base/MxTooltip/components/TooltipContent/index.mjs +2 -2
  233. package/reactjs/components/base/MxTooltip/components/index.js +1 -6
  234. package/reactjs/components/base/MxTooltip/components/index.mjs +4 -4
  235. package/reactjs/components/base/MxTooltip/index.js +1 -4
  236. package/reactjs/components/base/MxTooltip/index.mjs +2 -2
  237. package/reactjs/components/base/index.js +1 -14
  238. package/reactjs/components/base/index.mjs +12 -12
  239. package/reactjs/components/index.js +1 -54
  240. package/reactjs/components/index.mjs +52 -52
  241. package/reactjs/constants/chains.js +1 -54
  242. package/reactjs/constants/chains.mjs +33 -52
  243. package/reactjs/constants/index.js +1 -13
  244. package/reactjs/constants/index.mjs +9 -10
  245. package/reactjs/context/Web3AppProvider.js +1 -42
  246. package/reactjs/context/Web3AppProvider.mjs +34 -36
  247. package/reactjs/context/queryClient.js +1 -11
  248. package/reactjs/context/queryClient.mjs +5 -8
  249. package/reactjs/context/useWeb3App.js +1 -12
  250. package/reactjs/context/useWeb3App.mjs +7 -8
  251. package/reactjs/helpers/index.js +1 -6
  252. package/reactjs/helpers/index.mjs +4 -4
  253. package/reactjs/helpers/resolveBridgeApiChainId.js +1 -40
  254. package/reactjs/helpers/resolveBridgeApiChainId.mjs +21 -34
  255. package/reactjs/hooks/index.js +1 -35
  256. package/reactjs/hooks/index.mjs +33 -33
  257. package/reactjs/hooks/tests/useGenericSignMessage.spec.js +1 -68
  258. package/reactjs/hooks/tests/useGenericSignMessage.spec.mjs +23 -38
  259. package/reactjs/hooks/tests/useSignTransaction.spec.js +1 -195
  260. package/reactjs/hooks/tests/useSignTransaction.spec.mjs +72 -110
  261. package/reactjs/hooks/useAccount.js +1 -13
  262. package/reactjs/hooks/useAccount.mjs +7 -8
  263. package/reactjs/hooks/useBalances.js +1 -53
  264. package/reactjs/hooks/useBalances.mjs +28 -40
  265. package/reactjs/hooks/useBridgeApiChainId.js +1 -13
  266. package/reactjs/hooks/useBridgeApiChainId.mjs +9 -9
  267. package/reactjs/hooks/useBridgeFormik.js +1 -167
  268. package/reactjs/hooks/useBridgeFormik.mjs +110 -155
  269. package/reactjs/hooks/useDebounce.js +1 -13
  270. package/reactjs/hooks/useDebounce.mjs +8 -10
  271. package/reactjs/hooks/useFetchBridgeData.js +1 -45
  272. package/reactjs/hooks/useFetchBridgeData.mjs +37 -38
  273. package/reactjs/hooks/useFetchTokens.js +1 -115
  274. package/reactjs/hooks/useFetchTokens.mjs +80 -108
  275. package/reactjs/hooks/useGenericSignMessage.js +1 -75
  276. package/reactjs/hooks/useGenericSignMessage.mjs +44 -64
  277. package/reactjs/hooks/useGetChainId.js +1 -11
  278. package/reactjs/hooks/useGetChainId.mjs +7 -8
  279. package/reactjs/hooks/useResolveTokenChain.js +1 -20
  280. package/reactjs/hooks/useResolveTokenChain.mjs +11 -14
  281. package/reactjs/hooks/useSendTransactions.js +1 -25
  282. package/reactjs/hooks/useSendTransactions.mjs +19 -23
  283. package/reactjs/hooks/useSignTransaction.js +1 -112
  284. package/reactjs/hooks/useSignTransaction.mjs +50 -76
  285. package/reactjs/hooks/useSuiConnect.js +1 -86
  286. package/reactjs/hooks/useSuiConnect.mjs +52 -70
  287. package/reactjs/hooks/validation/index.js +1 -10
  288. package/reactjs/hooks/validation/index.mjs +8 -8
  289. package/reactjs/hooks/validation/useAmountSchema.js +1 -32
  290. package/reactjs/hooks/validation/useAmountSchema.mjs +8 -11
  291. package/reactjs/hooks/validation/useSecondAmountSchema.js +1 -26
  292. package/reactjs/hooks/validation/useSecondAmountSchema.mjs +5 -6
  293. package/reactjs/hooks/validation/useTestHasEnoughFunds.js +1 -37
  294. package/reactjs/hooks/validation/useTestHasEnoughFunds.mjs +20 -29
  295. package/reactjs/hooks/validation/useTestIsConnected.js +1 -27
  296. package/reactjs/hooks/validation/useTestIsConnected.mjs +13 -19
  297. package/reactjs/index.js +1 -190
  298. package/reactjs/index.mjs +154 -154
  299. package/reactjs/init/index.js +1 -5
  300. package/reactjs/init/index.mjs +3 -3
  301. package/reactjs/init/init.js +1 -147
  302. package/reactjs/init/init.mjs +57 -78
  303. package/reactjs/queries/index.js +1 -17
  304. package/reactjs/queries/index.mjs +15 -15
  305. package/reactjs/queries/useCheckAccount.query.js +1 -39
  306. package/reactjs/queries/useCheckAccount.query.mjs +29 -33
  307. package/reactjs/queries/useGetAllTokens.query.js +1 -35
  308. package/reactjs/queries/useGetAllTokens.query.mjs +26 -30
  309. package/reactjs/queries/useGetChains.query.js +1 -34
  310. package/reactjs/queries/useGetChains.query.mjs +26 -28
  311. package/reactjs/queries/useGetHistory.query.js +1 -69
  312. package/reactjs/queries/useGetHistory.query.mjs +53 -57
  313. package/reactjs/queries/useGetMvxTokensBalances.query.js +1 -66
  314. package/reactjs/queries/useGetMvxTokensBalances.query.mjs +38 -46
  315. package/reactjs/queries/useGetNonMvxTokensBalances.query.js +1 -81
  316. package/reactjs/queries/useGetNonMvxTokensBalances.query.mjs +49 -57
  317. package/reactjs/queries/useGetRate.mutation.js +1 -18
  318. package/reactjs/queries/useGetRate.mutation.mjs +12 -15
  319. package/reactjs/reexports.js +1 -48
  320. package/reactjs/reexports.mjs +13 -13
  321. package/reactjs/utils/delay.js +1 -6
  322. package/reactjs/utils/delay.mjs +3 -3
  323. package/reactjs/utils/formatAmount.js +1 -23
  324. package/reactjs/utils/formatAmount.mjs +16 -17
  325. package/reactjs/utils/getCleanStringAmount.js +1 -11
  326. package/reactjs/utils/getCleanStringAmount.mjs +6 -8
  327. package/reactjs/utils/getCompletePathname.js +1 -5
  328. package/reactjs/utils/getCompletePathname.mjs +3 -3
  329. package/reactjs/utils/getInitialTokens.js +1 -12
  330. package/reactjs/utils/getInitialTokens.mjs +6 -7
  331. package/reactjs/utils/hasEnoughFunds.js +1 -19
  332. package/reactjs/utils/hasEnoughFunds.mjs +11 -14
  333. package/reactjs/utils/index.js +1 -26
  334. package/reactjs/utils/index.mjs +24 -24
  335. package/reactjs/utils/isStringFloat.js +1 -21
  336. package/reactjs/utils/isStringFloat.mjs +11 -18
  337. package/reactjs/utils/mxClsx.js +1 -8
  338. package/reactjs/utils/mxClsx.mjs +4 -6
  339. package/reactjs/utils/pipe.js +1 -25
  340. package/reactjs/utils/pipe.mjs +13 -17
  341. package/reactjs/utils/removeCommas.js +1 -6
  342. package/reactjs/utils/removeCommas.mjs +2 -4
  343. package/reactjs/utils/roundAmount.js +1 -40
  344. package/reactjs/utils/roundAmount.mjs +16 -36
  345. package/reactjs/utils/testNumber.js +1 -4
  346. package/reactjs/utils/testNumber.mjs +2 -2
  347. package/store/inMemoryStore.js +1 -39
  348. package/store/inMemoryStore.mjs +17 -21
  349. package/style.css +1 -2274
  350. package/types/chainType.js +1 -11
  351. package/types/chainType.mjs +2 -9
  352. package/types/errors.js +1 -9
  353. package/types/errors.mjs +4 -5
  354. package/types/providerType.js +1 -9
  355. package/types/providerType.mjs +2 -7
  356. package/types/transaction.d.ts +2 -0
  357. package/all-networks-EJIVYZ_i.mjs +0 -4
  358. package/all-networks-NYACMyeN.js +0 -4
  359. package/default-BYtXv70Z.mjs +0 -4
  360. package/default-H3AbmzFV.js +0 -4
  361. package/react.esm-7GsOwMPq.js +0 -11815
  362. package/react.esm-CU-Iqz8D.mjs +0 -11796
@@ -1,676 +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 faSpinner = require("@fortawesome/free-solid-svg-icons/faSpinner");
6
- const reactFontawesome = require("@fortawesome/react-fontawesome");
7
- const formatAmount = require("@multiversx/sdk-dapp-utils/out/helpers/formatAmount");
8
- const react = require("@reown/appkit/react");
9
- const core = require("@wagmi/core");
10
- const debounce = require("lodash/debounce");
11
- const React = require("react");
12
- const reactToastify = require("react-toastify");
13
- const reactjs_components_BridgeForm_hooks_useBridgeTokenSelection = require("./hooks/useBridgeTokenSelection.js");
14
- const reactjs_components_BridgeForm_utils_bridgeFormHelpers = require("./utils/bridgeFormHelpers.js");
15
- const constants_index = require("../../../constants/index.js");
16
- const helpers_getApiURL = require("../../../helpers/getApiURL.js");
17
- require("../../constants/index.js");
18
- const helpers_safeImageUrl = require("../../../helpers/safeImageUrl.js");
19
- const types_chainType = require("../../../types/chainType.js");
20
- const reactjs_context_useWeb3App = require("../../context/useWeb3App.js");
21
- const reactjs_helpers_resolveBridgeApiChainId = require("../../helpers/resolveBridgeApiChainId.js");
22
- const reactjs_hooks_useAccount = require("../../hooks/useAccount.js");
23
- const reactjs_hooks_useBridgeApiChainId = require("../../hooks/useBridgeApiChainId.js");
24
- const reactjs_hooks_useBridgeFormik = require("../../hooks/useBridgeFormik.js");
25
- const reactjs_hooks_useFetchBridgeData = require("../../hooks/useFetchBridgeData.js");
26
- const reactjs_hooks_useGetChainId = require("../../hooks/useGetChainId.js");
27
- const reactjs_hooks_useSendTransactions = require("../../hooks/useSendTransactions.js");
28
- const reactjs_hooks_useSignTransaction = require("../../hooks/useSignTransaction.js");
29
- const reactjs_queries_useGetHistory_query = require("../../queries/useGetHistory.query.js");
30
- const reactjs_queries_useGetRate_mutation = require("../../queries/useGetRate.mutation.js");
31
- const reactjs_utils_mxClsx = require("../../utils/mxClsx.js");
32
- const reactjs_components_AmountCard_AmountCard = require("../AmountCard/AmountCard.js");
33
- const reactjs_components_AmountInput_AmountInput = require("../AmountInput/AmountInput.js");
34
- const reactjs_components_base_MxButton_MxButton = require("../base/MxButton/MxButton.js");
35
- require("../base/MxCard/MxCard.js");
36
- require("../base/MxLink/MxLink.js");
37
- require("../base/MxSearch/MxSearch.js");
38
- require("@fortawesome/free-solid-svg-icons/faClose");
39
- require("@headlessui/react");
40
- require("react-dom");
41
- require("react-popper");
42
- require("../base/MxTooltip/components/TooltipContainer/TooltipContainer.js");
43
- const reactjs_components_BridgeHistory_BridgeHistory = require("../BridgeHistory/BridgeHistory.js");
44
- const reactjs_components_Connect_BridgeConnectButton = require("../Connect/BridgeConnectButton.js");
45
- require("wagmi");
46
- const reactjs_components_Connect_MvxConnectButton = require("../Connect/MvxConnectButton.js");
47
- const reactjs_components_Connect_BridgeAccountDisplay = require("../Connect/BridgeAccountDisplay.js");
48
- const reactjs_components_Connect_MvxAccountDisplay = require("../Connect/MvxAccountDisplay.js");
49
- require("@reown/appkit-controllers");
50
- const reactjs_components_ToggleDirection_ToggleDirection = require("../ToggleDirection/ToggleDirection.js");
51
- const reactjs_components_TokenSelector_TokenSelector = require("../TokenSelector/TokenSelector.js");
52
- let fetchRateInterval;
53
- const Deposit = ({
54
- mvxChainId,
55
- mvxAddress,
56
- username,
57
- callbackRoute = "/",
58
- firstTokenIdentifier,
59
- secondTokenIdentifier,
60
- firstTokenAmount,
61
- secondTokenAmount,
62
- refetchTrigger,
63
- showHistory,
64
- forcedDestinationTokenSymbol,
65
- onSuccessfullySentTransaction,
66
- onFailedSentTransaction,
67
- onHistoryClose,
68
- onMvxConnect,
69
- onMvxDisconnect,
70
- onNavigate,
71
- onChangeDirection
72
- }) => {
73
- var _a, _b;
74
- const ref = React.useRef(null);
75
- const [isTokenSelectorVisible, setIsTokenSelectorVisible] = React.useState(false);
76
- const [pendingSigning, setPendingSigning] = React.useState(false);
77
- const [forceRefetchRate, setForceRefetchRate] = React.useState(1);
78
- const [siginingTransactionsCount, setSigningTransactionsCount] = React.useState(0);
79
- const account = reactjs_hooks_useAccount.useAccount();
80
- const { switchNetwork } = react.useAppKitNetwork();
81
- const invalidateHistoryQuery = reactjs_queries_useGetHistory_query.useInvalidateHistoryQuery();
82
- const {
83
- config,
84
- options,
85
- supportedChains: sdkChains,
86
- nativeAuthToken,
87
- bridgeOnly
88
- } = reactjs_context_useWeb3App.useWeb3App();
89
- const chainId = reactjs_hooks_useGetChainId.useGetChainId();
90
- const bridgeApiChainId = reactjs_hooks_useBridgeApiChainId.useBridgeApiChainId();
91
- const {
92
- evmTokensWithBalances,
93
- mvxTokensWithBalances,
94
- isTokensLoading: tokensLoading,
95
- isLoadingEvmTokensBalances,
96
- isLoadingMvxTokensBalances,
97
- chains = [],
98
- isChainsLoading
99
- } = reactjs_hooks_useFetchBridgeData.useFetchBridgeData({
100
- refetchTrigger,
101
- mvxAddress,
102
- mvxApiURL: options.mvxApiURL
103
- });
104
- const isTokensLoading = tokensLoading || isLoadingEvmTokensBalances || isLoadingMvxTokensBalances || isChainsLoading;
105
- const activeChain = React.useMemo(() => {
106
- return sdkChains.find((chain) => reactjs_helpers_resolveBridgeApiChainId.sameBridgeApiChainId(chain.id, chainId));
107
- }, [chainId, sdkChains]);
108
- const mvxChain = React.useMemo(() => {
109
- return chains.find(
110
- (chain) => chain.chainId.toString() === mvxChainId.toString()
111
- );
112
- }, [chainId, chains]);
113
- const { evm, solana, bitcoin, sui } = reactjs_hooks_useSignTransaction.useSignTransaction();
114
- const sendTransactions = reactjs_hooks_useSendTransactions.useSendTransactions();
115
- const {
116
- mutate: getRate,
117
- data: rate,
118
- isPending: isPendingRate,
119
- error: rateError
120
- } = reactjs_queries_useGetRate_mutation.useGetRateMutation();
121
- const rateValidationError = ((_a = rateError == null ? void 0 : rateError.response) == null ? void 0 : _a.status) === 400 ? (_b = rateError == null ? void 0 : rateError.response) == null ? void 0 : _b.data.message : void 0;
122
- const handleSwitchNetwork = React.useCallback(
123
- (chain) => {
124
- const sdkChain = sdkChains.find(
125
- (c) => reactjs_helpers_resolveBridgeApiChainId.sameBridgeApiChainId(c.id, chain.id)
126
- );
127
- if (sdkChain) {
128
- switchNetwork(sdkChain);
129
- }
130
- },
131
- [sdkChains, switchNetwork]
132
- );
133
- const {
134
- firstToken,
135
- secondToken,
136
- fromOptions,
137
- toOptions,
138
- selectedChainOption,
139
- onChangeFirstSelect,
140
- onChangeSecondSelect,
141
- handleChangeDirection: handleTokenChangeDirection
142
- } = reactjs_components_BridgeForm_hooks_useBridgeTokenSelection.useBridgeTokenSelection({
143
- chains,
144
- activeChain,
145
- sdkChains,
146
- switchNetwork: handleSwitchNetwork,
147
- fromTokens: evmTokensWithBalances,
148
- toTokens: mvxTokensWithBalances,
149
- firstTokenIdentifier,
150
- secondTokenIdentifier,
151
- forcedDestinationTokenSymbol,
152
- isTokensLoading,
153
- callbackRoute,
154
- onNavigate
155
- });
156
- const isFirstTokenMvx = React.useMemo(() => {
157
- return firstToken ? constants_index.MVX_CHAIN_IDS.includes(firstToken.chainId.toString()) : false;
158
- }, [firstToken == null ? void 0 : firstToken.chainId]);
159
- const isSecondTokenMvx = React.useMemo(() => {
160
- return secondToken ? constants_index.MVX_CHAIN_IDS.includes(secondToken.chainId.toString()) : false;
161
- }, [secondToken == null ? void 0 : secondToken.chainId]);
162
- const [firstAmount, setFirstAmount] = React.useState(firstTokenAmount ?? "");
163
- const [secondAmount, setSecondAmount] = React.useState(secondTokenAmount ?? "");
164
- const firstTokenChain = React.useMemo(() => {
165
- if (!firstToken) {
166
- return selectedChainOption;
167
- }
168
- return chains.find(
169
- (chain) => reactjs_helpers_resolveBridgeApiChainId.sameBridgeApiChainId(chain.chainId, firstToken.chainId)
170
- ) ?? selectedChainOption;
171
- }, [firstToken == null ? void 0 : firstToken.chainId, chains, selectedChainOption]);
172
- const bridgeFromChainId = React.useMemo(
173
- () => reactjs_helpers_resolveBridgeApiChainId.toBridgeApiChainId(firstToken == null ? void 0 : firstToken.chainId) ?? bridgeApiChainId,
174
- [firstToken == null ? void 0 : firstToken.chainId, bridgeApiChainId]
175
- );
176
- const bridgeAddress = account.address;
177
- const isAuthenticated = account.isConnected && Boolean(bridgeAddress);
178
- const hasAmounts = firstAmount !== "" && secondAmount !== "";
179
- const fetchRateDebounced = React.useCallback(
180
- debounce(async (amount) => {
181
- if (!amount || !Number(amount) || !account.address || !(firstToken == null ? void 0 : firstToken.address) || !(secondToken == null ? void 0 : secondToken.address) || !selectedChainOption || !bridgeFromChainId) {
182
- return;
183
- }
184
- getRate({
185
- nativeAuthToken: nativeAuthToken ?? "",
186
- body: {
187
- tokenIn: firstToken.address,
188
- amountIn: amount,
189
- fromChainId: bridgeFromChainId,
190
- tokenOut: secondToken.address,
191
- toChainId: mvxChainId
192
- }
193
- });
194
- }, 500),
195
- [
196
- account.address,
197
- bridgeFromChainId,
198
- firstToken == null ? void 0 : firstToken.address,
199
- secondToken == null ? void 0 : secondToken.address,
200
- selectedChainOption
201
- ]
202
- );
203
- const handleOnChangeFirstAmount = React.useCallback((amount) => {
204
- setFirstAmount(() => amount);
205
- }, []);
206
- const handleOnChangeSecondAmount = React.useCallback((amount) => {
207
- setSecondAmount(() => amount);
208
- }, []);
209
- const handleHistoryClose = React.useCallback(() => {
210
- onHistoryClose == null ? void 0 : onHistoryClose();
211
- }, [onHistoryClose]);
212
- const handleOnFirstMaxBtnChange = React.useCallback(() => {
213
- const formattedBalance = formatAmount.formatAmount({
214
- decimals: firstToken == null ? void 0 : firstToken.decimals,
215
- input: (firstToken == null ? void 0 : firstToken.balance) ?? "0",
216
- addCommas: false,
217
- digits: 4
218
- });
219
- formik.setFieldValue("firstAmount", formattedBalance);
220
- handleOnChangeFirstAmount(formattedBalance);
221
- }, [firstToken == null ? void 0 : firstToken.balance, firstToken == null ? void 0 : firstToken.decimals, handleOnChangeFirstAmount]);
222
- const onSuccess = React.useCallback(
223
- async (txHashes) => {
224
- handleOnChangeFirstAmount("");
225
- handleOnChangeSecondAmount("");
226
- invalidateHistoryQuery();
227
- invalidateHistoryQuery();
228
- onSuccessfullySentTransaction == null ? void 0 : onSuccessfullySentTransaction(txHashes);
229
- },
230
- [
231
- handleOnChangeFirstAmount,
232
- handleOnChangeSecondAmount,
233
- onSuccessfullySentTransaction
234
- ]
235
- );
236
- const handleChangeDirection = () => {
237
- handleTokenChangeDirection();
238
- onChangeDirection();
239
- };
240
- React.useEffect(() => {
241
- if ((selectedChainOption == null ? void 0 : selectedChainOption.chainId) !== (firstToken == null ? void 0 : firstToken.chainId)) {
242
- const selectedOption = fromOptions == null ? void 0 : fromOptions.find(
243
- (option) => option.chainId.toString() === (selectedChainOption == null ? void 0 : selectedChainOption.chainId)
244
- );
245
- if (!selectedOption) {
246
- return;
247
- }
248
- onChangeFirstSelect(selectedOption);
249
- }
250
- }, [selectedChainOption == null ? void 0 : selectedChainOption.chainId]);
251
- const onSubmit = React.useCallback(
252
- async ({
253
- transactions,
254
- provider
255
- }) => {
256
- var _a2, _b2, _c;
257
- const signedTransactions = [];
258
- setPendingSigning(true);
259
- setSigningTransactionsCount(() => transactions.length);
260
- try {
261
- let txIndex = -1;
262
- for (const transaction of transactions) {
263
- ++txIndex;
264
- try {
265
- switch (reactjs_components_BridgeForm_utils_bridgeFormHelpers.resolveSigningChainType(transaction, firstTokenChain)) {
266
- case types_chainType.ChainType.evm: {
267
- const hash = await evm.signTransaction({
268
- ...transaction,
269
- value: BigInt(transaction.value),
270
- gas: BigInt(transaction.gasLimit),
271
- account: bridgeAddress
272
- });
273
- if (!hash) {
274
- break;
275
- }
276
- signedTransactions.push({
277
- ...transaction,
278
- txHash: hash
279
- });
280
- if (txIndex === transactions.length - 1 || !hash) {
281
- break;
282
- }
283
- const transactionReceipt = await core.waitForTransactionReceipt(
284
- config,
285
- {
286
- confirmations: 1,
287
- hash
288
- }
289
- );
290
- console.info({
291
- transactionReceipt,
292
- hash
293
- });
294
- break;
295
- }
296
- case types_chainType.ChainType.sol:
297
- if (!transaction.instructions || !transaction.feePayer) {
298
- break;
299
- }
300
- const txHash = await solana.signTransaction({
301
- feePayer: transaction.feePayer,
302
- instructions: transaction.instructions,
303
- recentBlockhash: transaction.recentBlockhash
304
- });
305
- if (!txHash) {
306
- break;
307
- }
308
- signedTransactions.push({
309
- ...transaction,
310
- txHash
311
- });
312
- break;
313
- case types_chainType.ChainType.btc:
314
- if (!transaction.bitcoinParams) {
315
- console.error("No bitcoin params");
316
- break;
317
- }
318
- const psbt = await bitcoin.signTransaction(
319
- transaction.bitcoinParams
320
- );
321
- signedTransactions.push({
322
- ...transaction,
323
- txHash: psbt
324
- });
325
- break;
326
- case types_chainType.ChainType.sui: {
327
- const serializedTx = (_a2 = transaction.suiParams) == null ? void 0 : _a2.transactionBytes;
328
- const sender = (_b2 = transaction.suiParams) == null ? void 0 : _b2.sender;
329
- if (!serializedTx || !sender) {
330
- console.error("No Sui transaction bytes or sender address");
331
- break;
332
- }
333
- const signature = await sui.signTransaction({
334
- transaction: serializedTx,
335
- address: sender
336
- });
337
- if (!signature) {
338
- break;
339
- }
340
- signedTransactions.push({
341
- ...transaction,
342
- suiParams: {
343
- ...transaction.suiParams,
344
- signature
345
- }
346
- });
347
- break;
348
- }
349
- default:
350
- reactToastify.toast.error("Provider not supported");
351
- setPendingSigning(false);
352
- return;
353
- }
354
- setSigningTransactionsCount(
355
- () => transactions.length - 1 - txIndex
356
- );
357
- } catch (e) {
358
- reactToastify.toast.dismiss();
359
- reactToastify.toast.error("Transaction aborted");
360
- onFailedSentTransaction == null ? void 0 : onFailedSentTransaction("Transaction aborted");
361
- setPendingSigning(false);
362
- return;
363
- }
364
- }
365
- const { data: batch } = await sendTransactions({
366
- transactions: signedTransactions,
367
- provider,
368
- url: helpers_getApiURL.getApiURL() ?? "",
369
- token: nativeAuthToken ?? ""
370
- });
371
- const apiHashes = ((_c = batch.transactions) == null ? void 0 : _c.map((tx) => tx.txHash).filter((h) => Boolean(h))) ?? [];
372
- const localHashes = signedTransactions.map((tx) => tx.txHash).filter((h) => Boolean(h));
373
- const txHashes = apiHashes.length > 0 ? apiHashes : localHashes.length > 0 ? localHashes : batch.batchId ? [batch.batchId] : [];
374
- onSuccess(txHashes);
375
- setPendingSigning(false);
376
- } catch (e) {
377
- console.error(e);
378
- reactToastify.toast.dismiss();
379
- reactToastify.toast.error("Transaction cancelled");
380
- onFailedSentTransaction == null ? void 0 : onFailedSentTransaction("Transaction cancelled");
381
- setPendingSigning(false);
382
- setSigningTransactionsCount(0);
383
- resetSwapForm();
384
- handleOnChangeFirstAmount("");
385
- handleOnChangeSecondAmount("");
386
- }
387
- },
388
- [
389
- firstTokenChain == null ? void 0 : firstTokenChain.chainType,
390
- bridgeAddress,
391
- config,
392
- handleOnChangeFirstAmount,
393
- handleOnChangeSecondAmount,
394
- nativeAuthToken,
395
- onSuccess,
396
- sendTransactions,
397
- bitcoin.signTransaction,
398
- evm.signTransaction,
399
- solana.signTransaction,
400
- sui.signTransaction
401
- ]
402
- );
403
- const {
404
- formik,
405
- firstAmountError,
406
- secondAmountError,
407
- fromChainError,
408
- handleBlur,
409
- handleChange,
410
- handleSubmit,
411
- resetSwapForm
412
- } = reactjs_hooks_useBridgeFormik.useBridgeFormik({
413
- isMvxConnected: Boolean(mvxAddress),
414
- rate,
415
- sender: account.address ?? "",
416
- receiver: mvxAddress ?? "",
417
- firstToken,
418
- firstAmount,
419
- fromChainId: bridgeFromChainId,
420
- toChainId: mvxChainId,
421
- secondToken,
422
- secondAmount,
423
- setForceRefetchRate,
424
- onSubmit
425
- });
426
- const hasError = Boolean(
427
- firstAmountError || secondAmountError || fromChainError || rateValidationError
428
- );
429
- const amountErrorFirstInput = React.useMemo(() => {
430
- return firstAmount !== "" ? rateValidationError ?? firstAmountError : void 0;
431
- }, [firstAmountError, firstAmount, rateValidationError]);
432
- const amountErrorSecondInput = React.useMemo(() => {
433
- return secondAmount !== "" ? fromChainError ?? secondAmountError : void 0;
434
- }, [fromChainError, secondAmountError, secondAmount]);
435
- React.useEffect(() => {
436
- if (!firstAmount) {
437
- setSecondAmount("");
438
- }
439
- fetchRateDebounced(firstAmount);
440
- if (fetchRateInterval) {
441
- clearInterval(fetchRateInterval);
442
- }
443
- fetchRateInterval = setInterval(() => {
444
- fetchRateDebounced(firstAmount);
445
- }, 50 * 1e3);
446
- return () => clearInterval(fetchRateInterval);
447
- }, [firstAmount, forceRefetchRate, fetchRateDebounced]);
448
- React.useEffect(() => {
449
- if (!(rate == null ? void 0 : rate.amountOut)) {
450
- return;
451
- }
452
- formik.setFieldValue(reactjs_hooks_useBridgeFormik.BridgeFormikValuesEnum.secondAmount, rate.amountOut);
453
- setSecondAmount(rate.amountOut);
454
- }, [rate == null ? void 0 : rate.amountOut]);
455
- React.useEffect(() => {
456
- if (rateValidationError) {
457
- formik.setFieldValue(reactjs_hooks_useBridgeFormik.BridgeFormikValuesEnum.secondAmount, "0");
458
- setSecondAmount("0");
459
- }
460
- }, [rateValidationError]);
461
- React.useEffect(() => {
462
- if (firstTokenAmount) {
463
- formik.setFieldValue(
464
- reactjs_hooks_useBridgeFormik.BridgeFormikValuesEnum.firstAmount,
465
- firstTokenAmount
466
- );
467
- handleOnChangeFirstAmount(firstTokenAmount);
468
- }
469
- }, []);
470
- React.useEffect(() => {
471
- if (secondTokenAmount) {
472
- formik.setFieldValue(
473
- reactjs_hooks_useBridgeFormik.BridgeFormikValuesEnum.secondAmount,
474
- secondTokenAmount
475
- );
476
- handleOnChangeSecondAmount(secondTokenAmount);
477
- }
478
- }, [secondTokenAmount]);
479
- return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(
480
- "form",
481
- {
482
- ref,
483
- noValidate: true,
484
- className: "liq-flex liq-flex-col liq-gap-1 liq-relative",
485
- autoComplete: "off",
486
- onSubmit: handleSubmit,
487
- children: [
488
- showHistory && /* @__PURE__ */ jsxRuntime.jsx(reactjs_components_BridgeHistory_BridgeHistory.BridgeHistory, { mvxAddress, onClose: handleHistoryClose }),
489
- /* @__PURE__ */ jsxRuntime.jsxs(
490
- reactjs_components_AmountCard_AmountCard.AmountCard,
491
- {
492
- className: reactjs_utils_mxClsx.mxClsx(
493
- "liq-pb-8 liq-pt-6 hover:liq-bg-neutral-700/50 sm:liq-pb-6",
494
- {
495
- "liq-pointer-events-none": isTokenSelectorVisible,
496
- "focus-within:liq-outline-neutral-700/75 hover:liq-outline-neutral-700/55 hover:focus-within:liq-outline-neutral-700/80": !isTokenSelectorVisible
497
- }
498
- ),
499
- children: [
500
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "liq-flex liq-items-center liq-gap-1", children: [
501
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "From" }),
502
- /* @__PURE__ */ jsxRuntime.jsx(
503
- reactjs_components_Connect_BridgeAccountDisplay.BridgeAccountDisplay,
504
- {
505
- disabled: isPendingRate,
506
- activeChain: firstTokenChain
507
- }
508
- )
509
- ] }),
510
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "liq-flex liq-justify-between liq-gap-1", children: [
511
- /* @__PURE__ */ jsxRuntime.jsx(
512
- reactjs_components_AmountInput_AmountInput.AmountInput,
513
- {
514
- inputName: "firstAmount",
515
- inputValue: formik.values.firstAmount,
516
- amountError: amountErrorFirstInput,
517
- disabled: false,
518
- onInputDebounceChange: handleOnChangeFirstAmount,
519
- onInputChange: handleChange,
520
- onBlur: handleBlur
521
- }
522
- ),
523
- /* @__PURE__ */ jsxRuntime.jsx(
524
- reactjs_components_TokenSelector_TokenSelector.TokenSelector,
525
- {
526
- name: "firstToken",
527
- disabled: isPendingRate,
528
- options: fromOptions,
529
- areOptionsLoading: isTokensLoading,
530
- isMvxSelector: isFirstTokenMvx,
531
- isDestination: false,
532
- color: "neutral-850",
533
- onChange: onChangeFirstSelect,
534
- onBlur: handleBlur,
535
- onMaxBtnClick: handleOnFirstMaxBtnChange,
536
- selectedOption: firstToken,
537
- onTokenSelectorDisplay: (visible) => setIsTokenSelectorVisible(visible)
538
- }
539
- )
540
- ] })
541
- ]
542
- }
543
- ),
544
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "liq-absolute liq-left-[6%] liq-top-[40%] -liq-mt-1 liq-z-10", children: bridgeOnly && /* @__PURE__ */ jsxRuntime.jsx(reactjs_components_ToggleDirection_ToggleDirection.ToggleDirection, { onChangeDirection: handleChangeDirection }) }),
545
- /* @__PURE__ */ jsxRuntime.jsxs(
546
- reactjs_components_AmountCard_AmountCard.AmountCard,
547
- {
548
- className: reactjs_utils_mxClsx.mxClsx(
549
- "liq-pb-8 liq-pt-6 hover:liq-bg-neutral-700/50 sm:liq-pb-6",
550
- {
551
- "liq-pointer-events-none": isTokenSelectorVisible
552
- }
553
- ),
554
- children: [
555
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "liq-flex liq-items-center liq-gap-1", children: [
556
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "To" }),
557
- /* @__PURE__ */ jsxRuntime.jsx(
558
- reactjs_components_Connect_MvxAccountDisplay.MvxAccountDisplay,
559
- {
560
- accountAddress: mvxAddress,
561
- chainIcon: helpers_safeImageUrl.safeImageUrl(mvxChain == null ? void 0 : mvxChain.pngUrl),
562
- username,
563
- accountExplorerUrl: `${options.mvxExplorerAddress}/accounts/${mvxAddress}`,
564
- showTag: true,
565
- onDisconnect: onMvxDisconnect,
566
- onConnect: onMvxConnect
567
- }
568
- )
569
- ] }),
570
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "liq-flex liq-justify-between liq-gap-1", children: [
571
- /* @__PURE__ */ jsxRuntime.jsx(
572
- reactjs_components_AmountInput_AmountInput.AmountInput,
573
- {
574
- inputName: "secondAmount",
575
- inputValue: formik.values.secondAmount,
576
- amountError: amountErrorSecondInput,
577
- disabled: false,
578
- onInputDebounceChange: handleOnChangeSecondAmount,
579
- onInputChange: handleChange,
580
- onBlur: handleBlur
581
- }
582
- ),
583
- /* @__PURE__ */ jsxRuntime.jsx(
584
- reactjs_components_TokenSelector_TokenSelector.TokenSelector,
585
- {
586
- name: "secondToken",
587
- disabled: isPendingRate,
588
- omitDisableClass: true,
589
- options: toOptions,
590
- areOptionsLoading: isTokensLoading,
591
- isMvxSelector: isSecondTokenMvx,
592
- color: "neutral-850",
593
- onChange: onChangeSecondSelect,
594
- onBlur: handleBlur,
595
- selectedOption: secondToken
596
- }
597
- )
598
- ] })
599
- ]
600
- }
601
- ),
602
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "liq-flex liq-items-center liq-justify-center", children: [
603
- !mvxAddress && /* @__PURE__ */ jsxRuntime.jsx(
604
- reactjs_components_Connect_MvxConnectButton.MvxConnectButton,
605
- {
606
- mvxAccountAddress: mvxAddress,
607
- icon: helpers_safeImageUrl.safeImageUrl(mvxChain == null ? void 0 : mvxChain.pngUrl),
608
- onClick: onMvxConnect
609
- }
610
- ),
611
- mvxAddress && !isAuthenticated && /* @__PURE__ */ jsxRuntime.jsx(
612
- reactjs_components_Connect_BridgeConnectButton.BridgeConnectButton,
613
- {
614
- className: "liq-w-full liq-rounded-xl liq-bg-neutral-850/50 liq-px-8 liq-py-3 liq-font-semibold liq-text-primary-200 liq-transition-colors liq-duration-200 hover:enabled:liq-bg-primary-700/80 disabled:liq-opacity-50",
615
- disabled: isPendingRate,
616
- activeChain: firstTokenChain
617
- }
618
- ),
619
- mvxAddress && isAuthenticated && /* @__PURE__ */ jsxRuntime.jsxs(
620
- reactjs_components_base_MxButton_MxButton.MxButton,
621
- {
622
- type: "submit",
623
- variant: "neutral-850",
624
- className: "liq-w-full disabled:liq-bg-neutral-850/50 liq-py-3 hover:enabled:liq-bg-primary !liq-text-primary-200",
625
- disabled: !hasAmounts || isPendingRate || !mvxAddress || !account.address || hasError || pendingSigning,
626
- children: [
627
- hasAmounts && !pendingSigning && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "liq-flex liq-justify-center liq-items-center liq-gap-2", children: [
628
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: "Deposit on " }),
629
- /* @__PURE__ */ jsxRuntime.jsx(
630
- "img",
631
- {
632
- src: helpers_safeImageUrl.safeImageUrl(mvxChain == null ? void 0 : mvxChain.pngUrl),
633
- alt: "",
634
- className: "liq-h-[1.5rem] liq-w-[1.5rem] liq-rounded-lg"
635
- }
636
- ),
637
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: "MultiversX" })
638
- ] }),
639
- !hasAmounts && !pendingSigning && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "liq-text-neutral-100", children: "Enter amount" }),
640
- pendingSigning && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "liq-flex liq-justify-center liq-items-center liq-gap-2", children: [
641
- /* @__PURE__ */ jsxRuntime.jsx(
642
- reactFontawesome.FontAwesomeIcon,
643
- {
644
- icon: faSpinner.faSpinner,
645
- spin: true,
646
- className: "liq-mx-1 liq-flex liq-items-center"
647
- }
648
- ),
649
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: "Depositing on" }),
650
- /* @__PURE__ */ jsxRuntime.jsx(
651
- "img",
652
- {
653
- src: helpers_safeImageUrl.safeImageUrl(mvxChain == null ? void 0 : mvxChain.pngUrl),
654
- alt: "",
655
- className: "liq-h-[1.5rem] liq-w-[1.5rem] liq-rounded-lg"
656
- }
657
- ),
658
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: "MultiversX" })
659
- ] })
660
- ]
661
- }
662
- )
663
- ] }),
664
- account.address && siginingTransactionsCount > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "liq-flex liq-items-center liq-justify-center liq-text-neutral-300 liq-text-sm", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
665
- "You will be asked to sign ",
666
- siginingTransactionsCount,
667
- " ",
668
- siginingTransactionsCount > 1 ? "transactions" : "transaction",
669
- " ",
670
- "on your wallet"
671
- ] }) })
672
- ]
673
- }
674
- ) });
675
- };
676
- exports.Deposit = Deposit;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),js=require("@fortawesome/free-solid-svg-icons/faSpinner"),Is=require("@fortawesome/react-fontawesome"),Cs=require("@multiversx/sdk-dapp-utils/out/helpers/formatAmount"),Bs=require("@reown/appkit/react"),vs=require("@wagmi/core"),ys=require("lodash/debounce"),t=require("react"),k=require("react-toastify"),As=require("./hooks/useBridgeTokenSelection.js"),ks=require("./utils/bridgeFormHelpers.js"),Se=require("../../../constants/index.js"),Ss=require("../../../helpers/getApiURL.js");require("../../constants/index.js");const H=require("../../../helpers/safeImageUrl.js"),L=require("../../../types/chainType.js"),ws=require("../../context/useWeb3App.js"),T=require("../../helpers/resolveBridgeApiChainId.js"),Ns=require("../../hooks/useAccount.js"),Ms=require("../../hooks/useBridgeApiChainId.js"),S=require("../../hooks/useBridgeFormik.js"),Ds=require("../../hooks/useFetchBridgeData.js"),Fs=require("../../hooks/useGetChainId.js"),Rs=require("../../hooks/useSendTransactions.js"),Es=require("../../hooks/useSignTransaction.js"),Vs=require("../../queries/useGetHistory.query.js"),Ps=require("../../queries/useGetRate.mutation.js"),we=require("../../utils/mxClsx.js"),Ne=require("../AmountCard/AmountCard.js"),Me=require("../AmountInput/AmountInput.js"),Us=require("../base/MxButton/MxButton.js");require("../base/MxCard/MxCard.js");require("../base/MxLink/MxLink.js");require("../base/MxSearch/MxSearch.js");require("@fortawesome/free-solid-svg-icons/faClose");require("@headlessui/react");require("react-dom");require("react-popper");require("../base/MxTooltip/components/TooltipContainer/TooltipContainer.js");const Hs=require("../BridgeHistory/BridgeHistory.js"),Ls=require("../Connect/BridgeConnectButton.js");require("wagmi");const Ts=require("../Connect/MvxConnectButton.js"),Os=require("../Connect/BridgeAccountDisplay.js"),Gs=require("../Connect/MvxAccountDisplay.js");require("@reown/appkit-controllers");const Ws=require("../ToggleDirection/ToggleDirection.js"),De=require("../TokenSelector/TokenSelector.js");let O;const Xs=({mvxChainId:G,mvxAddress:c,username:Fe,callbackRoute:Re="/",firstTokenIdentifier:Ee,secondTokenIdentifier:Ve,firstTokenAmount:w,secondTokenAmount:j,refetchTrigger:Pe,showHistory:Ue,forcedDestinationTokenSymbol:He,onSuccessfullySentTransaction:N,onFailedSentTransaction:f,onHistoryClose:M,onMvxConnect:re,onMvxDisconnect:Le,onNavigate:Te,onChangeDirection:Oe})=>{var je,Ie;const Ge=t.useRef(null),ae=t.useRef(void 0),[W,We]=t.useState(!1),[D,I]=t.useState(!1),[Xe,ze]=t.useState(1),[X,z]=t.useState(0),g=Ns.useAccount(),{switchNetwork:oe}=Bs.useAppKitNetwork(),ce=Vs.useInvalidateHistoryQuery(),{config:le,options:ue,supportedChains:C,nativeAuthToken:Q,bridgeOnly:Qe}=ws.useWeb3App(),$=Fs.useGetChainId(),de=Ms.useBridgeApiChainId(),{evmTokensWithBalances:$e,mvxTokensWithBalances:Ke,isTokensLoading:Ye,isLoadingEvmTokensBalances:Je,isLoadingMvxTokensBalances:Ze,chains:B=[],isChainsLoading:es}=Ds.useFetchBridgeData({refetchTrigger:Pe,mvxAddress:c,mvxApiURL:ue.mvxApiURL}),K=Ye||Je||Ze||es,ss=t.useMemo(()=>C.find(n=>T.sameBridgeApiChainId(n.id,$)),[$,C]),o=t.useMemo(()=>B.find(n=>n.chainId.toString()===G.toString()),[$,B]),{evm:me,solana:he,bitcoin:ge,sui:pe}=Es.useSignTransaction(),qe=Rs.useSendTransactions(),{mutate:ts,data:u,isPending:v,error:b}=Ps.useGetRateMutation(),y=((je=b==null?void 0:b.response)==null?void 0:je.status)===400?(Ie=b==null?void 0:b.response)==null?void 0:Ie.data.message:void 0,ns=t.useCallback(n=>{const q=C.find(l=>T.sameBridgeApiChainId(l.id,n.id));q&&oe(q)},[C,oe]),{firstToken:e,secondToken:a,fromOptions:F,toOptions:is,selectedChainOption:r,onChangeFirstSelect:fe,onChangeSecondSelect:rs,handleChangeDirection:as}=As.useBridgeTokenSelection({chains:B,activeChain:ss,sdkChains:C,switchNetwork:ns,fromTokens:$e,toTokens:Ke,firstTokenIdentifier:Ee,secondTokenIdentifier:Ve,forcedDestinationTokenSymbol:He,isTokensLoading:K,callbackRoute:Re,onNavigate:Te}),os=t.useMemo(()=>e?Se.MVX_CHAIN_IDS.includes(e.chainId.toString()):!1,[e==null?void 0:e.chainId]),cs=t.useMemo(()=>a?Se.MVX_CHAIN_IDS.includes(a.chainId.toString()):!1,[a==null?void 0:a.chainId]),[d,ls]=t.useState(w??""),[R,E]=t.useState(j??""),x=t.useMemo(()=>e?B.find(n=>T.sameBridgeApiChainId(n.chainId,e.chainId))??r:r,[e==null?void 0:e.chainId,B,r]),V=t.useMemo(()=>T.toBridgeApiChainId(e==null?void 0:e.chainId)??de,[e==null?void 0:e.chainId,de]),Y=g.address,be=g.isConnected&&!!Y,J=d!==""&&R!=="",Z=t.useCallback(ys(async n=>{!n||!Number(n)||!g.address||!(e!=null&&e.address)||!(a!=null&&a.address)||!r||!V||ts({nativeAuthToken:Q??"",body:{tokenIn:e.address,amountIn:n,fromChainId:V,tokenOut:a.address,toChainId:G}})},500),[g.address,V,e==null?void 0:e.address,a==null?void 0:a.address,r]),m=t.useCallback(n=>{ls(()=>n)},[]),_=t.useCallback(n=>{E(()=>n)},[]),us=t.useCallback(()=>{M==null||M()},[M]),ds=t.useCallback(()=>{const n=Cs.formatAmount({decimals:e==null?void 0:e.decimals,input:(e==null?void 0:e.balance)??"0",addCommas:!1,digits:4});p.setFieldValue("firstAmount",n),m(n)},[e==null?void 0:e.balance,e==null?void 0:e.decimals,m]),xe=t.useCallback(async n=>{m(""),_(""),ce(),ce(),N==null||N(n)},[m,_,N]),ms=()=>{as(),Oe()};t.useEffect(()=>{const n=ae.current;if(ae.current=r==null?void 0:r.chainId,!!n&&(r==null?void 0:r.chainId)!==(e==null?void 0:e.chainId)){const q=F==null?void 0:F.find(l=>l.chainId.toString()===(r==null?void 0:r.chainId));if(!q)return;fe(q)}},[r==null?void 0:r.chainId]);const hs=t.useCallback(async({transactions:n,provider:q})=>{var Ce,Be,ve;const l=[];I(!0),z(()=>n.length);try{let A=-1;for(const i of n){++A;try{switch(ks.resolveSigningChainType(i,x)){case L.ChainType.evm:{const h=await me.signTransaction({...i,value:BigInt(i.value),gas:BigInt(i.gasLimit),account:Y});if(!h||(l.push({...i,txHash:h}),A===n.length-1||!h))break;const U=await vs.waitForTransactionReceipt(le,{confirmations:1,hash:h});console.info({transactionReceipt:U,hash:h});break}case L.ChainType.sol:if(!i.instructions||!i.feePayer)break;const ie=await he.signTransaction({feePayer:i.feePayer,instructions:i.instructions,recentBlockhash:i.recentBlockhash});if(!ie)break;l.push({...i,txHash:ie});break;case L.ChainType.btc:if(!i.bitcoinParams){console.error("No bitcoin params");break}const _s=await ge.signTransaction(i.bitcoinParams);l.push({...i,txHash:_s});break;case L.ChainType.sui:{const h=(Ce=i.suiParams)==null?void 0:Ce.transactionBytes,U=(Be=i.suiParams)==null?void 0:Be.sender;if(!h||!U){console.error("No Sui transaction bytes or sender address");break}const ke=await pe.signTransaction({transaction:h,address:U});if(!ke)break;l.push({...i,suiParams:{...i.suiParams,signature:ke}});break}default:k.toast.error("Provider not supported"),I(!1);return}z(()=>n.length-1-A)}catch{k.toast.dismiss(),k.toast.error("Transaction aborted"),f==null||f("Transaction aborted"),I(!1);return}}const{data:ne}=await qe({transactions:l,provider:q,url:Ss.getApiURL()??"",token:Q??""}),ye=((ve=ne.transactions)==null?void 0:ve.map(i=>i.txHash).filter(i=>!!i))??[],Ae=l.map(i=>i.txHash).filter(i=>!!i),xs=ye.length>0?ye:Ae.length>0?Ae:ne.batchId?[ne.batchId]:[];xe(xs),I(!1)}catch(A){console.error(A),k.toast.dismiss(),k.toast.error("Transaction cancelled"),f==null||f("Transaction cancelled"),I(!1),z(0),ps(),m(""),_("")}},[x==null?void 0:x.chainType,Y,le,m,_,Q,xe,qe,ge.signTransaction,me.signTransaction,he.signTransaction,pe.signTransaction]),{formik:p,firstAmountError:ee,secondAmountError:se,fromChainError:te,handleBlur:P,handleChange:_e,handleSubmit:gs,resetSwapForm:ps}=S.useBridgeFormik({isMvxConnected:!!c,rate:u,sender:g.address??"",receiver:c??"",firstToken:e,firstAmount:d,fromChainId:V,toChainId:G,secondToken:a,secondAmount:R,setForceRefetchRate:ze,onSubmit:hs}),qs=!!(ee||se||te||y),fs=t.useMemo(()=>d!==""?y??ee:void 0,[ee,d,y]),bs=t.useMemo(()=>R!==""?te??se:void 0,[te,se,R]);return t.useEffect(()=>(d||E(""),Z(d),O&&clearInterval(O),O=setInterval(()=>{Z(d)},50*1e3),()=>clearInterval(O)),[d,Xe,Z]),t.useEffect(()=>{u!=null&&u.amountOut&&(p.setFieldValue(S.BridgeFormikValuesEnum.secondAmount,u.amountOut),E(u.amountOut))},[u==null?void 0:u.amountOut]),t.useEffect(()=>{y&&(p.setFieldValue(S.BridgeFormikValuesEnum.secondAmount,"0"),E("0"))},[y]),t.useEffect(()=>{w&&(p.setFieldValue(S.BridgeFormikValuesEnum.firstAmount,w),m(w))},[]),t.useEffect(()=>{j&&(p.setFieldValue(S.BridgeFormikValuesEnum.secondAmount,j),_(j))},[j]),s.jsx(s.Fragment,{children:s.jsxs("form",{ref:Ge,noValidate:!0,className:"liq-flex liq-flex-col liq-gap-1 liq-relative",autoComplete:"off",onSubmit:gs,children:[Ue&&s.jsx(Hs.BridgeHistory,{mvxAddress:c,onClose:us}),s.jsxs(Ne.AmountCard,{className:we.mxClsx("liq-pb-8 liq-pt-6 hover:liq-bg-neutral-700/50 sm:liq-pb-6",{"liq-pointer-events-none":W,"focus-within:liq-outline-neutral-700/75 hover:liq-outline-neutral-700/55 hover:focus-within:liq-outline-neutral-700/80":!W}),children:[s.jsxs("div",{className:"liq-flex liq-items-center liq-gap-1",children:[s.jsx("span",{children:"From"}),s.jsx(Os.BridgeAccountDisplay,{disabled:v,activeChain:x})]}),s.jsxs("div",{className:"liq-flex liq-justify-between liq-gap-1",children:[s.jsx(Me.AmountInput,{inputName:"firstAmount",inputValue:p.values.firstAmount,amountError:fs,disabled:!1,onInputDebounceChange:m,onInputChange:_e,onBlur:P}),s.jsx(De.TokenSelector,{name:"firstToken",disabled:v,options:F,areOptionsLoading:K,isMvxSelector:os,isDestination:!1,color:"neutral-850",onChange:fe,onBlur:P,onMaxBtnClick:ds,selectedOption:e,onTokenSelectorDisplay:n=>We(n)})]})]}),s.jsx("div",{className:"liq-absolute liq-left-[6%] liq-top-[40%] -liq-mt-1 liq-z-10",children:Qe&&s.jsx(Ws.ToggleDirection,{onChangeDirection:ms})}),s.jsxs(Ne.AmountCard,{className:we.mxClsx("liq-pb-8 liq-pt-6 hover:liq-bg-neutral-700/50 sm:liq-pb-6",{"liq-pointer-events-none":W}),children:[s.jsxs("div",{className:"liq-flex liq-items-center liq-gap-1",children:[s.jsx("span",{children:"To"}),s.jsx(Gs.MvxAccountDisplay,{accountAddress:c,chainIcon:H.safeImageUrl(o==null?void 0:o.pngUrl),username:Fe,accountExplorerUrl:`${ue.mvxExplorerAddress}/accounts/${c}`,showTag:!0,onDisconnect:Le,onConnect:re})]}),s.jsxs("div",{className:"liq-flex liq-justify-between liq-gap-1",children:[s.jsx(Me.AmountInput,{inputName:"secondAmount",inputValue:p.values.secondAmount,amountError:bs,disabled:!1,onInputDebounceChange:_,onInputChange:_e,onBlur:P}),s.jsx(De.TokenSelector,{name:"secondToken",disabled:v,omitDisableClass:!0,options:is,areOptionsLoading:K,isMvxSelector:cs,color:"neutral-850",onChange:rs,onBlur:P,selectedOption:a})]})]}),s.jsxs("div",{className:"liq-flex liq-items-center liq-justify-center",children:[!c&&s.jsx(Ts.MvxConnectButton,{mvxAccountAddress:c,icon:H.safeImageUrl(o==null?void 0:o.pngUrl),onClick:re}),c&&!be&&s.jsx(Ls.BridgeConnectButton,{className:"liq-w-full liq-rounded-xl liq-bg-neutral-850/50 liq-px-8 liq-py-3 liq-font-semibold liq-text-primary-200 liq-transition-colors liq-duration-200 hover:enabled:liq-bg-primary-700/80 disabled:liq-opacity-50",disabled:v,activeChain:x}),c&&be&&s.jsxs(Us.MxButton,{type:"submit",variant:"neutral-850",className:"liq-w-full disabled:liq-bg-neutral-850/50 liq-py-3 hover:enabled:liq-bg-primary !liq-text-primary-200",disabled:!J||v||!c||!g.address||qs||D,children:[J&&!D&&s.jsxs("div",{className:"liq-flex liq-justify-center liq-items-center liq-gap-2",children:[s.jsx("div",{children:"Deposit on "}),s.jsx("img",{src:H.safeImageUrl(o==null?void 0:o.pngUrl),alt:"",className:"liq-h-[1.5rem] liq-w-[1.5rem] liq-rounded-lg"}),s.jsx("div",{children:"MultiversX"})]}),!J&&!D&&s.jsx("span",{className:"liq-text-neutral-100",children:"Enter amount"}),D&&s.jsxs("div",{className:"liq-flex liq-justify-center liq-items-center liq-gap-2",children:[s.jsx(Is.FontAwesomeIcon,{icon:js.faSpinner,spin:!0,className:"liq-mx-1 liq-flex liq-items-center"}),s.jsx("div",{children:"Depositing on"}),s.jsx("img",{src:H.safeImageUrl(o==null?void 0:o.pngUrl),alt:"",className:"liq-h-[1.5rem] liq-w-[1.5rem] liq-rounded-lg"}),s.jsx("div",{children:"MultiversX"})]})]})]}),g.address&&X>0&&s.jsx("div",{className:"liq-flex liq-items-center liq-justify-center liq-text-neutral-300 liq-text-sm",children:s.jsxs("div",{children:["You will be asked to sign ",X," ",X>1?"transactions":"transaction"," ","on your wallet"]})})]})})};exports.Deposit=Xs;