@multiversx/sdk-dapp-liquidity 2.1.0 → 2.2.0

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 (28) hide show
  1. package/helpers/index.d.ts +1 -0
  2. package/helpers/index.js +1 -1
  3. package/helpers/index.mjs +18 -16
  4. package/helpers/isValidAddressForChainType.d.ts +3 -0
  5. package/helpers/isValidAddressForChainType.js +2 -0
  6. package/helpers/isValidAddressForChainType.mjs +37 -0
  7. package/helpers/tests/assertRateConfirmationMatchesIntent.spec.js +1 -1
  8. package/helpers/tests/assertRateConfirmationMatchesIntent.spec.mjs +3 -3
  9. package/helpers/tests/isValidAddressForChainType.spec.d.ts +1 -0
  10. package/helpers/tests/isValidAddressForChainType.spec.js +2 -0
  11. package/helpers/tests/isValidAddressForChainType.spec.mjs +102 -0
  12. package/index.js +1 -1
  13. package/index.mjs +162 -160
  14. package/package.json +3 -2
  15. package/reactjs/components/BridgeForm/Deposit.js +1 -1
  16. package/reactjs/components/BridgeForm/Deposit.mjs +269 -260
  17. package/reactjs/components/BridgeForm/Transfer.js +1 -1
  18. package/reactjs/components/BridgeForm/Transfer.mjs +210 -201
  19. package/reactjs/components/BridgeHistory/BridgeHistory.js +1 -1
  20. package/reactjs/components/BridgeHistory/BridgeHistory.mjs +5 -3
  21. package/reactjs/components/Connect/BridgeConnectButton.js +1 -1
  22. package/reactjs/components/Connect/BridgeConnectButton.mjs +17 -14
  23. package/reactjs/hooks/useBridgeFormik.d.ts +6 -1
  24. package/reactjs/hooks/useBridgeFormik.js +1 -1
  25. package/reactjs/hooks/useBridgeFormik.mjs +94 -85
  26. package/reactjs/queries/useGetNonMvxTokensBalances.query.js +1 -1
  27. package/reactjs/queries/useGetNonMvxTokensBalances.query.mjs +11 -9
  28. package/style.css +1 -1
@@ -1,38 +1,41 @@
1
- import { jsx as r, Fragment as li, jsxs as a } from "react/jsx-runtime";
2
- import { formatAmount as ci } from "@multiversx/sdk-dapp-utils/out/helpers/formatAmount";
3
- import { useAppKitNetwork as di } from "@reown/appkit/react";
4
- import mi from "lodash/debounce";
5
- import { useRef as ui, useState as C, useMemo as m, useCallback as u, useEffect as I } from "react";
6
- import { toast as ue } from "react-toastify";
7
- import { useBridgeTokenSelection as pi } from "./hooks/useBridgeTokenSelection.mjs";
8
- import { MVX_CHAIN_IDS as pe } from "../../../constants/index.mjs";
9
- import { getApiURL as hi } from "../../../helpers/getApiURL.mjs";
1
+ import { jsx as r, Fragment as di, jsxs as s } from "react/jsx-runtime";
2
+ import { formatAmount as mi } from "@multiversx/sdk-dapp-utils/out/helpers/formatAmount";
3
+ import { useAppKitNetwork as pi } from "@reown/appkit/react";
4
+ import ui from "lodash/debounce";
5
+ import { useRef as hi, useState as C, useMemo as m, useCallback as p, useEffect as I } from "react";
6
+ import { toast as he } from "react-toastify";
7
+ import { useBridgeTokenSelection as fi } from "./hooks/useBridgeTokenSelection.mjs";
8
+ import { MVX_CHAIN_IDS as fe } from "../../../constants/index.mjs";
9
+ import { getApiURL as gi } from "../../../helpers/getApiURL.mjs";
10
10
  import "../../constants/index.mjs";
11
- import { safeImageUrl as J } from "../../../helpers/safeImageUrl.mjs";
12
- import { ProviderType as fi } from "../../../types/providerType.mjs";
13
- import { useWeb3App as he } from "../../context/useWeb3App.mjs";
14
- import { sameBridgeApiChainId as Z, toBridgeApiChainId as gi } from "../../helpers/resolveBridgeApiChainId.mjs";
11
+ import { safeImageUrl as S } from "../../../helpers/safeImageUrl.mjs";
12
+ import "@solana/web3.js";
13
+ import "bitcoinjs-lib";
14
+ import "viem";
15
+ import { ChainType as qi } from "../../../types/chainType.mjs";
16
+ import { ProviderType as bi } from "../../../types/providerType.mjs";
17
+ import { useWeb3App as ge } from "../../context/useWeb3App.mjs";
18
+ import { sameBridgeApiChainId as T, toBridgeApiChainId as vi } from "../../helpers/resolveBridgeApiChainId.mjs";
15
19
  import "yup";
