@multiversx/sdk-dapp-liquidity 2.3.0-alpha.4 → 2.3.0-alpha.5

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.
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@reown/appkit/react"),p=require("axios"),b=require("react"),h=require("../../helpers/getApiURL.js"),o=require("../context/useWeb3App.js"),A=()=>{const{config:u}=o.useWeb3App(),{address:t,isConnected:a}=l.useAppKitAccount(),{nativeAuthToken:i}=o.useWeb3App(),d=async n=>{const s=`${h.getApiURL()}/user/balance/${t}?chainId=${n}`;try{const{data:r}=await p.get(s,{headers:{Authorization:`Bearer ${i}`}});return r.reduce((e,c)=>(e[c.tokenAddress]=c.balance,e),{})}catch(r){throw new Error(`Error fetching balances: ${r}`)}};return{getBalances:b.useCallback(async({tokens:n,chainId:s})=>{const r=await d(s);return n.map(e=>!a||!t||!e.chainId?{tokenId:e.address,balance:"0"}:{tokenId:e.address,balance:r[e.address]??"0"})},[u,a,t])}};exports.useBalances=A;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@reown/appkit/react"),d=require("axios"),l=require("react"),b=require("../../helpers/getApiURL.js"),p=require("../context/useWeb3App.js"),h=()=>{const{address:t,isConnected:s}=i.useAppKitAccount(),{nativeAuthToken:c}=p.useWeb3App(),u=async a=>{const n=`${b.getApiURL()}/user/balance/${t}?chainId=${a}`;try{const{data:r}=await d.get(n,{headers:{Authorization:`Bearer ${c}`}});return r.reduce((e,o)=>(e[o.tokenAddress]=o.balance,e),{})}catch(r){throw new Error(`Error fetching balances: ${r}`)}};return{getBalances:l.useCallback(async({tokens:a,chainId:n})=>{const r=await u(n);return a.map(e=>!s||!t||!e.chainId?{tokenId:e.address,balance:"0"}:{tokenId:e.address,balance:r[e.address]??"0"})},[s,t,c])}};exports.useBalances=h;
@@ -1,19 +1,19 @@
1
- import { useAppKitAccount as l } from "@reown/appkit/react";
2
- import p from "axios";
3
- import { useCallback as m } from "react";
4
- import { getApiURL as f } from "../../helpers/getApiURL.mjs";
5
- import { useWeb3App as c } from "../context/useWeb3App.mjs";
6
- const w = () => {
7
- const { config: i } = c(), { address: a, isConnected: s } = l(), { nativeAuthToken: d } = c(), u = async (t) => {
8
- const n = `${f()}/user/balance/${a}?chainId=${t}`;
1
+ import { useAppKitAccount as i } from "@reown/appkit/react";
2
+ import u from "axios";
3
+ import { useCallback as l } from "react";
4
+ import { getApiURL as p } from "../../helpers/getApiURL.mjs";
5
+ import { useWeb3App as m } from "../context/useWeb3App.mjs";
6
+ const $ = () => {
7
+ const { address: a, isConnected: s } = i(), { nativeAuthToken: o } = m(), d = async (t) => {
8
+ const n = `${p()}/user/balance/${a}?chainId=${t}`;
9
9
  try {
10
- const { data: r } = await p.get(n, {
10
+ const { data: r } = await u.get(n, {
11
11
  headers: {
12
- Authorization: `Bearer ${d}`
12
+ Authorization: `Bearer ${o}`
13
13
  }
14
14
  });
15
15
  return r.reduce(
16
- (e, o) => (e[o.tokenAddress] = o.balance, e),
16
+ (e, c) => (e[c.tokenAddress] = c.balance, e),
17
17
  {}
18
18
  );
19
19
  } catch (r) {
@@ -21,9 +21,9 @@ const w = () => {
21
21
  }
22
22
  };
23
23
  return {
24
- getBalances: m(
24
+ getBalances: l(
25
25
  async ({ tokens: t, chainId: n }) => {
26
- const r = await u(n);
26
+ const r = await d(n);
27
27
  return t.map((e) => !s || !a || !e.chainId ? {
28
28
  tokenId: e.address,
29
29
  balance: "0"
@@ -32,10 +32,11 @@ const w = () => {
32
32
  balance: r[e.address] ?? "0"
33
33
  });
34
34
  },
35
- [i, s, a]
35
+ // nativeAuthToken is used inside fetchBalances (auth header); config is not used.
36
+ [s, a, o]
36
37
  )
37
38
  };
38
39
  };
39
40
  export {
40
- w as useBalances
41
+ $ as useBalances
41
42
  };
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const J=require("formik"),d=require("react"),a=require("yup"),K=require("./validation/useAmountSchema.js"),Q=require("./validation/useSecondAmountSchema.js"),X=require("../../api/confirmRate.js"),Y=require("../../helpers/assertConfirmRateData.js"),Z=require("../../helpers/assertRateConfirmationMatchesIntent.js"),B=require("../../helpers/getApiURL.js"),R=require("../../helpers/isValidAddressForChainType.js"),j=require("../../types/errors.js"),M=require("../../types/providerType.js"),oo=require("../context/useWeb3App.js");var D=(r=>(r.firstToken="firstToken",r.firstAmount="firstAmount",r.secondToken="secondToken",r.secondAmount="secondAmount",r.fromChainId="fromChainId",r.toChainId="toChainId",r))(D||{});const ro=({sender:r,receiver:c,firstToken:h,firstAmount:I,secondToken:C,secondAmount:l,fromChainId:p,toChainId:A,setForceRefetchRate:S,rate:o,onSubmit:O,isMvxConnected:P,senderChainType:q,receiverChainType:v})=>{const u=d.useRef(),{nativeAuthToken:k}=oo.useWeb3App(),[V,_]=d.useState(void 0),g=!r||!q?!0:R.isValidAddressForChainType(r,q),T=!c||!v?!0:R.isValidAddressForChainType(c,v),$=r&&!g?`Invalid ${q} sender address`:void 0,w=c&&!T?`Invalid ${v} receiver address`:void 0,F={firstAmount:"",secondAmount:"",fromChainId:p??"",toChainId:A??""},b=()=>{f.setTouched({},!1),f.setErrors({}),e("firstAmount",""),e("secondAmount","")},L=async t=>{var y,E;if(!u.current){u.current=!0,_(void 0);try{if(!g||!T){u.current=!1;return}Y.assertConfirmRateData({nativeAuthToken:k,orderId:o==null?void 0:o.orderId,fromChainId:t.fromChainId,toChainId:t.toChainId,sender:r,receiver:c});const{data:i}=await X.confirmRate({url:B.getApiURL(),nativeAuthToken:k??"",body:{tokenIn:((y=t.firstToken)==null?void 0:y.address)??"",amountIn:(I==null?void 0:I.toString())??"",fromChainId:t.fromChainId??"",tokenOut:((E=t.secondToken)==null?void 0:E.address)??"",toChainId:t.toChainId??"",amountOut:(l==null?void 0:l.toString())??"",sender:r??"",receiver:c??"",fee:(o==null?void 0:o.fee)??"0",provider:(o==null?void 0:o.provider)??M.ProviderType.None,orderId:(o==null?void 0:o.orderId)??""}}),s=i;if(!s||s.length===0){u.current=!1;return}Z.assertRateConfirmationMatchesIntent({fromChainId:t.fromChainId??"",sender:r??""},s),b(),O({transactions:s,provider:(o==null?void 0:o.provider)??M.ProviderType.None})}catch(i){console.error("Error confirming rate:",i),i instanceof j.ConfirmRateError||i instanceof j.MissingConfirmRateDataError?_(i.message):S==null||S(s=>s+1)}finally{u.current=!1}}},f=J.useFormik({initialValues:F,validationSchema:a.object().shape({firstAmount:K.useAmountSchema({isMvxConnected:P}),firstToken:a.object().required(),secondAmount:Q.useSecondAmountSchema(),secondToken:a.object().required(),fromChainId:a.string().required(),toChainId:a.string().required()}),onSubmit:L}),{errors:n,touched:m,handleBlur:N,handleSubmit:U,handleChange:W,setFieldValue:e,setFieldTouched:x}=f;d.useEffect(()=>{e("firstToken",h,!0)},[h]),d.useEffect(()=>{e("secondToken",C,!0)},[C]),d.useEffect(()=>{e("fromChainId",p,!0)},[p]),d.useEffect(()=>{e("toChainId",A,!0)},[A]);const z="secondAmount"in n&&"secondAmount"in m?n.secondAmount:void 0,G="firstAmount"in n&&"firstAmount"in m?n.firstAmount:void 0,H="fromChainId"in n&&"fromChainId"in m?n.fromChainId:void 0;return{formik:f,errors:n,touched:m,firstToken:h,secondToken:C,firstAmountError:G,secondAmountError:z,fromChainError:H,senderAddressError:$,receiverAddressError:w,confirmRateError:V,handleBlur:N,handleChange:W,handleSubmit:U,setFieldValue:e,resetSwapForm:b,setFieldTouched:x}};exports.BridgeFormikValuesEnum=D;exports.useBridgeFormik=ro;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const J=require("formik"),d=require("react"),a=require("yup"),K=require("./validation/useAmountSchema.js"),Q=require("./validation/useSecondAmountSchema.js"),X=require("../../api/confirmRate.js"),Y=require("../../helpers/assertConfirmRateData.js"),Z=require("../../helpers/assertRateConfirmationMatchesIntent.js"),B=require("../../helpers/getApiURL.js"),R=require("../../helpers/isValidAddressForChainType.js"),j=require("../../types/errors.js"),M=require("../../types/providerType.js"),oo=require("../context/useWeb3App.js");var D=(r=>(r.firstToken="firstToken",r.firstAmount="firstAmount",r.secondToken="secondToken",r.secondAmount="secondAmount",r.fromChainId="fromChainId",r.toChainId="toChainId",r))(D||{});const ro=({sender:r,receiver:c,firstToken:h,firstAmount:I,secondToken:C,secondAmount:l,fromChainId:p,toChainId:A,setForceRefetchRate:S,rate:o,onSubmit:O,isMvxConnected:P,senderChainType:q,receiverChainType:v})=>{const u=d.useRef(),{nativeAuthToken:k}=oo.useWeb3App(),[V,_]=d.useState(void 0),g=!r||!q?!0:R.isValidAddressForChainType(r,q),T=!c||!v?!0:R.isValidAddressForChainType(c,v),$=r&&!g?`Invalid ${q} sender address`:void 0,w=c&&!T?`Invalid ${v} receiver address`:void 0,F={firstAmount:"",secondAmount:"",fromChainId:p??"",toChainId:A??""},b=()=>{f.setTouched({},!1),f.setErrors({}),n("firstAmount",""),n("secondAmount","")},L=async t=>{var y,E;if(!u.current){u.current=!0,_(void 0);try{if(!g||!T){u.current=!1;return}Y.assertConfirmRateData({nativeAuthToken:k,orderId:o==null?void 0:o.orderId,fromChainId:t.fromChainId,toChainId:t.toChainId,sender:r,receiver:c});const{data:i}=await X.confirmRate({url:B.getApiURL(),nativeAuthToken:k??"",body:{tokenIn:((y=t.firstToken)==null?void 0:y.address)??"",amountIn:(I==null?void 0:I.toString())??"",fromChainId:t.fromChainId??"",tokenOut:((E=t.secondToken)==null?void 0:E.address)??"",toChainId:t.toChainId??"",amountOut:(l==null?void 0:l.toString())??"",sender:r??"",receiver:c??"",fee:(o==null?void 0:o.fee)??"0",provider:(o==null?void 0:o.provider)??M.ProviderType.None,orderId:(o==null?void 0:o.orderId)??""}}),s=i;if(!s||s.length===0){u.current=!1;return}Z.assertRateConfirmationMatchesIntent({fromChainId:t.fromChainId??"",sender:r??""},s),b(),O({transactions:s,provider:(o==null?void 0:o.provider)??M.ProviderType.None})}catch(i){console.error("Error confirming rate:",i),i instanceof j.ConfirmRateError||i instanceof j.MissingConfirmRateDataError?_(i.message):S==null||S(s=>s+1)}finally{u.current=!1}}},f=J.useFormik({initialValues:F,validationSchema:a.object().shape({firstAmount:K.useAmountSchema({isMvxConnected:P}),firstToken:a.object().required(),secondAmount:Q.useSecondAmountSchema(),secondToken:a.object().required(),fromChainId:a.string().required(),toChainId:a.string().required()}),onSubmit:L}),{errors:e,touched:m,handleBlur:N,handleSubmit:U,handleChange:W,setFieldValue:n,setFieldTouched:x}=f;d.useEffect(()=>{n("firstToken",h,!0)},[h,n]),d.useEffect(()=>{n("secondToken",C,!0)},[C,n]),d.useEffect(()=>{n("fromChainId",p,!0)},[p,n]),d.useEffect(()=>{n("toChainId",A,!0)},[A,n]);const z="secondAmount"in e&&"secondAmount"in m?e.secondAmount:void 0,G="firstAmount"in e&&"firstAmount"in m?e.firstAmount:void 0,H="fromChainId"in e&&"fromChainId"in m?e.fromChainId:void 0;return{formik:f,errors:e,touched:m,firstToken:h,secondToken:C,firstAmountError:G,secondAmountError:z,fromChainError:H,senderAddressError:$,receiverAddressError:w,confirmRateError:V,handleBlur:N,handleChange:W,handleSubmit:U,setFieldValue:n,resetSwapForm:b,setFieldTouched:x}};exports.BridgeFormikValuesEnum=D;exports.useBridgeFormik=ro;
@@ -36,7 +36,7 @@ const So = ({
36
36
  fromChainId: p ?? "",
37
37
  toChainId: A ?? ""
38
38
  }, q = () => {
39
- f.setTouched({}, !1), f.setErrors({}), i("firstAmount", ""), i("secondAmount", "");
39
+ f.setTouched({}, !1), f.setErrors({}), n("firstAmount", ""), n("secondAmount", "");
40
40
  }, P = async (t) => {
41
41
  var R, w;
42
42
  if (!m.current) {
@@ -100,27 +100,27 @@ const So = ({
100
100
  }),
101
101
  onSubmit: P
102
102
  }), {
103
- errors: n,
103
+ errors: i,
104
104
  touched: c,
105
105
  handleBlur: U,
106
106
  handleSubmit: W,
107
107
  handleChange: z,
108
- setFieldValue: i,
108
+ setFieldValue: n,
109
109
  setFieldTouched: G
110
110
  } = f;
111
111
  u(() => {
112
- i("firstToken", a, !0);
113
- }, [a]), u(() => {
114
- i("secondToken", I, !0);
115
- }, [I]), u(() => {
116
- i("fromChainId", p, !0);
117
- }, [p]), u(() => {
118
- i("toChainId", A, !0);
119
- }, [A]);
120
- const H = "secondAmount" in n && "secondAmount" in c ? n.secondAmount : void 0, J = "firstAmount" in n && "firstAmount" in c ? n.firstAmount : void 0, K = "fromChainId" in n && "fromChainId" in c ? n.fromChainId : void 0;
112
+ n("firstToken", a, !0);
113
+ }, [a, n]), u(() => {
114
+ n("secondToken", I, !0);
115
+ }, [I, n]), u(() => {
116
+ n("fromChainId", p, !0);
117
+ }, [p, n]), u(() => {
118
+ n("toChainId", A, !0);
119
+ }, [A, n]);
120
+ const H = "secondAmount" in i && "secondAmount" in c ? i.secondAmount : void 0, J = "firstAmount" in i && "firstAmount" in c ? i.firstAmount : void 0, K = "fromChainId" in i && "fromChainId" in c ? i.fromChainId : void 0;
121
121
  return {
122
122
  formik: f,
123
- errors: n,
123
+ errors: i,
124
124
  touched: c,
125
125
  firstToken: a,
126
126
  secondToken: I,
@@ -133,7 +133,7 @@ const So = ({
133
133
  handleBlur: U,
134
134
  handleChange: z,
135
135
  handleSubmit: W,
136
- setFieldValue: i,
136
+ setFieldValue: n,
137
137
  resetSwapForm: q,
138
138
  setFieldTouched: G
139
139
  };
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),u=(e,n)=>{const[s,o]=t.useState(e),c=()=>{const r=setTimeout(()=>o(e),n);return()=>clearTimeout(r)};return t.useEffect(c,[e]),s};exports.useDebounce=u;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),u=(e,t)=>{const[s,c]=n.useState(e),o=()=>{const r=setTimeout(()=>c(e),t);return()=>clearTimeout(r)};return n.useEffect(o,[e,t]),s};exports.useDebounce=u;
@@ -1,11 +1,11 @@
1
1
  import { useState as r, useEffect as n } from "react";
2
- const m = (t, e) => {
3
- const [o, s] = r(t);
2
+ const a = (e, t) => {
3
+ const [s, c] = r(e);
4
4
  return n(() => {
5
- const c = setTimeout(() => s(t), e);
6
- return () => clearTimeout(c);
7
- }, [t]), o;
5
+ const o = setTimeout(() => c(e), t);
6
+ return () => clearTimeout(o);
7
+ }, [e, t]), s;
8
8
  };
9
9
  export {
10
- m as useDebounce
10
+ a as useDebounce
11
11
  };
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),A=require("./useAccount.js"),m=require("./useBridgeApiChainId.js"),_=require("../../constants/index.js"),S=require("../context/useWeb3App.js"),j=require("../queries/useGetAllTokens.query.js"),k=require("../queries/useGetMvxTokensBalances.query.js"),v=require("../queries/useGetNonMvxTokensBalances.query.js"),w=({mvxAddress:u,mvxApiURL:B,refetchTrigger:d})=>{const l=m.useBridgeApiChainId(),T=A.useAccount(),{nativeAuthToken:h,bridgeOnly:f}=S.useWeb3App(),g=k.useInvalidateMvxTokensBalancesQuery(),I=v.useInvalidateEvmTokensBalances(),{data:s,isLoading:L,isError:M}=j.useGetAllTokensQuery({nativeAuthToken:h,bridgeOnly:f}),o=a.useMemo(()=>s==null?void 0:s.filter(e=>!_.MVX_CHAIN_IDS.includes(e.chainId.toString())&&e.chainId.toLowerCase()!=="fiat"),[s]),r=a.useMemo(()=>s==null?void 0:s.filter(e=>_.MVX_CHAIN_IDS.includes(e.chainId.toString())),[s]),{data:t,isLoading:q,isError:b}=v.useGetNonMvxTokensBalancesQuery({tokens:o??[],chainId:l}),{data:i,isLoading:E,isError:C}=k.useGetMvxTokensBalancesQuery({tokens:r??[],mvxAddress:u,apiURL:B}),p=a.useMemo(()=>r==null?void 0:r.map(e=>{const n=i==null?void 0:i.find(c=>c.address.toLowerCase()===e.address.toLowerCase());return n?{...n,balance:n.balance.toString()}:{...e,balance:"0"}}),[r,i]),y=a.useMemo(()=>o==null?void 0:o.map(e=>{const n=t==null?void 0:t.find(c=>c.address.toLowerCase()===e.address.toLowerCase()&&c.chainId.toLowerCase()===e.chainId.toLowerCase());return n?{...n,balance:n.balance.toString()}:{...e,balance:"0"}}),[o,t]);return a.useEffect(()=>{u&&g()},[d,u]),a.useEffect(()=>{T.address&&I()},[d,l,T.address]),{isTokensLoading:L,isTokensError:M,isLoadingEvmTokensBalances:q,isErrorEvmTokensBalances:b,evmTokensWithBalances:y,isLoadingMvxTokensBalances:E,isErrorMvxTokensBalances:C,mvxTokensWithBalances:p,tokens:s}};exports.useFetchTokens=w;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),A=require("./useAccount.js"),m=require("./useBridgeApiChainId.js"),v=require("../../constants/index.js"),S=require("../context/useWeb3App.js"),j=require("../queries/useGetAllTokens.query.js"),B=require("../queries/useGetMvxTokensBalances.query.js"),h=require("../queries/useGetNonMvxTokensBalances.query.js"),w=({mvxAddress:u,mvxApiURL:f,refetchTrigger:d})=>{const l=m.useBridgeApiChainId(),T=A.useAccount(),{nativeAuthToken:g,bridgeOnly:I}=S.useWeb3App(),_=B.useInvalidateMvxTokensBalancesQuery(),k=h.useInvalidateEvmTokensBalances(),{data:s,isLoading:L,isError:M}=j.useGetAllTokensQuery({nativeAuthToken:g,bridgeOnly:I}),o=a.useMemo(()=>s==null?void 0:s.filter(e=>!v.MVX_CHAIN_IDS.includes(e.chainId.toString())&&e.chainId.toLowerCase()!=="fiat"),[s]),r=a.useMemo(()=>s==null?void 0:s.filter(e=>v.MVX_CHAIN_IDS.includes(e.chainId.toString())),[s]),{data:t,isLoading:q,isError:b}=h.useGetNonMvxTokensBalancesQuery({tokens:o??[],chainId:l}),{data:i,isLoading:E,isError:C}=B.useGetMvxTokensBalancesQuery({tokens:r??[],mvxAddress:u,apiURL:f}),p=a.useMemo(()=>r==null?void 0:r.map(e=>{const n=i==null?void 0:i.find(c=>c.address.toLowerCase()===e.address.toLowerCase());return n?{...n,balance:n.balance.toString()}:{...e,balance:"0"}}),[r,i]),y=a.useMemo(()=>o==null?void 0:o.map(e=>{const n=t==null?void 0:t.find(c=>c.address.toLowerCase()===e.address.toLowerCase()&&c.chainId.toLowerCase()===e.chainId.toLowerCase());return n?{...n,balance:n.balance.toString()}:{...e,balance:"0"}}),[o,t]);return a.useEffect(()=>{u&&_()},[d,u,_]),a.useEffect(()=>{T.address&&k()},[d,l,T.address,k]),{isTokensLoading:L,isTokensError:M,isLoadingEvmTokensBalances:q,isErrorEvmTokensBalances:b,evmTokensWithBalances:y,isLoadingMvxTokensBalances:E,isErrorMvxTokensBalances:C,mvxTokensWithBalances:p,tokens:s}};exports.useFetchTokens=w;
@@ -1,31 +1,31 @@
1
- import { useMemo as c, useEffect as f } from "react";
1
+ import { useMemo as c, useEffect as T } from "react";
2
2
  import { useAccount as y } from "./useAccount.mjs";
3
3
  import { useBridgeApiChainId as A } from "./useBridgeApiChainId.mjs";
4
- import { MVX_CHAIN_IDS as p } from "../../constants/index.mjs";
4
+ import { MVX_CHAIN_IDS as L } from "../../constants/index.mjs";
5
5
  import { useWeb3App as Q } from "../context/useWeb3App.mjs";
6
6
  import { useGetAllTokensQuery as S } from "../queries/useGetAllTokens.query.mjs";
7
7
  import { useInvalidateMvxTokensBalancesQuery as x, useGetMvxTokensBalancesQuery as N } from "../queries/useGetMvxTokensBalances.query.mjs";
8
8
  import { useInvalidateEvmTokensBalances as W, useGetNonMvxTokensBalancesQuery as G } from "../queries/useGetNonMvxTokensBalances.query.mjs";
9
9
  const X = ({
10
10
  mvxAddress: d,
11
- mvxApiURL: T,
11
+ mvxApiURL: B,
12
12
  refetchTrigger: u
13
13
  }) => {
14
- const l = A(), m = y(), { nativeAuthToken: L, bridgeOnly: B } = Q(), v = x(), g = W(), {
14
+ const l = A(), m = y(), { nativeAuthToken: v, bridgeOnly: g } = Q(), f = x(), p = W(), {
15
15
  data: a,
16
16
  isLoading: h,
17
17
  isError: k
18
18
  } = S({
19
- nativeAuthToken: L,
20
- bridgeOnly: B
19
+ nativeAuthToken: v,
20
+ bridgeOnly: g
21
21
  }), s = c(
22
22
  () => a == null ? void 0 : a.filter(
23
- (e) => !p.includes(e.chainId.toString()) && e.chainId.toLowerCase() !== "fiat"
23
+ (e) => !L.includes(e.chainId.toString()) && e.chainId.toLowerCase() !== "fiat"
24
24
  ),
25
25
  [a]
26
26
  ), o = c(
27
27
  () => a == null ? void 0 : a.filter(
28
- (e) => p.includes(e.chainId.toString())
28
+ (e) => L.includes(e.chainId.toString())
29
29
  ),
30
30
  [a]
31
31
  ), {
@@ -42,7 +42,7 @@ const X = ({
42
42
  } = N({
43
43
  tokens: o ?? [],
44
44
  mvxAddress: d,
45
- apiURL: T
45
+ apiURL: B
46
46
  }), M = c(() => o == null ? void 0 : o.map((e) => {
47
47
  const n = i == null ? void 0 : i.find(
48
48
  (t) => t.address.toLowerCase() === e.address.toLowerCase()
@@ -66,11 +66,16 @@ const X = ({
66
66
  balance: "0"
67
67
  };
68
68
  }), [s, r]);
69
- return f(() => {
70
- d && v();
71
- }, [u, d]), f(() => {
72
- m.address && g();
73
- }, [u, l, m.address]), {
69
+ return T(() => {
70
+ d && f();
71
+ }, [u, d, f]), T(() => {
72
+ m.address && p();
73
+ }, [
74
+ u,
75
+ l,
76
+ m.address,
77
+ p
78
+ ]), {
74
79
  isTokensLoading: h,
75
80
  isTokensError: k,
76
81
  isLoadingEvmTokensBalances: E,