@multiversx/sdk-dapp-liquidity 1.1.0-alpha.8 → 1.1.0-alpha.9

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 (289) hide show
  1. package/api/getTransactions.js +4 -3
  2. package/api/getTransactions.mjs +4 -3
  3. package/api/tests/getTransactions.spec.js +80 -68
  4. package/api/tests/getTransactions.spec.mjs +80 -68
  5. package/constants/index.d.ts +1 -1
  6. package/constants/index.js +1 -1
  7. package/constants/index.mjs +1 -1
  8. package/index.js +42 -14
  9. package/index.mjs +11 -13
  10. package/package.json +9 -5
  11. package/reactjs/components/BridgeForm/BridgeForm.js +42 -37
  12. package/reactjs/components/BridgeForm/BridgeForm.mjs +10 -5
  13. package/reactjs/components/BridgeHistory/BridgeHistory.js +6 -6
  14. package/reactjs/components/BridgeHistory/BridgeHistory.mjs +1 -1
  15. package/reactjs/components/Connect/BridgeAccountDisplay.js +2 -6
  16. package/reactjs/components/Connect/BridgeAccountDisplay.mjs +2 -6
  17. package/reactjs/components/Connect/CustomConnectButton.js +2 -6
  18. package/reactjs/components/Connect/CustomConnectButton.mjs +1 -5
  19. package/reactjs/components/Connect/SwitchChainButton.js +2 -7
  20. package/reactjs/components/Connect/SwitchChainButton.mjs +1 -6
  21. package/reactjs/components/CopyButton/CopyButton.js +2 -2
  22. package/reactjs/components/CopyButton/CopyButton.mjs +2 -2
  23. package/reactjs/components/DisplayAmount/components/AnimateNumber/AnimateNumber.js +5 -5
  24. package/reactjs/components/TokenSelector/TokenSelector.js +5 -5
  25. package/reactjs/components/TokenSelector/TokenSelector.mjs +1 -1
  26. package/reactjs/components/TokenSelector/components/ChainSelect/ChainSelect.js +3 -3
  27. package/reactjs/components/TokenSelector/components/SelectContent.js +8 -8
  28. package/reactjs/components/TokenSelector/components/TokenIcon.js +3 -3
  29. package/reactjs/components/TokenSelector/components/TokenItem.js +9 -4
  30. package/reactjs/components/TokenSelector/components/TokenItem.mjs +6 -1
  31. package/reactjs/components/base/MxCard/MxCard.js +2 -2
  32. package/reactjs/components/base/MxLink/MxLink.js +2 -2
  33. package/reactjs/components/base/MxSearch/MxSearch.js +4 -4
  34. package/reactjs/components/base/MxSlideover/MxSlideover.js +4 -4
  35. package/reactjs/components/base/MxTooltip/MxTooltip.js +9 -9
  36. package/reactjs/components/base/MxTooltip/components/TooltipContainer/TooltipContainer.js +2 -2
  37. package/reactjs/context/Web3AppProvider.js +3 -3
  38. package/reactjs/context/useWeb3App.js +2 -2
  39. package/reactjs/hooks/index.js +1 -1
  40. package/reactjs/hooks/useAccount.js +1 -6
  41. package/reactjs/hooks/useAccount.mjs +1 -6
  42. package/reactjs/hooks/useBalances.js +1 -1
  43. package/reactjs/hooks/useBridgeFormik.js +9 -9
  44. package/reactjs/hooks/useDebounce.js +3 -3
  45. package/reactjs/hooks/useFetchTokens.js +9 -9
  46. package/reactjs/hooks/useFetchTokens.mjs +2 -2
  47. package/reactjs/hooks/useFiatData.js +6 -6
  48. package/reactjs/hooks/useFiatData.mjs +1 -1
  49. package/reactjs/hooks/useGetChainId.js +3 -3
  50. package/reactjs/hooks/useGetChainId.mjs +1 -1
  51. package/reactjs/hooks/useResolveTokenChain.js +2 -2
  52. package/reactjs/hooks/useSendTransactions.js +2 -2
  53. package/reactjs/hooks/validation/useTestHasEnoughFunds.js +3 -3
  54. package/reactjs/hooks/validation/useTestIsConnected.js +2 -2
  55. package/reactjs/index.js +42 -14
  56. package/reactjs/index.mjs +11 -13
  57. package/reactjs/init/init.d.ts +1 -1
  58. package/reactjs/init/init.js +30 -16
  59. package/reactjs/init/init.mjs +21 -7
  60. package/reactjs/init/tests/init.spec.js +6 -7
  61. package/reactjs/init/tests/init.spec.mjs +5 -6
  62. package/reactjs/queries/useGetEvmTokensBalances.query.js +3 -7
  63. package/reactjs/queries/useGetEvmTokensBalances.query.mjs +2 -6
  64. package/reactjs/queries/useGetMvxTokensBalances.query.js +2 -2
  65. package/reactjs/reexports.js +41 -13
  66. package/reactjs/reexports.mjs +11 -13
  67. package/{useBalances-CMixgIRU.js → useBalances-FCILRNAy.js} +2 -2
  68. package/add-6Hktd7HI.mjs +0 -19
  69. package/add-juzQkMr_.js +0 -20
  70. package/all-wallets-CDBHcdBW.mjs +0 -10
  71. package/all-wallets-DWuLhbnN.js +0 -11
  72. package/app-store-2Caui3Hv.mjs +0 -21
  73. package/app-store-Cppxe4t5.js +0 -22
  74. package/apple-DKtoJZe9.mjs +0 -22
  75. package/apple-nexFyqTC.js +0 -23
  76. package/arrow-bottom-BVz7XUz-.js +0 -13
  77. package/arrow-bottom-C5NamQSq.mjs +0 -12
  78. package/arrow-bottom-circle-CvWQP3gd.js +0 -16
  79. package/arrow-bottom-circle-DZRlr5gZ.mjs +0 -15
  80. package/arrow-left-BjtUA8Tn.mjs +0 -12
  81. package/arrow-left-ywqF3CIm.js +0 -13
  82. package/arrow-right-BM5qYgEx.js +0 -13
  83. package/arrow-right-EfRPXJ8g.mjs +0 -12
  84. package/arrow-top-DIZLgKAv.mjs +0 -12
  85. package/arrow-top-MEfOCzpg.js +0 -13
  86. package/bank-B5GtM-iL.mjs +0 -18
  87. package/bank-dWinx5sN.js +0 -19
  88. package/bitcoin-1SWAuj8n.mjs +0 -3792
  89. package/bitcoin-DHwiZolS.js +0 -3792
  90. package/browser-BCJFo3OQ.mjs +0 -18
  91. package/browser-DbtgVP-h.js +0 -19
  92. package/card-Bgar5aKz.js +0 -19
  93. package/card-vGuo5IOR.mjs +0 -18
  94. package/checkmark-BKBFeuP5.mjs +0 -15
  95. package/checkmark-bold-BYb8CUZ8.js +0 -13
  96. package/checkmark-bold-BiFMlocx.mjs +0 -12
  97. package/checkmark-l8h3sm_g.js +0 -16
  98. package/chevron-bottom-DfebxTNv.js +0 -13
  99. package/chevron-bottom-qpBNc49E.mjs +0 -12
  100. package/chevron-left-Coi_nNKR.mjs +0 -12
  101. package/chevron-left-FnvKOdGV.js +0 -13
  102. package/chevron-right-Be3FE3hr.js +0 -13
  103. package/chevron-right-CRz3MalJ.mjs +0 -12
  104. package/chevron-top-C68v_E2c.mjs +0 -12
  105. package/chevron-top-COvCOnB2.js +0 -13
  106. package/chrome-store-CPJDJNPu.mjs +0 -65
  107. package/chrome-store-FqwxUZG7.js +0 -66
  108. package/clock-ByjZ4ilt.js +0 -13
  109. package/clock-DrLinnc4.mjs +0 -12
  110. package/close-CKfcXm4W.js +0 -13
  111. package/close-yanFPosb.mjs +0 -12
  112. package/coinPlaceholder-3S4HUg2d.js +0 -13
  113. package/coinPlaceholder-BIfIkMfn.mjs +0 -12
  114. package/compass-CV7Q0BRl.mjs +0 -12
  115. package/compass-Cbi2jkxk.js +0 -13
  116. package/copy-Ca63iQNd.mjs +0 -19
  117. package/copy-DwGrXa_8.js +0 -20
  118. package/cursor-BOhtgld_.mjs +0 -7
  119. package/cursor-CWmF-b84.js +0 -8
  120. package/cursor-transparent-BwVGzwtu.mjs +0 -16
  121. package/cursor-transparent-C1tHtAAt.js +0 -17
  122. package/desktop-332WWCVu.mjs +0 -13
  123. package/desktop-DFpoQ2XQ.js +0 -14
  124. package/disconnect-_clyltwg.js +0 -13
  125. package/disconnect-i16vASLo.mjs +0 -12
  126. package/discord-B3xzyS21.js +0 -22
  127. package/discord-Cmks8AXc.mjs +0 -21
  128. package/email-B4Qs8Wql.mjs +0 -797
  129. package/email-CSDaC3PV.js +0 -793
  130. package/embedded-wallet-Z38VX5nD.js +0 -547
  131. package/embedded-wallet-iJQprDOK.mjs +0 -550
  132. package/etherscan-DiQKb9JJ.mjs +0 -10
  133. package/etherscan-DiZfBzq1.js +0 -11
  134. package/exclamation-triangle-BzIxINm5.js +0 -9
  135. package/exclamation-triangle-DgSYWQO-.mjs +0 -8
  136. package/extension-BO0Cd6z8.mjs +0 -12
  137. package/extension-bF9Sb9iB.js +0 -13
  138. package/external-link-5DYOaT3U.js +0 -13
  139. package/external-link-C6tOSZPl.mjs +0 -12
  140. package/facebook-BNpFIEwz.js +0 -31
  141. package/facebook-BxE8Pfgx.mjs +0 -30
  142. package/farcaster-Cn4wtliN.js +0 -17
  143. package/farcaster-lOD2t_ep.mjs +0 -16
  144. package/filters-DIWesbdh.js +0 -13
  145. package/filters-DQYjZNck.mjs +0 -12
  146. package/github-BK40bIpw.js +0 -23
  147. package/github-DvTIEePs.mjs +0 -22
  148. package/google-BEZdehYk.js +0 -23
  149. package/google-BQODtHO9.mjs +0 -22
  150. package/help-circle-BoaBQK8j.mjs +0 -16
  151. package/help-circle-Dafpc2S0.js +0 -17
  152. package/id-D38R6u_z.js +0 -17
  153. package/id-Te72spgu.mjs +0 -16
  154. package/if-defined-Ckbxb_LZ.js +0 -808
  155. package/if-defined-DwE54thp.mjs +0 -808
  156. package/image-Dtdls2gL.js +0 -9
  157. package/image-pcAZlse8.mjs +0 -8
  158. package/index-B0-hXPyA.mjs +0 -276
  159. package/index-B5VBriCp.js +0 -166
  160. package/index-B6PAkUMD.mjs +0 -55
  161. package/index-BI3g_V6a.js +0 -258
  162. package/index-BMOzU0g_.mjs +0 -101
  163. package/index-BREDoavK.mjs +0 -62
  164. package/index-BieKpvUd.mjs +0 -166
  165. package/index-Bm64lTwT.mjs +0 -101
  166. package/index-BmdNakBG.mjs +0 -176
  167. package/index-BqWHWBPd.js +0 -2237
  168. package/index-BsSQctOn.mjs +0 -107
  169. package/index-CB8Xl3BI.mjs +0 -273
  170. package/index-CE-ThOUU.js +0 -682
  171. package/index-CJtYUGWk.js +0 -101
  172. package/index-CNBa_yb_.js +0 -273
  173. package/index-CNGSm-3v.js +0 -144
  174. package/index-CZ8svgH6.js +0 -566
  175. package/index-CgQUQyKy.mjs +0 -812
  176. package/index-CkqN9i4B.js +0 -103
  177. package/index-Cwx48WwC.js +0 -265
  178. package/index-CxbGh3dD.js +0 -59
  179. package/index-D-QW67ts.js +0 -57
  180. package/index-D09okGU-.mjs +0 -329
  181. package/index-D5JBvvTH.mjs +0 -82
  182. package/index-D97ZdUzy.mjs +0 -95
  183. package/index-D9W5rupt.js +0 -107
  184. package/index-DAAXziQn.mjs +0 -57
  185. package/index-DF_4TKAG.js +0 -344
  186. package/index-DFgTp8ma.mjs +0 -259
  187. package/index-DHQBI2q7.mjs +0 -9536
  188. package/index-DHd3241q.mjs +0 -2235
  189. package/index-DLv0901W.js +0 -9510
  190. package/index-DNH3d6sj.js +0 -97
  191. package/index-DTpnJ3r_.mjs +0 -344
  192. package/index-DahyraMD.js +0 -178
  193. package/index-Dp8ypte2.js +0 -84
  194. package/index-HSJrj1ec.mjs +0 -680
  195. package/index-Ksar04rg.js +0 -64
  196. package/index-Oc6Afuhx.mjs +0 -263
  197. package/index-Sl878vk4.mjs +0 -566
  198. package/index-Uj_cxq0b.js +0 -152
  199. package/index-VLLsIwhe.mjs +0 -70
  200. package/index-XZhf4PTD.js +0 -72
  201. package/index-f9NdzhLG.mjs +0 -145
  202. package/index-h3HYCin8.js +0 -331
  203. package/index-kH104rXk.js +0 -814
  204. package/index-o5mkLIxK.js +0 -278
  205. package/index-zw-X0o15.mjs +0 -150
  206. package/info-DIiGb1WG.mjs +0 -7
  207. package/info-_1FcljSX.js +0 -8
  208. package/info-circle-C0cfc1Ai.mjs +0 -16
  209. package/info-circle-DNrGAlaC.js +0 -17
  210. package/lightbulb-DAhFAQxe.mjs +0 -7
  211. package/lightbulb-xep8mw9e.js +0 -8
  212. package/mail-BP4O1jha.mjs +0 -12
  213. package/mail-DizrQGIr.js +0 -13
  214. package/mobile-DN0RkiUA.mjs +0 -13
  215. package/mobile-jaedeM4x.js +0 -14
  216. package/more-BwUSQJtS.mjs +0 -15
  217. package/more-Db1xellQ.js +0 -16
  218. package/network-placeholder-BFwoDmjz.mjs +0 -18
  219. package/network-placeholder-Bnr8tbL-.js +0 -19
  220. package/nftPlaceholder-B1JCCbzW.mjs +0 -12
  221. package/nftPlaceholder-BwnfvXxH.js +0 -13
  222. package/off-DgfbvVEQ.js +0 -13
  223. package/off-HoeLvIQv.mjs +0 -12
  224. package/onramp-D1g6Jbkc.js +0 -1587
  225. package/onramp-LOJyQFpR.mjs +0 -1593
  226. package/play-store-3rRSeyAn.js +0 -37
  227. package/play-store-BzzZjkgk.mjs +0 -36
  228. package/plus-DY8W7EOO.js +0 -18
  229. package/plus-wT-ccjDA.mjs +0 -17
  230. package/qr-code-BEaXe2LV.js +0 -11
  231. package/qr-code-BjTH6iOp.mjs +0 -10
  232. package/react-59f9mIHr.mjs +0 -25357
  233. package/react-DGsKaIEu.mjs +0 -6077
  234. package/react-dVsV8KsZ.js +0 -6077
  235. package/react-m2gZQZx4.js +0 -25357
  236. package/receive-Cs1s1gYM.mjs +0 -216
  237. package/receive-UwRW4C9x.js +0 -216
  238. package/recycle-horizontal-BNBaqSZz.js +0 -14
  239. package/recycle-horizontal-CeHfqJIc.mjs +0 -13
  240. package/refresh-BA2xhh9V.js +0 -13
  241. package/refresh-qhuKtgB7.mjs +0 -12
  242. package/reown-logo-CuHLfpEw.mjs +0 -16
  243. package/reown-logo-Tq7bFUT6.js +0 -17
  244. package/search-6n0Ff_dt.mjs +0 -12
  245. package/search-Cx4Blqfv.js +0 -13
  246. package/send-B657IEsU.mjs +0 -1193
  247. package/send-B8cwQAnQ.js +0 -1191
  248. package/send-D1dMQkPK.js +0 -20
  249. package/send-t0dgu5ob.mjs +0 -19
  250. package/socials-BxPH0UFz.js +0 -723
  251. package/socials-_cnavCl9.mjs +0 -725
  252. package/swapHorizontal-BVGXUTXy.js +0 -13
  253. package/swapHorizontal-CZDLEGAJ.mjs +0 -12
  254. package/swapHorizontalBold-CYGMAdYJ.mjs +0 -12
  255. package/swapHorizontalBold-CtYibkOJ.js +0 -13
  256. package/swapHorizontalMedium-BWtcSeVX.mjs +0 -20
  257. package/swapHorizontalMedium-CX8g5USa.js +0 -21
  258. package/swapHorizontalRoundedBold-D69LbTIY.js +0 -13
  259. package/swapHorizontalRoundedBold-DLqIi8XJ.mjs +0 -12
  260. package/swapVertical-Bygn2_8O.mjs +0 -12
  261. package/swapVertical-YEu2FTpl.js +0 -13
  262. package/swaps-BUgwNzkE.js +0 -1906
  263. package/swaps-CN6V4itg.mjs +0 -1908
  264. package/telegram-B3TsPPWG.mjs +0 -20
  265. package/telegram-BzZxoCON.js +0 -21
  266. package/three-dots-B9-WRm9o.mjs +0 -9
  267. package/three-dots-kGCFeW5_.js +0 -10
  268. package/transactions-C4LyMy2H.js +0 -37
  269. package/transactions-Cgbyv_T6.mjs +0 -37
  270. package/twitch-BBdiYoRQ.js +0 -23
  271. package/twitch-BNJQGRXy.mjs +0 -22
  272. package/twitterIcon-CR6NDfBD.js +0 -11
  273. package/twitterIcon-Onqp_sDr.mjs +0 -10
  274. package/verify-B99cyMD7.js +0 -13
  275. package/verify-Eoq8GSce.mjs +0 -12
  276. package/verify-filled-BQXXBU08.mjs +0 -12
  277. package/verify-filled-CiEDnETf.js +0 -13
  278. package/w3m-modal-B7NYvu08.js +0 -1208
  279. package/w3m-modal-Bu0ZSyML.mjs +0 -1208
  280. package/wallet-BcT8lNii.js +0 -13
  281. package/wallet-dOYVmmoC.mjs +0 -12
  282. package/wallet-placeholder-D_dKjqBq.mjs +0 -18
  283. package/wallet-placeholder-_pc2YkIy.js +0 -19
  284. package/walletconnect-CP6kDQcs.mjs +0 -38
  285. package/walletconnect-yIf5ci65.js +0 -39
  286. package/warning-circle-CKiBhLmZ.js +0 -17
  287. package/warning-circle-D0zgojhL.mjs +0 -16
  288. package/x-D4lyzn0g.js +0 -17
  289. package/x-DyfNtc-k.mjs +0 -16
