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