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