@multiversx/sdk-dapp-liquidity 2.3.0-alpha.0 → 2.3.0-alpha.2

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.
@@ -3,13 +3,13 @@ import { faSpinner as Ei } from "@fortawesome/free-solid-svg-icons/faSpinner";
3
3
  import { FontAwesomeIcon as Mi } from "@fortawesome/react-fontawesome";
4
4
  import { formatAmount as Pi } from "@multiversx/sdk-dapp-utils/out/helpers/formatAmount";
5
5
  import { useAppKitNetwork as Vi } from "@reown/appkit/react";
6
- import { waitForTransactionReceipt as ki } from "@wagmi/core";
7
- import Fi from "lodash/debounce";
8
- import { useRef as Fe, useState as y, useMemo as g, useCallback as f, useEffect as N } from "react";
6
+ import { waitForTransactionReceipt as Fi } from "@wagmi/core";
7
+ import Li from "lodash/debounce";
8
+ import { useRef as Le, useState as B, useMemo as g, useCallback as f, useEffect as N } from "react";
9
9
  import { toast as M } from "react-toastify";
10
- import { useBridgeTokenSelection as Li } from "./hooks/useBridgeTokenSelection.mjs";
10
+ import { useBridgeTokenSelection as ki } from "./hooks/useBridgeTokenSelection.mjs";
11
11
  import { resolveSigningChainType as Ui } from "./utils/bridgeFormHelpers.mjs";
12
- import { MVX_CHAIN_IDS as Le } from "../../../constants/index.mjs";
12
+ import { MVX_CHAIN_IDS as ke } from "../../../constants/index.mjs";
13
13
  import { getApiURL as ji } from "../../../helpers/getApiURL.mjs";
14
14
  import "../../constants/index.mjs";
15
15
  import { safeImageUrl as z } from "../../../helpers/safeImageUrl.mjs";
@@ -18,21 +18,22 @@ import "bitcoinjs-lib";
18
18
  import "viem";
19
19
  import { ChainType as P } from "../../../types/chainType.mjs";
20
20
  import { useWeb3App as Hi } from "../../context/useWeb3App.mjs";
21
- import { sameBridgeApiChainId as me, toBridgeApiChainId as Oi } from "../../helpers/resolveBridgeApiChainId.mjs";
21
+ import { sameBridgeApiChainId as de, toBridgeApiChainId as Oi } from "../../helpers/resolveBridgeApiChainId.mjs";
22
22
  import { useAccount as Wi } from "../../hooks/useAccount.mjs";
23
23
  import { useBridgeApiChainId as Xi } from "../../hooks/useBridgeApiChainId.mjs";
24
24
  import { useBridgeFormik as zi, BridgeFormikValuesEnum as G } from "../../hooks/useBridgeFormik.mjs";
25
- import { useFetchBridgeData as Gi } from "../../hooks/useFetchBridgeData.mjs";
26
- import { useGetChainId as Qi } from "../../hooks/useGetChainId.mjs";
27
- import { useNamespaceAddress as _i } from "../../hooks/useNamespaceAddress.mjs";
28
- import { useSendTransactions as $i } from "../../hooks/useSendTransactions.mjs";
29
- import { useSignTransaction as Ki } from "../../hooks/useSignTransaction.mjs";
30
- import { useInvalidateHistoryQuery as Yi } from "../../queries/useGetHistory.query.mjs";
31
- import { useGetRateMutation as Ji } from "../../queries/useGetRate.mutation.mjs";
25
+ import { useDisconnectOnChainTypeChange as Gi } from "../../hooks/useDisconnectOnChainTypeChange.mjs";
26
+ import { useFetchBridgeData as Qi } from "../../hooks/useFetchBridgeData.mjs";
27
+ import { useGetChainId as _i } from "../../hooks/useGetChainId.mjs";
28
+ import { useNamespaceAddress as $i } from "../../hooks/useNamespaceAddress.mjs";
29
+ import { useSendTransactions as Ki } from "../../hooks/useSendTransactions.mjs";
30
+ import { useSignTransaction as Yi } from "../../hooks/useSignTransaction.mjs";
31
+ import { useInvalidateHistoryQuery as Ji } from "../../queries/useGetHistory.query.mjs";
32
+ import { useGetRateMutation as Zi } from "../../queries/useGetRate.mutation.mjs";
32
33
  import { mxClsx as Ue } from "../../utils/mxClsx.mjs";