@@ -19,13 +19,14 @@ async function getTransactions({
19
19
  tokenIn: tokenIn || "",
20
20
  tokenOut: tokenOut || ""
21
21
  });
22
- for (const [key, value] of queryParams.entries()) {
23
- if (!value) {
22
+ const params = Object.entries(Object.fromEntries(queryParams.entries()));
23
+ for (const [key, value] of params) {
24
+ if (value === "") {
24
25
  queryParams.delete(key);
25
26
  }
26
27
  }
27
28
  const queryString = queryParams.toString();
28
- const endpointWithParams = `/transactions/?${queryString}`;
29
+ const endpointWithParams = `/transactions?${queryString}`;
29
30
  return await axios.get(endpointWithParams, {
30
31
  baseURL: url
31
32
  });
@@ -16,13 +16,14 @@ async function getTransactions({
16
16
  tokenIn: tokenIn || "",
17
17
  tokenOut: tokenOut || ""
18
18
  });
19
- for (const [key, value] of queryParams.entries()) {
20
- if (!value) {
19
+ const params = Object.entries(Object.fromEntries(queryParams.entries()));
20
+ for (const [key, value] of params) {
21
+ if (value === "") {
21
22
  queryParams.delete(key);
22
23
  }
23
24
  }
24
25
  const queryString = queryParams.toString();
25
- const endpointWithParams = `/transactions/?${queryString}`;
26
+ const endpointWithParams = `/transactions?${queryString}`;
26
27
  return await axios.get(endpointWithParams, {
27
28
  baseURL: url
28
29
  });
@@ -7,85 +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 response = [
12
- {
13
- fromChainId: "97",
14
- toChainId: "44",
15
- tokenIn: "0x063b637324e6115f8da67f761A99B7F00B7Fd908",
16
- tokenOut: "USDT-58d5d0",
17
- amountIn: "11000000",
18
- amountOut: "11000000",
19
- depositTimestamp: 1738054613,
20
- sender: "0x1009c2f59e03c383ca8f2766cfe305a1e79f4c8d",
21
- status: "success",
22
- receiver: "erd1sp0aaszznqnuvyvkmxkv2ultcvlf637c093sfc26dszks60jdqsqy2knqu",
23
- txHash: "0xe7e706c1793d06a252a3f040f07732989e4a6466d804cae17105c09818bc2994",
24
- fee: "0",
25
- provider: types_providerType.ProviderType.MultiversxBridge
26
- }
27
- ];
28
- mockedAxios.get.mockResolvedValue({ data: response });
29
- const result = await api_getTransactions.getTransactions({ url });
30
- 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?", {
31
44
  baseURL: url
32
45
  });
33
- expect(result.data).toEqual(response);
46
+ expect(result.data).toEqual(mockResponse);
34
47
  });