16
20
  import "@multiversx/sdk-dapp-utils/out/helpers/parseAmount";
17
21
  import "bignumber.js";
18
- import { useAccount as qi } from "../../hooks/useAccount.mjs";
22
+ import { useAccount as Ci } from "../../hooks/useAccount.mjs";
19
23
  import "axios";
20
- import { useBridgeFormik as bi, BridgeFormikValuesEnum as F } from "../../hooks/useBridgeFormik.mjs";
21
- import { useFetchBridgeData as vi } from "../../hooks/useFetchBridgeData.mjs";
22
- import { useBridgeApiChainId as Ci } from "../../hooks/useBridgeApiChainId.mjs";
24
+ import { useBridgeFormik as Ii, BridgeFormikValuesEnum as F } from "../../hooks/useBridgeFormik.mjs";
25
+ import { useFetchBridgeData as xi } from "../../hooks/useFetchBridgeData.mjs";
26
+ import { useBridgeApiChainId as Ai } from "../../hooks/useBridgeApiChainId.mjs";
23
27
  import "@tanstack/react-query";
24
- import { useGetChainId as Ii } from "../../hooks/useGetChainId.mjs";
25
- import { useSendTransactions as Bi } from "../../hooks/useSendTransactions.mjs";
28
+ import { useGetChainId as Bi } from "../../hooks/useGetChainId.mjs";
29
+ import { useSendTransactions as Ni } from "../../hooks/useSendTransactions.mjs";
26
30
  import "@reown/appkit-adapter-solana/react";
27
- import "@solana/web3.js";
28
31
  import "wagmi";
29
32
  import "@reown/appkit-controllers";
30
- import { useInvalidateHistoryQuery as Ai } from "../../queries/useGetHistory.query.mjs";
31
- import { useGetRateMutation as xi } from "../../queries/useGetRate.mutation.mjs";
32
- import { mxClsx as fe } from "../../utils/mxClsx.mjs";
33
- import { AmountCard as ge } from "../AmountCard/AmountCard.mjs";
34
- import { AmountInput as qe } from "../AmountInput/AmountInput.mjs";
35
- import { MxButton as Ni } from "../base/MxButton/MxButton.mjs";
33
+ import { useInvalidateHistoryQuery as wi } from "../../queries/useGetHistory.query.mjs";
34
+ import { useGetRateMutation as yi } from "../../queries/useGetRate.mutation.mjs";
35
+ import { mxClsx as qe } from "../../utils/mxClsx.mjs";
36
+ import { AmountCard as be } from "../AmountCard/AmountCard.mjs";
37
+ import { AmountInput as ve } from "../AmountInput/AmountInput.mjs";
38
+ import { MxButton as Di } from "../base/MxButton/MxButton.mjs";
36
39
  import "../base/MxCard/MxCard.mjs";
37
40
  import "../base/MxLink/MxLink.mjs";
38
41
  import "../base/MxSearch/MxSearch.mjs";
@@ -42,105 +45,105 @@ import "@headlessui/react";
42
45
  import "react-dom";
43
46
  import "react-popper";
44
47
  import "../base/MxTooltip/components/TooltipContainer/TooltipContainer.mjs";
45
- import { BridgeHistory as wi } from "../BridgeHistory/BridgeHistory.mjs";
46
- import { BridgeConnectButton as yi } from "../Connect/BridgeConnectButton.mjs";
47
- import { MvxConnectButton as Di } from "../Connect/MvxConnectButton.mjs";
48
- import { BridgeAccountDisplay as Oi } from "../Connect/BridgeAccountDisplay.mjs";
49
- import { MvxAccountDisplay as Mi } from "../Connect/MvxAccountDisplay.mjs";
50
- import { ToggleDirection as Ei } from "../ToggleDirection/ToggleDirection.mjs";
51
- import { TokenSelector as be } from "../TokenSelector/TokenSelector.mjs";
48
+ import { BridgeHistory as Ei } from "../BridgeHistory/BridgeHistory.mjs";
49
+ import { BridgeConnectButton as Oi } from "../Connect/BridgeConnectButton.mjs";
50
+ import { MvxConnectButton as Mi } from "../Connect/MvxConnectButton.mjs";
51
+ import { BridgeAccountDisplay as Ri } from "../Connect/BridgeAccountDisplay.mjs";
52
+ import { MvxAccountDisplay as Vi } from "../Connect/MvxAccountDisplay.mjs";
53
+ import { ToggleDirection as Li } from "../ToggleDirection/ToggleDirection.mjs";
54
+ import { TokenSelector as Ce } from "../TokenSelector/TokenSelector.mjs";
52
55
  let U;
