@multiversx/sdk-dapp-liquidity 2.4.0-alpha.0 → 2.4.0-alpha.1
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/BridgeHistory-0NVr8Uxp.js +2 -0
- package/{BridgeHistory-CInRkJ6T.mjs → BridgeHistory-BUSiuT1d.mjs} +10 -10
- package/{useFetchBridgeData-C_hZjzd_.mjs → hooks-DMIHvAKb.mjs} +16 -16
- package/hooks-SJPsZfDx.js +2 -0
- package/index.js +1 -1
- package/index.mjs +42 -42
- package/package.json +1 -1
- package/reactjs/components/BridgeForm/BridgeForm.js +1 -1
- package/reactjs/components/BridgeForm/BridgeForm.mjs +77 -49
- package/reactjs/components/BridgeForm/Deposit.js +1 -1
- package/reactjs/components/BridgeForm/Deposit.mjs +221 -222
- package/reactjs/components/BridgeForm/Transfer.js +1 -1
- package/reactjs/components/BridgeForm/Transfer.mjs +44 -44
- package/reactjs/components/BridgeForm/hooks/useBridgeTokenSelection.js +1 -1
- package/reactjs/components/BridgeForm/hooks/useBridgeTokenSelection.mjs +3 -3
- package/reactjs/components/BridgeForm/utils/bridgeFormHelpers.d.ts +2 -0
- package/reactjs/components/BridgeForm/utils/bridgeFormHelpers.js +1 -1
- package/reactjs/components/BridgeForm/utils/bridgeFormHelpers.mjs +2 -2
- package/reactjs/components/BridgeHistory/BridgeHistory.js +1 -1
- package/reactjs/components/BridgeHistory/BridgeHistory.mjs +1 -1
- package/reactjs/components/BridgeHistory/index.js +1 -1
- package/reactjs/components/BridgeHistory/index.mjs +1 -1
- package/reactjs/components/Connect/ChainSelectConnect.js +1 -1
- package/reactjs/components/Connect/ChainSelectConnect.mjs +3 -3
- package/reactjs/components/index.js +1 -1
- package/reactjs/components/index.mjs +1 -1
- package/reactjs/context/Web3AppProvider.js +1 -1
- package/reactjs/context/Web3AppProvider.mjs +5 -5
- package/reactjs/hooks/index.js +1 -1
- package/reactjs/hooks/index.mjs +14 -14
- package/reactjs/hooks/useBridgeFormik.js +1 -1
- package/reactjs/hooks/useBridgeFormik.mjs +14 -14
- package/reactjs/hooks/useFetchBridgeData.js +1 -1
- package/reactjs/hooks/useFetchBridgeData.mjs +1 -1
- package/reactjs/hooks/useFetchTokens.js +1 -1
- package/reactjs/hooks/useFetchTokens.mjs +1 -1
- package/reactjs/hooks/useSignTransaction.d.ts +3 -470
- package/reactjs/hooks/useSignTransaction.js +1 -1
- package/reactjs/hooks/useSignTransaction.mjs +39 -40
- package/reactjs/index.js +1 -1
- package/reactjs/index.mjs +42 -42
- package/reactjs/queries/index.js +1 -1
- package/reactjs/queries/index.mjs +3 -3
- package/reactjs/queries/useGetNonMvxTokensBalances.query.js +1 -1
- package/reactjs/queries/useGetNonMvxTokensBalances.query.mjs +1 -1
- package/reactjs/utils/index.js +1 -1
- package/reactjs/utils/index.mjs +11 -11
- package/BridgeHistory-BU-L_w0l.js +0 -2
- package/useFetchBridgeData-B5xt9GbW.js +0 -2
|
@@ -10,139 +10,138 @@ import { AmountCard as o } from "../AmountCard/AmountCard.mjs";
|
|
|
10
10
|
import "../AmountCard/index.mjs";
|
|
11
11
|
import { AmountInput as s } from "../AmountInput/AmountInput.mjs";
|
|
12
12
|
import "../AmountInput/index.mjs";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import { useNamespaceAddress as
|
|
26
|
-
import { useInvalidateHistoryQuery as
|
|
27
|
-
import { useGetRateMutation as
|
|
28
|
-
import { t as
|
|
13
|
+
import { useAccount as c } from "../../hooks/useAccount.mjs";
|
|
14
|
+
import { useWeb3App as ee } from "../../context/useWeb3App.mjs";
|
|
15
|
+
import { BridgeFormikValuesEnum as l, useBridgeFormik as te } from "../../hooks/useBridgeFormik.mjs";
|
|
16
|
+
import { sameBridgeApiChainId as u, toBridgeApiChainId as ne } from "../../helpers/resolveBridgeApiChainId.mjs";
|
|
17
|
+
import { useBridgeApiChainId as re } from "../../hooks/useBridgeApiChainId.mjs";
|
|
18
|
+
import { t as ie } from "../../../hooks-DMIHvAKb.mjs";
|
|
19
|
+
import { useGetChainId as ae } from "../../hooks/useGetChainId.mjs";
|
|
20
|
+
import { useSendTransactions as oe } from "../../hooks/useSendTransactions.mjs";
|
|
21
|
+
import { useSignTransaction as se } from "../../hooks/useSignTransaction.mjs";
|
|
22
|
+
import { resolveSigningChainType as ce } from "./utils/bridgeFormHelpers.mjs";
|
|
23
|
+
import { useBridgeTokenSelection as le } from "./hooks/useBridgeTokenSelection.mjs";
|
|
24
|
+
import { useDisconnectOnChainTypeChange as ue } from "../../hooks/useDisconnectOnChainTypeChange.mjs";
|
|
25
|
+
import { useNamespaceAddress as de } from "../../hooks/useNamespaceAddress.mjs";
|
|
26
|
+
import { useInvalidateHistoryQuery as fe } from "../../queries/useGetHistory.query.mjs";
|
|
27
|
+
import { useGetRateMutation as pe } from "../../queries/useGetRate.mutation.mjs";
|
|
28
|
+
import { t as me } from "../../../BridgeHistory-BUSiuT1d.mjs";
|
|
29
29
|
import "../BridgeHistory/index.mjs";
|
|
30
|
-
import { BridgeConnectButton as
|
|
31
|
-
import { MvxConnectButton as
|
|
32
|
-
import { BridgeAccountDisplay as
|
|
33
|
-
import { MvxAccountDisplay as
|
|
30
|
+
import { BridgeConnectButton as he } from "../Connect/BridgeConnectButton.mjs";
|
|
31
|
+
import { MvxConnectButton as ge } from "../Connect/MvxConnectButton.mjs";
|
|
32
|
+
import { BridgeAccountDisplay as _e } from "../Connect/BridgeAccountDisplay.mjs";
|
|
33
|
+
import { MvxAccountDisplay as ve } from "../Connect/MvxAccountDisplay.mjs";
|
|
34
34
|
import "../Connect/index.mjs";
|
|
35
|
-
import { t as
|
|
36
|
-
import { TokenSelector as
|
|
35
|
+
import { t as ye } from "../../../ToggleDirection-BLDXxUlN.mjs";
|
|
36
|
+
import { TokenSelector as be } from "../TokenSelector/TokenSelector.mjs";
|
|
37
37
|
import "../TokenSelector/index.mjs";
|
|
38
|
-
import { Fragment as
|
|
39
|
-
import { useCallback as
|
|
40
|
-
import { FontAwesomeIcon as
|
|
41
|
-
import {
|
|
42
|
-
import { formatAmount as
|
|
43
|
-
import {
|
|
44
|
-
import { waitForTransactionReceipt as
|
|
45
|
-
import
|
|
46
|
-
import { toast as
|
|
38
|
+
import { Fragment as xe, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
39
|
+
import { useCallback as p, useEffect as m, useMemo as h, useRef as Se, useState as g } from "react";
|
|
40
|
+
import { FontAwesomeIcon as Ce } from "@fortawesome/react-fontawesome";
|
|
41
|
+
import { useAppKitNetwork as we } from "@reown/appkit/react";
|
|
42
|
+
import { formatAmount as Te } from "@multiversx/sdk-dapp-utils/out/helpers/formatAmount";
|
|
43
|
+
import { faSpinner as Ee } from "@fortawesome/free-solid-svg-icons/faSpinner";
|
|
44
|
+
import { waitForTransactionReceipt as De } from "@wagmi/core";
|
|
45
|
+
import Oe from "lodash/debounce";
|
|
46
|
+
import { toast as _ } from "react-toastify";
|
|
47
47
|
//#region src/reactjs/components/BridgeForm/Deposit.tsx
|
|
48
|
-
var
|
|
49
|
-
let
|
|
50
|
-
refetchTrigger:
|
|
51
|
-
mvxAddress:
|
|
52
|
-
mvxApiURL:
|
|
53
|
-
}),
|
|
54
|
-
chains:
|
|
55
|
-
activeChain:
|
|
56
|
-
sdkChains:
|
|
57
|
-
switchNetwork:
|
|
58
|
-
let t =
|
|
59
|
-
t &&
|
|
60
|
-
}, [
|
|
61
|
-
fromTokens:
|
|
62
|
-
toTokens:
|
|
63
|
-
firstTokenIdentifier:
|
|
64
|
-
secondTokenIdentifier:
|
|
65
|
-
forcedDestinationTokenSymbol:
|
|
66
|
-
isTokensLoading:
|
|
67
|
-
callbackRoute:
|
|
68
|
-
onNavigate:
|
|
69
|
-
}), yt =
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
]), G =
|
|
74
|
-
|
|
75
|
-
let K =
|
|
76
|
-
!e || !Number(e) || !K || !
|
|
77
|
-
nativeAuthToken:
|
|
48
|
+
var v, y = ({ mvxChainId: y, mvxAddress: b, username: ke, callbackRoute: Ae = "/", firstTokenIdentifier: je, secondTokenIdentifier: Me, firstTokenAmount: x, secondTokenAmount: S, refetchTrigger: Ne, showHistory: Pe, forcedDestinationTokenSymbol: Fe, onSuccessfullySentTransaction: Ie, onFailedSentTransaction: Le, onHistoryClose: Re, onMvxConnect: ze, onMvxDisconnect: Be, onNavigate: Ve, onChangeDirection: He }) => {
|
|
49
|
+
let Ue = Se(null), We = Se(void 0), [C, Ge] = g(!1), [w, T] = g(!1), [Ke, qe] = g(1), [E, D] = g(0), Je = c(), { switchNetwork: Ye } = we(), Xe = fe(), { config: Ze, options: Qe, supportedChains: O, nativeAuthToken: k, bridgeOnly: $e } = ee(), A = ae(), et = re(), { evmTokensWithBalances: tt, mvxTokensWithBalances: nt, isTokensLoading: rt, isLoadingEvmTokensBalances: it, isLoadingMvxTokensBalances: at, chains: j = [], isChainsLoading: ot } = ie({
|
|
50
|
+
refetchTrigger: Ne,
|
|
51
|
+
mvxAddress: b,
|
|
52
|
+
mvxApiURL: Qe.mvxApiURL
|
|
53
|
+
}), M = rt || it || at || ot, st = h(() => O.find((e) => u(e.id, A)), [A, O]), N = h(() => j.find((e) => e.chainId.toString() === y.toString()), [A, j]), { evm: ct, solana: lt, bitcoin: ut, sui: dt } = se(), ft = oe(), { mutate: pt, data: P, isPending: F, error: mt } = pe(), I = mt?.response?.status === 400 ? mt?.response?.data.message : void 0, { firstToken: L, secondToken: R, fromOptions: z, toOptions: ht, selectedChainOption: B, onChangeFirstSelect: gt, onChangeSecondSelect: _t, handleChangeDirection: vt } = le({
|
|
54
|
+
chains: j,
|
|
55
|
+
activeChain: st,
|
|
56
|
+
sdkChains: O,
|
|
57
|
+
switchNetwork: p((e) => {
|
|
58
|
+
let t = O.find((t) => u(t.id, e.id));
|
|
59
|
+
t && Ye(t);
|
|
60
|
+
}, [O, Ye]),
|
|
61
|
+
fromTokens: tt,
|
|
62
|
+
toTokens: nt,
|
|
63
|
+
firstTokenIdentifier: je,
|
|
64
|
+
secondTokenIdentifier: Me,
|
|
65
|
+
forcedDestinationTokenSymbol: Fe,
|
|
66
|
+
isTokensLoading: M,
|
|
67
|
+
callbackRoute: Ae,
|
|
68
|
+
onNavigate: Ve
|
|
69
|
+
}), yt = h(() => L ? e.includes(L.chainId.toString()) : !1, [L?.chainId]), bt = h(() => R ? e.includes(R.chainId.toString()) : !1, [R?.chainId]), [V, xt] = g(x ?? ""), [H, U] = g(S ?? ""), W = h(() => L ? j.find((e) => u(e.chainId, L.chainId)) ?? B : B, [
|
|
70
|
+
L?.chainId,
|
|
71
|
+
j,
|
|
72
|
+
B
|
|
73
|
+
]), G = h(() => ne(L?.chainId) ?? et, [L?.chainId, et]);
|
|
74
|
+
ue(W?.chainType);
|
|
75
|
+
let K = de(W?.chainType), St = K, Ct = Je.isConnected && !!K, q = V !== "" && H !== "", J = p(Oe(async (e) => {
|
|
76
|
+
!e || !Number(e) || !K || !L?.address || !R?.address || !B || !G || pt({
|
|
77
|
+
nativeAuthToken: k ?? "",
|
|
78
78
|
body: {
|
|
79
|
-
tokenIn:
|
|
79
|
+
tokenIn: L.address,
|
|
80
80
|
amountIn: e,
|
|
81
81
|
fromChainId: G,
|
|
82
|
-
tokenOut:
|
|
83
|
-
toChainId:
|
|
82
|
+
tokenOut: R.address,
|
|
83
|
+
toChainId: y
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
86
|
}, 500), [
|
|
87
87
|
K,
|
|
88
88
|
G,
|
|
89
|
-
I?.address,
|
|
90
89
|
L?.address,
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
90
|
+
R?.address,
|
|
91
|
+
B,
|
|
92
|
+
y,
|
|
93
|
+
k,
|
|
94
|
+
pt
|
|
95
|
+
]), Y = p((e) => {
|
|
96
96
|
xt(() => e);
|
|
97
|
-
}, []),
|
|
97
|
+
}, []), X = p((e) => {
|
|
98
98
|
U(() => e);
|
|
99
|
-
}, []),
|
|
100
|
-
|
|
101
|
-
}, [
|
|
102
|
-
let e =
|
|
103
|
-
decimals:
|
|
104
|
-
input:
|
|
99
|
+
}, []), wt = p(() => {
|
|
100
|
+
Re?.();
|
|
101
|
+
}, [Re]), Tt = p(() => {
|
|
102
|
+
let e = Te({
|
|
103
|
+
decimals: L?.decimals,
|
|
104
|
+
input: L?.balance ?? "0",
|
|
105
105
|
addCommas: !1,
|
|
106
106
|
digits: 4
|
|
107
107
|
});
|
|
108
|
-
|
|
108
|
+
Z.setFieldValue("firstAmount", e), Y(e);
|
|
109
109
|
}, [
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
]),
|
|
114
|
-
|
|
110
|
+
L?.balance,
|
|
111
|
+
L?.decimals,
|
|
112
|
+
Y
|
|
113
|
+
]), Et = p(async (e) => {
|
|
114
|
+
Y(""), X(""), Xe(), Xe(), Ie?.(e);
|
|
115
115
|
}, [
|
|
116
|
-
J,
|
|
117
116
|
Y,
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
117
|
+
X,
|
|
118
|
+
Ie
|
|
119
|
+
]), Dt = () => {
|
|
120
|
+
vt(), He();
|
|
121
121
|
};
|
|
122
|
-
|
|
123
|
-
let e =
|
|
124
|
-
if (
|
|
125
|
-
let e =
|
|
122
|
+
m(() => {
|
|
123
|
+
let e = We.current;
|
|
124
|
+
if (We.current = B?.chainId, e && L?.chainId && B?.chainId !== L.chainId) {
|
|
125
|
+
let e = z?.find((e) => e.chainId.toString() === B?.chainId);
|
|
126
126
|
if (!e) return;
|
|
127
|
-
|
|
127
|
+
gt(e);
|
|
128
128
|
}
|
|
129
129
|
}, [
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
B
|
|
130
|
+
B?.chainId,
|
|
131
|
+
L?.chainId,
|
|
132
|
+
z
|
|
134
133
|
]);
|
|
135
|
-
let
|
|
134
|
+
let Ot = p(async ({ transactions: e, provider: n }) => {
|
|
136
135
|
let i = [];
|
|
137
|
-
|
|
136
|
+
T(!0), D(() => e.length);
|
|
138
137
|
try {
|
|
139
138
|
let a = -1;
|
|
140
139
|
for (let t of e) {
|
|
141
140
|
++a;
|
|
142
141
|
try {
|
|
143
|
-
switch (
|
|
142
|
+
switch (ce(t, W)) {
|
|
144
143
|
case r.evm: {
|
|
145
|
-
let n = await
|
|
144
|
+
let n = await ct.signTransaction({
|
|
146
145
|
...t,
|
|
147
146
|
value: BigInt(t.value),
|
|
148
147
|
gas: BigInt(t.gasLimit),
|
|
@@ -152,7 +151,7 @@ var _, v = ({ mvxChainId: v, mvxAddress: y, username: Ae, callbackRoute: je = "/
|
|
|
152
151
|
...t,
|
|
153
152
|
txHash: n
|
|
154
153
|
}), a === e.length - 1 || !n)) break;
|
|
155
|
-
let r = await
|
|
154
|
+
let r = await De(Ze, {
|
|
156
155
|
confirmations: 1,
|
|
157
156
|
hash: n
|
|
158
157
|
});
|
|
@@ -164,7 +163,7 @@ var _, v = ({ mvxChainId: v, mvxAddress: y, username: Ae, callbackRoute: je = "/
|
|
|
164
163
|
}
|
|
165
164
|
case r.sol:
|
|
166
165
|
if (!t.instructions || !t.feePayer) break;
|
|
167
|
-
let n = await
|
|
166
|
+
let n = await lt.signTransaction({
|
|
168
167
|
feePayer: t.feePayer,
|
|
169
168
|
instructions: t.instructions,
|
|
170
169
|
recentBlockhash: t.recentBlockhash
|
|
@@ -180,7 +179,7 @@ var _, v = ({ mvxChainId: v, mvxAddress: y, username: Ae, callbackRoute: je = "/
|
|
|
180
179
|
console.error("No bitcoin params");
|
|
181
180
|
break;
|
|
182
181
|
}
|
|
183
|
-
let o = await
|
|
182
|
+
let o = await ut.signTransaction(t.bitcoinParams);
|
|
184
183
|
i.push({
|
|
185
184
|
...t,
|
|
186
185
|
txHash: o
|
|
@@ -192,7 +191,7 @@ var _, v = ({ mvxChainId: v, mvxAddress: y, username: Ae, callbackRoute: je = "/
|
|
|
192
191
|
console.error("No Sui transaction bytes or sender address");
|
|
193
192
|
break;
|
|
194
193
|
}
|
|
195
|
-
let r = await
|
|
194
|
+
let r = await dt.signTransaction({
|
|
196
195
|
transaction: e,
|
|
197
196
|
address: n
|
|
198
197
|
});
|
|
@@ -207,246 +206,246 @@ var _, v = ({ mvxChainId: v, mvxAddress: y, username: Ae, callbackRoute: je = "/
|
|
|
207
206
|
break;
|
|
208
207
|
}
|
|
209
208
|
default:
|
|
210
|
-
|
|
209
|
+
_.error("Provider not supported"), T(!1);
|
|
211
210
|
return;
|
|
212
211
|
}
|
|
213
|
-
|
|
212
|
+
D(() => e.length - 1 - a);
|
|
214
213
|
} catch {
|
|
215
|
-
|
|
214
|
+
_.dismiss(), _.error("Transaction aborted"), Le?.("Transaction aborted"), T(!1);
|
|
216
215
|
return;
|
|
217
216
|
}
|
|
218
217
|
}
|
|
219
|
-
let { data: o } = await
|
|
218
|
+
let { data: o } = await ft({
|
|
220
219
|
transactions: i,
|
|
221
220
|
provider: n,
|
|
222
221
|
url: t() ?? "",
|
|
223
|
-
token:
|
|
222
|
+
token: k ?? ""
|
|
224
223
|
}), s = o.transactions?.map((e) => e.txHash).filter((e) => !!e) ?? [], c = i.map((e) => e.txHash).filter((e) => !!e);
|
|
225
|
-
|
|
224
|
+
Et(s.length > 0 ? s : c.length > 0 ? c : o.batchId ? [o.batchId] : []), T(!1);
|
|
226
225
|
} catch (e) {
|
|
227
|
-
console.error(e),
|
|
226
|
+
console.error(e), _.dismiss(), _.error("Transaction cancelled"), Le?.("Transaction cancelled"), T(!1), D(0), It(), Y(""), X("");
|
|
228
227
|
}
|
|
229
228
|
}, [
|
|
230
229
|
W,
|
|
231
230
|
St,
|
|
232
|
-
|
|
233
|
-
J,
|
|
231
|
+
Ze,
|
|
234
232
|
Y,
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
lt.signTransaction,
|
|
233
|
+
X,
|
|
234
|
+
k,
|
|
235
|
+
Et,
|
|
236
|
+
ft,
|
|
240
237
|
ut.signTransaction,
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
238
|
+
ct.signTransaction,
|
|
239
|
+
lt.signTransaction,
|
|
240
|
+
dt.signTransaction
|
|
241
|
+
]), { formik: Z, firstAmountError: kt, secondAmountError: At, fromChainError: jt, senderAddressError: Mt, receiverAddressError: Nt, confirmRateError: Q, handleBlur: $, handleChange: Pt, handleSubmit: Ft, resetSwapForm: It } = te({
|
|
242
|
+
isMvxConnected: !!b,
|
|
243
|
+
rate: P,
|
|
245
244
|
sender: K ?? "",
|
|
246
|
-
receiver:
|
|
247
|
-
firstToken:
|
|
245
|
+
receiver: b ?? "",
|
|
246
|
+
firstToken: L,
|
|
248
247
|
firstAmount: V,
|
|
249
248
|
fromChainId: G,
|
|
250
|
-
toChainId:
|
|
251
|
-
secondToken:
|
|
249
|
+
toChainId: y,
|
|
250
|
+
secondToken: R,
|
|
252
251
|
secondAmount: H,
|
|
253
|
-
setForceRefetchRate:
|
|
252
|
+
setForceRefetchRate: qe,
|
|
254
253
|
senderChainType: W?.chainType,
|
|
255
254
|
receiverChainType: r.mvx,
|
|
256
|
-
onSubmit:
|
|
257
|
-
}), Lt = !!(At || jt ||
|
|
258
|
-
|
|
255
|
+
onSubmit: Ot
|
|
256
|
+
}), Lt = !!(kt || At || jt || I || Mt || Nt || Q), Rt = h(() => V === "" ? void 0 : I ?? kt, [
|
|
257
|
+
kt,
|
|
259
258
|
V,
|
|
260
|
-
|
|
261
|
-
]), zt =
|
|
262
|
-
Mt,
|
|
259
|
+
I
|
|
260
|
+
]), zt = h(() => H === "" ? void 0 : jt ?? At, [
|
|
263
261
|
jt,
|
|
262
|
+
At,
|
|
264
263
|
H
|
|
265
264
|
]);
|
|
266
|
-
return
|
|
267
|
-
|
|
268
|
-
}, 50 * 1e3), () => clearInterval(
|
|
265
|
+
return m(() => (V || U(""), J(V), v && clearInterval(v), v = setInterval(() => {
|
|
266
|
+
J(V);
|
|
267
|
+
}, 50 * 1e3), () => clearInterval(v)), [
|
|
269
268
|
V,
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
]),
|
|
273
|
-
|
|
274
|
-
}, [
|
|
275
|
-
|
|
276
|
-
}, [
|
|
277
|
-
|
|
278
|
-
}, []),
|
|
279
|
-
|
|
280
|
-
}, [
|
|
281
|
-
ref:
|
|
269
|
+
Ke,
|
|
270
|
+
J
|
|
271
|
+
]), m(() => {
|
|
272
|
+
P?.amountOut && (Z.setFieldValue(l.secondAmount, P.amountOut), U(P.amountOut));
|
|
273
|
+
}, [P?.amountOut]), m(() => {
|
|
274
|
+
I && (Z.setFieldValue(l.secondAmount, "0"), U("0"));
|
|
275
|
+
}, [I]), m(() => {
|
|
276
|
+
x && (Z.setFieldValue(l.firstAmount, x), Y(x));
|
|
277
|
+
}, []), m(() => {
|
|
278
|
+
S && (Z.setFieldValue(l.secondAmount, S), X(S));
|
|
279
|
+
}, [S]), /* @__PURE__ */ d(xe, { children: /* @__PURE__ */ f("form", {
|
|
280
|
+
ref: Ue,
|
|
282
281
|
noValidate: !0,
|
|
283
282
|
className: "liq-flex liq-flex-col liq-gap-1 liq-relative",
|
|
284
283
|
autoComplete: "off",
|
|
285
284
|
onSubmit: Ft,
|
|
286
285
|
children: [
|
|
287
|
-
|
|
288
|
-
mvxAddress:
|
|
289
|
-
onClose:
|
|
286
|
+
Pe && /* @__PURE__ */ d(me, {
|
|
287
|
+
mvxAddress: b,
|
|
288
|
+
onClose: wt
|
|
290
289
|
}),
|
|
291
|
-
/* @__PURE__ */
|
|
290
|
+
/* @__PURE__ */ f(o, {
|
|
292
291
|
className: i("liq-pb-8 liq-pt-6 hover:liq-bg-neutral-700/50 sm:liq-pb-6", {
|
|
293
|
-
"liq-pointer-events-none":
|
|
294
|
-
"focus-within:liq-outline-neutral-700/75 hover:liq-outline-neutral-700/55 hover:focus-within:liq-outline-neutral-700/80": !
|
|
292
|
+
"liq-pointer-events-none": C,
|
|
293
|
+
"focus-within:liq-outline-neutral-700/75 hover:liq-outline-neutral-700/55 hover:focus-within:liq-outline-neutral-700/80": !C
|
|
295
294
|
}),
|
|
296
295
|
children: [
|
|
297
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ f("div", {
|
|
298
297
|
className: "liq-flex liq-items-center liq-gap-1",
|
|
299
|
-
children: [/* @__PURE__ */
|
|
300
|
-
disabled:
|
|
298
|
+
children: [/* @__PURE__ */ d("span", { children: "From" }), /* @__PURE__ */ d(_e, {
|
|
299
|
+
disabled: F,
|
|
301
300
|
activeChain: W
|
|
302
301
|
})]
|
|
303
302
|
}),
|
|
304
|
-
|
|
303
|
+
Mt && /* @__PURE__ */ d("div", {
|
|
305
304
|
className: "liq-text-red-400 liq-text-xs liq-mt-1",
|
|
306
|
-
children:
|
|
305
|
+
children: Mt
|
|
307
306
|
}),
|
|
308
|
-
/* @__PURE__ */
|
|
307
|
+
/* @__PURE__ */ f("div", {
|
|
309
308
|
className: "liq-flex liq-justify-between liq-gap-1",
|
|
310
|
-
children: [/* @__PURE__ */
|
|
309
|
+
children: [/* @__PURE__ */ d(s, {
|
|
311
310
|
inputName: "firstAmount",
|
|
312
|
-
inputValue:
|
|
311
|
+
inputValue: Z.values.firstAmount,
|
|
313
312
|
amountError: Rt,
|
|
314
313
|
disabled: !1,
|
|
315
|
-
onInputDebounceChange:
|
|
314
|
+
onInputDebounceChange: Y,
|
|
316
315
|
onInputChange: Pt,
|
|
317
316
|
onBlur: $
|
|
318
|
-
}), /* @__PURE__ */
|
|
317
|
+
}), /* @__PURE__ */ d(be, {
|
|
319
318
|
name: "firstToken",
|
|
320
|
-
disabled:
|
|
321
|
-
options:
|
|
322
|
-
areOptionsLoading:
|
|
319
|
+
disabled: F,
|
|
320
|
+
options: z,
|
|
321
|
+
areOptionsLoading: M,
|
|
323
322
|
isMvxSelector: yt,
|
|
324
323
|
isDestination: !1,
|
|
325
324
|
color: "neutral-850",
|
|
326
|
-
onChange:
|
|
325
|
+
onChange: gt,
|
|
327
326
|
onBlur: $,
|
|
328
|
-
onMaxBtnClick:
|
|
329
|
-
selectedOption:
|
|
330
|
-
onTokenSelectorDisplay: (e) =>
|
|
327
|
+
onMaxBtnClick: Tt,
|
|
328
|
+
selectedOption: L,
|
|
329
|
+
onTokenSelectorDisplay: (e) => Ge(e)
|
|
331
330
|
})]
|
|
332
331
|
})
|
|
333
332
|
]
|
|
334
333
|
}),
|
|
335
|
-
/* @__PURE__ */
|
|
334
|
+
/* @__PURE__ */ d("div", {
|
|
336
335
|
className: "liq-absolute liq-left-[6%] liq-top-[40%] -liq-mt-1 liq-z-10",
|
|
337
|
-
children:
|
|
336
|
+
children: $e && /* @__PURE__ */ d(ye, { onChangeDirection: Dt })
|
|
338
337
|
}),
|
|
339
|
-
/* @__PURE__ */
|
|
340
|
-
className: i("liq-pb-8 liq-pt-6 hover:liq-bg-neutral-700/50 sm:liq-pb-6", { "liq-pointer-events-none":
|
|
338
|
+
/* @__PURE__ */ f(o, {
|
|
339
|
+
className: i("liq-pb-8 liq-pt-6 hover:liq-bg-neutral-700/50 sm:liq-pb-6", { "liq-pointer-events-none": C }),
|
|
341
340
|
children: [
|
|
342
|
-
/* @__PURE__ */
|
|
341
|
+
/* @__PURE__ */ f("div", {
|
|
343
342
|
className: "liq-flex liq-items-center liq-gap-1",
|
|
344
|
-
children: [/* @__PURE__ */
|
|
345
|
-
accountAddress:
|
|
346
|
-
chainIcon: n(
|
|
347
|
-
username:
|
|
348
|
-
accountExplorerUrl: `${
|
|
343
|
+
children: [/* @__PURE__ */ d("span", { children: "To" }), /* @__PURE__ */ d(ve, {
|
|
344
|
+
accountAddress: b,
|
|
345
|
+
chainIcon: n(N?.pngUrl),
|
|
346
|
+
username: ke,
|
|
347
|
+
accountExplorerUrl: `${Qe.mvxExplorerAddress}/accounts/${b}`,
|
|
349
348
|
showTag: !0,
|
|
350
|
-
onDisconnect:
|
|
351
|
-
onConnect:
|
|
349
|
+
onDisconnect: Be,
|
|
350
|
+
onConnect: ze
|
|
352
351
|
})]
|
|
353
352
|
}),
|
|
354
|
-
|
|
353
|
+
Nt && /* @__PURE__ */ d("div", {
|
|
355
354
|
className: "liq-text-red-400 liq-text-xs liq-mt-1",
|
|
356
|
-
children:
|
|
355
|
+
children: Nt
|
|
357
356
|
}),
|
|
358
|
-
Q && /* @__PURE__ */
|
|
357
|
+
Q && /* @__PURE__ */ d("div", {
|
|
359
358
|
className: "liq-text-red-400 liq-text-xs liq-mt-1",
|
|
360
359
|
children: Q
|
|
361
360
|
}),
|
|
362
|
-
/* @__PURE__ */
|
|
361
|
+
/* @__PURE__ */ f("div", {
|
|
363
362
|
className: "liq-flex liq-justify-between liq-gap-1",
|
|
364
|
-
children: [/* @__PURE__ */
|
|
363
|
+
children: [/* @__PURE__ */ d(s, {
|
|
365
364
|
inputName: "secondAmount",
|
|
366
|
-
inputValue:
|
|
365
|
+
inputValue: Z.values.secondAmount,
|
|
367
366
|
amountError: zt,
|
|
368
367
|
disabled: !1,
|
|
369
|
-
onInputDebounceChange:
|
|
368
|
+
onInputDebounceChange: X,
|
|
370
369
|
onInputChange: Pt,
|
|
371
370
|
onBlur: $
|
|
372
|
-
}), /* @__PURE__ */
|
|
371
|
+
}), /* @__PURE__ */ d(be, {
|
|
373
372
|
name: "secondToken",
|
|
374
|
-
disabled:
|
|
373
|
+
disabled: F,
|
|
375
374
|
omitDisableClass: !0,
|
|
376
|
-
options:
|
|
377
|
-
areOptionsLoading:
|
|
375
|
+
options: ht,
|
|
376
|
+
areOptionsLoading: M,
|
|
378
377
|
isMvxSelector: bt,
|
|
379
378
|
color: "neutral-850",
|
|
380
379
|
onChange: _t,
|
|
381
380
|
onBlur: $,
|
|
382
|
-
selectedOption:
|
|
381
|
+
selectedOption: R
|
|
383
382
|
})]
|
|
384
383
|
})
|
|
385
384
|
]
|
|
386
385
|
}),
|
|
387
|
-
/* @__PURE__ */
|
|
386
|
+
/* @__PURE__ */ f("div", {
|
|
388
387
|
className: "liq-flex liq-items-center liq-justify-center",
|
|
389
388
|
children: [
|
|
390
|
-
!
|
|
391
|
-
mvxAccountAddress:
|
|
392
|
-
icon: n(
|
|
393
|
-
onClick:
|
|
389
|
+
!b && /* @__PURE__ */ d(ge, {
|
|
390
|
+
mvxAccountAddress: b,
|
|
391
|
+
icon: n(N?.pngUrl),
|
|
392
|
+
onClick: ze
|
|
394
393
|
}),
|
|
395
|
-
|
|
394
|
+
b && !Ct && /* @__PURE__ */ d(he, {
|
|
396
395
|
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",
|
|
397
|
-
disabled:
|
|
396
|
+
disabled: F,
|
|
398
397
|
activeChain: W
|
|
399
398
|
}),
|
|
400
|
-
|
|
399
|
+
b && Ct && /* @__PURE__ */ f(a, {
|
|
401
400
|
type: "submit",
|
|
402
401
|
variant: "neutral-850",
|
|
403
402
|
className: "liq-w-full disabled:liq-bg-neutral-850/50 liq-py-3 hover:enabled:liq-bg-primary !liq-text-primary-200",
|
|
404
|
-
disabled: !q ||
|
|
403
|
+
disabled: !q || F || !b || !K || Lt || w,
|
|
405
404
|
children: [
|
|
406
|
-
q && !
|
|
405
|
+
q && !w && /* @__PURE__ */ f("div", {
|
|
407
406
|
className: "liq-flex liq-justify-center liq-items-center liq-gap-2",
|
|
408
407
|
children: [
|
|
409
|
-
/* @__PURE__ */
|
|
410
|
-
/* @__PURE__ */
|
|
411
|
-
src: n(
|
|
408
|
+
/* @__PURE__ */ d("div", { children: "Deposit on " }),
|
|
409
|
+
/* @__PURE__ */ d("img", {
|
|
410
|
+
src: n(N?.pngUrl),
|
|
412
411
|
alt: "",
|
|
413
412
|
className: "liq-h-[1.5rem] liq-w-[1.5rem] liq-rounded-lg"
|
|
414
413
|
}),
|
|
415
|
-
/* @__PURE__ */
|
|
414
|
+
/* @__PURE__ */ d("div", { children: "MultiversX" })
|
|
416
415
|
]
|
|
417
416
|
}),
|
|
418
|
-
!q && !
|
|
417
|
+
!q && !w && /* @__PURE__ */ d("span", {
|
|
419
418
|
className: "liq-text-neutral-100",
|
|
420
419
|
children: "Enter amount"
|
|
421
420
|
}),
|
|
422
|
-
|
|
421
|
+
w && /* @__PURE__ */ f("div", {
|
|
423
422
|
className: "liq-flex liq-justify-center liq-items-center liq-gap-2",
|
|
424
423
|
children: [
|
|
425
|
-
/* @__PURE__ */
|
|
426
|
-
icon:
|
|
424
|
+
/* @__PURE__ */ d(Ce, {
|
|
425
|
+
icon: Ee,
|
|
427
426
|
spin: !0,
|
|
428
427
|
className: "liq-mx-1 liq-flex liq-items-center"
|
|
429
428
|
}),
|
|
430
|
-
/* @__PURE__ */
|
|
431
|
-
/* @__PURE__ */
|
|
432
|
-
src: n(
|
|
429
|
+
/* @__PURE__ */ d("div", { children: "Depositing on" }),
|
|
430
|
+
/* @__PURE__ */ d("img", {
|
|
431
|
+
src: n(N?.pngUrl),
|
|
433
432
|
alt: "",
|
|
434
433
|
className: "liq-h-[1.5rem] liq-w-[1.5rem] liq-rounded-lg"
|
|
435
434
|
}),
|
|
436
|
-
/* @__PURE__ */
|
|
435
|
+
/* @__PURE__ */ d("div", { children: "MultiversX" })
|
|
437
436
|
]
|
|
438
437
|
})
|
|
439
438
|
]
|
|
440
439
|
})
|
|
441
440
|
]
|
|
442
441
|
}),
|
|
443
|
-
K &&
|
|
442
|
+
K && E > 0 && /* @__PURE__ */ d("div", {
|
|
444
443
|
className: "liq-flex liq-items-center liq-justify-center liq-text-neutral-300 liq-text-sm",
|
|
445
|
-
children: /* @__PURE__ */
|
|
444
|
+
children: /* @__PURE__ */ f("div", { children: [
|
|
446
445
|
"You will be asked to sign ",
|
|
447
|
-
|
|
446
|
+
E,
|
|
448
447
|
" ",
|
|
449
|
-
|
|
448
|
+
E > 1 ? "transactions" : "transaction",
|
|
450
449
|
" ",
|
|
451
450
|
"on your wallet"
|
|
452
451
|
] })
|
|
@@ -455,4 +454,4 @@ var _, v = ({ mvxChainId: v, mvxAddress: y, username: Ae, callbackRoute: je = "/
|
|
|
455
454
|
}) });
|
|
456
455
|
};
|
|
457
456
|
//#endregion
|
|
458
|
-
export {
|
|
457
|
+
export { y as Deposit };
|