35
- it("fetches transactions with userWalletAddress", async () => {
36
- const userWalletAddress = "0x123";
37
- const response = [
38
- {
39
- fromChainId: "97",
40
- toChainId: "44",
41
- tokenIn: "0x063b637324e6115f8da67f761A99B7F00B7Fd908",
42
- tokenOut: "USDT-58d5d0",
43
- amountIn: "11000000",
44
- amountOut: "11000000",
45
- depositTimestamp: 1738054613,
46
- sender: "0x1009c2f59e03c383ca8f2766cfe305a1e79f4c8d",
47
- status: "success",
48
- receiver: "erd1sp0aaszznqnuvyvkmxkv2ultcvlf637c093sfc26dszks60jdqsqy2knqu",
49
- txHash: "0xe7e706c1793d06a252a3f040f07732989e4a6466d804cae17105c09818bc2994",
50
- fee: "0",
51
- provider: types_providerType.ProviderType.MultiversxBridge
52
- }
53
- ];
54
- mockedAxios.get.mockResolvedValue({ data: response });
55
- const result = await api_getTransactions.getTransactions({ url });
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
+ });
56
58
  expect(mockedAxios.get).toHaveBeenCalledWith(
57
- `/transactions/${userWalletAddress}`,
59
+ "/transactions?receiver=0x123&sender=0xABC&provider=multiversx-bridge&status=success&tokenIn=0xTOKEN&tokenOut=WEGLD-123456",
58
60
  { baseURL: url }
59
61
  );