53
- const Ot = ({
56
+ const Ft = ({
54
57
  mvxChainId: D,
55
58
  mvxAddress: o,
56
- username: ve,
57
- callbackRoute: Ce = "/",
58
- firstTokenIdentifier: Ie,
59
+ username: Ie,
60
+ callbackRoute: xe = "/",
61
+ firstTokenIdentifier: Ae,
59
62
  secondTokenIdentifier: Be,
60
- firstTokenAmount: O,
61
- secondTokenAmount: B,
62
- refetchTrigger: Ae,
63
- showHistory: xe,
64
- forcedDestinationTokenSymbol: Ne,
65
- onSuccessfullySentTransaction: p,
63
+ firstTokenAmount: E,
64
+ secondTokenAmount: x,
65
+ refetchTrigger: Ne,
66
+ showHistory: we,
67
+ forcedDestinationTokenSymbol: ye,
68
+ onSuccessfullySentTransaction: u,
66
69
  onFailedSentTransaction: f,
67
- onHistoryClose: M,
68
- onMvxConnect: S,
69
- onMvxDisconnect: we,
70
- onNavigate: ye,
71
- onChangeDirection: De
70
+ onHistoryClose: O,
71
+ onMvxConnect: ee,
72
+ onMvxDisconnect: De,
73
+ onNavigate: Ee,
74
+ onChangeDirection: Oe
72
75
  }) => {
73
- var de, me;
74
- const Oe = ui(null), [j, Me] = C(!1), [Ee, Re] = C(1), [k, T] = C(0), [ee, ie] = C([]), s = qi(), { switchNetwork: te } = di(), re = Ai(), {
75
- options: ne,
76
+ var pe, ue;
77
+ const Me = hi(null), [j, Re] = C(!1), [Ve, Le] = C(1), [P, ie] = C(0), [te, re] = C([]), l = Ci(), { switchNetwork: ne } = pi(), oe = wi(), {
78
+ options: ae,
76
79
  supportedChains: A,
77
- nativeAuthToken: P,
78
- bridgeOnly: Ve
79
- } = he(), W = Ii(), oe = Ci(), ae = Bi(), {
80
+ nativeAuthToken: W,
81
+ bridgeOnly: Fe
82
+ } = ge(), k = Bi(), se = Ai(), le = Ni(), {
80
83
  signMvxTransactions: G,
81
84
  resetMvxTransactionHash: Q,
82
85
  latestMvxTransactionHash: _
83
- } = he(), {
84
- evmTokensWithBalances: Le,
85
- mvxTokensWithBalances: Fe,
86
- isTokensLoading: Ue,
87
- isLoadingEvmTokensBalances: je,
86
+ } = ge(), {
87
+ evmTokensWithBalances: Ue,
88
+ mvxTokensWithBalances: je,
89
+ isTokensLoading: Pe,
90
+ isLoadingEvmTokensBalances: We,
88
91
  isLoadingMvxTokensBalances: ke,
89
- chains: x = [],
90
- isChainsLoading: Pe
91
- } = vi({
92
- refetchTrigger: Ae,
92
+ chains: B = [],
93
+ isChainsLoading: Ge
94
+ } = xi({
95
+ refetchTrigger: Ne,
93
96
  mvxAddress: o,
94
- mvxApiURL: ne.mvxApiURL
95
- }), $ = Ue || je || ke || Pe, We = m(() => A.find((e) => Z(e.id, W)), [W, A]), g = m(() => x.find(
97
+ mvxApiURL: ae.mvxApiURL
98
+ }), $ = Pe || We || ke || Ge, Qe = m(() => A.find((e) => T(e.id, k)), [k, A]), g = m(() => B.find(
96
99
  (e) => e.chainId.toString() === D.toString()
97
- ), [W, x]), {
98
- mutate: Ge,
100
+ ), [k, B]), {
101
+ mutate: _e,
99
102
  data: n,
100
103
  isPending: N,
101
104
  error: q
102
- } = xi(), w = ((de = q == null ? void 0 : q.response) == null ? void 0 : de.status) === 400 ? (me = q == null ? void 0 : q.response) == null ? void 0 : me.data.message : void 0, Qe = u(
105
+ } = yi(), w = ((pe = q == null ? void 0 : q.response) == null ? void 0 : pe.status) === 400 ? (ue = q == null ? void 0 : q.response) == null ? void 0 : ue.data.message : void 0, $e = p(
103
106
  (e) => {
104
107
  const v = A.find(
105
- (si) => Z(si.id, e.id)
108
+ (ci) => T(ci.id, e.id)
106
109
  );
107
- v && te(v);
110
+ v && ne(v);
108
111
  },
109
- [A, te]
112
+ [A, ne]
110
113
  ), {
111
114
  firstToken: i,
112
115
  secondToken: t,
113
- fromOptions: _e,
114
- toOptions: $e,
116
+ fromOptions: ze,
117
+ toOptions: He,
115
118
  selectedChainOption: y,
116
- onChangeFirstSelect: ze,
117
- onChangeSecondSelect: He,
118
- handleChangeDirection: Ke
119
- } = pi({
120
- chains: x,
121
- activeChain: We,
119
+ onChangeFirstSelect: Ke,
120
+ onChangeSecondSelect: Xe,
121
+ handleChangeDirection: Ye
122
+ } = fi({
123
+ chains: B,
124
+ activeChain: Qe,
122
125
  sdkChains: A,
123
- switchNetwork: Qe,
124
- fromTokens: Fe,
125
- toTokens: Le,
126
- firstTokenIdentifier: Ie,
126
+ switchNetwork: $e,
127
+ fromTokens: je,
128
+ toTokens: Ue,
129
+ firstTokenIdentifier: Ae,
127
130
  secondTokenIdentifier: Be,
128
- forcedDestinationTokenSymbol: Ne,
131
+ forcedDestinationTokenSymbol: ye,
129
132
  isTokensLoading: $,
130
133
  mvxChainId: D,
131
- callbackRoute: Ce,
132
- onNavigate: ye
133
- }), Xe = () => {
134
- Ke(), De();
135
- }, [l, Ye] = C(O ?? ""), [E, R] = C(B ?? ""), Je = m(() => i ? pe.includes(i.chainId.toString()) : !1, [i == null ? void 0 : i.chainId]), Ze = m(() => t ? pe.includes(t.chainId.toString()) : !1, [t == null ? void 0 : t.chainId]), c = m(() => t ? x.find(
136
- (e) => Z(e.chainId, t.chainId)
137
- ) ?? y : y, [t == null ? void 0 : t.chainId, x, y]), V = m(
138
- () => gi(t == null ? void 0 : t.chainId) ?? oe,
139
- [t == null ? void 0 : t.chainId, oe]
140
- ), se = s.address, le = s.isConnected && !!se, z = l !== "" && E !== "", H = u(
141
- mi(async (e) => {
142
- !e || !Number(e) || !s.address || !(i != null && i.address) || !(t != null && t.address) || !y || !V || Ge({
143
- nativeAuthToken: P ?? "",
134
+ callbackRoute: xe,
135
+ onNavigate: Ee
136
+ }), Je = () => {
137
+ Ye(), Oe();
138
+ }, [c, Ze] = C(E ?? ""), [M, R] = C(x ?? ""), Se = m(() => i ? fe.includes(i.chainId.toString()) : !1, [i == null ? void 0 : i.chainId]), Te = m(() => t ? fe.includes(t.chainId.toString()) : !1, [t == null ? void 0 : t.chainId]), a = m(() => t ? B.find(
139
+ (e) => T(e.chainId, t.chainId)
140
+ ) ?? y : y, [t == null ? void 0 : t.chainId, B, y]), V = m(
141
+ () => vi(t == null ? void 0 : t.chainId) ?? se,
142
+ [t == null ? void 0 : t.chainId, se]
143
+ ), ce = l.address, de = l.isConnected && !!ce, z = c !== "" && M !== "", H = p(
144
+ ui(async (e) => {
145
+ !e || !Number(e) || !l.address || !(i != null && i.address) || !(t != null && t.address) || !y || !V || _e({
146
+ nativeAuthToken: W ?? "",
144
147
  body: {
145
148
  tokenIn: i.address,
146
149
  amountIn: e,
@@ -151,52 +154,52 @@ const Ot = ({
151
154
  });
152
155
  }, 500),
153
156
  [
154
- s.address,
157
+ l.address,
155
158
  V,
156
159
  i == null ? void 0 : i.address,
157
160
  t == null ? void 0 : t.address,
158
161
  y
159
162
  ]
160
- ), d = u((e) => {
161
- Ye(() => e);
162
- }, []), b = u((e) => {
163
+ ), d = p((e) => {
164
+ Ze(() => e);
165
+ }, []), b = p((e) => {
163
166
  R(() => e);
164
- }, []), Se = u(() => {
165
- M == null || M();
166
- }, [M]), Te = u(() => {
167
- const e = ci({
167
+ }, []), ei = p(() => {
168
+ O == null || O();
169
+ }, [O]), ii = p(() => {
170
+ const e = mi({
168
171
  decimals: i == null ? void 0 : i.decimals,
169
172
  input: (i == null ? void 0 : i.balance) ?? "0",
170
173
  addCommas: !1,
171
174
  digits: 4
172
175
  });
173
176
  h.setFieldValue("firstAmount", e), d(e);
174
- }, [i == null ? void 0 : i.balance, i == null ? void 0 : i.decimals, d]), ei = u(
177
+ }, [i == null ? void 0 : i.balance, i == null ? void 0 : i.decimals, d]), ti = p(
175
178
  async (e) => {
176
- d(""), b(""), re(), re(), p == null || p(e);
179
+ d(""), b(""), oe(), oe(), u == null || u(e);
177
180
  },
178
181
  [
179
182
  d,
180
183
  b,
181
- p
184
+ u
182
185
  ]
183
- ), ii = u(
186
+ ), ri = p(
184
187
  async ({ transactions: e }) => {
185
- T(() => e.length);
188
+ ie(() => e.length);
186
189
  try {
187
190
  if (!G)
188
191
  throw new Error("signMvxTransactions function is not provided");
189
- await G(e), ie(e);
192
+ await G(e), re(e);
190
193
  } catch (v) {
191
- console.error(v), ue.dismiss(), ue.error("Transaction cancelled"), f == null || f("Transaction cancelled"), T(0), ri(), d(""), b("");
194
+ console.error(v), he.dismiss(), he.error("Transaction cancelled"), f == null || f("Transaction cancelled"), ie(0), oi(), d(""), b("");
192
195
  }
193
196
  },
194
197
  [
195
- se,
198
+ ce,
196
199
  d,
197
200
  b,
198
- P,
199
- ei,
201
+ W,
202
+ ti,
200
203
  G
201
204
  ]
202
205
  ), {
@@ -204,81 +207,85 @@ const Ot = ({
204
207
  firstAmountError: K,
205
208
  secondAmountError: X,
206
209
  fromChainError: Y,
210
+ senderAddressError: J,
211
+ receiverAddressError: Z,
207
212
  handleBlur: L,
208
- handleChange: ce,
209
- handleSubmit: ti,
210
- resetSwapForm: ri
211
- } = bi({
213
+ handleChange: me,
214
+ handleSubmit: ni,
215
+ resetSwapForm: oi
216
+ } = Ii({
212
217
  isMvxConnected: !!o,
213
218
  rate: n,
214
219
  sender: o ?? "",
215
- receiver: s.address ?? "",
220
+ receiver: l.address ?? "",
216
221
  firstToken: i,
217
- firstAmount: l,
222
+ firstAmount: c,
218
223
  fromChainId: D,
219
224
  toChainId: V,
220
225
  secondToken: t,
221
- secondAmount: E,
222
- setForceRefetchRate: Re,
223
- onSubmit: ii
224
- }), ni = !!(K || X || Y || w), oi = m(() => l !== "" ? w ?? K : void 0, [K, l, w]), ai = m(() => E !== "" ? Y ?? X : void 0, [Y, X, E]);
225
- return I(() => (l || R(""), H(l), U && clearInterval(U), U = setInterval(() => {
226
- H(l);
227
- }, 50 * 1e3), () => clearInterval(U)), [l, Ee, H]), I(() => {
226
+ secondAmount: M,
227
+ setForceRefetchRate: Le,
228
+ senderChainType: qi.mvx,
229
+ receiverChainType: a == null ? void 0 : a.chainType,
230
+ onSubmit: ri
231
+ }), ai = !!(K || X || Y || w || J || Z), si = m(() => c !== "" ? w ?? K : void 0, [K, c, w]), li = m(() => M !== "" ? Y ?? X : void 0, [Y, X, M]);
232
+ return I(() => (c || R(""), H(c), U && clearInterval(U), U = setInterval(() => {
233
+ H(c);
234
+ }, 50 * 1e3), () => clearInterval(U)), [c, Ve, H]), I(() => {
228
235
  n != null && n.amountOut && (h.setFieldValue(F.secondAmount, n.amountOut), R(n.amountOut));
229
236
  }, [n == null ? void 0 : n.amountOut]), I(() => {
230
237
  w && (h.setFieldValue(F.secondAmount, "0"), R("0"));
231
238
  }, [w]), I(() => {
232
- O && (h.setFieldValue(
239
+ E && (h.setFieldValue(
233
240
  F.firstAmount,
234
- O
235
- ), d(O));
241
+ E
242
+ ), d(E));
236
243
  }, []), I(() => {
237
- B && (h.setFieldValue(
244
+ x && (h.setFieldValue(
238
245
  F.secondAmount,
239
- B
240
- ), b(B));
241
- }, [B]), I(() => {
246
+ x
247
+ ), b(x));
248
+ }, [x]), I(() => {
242
249
  if (_)
243
250
  try {
244
251
  const e = _;
245
- ae({
246
- transactions: ee.map((v) => ({
252
+ le({
253
+ transactions: te.map((v) => ({
247
254
  ...v,
248
255
  txHash: e,
249
- receiver: s.address
256
+ receiver: l.address
250
257
  })),
251
- provider: (n == null ? void 0 : n.provider) ?? fi.None,
252
- url: hi() ?? "",
253
- token: P ?? ""
254
- }), p == null || p([e]);
258
+ provider: (n == null ? void 0 : n.provider) ?? bi.None,
259
+ url: gi() ?? "",
260
+ token: W ?? ""
261
+ }), u == null || u([e]);
255
262
  } catch (e) {
256
263
  console.error("Error while sending transactions:", e), f == null || f(
257
264
  "An error occurred while sending the transaction"
258
265
  );
259
266
  return;
260
267
  } finally {
261
- Q == null || Q(), ie([]);
268
+ Q == null || Q(), re([]);
262
269
  }
263
270
  }, [
264
271
  _,
265
- ee,
272
+ te,
266
273
  n == null ? void 0 : n.provider,
267
- ae
268
- ]), /* @__PURE__ */ r(li, { children: /* @__PURE__ */ a(
274
+ le
275
+ ]), /* @__PURE__ */ r(di, { children: /* @__PURE__ */ s(
269
276
  "form",
270
277
  {
271
- ref: Oe,
278
+ ref: Me,
272
279
  noValidate: !0,
273
280
  className: "liq-flex liq-flex-col liq-gap-1 liq-relative",
274
281
  autoComplete: "off",
275
- onSubmit: ti,
282
+ onSubmit: ni,
276
283
  children: [
277
- xe && /* @__PURE__ */ r(wi, { mvxAddress: o, onClose: Se }),
278
- /* @__PURE__ */ a(
279
- ge,
284
+ we && /* @__PURE__ */ r(Ei, { mvxAddress: o, onClose: ei }),
285
+ /* @__PURE__ */ s(
286
+ be,
280
287
  {
281
- className: fe(
288
+ className: qe(
282
289
  "liq-pb-8 liq-pt-6 hover:liq-bg-neutral-700/50 sm:liq-pb-6",
283
290
  {
284
291
  "liq-pointer-events-none": j,
@@ -286,100 +293,102 @@ const Ot = ({
286
293
  }
287
294
  ),
288
295
  children: [
289
- /* @__PURE__ */ a("div", { className: "liq-flex liq-items-center liq-gap-1", children: [
296
+ /* @__PURE__ */ s("div", { className: "liq-flex liq-items-center liq-gap-1", children: [
290
297
  /* @__PURE__ */ r("span", { children: "From" }),
291
298
  /* @__PURE__ */ r(
292
- Mi,
299
+ Vi,
293
300
  {
294
301
  accountAddress: o,
295
- chainIcon: J(g == null ? void 0 : g.pngUrl),
296
- username: ve,
297
- accountExplorerUrl: `${ne.mvxExplorerAddress}/accounts/${o}`,
302
+ chainIcon: S(g == null ? void 0 : g.pngUrl),
303
+ username: Ie,
304
+ accountExplorerUrl: `${ae.mvxExplorerAddress}/accounts/${o}`,
298
305
  showTag: !0,
299
- onDisconnect: we,
300
- onConnect: S
306
+ onDisconnect: De,
307
+ onConnect: ee
301
308
  }
302
309
  )
303
310
  ] }),
304
- /* @__PURE__ */ a("div", { className: "liq-flex liq-justify-between liq-gap-1", children: [
311
+ J && /* @__PURE__ */ r("div", { className: "liq-text-red-400 liq-text-xs liq-mt-1", children: J }),
312
+ /* @__PURE__ */ s("div", { className: "liq-flex liq-justify-between liq-gap-1", children: [
305
313
  /* @__PURE__ */ r(
306
- qe,
314
+ ve,
307
315
  {
308
316
  inputName: "firstAmount",
309
317
  inputValue: h.values.firstAmount,
310
- amountError: oi,
318
+ amountError: si,
311
319
  disabled: !1,
312
320
  onInputDebounceChange: d,
313
- onInputChange: ce,
321
+ onInputChange: me,
314
322
  onBlur: L
315
323
  }
316
324
  ),
317
325
  /* @__PURE__ */ r(
318
- be,
326
+ Ce,
319
327
  {
320
328
  name: "firstToken",
321
329
  disabled: N,
322
- options: _e,
330
+ options: ze,
323
331
  areOptionsLoading: $,
324
- isMvxSelector: Je,
332
+ isMvxSelector: Se,
325
333
  isDestination: !1,
326
334
  color: "neutral-850",
327
- onChange: ze,
335
+ onChange: Ke,
328
336
  onBlur: L,
329
- onMaxBtnClick: Te,
337
+ onMaxBtnClick: ii,
330
338
  selectedOption: i,
331
- onTokenSelectorDisplay: (e) => Me(e)
339
+ onTokenSelectorDisplay: (e) => Re(e)
332
340
  }
333
341
  )
334
342
  ] })
335
343
  ]
336
344
  }
337
345
  ),
338
- /* @__PURE__ */ r("div", { className: "liq-absolute liq-left-[6%] liq-top-[40%] -liq-mt-1 liq-z-10", children: Ve && /* @__PURE__ */ r(Ei, { onChangeDirection: Xe }) }),
339
- /* @__PURE__ */ a(
340
- ge,
346
+ /* @__PURE__ */ r("div", { className: "liq-absolute liq-left-[6%] liq-top-[40%] -liq-mt-1 liq-z-10", children: Fe && /* @__PURE__ */ r(Li, { onChangeDirection: Je }) }),
347
+ /* @__PURE__ */ s(
348
+ be,
341
349
  {
342
- className: fe(
350
+ className: qe(
343
351
  "liq-pb-8 liq-pt-6 hover:liq-bg-neutral-700/50 sm:liq-pb-6",
344
352
  {
345
353
  "liq-pointer-events-none": j
346
354
  }
347
355
  ),
348
356
  children: [
349
- /* @__PURE__ */ a("div", { className: "liq-flex liq-items-center liq-gap-1", children: [
357
+ /* @__PURE__ */ s("div", { className: "liq-flex liq-items-center liq-gap-1", children: [
350
358
  /* @__PURE__ */ r("span", { children: "To" }),
351
359
  /* @__PURE__ */ r(
352
- Oi,
360
+ Ri,
353
361
  {
354
362
  disabled: N,
355
- activeChain: c
363
+ activeChain: a
356
364
  }
357
365
  )
358
366
  ] }),
359
- /* @__PURE__ */ a("div", { className: "liq-flex liq-justify-between liq-gap-1", children: [
367
+ Z && /* @__PURE__ */ r("div", { className: "liq-text-red-400 liq-text-xs liq-mt-1", children: Z }),
368
+ /* @__PURE__ */ s("div", { className: "liq-flex liq-justify-between liq-gap-1", children: [
360
369
  /* @__PURE__ */ r(
361
- qe,
370
+ ve,
362
371
  {
363
372
  inputName: "secondAmount",
364
373
  inputValue: h.values.secondAmount,
365
- amountError: ai,
374
+ amountError: li,
366
375
  disabled: !1,
367
376
  onInputDebounceChange: b,
368
- onInputChange: ce,
377
+ onInputChange: me,
369
378
  onBlur: L
370
379
  }
371
380
  ),
372
381
  /* @__PURE__ */ r(
373
- be,
382
+ Ce,
374
383
  {
375
384
  name: "secondToken",
376
385
  disabled: N,
377
386
  omitDisableClass: !0,
378
- options: $e,
387
+ options: He,
379
388
  areOptionsLoading: $,
380
- isMvxSelector: Ze,
389
+ isMvxSelector: Te,
381
390
  color: "neutral-850",
382
- onChange: He,
391
+ onChange: Xe,
383
392
  onBlur: L,
384
393
  selectedOption: t
385
394
  }
@@ -388,54 +397,54 @@ const Ot = ({
388
397
  ]
389
398
  }
390
399
  ),
391
- /* @__PURE__ */ a("div", { className: "liq-flex liq-items-center liq-justify-center", children: [
400
+ /* @__PURE__ */ s("div", { className: "liq-flex liq-items-center liq-justify-center", children: [
392
401
  !o && /* @__PURE__ */ r(
393
- Di,
402
+ Mi,
394
403
  {
395
404
  mvxAccountAddress: o,
396
- icon: J(g == null ? void 0 : g.pngUrl),
397
- onClick: S
405
+ icon: S(g == null ? void 0 : g.pngUrl),
406
+ onClick: ee
398
407
  }
399
408
  ),
400
- o && !le && /* @__PURE__ */ r(
401
- yi,
409
+ o && !de && /* @__PURE__ */ r(
410
+ Oi,
402
411
  {
403
412
  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",
404
413
  disabled: N,
405
- activeChain: c
414
+ activeChain: a
406
415
  }
407
416
  ),
408
- o && le && /* @__PURE__ */ a(
409
- Ni,
417
+ o && de && /* @__PURE__ */ s(
418
+ Di,
410
419
  {
411
420
  "data-testid": "submit-button",
412
421
  type: "submit",
413
422
  variant: "neutral-850",
414
423
  className: "liq-w-full disabled:liq-bg-neutral-850/50 liq-py-3 hover:enabled:liq-bg-primary !liq-text-primary-200",
415
- disabled: !z || N || !o || !s.address || ni,
424
+ disabled: !z || N || !o || !l.address || ai,
416
425
  children: [
417
- z && /* @__PURE__ */ a("div", { className: "liq-flex liq-justify-center liq-items-center liq-gap-2", children: [
426
+ z && /* @__PURE__ */ s("div", { className: "liq-flex liq-justify-center liq-items-center liq-gap-2", children: [
418
427
  /* @__PURE__ */ r("div", { children: "Transfer to " }),
419
428
  /* @__PURE__ */ r(
420
429
  "img",
421
430
  {
422
- src: J(c == null ? void 0 : c.pngUrl),
431
+ src: S(a == null ? void 0 : a.pngUrl),
423
432
  alt: "",
424
433
  className: "liq-h-[1.5rem] liq-w-[1.5rem] liq-rounded-lg"
425
434
  }
426
435
  ),
427
- /* @__PURE__ */ r("div", { children: c == null ? void 0 : c.networkName })
436
+ /* @__PURE__ */ r("div", { children: a == null ? void 0 : a.networkName })
428
437
  ] }),
429
438
  !z && /* @__PURE__ */ r("span", { className: "liq-text-neutral-100", children: "Enter amount" })
430
439
  ]
431
440
  }
432
441
  )
433
442
  ] }),
434
- s.address && k > 0 && /* @__PURE__ */ r("div", { className: "liq-flex liq-items-center liq-justify-center liq-text-neutral-300 liq-text-sm", children: /* @__PURE__ */ a("div", { children: [
443
+ l.address && P > 0 && /* @__PURE__ */ r("div", { className: "liq-flex liq-items-center liq-justify-center liq-text-neutral-300 liq-text-sm", children: /* @__PURE__ */ s("div", { children: [
435
444
  "You will be asked to sign ",
436
- k,
445
+ P,
437
446
  " ",
438
- k > 1 ? "transactions" : "transaction",
447
+ P > 1 ? "transactions" : "transaction",
439
448
  " ",
440
449
  "on your wallet"
441
450
  ] }) })
@@ -444,5 +453,5 @@ const Ot = ({
444
453
  ) });
445
454
  };
446
455
  export {
447
- Ot as Transfer
456
+ Ft as Transfer
448
457
  };