@multiversx/sdk-dapp-liquidity 1.1.0-alpha.34 → 1.1.0-alpha.35

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 (60) hide show
  1. package/api/getChains.d.ts +2 -1
  2. package/api/getChains.js +9 -4
  3. package/api/getChains.mjs +9 -4
  4. package/api/getTokens.d.ts +2 -1
  5. package/api/getTokens.js +9 -4
  6. package/api/getTokens.mjs +9 -4
  7. package/api/getTokensBalances.d.ts +2 -1
  8. package/api/getTokensBalances.js +9 -4
  9. package/api/getTokensBalances.mjs +9 -4
  10. package/api/getTransactions.d.ts +2 -1
  11. package/api/getTransactions.js +9 -4
  12. package/api/getTransactions.mjs +9 -4
  13. package/api/index.d.ts +2 -0
  14. package/api/index.js +4 -0
  15. package/api/index.mjs +4 -0
  16. package/api/tests/getChains.spec.js +4 -2
  17. package/api/tests/getChains.spec.mjs +4 -2
  18. package/index.js +5 -1
  19. package/index.mjs +5 -1
  20. package/package.json +1 -1
  21. package/reactjs/components/BridgeForm/BridgeForm.js +8 -3
  22. package/reactjs/components/BridgeForm/BridgeForm.mjs +8 -3
  23. package/reactjs/components/TokenSelector/TokenSelector.d.ts +2 -1
  24. package/reactjs/components/TokenSelector/TokenSelector.js +7 -3
  25. package/reactjs/components/TokenSelector/TokenSelector.mjs +7 -3
  26. package/reactjs/components/TokenSelector/components/TokenItem.d.ts +2 -1
  27. package/reactjs/components/TokenSelector/components/TokenItem.js +4 -2
  28. package/reactjs/components/TokenSelector/components/TokenItem.mjs +4 -2
  29. package/reactjs/hooks/index.js +1 -1
  30. package/reactjs/hooks/index.mjs +1 -1
  31. package/reactjs/hooks/useBalances.js +1 -1
  32. package/reactjs/hooks/useBalances.mjs +1 -1
  33. package/reactjs/hooks/useFetchBridgeData.js +3 -1
  34. package/reactjs/hooks/useFetchBridgeData.mjs +3 -1
  35. package/reactjs/hooks/useFetchTokens.js +3 -1
  36. package/reactjs/hooks/useFetchTokens.mjs +3 -1
  37. package/reactjs/hooks/useFiatData.d.ts +2 -1
  38. package/reactjs/hooks/useFiatData.js +5 -2
  39. package/reactjs/hooks/useFiatData.mjs +5 -2
  40. package/reactjs/hooks/useResolveTokenChain.d.ts +2 -1
  41. package/reactjs/hooks/useResolveTokenChain.js +7 -2
  42. package/reactjs/hooks/useResolveTokenChain.mjs +7 -2
  43. package/reactjs/index.js +1 -1
  44. package/reactjs/index.mjs +1 -1
  45. package/reactjs/queries/useGetAllTokens.query.d.ts +3 -1
  46. package/reactjs/queries/useGetAllTokens.query.js +5 -2
  47. package/reactjs/queries/useGetAllTokens.query.mjs +5 -2
  48. package/reactjs/queries/useGetChains.query.d.ts +3 -1
  49. package/reactjs/queries/useGetChains.query.js +5 -2
  50. package/reactjs/queries/useGetChains.query.mjs +5 -2
  51. package/reactjs/queries/useGetEvmTokensBalances.query.js +1 -1
  52. package/reactjs/queries/useGetEvmTokensBalances.query.mjs +1 -1
  53. package/reactjs/queries/useGetHistory.query.d.ts +2 -1
  54. package/reactjs/queries/useGetHistory.query.js +4 -2
  55. package/reactjs/queries/useGetHistory.query.mjs +4 -2
  56. package/reactjs/queries/useGetMvxTokensBalances.query.d.ts +2 -1
  57. package/reactjs/queries/useGetMvxTokensBalances.query.js +9 -4
  58. package/reactjs/queries/useGetMvxTokensBalances.query.mjs +9 -4
  59. package/{useBalances-z9SZjzmN.mjs → useBalances-84Wb5V4N.mjs} +3 -2
  60. package/{useBalances-du_Oq1bB.js → useBalances-BrSgRL7R.js} +3 -2
@@ -1,6 +1,7 @@
1
1
  import { ChainDTO } from '../dto/Chain.dto';
2
2
  import { AxiosResponse } from 'axios';
3
3
 
