@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,132 +1,112 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { faChevronDown } from "@fortawesome/free-solid-svg-icons/faChevronDown";
3
- import { faWallet } from "@fortawesome/free-solid-svg-icons/faWallet";
4
- import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
5
- import { useState, useMemo, useEffect } from "react";
6
- import { SelectContainer } from "./components/SelectContainer.mjs";
7
- import { SelectContent } from "./components/SelectContent.mjs";
8
- import { SelectedOption } from "./components/SelectedOption.mjs";
9
- import { MVX_CHAIN_IDS } from "../../../constants/index.mjs";
10
- import { useResolveTokenChain } from "../../hooks/useResolveTokenChain.mjs";
11
- import { useGetChainsQuery } from "../../queries/useGetChains.query.mjs";
12
- import { mxClsx } from "../../utils/mxClsx.mjs";
13
- import { MxButton } from "../base/MxButton/MxButton.mjs";
14
- import { DisplayAmount } from "../DisplayAmount/DisplayAmount.mjs";
15
- const TokenSelector = ({
16
- name,
17
- options = [],
18
- selectedOption,
19
- areOptionsLoading = false,
20
- className = "",
21
- disabled = false,
22
- isMvxSelector = false,
23
- omitDisableClass = false,
24
- isDestination = false,
25
- color = "neutral-750",
26
- onBlur,
27
- onChange,
28
- onMaxBtnClick,
29
- onTokenSelectorDisplay
1
+ import { jsx as l, jsxs as n, Fragment as D } from "react/jsx-runtime";
2
+ import { faChevronDown as F } from "@fortawesome/free-solid-svg-icons/faChevronDown";
3
+ import { faWallet as V } from "@fortawesome/free-solid-svg-icons/faWallet";
4
+ import { FontAwesomeIcon as p } from "@fortawesome/react-fontawesome";
5
+ import { useState as X, useMemo as x, useEffect as _ } from "react";
6
+ import { SelectContainer as z } from "./components/SelectContainer.mjs";
7
+ import { SelectContent as E } from "./components/SelectContent.mjs";
8
+ import { SelectedOption as G } from "./components/SelectedOption.mjs";
9
+ import { MVX_CHAIN_IDS as v } from "../../../constants/index.mjs";
10
+ import { useResolveTokenChain as H } from "../../hooks/useResolveTokenChain.mjs";
11
+ import { useGetChainsQuery as Q } from "../../queries/useGetChains.query.mjs";
12
+ import { mxClsx as C } from "../../utils/mxClsx.mjs";
13
+ import { MxButton as R } from "../base/MxButton/MxButton.mjs";
14
+ import { DisplayAmount as W } from "../DisplayAmount/DisplayAmount.mjs";
15
+ const rl = ({
16
+ name: m,
17
+ options: N = [],
18
+ selectedOption: i,
19
+ areOptionsLoading: w = !1,
20
+ className: c = "",
21
+ disabled: f = !1,
22
+ isMvxSelector: t = !1,
23
+ omitDisableClass: y = !1,
24
+ isDestination: d = !1,
25
+ color: a = "neutral-750",
26
+ onBlur: I,
27
+ onChange: k,
28
+ onMaxBtnClick: h,
29
+ onTokenSelectorDisplay: q
30
30
  }) => {
31
- const [show, setShow] = useState(false);
32
- const { data, isLoading: areChainsLoading } = useGetChainsQuery();
33
- const { chainIcon } = useResolveTokenChain({
34
- token: selectedOption
35
- });
36
- const chains = useMemo(() => {
37
- if (isMvxSelector) {
38
- return (data == null ? void 0 : data.filter(
39
- (chain) => MVX_CHAIN_IDS.includes(chain.chainId.toString())
40
- )) ?? [];
31
+ const [o, u] = X(!1), { data: e, isLoading: b } = Q(), { chainIcon: g } = H({
32
+ token: i
33
+ }), A = x(() => t ? (e == null ? void 0 : e.filter(
34
+ (r) => v.includes(r.chainId.toString())
35
+ )) ?? [] : (e == null ? void 0 : e.filter(
36
+ (r) => !v.includes(r.chainId.toString())
37
+ )) ?? [], [e, t]), S = x(() => t && d, [t, d]), s = f || S, j = () => u(!0), L = (w || b) && !i;
38
+ return _(() => {
39
+ q == null || q(o);
40
+ }, [o]), L ? /* @__PURE__ */ l(
41
+ "div",
42
+ {
43
+ className: C(
44
+ "liq-h-12 liq-w-40 liq-animate-pulse",
45
+ {
46
+ "liq-rounded-xl": !0,
47
+ "liq-rounded-e-lg liq-rounded-s-3xl": !0
48
+ },
49
+ {
50
+ "liq-bg-neutral-100 liq-bg-opacity-[0.1] hover:liq-bg-opacity-[0.25]": a === "neutral-750",
51
+ "liq-bg-neutral-100 liq-bg-opacity-[0.05] hover:liq-bg-opacity-[0.15]": a === "neutral-850"
52
+ },
53
+ c
54
+ )
41
55
  }
42
- return (data == null ? void 0 : data.filter(
43
- (chain) => !MVX_CHAIN_IDS.includes(chain.chainId.toString())
44
- )) ?? [];
45
- }, [data, isMvxSelector]);
46
- const isDestinationMvx = useMemo(() => {
47
- const shouldDisable = isMvxSelector && isDestination;
48
- return shouldDisable;
49
- }, [isMvxSelector, isDestination]);
50
- const isVisuallyDisabled = disabled || isDestinationMvx;
51
- const handleOnClick = () => setShow(true);
52
- const showLoadingSkeleton = (areOptionsLoading || areChainsLoading) && !selectedOption;
53
- useEffect(() => {
54
- onTokenSelectorDisplay == null ? void 0 : onTokenSelectorDisplay(show);
55
- }, [show]);
56
- if (showLoadingSkeleton) {
57
- return /* @__PURE__ */ jsx(
58
- "div",
59
- {
60
- className: mxClsx(
61
- "liq-h-12 liq-w-40 liq-animate-pulse",
62
- {
63
- "liq-rounded-xl": true,
64
- "liq-rounded-e-lg liq-rounded-s-3xl": true
65
- },
66
- {
67
- "liq-bg-neutral-100 liq-bg-opacity-[0.1] hover:liq-bg-opacity-[0.25]": color === "neutral-750",
68
- "liq-bg-neutral-100 liq-bg-opacity-[0.05] hover:liq-bg-opacity-[0.15]": color === "neutral-850"
69
- },
70
- className
71
- )
72
- }
73
- );
74
- }
75
- return /* @__PURE__ */ jsxs(Fragment, { children: [
76
- show && /* @__PURE__ */ jsx(SelectContainer, { onClose: () => setShow(false), children: /* @__PURE__ */ jsx(
77
- SelectContent,
56
+ ) : /* @__PURE__ */ n(D, { children: [
57
+ o && /* @__PURE__ */ l(z, { onClose: () => u(!1), children: /* @__PURE__ */ l(
58
+ E,
78
59
  {
79
- onSelect: (token) => {
80
- onChange(token);
81
- setShow(false);
60
+ onSelect: (r) => {
61
+ k(r), u(!1);
82
62
  },
83
- tokens: options,
84
- chains,
85
- isMvxSelector,
86
- areChainsLoading,
87
- selectedToken: selectedOption
63
+ tokens: N,
64
+ chains: A,
65
+ isMvxSelector: t,
66
+ areChainsLoading: b,
67
+ selectedToken: i
88
68
  }
89
69
  ) }),
90
- !show && /* @__PURE__ */ jsxs("div", { className: "liq-flex liq-flex-col liq-items-end liq-justify-between liq-gap-4", children: [
91
- /* @__PURE__ */ jsxs(
70
+ !o && /* @__PURE__ */ n("div", { className: "liq-flex liq-flex-col liq-items-end liq-justify-between liq-gap-4", children: [
71
+ /* @__PURE__ */ n(
92
72
  "button",
93
73
  {
94
- name,
74
+ name: m,
95
75
  type: "button",
96
76
  role: "combobox",
97
- className: mxClsx(
77
+ className: C(
98
78
  "focus-primary liq-group liq-flex liq-cursor-pointer liq-items-center liq-gap-2 liq-transition-colors liq-duration-200 liq-relative",
99
79
  {
100
- "liq-rounded-e-lg liq-rounded-s-3xl liq-px-1 liq-py-1 liq-pr-3": true
80
+ "liq-rounded-e-lg liq-rounded-s-3xl liq-px-1 liq-py-1 liq-pr-3": !0
101
81
  },
102
82
  {
103
- "liq-bg-neutral-750/50 hover:enabled:liq-bg-neutral-750": color === "neutral-750",
104
- "liq-bg-neutral-900/50 liq-outline liq-outline-1 liq-outline-neutral-700/20 hover:enabled:liq-bg-neutral-600/50 hover:enabled:liq-outline-neutral-600": color === "neutral-850"
83
+ "liq-bg-neutral-750/50 hover:enabled:liq-bg-neutral-750": a === "neutral-750",
84
+ "liq-bg-neutral-900/50 liq-outline liq-outline-1 liq-outline-neutral-700/20 hover:enabled:liq-bg-neutral-600/50 hover:enabled:liq-outline-neutral-600": a === "neutral-850"
105
85
  },
106
86
  {
107
- "disabled:!liq-opacity-70": isVisuallyDisabled && !omitDisableClass
87
+ "disabled:!liq-opacity-70": s && !y
108
88
  },
109
89
  {
110
- "!liq-cursor-not-allowed !liq-bg-transparent !liq-outline-transparent": isVisuallyDisabled
90
+ "!liq-cursor-not-allowed !liq-bg-transparent !liq-outline-transparent": s
111
91
  },
112
- className
92
+ c
113
93
  ),
114
- onBlur,
115
- onClick: handleOnClick,
116
- disabled: isVisuallyDisabled,
94
+ onBlur: I,
95
+ onClick: j,
96
+ disabled: s,
117
97
  children: [
118
- /* @__PURE__ */ jsx(SelectedOption, { value: selectedOption }),
119
- !isVisuallyDisabled && /* @__PURE__ */ jsx(
120
- FontAwesomeIcon,
98
+ /* @__PURE__ */ l(G, { value: i }),
99
+ !s && /* @__PURE__ */ l(
100
+ p,
121
101
  {
122
- icon: faChevronDown,
102
+ icon: F,
123
103
  className: "liq-text-neutral-200 group-hover:liq-text-neutral-50"
124
104
  }
125
105
  ),
126
- chainIcon && /* @__PURE__ */ jsx(
106
+ g && /* @__PURE__ */ l(
127
107
  "img",
128
108
  {
129
- src: chainIcon,
109
+ src: g,
130
110
  alt: "",
131
111
  className: "liq-absolute liq-left-6 liq-bottom-[2px] liq-chain-icon liq-sm liq-w-6 liq-h-6 liq-border-[3px] liq-border-neutral-850 liq-rounded-lg"
132
112
  }
@@ -134,33 +114,33 @@ const TokenSelector = ({
134
114
  ]
135
115
  }
136
116
  ),
137
- /* @__PURE__ */ jsx("div", { className: "liq-flex liq-items-center liq-gap-3", children: /* @__PURE__ */ jsxs("div", { className: "liq-flex liq-items-center liq-gap-3", children: [
138
- /* @__PURE__ */ jsxs("div", { className: "liq-flex liq-items-center liq-gap-1", children: [
139
- /* @__PURE__ */ jsx(
140
- FontAwesomeIcon,
117
+ /* @__PURE__ */ l("div", { className: "liq-flex liq-items-center liq-gap-3", children: /* @__PURE__ */ n("div", { className: "liq-flex liq-items-center liq-gap-3", children: [
118
+ /* @__PURE__ */ n("div", { className: "liq-flex liq-items-center liq-gap-1", children: [
119
+ /* @__PURE__ */ l(
120
+ p,
141
121
  {
142
- icon: faWallet,
122
+ icon: V,
143
123
  className: "liq-text-neutral-300"
144
124
  }
145
125
  ),
146
- /* @__PURE__ */ jsx(
147
- DisplayAmount,
126
+ /* @__PURE__ */ l(
127
+ W,
148
128
  {
149
- "data-testid": `${name}-balance`,
150
- decimals: selectedOption == null ? void 0 : selectedOption.decimals,
151
- amount: (selectedOption == null ? void 0 : selectedOption.balance) ?? "0",
129
+ "data-testid": `${m}-balance`,
130
+ decimals: i == null ? void 0 : i.decimals,
131
+ amount: (i == null ? void 0 : i.balance) ?? "0",
152
132
  className: "liq-font-medium liq-text-neutral-100"
153
133
  }
154
134
  )
155
135
  ] }),
156
- onMaxBtnClick && /* @__PURE__ */ jsx(
157
- MxButton,
136
+ h && /* @__PURE__ */ l(
137
+ R,
158
138
  {
159
139
  btnSize: "xs",
160
140
  variant: "neutral-800",
161
- disabled,
162
- onClick: onMaxBtnClick,
163
- children: /* @__PURE__ */ jsx("span", { className: "liq-text-neutral-300", children: "MAX" })
141
+ disabled: f,
142
+ onClick: h,
143
+ children: /* @__PURE__ */ l("span", { className: "liq-text-neutral-300", children: "MAX" })
164
144
  }
165
145
  )
166
146
  ] }) })
@@ -168,5 +148,5 @@ const TokenSelector = ({
168
148
  ] });
169
149
  };
170
150
  export {
171
- TokenSelector
151
+ rl as TokenSelector
172
152
  };
@@ -1,95 +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 React = require("react");
6
- const Select = require("react-select");
7
- const helpers_getDisplayName = require("../../../../../helpers/getDisplayName.js");
8
- const reactjs_components_TokenSelector_components_ChainSelect_components_FormatChainOptionLabel = require("./components/FormatChainOptionLabel.js");
9
- const reactjs_components_TokenSelector_components_ChainSelect_components_IndicatorSeparator = require("./components/IndicatorSeparator.js");
10
- const reactjs_components_TokenSelector_components_ChainSelect_components_SelectedChainOption = require("./components/SelectedChainOption.js");
11
- require("../../../../constants/index.js");
12
- const reactjs_constants_chains = require("../../../../constants/chains.js");
13
- const ChainSelect = ({
14
- isLoading,
15
- selectedChainId,
16
- ignoreAllChains = false,
17
- onChange,
18
- chains
19
- }) => {
20
- const chainOptions = React.useMemo(() => {
21
- const options = chains.map((chain) => ({
22
- label: chain.networkName,
23
- value: chain.chainId.toString(),
24
- chain: {
25
- id: chain.chainId.toString(),
26
- name: helpers_getDisplayName.getDisplayName(chain),
27
- networkName: chain.networkName,
28
- svgUrl: chain.svgUrl,
29
- pngUrl: chain.pngUrl
30
- }
31
- }));
32
- if (ignoreAllChains) {
33
- return options;
34
- }
35
- options.unshift({
36
- label: "All",
37
- value: reactjs_constants_chains.ALL_NETWORK_ID,
38
- chain: {
39
- id: reactjs_constants_chains.ALL_NETWORK_ID,
40
- name: "all",
41
- networkName: "All",
42
- svgUrl: "https://cdn.multiversx.com/liquidity-sdk/all-networks.svg",
43
- pngUrl: "https://cdn.multiversx.com/liquidity-sdk/all-networks.svg"
44
- }
45
- });
46
- return options;
47
- }, [chains]);
48
- const selectedChain = React.useMemo(() => {
49
- return chainOptions.find(
50
- (chainOption) => chainOption.value.toString() === (selectedChainId == null ? void 0 : selectedChainId.toString())
51
- ) ?? (chainOptions == null ? void 0 : chainOptions[0]);
52
- }, [chainOptions, selectedChainId]);
53
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "styled-chain-select", "data-testid": "chainDropdown", children: /* @__PURE__ */ jsxRuntime.jsx(
54
- Select,
55
- {
56
- className: "basic-single",
57
- classNamePrefix: "styled-chain-select",
58
- maxMenuHeight: 260,
59
- value: selectedChain,
60
- isLoading,
61
- styles: {
62
- indicatorSeparator: reactjs_components_TokenSelector_components_ChainSelect_components_IndicatorSeparator.IndicatorSeparator,
63
- control: (css) => ({
64
- ...css,
65
- width: "max-content",
66
- minWidth: "100%",
67
- maxWidth: "10rem"
68
- }),
69
- menu: (css) => ({
70
- ...css,
71
- zIndex: 9999,
72
- width: "max-content",
73
- minWidth: "100%",
74
- right: 0
75
- })
76
- },
77
- isSearchable: true,
78
- name: "chain",
79
- options: chainOptions,
80
- onChange: (selectedOption) => {
81
- var _a, _b;
82
- if ((_a = selectedOption == null ? void 0 : selectedOption.chain) == null ? void 0 : _a.id) {
83
- onChange == null ? void 0 : onChange((_b = selectedOption.chain) == null ? void 0 : _b.id.toString());
84
- }
85
- },
86
- isMulti: false,
87
- formatOptionLabel: reactjs_components_TokenSelector_components_ChainSelect_components_FormatChainOptionLabel.FormatChainOptionLabel,
88
- components: {
89
- Input: () => null,
90
- SingleValue: reactjs_components_TokenSelector_components_ChainSelect_components_SelectedChainOption.SelectedChainOption
91
- }
92
- }
93
- ) });
94
- };
95
- exports.ChainSelect = ChainSelect;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),l=require("react"),_=require("react-select"),S=require("../../../../../helpers/getDisplayName.js"),d=require("./components/FormatChainOptionLabel.js"),g=require("./components/IndicatorSeparator.js"),h=require("./components/SelectedChainOption.js");require("../../../../constants/index.js");const c=require("../../../../constants/chains.js"),v=({isLoading:m,selectedChainId:r,ignoreAllChains:u=!1,onChange:o,chains:i})=>{const n=l.useMemo(()=>{const e=i.map(t=>({label:t.networkName,value:t.chainId.toString(),chain:{id:t.chainId.toString(),name:S.getDisplayName(t),networkName:t.networkName,svgUrl:t.svgUrl,pngUrl:t.pngUrl}}));return u||e.unshift({label:"All",value:c.ALL_NETWORK_ID,chain:{id:c.ALL_NETWORK_ID,name:"all",networkName:"All",svgUrl:"https://cdn.multiversx.com/liquidity-sdk/all-networks.svg",pngUrl:"https://cdn.multiversx.com/liquidity-sdk/all-networks.svg"}}),e},[i]),p=l.useMemo(()=>n.find(e=>e.value.toString()===(r==null?void 0:r.toString()))??(n==null?void 0:n[0]),[n,r]);return s.jsx("div",{className:"styled-chain-select","data-testid":"chainDropdown",children:s.jsx(_,{className:"basic-single",classNamePrefix:"styled-chain-select",maxMenuHeight:260,value:p,isLoading:m,styles:{indicatorSeparator:g.IndicatorSeparator,control:e=>({...e,width:"max-content",minWidth:"100%",maxWidth:"10rem"}),menu:e=>({...e,zIndex:9999,width:"max-content",minWidth:"100%",right:0})},isSearchable:!0,name:"chain",options:n,onChange:e=>{var t,a;(t=e==null?void 0:e.chain)!=null&&t.id&&(o==null||o((a=e.chain)==null?void 0:a.id.toString()))},isMulti:!1,formatOptionLabel:d.FormatChainOptionLabel,components:{Input:()=>null,SingleValue:h.SelectedChainOption}})})};exports.ChainSelect=v;
@@ -1,94 +1,85 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { useMemo } from "react";
3
- import Select from "react-select";
4
- import { getDisplayName } from "../../../../../helpers/getDisplayName.mjs";
5
- import { FormatChainOptionLabel } from "./components/FormatChainOptionLabel.mjs";
6
- import { IndicatorSeparator } from "./components/IndicatorSeparator.mjs";
7
- import { SelectedChainOption } from "./components/SelectedChainOption.mjs";
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { useMemo as e } from "react";
3
+ import f from "react-select";
4
+ import { getDisplayName as d } from "../../../../../helpers/getDisplayName.mjs";
5
+ import { FormatChainOptionLabel as g } from "./components/FormatChainOptionLabel.mjs";
6
+ import { IndicatorSeparator as v } from "./components/IndicatorSeparator.mjs";
7
+ import { SelectedChainOption as S } from "./components/SelectedChainOption.mjs";
8
8
  import "../../../../constants/index.mjs";
9
- import { ALL_NETWORK_ID } from "../../../../constants/chains.mjs";
10
- const ChainSelect = ({
11
- isLoading,
12
- selectedChainId,
13
- ignoreAllChains = false,
14
- onChange,
15
- chains
9
+ import { ALL_NETWORK_ID as s } from "../../../../constants/chains.mjs";
10
+ const W = ({
11
+ isLoading: p,
12
+ selectedChainId: o,
13
+ ignoreAllChains: u = !1,
14
+ onChange: a,
15
+ chains: m
16
16
  }) => {
17
- const chainOptions = useMemo(() => {
18
- const options = chains.map((chain) => ({
19
- label: chain.networkName,
20
- value: chain.chainId.toString(),
17
+ const i = e(() => {
18
+ const t = m.map((r) => ({
19
+ label: r.networkName,
20
+ value: r.chainId.toString(),
21
21
  chain: {
22
- id: chain.chainId.toString(),
23
- name: getDisplayName(chain),
24
- networkName: chain.networkName,
25
- svgUrl: chain.svgUrl,
26
- pngUrl: chain.pngUrl
22
+ id: r.chainId.toString(),
23
+ name: d(r),
24
+ networkName: r.networkName,
25
+ svgUrl: r.svgUrl,
26
+ pngUrl: r.pngUrl
27
27
  }
28
28
  }));
29
- if (ignoreAllChains) {
30
- return options;
31
- }
32
- options.unshift({
29
+ return u || t.unshift({
33
30
  label: "All",
34
- value: ALL_NETWORK_ID,
31
+ value: s,
35
32
  chain: {
36
- id: ALL_NETWORK_ID,
33
+ id: s,
37
34
  name: "all",
38
35
  networkName: "All",
39
36
  svgUrl: "https://cdn.multiversx.com/liquidity-sdk/all-networks.svg",
40
37
  pngUrl: "https://cdn.multiversx.com/liquidity-sdk/all-networks.svg"
41
38
  }
42
- });
43
- return options;
44
- }, [chains]);
45
- const selectedChain = useMemo(() => {
46
- return chainOptions.find(
47
- (chainOption) => chainOption.value.toString() === (selectedChainId == null ? void 0 : selectedChainId.toString())
48
- ) ?? (chainOptions == null ? void 0 : chainOptions[0]);
49
- }, [chainOptions, selectedChainId]);
50
- return /* @__PURE__ */ jsx("div", { className: "styled-chain-select", "data-testid": "chainDropdown", children: /* @__PURE__ */ jsx(
51
- Select,
39
+ }), t;
40
+ }, [m]), c = e(() => i.find(
41
+ (t) => t.value.toString() === (o == null ? void 0 : o.toString())
42
+ ) ?? (i == null ? void 0 : i[0]), [i, o]);
43
+ return /* @__PURE__ */ n("div", { className: "styled-chain-select", "data-testid": "chainDropdown", children: /* @__PURE__ */ n(
44
+ f,
52
45
  {
53
46
  className: "basic-single",
54
47
  classNamePrefix: "styled-chain-select",
55
48
  maxMenuHeight: 260,
56
- value: selectedChain,
57
- isLoading,
49
+ value: c,
50
+ isLoading: p,
58
51
  styles: {
59
- indicatorSeparator: IndicatorSeparator,
60
- control: (css) => ({
61
- ...css,
52
+ indicatorSeparator: v,
53
+ control: (t) => ({
54
+ ...t,
62
55
  width: "max-content",
63
56
  minWidth: "100%",
64
57
  maxWidth: "10rem"
65
58
  }),
66
- menu: (css) => ({
67
- ...css,
59
+ menu: (t) => ({
60
+ ...t,
68
61
  zIndex: 9999,
69
62
  width: "max-content",
70
63
  minWidth: "100%",
71
64
  right: 0
72
65
  })
73
66
  },
74
- isSearchable: true,
67
+ isSearchable: !0,
75
68
  name: "chain",
76
- options: chainOptions,
77
- onChange: (selectedOption) => {
78
- var _a, _b;
79
- if ((_a = selectedOption == null ? void 0 : selectedOption.chain) == null ? void 0 : _a.id) {
80
- onChange == null ? void 0 : onChange((_b = selectedOption.chain) == null ? void 0 : _b.id.toString());
81
- }
69
+ options: i,
70
+ onChange: (t) => {
71
+ var r, l;
72
+ (r = t == null ? void 0 : t.chain) != null && r.id && (a == null || a((l = t.chain) == null ? void 0 : l.id.toString()));
82
73
  },
83
- isMulti: false,
84
- formatOptionLabel: FormatChainOptionLabel,
74
+ isMulti: !1,
75
+ formatOptionLabel: g,
85
76
  components: {
86
77
  Input: () => null,
87
- SingleValue: SelectedChainOption
78
+ SingleValue: S
88
79
  }
89
80
  }
90
81
  ) });
91
82
  };
92
83
  export {
93
- ChainSelect
84
+ W as ChainSelect
94
85
  };
@@ -1,52 +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
- require("@multiversx/sdk-dapp-utils/out/helpers/formatAmount");
6
- require("@multiversx/sdk-dapp-utils/out/helpers/stringIsInteger");
7
- require("bignumber.js");
8
- require("../../../../../constants/index.js");
9
- require("@multiversx/sdk-dapp-utils/out/helpers/parseAmount");
10
- const reactjs_utils_mxClsx = require("../../../../../utils/mxClsx.js");
11
- const allNetworks = require("../../../../../../all-networks-NYACMyeN.js");
12
- const reactjs_constants_chains = require("../../../../../constants/chains.js");
13
- const ChainOptionLabel = ({
14
- chain,
15
- inDropdown = false
16
- }) => {
17
- const inDropdownClass = inDropdown ? "in-dropdown" : "hidden md:flex";
18
- return /* @__PURE__ */ jsxRuntime.jsx(
19
- "div",
20
- {
21
- className: `chain-element liq-flex liq-items-center liq-justify-between`,
22
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "liq-flex liq-flex-row liq-items-center", children: [
23
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: `chain-image liq-mr-2 ${inDropdownClass}`, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "liq-h-6 liq-w-6 liq-flex-shrink-0 liq-overflow-hidden", children: chain.pngUrl ? /* @__PURE__ */ jsxRuntime.jsx(
24
- "img",
25
- {
26
- src: chain.pngUrl ?? reactjs_constants_chains.chainIdentifier[chain.name],
27
- alt: "",
28
- loading: "lazy",
29
- className: reactjs_utils_mxClsx.mxClsx("liq-h-full liq-w-full", {
30
- "liq-rounded-lg": chain.id !== reactjs_constants_chains.ALL_NETWORK_ID
31
- })
32
- }
33
- ) : /* @__PURE__ */ jsxRuntime.jsx(
34
- "img",
35
- {
36
- src: allNetworks.AllNetworks,
37
- alt: "",
38
- className: "liq-h-full liq-w-full"
39
- }
40
- ) }) }),
41
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "liq-flex liq-flex-col", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "liq-flex liq-items-center", children: /* @__PURE__ */ jsxRuntime.jsx(
42
- "div",
43
- {
44
- className: "chain-name liq-flex liq-items-center liq-gap-2 liq-whitespace-nowrap",
45
- children: chain.networkName
46
- }
47
- ) }) })
48
- ] })
49
- }
50
- );
51
- };
52
- exports.ChainOptionLabel = ChainOptionLabel;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("@multiversx/sdk-dapp-utils/out/helpers/formatAmount");require("@multiversx/sdk-dapp-utils/out/helpers/stringIsInteger");require("bignumber.js");require("../../../../../constants/index.js");require("@multiversx/sdk-dapp-utils/out/helpers/parseAmount");const n=require("../../../../../utils/mxClsx.js"),a=require("../../../../../../helpers/safeImageUrl.js"),t=require("../../../../../../all-networks--dfVLHLJ.js"),i=require("../../../../../constants/chains.js"),c=({chain:l,inDropdown:s=!1})=>{const r=s?"in-dropdown":"hidden md:flex";return e.jsx("div",{className:"chain-element liq-flex liq-items-center liq-justify-between",children:e.jsxs("div",{className:"liq-flex liq-flex-row liq-items-center",children:[e.jsx("div",{className:`chain-image liq-mr-2 ${r}`,children:e.jsx("div",{className:"liq-h-6 liq-w-6 liq-flex-shrink-0 liq-overflow-hidden",children:l.pngUrl?e.jsx("img",{src:a.safeImageUrl(l.pngUrl,i.chainIdentifier[l.name]),alt:"",loading:"lazy",className:n.mxClsx("liq-h-full liq-w-full",{"liq-rounded-lg":l.id!==i.ALL_NETWORK_ID})}):e.jsx("img",{src:t.AllNetworks,alt:"",className:"liq-h-full liq-w-full"})})}),e.jsx("div",{className:"liq-flex liq-flex-col",children:e.jsx("div",{className:"liq-flex liq-items-center",children:e.jsx("div",{className:"chain-name liq-flex liq-items-center liq-gap-2 liq-whitespace-nowrap",children:l.networkName})})})]})})};exports.ChainOptionLabel=c;