@multiversx/sdk-dapp-liquidity 2.1.0 → 2.1.1-alpha.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/helpers/index.d.ts +1 -0
- package/helpers/index.js +1 -1
- package/helpers/index.mjs +18 -16
- package/helpers/isValidAddressForChainType.d.ts +3 -0
- package/helpers/isValidAddressForChainType.js +2 -0
- package/helpers/isValidAddressForChainType.mjs +37 -0
- package/helpers/tests/isValidAddressForChainType.spec.d.ts +1 -0
- package/helpers/tests/isValidAddressForChainType.spec.js +2 -0
- package/helpers/tests/isValidAddressForChainType.spec.mjs +102 -0
- package/index.js +1 -1
- package/index.mjs +162 -160
- package/package.json +3 -2
- package/reactjs/components/BridgeForm/Deposit.js +1 -1
- package/reactjs/components/BridgeForm/Deposit.mjs +269 -260
- package/reactjs/components/BridgeForm/Transfer.js +1 -1
- package/reactjs/components/BridgeForm/Transfer.mjs +210 -201
- package/reactjs/components/BridgeHistory/BridgeHistory.js +1 -1
- package/reactjs/components/BridgeHistory/BridgeHistory.mjs +5 -3
- package/reactjs/components/Connect/BridgeConnectButton.js +1 -1
- package/reactjs/components/Connect/BridgeConnectButton.mjs +17 -14
- package/reactjs/hooks/useBridgeFormik.d.ts +6 -1
- package/reactjs/hooks/useBridgeFormik.js +1 -1
- package/reactjs/hooks/useBridgeFormik.mjs +94 -85
- package/reactjs/queries/useGetNonMvxTokensBalances.query.js +1 -1
- package/reactjs/queries/useGetNonMvxTokensBalances.query.mjs +11 -9
- package/style.css +1 -1
|
@@ -1,38 +1,41 @@
|
|
|
1
|
-
import { jsx as r, Fragment as
|
|
2
|
-
import { formatAmount as
|
|
3
|
-
import { useAppKitNetwork as
|
|
4
|
-
import
|
|
5
|
-
import { useRef as
|
|
6
|
-
import { toast as
|
|
7
|
-
import { useBridgeTokenSelection as
|
|
8
|
-
import { MVX_CHAIN_IDS as
|
|
9
|
-
import { getApiURL as
|
|
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
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
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
|
|
22
|
+
import { useAccount as Ci } from "../../hooks/useAccount.mjs";
|
|
19
23
|
import "axios";
|
|
20
|
-
import { useBridgeFormik as
|
|
21
|
-
import { useFetchBridgeData as
|
|
22
|
-
import { useBridgeApiChainId as
|
|
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
|
|
25
|
-
import { useSendTransactions as
|
|
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
|
|
31
|
-
import { useGetRateMutation as
|
|
32
|
-
import { mxClsx as
|
|
33
|
-
import { AmountCard as
|
|
34
|
-
import { AmountInput as
|
|
35
|
-
import { MxButton as
|
|
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
|
|
46
|
-
import { BridgeConnectButton as
|
|
47
|
-
import { MvxConnectButton as
|
|
48
|
-
import { BridgeAccountDisplay as
|
|
49
|
-
import { MvxAccountDisplay as
|
|
50
|
-
import { ToggleDirection as
|
|
51
|
-
import { TokenSelector as
|
|
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
|
|
56
|
+
const Ft = ({
|
|
54
57
|
mvxChainId: D,
|
|
55
58
|
mvxAddress: o,
|
|
56
|
-
username:
|
|
57
|
-
callbackRoute:
|
|
58
|
-
firstTokenIdentifier:
|
|
59
|
+
username: Ie,
|
|
60
|
+
callbackRoute: xe = "/",
|
|
61
|
+
firstTokenIdentifier: Ae,
|
|
59
62
|
secondTokenIdentifier: Be,
|
|
60
|
-
firstTokenAmount:
|
|
61
|
-
secondTokenAmount:
|
|
62
|
-
refetchTrigger:
|
|
63
|
-
showHistory:
|
|
64
|
-
forcedDestinationTokenSymbol:
|
|
65
|
-
onSuccessfullySentTransaction:
|
|
63
|
+
firstTokenAmount: E,
|
|
64
|
+
secondTokenAmount: x,
|
|
65
|
+
refetchTrigger: Ne,
|
|
66
|
+
showHistory: we,
|
|
67
|
+
forcedDestinationTokenSymbol: ye,
|
|
68
|
+
onSuccessfullySentTransaction: u,
|
|
66
69
|
onFailedSentTransaction: f,
|
|
67
|
-
onHistoryClose:
|
|
68
|
-
onMvxConnect:
|
|
69
|
-
onMvxDisconnect:
|
|
70
|
-
onNavigate:
|
|
71
|
-
onChangeDirection:
|
|
70
|
+
onHistoryClose: O,
|
|
71
|
+
onMvxConnect: ee,
|
|
72
|
+
onMvxDisconnect: De,
|
|
73
|
+
onNavigate: Ee,
|
|
74
|
+
onChangeDirection: Oe
|
|
72
75
|
}) => {
|
|
73
|
-
var
|
|
74
|
-
const
|
|
75
|
-
options:
|
|
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:
|
|
78
|
-
bridgeOnly:
|
|
79
|
-
} =
|
|
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
|
-
} =
|
|
84
|
-
evmTokensWithBalances:
|
|
85
|
-
mvxTokensWithBalances:
|
|
86
|
-
isTokensLoading:
|
|
87
|
-
isLoadingEvmTokensBalances:
|
|
86
|
+
} = ge(), {
|
|
87
|
+
evmTokensWithBalances: Ue,
|
|
88
|
+
mvxTokensWithBalances: je,
|
|
89
|
+
isTokensLoading: Pe,
|
|
90
|
+
isLoadingEvmTokensBalances: We,
|
|
88
91
|
isLoadingMvxTokensBalances: ke,
|
|
89
|
-
chains:
|
|
90
|
-
isChainsLoading:
|
|
91
|
-
} =
|
|
92
|
-
refetchTrigger:
|
|
92
|
+
chains: B = [],
|
|
93
|
+
isChainsLoading: Ge
|
|
94
|
+
} = xi({
|
|
95
|
+
refetchTrigger: Ne,
|
|
93
96
|
mvxAddress: o,
|
|
94
|
-
mvxApiURL:
|
|
95
|
-
}), $ =
|
|
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
|
-
), [
|
|
98
|
-
mutate:
|
|
100
|
+
), [k, B]), {
|
|
101
|
+
mutate: _e,
|
|
99
102
|
data: n,
|
|
100
103
|
isPending: N,
|
|
101
104
|
error: q
|
|
102
|
-
} =
|
|
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
|
-
(
|
|
108
|
+
(ci) => T(ci.id, e.id)
|
|
106
109
|
);
|
|
107
|
-
v &&
|
|
110
|
+
v && ne(v);
|
|
108
111
|
},
|
|
109
|
-
[A,
|
|
112
|
+
[A, ne]
|
|
110
113
|
), {
|
|
111
114
|
firstToken: i,
|
|
112
115
|
secondToken: t,
|
|
113
|
-
fromOptions:
|
|
114
|
-
toOptions:
|
|
116
|
+
fromOptions: ze,
|
|
117
|
+
toOptions: He,
|
|
115
118
|
selectedChainOption: y,
|
|
116
|
-
onChangeFirstSelect:
|
|
117
|
-
onChangeSecondSelect:
|
|
118
|
-
handleChangeDirection:
|
|
119
|
-
} =
|
|
120
|
-
chains:
|
|
121
|
-
activeChain:
|
|
119
|
+
onChangeFirstSelect: Ke,
|
|
120
|
+
onChangeSecondSelect: Xe,
|
|
121
|
+
handleChangeDirection: Ye
|
|
122
|
+
} = fi({
|
|
123
|
+
chains: B,
|
|
124
|
+
activeChain: Qe,
|
|
122
125
|
sdkChains: A,
|
|
123
|
-
switchNetwork:
|
|
124
|
-
fromTokens:
|
|
125
|
-
toTokens:
|
|
126
|
-
firstTokenIdentifier:
|
|
126
|
+
switchNetwork: $e,
|
|
127
|
+
fromTokens: je,
|
|
128
|
+
toTokens: Ue,
|
|
129
|
+
firstTokenIdentifier: Ae,
|
|
127
130
|
secondTokenIdentifier: Be,
|
|
128
|
-
forcedDestinationTokenSymbol:
|
|
131
|
+
forcedDestinationTokenSymbol: ye,
|
|
129
132
|
isTokensLoading: $,
|
|
130
133
|
mvxChainId: D,
|
|
131
|
-
callbackRoute:
|
|
132
|
-
onNavigate:
|
|
133
|
-
}),
|
|
134
|
-
|
|
135
|
-
}, [
|
|
136
|
-
(e) =>
|
|
137
|
-
) ?? y : y, [t == null ? void 0 : t.chainId,
|
|
138
|
-
() =>
|
|
139
|
-
[t == null ? void 0 : t.chainId,
|
|
140
|
-
),
|
|
141
|
-
|
|
142
|
-
!e || !Number(e) || !
|
|
143
|
-
nativeAuthToken:
|
|
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
|
-
|
|
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 =
|
|
161
|
-
|
|
162
|
-
}, []), b =
|
|
163
|
+
), d = p((e) => {
|
|
164
|
+
Ze(() => e);
|
|
165
|
+
}, []), b = p((e) => {
|
|
163
166
|
R(() => e);
|
|
164
|
-
}, []),
|
|
165
|
-
|
|
166
|
-
}, [
|
|
167
|
-
const e =
|
|
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]),
|
|
177
|
+
}, [i == null ? void 0 : i.balance, i == null ? void 0 : i.decimals, d]), ti = p(
|
|
175
178
|
async (e) => {
|
|
176
|
-
d(""), b(""),
|
|
179
|
+
d(""), b(""), oe(), oe(), u == null || u(e);
|
|
177
180
|
},
|
|
178
181
|
[
|
|
179
182
|
d,
|
|
180
183
|
b,
|
|
181
|
-
|
|
184
|
+
u
|
|
182
185
|
]
|
|
183
|
-
),
|
|
186
|
+
), ri = p(
|
|
184
187
|
async ({ transactions: e }) => {
|
|
185
|
-
|
|
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),
|
|
192
|
+
await G(e), re(e);
|
|
190
193
|
} catch (v) {
|
|
191
|
-
console.error(v),
|
|
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
|
-
|
|
198
|
+
ce,
|
|
196
199
|
d,
|
|
197
200
|
b,
|
|
198
|
-
|
|
199
|
-
|
|
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:
|
|
209
|
-
handleSubmit:
|
|
210
|
-
resetSwapForm:
|
|
211
|
-
} =
|
|
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:
|
|
220
|
+
receiver: l.address ?? "",
|
|
216
221
|
firstToken: i,
|
|
217
|
-
firstAmount:
|
|
222
|
+
firstAmount: c,
|
|
218
223
|
fromChainId: D,
|
|
219
224
|
toChainId: V,
|
|
220
225
|
secondToken: t,
|
|
221
|
-
secondAmount:
|
|
222
|
-
setForceRefetchRate:
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
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
|
-
|
|
239
|
+
E && (h.setFieldValue(
|
|
233
240
|
F.firstAmount,
|
|
234
|
-
|
|
235
|
-
), d(
|
|
241
|
+
E
|
|
242
|
+
), d(E));
|
|
236
243
|
}, []), I(() => {
|
|
237
|
-
|
|
244
|
+
x && (h.setFieldValue(
|
|
238
245
|
F.secondAmount,
|
|
239
|
-
|
|
240
|
-
), b(
|
|
241
|
-
}, [
|
|
246
|
+
x
|
|
247
|
+
), b(x));
|
|
248
|
+
}, [x]), I(() => {
|
|
242
249
|
if (_)
|
|
243
250
|
try {
|
|
244
251
|
const e = _;
|
|
245
|
-
|
|
246
|
-
transactions:
|
|
252
|
+
le({
|
|
253
|
+
transactions: te.map((v) => ({
|
|
247
254
|
...v,
|
|
248
255
|
txHash: e,
|
|
249
|
-
receiver:
|
|
256
|
+
receiver: l.address
|
|
250
257
|
})),
|
|
251
|
-
provider: (n == null ? void 0 : n.provider) ??
|
|
252
|
-
url:
|
|
253
|
-
token:
|
|
254
|
-
}),
|
|
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(),
|
|
268
|
+
Q == null || Q(), re([]);
|
|
262
269
|
}
|
|
263
270
|
}, [
|
|
264
271
|
_,
|
|
265
|
-
|
|
272
|
+
te,
|
|
266
273
|
n == null ? void 0 : n.provider,
|
|
267
|
-
|
|
268
|
-
]), /* @__PURE__ */ r(
|
|
274
|
+
le
|
|
275
|
+
]), /* @__PURE__ */ r(di, { children: /* @__PURE__ */ s(
|
|
269
276
|
"form",
|
|
270
277
|
{
|
|
271
|
-
ref:
|
|
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:
|
|
282
|
+
onSubmit: ni,
|
|
276
283
|
children: [
|
|
277
|
-
|
|
278
|
-
/* @__PURE__ */
|
|
279
|
-
|
|
284
|
+
we && /* @__PURE__ */ r(Ei, { mvxAddress: o, onClose: ei }),
|
|
285
|
+
/* @__PURE__ */ s(
|
|
286
|
+
be,
|
|
280
287
|
{
|
|
281
|
-
className:
|
|
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__ */
|
|
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
|
-
|
|
299
|
+
Vi,
|
|
293
300
|
{
|
|
294
301
|
accountAddress: o,
|
|
295
|
-
chainIcon:
|
|
296
|
-
username:
|
|
297
|
-
accountExplorerUrl: `${
|
|
302
|
+
chainIcon: S(g == null ? void 0 : g.pngUrl),
|
|
303
|
+
username: Ie,
|
|
304
|
+
accountExplorerUrl: `${ae.mvxExplorerAddress}/accounts/${o}`,
|
|
298
305
|
showTag: !0,
|
|
299
|
-
onDisconnect:
|
|
300
|
-
onConnect:
|
|
306
|
+
onDisconnect: De,
|
|
307
|
+
onConnect: ee
|
|
301
308
|
}
|
|
302
309
|
)
|
|
303
310
|
] }),
|
|
304
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
314
|
+
ve,
|
|
307
315
|
{
|
|
308
316
|
inputName: "firstAmount",
|
|
309
317
|
inputValue: h.values.firstAmount,
|
|
310
|
-
amountError:
|
|
318
|
+
amountError: si,
|
|
311
319
|
disabled: !1,
|
|
312
320
|
onInputDebounceChange: d,
|
|
313
|
-
onInputChange:
|
|
321
|
+
onInputChange: me,
|
|
314
322
|
onBlur: L
|
|
315
323
|
}
|
|
316
324
|
),
|
|
317
325
|
/* @__PURE__ */ r(
|
|
318
|
-
|
|
326
|
+
Ce,
|
|
319
327
|
{
|
|
320
328
|
name: "firstToken",
|
|
321
329
|
disabled: N,
|
|
322
|
-
options:
|
|
330
|
+
options: ze,
|
|
323
331
|
areOptionsLoading: $,
|
|
324
|
-
isMvxSelector:
|
|
332
|
+
isMvxSelector: Se,
|
|
325
333
|
isDestination: !1,
|
|
326
334
|
color: "neutral-850",
|
|
327
|
-
onChange:
|
|
335
|
+
onChange: Ke,
|
|
328
336
|
onBlur: L,
|
|
329
|
-
onMaxBtnClick:
|
|
337
|
+
onMaxBtnClick: ii,
|
|
330
338
|
selectedOption: i,
|
|
331
|
-
onTokenSelectorDisplay: (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:
|
|
339
|
-
/* @__PURE__ */
|
|
340
|
-
|
|
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:
|
|
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__ */
|
|
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
|
-
|
|
360
|
+
Ri,
|
|
353
361
|
{
|
|
354
362
|
disabled: N,
|
|
355
|
-
activeChain:
|
|
363
|
+
activeChain: a
|
|
356
364
|
}
|
|
357
365
|
)
|
|
358
366
|
] }),
|
|
359
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
370
|
+
ve,
|
|
362
371
|
{
|
|
363
372
|
inputName: "secondAmount",
|
|
364
373
|
inputValue: h.values.secondAmount,
|
|
365
|
-
amountError:
|
|
374
|
+
amountError: li,
|
|
366
375
|
disabled: !1,
|
|
367
376
|
onInputDebounceChange: b,
|
|
368
|
-
onInputChange:
|
|
377
|
+
onInputChange: me,
|
|
369
378
|
onBlur: L
|
|
370
379
|
}
|
|
371
380
|
),
|
|
372
381
|
/* @__PURE__ */ r(
|
|
373
|
-
|
|
382
|
+
Ce,
|
|
374
383
|
{
|
|
375
384
|
name: "secondToken",
|
|
376
385
|
disabled: N,
|
|
377
386
|
omitDisableClass: !0,
|
|
378
|
-
options:
|
|
387
|
+
options: He,
|
|
379
388
|
areOptionsLoading: $,
|
|
380
|
-
isMvxSelector:
|
|
389
|
+
isMvxSelector: Te,
|
|
381
390
|
color: "neutral-850",
|
|
382
|
-
onChange:
|
|
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__ */
|
|
400
|
+
/* @__PURE__ */ s("div", { className: "liq-flex liq-items-center liq-justify-center", children: [
|
|
392
401
|
!o && /* @__PURE__ */ r(
|
|
393
|
-
|
|
402
|
+
Mi,
|
|
394
403
|
{
|
|
395
404
|
mvxAccountAddress: o,
|
|
396
|
-
icon:
|
|
397
|
-
onClick:
|
|
405
|
+
icon: S(g == null ? void 0 : g.pngUrl),
|
|
406
|
+
onClick: ee
|
|
398
407
|
}
|
|
399
408
|
),
|
|
400
|
-
o && !
|
|
401
|
-
|
|
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:
|
|
414
|
+
activeChain: a
|
|
406
415
|
}
|
|
407
416
|
),
|
|
408
|
-
o &&
|
|
409
|
-
|
|
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 || !
|
|
424
|
+
disabled: !z || N || !o || !l.address || ai,
|
|
416
425
|
children: [
|
|
417
|
-
z && /* @__PURE__ */
|
|
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:
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
445
|
+
P,
|
|
437
446
|
" ",
|
|
438
|
-
|
|
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
|
-
|
|
456
|
+
Ft as Transfer
|
|
448
457
|
};
|