4
- export declare function getChains({ url }: {
4
+ export declare function getChains({ url, nativeAuthToken }: {
5
5
  url: string;
6
+ nativeAuthToken?: string;
6
7
  }): Promise<AxiosResponse<ChainDTO[]>>;
package/api/getChains.js CHANGED
@@ -3,10 +3,15 @@
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
4
  const axios = require("axios");
5
5
  async function getChains({
6
- url
6
+ url,
7
+ nativeAuthToken
7
8
  }) {
8
- return await axios.get("/chains", {
9
- baseURL: url
10
- });
9
+ const config = {
10
+ baseURL: url,
11
+ headers: {
12
+ Authorization: `Bearer ${nativeAuthToken}`
13
+ }
14
+ };
15
+ return await axios.get("/chains", config);
11
16
  }
12
17
  exports.getChains = getChains;
package/api/getChains.mjs CHANGED
@@ -1,10 +1,15 @@
1
1
  import axios from "axios";
2
2
  async function getChains({
3
- url
3
+ url,
4
+ nativeAuthToken
4
5
  }) {
5
- return await axios.get("/chains", {
6
- baseURL: url
7
- });
6
+ const config = {
7
+ baseURL: url,
8
+ headers: {
9
+ Authorization: `Bearer ${nativeAuthToken}`
10
+ }
11
+ };
12
+ return await axios.get("/chains", config);
8
13
  }
9
14
  export {
10
15
  getChains
@@ -1,7 +1,8 @@
1
1
  import { TokenType } from '../types/token';
2
2
  import { AxiosResponse } from 'axios';
3
3
 
4
- export declare function getTokens({ url, chainId }: {
4
+ export declare function getTokens({ url, chainId, nativeAuthToken }: {
5
5
  url: string;
6
6
  chainId?: number;
7
+ nativeAuthToken?: string;
7
8
  }): Promise<AxiosResponse<TokenType[]>>;
package/api/getTokens.js CHANGED
@@ -4,11 +4,16 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
4
  const axios = require("axios");
5
5
  async function getTokens({
6
6
  url,
7
- chainId
7
+ chainId,
8
+ nativeAuthToken
8
9
  }) {
10
+ const config = {
11
+ baseURL: url,
12
+ headers: {
13
+ Authorization: `Bearer ${nativeAuthToken}`
14
+ }
15
+ };
9
16
  const endpoint = chainId ? `/tokens/${chainId}` : "/tokens";
10
- return await axios.get(endpoint, {
11
- baseURL: url
12
- });
17
+ return await axios.get(endpoint, config);
13
18
  }
14
19
  exports.getTokens = getTokens;
package/api/getTokens.mjs CHANGED
@@ -1,12 +1,17 @@
1
1
  import axios from "axios";
2
2
  async function getTokens({
3
3
  url,
4
- chainId
4
+ chainId,
5
+ nativeAuthToken
5
6
  }) {
7
+ const config = {
8
+ baseURL: url,
9
+ headers: {
10
+ Authorization: `Bearer ${nativeAuthToken}`
11
+ }
12
+ };
6
13
  const endpoint = chainId ? `/tokens/${chainId}` : "/tokens";
7
- return await axios.get(endpoint, {
8
- baseURL: url
9
- });
14
+ return await axios.get(endpoint, config);
10
15
  }
11
16
  export {
12
17
  getTokens
@@ -1,8 +1,9 @@
1
1
  import { TokenBalanceDTO } from '../dto/TokenBalance.dto';
2
2
  import { AxiosResponse } from 'axios';
3
3
 
4
- export declare function getTokensBalances({ url, userAddress, chainId }: {
4
+ export declare function getTokensBalances({ url, userAddress, chainId, nativeAuthToken }: {
5
5
  url: string;
6
6
  userAddress: string;
7
7
  chainId: string;
8
+ nativeAuthToken?: string;
8
9
  }): Promise<AxiosResponse<TokenBalanceDTO[]>>;
@@ -5,13 +5,18 @@ const axios = require("axios");
5
5
  async function getTokensBalances({
6
6
  url,
7
7
  userAddress,
8
- chainId
8
+ chainId,
9
+ nativeAuthToken
9
10
  }) {
11
+ const config = {
12
+ baseURL: url,
13
+ headers: {
14
+ Authorization: `Bearer ${nativeAuthToken}`
15
+ }
16
+ };
10
17
  return await axios.get(
11
18
  `/tokens/balances/${userAddress}/${chainId}`,
12
- {
13
- baseURL: url
14
- }
19
+ config
15
20
  );
16
21
  }
17
22
  exports.getTokensBalances = getTokensBalances;
@@ -2,13 +2,18 @@ import axios from "axios";
2
2
  async function getTokensBalances({
3
3
  url,
4
4
  userAddress,
5
- chainId
5
+ chainId,
6
+ nativeAuthToken
6
7
  }) {
8
+ const config = {
9
+ baseURL: url,
10
+ headers: {
11
+ Authorization: `Bearer ${nativeAuthToken}`
12
+ }
13
+ };
7
14
  return await axios.get(
8
15
  `/tokens/balances/${userAddress}/${chainId}`,
9
- {
10
- baseURL: url
11
- }
16
+ config
12
17
  );
13
18
  }
14
19
  export {
@@ -2,7 +2,7 @@ import { ProviderType } from 'types/providerType';
2
2
  import { TransactionDTO } from 'dto/Transaction.dto';
3
3
  import { AxiosResponse } from 'axios';
4
4
 
5
- export declare function getTransactions({ url, address, sender, provider, status, tokenIn, tokenOut }: {
5
+ export declare function getTransactions({ url, address, sender, provider, status, tokenIn, tokenOut, nativeAuthToken }: {
6
6
  url: string;
7
7
  address: string;
8
8
  sender?: string;
@@ -10,4 +10,5 @@ export declare function getTransactions({ url, address, sender, provider, status
10
10
  status?: string;
11
11
  tokenIn?: string;
12
12
  tokenOut?: string;
13
+ nativeAuthToken?: string;
13
14
  }): Promise<AxiosResponse<TransactionDTO[]>>;
@@ -9,7 +9,8 @@ async function getTransactions({
9
9
  provider,
10
10
  status,
11
11
  tokenIn,
12
- tokenOut
12
+ tokenOut,
13
+ nativeAuthToken
13
14
  }) {
14
15
  const queryParams = new URLSearchParams({
15
16
  receiver: address || "",
@@ -27,8 +28,12 @@ async function getTransactions({
27
28
  }
28
29
  const queryString = queryParams.toString();
29
30
  const endpointWithParams = `/transactions?${queryString}`;
30
- return await axios.get(endpointWithParams, {
31
- baseURL: url
32
- });
31
+ const config = {
32
+ baseURL: url,
33
+ headers: {
34
+ Authorization: `Bearer ${nativeAuthToken}`
35
+ }
36
+ };
37
+ return await axios.get(endpointWithParams, config);
33
38
  }
34
39
  exports.getTransactions = getTransactions;
@@ -6,7 +6,8 @@ async function getTransactions({
6
6
  provider,
7
7
  status,
8
8
  tokenIn,
9
- tokenOut
9
+ tokenOut,
10
+ nativeAuthToken
10
11
  }) {
11
12
  const queryParams = new URLSearchParams({
12
13
  receiver: address || "",
@@ -24,9 +25,13 @@ async function getTransactions({
24
25
  }
25
26
  const queryString = queryParams.toString();
26
27
  const endpointWithParams = `/transactions?${queryString}`;
27
- return await axios.get(endpointWithParams, {
28
- baseURL: url
29
- });
28
+ const config = {
29
+ baseURL: url,
30
+ headers: {
31
+ Authorization: `Bearer ${nativeAuthToken}`
32
+ }
33
+ };
34
+ return await axios.get(endpointWithParams, config);
30
35
  }
31
36
  export {
32
37
  getTransactions
package/api/index.d.ts CHANGED
@@ -5,3 +5,5 @@ export * from './getTokens';
5
5
  export * from './getTokensBalances';
6
6
  export * from './getTransactions';
7
7
  export * from './sendTransactions';
8
+ export * from './checkAccount';
9
+ export * from './linkAccount';
package/api/index.js CHANGED
@@ -8,6 +8,8 @@ const api_getTokens = require("./getTokens.js");
8
8
  const api_getTokensBalances = require("./getTokensBalances.js");
9
9
  const api_getTransactions = require("./getTransactions.js");
10
10
  const api_sendTransactions = require("./sendTransactions.js");
11
+ const api_checkAccount = require("./checkAccount.js");
12
+ const api_linkAccount = require("./linkAccount.js");
11
13
  exports.confirmRate = api_confirmRate.confirmRate;
12
14
  exports.getChains = api_getChains.getChains;
13
15
  exports.getRate = api_getRate.getRate;
@@ -15,3 +17,5 @@ exports.getTokens = api_getTokens.getTokens;
15
17
  exports.getTokensBalances = api_getTokensBalances.getTokensBalances;
16
18
  exports.getTransactions = api_getTransactions.getTransactions;
17
19
  exports.sendTransactions = api_sendTransactions.sendTransactions;
20
+ exports.checkAccount = api_checkAccount.checkAccount;
21
+ exports.linkAccount = api_linkAccount.linkAccount;
package/api/index.mjs CHANGED
@@ -5,12 +5,16 @@ import { getTokens } from "./getTokens.mjs";
5
5
  import { getTokensBalances } from "./getTokensBalances.mjs";
6
6
  import { getTransactions } from "./getTransactions.mjs";
7
7
  import { sendTransactions } from "./sendTransactions.mjs";
8
+ import { checkAccount } from "./checkAccount.mjs";
9
+ import { linkAccount } from "./linkAccount.mjs";
8
10
  export {
11
+ checkAccount,
9
12
  confirmRate,
10
13
  getChains,
11
14
  getRate,
12
15
  getTokens,
13
16
  getTokensBalances,
14
17
  getTransactions,
18
+ linkAccount,
15
19
  sendTransactions
16
20
  };
@@ -27,12 +27,14 @@ describe("getChains", () => {
27
27
  }
28
28
  ];
29
29
  mockedAxios.get.mockResolvedValue({ data: response });
30
- const result = await api_getChains.getChains({ url });
30
+ const result = await api_getChains.getChains({ url, nativeAuthToken: "ZKssadass" });
31
31
  expect(mockedAxios.get).toHaveBeenCalledWith("/chains", { baseURL: url });
32
32
  expect(result.data).toEqual(response);
33
33
  });
34
34
  it("handles error when fetching chains", async () => {
35
35
  mockedAxios.get.mockRejectedValue(new Error("Network Error"));
36
- await expect(api_getChains.getChains({ url })).rejects.toThrow("Network Error");
36
+ await expect(
37
+ api_getChains.getChains({ url, nativeAuthToken: "ZKssadass" })
38
+ ).rejects.toThrow("Network Error");
37
39
  });
38
40
  });
@@ -25,12 +25,14 @@ describe("getChains", () => {
25
25
  }
26
26
  ];
27
27
  mockedAxios.get.mockResolvedValue({ data: response });
28
- const result = await getChains({ url });
28
+ const result = await getChains({ url, nativeAuthToken: "ZKssadass" });
29
29
  expect(mockedAxios.get).toHaveBeenCalledWith("/chains", { baseURL: url });
30
30
  expect(result.data).toEqual(response);
31
31
  });
32
32
  it("handles error when fetching chains", async () => {
33
33
  mockedAxios.get.mockRejectedValue(new Error("Network Error"));
34
- await expect(getChains({ url })).rejects.toThrow("Network Error");
34
+ await expect(
35
+ getChains({ url, nativeAuthToken: "ZKssadass" })
36
+ ).rejects.toThrow("Network Error");
35
37
  });
36
38
  });
package/index.js CHANGED
@@ -8,6 +8,8 @@ const api_getTokens = require("./api/getTokens.js");
8
8
  const api_getTokensBalances = require("./api/getTokensBalances.js");
9
9
  const api_getTransactions = require("./api/getTransactions.js");
10
10
  const api_sendTransactions = require("./api/sendTransactions.js");
11
+ const api_checkAccount = require("./api/checkAccount.js");
12
+ const api_linkAccount = require("./api/linkAccount.js");
11
13
  const constants_index = require("./constants/index.js");
12
14
  const helpers_base64Utils = require("./helpers/base64Utils.js");
13
15
  const helpers_decodeLoginToken = require("./helpers/decodeLoginToken.js");
@@ -53,7 +55,7 @@ const reactjs_hooks_validation_useSecondAmountSchema = require("./reactjs/hooks/
53
55
  const reactjs_hooks_validation_useTestHasEnoughFunds = require("./reactjs/hooks/validation/useTestHasEnoughFunds.js");
54
56
  const reactjs_hooks_validation_useTestIsConnected = require("./reactjs/hooks/validation/useTestIsConnected.js");
55
57
  const reactjs_hooks_useAccount = require("./reactjs/hooks/useAccount.js");
56
- const reactjs_hooks_useBalances = require("./useBalances-du_Oq1bB.js");
58
+ const reactjs_hooks_useBalances = require("./useBalances-BrSgRL7R.js");
57
59
  const reactjs_hooks_useBridgeFormik = require("./reactjs/hooks/useBridgeFormik.js");
58
60
  const reactjs_hooks_useDebounce = require("./reactjs/hooks/useDebounce.js");
59
61
  const reactjs_hooks_useFetchBridgeData = require("./reactjs/hooks/useFetchBridgeData.js");
@@ -91,6 +93,8 @@ exports.getTokens = api_getTokens.getTokens;
91
93
  exports.getTokensBalances = api_getTokensBalances.getTokensBalances;
92
94
  exports.getTransactions = api_getTransactions.getTransactions;
93
95
  exports.sendTransactions = api_sendTransactions.sendTransactions;
96
+ exports.checkAccount = api_checkAccount.checkAccount;
97
+ exports.linkAccount = api_linkAccount.linkAccount;
94
98
  exports.MVX_CHAIN_IDS = constants_index.MVX_CHAIN_IDS;
95
99
  exports.decodeBase64 = helpers_base64Utils.decodeBase64;
96
100
  exports.encodeToBase64 = helpers_base64Utils.encodeToBase64;
package/index.mjs CHANGED
@@ -5,6 +5,8 @@ import { getTokens } from "./api/getTokens.mjs";
5
5
  import { getTokensBalances } from "./api/getTokensBalances.mjs";
6
6
  import { getTransactions } from "./api/getTransactions.mjs";
7
7
  import { sendTransactions } from "./api/sendTransactions.mjs";
8
+ import { checkAccount } from "./api/checkAccount.mjs";
9
+ import { linkAccount } from "./api/linkAccount.mjs";
8
10
  import { MVX_CHAIN_IDS } from "./constants/index.mjs";
9
11
  import { decodeBase64, encodeToBase64, isStringBase64 } from "./helpers/base64Utils.mjs";
10
12
  import { decodeLoginToken } from "./helpers/decodeLoginToken.mjs";
@@ -50,7 +52,7 @@ import { useSecondAmountSchema } from "./reactjs/hooks/validation/useSecondAmoun
50
52
  import { useTestHasEnoughFunds } from "./reactjs/hooks/validation/useTestHasEnoughFunds.mjs";
51
53
  import { useTestIsConnected } from "./reactjs/hooks/validation/useTestIsConnected.mjs";
52
54
  import { useAccount } from "./reactjs/hooks/useAccount.mjs";
53
- import { u } from "./useBalances-z9SZjzmN.mjs";
55
+ import { u } from "./useBalances-84Wb5V4N.mjs";
54
56
  import { BridgeFormikValuesEnum, useBridgeFormik } from "./reactjs/hooks/useBridgeFormik.mjs";
55
57
  import { useDebounce } from "./reactjs/hooks/useDebounce.mjs";
56
58
  import { useFetchBridgeData } from "./reactjs/hooks/useFetchBridgeData.mjs";
@@ -113,6 +115,7 @@ export {
113
115
  Web3AppContext,
114
116
  Web3AppProvider,
115
117
  chainIdentifier,
118
+ checkAccount,
116
119
  confirmRate,
117
120
  decodeBase64,
118
121
  decodeLoginToken,
@@ -141,6 +144,7 @@ export {
141
144
  invalidateMvxTokensBalancesQuery,
142
145
  isStringBase64,
143
146
  isStringFloat,
147
+ linkAccount,
144
148
  mxClsx,
145
149
  pipe,
146
150
  removeCommas,
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.34",
31
+ "version": "1.1.0-alpha.35",
32
32
  "main": "index.js",
33
33
  "module": "index.mjs",
34
34
  "types": "index.d.ts",
@@ -44,7 +44,7 @@ const reactjs_components_Connect_MvxAccountDisplay = require("../Connect/MvxAcco
44
44
  const reactjs_components_TokenSelector_TokenSelector = require("../TokenSelector/TokenSelector.js");
45
45
  const viem = require("viem");
46
46
  const actions = require("viem/actions");
47
- const reactjs_hooks_useBalances = require("../../../useBalances-du_Oq1bB.js");
47
+ const reactjs_hooks_useBalances = require("../../../useBalances-BrSgRL7R.js");
48
48
  function deepEqual(a, b) {
49
49
  if (a === b)
50
50
  return true;
@@ -147,6 +147,9 @@ const BridgeForm = ({
147
147
  const { switchNetwork } = react.useAppKitNetwork();
148
148
  const { config, options, supportedChains: sdkChains } = reactjs_context_useWeb3App.useWeb3App();
149
149
  const chainId = reactjs_hooks_useGetChainId.useGetChainId();
150
+ console.log("BridgeForm", {
151
+ nativeAuthToken
152
+ });
150
153
  const {
151
154
  evmTokensWithBalances,
152
155
  mvxTokensWithBalances,
@@ -716,7 +719,8 @@ const BridgeForm = ({
716
719
  onBlur: handleBlur,
717
720
  onMaxBtnClick: handleOnFirstMaxBtnChange,
718
721
  selectedOption: firstToken,
719
- onTokenSelectorDisplay: (visible) => setIsTokenSelectorVisible(visible)
722
+ onTokenSelectorDisplay: (visible) => setIsTokenSelectorVisible(visible),
723
+ nativeAuthToken
720
724
  }
721
725
  )
722
726
  ] })
@@ -773,7 +777,8 @@ const BridgeForm = ({
773
777
  color: "neutral-850",
774
778
  onChange: onChangeSecondSelect,
775
779
  onBlur: handleBlur,
776
- selectedOption: secondToken
780
+ selectedOption: secondToken,
781
+ nativeAuthToken
777
782
  }
778
783
  )
779
784
  ] })
@@ -41,7 +41,7 @@ import { MvxAccountDisplay } from "../Connect/MvxAccountDisplay.mjs";
41
41
  import { TokenSelector } from "../TokenSelector/TokenSelector.mjs";
42
42
  import { hexToString } from "viem";
43
43
  import { waitForTransactionReceipt as waitForTransactionReceipt$1, getTransaction, call } from "viem/actions";
44
- import { g as getAction } from "../../../useBalances-z9SZjzmN.mjs";
44
+ import { g as getAction } from "../../../useBalances-84Wb5V4N.mjs";
45
45
  function deepEqual(a, b) {
46
46
  if (a === b)
47
47
  return true;
@@ -144,6 +144,9 @@ const BridgeForm = ({
144
144
  const { switchNetwork } = useAppKitNetwork();
145
145
  const { config, options, supportedChains: sdkChains } = useWeb3App();
146
146
  const chainId = useGetChainId();
147
+ console.log("BridgeForm", {
148
+ nativeAuthToken
149
+ });
147
150
  const {
148
151
  evmTokensWithBalances,
149
152
  mvxTokensWithBalances,
@@ -713,7 +716,8 @@ const BridgeForm = ({
713
716
  onBlur: handleBlur,
714
717
  onMaxBtnClick: handleOnFirstMaxBtnChange,
715
718
  selectedOption: firstToken,
716
- onTokenSelectorDisplay: (visible) => setIsTokenSelectorVisible(visible)
719
+ onTokenSelectorDisplay: (visible) => setIsTokenSelectorVisible(visible),
720
+ nativeAuthToken
717
721
  }
718
722
  )
719
723
  ] })
@@ -770,7 +774,8 @@ const BridgeForm = ({
770
774
  color: "neutral-850",
771
775
  onChange: onChangeSecondSelect,
772
776
  onBlur: handleBlur,
773
- selectedOption: secondToken
777
+ selectedOption: secondToken,
778
+ nativeAuthToken
774
779
  }
775
780
  )
776
781
  ] })
@@ -1,6 +1,6 @@
1
1
  import { TokenType } from '../../../types/token';
2
2
 
3
- export declare const TokenSelector: ({ name, options, selectedOption, areOptionsLoading, className, disabled, isMvxSelector, omitDisableClass, color, onBlur, onChange, onMaxBtnClick, onTokenSelectorDisplay }: {
3
+ export declare const TokenSelector: ({ name, options, selectedOption, areOptionsLoading, className, disabled, isMvxSelector, omitDisableClass, color, onBlur, onChange, onMaxBtnClick, onTokenSelectorDisplay, nativeAuthToken }: {
4
4
  name: string;
5
5
  options: TokenType[];
6
6
  selectedOption?: TokenType;
@@ -14,4 +14,5 @@ export declare const TokenSelector: ({ name, options, selectedOption, areOptions
14
14
  onBlur?: (e: React.FocusEvent<any, HTMLButtonElement>) => void;
15
15
  onMaxBtnClick?: () => void;
16
16
  onTokenSelectorDisplay?: (visible: boolean) => void;
17
+ nativeAuthToken?: string;
17
18
  }) => import("react/jsx-runtime").JSX.Element;
@@ -28,12 +28,16 @@ const TokenSelector = ({
28
28
  onBlur,
29
29
  onChange,
30
30
  onMaxBtnClick,
31
- onTokenSelectorDisplay
31
+ onTokenSelectorDisplay,
32
+ nativeAuthToken
32
33
  }) => {
33
34
  const [show, setShow] = React.useState(false);
34
- const { data, isLoading: areChainsLoading } = reactjs_queries_useGetChains_query.useGetChainsQuery();
35
+ const { data, isLoading: areChainsLoading } = reactjs_queries_useGetChains_query.useGetChainsQuery({
36
+ nativeAuthToken
37
+ });
35
38
  const { chainIcon } = reactjs_hooks_useResolveTokenChain.useResolveTokenChain({
36
- token: selectedOption
39
+ token: selectedOption,
40
+ nativeAuthToken
37
41
  });
38
42
  const chains = React.useMemo(() => {
39
43
  if (isMvxSelector) {
@@ -25,12 +25,16 @@ const TokenSelector = ({
25
25
  onBlur,
26
26
  onChange,
27
27
  onMaxBtnClick,
28
- onTokenSelectorDisplay
28
+ onTokenSelectorDisplay,
29
+ nativeAuthToken
29
30
  }) => {
30
31
  const [show, setShow] = useState(false);
31
- const { data, isLoading: areChainsLoading } = useGetChainsQuery();
32
+ const { data, isLoading: areChainsLoading } = useGetChainsQuery({
33
+ nativeAuthToken
34
+ });
32
35
  const { chainIcon } = useResolveTokenChain({
33
- token: selectedOption
36
+ token: selectedOption,
37
+ nativeAuthToken
34
38
  });
35
39
  const chains = useMemo(() => {
36
40
  if (isMvxSelector) {
@@ -1,7 +1,8 @@
1
1
  import { TokenType } from '../../../../types/token';
2
2
 
3
- export declare const TokenItem: ({ token, onClick, selected }: {
3
+ export declare const TokenItem: ({ token, onClick, selected, nativeAuthToken }: {
4
4
  token: TokenType;
5
5
  onClick: (token: TokenType) => void;
6
6
  selected: boolean;
7
+ nativeAuthToken?: string;
7
8
  }) => import("react/jsx-runtime").JSX.Element;
@@ -11,10 +11,12 @@ const reactjs_hooks_useResolveTokenChain = require("../../../hooks/useResolveTok
11
11
  const TokenItem = ({
12
12
  token,
13
13
  onClick,
14
- selected
14
+ selected,
15
+ nativeAuthToken
15
16
  }) => {
16
17
  const { tokenChain, chainIcon } = reactjs_hooks_useResolveTokenChain.useResolveTokenChain({
17
- token
18
+ token,
19
+ nativeAuthToken
18
20
  });
19
21
  const { supportedChains: sdkChains } = reactjs_context_useWeb3App.useWeb3App();
20
22
  const { switchNetwork } = react.useAppKitNetwork();
@@ -8,10 +8,12 @@ import { useResolveTokenChain } from "../../../hooks/useResolveTokenChain.mjs";
8
8
  const TokenItem = ({
9
9
  token,
10
10
  onClick,
11
- selected
11
+ selected,
12
+ nativeAuthToken
12
13
  }) => {
13
14
  const { tokenChain, chainIcon } = useResolveTokenChain({
14
- token
15
+ token,
16
+ nativeAuthToken
15
17
  });
16
18
  const { supportedChains: sdkChains } = useWeb3App();
17
19
  const { switchNetwork } = useAppKitNetwork();
@@ -6,7 +6,7 @@ const reactjs_hooks_validation_useSecondAmountSchema = require("./validation/use
6
6
  const reactjs_hooks_validation_useTestHasEnoughFunds = require("./validation/useTestHasEnoughFunds.js");
7
7
  const reactjs_hooks_validation_useTestIsConnected = require("./validation/useTestIsConnected.js");
8
8
  const reactjs_hooks_useAccount = require("./useAccount.js");
9
- const reactjs_hooks_useBalances = require("../../useBalances-du_Oq1bB.js");
9
+ const reactjs_hooks_useBalances = require("../../useBalances-BrSgRL7R.js");
10
10
  const reactjs_hooks_useBridgeFormik = require("./useBridgeFormik.js");
11
11
  const reactjs_hooks_useDebounce = require("./useDebounce.js");
12
12
  const reactjs_hooks_useFetchBridgeData = require("./useFetchBridgeData.js");
@@ -3,7 +3,7 @@ import { useSecondAmountSchema } from "./validation/useSecondAmountSchema.mjs";
3
3
  import { useTestHasEnoughFunds } from "./validation/useTestHasEnoughFunds.mjs";
4
4
  import { useTestIsConnected } from "./validation/useTestIsConnected.mjs";
5
5
  import { useAccount } from "./useAccount.mjs";
6
- import { u } from "../../useBalances-z9SZjzmN.mjs";
6
+ import { u } from "../../useBalances-84Wb5V4N.mjs";
7
7
  import { BridgeFormikValuesEnum, useBridgeFormik } from "./useBridgeFormik.mjs";
8
8
  import { useDebounce } from "./useDebounce.mjs";
9
9
  import { useFetchBridgeData } from "./useFetchBridgeData.mjs";
@@ -15,7 +15,7 @@ require("yup");
15
15
  require("@multiversx/sdk-dapp-utils/out/helpers/parseAmount");
16
16
  require("../../bignumber-B8vjg9qn.js");
17
17
  require("wagmi");
18
- const reactjs_hooks_useBalances = require("../../useBalances-du_Oq1bB.js");
18
+ const reactjs_hooks_useBalances = require("../../useBalances-BrSgRL7R.js");
19
19
  require("formik");
20
20
  require("../constants/index.js");
21
21
  require("@reown/appkit-adapter-solana/react");
@@ -12,7 +12,7 @@ import "yup";
12
12
  import "@multiversx/sdk-dapp-utils/out/helpers/parseAmount";
13
13
  import "../../bignumber-CKZkoo0g.mjs";
14
14
  import "wagmi";
15
- import { u } from "../../useBalances-z9SZjzmN.mjs";
15
+ import { u } from "../../useBalances-84Wb5V4N.mjs";
16
16
  import "formik";
17
17
  import "../constants/index.mjs";
18
18
  import "@reown/appkit-adapter-solana/react";
@@ -29,7 +29,9 @@ const useFetchBridgeData = ({
29
29
  data: chains,
30
30
  isLoading: isChainsLoading,
31
31
  isError: isChainsError
32
- } = reactjs_queries_useGetChains_query.useGetChainsQuery();
32
+ } = reactjs_queries_useGetChains_query.useGetChainsQuery({
33
+ nativeAuthToken
34
+ });
33
35
  return {
34
36
  isTokensError,
35
37
  isTokensLoading,
@@ -26,7 +26,9 @@ const useFetchBridgeData = ({
26
26
  data: chains,
27
27
  isLoading: isChainsLoading,
28
28
  isError: isChainsError
29
- } = useGetChainsQuery();
29
+ } = useGetChainsQuery({
30
+ nativeAuthToken
31
+ });
30
32
  return {
31
33
  isTokensError,
32
34
  isTokensLoading,
@@ -20,7 +20,9 @@ const useFetchTokens = ({
20
20
  data: tokens,
21
21
  isLoading: isTokensLoading,
22
22
  isError: isTokensError
23
- } = reactjs_queries_useGetAllTokens_query.useGetAllTokensQuery();
23
+ } = reactjs_queries_useGetAllTokens_query.useGetAllTokensQuery({
24
+ nativeAuthToken
25
+ });
24
26
  const evmTokens = React.useMemo(
25
27
  () => tokens == null ? void 0 : tokens.filter(
26
28
  (token) => !constants_index.MVX_CHAIN_IDS.includes(token.chainId.toString()) && token.chainId.toLowerCase() !== "fiat"
@@ -17,7 +17,9 @@ const useFetchTokens = ({
17
17
  data: tokens,
18
18
  isLoading: isTokensLoading,
19
19
  isError: isTokensError
20
- } = useGetAllTokensQuery();
20
+ } = useGetAllTokensQuery({
21
+ nativeAuthToken
22
+ });
21
23
  const evmTokens = useMemo(
22
24
  () => tokens == null ? void 0 : tokens.filter(
23
25
  (token) => !MVX_CHAIN_IDS.includes(token.chainId.toString()) && token.chainId.toLowerCase() !== "fiat"
@@ -1,7 +1,8 @@
1
- export declare const useFiatData: ({ mvxAddress, mvxApiURL, refetchTrigger }: {
1
+ export declare const useFiatData: ({ mvxAddress, mvxApiURL, refetchTrigger, nativeAuthToken }: {
2
2
  mvxAddress?: string;
3
3
  mvxApiURL: string;
4
4
  refetchTrigger?: number;
5
+ nativeAuthToken?: string;
5
6
  }) => {
6
7
  isTokensLoading: boolean;
7
8
  isTokensError: boolean;
@@ -8,13 +8,16 @@ const reactjs_queries_useGetMvxTokensBalances_query = require("../queries/useGet
8
8
  const useFiatData = ({
9
9
  mvxAddress,
10
10
  mvxApiURL,
11
- refetchTrigger
11
+ refetchTrigger,
12
+ nativeAuthToken
12
13
  }) => {
13
14
  const {
14
15
  data: tokens,
15
16
  isLoading: isTokensLoading,
16
17
  isError: isTokensError
17
- } = reactjs_queries_useGetAllTokens_query.useGetAllTokensQuery();
18
+ } = reactjs_queries_useGetAllTokens_query.useGetAllTokensQuery({
19
+ nativeAuthToken
20
+ });
18
21
  const mvxTokens = React.useMemo(
19
22
  () => tokens == null ? void 0 : tokens.filter(
20
23
  (token) => constants_index.MVX_CHAIN_IDS.includes(token.chainId.toString())
@@ -5,13 +5,16 @@ import { useGetMvxTokensBalancesQuery, invalidateMvxTokensBalancesQuery } from "
5
5
  const useFiatData = ({
6
6
  mvxAddress,
7
7
  mvxApiURL,
8
- refetchTrigger
8
+ refetchTrigger,
9
+ nativeAuthToken
9
10
  }) => {
10
11
  const {
11
12
  data: tokens,
12
13
  isLoading: isTokensLoading,
13
14
  isError: isTokensError
14
- } = useGetAllTokensQuery();
15
+ } = useGetAllTokensQuery({
16
+ nativeAuthToken
17
+ });
15
18
  const mvxTokens = useMemo(
16
19
  () => tokens == null ? void 0 : tokens.filter(
17
20
  (token) => MVX_CHAIN_IDS.includes(token.chainId.toString())
@@ -1,7 +1,8 @@
1
1
  import { TokenDTO } from '../../dto/Token.dto';
2
2
 
3
- export declare const useResolveTokenChain: ({ token }: {
3
+ export declare const useResolveTokenChain: ({ token, nativeAuthToken }: {
4
4
  token?: TokenDTO;
5
+ nativeAuthToken?: string;
5
6
  }) => {
6
7
  tokenChain: import('../..').ChainDTO | undefined;
7
8
  isLoading: boolean;
@@ -5,8 +5,13 @@ const React = require("react");
5
5
  require("../constants/index.js");
6
6
  const reactjs_queries_useGetChains_query = require("../queries/useGetChains.query.js");
7
7
  const reactjs_constants_chains = require("../constants/chains.js");
8
- const useResolveTokenChain = ({ token }) => {
9
- const { data: chains, isLoading } = reactjs_queries_useGetChains_query.useGetChainsQuery();
8
+ const useResolveTokenChain = ({
9
+ token,
10
+ nativeAuthToken
11
+ }) => {
12
+ const { data: chains, isLoading } = reactjs_queries_useGetChains_query.useGetChainsQuery({
13
+ nativeAuthToken
14
+ });
10
15
  const tokenChain = React.useMemo(() => {
11
16
  return chains == null ? void 0 : chains.find(
12
17
  (chain) => chain.chainId.toString() === (token == null ? void 0 : token.chainId.toString())
@@ -2,8 +2,13 @@ import { useMemo } from "react";
2
2
  import "../constants/index.mjs";
3
3
  import { useGetChainsQuery } from "../queries/useGetChains.query.mjs";
4
4
  import { chainIdentifier } from "../constants/chains.mjs";
5
- const useResolveTokenChain = ({ token }) => {
6
- const { data: chains, isLoading } = useGetChainsQuery();
5
+ const useResolveTokenChain = ({
6
+ token,
7
+ nativeAuthToken
8
+ }) => {
9
+ const { data: chains, isLoading } = useGetChainsQuery({
10
+ nativeAuthToken
11
+ });
7
12
  const tokenChain = useMemo(() => {
8
13
  return chains == null ? void 0 : chains.find(
9
14
  (chain) => chain.chainId.toString() === (token == null ? void 0 : token.chainId.toString())
package/reactjs/index.js CHANGED
@@ -36,7 +36,7 @@ const reactjs_hooks_validation_useSecondAmountSchema = require("./hooks/validati
36
36
  const reactjs_hooks_validation_useTestHasEnoughFunds = require("./hooks/validation/useTestHasEnoughFunds.js");
37
37
  const reactjs_hooks_validation_useTestIsConnected = require("./hooks/validation/useTestIsConnected.js");
38
38
  const reactjs_hooks_useAccount = require("./hooks/useAccount.js");
39
- const reactjs_hooks_useBalances = require("../useBalances-du_Oq1bB.js");
39
+ const reactjs_hooks_useBalances = require("../useBalances-BrSgRL7R.js");
40
40
  const reactjs_hooks_useBridgeFormik = require("./hooks/useBridgeFormik.js");
41
41
  const reactjs_hooks_useDebounce = require("./hooks/useDebounce.js");
42
42
  const reactjs_hooks_useFetchBridgeData = require("./hooks/useFetchBridgeData.js");
package/reactjs/index.mjs CHANGED
@@ -33,7 +33,7 @@ import { useSecondAmountSchema } from "./hooks/validation/useSecondAmountSchema.
33
33
  import { useTestHasEnoughFunds } from "./hooks/validation/useTestHasEnoughFunds.mjs";
34
34
  import { useTestIsConnected } from "./hooks/validation/useTestIsConnected.mjs";
35
35
  import { useAccount } from "./hooks/useAccount.mjs";
36
- import { u } from "../useBalances-z9SZjzmN.mjs";
36
+ import { u } from "../useBalances-84Wb5V4N.mjs";
37
37
  import { BridgeFormikValuesEnum, useBridgeFormik } from "./hooks/useBridgeFormik.mjs";
38
38
  import { useDebounce } from "./hooks/useDebounce.mjs";
39
39
  import { useFetchBridgeData } from "./hooks/useFetchBridgeData.mjs";
@@ -1,3 +1,5 @@
1
1
  import { AxiosError } from 'axios';
2
2
 
3
- export declare const useGetAllTokensQuery: () => import('@tanstack/react-query').UseQueryResult<import('../..').TokenType[], AxiosError<unknown, any>>;
3
+ export declare const useGetAllTokensQuery: ({ nativeAuthToken }: {
4
+ nativeAuthToken?: string;
5
+ }) => import('@tanstack/react-query').UseQueryResult<import('../..').TokenType[], AxiosError<unknown, any>>;
@@ -4,11 +4,14 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
4
  const reactQuery = require("@tanstack/react-query");
5
5
  const api_getTokens = require("../../api/getTokens.js");
6
6
  const helpers_getApiURL = require("../../helpers/getApiURL.js");
7
- const useGetAllTokensQuery = () => {
7
+ const useGetAllTokensQuery = ({
8
+ nativeAuthToken
9
+ }) => {
8
10
  const queryFn = async () => {
9
11
  try {
10
12
  const { data } = await api_getTokens.getTokens({
11
- url: helpers_getApiURL.getApiURL()
13
+ url: helpers_getApiURL.getApiURL(),
14
+ nativeAuthToken
12
15
  });
13
16
  return data;
14
17
  } catch (error) {
@@ -1,11 +1,14 @@
1
1
  import { useQuery } from "@tanstack/react-query";
2
2
  import { getTokens } from "../../api/getTokens.mjs";
3
3
  import { getApiURL } from "../../helpers/getApiURL.mjs";
4
- const useGetAllTokensQuery = () => {
4
+ const useGetAllTokensQuery = ({
5
+ nativeAuthToken
6
+ }) => {
5
7
  const queryFn = async () => {
6
8
  try {
7
9
  const { data } = await getTokens({
8
- url: getApiURL()
10
+ url: getApiURL(),
11
+ nativeAuthToken
9
12
  });
10
13
  return data;
11
14
  } catch (error) {
@@ -1,3 +1,5 @@
1
1
  import { AxiosError } from 'axios';
2
2
 
3
- export declare const useGetChainsQuery: () => import('@tanstack/react-query').UseQueryResult<import('../..').ChainDTO[], AxiosError<unknown, any>>;
3
+ export declare const useGetChainsQuery: ({ nativeAuthToken }: {
4
+ nativeAuthToken?: string;
5
+ }) => import('@tanstack/react-query').UseQueryResult<import('../..').ChainDTO[], AxiosError<unknown, any>>;
@@ -4,11 +4,14 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
4
  const reactQuery = require("@tanstack/react-query");
5
5
  const api_getChains = require("../../api/getChains.js");
6
6
  const helpers_getApiURL = require("../../helpers/getApiURL.js");
7
- const useGetChainsQuery = () => {
7
+ const useGetChainsQuery = ({
8
+ nativeAuthToken
9
+ }) => {
8
10
  const queryFn = async () => {
9
11
  try {
10
12
  const { data } = await api_getChains.getChains({
11
- url: helpers_getApiURL.getApiURL()
13
+ url: helpers_getApiURL.getApiURL(),
14
+ nativeAuthToken
12
15
  });
13
16
  return data;
14
17
  } catch (error) {
@@ -1,11 +1,14 @@
1
1
  import { useQuery } from "@tanstack/react-query";
2
2
  import { getChains } from "../../api/getChains.mjs";
3
3
  import { getApiURL } from "../../helpers/getApiURL.mjs";
4
- const useGetChainsQuery = () => {
4
+ const useGetChainsQuery = ({
5
+ nativeAuthToken
6
+ }) => {
5
7
  const queryFn = async () => {
6
8
  try {
7
9
  const { data } = await getChains({
8
- url: getApiURL()
10
+ url: getApiURL(),
11
+ nativeAuthToken
9
12
  });
10
13
  return data;
11
14
  } catch (error) {
@@ -9,7 +9,7 @@ require("react");
9
9
  require("@multiversx/sdk-dapp-utils/out/helpers/parseAmount");
10
10
  require("../../bignumber-B8vjg9qn.js");
11
11
  require("wagmi");
12
- const reactjs_hooks_useBalances = require("../../useBalances-du_Oq1bB.js");
12
+ const reactjs_hooks_useBalances = require("../../useBalances-BrSgRL7R.js");
13
13
  require("formik");
14
14
  require("axios");
15
15
  require("../context/Web3AppProvider.js");
@@ -6,7 +6,7 @@ import "react";
6
6
  import "@multiversx/sdk-dapp-utils/out/helpers/parseAmount";
7
7
  import "../../bignumber-CKZkoo0g.mjs";
8
8
  import "wagmi";
9
- import { u as useBalances } from "../../useBalances-z9SZjzmN.mjs";
9
+ import { u as useBalances } from "../../useBalances-84Wb5V4N.mjs";
10
10
  import "formik";
11
11
  import "axios";
12
12
  import "../context/Web3AppProvider.mjs";
@@ -1,12 +1,13 @@
1
1
  import { ProviderType } from 'types/providerType';
2
2
  import { AxiosError } from 'axios';
3
3
 
4
- export declare const useGetHistoryQuery: ({ address, sender, provider, status, tokenIn, tokenOut }: {
4
+ export declare const useGetHistoryQuery: ({ address, sender, provider, status, tokenIn, tokenOut, nativeAuthToken }: {
5
5
  address?: string;
6
6
  sender?: string;
7
7
  provider?: ProviderType;
8
8
  status?: string;
9
9
  tokenIn?: string;
10
10
  tokenOut?: string;
11
+ nativeAuthToken?: string;
11
12
  }) => import('@tanstack/react-query').UseQueryResult<import('../..').TransactionDTO[], AxiosError<unknown, any>>;
12
13
  export declare const invalidateHistoryQuery: () => void;
@@ -11,7 +11,8 @@ const useGetHistoryQuery = ({
11
11
  provider,
12
12
  status,
13
13
  tokenIn,
14
- tokenOut
14
+ tokenOut,
15
+ nativeAuthToken
15
16
  }) => {
16
17
  const queryFn = async () => {
17
18
  if (!address) {
@@ -25,7 +26,8 @@ const useGetHistoryQuery = ({
25
26
  provider,
26
27
  status,
27
28
  tokenIn,
28
- tokenOut
29
+ tokenOut,
30
+ nativeAuthToken
29
31
  });
30
32
  return data;
31
33
  } catch (error) {
@@ -8,7 +8,8 @@ const useGetHistoryQuery = ({
8
8
  provider,
9
9
  status,
10
10
  tokenIn,
11
- tokenOut
11
+ tokenOut,
12
+ nativeAuthToken
12
13
  }) => {
13
14
  const queryFn = async () => {
14
15
  if (!address) {
@@ -22,7 +23,8 @@ const useGetHistoryQuery = ({
22
23
  provider,
23
24
  status,
24
25
  tokenIn,
25
- tokenOut
26
+ tokenOut,
27
+ nativeAuthToken
26
28
  });
27
29
  return data;
28
30
  } catch (error) {
@@ -1,10 +1,11 @@
1
1
  import { TokenType } from '../../types/token';
2
2
  import { AxiosError } from 'axios';
3
3
 
4
- export declare const useGetMvxTokensBalancesQuery: ({ tokens, mvxAddress, apiURL }: {
4
+ export declare const useGetMvxTokensBalancesQuery: ({ tokens, mvxAddress, apiURL, nativeAuthToken }: {
5
5
  tokens: TokenType[];
6
6
  mvxAddress?: string;
7
7
  apiURL: string;
8
+ nativeAuthToken?: string;
8
9
  }) => import('@tanstack/react-query').UseQueryResult<{
9
10
  balance: string;
10
11
  address: string;
@@ -8,16 +8,21 @@ const reactjs_context_queryClient = require("../context/queryClient.js");
8
8
  const useGetMvxTokensBalancesQuery = ({
9
9
  tokens,
10
10
  mvxAddress,
11
- apiURL
11
+ apiURL,
12
+ nativeAuthToken
12
13
  }) => {
13
14
  const tokenIdentifiers = React.useMemo(() => {
14
15
  return tokens.map(({ address }) => address);
15
16
  }, [tokens]);
16
17
  const url = `${apiURL}/accounts/${mvxAddress}/tokens?identifiers=${tokenIdentifiers}`;
18
+ const config = {
19
+ headers: {
20
+ Authorization: `Bearer ${nativeAuthToken}`
21
+ },
22
+ timeout: 3e3
23
+ };
17
24
  const queryFn = async () => {
18
- const { data } = await axios.get(url, {
19
- timeout: 3e3
20
- });
25
+ const { data } = await axios.get(url, config);
21
26
  return data.map((asset) => {
22
27
  var _a;
23
28
  const foundToken = tokens.find(
@@ -5,16 +5,21 @@ import { getQueryClient } from "../context/queryClient.mjs";
5
5
  const useGetMvxTokensBalancesQuery = ({
6
6
  tokens,
7
7
  mvxAddress,
8
- apiURL
8
+ apiURL,
9
+ nativeAuthToken
9
10
  }) => {
10
11
  const tokenIdentifiers = useMemo(() => {
11
12
  return tokens.map(({ address }) => address);
12
13
  }, [tokens]);
13
14
  const url = `${apiURL}/accounts/${mvxAddress}/tokens?identifiers=${tokenIdentifiers}`;
15
+ const config = {
16
+ headers: {
17
+ Authorization: `Bearer ${nativeAuthToken}`
18
+ },
19
+ timeout: 3e3
20
+ };
14
21
  const queryFn = async () => {
15
- const { data } = await axios.get(url, {
16
- timeout: 3e3
17
- });
22
+ const { data } = await axios.get(url, config);
18
23
  return data.map((asset) => {
19
24
  var _a;
20
25
  const foundToken = tokens.find(
@@ -174,7 +174,9 @@ const useBalances = ({
174
174
  const { config } = useWeb3App();
175
175
  const { address, isConnected } = useAppKitAccount();
176
176
  const chainId = useGetChainId();
177
- const { data: chains } = useGetChainsQuery();
177
+ const { data: chains } = useGetChainsQuery({
178
+ nativeAuthToken
179
+ });
178
180
  const activeChain = useMemo(() => {
179
181
  return chains == null ? void 0 : chains.find(
180
182
  (chain) => chain.chainId.toString() === (chainId == null ? void 0 : chainId.toString())
@@ -199,7 +201,6 @@ const useBalances = ({
199
201
  const url = `${getApiURL()}/user/balance/${address}?chainId=${activeChain == null ? void 0 : activeChain.chainId}`;
200
202
  try {
201
203
  const { data } = await axios.get(url, {
202
- baseURL: url,
203
204
  headers: {
204
205
  Authorization: `Bearer ${nativeAuthToken}`
205
206
  }
@@ -176,7 +176,9 @@ const useBalances = ({
176
176
  const { config } = reactjs_context_useWeb3App.useWeb3App();
177
177
  const { address, isConnected } = react.useAppKitAccount();
178
178
  const chainId = reactjs_hooks_useGetChainId.useGetChainId();
179
- const { data: chains } = reactjs_queries_useGetChains_query.useGetChainsQuery();
179
+ const { data: chains } = reactjs_queries_useGetChains_query.useGetChainsQuery({
180
+ nativeAuthToken
181
+ });
180
182
  const activeChain = React.useMemo(() => {
181
183
  return chains == null ? void 0 : chains.find(
182
184
  (chain) => chain.chainId.toString() === (chainId == null ? void 0 : chainId.toString())
@@ -201,7 +203,6 @@ const useBalances = ({
201
203
  const url = `${helpers_getApiURL.getApiURL()}/user/balance/${address}?chainId=${activeChain == null ? void 0 : activeChain.chainId}`;
202
204
  try {
203
205
  const { data } = await axios.get(url, {
204
- baseURL: url,
205
206
  headers: {
206
207
  Authorization: `Bearer ${nativeAuthToken}`
207
208
  }