60
- expect(result.data).toEqual(response);
62
+ expect(result.data).toEqual(mockResponse);
61
63
  });
62
- it("fetches transactions with both transactionId and userWalletAddress", async () => {
63
- const userWalletAddress = "0x123";
64
- const response = [
65
- {
66
- fromChainId: "97",
67
- toChainId: "44",
68
- tokenIn: "0x063b637324e6115f8da67f761A99B7F00B7Fd908",
69
- tokenOut: "USDT-58d5d0",
70
- amountIn: "11000000",
71
- amountOut: "11000000",
72
- depositTimestamp: 1738054613,
73
- sender: "0x1009c2f59e03c383ca8f2766cfe305a1e79f4c8d",
74
- status: "success",
75
- receiver: "erd1sp0aaszznqnuvyvkmxkv2ultcvlf637c093sfc26dszks60jdqsqy2knqu",
76
- txHash: "0xe7e706c1793d06a252a3f040f07732989e4a6466d804cae17105c09818bc2994",
77
- fee: "0",
78
- provider: types_providerType.ProviderType.MultiversxBridge
79
- }
80
- ];
81
- mockedAxios.get.mockResolvedValue({ data: response });
64
+ it("excludes empty parameters from the query", async () => {
82
65
  const result = await api_getTransactions.getTransactions({
83
- url
66
+ url,
67
+ address: "0x123",
68
+ sender: "",
69
+ provider: types_providerType.ProviderType.MultiversxBridge,
70
+ status: "",
71
+ tokenIn: "0xTOKEN",
72
+ tokenOut: ""
84
73
  });
85
74
  expect(mockedAxios.get).toHaveBeenCalledWith(
86
- `/transactions/${userWalletAddress}`,
75
+ "/transactions?receiver=0x123&provider=multiversx-bridge&tokenIn=0xTOKEN",
87
76
  { baseURL: url }
88
77
  );
89
- 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);
90
102
  });
91
103
  });
