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