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