@@ -5,85 +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 response = [
10
- {
11
- fromChainId: "97",
12
- toChainId: "44",
13
- tokenIn: "0x063b637324e6115f8da67f761A99B7F00B7Fd908",
14
- tokenOut: "USDT-58d5d0",
15
- amountIn: "11000000",
16
- amountOut: "11000000",
17
- depositTimestamp: 1738054613,
18
- sender: "0x1009c2f59e03c383ca8f2766cfe305a1e79f4c8d",
19
- status: "success",
20
- receiver: "erd1sp0aaszznqnuvyvkmxkv2ultcvlf637c093sfc26dszks60jdqsqy2knqu",
21
- txHash: "0xe7e706c1793d06a252a3f040f07732989e4a6466d804cae17105c09818bc2994",
22
- fee: "0",
23
- provider: ProviderType.MultiversxBridge
24
- }
25
- ];
26
- mockedAxios.get.mockResolvedValue({ data: response });
27
- const result = await getTransactions({ url });
28
- 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?", {
29
42
  baseURL: url
30
43
  });
31
- expect(result.data).toEqual(response);
44
+ expect(result.data).toEqual(mockResponse);
32
45
  });
33
- it("fetches transactions with userWalletAddress", async () => {
34
- const userWalletAddress = "0x123";
35
- const response = [
36
- {
37
- fromChainId: "97",
38
- toChainId: "44",
39
- tokenIn: "0x063b637324e6115f8da67f761A99B7F00B7Fd908",
40
- tokenOut: "USDT-58d5d0",
41
- amountIn: "11000000",
42
- amountOut: "11000000",
43
- depositTimestamp: 1738054613,
44
- sender: "0x1009c2f59e03c383ca8f2766cfe305a1e79f4c8d",
45
- status: "success",
46
- receiver: "erd1sp0aaszznqnuvyvkmxkv2ultcvlf637c093sfc26dszks60jdqsqy2knqu",
47
- txHash: "0xe7e706c1793d06a252a3f040f07732989e4a6466d804cae17105c09818bc2994",
48
- fee: "0",
49
- provider: ProviderType.MultiversxBridge
50
- }
51
- ];
52
- mockedAxios.get.mockResolvedValue({ data: response });
53
- const result = await getTransactions({ url });
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
+ });
54
56
  expect(mockedAxios.get).toHaveBeenCalledWith(
55
- `/transactions/${userWalletAddress}`,
57
+ "/transactions?receiver=0x123&sender=0xABC&provider=multiversx-bridge&status=success&tokenIn=0xTOKEN&tokenOut=WEGLD-123456",
56
58
  { baseURL: url }
57
59
  );