33
34
  import { AmountCard as je } from "../AmountCard/AmountCard.mjs";
34
35
  import { AmountInput as He } from "../AmountInput/AmountInput.mjs";
35
- import { MxButton as Zi } from "../base/MxButton/MxButton.mjs";
36
+ import { MxButton as Ti } from "../base/MxButton/MxButton.mjs";
36
37
  import "../base/MxCard/MxCard.mjs";
37
38
  import "../base/MxLink/MxLink.mjs";
38
39
  import "../base/MxSearch/MxSearch.mjs";
@@ -41,17 +42,17 @@ import "@headlessui/react";
41
42
  import "react-dom";
42
43
  import "react-popper";
43
44
  import "../base/MxTooltip/components/TooltipContainer/TooltipContainer.mjs";
44
- import { BridgeHistory as Ti } from "../BridgeHistory/BridgeHistory.mjs";
45
- import { BridgeConnectButton as et } from "../Connect/BridgeConnectButton.mjs";
45
+ import { BridgeHistory as et } from "../BridgeHistory/BridgeHistory.mjs";
46
+ import { BridgeConnectButton as it } from "../Connect/BridgeConnectButton.mjs";
46
47
  import "wagmi";
47
- import { MvxConnectButton as it } from "../Connect/MvxConnectButton.mjs";
48
- import { BridgeAccountDisplay as tt } from "../Connect/BridgeAccountDisplay.mjs";
49
- import { MvxAccountDisplay as nt } from "../Connect/MvxAccountDisplay.mjs";
48
+ import { MvxConnectButton as tt } from "../Connect/MvxConnectButton.mjs";
49
+ import { BridgeAccountDisplay as nt } from "../Connect/BridgeAccountDisplay.mjs";
50
+ import { MvxAccountDisplay as rt } from "../Connect/MvxAccountDisplay.mjs";
50
51
  import "@reown/appkit-controllers";
51
- import { ToggleDirection as rt } from "../ToggleDirection/ToggleDirection.mjs";
52
+ import { ToggleDirection as ot } from "../ToggleDirection/ToggleDirection.mjs";
52
53
  import { TokenSelector as Oe } from "../TokenSelector/TokenSelector.mjs";
53
54
  let Q;
