@multiversx/sdk-dapp-liquidity 1.1.0-alpha.3 → 1.1.0-alpha.30

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 (447) hide show
  1. package/README.md +6 -1
  2. package/api/getTransactions.d.ts +8 -2
  3. package/api/getTransactions.js +23 -3
  4. package/api/getTransactions.mjs +23 -3
  5. package/api/tests/getChains.spec.js +2 -1
  6. package/api/tests/getChains.spec.mjs +2 -1
  7. package/api/tests/getTokens.spec.js +2 -2
  8. package/api/tests/getTokens.spec.mjs +2 -2
  9. package/api/tests/getTransactions.spec.js +79 -69
  10. package/api/tests/getTransactions.spec.mjs +79 -69
  11. package/constants/index.d.ts +1 -1
  12. package/constants/index.js +1 -1
  13. package/constants/index.mjs +1 -1
  14. package/dto/Chain.dto.d.ts +3 -1
  15. package/dto/ConfirmRate.dto.d.ts +1 -0
  16. package/dto/Token.dto.d.ts +6 -2
  17. package/dto/Transaction.dto.d.ts +1 -0
  18. package/index.js +42 -16
  19. package/index.mjs +12 -16
  20. package/package.json +10 -6
  21. package/reactjs/components/BridgeForm/BridgeForm.d.ts +6 -1
  22. package/reactjs/components/BridgeForm/BridgeForm.js +210 -88
  23. package/reactjs/components/BridgeForm/BridgeForm.mjs +183 -61
  24. package/reactjs/components/BridgeHistory/BridgeHistory.js +73 -26
  25. package/reactjs/components/BridgeHistory/BridgeHistory.mjs +68 -21
  26. package/reactjs/components/Connect/BridgeAccountDisplay.js +2 -6
  27. package/reactjs/components/Connect/BridgeAccountDisplay.mjs +2 -6
  28. package/reactjs/components/Connect/CustomConnectButton.js +2 -6
  29. package/reactjs/components/Connect/CustomConnectButton.mjs +1 -5
  30. package/reactjs/components/Connect/MvxConnectButton.d.ts +2 -4
  31. package/reactjs/components/Connect/MvxConnectButton.js +2 -2
  32. package/reactjs/components/Connect/MvxConnectButton.mjs +2 -2
  33. package/reactjs/components/Connect/SwitchChainButton.js +2 -7
  34. package/reactjs/components/Connect/SwitchChainButton.mjs +1 -6
  35. package/reactjs/components/CopyButton/CopyButton.js +2 -2
  36. package/reactjs/components/CopyButton/CopyButton.mjs +2 -2
  37. package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.js +5 -5
  38. package/reactjs/components/TokenSelector/TokenSelector.d.ts +2 -1
  39. package/reactjs/components/TokenSelector/TokenSelector.js +17 -9
  40. package/reactjs/components/TokenSelector/TokenSelector.mjs +13 -5
  41. package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.d.ts +2 -1
  42. package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.js +7 -3
  43. package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.mjs +4 -0
  44. package/reactjs/components/TokenSelector/components/SelectContent.d.ts +2 -1
  45. package/reactjs/components/TokenSelector/components/SelectContent.js +12 -9
  46. package/reactjs/components/TokenSelector/components/SelectContent.mjs +4 -1
  47. package/reactjs/components/TokenSelector/components/TokenIcon.js +3 -3
  48. package/reactjs/components/TokenSelector/components/TokenItem.js +9 -9
  49. package/reactjs/components/TokenSelector/components/TokenItem.mjs +6 -6
  50. package/reactjs/components/base/MxCard/MxCard.js +2 -2
  51. package/reactjs/components/base/MxCircleLoader/MxCircleLoader.d.ts +4 -0
  52. package/reactjs/components/base/MxCircleLoader/MxCircleLoader.js +29 -0
  53. package/reactjs/components/base/MxCircleLoader/MxCircleLoader.mjs +28 -0
  54. package/reactjs/components/base/MxCircleLoader/index.d.ts +1 -0
  55. package/reactjs/components/base/MxCircleLoader/index.js +5 -0
  56. package/reactjs/components/base/MxCircleLoader/index.mjs +4 -0
  57. package/reactjs/components/base/MxLink/MxLink.js +2 -2
  58. package/reactjs/components/base/MxSearch/MxSearch.js +4 -4
  59. package/reactjs/components/base/MxSlideover/MxSlideover.js +4 -4
  60. package/reactjs/components/base/MxTooltip/MxTooltip.js +9 -9
  61. package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.js +2 -2
  62. package/reactjs/context/Web3AppProvider.d.ts +3 -1
  63. package/reactjs/context/Web3AppProvider.js +7 -5
  64. package/reactjs/context/Web3AppProvider.mjs +4 -2
  65. package/reactjs/context/useWeb3App.js +2 -2
  66. package/reactjs/hooks/index.js +1 -1
  67. package/reactjs/hooks/index.mjs +1 -1
  68. package/reactjs/hooks/useAccount.js +1 -6
  69. package/reactjs/hooks/useAccount.mjs +1 -6
  70. package/reactjs/hooks/useBalances.d.ts +1 -3
  71. package/reactjs/hooks/useBalances.js +16 -1
  72. package/reactjs/hooks/useBalances.mjs +16 -1
  73. package/reactjs/hooks/useBridgeFormik.js +9 -16
  74. package/reactjs/hooks/useBridgeFormik.mjs +0 -7
  75. package/reactjs/hooks/useDebounce.js +3 -3
  76. package/reactjs/hooks/useFetchBridgeData.d.ts +12 -5
  77. package/reactjs/hooks/useFetchBridgeData.js +0 -2
  78. package/reactjs/hooks/useFetchBridgeData.mjs +0 -2
  79. package/reactjs/hooks/useFetchTokens.d.ts +12 -5
  80. package/reactjs/hooks/useFetchTokens.js +8 -12
  81. package/reactjs/hooks/useFetchTokens.mjs +2 -6
  82. package/reactjs/hooks/useFiatData.d.ts +6 -2
  83. package/reactjs/hooks/useFiatData.js +6 -6
  84. package/reactjs/hooks/useFiatData.mjs +1 -1
  85. package/reactjs/hooks/useGetChainId.js +3 -3
  86. package/reactjs/hooks/useGetChainId.mjs +1 -1
  87. package/reactjs/hooks/useResolveTokenChain.js +2 -2
  88. package/reactjs/hooks/useSendTransactions.js +2 -2
  89. package/reactjs/hooks/useSignTransaction.d.ts +93 -67
  90. package/reactjs/hooks/useSignTransaction.js +53 -4
  91. package/reactjs/hooks/useSignTransaction.mjs +53 -4
  92. package/reactjs/hooks/validation/useTestHasEnoughFunds.js +3 -3
  93. package/reactjs/hooks/validation/useTestIsConnected.js +2 -2
  94. package/reactjs/index.js +42 -16
  95. package/reactjs/index.mjs +12 -16
  96. package/reactjs/init/init.d.ts +220 -1
  97. package/reactjs/init/init.js +34 -10
  98. package/reactjs/init/init.mjs +31 -7
  99. package/reactjs/init/tests/init.spec.js +5 -6
  100. package/reactjs/init/tests/init.spec.mjs +5 -6
  101. package/reactjs/queries/index.d.ts +0 -1
  102. package/reactjs/queries/index.js +0 -2
  103. package/reactjs/queries/index.mjs +1 -3
  104. package/reactjs/queries/useGetEvmTokensBalances.query.d.ts +6 -2
  105. package/reactjs/queries/useGetEvmTokensBalances.query.js +5 -9
  106. package/reactjs/queries/useGetEvmTokensBalances.query.mjs +5 -9
  107. package/reactjs/queries/useGetHistory.query.d.ts +9 -1
  108. package/reactjs/queries/useGetHistory.query.js +23 -5
  109. package/reactjs/queries/useGetHistory.query.mjs +23 -5
  110. package/reactjs/queries/useGetMvxTokensBalances.query.d.ts +6 -2
  111. package/reactjs/queries/useGetMvxTokensBalances.query.js +2 -2
  112. package/reactjs/reexports.d.ts +2 -1
  113. package/reactjs/reexports.js +41 -13
  114. package/reactjs/reexports.mjs +11 -13
  115. package/reactjs/utils/getInitialTokens.d.ts +4 -1
  116. package/reactjs/utils/getInitialTokens.js +3 -3
  117. package/reactjs/utils/getInitialTokens.mjs +3 -3
  118. package/style.css +23 -1740
  119. package/types/chainType.d.ts +6 -0
  120. package/types/chainType.js +11 -0
  121. package/types/chainType.mjs +10 -0
  122. package/types/providerType.d.ts +1 -1
  123. package/types/providerType.js +1 -1
  124. package/types/providerType.mjs +1 -1
  125. package/types/transaction.d.ts +28 -0
  126. package/types/utxo.d.ts +11 -0
  127. package/types/utxo.js +2 -0
  128. package/types/utxo.mjs +1 -0
  129. package/{useBalances-rRug6Uza.mjs → useBalances-BWufkhuy.mjs} +94 -14
  130. package/{useBalances-CMixgIRU.js → useBalances-BwQplEkY.js} +95 -15
  131. package/add-3BCUvSCt.mjs +0 -19
  132. package/add-DCeZeenO.js +0 -20
  133. package/all-wallets-BmgBKRug.js +0 -11
  134. package/all-wallets-FKmNZ66z.mjs +0 -10
  135. package/app-store-CbYWgqmd.mjs +0 -21
  136. package/app-store-D_5F0mR4.js +0 -22
  137. package/apple-8B_b8kAc.mjs +0 -22
  138. package/apple-BwYB0tMQ.js +0 -23
  139. package/arrow-bottom-3XtFygVb.mjs +0 -12
  140. package/arrow-bottom-B4l4HJCy.js +0 -13
  141. package/arrow-bottom-circle-BnvomGtz.mjs +0 -15
  142. package/arrow-bottom-circle-KobZJ_fK.js +0 -16
  143. package/arrow-left-CjiJwBax.js +0 -13
  144. package/arrow-left-DbIgXHar.mjs +0 -12
  145. package/arrow-right-Bhg8xM3d.mjs +0 -12
  146. package/arrow-right-xU29L0ax.js +0 -13
  147. package/arrow-top-CSBKtLZo.js +0 -13
  148. package/arrow-top-DZqppJV1.mjs +0 -12
  149. package/bank-DJAILbNs.js +0 -19
  150. package/bank-wBrvs4Uk.mjs +0 -18
  151. package/bitcoin-DsA7-exS.mjs +0 -3541
  152. package/bitcoin-ymxJHn-_.js +0 -3541
  153. package/browser-CMwRVF9i.mjs +0 -18
  154. package/browser-DN2v3wtx.js +0 -19
  155. package/card-DCJLvVxE.js +0 -19
  156. package/card-le6hOsaj.mjs +0 -18
  157. package/checkmark-Cp3aAXtY.js +0 -16
  158. package/checkmark-DrMAKEwB.mjs +0 -15
  159. package/checkmark-bold-Ck4iDbtx.mjs +0 -12
  160. package/checkmark-bold-Doo1m0AX.js +0 -13
  161. package/chevron-bottom-D7BdJX-N.mjs +0 -12
  162. package/chevron-bottom-njC8Ngo9.js +0 -13
  163. package/chevron-left-C276To1p.mjs +0 -12
  164. package/chevron-left-DFqStS4C.js +0 -13
  165. package/chevron-right-BEaNKTUI.js +0 -13
  166. package/chevron-right-BLKwojDw.mjs +0 -12
  167. package/chevron-top-B7MGJq4-.mjs +0 -12
  168. package/chevron-top-Cwq1_meI.js +0 -13
  169. package/chrome-store-C5TevyVh.mjs +0 -65
  170. package/chrome-store-CMNN4-HT.js +0 -66
  171. package/clock-DJj9e3f9.js +0 -13
  172. package/clock-DzimdgI_.mjs +0 -12
  173. package/close-B157dUQ4.mjs +0 -12
  174. package/close-BxR6tB8U.js +0 -13
  175. package/coinPlaceholder-BVW1uvlR.js +0 -13
  176. package/coinPlaceholder-HBSLiUFH.mjs +0 -12
  177. package/compass-BYgmipOo.js +0 -13
  178. package/compass-DjjI5p4A.mjs +0 -12
  179. package/copy-as55vt-p.mjs +0 -19
  180. package/copy-ePIIYpzl.js +0 -20
  181. package/cursor-CFB-aeND.mjs +0 -7
  182. package/cursor-WCsVGQ3k.js +0 -8
  183. package/cursor-transparent-BeW4FJeS.js +0 -17
  184. package/cursor-transparent-UnLsX6vO.mjs +0 -16
  185. package/desktop-CZVMMlzv.js +0 -14
  186. package/desktop-CjnJn_bw.mjs +0 -13
  187. package/disconnect-CCFuuni4.js +0 -13
  188. package/disconnect-DULDFd8b.mjs +0 -12
  189. package/discord-BqNqFTBk.mjs +0 -21
  190. package/discord-NuyHZRR6.js +0 -22
  191. package/email-DGaF-62q.mjs +0 -797
  192. package/email-hzM1YeAa.js +0 -793
  193. package/embedded-wallet-ChKT2Kqi.mjs +0 -550
  194. package/embedded-wallet-DqTVtI_b.js +0 -547
  195. package/etherscan-CEsSVAq2.mjs +0 -10
  196. package/etherscan-Ds9nq6I4.js +0 -11
  197. package/exclamation-triangle-CUPVSfox.js +0 -9
  198. package/exclamation-triangle-EcsUlgU6.mjs +0 -8
  199. package/extension-BR4NlDwD.js +0 -13
  200. package/extension-CLHZhCSN.mjs +0 -12
  201. package/external-link-CRYOg_me.mjs +0 -12
  202. package/external-link-CWIkl3WV.js +0 -13
  203. package/facebook-ACv8F_-T.js +0 -31
  204. package/facebook-Cu3fhUsY.mjs +0 -30
  205. package/farcaster-D5ZOGlcT.mjs +0 -16
  206. package/farcaster-DfNCB-wN.js +0 -17
  207. package/filters-CNI5jsrU.js +0 -13
  208. package/filters-CdM5otRV.mjs +0 -12
  209. package/github-BEf292I1.mjs +0 -22
  210. package/github-Do7sWgv8.js +0 -23
  211. package/google-BODDgJTL.mjs +0 -22
  212. package/google-Cj3O62wM.js +0 -23
  213. package/help-circle-Ci498tJe.js +0 -17
  214. package/help-circle-DBELxJch.mjs +0 -16
  215. package/id-Cqn2I8pT.mjs +0 -16
  216. package/id-DFT-uV99.js +0 -17
  217. package/if-defined-D2_GrpzG.mjs +0 -808
  218. package/if-defined-DCNi9_tU.js +0 -808
  219. package/image-BL7nQSxN.mjs +0 -8
  220. package/image-yi8kMU8J.js +0 -9
  221. package/index-B2Hy-NF2.js +0 -97
  222. package/index-BBplfur6.js +0 -258
  223. package/index-BQ73fcgT.mjs +0 -101
  224. package/index-BQwRt9K1.mjs +0 -276
  225. package/index-BUD5aDnu.js +0 -682
  226. package/index-BaXPSDqe.js +0 -273
  227. package/index-BnIkKri-.mjs +0 -82
  228. package/index-Bohb3kl3.mjs +0 -108
  229. package/index-BwuR3kQH.mjs +0 -680
  230. package/index-BxxcuVMn.js +0 -152
  231. package/index-BypiLvRj.mjs +0 -273
  232. package/index-BzKWxdW7.js +0 -178
  233. package/index-C9-3nLnD.js +0 -103
  234. package/index-CLYqnLiQ.mjs +0 -9536
  235. package/index-CNlRmIrd.mjs +0 -55
  236. package/index-CQGOi3YP.js +0 -108
  237. package/index-CQHTMX2w.js +0 -57
  238. package/index-CQjirRvY.js +0 -166
  239. package/index-CWq1hi6D.js +0 -144
  240. package/index-CgEo1493.mjs +0 -101
  241. package/index-Cjb3mozL.mjs +0 -344
  242. package/index-CkXs2_JU.js +0 -814
  243. package/index-CvB1dQL-.mjs +0 -259
  244. package/index-CznIs6Ri.js +0 -344
  245. package/index-D5y2sPuX.mjs +0 -145
  246. package/index-D6oVv_xe.mjs +0 -176
  247. package/index-D77dZTM-.js +0 -101
  248. package/index-D7Crgb92.mjs +0 -166
  249. package/index-D9IfhMQO.js +0 -72
  250. package/index-DAPHrvyl.mjs +0 -566
  251. package/index-DCUKGebw.mjs +0 -812
  252. package/index-DM3a8Cxg.js +0 -331
  253. package/index-DQTDWPkK.js +0 -566
  254. package/index-Dbvu7_7E.js +0 -59
  255. package/index-DjK2gI38.mjs +0 -329
  256. package/index-DjVDwKyw.js +0 -278
  257. package/index-Dl21qlpM.js +0 -84
  258. package/index-Dy1_qaPl.mjs +0 -62
  259. package/index-DzQCeKKr.mjs +0 -95
  260. package/index-GDRRLbhM.mjs +0 -150
  261. package/index-KbSTzPJK.mjs +0 -57
  262. package/index-NJGuA8Hd.js +0 -64
  263. package/index-TtX6sKdt.js +0 -2237
  264. package/index-iL3P2-q2.mjs +0 -70
  265. package/index-j6sdnIsO.js +0 -9510
  266. package/index-jtBCZMfH.mjs +0 -263
  267. package/index-miYE8X37.mjs +0 -2235
  268. package/index-tRphky_g.js +0 -265
  269. package/info-CyIx65VL.mjs +0 -7
  270. package/info-GFfmaB2U.js +0 -8
  271. package/info-circle-BJebXoVk.js +0 -17
  272. package/info-circle-DEoF1MBl.mjs +0 -16
  273. package/lightbulb-BPKMbZZM.js +0 -8
  274. package/lightbulb-Bmy3we8u.mjs +0 -7
  275. package/mail-CQyo-njh.mjs +0 -12
  276. package/mail-RqhzZO28.js +0 -13
  277. package/mobile--nS-soHG.mjs +0 -13
  278. package/mobile-CySJYCCl.js +0 -14
  279. package/modules/fiat/components/FiatForm/FiatForm.d.ts +0 -9
  280. package/modules/fiat/components/FiatForm/FiatForm.js +0 -334
  281. package/modules/fiat/components/FiatForm/FiatForm.mjs +0 -333
  282. package/modules/fiat/components/FiatForm/components/AmountInput/AmountInput.d.ts +0 -13
  283. package/modules/fiat/components/FiatForm/components/AmountInput/AmountInput.js +0 -120
  284. package/modules/fiat/components/FiatForm/components/AmountInput/AmountInput.mjs +0 -119
  285. package/modules/fiat/components/FiatForm/components/AmountInput/index.d.ts +0 -1
  286. package/modules/fiat/components/FiatForm/components/AmountInput/index.js +0 -5
  287. package/modules/fiat/components/FiatForm/components/AmountInput/index.mjs +0 -4
  288. package/modules/fiat/components/FiatForm/components/Payment/PaymentForm.d.ts +0 -6
  289. package/modules/fiat/components/FiatForm/components/Payment/PaymentForm.js +0 -164
  290. package/modules/fiat/components/FiatForm/components/Payment/PaymentForm.mjs +0 -163
  291. package/modules/fiat/components/FiatForm/components/Payment/PaymentFrame.d.ts +0 -7
  292. package/modules/fiat/components/FiatForm/components/Payment/PaymentFrame.js +0 -100
  293. package/modules/fiat/components/FiatForm/components/Payment/PaymentFrame.mjs +0 -99
  294. package/modules/fiat/components/FiatForm/components/RateReloading/RateReloading.d.ts +0 -7
  295. package/modules/fiat/components/FiatForm/components/RateReloading/RateReloading.js +0 -74
  296. package/modules/fiat/components/FiatForm/components/RateReloading/RateReloading.mjs +0 -73
  297. package/modules/fiat/components/FiatForm/components/TokenSelector/TokenSelector.d.ts +0 -14
  298. package/modules/fiat/components/FiatForm/components/TokenSelector/TokenSelector.js +0 -94
  299. package/modules/fiat/components/FiatForm/components/TokenSelector/TokenSelector.mjs +0 -93
  300. package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContainer.d.ts +0 -7
  301. package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContainer.js +0 -85
  302. package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContainer.mjs +0 -84
  303. package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContent.d.ts +0 -7
  304. package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContent.js +0 -94
  305. package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectContent.mjs +0 -93
  306. package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectedOption.d.ts +0 -5
  307. package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectedOption.js +0 -30
  308. package/modules/fiat/components/FiatForm/components/TokenSelector/components/SelectedOption.mjs +0 -29
  309. package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenIcon.d.ts +0 -8
  310. package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenIcon.js +0 -106
  311. package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenIcon.mjs +0 -105
  312. package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenItem.d.ts +0 -7
  313. package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenItem.js +0 -33
  314. package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenItem.mjs +0 -32
  315. package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenList.d.ts +0 -7
  316. package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenList.js +0 -21
  317. package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenList.mjs +0 -20
  318. package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenSymbol.d.ts +0 -9
  319. package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenSymbol.js +0 -26
  320. package/modules/fiat/components/FiatForm/components/TokenSelector/components/TokenSymbol.mjs +0 -25
  321. package/modules/fiat/components/FiatForm/components/TokenSelector/index.d.ts +0 -1
  322. package/modules/fiat/components/FiatForm/components/TokenSelector/index.js +0 -5
  323. package/modules/fiat/components/FiatForm/components/TokenSelector/index.mjs +0 -4
  324. package/modules/fiat/components/FiatForm/index.d.ts +0 -1
  325. package/modules/fiat/components/FiatForm/index.js +0 -5
  326. package/modules/fiat/components/FiatForm/index.mjs +0 -4
  327. package/modules/fiat/components/index.d.ts +0 -1
  328. package/modules/fiat/components/index.js +0 -5
  329. package/modules/fiat/components/index.mjs +0 -4
  330. package/modules/fiat/context/FiatProvider.d.ts +0 -8
  331. package/modules/fiat/context/FiatProvider.js +0 -24
  332. package/modules/fiat/context/FiatProvider.mjs +0 -23
  333. package/modules/fiat/context/queryClient.d.ts +0 -3
  334. package/modules/fiat/context/queryClient.js +0 -12
  335. package/modules/fiat/context/queryClient.mjs +0 -11
  336. package/modules/fiat/context/useFiat.d.ts +0 -1
  337. package/modules/fiat/context/useFiat.js +0 -13
  338. package/modules/fiat/context/useFiat.mjs +0 -12
  339. package/modules/fiat/hooks/index.d.ts +0 -2
  340. package/modules/fiat/hooks/index.js +0 -7
  341. package/modules/fiat/hooks/index.mjs +0 -6
  342. package/modules/fiat/hooks/useFiatData.d.ts +0 -7
  343. package/modules/fiat/hooks/useFiatData.js +0 -78
  344. package/modules/fiat/hooks/useFiatData.mjs +0 -77
  345. package/modules/fiat/hooks/validation/index.d.ts +0 -1
  346. package/modules/fiat/hooks/validation/index.js +0 -5
  347. package/modules/fiat/hooks/validation/index.mjs +0 -4
  348. package/modules/fiat/hooks/validation/useAmountSchema.d.ts +0 -2
  349. package/modules/fiat/hooks/validation/useAmountSchema.js +0 -27
  350. package/modules/fiat/hooks/validation/useAmountSchema.mjs +0 -9
  351. package/modules/fiat/index.d.ts +0 -8
  352. package/modules/fiat/index.js +0 -22
  353. package/modules/fiat/index.mjs +0 -21
  354. package/modules/fiat/init/index.d.ts +0 -2
  355. package/modules/fiat/init/index.js +0 -5
  356. package/modules/fiat/init/index.mjs +0 -4
  357. package/modules/fiat/init/init.d.ts +0 -22
  358. package/modules/fiat/init/init.js +0 -15
  359. package/modules/fiat/init/init.mjs +0 -14
  360. package/modules/fiat/queries/index.d.ts +0 -2
  361. package/modules/fiat/queries/index.js +0 -7
  362. package/modules/fiat/queries/index.mjs +0 -6
  363. package/modules/fiat/queries/useGetRate.mutation.d.ts +0 -6
  364. package/modules/fiat/queries/useGetRate.mutation.js +0 -20
  365. package/modules/fiat/queries/useGetRate.mutation.mjs +0 -19
  366. package/modules/fiat/queries/useGetTokens.query.d.ts +0 -5
  367. package/modules/fiat/queries/useGetTokens.query.js +0 -33
  368. package/modules/fiat/queries/useGetTokens.query.mjs +0 -32
  369. package/more-CwWZDDBg.mjs +0 -15
  370. package/more-bZ0pd89b.js +0 -16
  371. package/network-placeholder-BHCmKrry.mjs +0 -18
  372. package/network-placeholder-aJGrqpCg.js +0 -19
  373. package/nftPlaceholder-CGLCdnta.js +0 -13
  374. package/nftPlaceholder-pidG99wt.mjs +0 -12
  375. package/off-DqIdiRvr.mjs +0 -12
  376. package/off-Dzc0O-PN.js +0 -13
  377. package/onramp-CU3WpHjP.mjs +0 -1593
  378. package/onramp-DpdybYx8.js +0 -1587
  379. package/play-store-C5Gl454J.mjs +0 -36
  380. package/play-store-CMtGhNVv.js +0 -37
  381. package/plus-BYok4L2w.js +0 -18
  382. package/plus-DcQZoixB.mjs +0 -17
  383. package/qr-code-D8jk7hh0.mjs +0 -10
  384. package/qr-code-wHRs9uHL.js +0 -11
  385. package/react-BT74Hcah.js +0 -6078
  386. package/react-C6QSQYzA.js +0 -254
  387. package/react-CrzHxs1H.mjs +0 -25357
  388. package/react-DmVF9JBF.mjs +0 -6078
  389. package/react-Dz0FNS2o.js +0 -25357
  390. package/react-ICzqG8J6.mjs +0 -254
  391. package/reactjs/queries/useGetTokens.query.d.ts +0 -3
  392. package/reactjs/queries/useGetTokens.query.js +0 -34
  393. package/reactjs/queries/useGetTokens.query.mjs +0 -33
  394. package/receive-Cf90xf32.mjs +0 -216
  395. package/receive-_Qf98a76.js +0 -216
  396. package/recycle-horizontal-DGj7Ya8u.js +0 -14
  397. package/recycle-horizontal-jbMIQBSA.mjs +0 -13
  398. package/refresh-C3z4X6Ra.mjs +0 -12
  399. package/refresh-D20w1bR5.js +0 -13
  400. package/reown-logo-BtryrZ0M.js +0 -17
  401. package/reown-logo-MOOHjLJG.mjs +0 -16
  402. package/search-C8qQ2OF_.js +0 -13
  403. package/search-CiVHywyX.mjs +0 -12
  404. package/send-C8kIbx5x.js +0 -1191
  405. package/send-CJ5uA96d.mjs +0 -19
  406. package/send-CSVxya54.js +0 -20
  407. package/send-CW2bf2qU.mjs +0 -1193
  408. package/socials-Bs3xjhwd.js +0 -723
  409. package/socials-CTeVPgpO.mjs +0 -725
  410. package/swapHorizontal-B1XnljWk.mjs +0 -12
  411. package/swapHorizontal-DoBOwYma.js +0 -13
  412. package/swapHorizontalBold-ChRdyrAc.js +0 -13
  413. package/swapHorizontalBold-ZOXPzU3l.mjs +0 -12
  414. package/swapHorizontalMedium-7Vh6jM1i.mjs +0 -20
  415. package/swapHorizontalMedium-KEiACy_f.js +0 -21
  416. package/swapHorizontalRoundedBold-BBvIWuGE.js +0 -13
  417. package/swapHorizontalRoundedBold-BGQ_C_tG.mjs +0 -12
  418. package/swapVertical-DdtnITSU.js +0 -13
  419. package/swapVertical-DyamFXFs.mjs +0 -12
  420. package/swaps-D-RYqPMm.js +0 -1906
  421. package/swaps-DkOwtcRc.mjs +0 -1908
  422. package/telegram-BtkXg1RW.js +0 -21
  423. package/telegram-f99qesxc.mjs +0 -20
  424. package/three-dots-BeUcfBGZ.js +0 -10
  425. package/three-dots-DKR049e7.mjs +0 -9
  426. package/transactions-BPLEtw2I.mjs +0 -37
  427. package/transactions-CuvH3fXr.js +0 -37
  428. package/twitch-9WJ7_BtK.mjs +0 -22
  429. package/twitch-SzeD1x5u.js +0 -23
  430. package/twitterIcon-BZ0-__04.js +0 -11
  431. package/twitterIcon-DOu4wRVw.mjs +0 -10
  432. package/verify-BBbz--_D.js +0 -13
  433. package/verify-CZlhDs-b.mjs +0 -12
  434. package/verify-filled-3kQkfAKY.mjs +0 -12
  435. package/verify-filled-D6lQnTMX.js +0 -13
  436. package/w3m-modal-B8pbabeE.js +0 -1208
  437. package/w3m-modal-D6o_n4pP.mjs +0 -1208
  438. package/wallet-CBn7xnZU.mjs +0 -12
  439. package/wallet-DSfjOp5r.js +0 -13
  440. package/wallet-placeholder-BhTS6W-G.js +0 -19
  441. package/wallet-placeholder-LgcirFmF.mjs +0 -18
  442. package/walletconnect-5VFb1-rC.js +0 -39
  443. package/walletconnect-Boo6bRXF.mjs +0 -38
  444. package/warning-circle-CDQm5SB6.mjs +0 -16
  445. package/warning-circle-CHLQICdy.js +0 -17
  446. package/x-B6ycL_Yp.js +0 -17
  447. package/x-DxSIKaVH.mjs +0 -16