58
- expect(result.data).toEqual(response);
60
+ expect(result.data).toEqual(mockResponse);
59
61
  });
60
- it("fetches transactions with both transactionId and userWalletAddress", async () => {
61
- const userWalletAddress = "0x123";
62
- const response = [
63
- {
64
- fromChainId: "97",
65
- toChainId: "44",
66
- tokenIn: "0x063b637324e6115f8da67f761A99B7F00B7Fd908",
67
- tokenOut: "USDT-58d5d0",
68
- amountIn: "11000000",
69
- amountOut: "11000000",
70
- depositTimestamp: 1738054613,
71
- sender: "0x1009c2f59e03c383ca8f2766cfe305a1e79f4c8d",
72
- status: "success",
73
- receiver: "erd1sp0aaszznqnuvyvkmxkv2ultcvlf637c093sfc26dszks60jdqsqy2knqu",
74
- txHash: "0xe7e706c1793d06a252a3f040f07732989e4a6466d804cae17105c09818bc2994",
75
- fee: "0",
76
- provider: ProviderType.MultiversxBridge
77
- }
78
- ];
79
- mockedAxios.get.mockResolvedValue({ data: response });
62
+ it("excludes empty parameters from the query", async () => {
80
63
  const result = await getTransactions({
81
- url
64
+ url,
65
+ address: "0x123",
66
+ sender: "",
67
+ provider: ProviderType.MultiversxBridge,
68
+ status: "",
69
+ tokenIn: "0xTOKEN",
70
+ tokenOut: ""
82
71
  });
83
72
  expect(mockedAxios.get).toHaveBeenCalledWith(
84
- `/transactions/${userWalletAddress}`,
73
+ "/transactions?receiver=0x123&provider=multiversx-bridge&tokenIn=0xTOKEN",
85
74
  { baseURL: url }
86
75
  );
87
- 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);
88
100
  });
89
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
  };