54
- const rn = ({
55
+ const an = ({
55
56
  mvxChainId: _,
56
57
  mvxAddress: c,
57
58
  username: We,
@@ -63,78 +64,80 @@ const rn = ({
63
64
  refetchTrigger: Qe,
64
65
  showHistory: _e,
65
66
  forcedDestinationTokenSymbol: $e,
66
- onSuccessfullySentTransaction: k,
67
- onFailedSentTransaction: v,
68
- onHistoryClose: F,
69
- onMvxConnect: ue,
67
+ onSuccessfullySentTransaction: F,
68
+ onFailedSentTransaction: I,
69
+ onHistoryClose: L,
70
+ onMvxConnect: me,
70
71
  onMvxDisconnect: Ke,
71
72
  onNavigate: Ye,
72
73
  onChangeDirection: Je
73
74
  }) => {
74
75
  var De, Se;
75
- const Ze = Fe(null), pe = Fe(void 0), [$, Te] = y(!1), [L, A] = y(!1), [ei, ii] = y(1), [K, Y] = y(0), I = Wi(), { switchNetwork: he } = Vi(), ge = Yi(), {
76
- config: fe,
77
- options: qe,
76
+ const Ze = Le(null), ue = Le(void 0), [$, Te] = B(!1), [k, A] = B(!1), [ei, ii] = B(1), [K, Y] = B(0), ti = Wi(), { switchNetwork: pe } = Vi(), he = Ji(), {
77
+ config: ge,
78
+ options: fe,
78
79
  supportedChains: w,
79
80
  nativeAuthToken: J,
80
- bridgeOnly: ti
81
- } = Hi(), Z = Qi(), be = Xi(), {
82
- evmTokensWithBalances: ni,
83
- mvxTokensWithBalances: ri,
81
+ bridgeOnly: ni
82
+ } = Hi(), Z = _i(), qe = Xi(), {
83
+ evmTokensWithBalances: ri,
84
+ mvxTokensWithBalances: oi,
84
85
  isTokensLoading: ai,
85
- isLoadingEvmTokensBalances: oi,
86
- isLoadingMvxTokensBalances: si,
86
+ isLoadingEvmTokensBalances: si,
87
+ isLoadingMvxTokensBalances: li,
87
88
  chains: D = [],
88
- isChainsLoading: li
89
- } = Gi({
89
+ isChainsLoading: ci
90
+ } = Qi({
90
91
  refetchTrigger: Qe,
91
92
  mvxAddress: c,
92
- mvxApiURL: qe.mvxApiURL
93
- }), T = ai || oi || si || li, ci = g(() => w.find((i) => me(i.id, Z)), [Z, w]), o = g(() => D.find(
93
+ mvxApiURL: fe.mvxApiURL
94
+ }), T = ai || si || li || ci, di = g(() => w.find((i) => de(i.id, Z)), [Z, w]), s = g(() => D.find(
94
95
  (i) => i.chainId.toString() === _.toString()
95
- ), [Z, D]), { evm: ve, solana: Ie, bitcoin: xe, sui: Be } = Ki(), ye = $i(), {
96
- mutate: di,
96
+ ), [Z, D]), { evm: be, solana: ve, bitcoin: Ie, sui: xe } = Yi(), ye = Ki(), {
97
+ mutate: mi,
97
98
  data: m,
98
99
  isPending: S,
99
100
  error: x
100
- } = Ji(), R = ((De = x == null ? void 0 : x.response) == null ? void 0 : De.status) === 400 ? (Se = x == null ? void 0 : x.response) == null ? void 0 : Se.data.message : void 0, mi = f(
101
+ } = Zi(), R = ((De = x == null ? void 0 : x.response) == null ? void 0 : De.status) === 400 ? (Se = x == null ? void 0 : x.response) == null ? void 0 : Se.data.message : void 0, ui = f(
101
102
  (i) => {
102
- const b = w.find(
103
- (d) => me(d.id, i.id)
103
+ const v = w.find(
104
+ (d) => de(d.id, i.id)
104
105
  );
105
- b && he(b);
106
+ v && pe(v);
106
107
  },
107
- [w, he]
108
+ [w, pe]
108
109
  ), {
109
110
  firstToken: e,
110
111
  secondToken: a,
111
112
  fromOptions: U,
112
- toOptions: ui,
113
+ toOptions: pi,
113
114
  selectedChainOption: r,
114
- onChangeFirstSelect: Ne,
115
- onChangeSecondSelect: pi,
116
- handleChangeDirection: hi
117
- } = Li({
115
+ onChangeFirstSelect: Be,
116
+ onChangeSecondSelect: hi,
117
+ handleChangeDirection: gi
118
+ } = ki({
118
119
  chains: D,
119
- activeChain: ci,
120
+ activeChain: di,
120
121
  sdkChains: w,
121
- switchNetwork: mi,
122
- fromTokens: ni,
123
- toTokens: ri,
122
+ switchNetwork: ui,
123
+ fromTokens: ri,
124
+ toTokens: oi,
124
125
  firstTokenIdentifier: ze,
125
126
  secondTokenIdentifier: Ge,
126
127
  forcedDestinationTokenSymbol: $e,
127
128
  isTokensLoading: T,
128
129
  callbackRoute: Xe,
129
130
  onNavigate: Ye
130
- }), gi = g(() => e ? Le.includes(e.chainId.toString()) : !1, [e == null ? void 0 : e.chainId]), fi = g(() => a ? Le.includes(a.chainId.toString()) : !1, [a == null ? void 0 : a.chainId]), [u, qi] = y(V ?? ""), [j, H] = y(C ?? ""), s = g(() => e ? D.find(
131
- (i) => me(i.chainId, e.chainId)
131
+ }), fi = g(() => e ? ke.includes(e.chainId.toString()) : !1, [e == null ? void 0 : e.chainId]), qi = g(() => a ? ke.includes(a.chainId.toString()) : !1, [a == null ? void 0 : a.chainId]), [u, bi] = B(V ?? ""), [j, H] = B(C ?? ""), o = g(() => e ? D.find(
132
+ (i) => de(i.chainId, e.chainId)
132
133
  ) ?? r : r, [e == null ? void 0 : e.chainId, D, r]), O = g(
133
- () => Oi(e == null ? void 0 : e.chainId) ?? be,
134
- [e == null ? void 0 : e.chainId, be]
135
- ), bi = _i(s == null ? void 0 : s.chainType), ee = I.address, Ce = I.isConnected && !!ee, ie = u !== "" && j !== "", te = f(
136
- Fi(async (i) => {
137
- !i || !Number(i) || !I.address || !(e != null && e.address) || !(a != null && a.address) || !r || !O || di({
134
+ () => Oi(e == null ? void 0 : e.chainId) ?? qe,
135
+ [e == null ? void 0 : e.chainId, qe]
136
+ );
137
+ Gi(o == null ? void 0 : o.chainType);
138
+ const q = $i(o == null ? void 0 : o.chainType), Ne = q, Ce = ti.isConnected && !!q, ee = u !== "" && j !== "", ie = f(
139
+ Li(async (i) => {
140
+ !i || !Number(i) || !q || !(e != null && e.address) || !(a != null && a.address) || !r || !O || mi({
138
141
  nativeAuthToken: J ?? "",
139
142
  body: {
140
143
  tokenIn: e.address,
@@ -146,53 +149,53 @@ const rn = ({
146
149
  });
147
150
  }, 500),
148
151
  [
149
- I.address,
152
+ q,
150
153
  O,
151
154
  e == null ? void 0 : e.address,
152
155
  a == null ? void 0 : a.address,
153
156
  r
154
157
  ]
155
158
  ), p = f((i) => {
156
- qi(() => i);
157
- }, []), B = f((i) => {
159
+ bi(() => i);
160
+ }, []), y = f((i) => {
158
161
  H(() => i);
159
162
  }, []), vi = f(() => {
160
- F == null || F();
161
- }, [F]), Ii = f(() => {
163
+ L == null || L();
164
+ }, [L]), Ii = f(() => {
162
165
  const i = Pi({
163
166
  decimals: e == null ? void 0 : e.decimals,
164
167
  input: (e == null ? void 0 : e.balance) ?? "0",
165
168
  addCommas: !1,
166
169
  digits: 4
167
170
  });
168
- q.setFieldValue("firstAmount", i), p(i);
171
+ b.setFieldValue("firstAmount", i), p(i);
169
172
  }, [e == null ? void 0 : e.balance, e == null ? void 0 : e.decimals, p]), Ae = f(
170
173
  async (i) => {
171
- p(""), B(""), ge(), ge(), k == null || k(i);
174
+ p(""), y(""), he(), he(), F == null || F(i);
172
175
  },
173
176
  [
174
177
  p,
175
- B,
176
- k
178
+ y,
179
+ F
177
180
  ]
178
181
  ), xi = () => {
179
- hi(), Je();
182
+ gi(), Je();
180
183
  };
181
184
  N(() => {
182
- const i = pe.current;
183
- if (pe.current = r == null ? void 0 : r.chainId, !!i && (r == null ? void 0 : r.chainId) !== (e == null ? void 0 : e.chainId)) {
184
- const b = U == null ? void 0 : U.find(
185
+ const i = ue.current;
186
+ if (ue.current = r == null ? void 0 : r.chainId, !!i && (r == null ? void 0 : r.chainId) !== (e == null ? void 0 : e.chainId)) {
187
+ const v = U == null ? void 0 : U.find(
185
188
  (d) => d.chainId.toString() === (r == null ? void 0 : r.chainId)
186
189
  );
187
- if (!b)
190
+ if (!v)
188
191
  return;
189
- Ne(b);
192
+ Be(v);
190
193
  }
191
194
  }, [r == null ? void 0 : r.chainId]);
192
- const Bi = f(
195
+ const yi = f(
193
196
  async ({
194
197
  transactions: i,
195
- provider: b
198
+ provider: v
196
199
  }) => {
197
200
  var Re, Ee, Me;
198
201
  const d = [];
@@ -202,21 +205,21 @@ const rn = ({
202
205
  for (const t of i) {
203
206
  ++E;
204
207
  try {
205
- switch (Ui(t, s)) {
208
+ switch (Ui(t, o)) {
206
209
  case P.evm: {
207
- const h = await ve.signTransaction({
210
+ const h = await be.signTransaction({
208
211
  ...t,
209
212
  value: BigInt(t.value),
210
213
  gas: BigInt(t.gasLimit),
211
- account: ee
214
+ account: Ne
212
215
  });
213
216
  if (!h || (d.push({
214
217
  ...t,
215
218
  txHash: h
216
219
  }), E === i.length - 1 || !h))
217
220
  break;
218
- const X = await ki(
219
- fe,
221
+ const X = await Fi(
222
+ ge,
220
223
  {
221
224
  confirmations: 1,
222
225
  hash: h
@@ -231,16 +234,16 @@ const rn = ({
231
234
  case P.sol:
232
235
  if (!t.instructions || !t.feePayer)
233
236
  break;
234
- const de = await Ie.signTransaction({
237
+ const ce = await ve.signTransaction({
235
238
  feePayer: t.feePayer,
236
239
  instructions: t.instructions,
237
240
  recentBlockhash: t.recentBlockhash
238
241
  });
239
- if (!de)
242
+ if (!ce)
240
243
  break;
241
244
  d.push({
242
245
  ...t,
243
- txHash: de
246
+ txHash: ce
244
247
  });
245
248
  break;
246
249
  case P.btc:
@@ -248,7 +251,7 @@ const rn = ({
248
251
  console.error("No bitcoin params");
249
252
  break;
250
253
  }
251
- const Si = await xe.signTransaction(
254
+ const Si = await Ie.signTransaction(
252
255
  t.bitcoinParams
253
256
  );
254
257
  d.push({
@@ -262,17 +265,17 @@ const rn = ({
262
265
  console.error("No Sui transaction bytes or sender address");
263
266
  break;
264
267
  }
265
- const ke = await Be.signTransaction({
268
+ const Fe = await xe.signTransaction({
266
269
  transaction: h,
267
270
  address: X
268
271
  });
269
- if (!ke)
272
+ if (!Fe)
270
273
  break;
271
274
  d.push({
272
275
  ...t,
273
276
  suiParams: {
274
277
  ...t.suiParams,
275
- signature: ke
278
+ signature: Fe
276
279
  }
277
280
  });
278
281
  break;
@@ -285,51 +288,51 @@ const rn = ({
285
288
  () => i.length - 1 - E
286
289
  );
287
290
  } catch {
288
- M.dismiss(), M.error("Transaction aborted"), v == null || v("Transaction aborted"), A(!1);
291
+ M.dismiss(), M.error("Transaction aborted"), I == null || I("Transaction aborted"), A(!1);
289
292
  return;
290
293
  }
291
294
  }
292
- const { data: ce } = await ye({
295
+ const { data: le } = await ye({
293
296
  transactions: d,
294
- provider: b,
297
+ provider: v,
295
298
  url: ji() ?? "",
296
299
  token: J ?? ""
297
- }), Pe = ((Me = ce.transactions) == null ? void 0 : Me.map((t) => t.txHash).filter((t) => !!t)) ?? [], Ve = d.map((t) => t.txHash).filter((t) => !!t), Di = Pe.length > 0 ? Pe : Ve.length > 0 ? Ve : ce.batchId ? [ce.batchId] : [];
300
+ }), Pe = ((Me = le.transactions) == null ? void 0 : Me.map((t) => t.txHash).filter((t) => !!t)) ?? [], Ve = d.map((t) => t.txHash).filter((t) => !!t), Di = Pe.length > 0 ? Pe : Ve.length > 0 ? Ve : le.batchId ? [le.batchId] : [];
298
301
  Ae(Di), A(!1);
299
302
  } catch (E) {
300
- console.error(E), M.dismiss(), M.error("Transaction cancelled"), v == null || v("Transaction cancelled"), A(!1), Y(0), Ni(), p(""), B("");
303
+ console.error(E), M.dismiss(), M.error("Transaction cancelled"), I == null || I("Transaction cancelled"), A(!1), Y(0), Ni(), p(""), y("");
301
304
  }
302
305
  },
303
306
  [
304
- s == null ? void 0 : s.chainType,
305
- ee,
306
- fe,
307
+ o == null ? void 0 : o.chainType,
308
+ Ne,
309
+ ge,
307
310
  p,
308
- B,
311
+ y,
309
312
  J,
310
313
  Ae,
311
314
  ye,
312
- xe.signTransaction,
313
- ve.signTransaction,
314
315
  Ie.signTransaction,
315
- Be.signTransaction
316
+ be.signTransaction,
317
+ ve.signTransaction,
318
+ xe.signTransaction
316
319
  ]
317
320
  ), {
318
- formik: q,
319
- firstAmountError: ne,
320
- secondAmountError: re,
321
- fromChainError: ae,
321
+ formik: b,
322
+ firstAmountError: te,
323
+ secondAmountError: ne,
324
+ fromChainError: re,
322
325
  senderAddressError: oe,
323
- receiverAddressError: se,
324
- confirmRateError: le,
326
+ receiverAddressError: ae,
327
+ confirmRateError: se,
325
328
  handleBlur: W,
326
329
  handleChange: we,
327
- handleSubmit: yi,
330
+ handleSubmit: Bi,
328
331
  resetSwapForm: Ni
329
332
  } = zi({
330
333
  isMvxConnected: !!c,
331
334
  rate: m,
332
- sender: bi ?? "",
335
+ sender: q ?? "",
333
336
  receiver: c ?? "",
334
337
  firstToken: e,
335
338
  firstAmount: u,
@@ -338,26 +341,26 @@ const rn = ({
338
341
  secondToken: a,
339
342
  secondAmount: j,
340
343
  setForceRefetchRate: ii,
341
- senderChainType: s == null ? void 0 : s.chainType,
344
+ senderChainType: o == null ? void 0 : o.chainType,
342
345
  receiverChainType: P.mvx,
343
- onSubmit: Bi
344
- }), Ci = !!(ne || re || ae || R || oe || se || le), Ai = g(() => u !== "" ? R ?? ne : void 0, [ne, u, R]), wi = g(() => j !== "" ? ae ?? re : void 0, [ae, re, j]);
345
- return N(() => (u || H(""), te(u), Q && clearInterval(Q), Q = setInterval(() => {
346
- te(u);
347
- }, 50 * 1e3), () => clearInterval(Q)), [u, ei, te]), N(() => {
348
- m != null && m.amountOut && (q.setFieldValue(G.secondAmount, m.amountOut), H(m.amountOut));
346
+ onSubmit: yi
347
+ }), Ci = !!(te || ne || re || R || oe || ae || se), Ai = g(() => u !== "" ? R ?? te : void 0, [te, u, R]), wi = g(() => j !== "" ? re ?? ne : void 0, [re, ne, j]);
348
+ return N(() => (u || H(""), ie(u), Q && clearInterval(Q), Q = setInterval(() => {
349
+ ie(u);
350
+ }, 50 * 1e3), () => clearInterval(Q)), [u, ei, ie]), N(() => {
351
+ m != null && m.amountOut && (b.setFieldValue(G.secondAmount, m.amountOut), H(m.amountOut));
349
352
  }, [m == null ? void 0 : m.amountOut]), N(() => {
350
- R && (q.setFieldValue(G.secondAmount, "0"), H("0"));
353
+ R && (b.setFieldValue(G.secondAmount, "0"), H("0"));
351
354
  }, [R]), N(() => {
352
- V && (q.setFieldValue(
355
+ V && (b.setFieldValue(
353
356
  G.firstAmount,
354
357
  V
355
358
  ), p(V));
356
359
  }, []), N(() => {
357
- C && (q.setFieldValue(
360
+ C && (b.setFieldValue(
358
361
  G.secondAmount,
359
362
  C
360
- ), B(C));
363
+ ), y(C));
361
364
  }, [C]), /* @__PURE__ */ n(Ri, { children: /* @__PURE__ */ l(
362
365
  "form",
363
366
  {
@@ -365,9 +368,9 @@ const rn = ({
365
368
  noValidate: !0,
366
369
  className: "liq-flex liq-flex-col liq-gap-1 liq-relative",
367
370
  autoComplete: "off",
368
- onSubmit: yi,
371
+ onSubmit: Bi,
369
372
  children: [
370
- _e && /* @__PURE__ */ n(Ti, { mvxAddress: c, onClose: vi }),
373
+ _e && /* @__PURE__ */ n(et, { mvxAddress: c, onClose: vi }),
371
374
  /* @__PURE__ */ l(
372
375
  je,
373
376
  {
@@ -382,10 +385,10 @@ const rn = ({
382
385
  /* @__PURE__ */ l("div", { className: "liq-flex liq-items-center liq-gap-1", children: [
383
386
  /* @__PURE__ */ n("span", { children: "From" }),
384
387
  /* @__PURE__ */ n(
385
- tt,
388
+ nt,
386
389
  {
387
390
  disabled: S,
388
- activeChain: s
391
+ activeChain: o
389
392
  }
390
393
  )
391
394
  ] }),
@@ -395,7 +398,7 @@ const rn = ({
395
398
  He,
396
399
  {
397
400
  inputName: "firstAmount",
398
- inputValue: q.values.firstAmount,
401
+ inputValue: b.values.firstAmount,
399
402
  amountError: Ai,
400
403
  disabled: !1,
401
404
  onInputDebounceChange: p,
@@ -410,10 +413,10 @@ const rn = ({
410
413
  disabled: S,
411
414
  options: U,
412
415
  areOptionsLoading: T,
413
- isMvxSelector: gi,
416
+ isMvxSelector: fi,
414
417
  isDestination: !1,
415
418
  color: "neutral-850",
416
- onChange: Ne,
419
+ onChange: Be,
417
420
  onBlur: W,
418
421
  onMaxBtnClick: Ii,
419
422
  selectedOption: e,
@@ -424,7 +427,7 @@ const rn = ({
424
427
  ]
425
428
  }
426
429
  ),
427
- /* @__PURE__ */ n("div", { className: "liq-absolute liq-left-[6%] liq-top-[40%] -liq-mt-1 liq-z-10", children: ti && /* @__PURE__ */ n(rt, { onChangeDirection: xi }) }),
430
+ /* @__PURE__ */ n("div", { className: "liq-absolute liq-left-[6%] liq-top-[40%] -liq-mt-1 liq-z-10", children: ni && /* @__PURE__ */ n(ot, { onChangeDirection: xi }) }),
428
431
  /* @__PURE__ */ l(
429
432
  je,
430
433
  {
@@ -438,29 +441,29 @@ const rn = ({
438
441
  /* @__PURE__ */ l("div", { className: "liq-flex liq-items-center liq-gap-1", children: [
439
442
  /* @__PURE__ */ n("span", { children: "To" }),
440
443
  /* @__PURE__ */ n(
441
- nt,
444
+ rt,
442
445
  {
443
446
  accountAddress: c,
444
- chainIcon: z(o == null ? void 0 : o.pngUrl),
447
+ chainIcon: z(s == null ? void 0 : s.pngUrl),
445
448
  username: We,
446
- accountExplorerUrl: `${qe.mvxExplorerAddress}/accounts/${c}`,
449
+ accountExplorerUrl: `${fe.mvxExplorerAddress}/accounts/${c}`,
447
450
  showTag: !0,
448
451
  onDisconnect: Ke,
449
- onConnect: ue
452
+ onConnect: me
450
453
  }
451
454
  )
452
455
  ] }),
456
+ ae && /* @__PURE__ */ n("div", { className: "liq-text-red-400 liq-text-xs liq-mt-1", children: ae }),
453
457
  se && /* @__PURE__ */ n("div", { className: "liq-text-red-400 liq-text-xs liq-mt-1", children: se }),
454
- le && /* @__PURE__ */ n("div", { className: "liq-text-red-400 liq-text-xs liq-mt-1", children: le }),
455
458
  /* @__PURE__ */ l("div", { className: "liq-flex liq-justify-between liq-gap-1", children: [
456
459
  /* @__PURE__ */ n(
457
460
  He,
458
461
  {
459
462
  inputName: "secondAmount",
460
- inputValue: q.values.secondAmount,
463
+ inputValue: b.values.secondAmount,
461
464
  amountError: wi,
462
465
  disabled: !1,
463
- onInputDebounceChange: B,
466
+ onInputDebounceChange: y,
464
467
  onInputChange: we,
465
468
  onBlur: W
466
469
  }
@@ -471,11 +474,11 @@ const rn = ({
471
474
  name: "secondToken",
472
475
  disabled: S,
473
476
  omitDisableClass: !0,
474
- options: ui,
477
+ options: pi,
475
478
  areOptionsLoading: T,
476
- isMvxSelector: fi,
479
+ isMvxSelector: qi,
477
480
  color: "neutral-850",
478
- onChange: pi,
481
+ onChange: hi,
479
482
  onBlur: W,
480
483
  selectedOption: a
481
484
  }
@@ -486,43 +489,43 @@ const rn = ({
486
489
  ),
487
490
  /* @__PURE__ */ l("div", { className: "liq-flex liq-items-center liq-justify-center", children: [
488
491
  !c && /* @__PURE__ */ n(
489
- it,
492
+ tt,
490
493
  {
491
494
  mvxAccountAddress: c,
492
- icon: z(o == null ? void 0 : o.pngUrl),
493
- onClick: ue
495
+ icon: z(s == null ? void 0 : s.pngUrl),
496
+ onClick: me
494
497
  }
495
498
  ),
496
499
  c && !Ce && /* @__PURE__ */ n(
497
- et,
500
+ it,
498
501
  {
499
502
  className: "liq-w-full liq-rounded-xl liq-bg-neutral-850/50 liq-px-8 liq-py-3 liq-font-semibold liq-text-primary-200 liq-transition-colors liq-duration-200 hover:enabled:liq-bg-primary-700/80 disabled:liq-opacity-50",
500
503
  disabled: S,
501
- activeChain: s
504
+ activeChain: o
502
505
  }
503
506
  ),
504
507
  c && Ce && /* @__PURE__ */ l(
505
- Zi,
508
+ Ti,
506
509
  {
507
510
  type: "submit",
508
511
  variant: "neutral-850",
509
512
  className: "liq-w-full disabled:liq-bg-neutral-850/50 liq-py-3 hover:enabled:liq-bg-primary !liq-text-primary-200",
510
- disabled: !ie || S || !c || !I.address || Ci || L,
513
+ disabled: !ee || S || !c || !q || Ci || k,
511
514
  children: [
512
- ie && !L && /* @__PURE__ */ l("div", { className: "liq-flex liq-justify-center liq-items-center liq-gap-2", children: [
515
+ ee && !k && /* @__PURE__ */ l("div", { className: "liq-flex liq-justify-center liq-items-center liq-gap-2", children: [
513
516
  /* @__PURE__ */ n("div", { children: "Deposit on " }),
514
517
  /* @__PURE__ */ n(
515
518
  "img",
516
519
  {
517
- src: z(o == null ? void 0 : o.pngUrl),
520
+ src: z(s == null ? void 0 : s.pngUrl),
518
521
  alt: "",
519
522
  className: "liq-h-[1.5rem] liq-w-[1.5rem] liq-rounded-lg"
520
523
  }
521
524
  ),
522
525
  /* @__PURE__ */ n("div", { children: "MultiversX" })
523
526
  ] }),
524
- !ie && !L && /* @__PURE__ */ n("span", { className: "liq-text-neutral-100", children: "Enter amount" }),
525
- L && /* @__PURE__ */ l("div", { className: "liq-flex liq-justify-center liq-items-center liq-gap-2", children: [
527
+ !ee && !k && /* @__PURE__ */ n("span", { className: "liq-text-neutral-100", children: "Enter amount" }),
528
+ k && /* @__PURE__ */ l("div", { className: "liq-flex liq-justify-center liq-items-center liq-gap-2", children: [
526
529
  /* @__PURE__ */ n(
527
530
  Mi,
528
531
  {
@@ -535,7 +538,7 @@ const rn = ({
535
538
  /* @__PURE__ */ n(
536
539
  "img",
537
540
  {
538
- src: z(o == null ? void 0 : o.pngUrl),
541
+ src: z(s == null ? void 0 : s.pngUrl),
539
542
  alt: "",
540
543
  className: "liq-h-[1.5rem] liq-w-[1.5rem] liq-rounded-lg"
541
544
  }
@@ -546,7 +549,7 @@ const rn = ({
546
549
  }
547
550
  )
548
551
  ] }),
549
- I.address && K > 0 && /* @__PURE__ */ n("div", { className: "liq-flex liq-items-center liq-justify-center liq-text-neutral-300 liq-text-sm", children: /* @__PURE__ */ l("div", { children: [
552
+ q && K > 0 && /* @__PURE__ */ n("div", { className: "liq-flex liq-items-center liq-justify-center liq-text-neutral-300 liq-text-sm", children: /* @__PURE__ */ l("div", { children: [
550
553
  "You will be asked to sign ",
551
554
  K,
552
555
  " ",
@@ -559,5 +562,5 @@ const rn = ({
559
562
  ) });
560
563
  };
561
564
  export {
562
- rn as Deposit
565
+ an as Deposit
563
566
  };