package/README.md CHANGED
@@ -183,4 +183,9 @@ const App = () => {
183
183
  </Web3AppProvider>
184
184
  )
185
185
  }
186
- ```
186
+ ```
187
+
188
+ ## Disclaimer
189
+
190
+ 1. This package is in active development and is subject to change. We recommend to check the latest version and update your code accordingly.
191
+ 2. This package is not fully supported on the Next.js framework. We are working on a solution to make it compatible with Next.js.
@@ -1,7 +1,13 @@
1
+ import { ProviderType } from 'types/providerType';
1
2
  import { TransactionDTO } from 'dto/Transaction.dto';
2
3
  import { AxiosResponse } from 'axios';
3
4
 
4
- export declare function getTransactions({ url, userWalletAddress }: {
5
+ export declare function getTransactions({ url, address, sender, provider, status, tokenIn, tokenOut }: {
5
6
  url: string;
6
- userWalletAddress: string;
7
+ address: string;
8
+ sender?: string;
9
+ provider?: ProviderType;
10
+ status?: string;
11
+ tokenIn?: string;
12
+ tokenOut?: string;
7
13
  }): Promise<AxiosResponse<TransactionDTO[]>>;
@@ -4,10 +4,30 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
4
  const axios = require("axios");
5
5
  async function getTransactions({
6
6
  url,
7
- userWalletAddress
7
+ address,
8
+ sender,
9
+ provider,
10
+ status,
11
+ tokenIn,
12
+ tokenOut
8
13
  }) {
9
- const endpoint = userWalletAddress ? `/transactions/${userWalletAddress}` : "/transactions";
10
- return await axios.get(endpoint, {
14
+ const queryParams = new URLSearchParams({
15
+ receiver: address || "",
16
+ sender: sender || "",
17
+ provider: provider || "",
18
+ status: status || "",
19
+ tokenIn: tokenIn || "",
20
+ tokenOut: tokenOut || ""
21
+ });
22
+ const params = Object.entries(Object.fromEntries(queryParams.entries()));
23
+ for (const [key, value] of params) {
24
+ if (value === "") {
25
+ queryParams.delete(key);
26
+ }
27
+ }
28
+ const queryString = queryParams.toString();
29
+ const endpointWithParams = `/transactions?${queryString}`;
30
+ return await axios.get(endpointWithParams, {
11
31
  baseURL: url
12
32
  });
13
33
  }
@@ -1,10 +1,30 @@
1
1
  import axios from "axios";
2
2
  async function getTransactions({
3
3
  url,
4
- userWalletAddress
4
+ address,
5
+ sender,
6
+ provider,
7
+ status,
8
+ tokenIn,
9
+ tokenOut
5
10
  }) {
6
- const endpoint = userWalletAddress ? `/transactions/${userWalletAddress}` : "/transactions";
7
- return await axios.get(endpoint, {
11
+ const queryParams = new URLSearchParams({
12
+ receiver: address || "",
13
+ sender: sender || "",
14
+ provider: provider || "",
15
+ status: status || "",
16
+ tokenIn: tokenIn || "",
17
+ tokenOut: tokenOut || ""
18
+ });
19
+ const params = Object.entries(Object.fromEntries(queryParams.entries()));
20
+ for (const [key, value] of params) {
21
+ if (value === "") {
22
+ queryParams.delete(key);
23
+ }
24
+ }
25
+ const queryString = queryParams.toString();
26
+ const endpointWithParams = `/transactions?${queryString}`;
27
+ return await axios.get(endpointWithParams, {
8
28
  baseURL: url
9
29
  });
10
30
  }
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
3
  const axios = require("axios");
4
+ const types_chainType = require("../../types/chainType.js");
4
5
  const api_getChains = require("../getChains.js");
5
6
  jest.mock("axios");
6
7
  const mockedAxios = axios;
@@ -13,7 +14,7 @@ describe("getChains", () => {
13
14
  chainName: "msx",
14
15
  pngUrl: "https://devnet-tools.multiversx.com/liquidity-sdk/ethereum/icon.png",
15
16
  svgUrl: "https://devnet-tools.multiversx.com/liquidity-sdk/ethereum/icon.svg",
16
- chainType: "type1",
17
+ chainType: types_chainType.ChainType.evm,
17
18
  rpc: "rpc1",
18
19
  blockExplorerUrls: ["explorer1"],
19
20
  nativeCurrency: {
@@ -1,4 +1,5 @@
1
1
  import axios from "axios";
2
+ import { ChainType } from "../../types/chainType.mjs";
2
3
  import { getChains } from "../getChains.mjs";
3
4
  jest.mock("axios");
4
5
  const mockedAxios = axios;
@@ -11,7 +12,7 @@ describe("getChains", () => {
11
12
  chainName: "msx",
12
13
  pngUrl: "https://devnet-tools.multiversx.com/liquidity-sdk/ethereum/icon.png",
13
14
  svgUrl: "https://devnet-tools.multiversx.com/liquidity-sdk/ethereum/icon.svg",
14
- chainType: "type1",
15
+ chainType: ChainType.evm,
15
16
  rpc: "rpc1",
16
17
  blockExplorerUrls: ["explorer1"],
17
18
  nativeCurrency: {
@@ -9,7 +9,7 @@ describe("getTokens", () => {
9
9
  it("fetches tokens successfully without chainId", async () => {
10
10
  const response = [
11
11
  {
12
- chainId: 1,
12
+ chainId: "1",
13
13
  address: "0x123",
14
14
  name: "Token One",
15
15
  symbol: "T1",
@@ -32,7 +32,7 @@ describe("getTokens", () => {
32
32
  const chainId = 1;
33
33
  const response = [
34
34
  {
35
- chainId: 1,
35
+ chainId: "1",
36
36
  address: "0x123",
37
37
  name: "Token One",
38
38
  symbol: "T1",
@@ -7,7 +7,7 @@ describe("getTokens", () => {
7
7
  it("fetches tokens successfully without chainId", async () => {
8
8
  const response = [
9
9
  {
10
- chainId: 1,
10
+ chainId: "1",
11
11
  address: "0x123",
12
12
  name: "Token One",
13
13
  symbol: "T1",
@@ -30,7 +30,7 @@ describe("getTokens", () => {
30
30
  const chainId = 1;
31
31
  const response = [
32
32
  {
33
- chainId: 1,
33
+ chainId: "1",
34
34
  address: "0x123",
35
35
  name: "Token One",
36
36
  symbol: "T1",
@@ -7,87 +7,97 @@ jest.mock("axios");
7
7
  const mockedAxios = axios;
8
8
  describe("getTransactions", () => {
9
9
  const url = "https://api.example.com";
10
- it("fetches transactions without userWalletAddress", async () => {
11
- const userWalletAddress = "";
12
- const response = [
13
- {
14
- fromChainId: "97",
15
- toChainId: "44",
16
- tokenIn: "0x063b637324e6115f8da67f761A99B7F00B7Fd908",
17
- tokenOut: "USDT-58d5d0",
18
- amountIn: "11000000",
19
- amountOut: "11000000",
20
- depositTimestamp: 1738054613,
21
- sender: "0x1009c2f59e03c383ca8f2766cfe305a1e79f4c8d",
22
- status: "success",
23
- receiver: "erd1sp0aaszznqnuvyvkmxkv2ultcvlf637c093sfc26dszks60jdqsqy2knqu",
24
- txHash: "0xe7e706c1793d06a252a3f040f07732989e4a6466d804cae17105c09818bc2994",
25
- fee: "0",
26
- provider: types_providerType.ProviderType.MultiversxBridge
27
- }
28
- ];
29
- mockedAxios.get.mockResolvedValue({ data: response });
30
- const result = await api_getTransactions.getTransactions({ url, userWalletAddress });
31
- expect(mockedAxios.get).toHaveBeenCalledWith("/transactions", {
10
+ const mockResponse = [
11
+ {
12
+ fromChainId: "97",
13
+ toChainId: "44",
14
+ tokenIn: "0x063b637324e6115f8da67f761A99B7F00B7Fd908",
15
+ tokenOut: "USDT-58d5d0",
16
+ amountIn: "11000000",
17
+ amountOut: "11000000",
18
+ depositTimestamp: 1738054613,
19
+ sender: "0x1009c2f59e03c383ca8f2766cfe305a1e79f4c8d",
20
+ status: "success",
21
+ receiver: "erd1sp0aaszznqnuvyvkmxkv2ultcvlf637c093sfc26dszks60jdqsqy2knqu",
22
+ txHash: "0xe7e706c1793d06a252a3f040f07732989e4a6466d804cae17105c09818bc2994",
23
+ fee: "0",
24
+ provider: types_providerType.ProviderType.MultiversxBridge
25
+ }
26
+ ];
27
+ beforeEach(() => {
28
+ mockedAxios.get.mockClear();
29
+ mockedAxios.get.mockResolvedValue({ data: mockResponse });
30
+ });
31
+ it("fetches transactions with only address parameter", async () => {
32
+ const address = "0x123";
33
+ const result = await api_getTransactions.getTransactions({ url, address });
34
+ expect(mockedAxios.get).toHaveBeenCalledWith(
35
+ "/transactions?receiver=0x123",
36
+ { baseURL: url }
37
+ );
38
+ expect(result.data).toEqual(mockResponse);
39
+ });
40
+ it("fetches transactions with empty address", async () => {
41
+ const address = "";
42
+ const result = await api_getTransactions.getTransactions({ url, address });
43
+ expect(mockedAxios.get).toHaveBeenCalledWith("/transactions?", {
32
44
  baseURL: url
33
45
  });
34
- expect(result.data).toEqual(response);
46
+ expect(result.data).toEqual(mockResponse);
35
47
  });
36
- it("fetches transactions with userWalletAddress", async () => {
37
- const userWalletAddress = "0x123";
38
- const response = [
39
- {
40
- fromChainId: "97",
41
- toChainId: "44",
42
- tokenIn: "0x063b637324e6115f8da67f761A99B7F00B7Fd908",
43
- tokenOut: "USDT-58d5d0",
44
- amountIn: "11000000",
45
- amountOut: "11000000",
46
- depositTimestamp: 1738054613,
47
- sender: "0x1009c2f59e03c383ca8f2766cfe305a1e79f4c8d",
48
- status: "success",
49
- receiver: "erd1sp0aaszznqnuvyvkmxkv2ultcvlf637c093sfc26dszks60jdqsqy2knqu",
50
- txHash: "0xe7e706c1793d06a252a3f040f07732989e4a6466d804cae17105c09818bc2994",
51
- fee: "0",
52
- provider: types_providerType.ProviderType.MultiversxBridge
53
- }
54
- ];
55
- mockedAxios.get.mockResolvedValue({ data: response });
56
- const result = await api_getTransactions.getTransactions({ url, userWalletAddress });
48
+ it("includes all non-empty parameters in the query", async () => {
49
+ const result = await api_getTransactions.getTransactions({
50
+ url,
51
+ address: "0x123",
52
+ sender: "0xABC",
53
+ provider: types_providerType.ProviderType.MultiversxBridge,
54
+ status: "success",
55
+ tokenIn: "0xTOKEN",
56
+ tokenOut: "WEGLD-123456"
57
+ });
57
58
  expect(mockedAxios.get).toHaveBeenCalledWith(
58
- `/transactions/${userWalletAddress}`,
59
+ "/transactions?receiver=0x123&sender=0xABC&provider=multiversxBridge&status=success&tokenIn=0xTOKEN&tokenOut=WEGLD-123456",
59
60
  { baseURL: url }
60
61
  );
61
- expect(result.data).toEqual(response);
62
+ expect(result.data).toEqual(mockResponse);
62
63
  });
63
- it("fetches transactions with both transactionId and userWalletAddress", async () => {
64
- const userWalletAddress = "0x123";
65
- const response = [
66
- {
67
- fromChainId: "97",
68
- toChainId: "44",
69
- tokenIn: "0x063b637324e6115f8da67f761A99B7F00B7Fd908",
70
- tokenOut: "USDT-58d5d0",
71
- amountIn: "11000000",
72
- amountOut: "11000000",
73
- depositTimestamp: 1738054613,
74
- sender: "0x1009c2f59e03c383ca8f2766cfe305a1e79f4c8d",
75
- status: "success",
76
- receiver: "erd1sp0aaszznqnuvyvkmxkv2ultcvlf637c093sfc26dszks60jdqsqy2knqu",
77
- txHash: "0xe7e706c1793d06a252a3f040f07732989e4a6466d804cae17105c09818bc2994",
78
- fee: "0",
79
- provider: types_providerType.ProviderType.MultiversxBridge
80
- }
81
- ];
82
- mockedAxios.get.mockResolvedValue({ data: response });
64
+ it("excludes empty parameters from the query", async () => {
83
65
  const result = await api_getTransactions.getTransactions({
84
66
  url,
85
- userWalletAddress
67
+ address: "0x123",
68
+ sender: "",
69
+ provider: types_providerType.ProviderType.MultiversxBridge,
70
+ status: "",
71
+ tokenIn: "0xTOKEN",
72
+ tokenOut: ""
86
73
  });
87
74
  expect(mockedAxios.get).toHaveBeenCalledWith(
88
- `/transactions/${userWalletAddress}`,
75
+ "/transactions?receiver=0x123&provider=multiversxBridge&tokenIn=0xTOKEN",
89
76
  { baseURL: url }
90
77
  );
91
- expect(result.data).toEqual(response);
78
+ expect(result.data).toEqual(mockResponse);
79
+ });
80
+ it("handles axios error", async () => {
81
+ const error = new Error("Network error");
82
+ mockedAxios.get.mockRejectedValueOnce(error);
83
+ await expect(api_getTransactions.getTransactions({ url, address: "0x123" })).rejects.toThrow(
84
+ "Network error"
85
+ );
86
+ expect(mockedAxios.get).toHaveBeenCalledWith(
87
+ "/transactions?receiver=0x123",
88
+ { baseURL: url }
89
+ );
90
+ });
91
+ it("passes through axios response", async () => {
92
+ const axiosResponse = {
93
+ data: mockResponse,
94
+ status: 200,
95
+ statusText: "OK",
96
+ headers: {},
97
+ config: {}
98
+ };
99
+ mockedAxios.get.mockResolvedValueOnce(axiosResponse);
100
+ const result = await api_getTransactions.getTransactions({ url, address: "0x123" });
101
+ expect(result).toEqual(axiosResponse);
92
102
  });
93
103
  });
@@ -5,87 +5,97 @@ jest.mock("axios");
5
5
  const mockedAxios = axios;
6
6
  describe("getTransactions", () => {
7
7
  const url = "https://api.example.com";
8
- it("fetches transactions without userWalletAddress", async () => {
9
- const userWalletAddress = "";
10
- const response = [
11
- {
12
- fromChainId: "97",
13
- toChainId: "44",
14
- tokenIn: "0x063b637324e6115f8da67f761A99B7F00B7Fd908",
15
- tokenOut: "USDT-58d5d0",
16
- amountIn: "11000000",
17
- amountOut: "11000000",
18
- depositTimestamp: 1738054613,
19
- sender: "0x1009c2f59e03c383ca8f2766cfe305a1e79f4c8d",
20
- status: "success",
21
- receiver: "erd1sp0aaszznqnuvyvkmxkv2ultcvlf637c093sfc26dszks60jdqsqy2knqu",
22
- txHash: "0xe7e706c1793d06a252a3f040f07732989e4a6466d804cae17105c09818bc2994",
23
- fee: "0",
24
- provider: ProviderType.MultiversxBridge
25
- }
26
- ];
27
- mockedAxios.get.mockResolvedValue({ data: response });
28
- const result = await getTransactions({ url, userWalletAddress });
29
- expect(mockedAxios.get).toHaveBeenCalledWith("/transactions", {
8
+ const mockResponse = [
9
+ {
10
+ fromChainId: "97",
11
+ toChainId: "44",
12
+ tokenIn: "0x063b637324e6115f8da67f761A99B7F00B7Fd908",
13
+ tokenOut: "USDT-58d5d0",
14
+ amountIn: "11000000",
15
+ amountOut: "11000000",
16
+ depositTimestamp: 1738054613,
17
+ sender: "0x1009c2f59e03c383ca8f2766cfe305a1e79f4c8d",
18
+ status: "success",
19
+ receiver: "erd1sp0aaszznqnuvyvkmxkv2ultcvlf637c093sfc26dszks60jdqsqy2knqu",
20
+ txHash: "0xe7e706c1793d06a252a3f040f07732989e4a6466d804cae17105c09818bc2994",
21
+ fee: "0",
22
+ provider: ProviderType.MultiversxBridge
23
+ }
24
+ ];
25
+ beforeEach(() => {
26
+ mockedAxios.get.mockClear();
27
+ mockedAxios.get.mockResolvedValue({ data: mockResponse });
28
+ });
29
+ it("fetches transactions with only address parameter", async () => {
30
+ const address = "0x123";
31
+ const result = await getTransactions({ url, address });
32
+ expect(mockedAxios.get).toHaveBeenCalledWith(
33
+ "/transactions?receiver=0x123",
34
+ { baseURL: url }
35
+ );
36
+ expect(result.data).toEqual(mockResponse);
37
+ });
38
+ it("fetches transactions with empty address", async () => {
39
+ const address = "";
40
+ const result = await getTransactions({ url, address });
41
+ expect(mockedAxios.get).toHaveBeenCalledWith("/transactions?", {
30
42
  baseURL: url
31
43
  });
32
- expect(result.data).toEqual(response);
44
+ expect(result.data).toEqual(mockResponse);
33
45
  });
34
- it("fetches transactions with userWalletAddress", async () => {
35
- const userWalletAddress = "0x123";
36
- const response = [
37
- {
38
- fromChainId: "97",
39
- toChainId: "44",
40
- tokenIn: "0x063b637324e6115f8da67f761A99B7F00B7Fd908",
41
- tokenOut: "USDT-58d5d0",
42
- amountIn: "11000000",
43
- amountOut: "11000000",
44
- depositTimestamp: 1738054613,
45
- sender: "0x1009c2f59e03c383ca8f2766cfe305a1e79f4c8d",
46
- status: "success",
47
- receiver: "erd1sp0aaszznqnuvyvkmxkv2ultcvlf637c093sfc26dszks60jdqsqy2knqu",
48
- txHash: "0xe7e706c1793d06a252a3f040f07732989e4a6466d804cae17105c09818bc2994",
49
- fee: "0",
50
- provider: ProviderType.MultiversxBridge
51
- }
52
- ];
53
- mockedAxios.get.mockResolvedValue({ data: response });
54
- const result = await getTransactions({ url, userWalletAddress });
46
+ it("includes all non-empty parameters in the query", async () => {
47
+ const result = await getTransactions({
48
+ url,
49
+ address: "0x123",
50
+ sender: "0xABC",
51
+ provider: ProviderType.MultiversxBridge,
52
+ status: "success",
53
+ tokenIn: "0xTOKEN",
54
+ tokenOut: "WEGLD-123456"
55
+ });
55
56
  expect(mockedAxios.get).toHaveBeenCalledWith(
56
- `/transactions/${userWalletAddress}`,
57
+ "/transactions?receiver=0x123&sender=0xABC&provider=multiversxBridge&status=success&tokenIn=0xTOKEN&tokenOut=WEGLD-123456",
57
58
  { baseURL: url }
58
59
  );
59
- expect(result.data).toEqual(response);
60
+ expect(result.data).toEqual(mockResponse);
60
61
  });
61
- it("fetches transactions with both transactionId and userWalletAddress", async () => {
62
- const userWalletAddress = "0x123";
63
- const response = [
64
- {
65
- fromChainId: "97",
66
- toChainId: "44",
67
- tokenIn: "0x063b637324e6115f8da67f761A99B7F00B7Fd908",
68
- tokenOut: "USDT-58d5d0",
69
- amountIn: "11000000",
70
- amountOut: "11000000",
71
- depositTimestamp: 1738054613,
72
- sender: "0x1009c2f59e03c383ca8f2766cfe305a1e79f4c8d",
73
- status: "success",
74
- receiver: "erd1sp0aaszznqnuvyvkmxkv2ultcvlf637c093sfc26dszks60jdqsqy2knqu",
75
- txHash: "0xe7e706c1793d06a252a3f040f07732989e4a6466d804cae17105c09818bc2994",
76
- fee: "0",
77
- provider: ProviderType.MultiversxBridge
78
- }
79
- ];
80
- mockedAxios.get.mockResolvedValue({ data: response });
62
+ it("excludes empty parameters from the query", async () => {
81
63
  const result = await getTransactions({
82
64
  url,
83
- userWalletAddress
65
+ address: "0x123",
66
+ sender: "",
67
+ provider: ProviderType.MultiversxBridge,
68
+ status: "",
69
+ tokenIn: "0xTOKEN",
70
+ tokenOut: ""
84
71
  });
85
72
  expect(mockedAxios.get).toHaveBeenCalledWith(
86
- `/transactions/${userWalletAddress}`,
73
+ "/transactions?receiver=0x123&provider=multiversxBridge&tokenIn=0xTOKEN",
87
74
  { baseURL: url }
88
75
  );
89
- expect(result.data).toEqual(response);
76
+ expect(result.data).toEqual(mockResponse);
77
+ });
78
+ it("handles axios error", async () => {
79
+ const error = new Error("Network error");
80
+ mockedAxios.get.mockRejectedValueOnce(error);
81
+ await expect(getTransactions({ url, address: "0x123" })).rejects.toThrow(
82
+ "Network error"
83
+ );
84
+ expect(mockedAxios.get).toHaveBeenCalledWith(
85
+ "/transactions?receiver=0x123",
86
+ { baseURL: url }
87
+ );
88
+ });
89
+ it("passes through axios response", async () => {
90
+ const axiosResponse = {
91
+ data: mockResponse,
92
+ status: 200,
93
+ statusText: "OK",
94
+ headers: {},
95
+ config: {}
96
+ };
97
+ mockedAxios.get.mockResolvedValueOnce(axiosResponse);
98
+ const result = await getTransactions({ url, address: "0x123" });
99
+ expect(result).toEqual(axiosResponse);
90
100
  });
91
101
  });
@@ -1 +1 @@
1
- export declare const MVX_CHAIN_IDS: number[];
1
+ export declare const MVX_CHAIN_IDS: string[];
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
- const MVX_CHAIN_IDS = [31, 44, 54];
4
+ const MVX_CHAIN_IDS = ["31", "44", "54"];
5
5
  exports.MVX_CHAIN_IDS = MVX_CHAIN_IDS;
@@ -1,4 +1,4 @@
1
- const MVX_CHAIN_IDS = [31, 44, 54];
1
+ const MVX_CHAIN_IDS = ["31", "44", "54"];
2
2
  export {
3
3
  MVX_CHAIN_IDS
4
4
  };
@@ -1,9 +1,11 @@
1
+ import { ChainType } from '../types/chainType';
2
+
1
3
  export interface ChainDTO {
2
4
  chainId: string;
3
5
  chainName: string;
4
6
  pngUrl: string;
5
7
  svgUrl: string;
6
- chainType: string;
8
+ chainType: ChainType;
7
9
  rpc: string;
8
10
  networkName: string;
9
11
  nativeCurrency: {
@@ -8,4 +8,5 @@ export interface ConfirmRateDto extends RateRequestResponse {
8
8
  toChainId: string;
9
9
  sender: string;
10
10
  receiver: string;
11
+ backUrl?: string;
11
12
  }
@@ -1,5 +1,5 @@
1
1
  export interface TokenDTO {
2
- chainId: number;
2
+ chainId: string;
3
3
  address: string;
4
4
  name: string;
5
5
  symbol: string;
@@ -11,6 +11,10 @@ export interface TokenDTO {
11
11
  minBridgeAmount: string;
12
12
  maxBridgeAmount: string;
13
13
  };
14
- availableTokens?: string[];
14
+ availableTokens?: {
15
+ address: string;
16
+ chainId: string;
17
+ symbol: string;
18
+ }[];
15
19
  isNative?: boolean;
16
20
  }
@@ -14,4 +14,5 @@ export interface TransactionDTO {
14
14
  fee: string;
15
15
  txHash: string;
16
16
  provider: ProviderType;
17
+ orderId?: string;
17
18
  }