package/index.js CHANGED
@@ -53,7 +53,7 @@ const reactjs_hooks_validation_useSecondAmountSchema = require("./reactjs/hooks/
53
53
  const reactjs_hooks_validation_useTestHasEnoughFunds = require("./reactjs/hooks/validation/useTestHasEnoughFunds.js");
54
54
  const reactjs_hooks_validation_useTestIsConnected = require("./reactjs/hooks/validation/useTestIsConnected.js");
55
55
  const reactjs_hooks_useAccount = require("./reactjs/hooks/useAccount.js");
56
- const reactjs_hooks_useBalances = require("./useBalances-CMixgIRU.js");
56
+ const reactjs_hooks_useBalances = require("./useBalances-FCILRNAy.js");
57
57
  const reactjs_hooks_useBridgeFormik = require("./reactjs/hooks/useBridgeFormik.js");
58
58
  const reactjs_hooks_useDebounce = require("./reactjs/hooks/useDebounce.js");
59
59
  const reactjs_hooks_useFetchBridgeData = require("./reactjs/hooks/useFetchBridgeData.js");
@@ -82,11 +82,9 @@ const reactjs_utils_pipe = require("./reactjs/utils/pipe.js");
82
82
  const reactjs_utils_removeCommas = require("./reactjs/utils/removeCommas.js");
83
83
  const reactjs_utils_roundAmount = require("./reactjs/utils/roundAmount.js");
84
84
  const reactjs_utils_testNumber = require("./reactjs/utils/testNumber.js");
85
- const react$1 = require("./react-m2gZQZx4.js");
85
+ const react = require("@reown/appkit/react");
86
86
  const wagmi = require("wagmi");
87
87
  const reactjs_constants_chains = require("./reactjs/constants/chains.js");
88
- const index = require("./index-D9W5rupt.js");
89
- const react = require("./react-dVsV8KsZ.js");
90
88
  exports.confirmRate = api_confirmRate.confirmRate;
91
89
  exports.getChains = api_getChains.getChains;
92
90
  exports.getRate = api_getRate.getRate;
@@ -175,19 +173,49 @@ exports.pipe = reactjs_utils_pipe.pipe;
175
173
  exports.removeCommas = reactjs_utils_removeCommas.removeCommas;
176
174
  exports.roundAmount = reactjs_utils_roundAmount.roundAmount;
177
175
  exports.testNumber = reactjs_utils_testNumber.testNumber;
178
- exports.useAppKitNetwork = react$1.useAppKitNetwork;
176
+ Object.defineProperty(exports, "useAppKit", {
177
+ enumerable: true,
178
+ get: () => react.useAppKit
179
+ });
180
+ Object.defineProperty(exports, "useAppKitAccount", {
181
+ enumerable: true,
182
+ get: () => react.useAppKitAccount
183
+ });
184
+ Object.defineProperty(exports, "useAppKitEvents", {
185
+ enumerable: true,
186
+ get: () => react.useAppKitEvents
187
+ });
188
+ Object.defineProperty(exports, "useAppKitNetwork", {
189
+ enumerable: true,
190
+ get: () => react.useAppKitNetwork
191
+ });
192
+ Object.defineProperty(exports, "useAppKitNetworkCore", {
193
+ enumerable: true,
194
+ get: () => react.useAppKitNetworkCore
195
+ });
196
+ Object.defineProperty(exports, "useAppKitProvider", {
197
+ enumerable: true,
198
+ get: () => react.useAppKitProvider
199
+ });
200
+ Object.defineProperty(exports, "useAppKitState", {
201
+ enumerable: true,
202
+ get: () => react.useAppKitState
203
+ });
204
+ Object.defineProperty(exports, "useAppKitTheme", {
205
+ enumerable: true,
206
+ get: () => react.useAppKitTheme
207
+ });
208
+ Object.defineProperty(exports, "useDisconnect", {
209
+ enumerable: true,
210
+ get: () => react.useDisconnect
211
+ });
212
+ Object.defineProperty(exports, "useWalletInfo", {
213
+ enumerable: true,
214
+ get: () => react.useWalletInfo
215
+ });
179
216
  Object.defineProperty(exports, "useWaitForTransactionReceipt", {
180
217
  enumerable: true,
181
218
  get: () => wagmi.useWaitForTransactionReceipt
182
219
  });
183
220
  exports.ALL_NETWORK_ID = reactjs_constants_chains.ALL_NETWORK_ID;
184
221
  exports.chainIdentifier = reactjs_constants_chains.chainIdentifier;
185
- exports.useAppKit = index.useAppKit;
186
- exports.useAppKitEvents = index.useAppKitEvents;
187
- exports.useAppKitProvider = index.useAppKitProvider;
188
- exports.useAppKitState = index.useAppKitState;
189
- exports.useAppKitTheme = index.useAppKitTheme;
190
- exports.useWalletInfo = index.useWalletInfo;
191
- exports.useAppKitAccount = react.useAppKitAccount;
192
- exports.useAppKitNetworkCore = react.useAppKitNetworkCore;
193
- exports.useDisconnect = react.useDisconnect;
package/index.mjs CHANGED
@@ -79,11 +79,9 @@ import { pipe } from "./reactjs/utils/pipe.mjs";
79
79
  import { removeCommas } from "./reactjs/utils/removeCommas.mjs";
80
80
  import { roundAmount } from "./reactjs/utils/roundAmount.mjs";
81
81
  import { testNumber } from "./reactjs/utils/testNumber.mjs";
82
- import { u as u2 } from "./react-59f9mIHr.mjs";
82
+ import { useAppKit, useAppKitAccount, useAppKitEvents, useAppKitNetwork, useAppKitNetworkCore, useAppKitProvider, useAppKitState, useAppKitTheme, useDisconnect, useWalletInfo } from "@reown/appkit/react";
83
83
  import { useWaitForTransactionReceipt } from "wagmi";
84
84
  import { ALL_NETWORK_ID, chainIdentifier } from "./reactjs/constants/chains.mjs";
85
- import { u as u3, a, e, b, c, d } from "./index-BsSQctOn.mjs";
86
- import { u as u4, b as b2, a as a2 } from "./react-DGsKaIEu.mjs";
87
85
  export {
88
86
  ALL_NETWORK_ID,
89
87
  AccountAddress,
@@ -155,18 +153,18 @@ export {
155
153
  testNumber,
156
154
  useAccount,
157
155
  useAmountSchema,
158
- u3 as useAppKit,
159
- u4 as useAppKitAccount,
160
- a as useAppKitEvents,
161
- u2 as useAppKitNetwork,
162
- b2 as useAppKitNetworkCore,
163
- e as useAppKitProvider,
164
- b as useAppKitState,
165
- c as useAppKitTheme,
156
+ useAppKit,
157
+ useAppKitAccount,
158
+ useAppKitEvents,
159
+ useAppKitNetwork,
160
+ useAppKitNetworkCore,
161
+ useAppKitProvider,
162
+ useAppKitState,
163
+ useAppKitTheme,
166
164
  u as useBalances,
167
165
  useBridgeFormik,
168
166
  useDebounce,
169
- a2 as useDisconnect,
167
+ useDisconnect,
170
168
  useFetchBridgeData,
171
169
  useFetchTokens,
172
170
  useGetAllTokensQuery,
@@ -184,6 +182,6 @@ export {
184
182
  useTestHasEnoughFunds,
185
183
  useTestIsConnected,
186
184
  useWaitForTransactionReceipt,
187
- d as useWalletInfo,
185
+ useWalletInfo,
188
186
  useWeb3App
189
187
  };
package/package.json CHANGED
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "homepage": "https://github.com/multiversx/mx-sdk-dapp-liquidity#readme",
30
30
  "license": "MIT",
31
- "version": "1.1.0-alpha.8",
31
+ "version": "1.1.0-alpha.9",
32
32
  "main": "index.js",
33
33
  "module": "index.mjs",
34
34
  "types": "index.d.ts",
@@ -52,8 +52,12 @@
52
52
  "@headlessui/react": "2.2.0",
53
53
  "@multiversx/sdk-dapp-utils": "1.0.5",
54
54
  "@popperjs/core": "^2.11.8",
55
- "@reown/appkit-adapter-wagmi": "1.7.0",
56
- "@tanstack/react-query": "5.62.7",
55
+ "@reown/appkit": "^1.7.1",
56
+ "@reown/appkit-adapter-bitcoin": "1.7.1",
57
+ "@reown/appkit-adapter-solana": "1.7.1",
58
+ "@reown/appkit-adapter-wagmi": "1.7.1",
59
+ "@solana/web3.js": "^1.98.0",
60
+ "@tanstack/react-query": "^5.70.0",
57
61
  "animated-number-react": "0.1.2",
58
62
  "axios": "1.7.9",
59
63
  "formik": "2.4.6",
@@ -65,8 +69,8 @@
65
69
  "react-select": "5.10.0",
66
70
  "react-toastify": "11.0.3",
67
71
  "tailwind-merge": "2.6.0",
68
- "viem": "2.23.7",
69
- "wagmi": "2.14.12",
72
+ "viem": "^2.24.1",
73
+ "wagmi": "^2.14.15",
70
74
  "yup": "1.4.0"
71
75
  },
72
76
  "peerDependencies": {