@trustware/sdk-staging 1.1.13-staging.1 → 1.1.13-staging.2
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/dist/constants.cjs +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/core.cjs +1 -1
- package/dist/core.mjs +1 -1
- package/dist/index.cjs +522 -460
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +460 -399
- package/dist/index.mjs.map +1 -1
- package/dist/smart-account.cjs +1 -1
- package/dist/smart-account.mjs +1 -1
- package/dist/wallet.cjs +1 -1
- package/dist/wallet.mjs +1 -1
- package/dist/widget.cjs +522 -460
- package/dist/widget.cjs.map +1 -1
- package/dist/widget.mjs +462 -401
- package/dist/widget.mjs.map +1 -1
- package/package.json +1 -1
package/dist/widget.mjs
CHANGED
|
@@ -571,7 +571,7 @@ var init_constants = __esm({
|
|
|
571
571
|
"src/constants.ts"() {
|
|
572
572
|
"use strict";
|
|
573
573
|
SDK_NAME = "@trustware/sdk";
|
|
574
|
-
SDK_VERSION = "1.1.13-staging.
|
|
574
|
+
SDK_VERSION = "1.1.13-staging.2";
|
|
575
575
|
API_ROOT = "https://bv-staging-api.trustware.io";
|
|
576
576
|
GTM_ID = "GTM-TZDGNCXB";
|
|
577
577
|
API_PREFIX = "/api";
|
|
@@ -6042,7 +6042,7 @@ var init_failure = __esm({
|
|
|
6042
6042
|
});
|
|
6043
6043
|
|
|
6044
6044
|
// src/hooks/useGTM.ts
|
|
6045
|
-
import { useEffect as useEffect5,
|
|
6045
|
+
import { useEffect as useEffect5, useCallback as useCallback2 } from "react";
|
|
6046
6046
|
function isGA4Allowed() {
|
|
6047
6047
|
try {
|
|
6048
6048
|
return Trustware.getConfig().features.shouldAllowGA4;
|
|
@@ -6111,7 +6111,6 @@ function useGTMTracker() {
|
|
|
6111
6111
|
return { trackEvent, trackPageView, setUserProperty, directGtag };
|
|
6112
6112
|
}
|
|
6113
6113
|
function useGTM(gtmId) {
|
|
6114
|
-
const scriptRef = useRef2(null);
|
|
6115
6114
|
const tracker = useGTMTracker();
|
|
6116
6115
|
useEffect5(() => {
|
|
6117
6116
|
if (!isGA4Allowed()) {
|
|
@@ -6126,14 +6125,24 @@ function useGTM(gtmId) {
|
|
|
6126
6125
|
);
|
|
6127
6126
|
return;
|
|
6128
6127
|
}
|
|
6129
|
-
|
|
6128
|
+
containerRefCount += 1;
|
|
6129
|
+
const release = () => {
|
|
6130
|
+
containerRefCount -= 1;
|
|
6131
|
+
if (containerRefCount > 0) return;
|
|
6132
|
+
if (injectedScript) {
|
|
6133
|
+
injectedScript.parentNode?.removeChild(injectedScript);
|
|
6134
|
+
injectedScript = null;
|
|
6135
|
+
}
|
|
6136
|
+
isContainerInitialized = false;
|
|
6137
|
+
};
|
|
6138
|
+
if (isContainerInitialized) return release;
|
|
6130
6139
|
const alreadyLoaded = document.querySelector(
|
|
6131
6140
|
`script[src*="googletagmanager.com/gtm.js?id=${gtmId}"]`
|
|
6132
6141
|
);
|
|
6133
6142
|
if (alreadyLoaded) {
|
|
6134
6143
|
window.dataLayer = window.dataLayer || [];
|
|
6135
6144
|
isContainerInitialized = true;
|
|
6136
|
-
return;
|
|
6145
|
+
return release;
|
|
6137
6146
|
}
|
|
6138
6147
|
window.dataLayer = window.dataLayer || [];
|
|
6139
6148
|
window.dataLayer.push({
|
|
@@ -6145,15 +6154,9 @@ function useGTM(gtmId) {
|
|
|
6145
6154
|
script.async = true;
|
|
6146
6155
|
script.src = `https://www.googletagmanager.com/gtm.js?id=${gtmId}`;
|
|
6147
6156
|
firstScript.parentNode?.insertBefore(script, firstScript);
|
|
6148
|
-
|
|
6157
|
+
injectedScript = script;
|
|
6149
6158
|
isContainerInitialized = true;
|
|
6150
|
-
return
|
|
6151
|
-
if (scriptRef.current) {
|
|
6152
|
-
scriptRef.current.parentNode?.removeChild(scriptRef.current);
|
|
6153
|
-
scriptRef.current = null;
|
|
6154
|
-
}
|
|
6155
|
-
isContainerInitialized = false;
|
|
6156
|
-
};
|
|
6159
|
+
return release;
|
|
6157
6160
|
}, [gtmId]);
|
|
6158
6161
|
const addNoscriptIframe = useCallback2(() => {
|
|
6159
6162
|
if (!isGA4Allowed()) return;
|
|
@@ -6171,12 +6174,14 @@ function useGTM(gtmId) {
|
|
|
6171
6174
|
}, [gtmId]);
|
|
6172
6175
|
return { ...tracker, addNoscriptIframe };
|
|
6173
6176
|
}
|
|
6174
|
-
var isContainerInitialized;
|
|
6177
|
+
var isContainerInitialized, containerRefCount, injectedScript;
|
|
6175
6178
|
var init_useGTM = __esm({
|
|
6176
6179
|
"src/hooks/useGTM.ts"() {
|
|
6177
6180
|
"use strict";
|
|
6178
6181
|
init_core2();
|
|
6179
6182
|
isContainerInitialized = false;
|
|
6183
|
+
containerRefCount = 0;
|
|
6184
|
+
injectedScript = null;
|
|
6180
6185
|
}
|
|
6181
6186
|
});
|
|
6182
6187
|
|
|
@@ -6190,7 +6195,7 @@ var init_hooks = __esm({
|
|
|
6190
6195
|
});
|
|
6191
6196
|
|
|
6192
6197
|
// src/widget/hooks/useTransactionPolling.ts
|
|
6193
|
-
import { useCallback as useCallback3, useEffect as useEffect6, useRef as
|
|
6198
|
+
import { useCallback as useCallback3, useEffect as useEffect6, useRef as useRef2, useState as useState6 } from "react";
|
|
6194
6199
|
function useTransactionPolling() {
|
|
6195
6200
|
const { setCurrentStep } = useDepositNavigation();
|
|
6196
6201
|
const { setTransactionStatus, setErrorMessage } = useDepositTransaction();
|
|
@@ -6211,11 +6216,11 @@ function useTransactionPolling() {
|
|
|
6211
6216
|
transaction: null,
|
|
6212
6217
|
receiptSubmitted: false
|
|
6213
6218
|
});
|
|
6214
|
-
const pollingRef =
|
|
6215
|
-
const timeoutRef =
|
|
6216
|
-
const abortRef =
|
|
6217
|
-
const startTimeRef =
|
|
6218
|
-
const pollCountRef =
|
|
6219
|
+
const pollingRef = useRef2(null);
|
|
6220
|
+
const timeoutRef = useRef2(null);
|
|
6221
|
+
const abortRef = useRef2(false);
|
|
6222
|
+
const startTimeRef = useRef2(0);
|
|
6223
|
+
const pollCountRef = useRef2(0);
|
|
6219
6224
|
const clearPolling = useCallback3(() => {
|
|
6220
6225
|
abortRef.current = true;
|
|
6221
6226
|
if (pollingRef.current) {
|
|
@@ -6386,7 +6391,7 @@ function useTransactionPolling() {
|
|
|
6386
6391
|
receiptSubmitted: false
|
|
6387
6392
|
});
|
|
6388
6393
|
}, [clearPolling]);
|
|
6389
|
-
const clearPollingRef =
|
|
6394
|
+
const clearPollingRef = useRef2(clearPolling);
|
|
6390
6395
|
clearPollingRef.current = clearPolling;
|
|
6391
6396
|
useEffect6(() => {
|
|
6392
6397
|
return () => {
|
|
@@ -9132,7 +9137,7 @@ var init_wallets = __esm({
|
|
|
9132
9137
|
});
|
|
9133
9138
|
|
|
9134
9139
|
// src/widget/state/deposit/useWalletTokenState.ts
|
|
9135
|
-
import { useCallback as useCallback5, useEffect as useEffect9, useRef as
|
|
9140
|
+
import { useCallback as useCallback5, useEffect as useEffect9, useRef as useRef3, useState as useState8 } from "react";
|
|
9136
9141
|
function useWalletTokenState({
|
|
9137
9142
|
walletAddress,
|
|
9138
9143
|
selectedChain,
|
|
@@ -9143,16 +9148,16 @@ function useWalletTokenState({
|
|
|
9143
9148
|
const [yourWalletTokens, setYourWalletTokens] = useState8([]);
|
|
9144
9149
|
const [yourWalletTokensLoading, setYourWalletTokensLoading] = useState8(false);
|
|
9145
9150
|
const [walletTokensReloadNonce, setWalletTokensReloadNonce] = useState8(0);
|
|
9146
|
-
const lastLoadedWalletRef =
|
|
9151
|
+
const lastLoadedWalletRef = useRef3(null);
|
|
9147
9152
|
const { tokens } = useTokens(null);
|
|
9148
9153
|
const { chains } = useChains();
|
|
9149
|
-
const selectedChainRef =
|
|
9154
|
+
const selectedChainRef = useRef3(selectedChain);
|
|
9150
9155
|
selectedChainRef.current = selectedChain;
|
|
9151
|
-
const selectedTokenRef =
|
|
9156
|
+
const selectedTokenRef = useRef3(selectedToken);
|
|
9152
9157
|
selectedTokenRef.current = selectedToken;
|
|
9153
|
-
const setSelectedChainRef =
|
|
9158
|
+
const setSelectedChainRef = useRef3(setSelectedChain);
|
|
9154
9159
|
setSelectedChainRef.current = setSelectedChain;
|
|
9155
|
-
const setSelectedTokenRef =
|
|
9160
|
+
const setSelectedTokenRef = useRef3(setSelectedToken);
|
|
9156
9161
|
setSelectedTokenRef.current = setSelectedToken;
|
|
9157
9162
|
const { address: fallbackAddress } = useWalletInfo();
|
|
9158
9163
|
const getCurrentWalletAddress = useCallback5(
|
|
@@ -10399,7 +10404,7 @@ var init_useWalletSessionState = __esm({
|
|
|
10399
10404
|
});
|
|
10400
10405
|
|
|
10401
10406
|
// src/widget/state/deposit/useWalletConnect.ts
|
|
10402
|
-
import { useCallback as useCallback10, useEffect as useEffect13, useRef as
|
|
10407
|
+
import { useCallback as useCallback10, useEffect as useEffect13, useRef as useRef4, useState as useState13 } from "react";
|
|
10403
10408
|
function useWalletConnect({
|
|
10404
10409
|
setWalletType,
|
|
10405
10410
|
setCurrentStep,
|
|
@@ -10411,7 +10416,7 @@ function useWalletConnect({
|
|
|
10411
10416
|
const ecosystem = selectedNamespace.trim().toLowerCase() === "solana" ? "solana" : "evm";
|
|
10412
10417
|
const [wcStatus, setWcStatus] = useState13("idle");
|
|
10413
10418
|
const [wcErrorMessage, setWcErrorMessage] = useState13(null);
|
|
10414
|
-
const wcTimeoutRef =
|
|
10419
|
+
const wcTimeoutRef = useRef4(null);
|
|
10415
10420
|
const clearWcTimeout = useCallback10(() => {
|
|
10416
10421
|
if (wcTimeoutRef.current !== null) {
|
|
10417
10422
|
clearTimeout(wcTimeoutRef.current);
|
|
@@ -11119,7 +11124,7 @@ var init_AmountSlider = __esm({
|
|
|
11119
11124
|
});
|
|
11120
11125
|
|
|
11121
11126
|
// src/widget/components/AmountInputDisplay.tsx
|
|
11122
|
-
import { useRef as
|
|
11127
|
+
import { useRef as useRef5, useState as useState15 } from "react";
|
|
11123
11128
|
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
11124
11129
|
function formatDisplayAmount(value) {
|
|
11125
11130
|
if (!Number.isFinite(value) || value <= 0) return "0";
|
|
@@ -11159,7 +11164,7 @@ function AmountInputDisplay({
|
|
|
11159
11164
|
inputAriaLabel = "Deposit amount"
|
|
11160
11165
|
}) {
|
|
11161
11166
|
const [isEditing, setIsEditing] = useState15(false);
|
|
11162
|
-
const inputRef =
|
|
11167
|
+
const inputRef = useRef5(null);
|
|
11163
11168
|
const handleAmountClick = () => {
|
|
11164
11169
|
if (isFixedAmount) return;
|
|
11165
11170
|
const isZeroish = !amount || parseFloat(amount) === 0;
|
|
@@ -11485,7 +11490,7 @@ var init_ConfettiEffect = __esm({
|
|
|
11485
11490
|
});
|
|
11486
11491
|
|
|
11487
11492
|
// src/widget/components/Dialog.tsx
|
|
11488
|
-
import { useEffect as useEffect15, useRef as
|
|
11493
|
+
import { useEffect as useEffect15, useRef as useRef6 } from "react";
|
|
11489
11494
|
import { Fragment, jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
11490
11495
|
var Dialog;
|
|
11491
11496
|
var init_Dialog = __esm({
|
|
@@ -11502,10 +11507,10 @@ var init_Dialog = __esm({
|
|
|
11502
11507
|
confirmText = "Close Anyway",
|
|
11503
11508
|
isDark = false
|
|
11504
11509
|
}) => {
|
|
11505
|
-
const dialogRef =
|
|
11506
|
-
const overlayRef =
|
|
11507
|
-
const firstButtonRef =
|
|
11508
|
-
const lastButtonRef =
|
|
11510
|
+
const dialogRef = useRef6(null);
|
|
11511
|
+
const overlayRef = useRef6(null);
|
|
11512
|
+
const firstButtonRef = useRef6(null);
|
|
11513
|
+
const lastButtonRef = useRef6(null);
|
|
11509
11514
|
useEffect15(() => {
|
|
11510
11515
|
const handleEscape = (e2) => {
|
|
11511
11516
|
if (e2.key === "Escape" && open) {
|
|
@@ -11850,7 +11855,7 @@ var init_TransactionHashLink = __esm({
|
|
|
11850
11855
|
});
|
|
11851
11856
|
|
|
11852
11857
|
// src/widget/components/SwipeToConfirmTokens.tsx
|
|
11853
|
-
import { useState as useState17, useRef as
|
|
11858
|
+
import { useState as useState17, useRef as useRef7, useCallback as useCallback12, useEffect as useEffect16 } from "react";
|
|
11854
11859
|
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
11855
11860
|
function SwipeToConfirmTokens({
|
|
11856
11861
|
fromToken,
|
|
@@ -11868,13 +11873,13 @@ function SwipeToConfirmTokens({
|
|
|
11868
11873
|
const [dragX, setDragX] = useState17(0);
|
|
11869
11874
|
const [isDragging, setIsDragging] = useState17(false);
|
|
11870
11875
|
const [isComplete, setIsComplete] = useState17(false);
|
|
11871
|
-
const trackRef =
|
|
11872
|
-
const thumbRef =
|
|
11876
|
+
const trackRef = useRef7(null);
|
|
11877
|
+
const thumbRef = useRef7(null);
|
|
11873
11878
|
const [isLongPressing, setIsLongPressing] = useState17(false);
|
|
11874
11879
|
const [longPressProgress, setLongPressProgress] = useState17(0);
|
|
11875
|
-
const longPressTimerRef =
|
|
11876
|
-
const longPressStartRef =
|
|
11877
|
-
const longPressAnimationRef =
|
|
11880
|
+
const longPressTimerRef = useRef7(null);
|
|
11881
|
+
const longPressStartRef = useRef7(null);
|
|
11882
|
+
const longPressAnimationRef = useRef7(null);
|
|
11878
11883
|
const LONG_PRESS_DURATION = 1500;
|
|
11879
11884
|
const thumbSize = 48;
|
|
11880
11885
|
const padding = 4;
|
|
@@ -12766,7 +12771,7 @@ var init_Toast = __esm({
|
|
|
12766
12771
|
// src/widget/components/TokenSwipePill.tsx
|
|
12767
12772
|
import React9, {
|
|
12768
12773
|
useState as useState19,
|
|
12769
|
-
useRef as
|
|
12774
|
+
useRef as useRef8,
|
|
12770
12775
|
useCallback as useCallback14,
|
|
12771
12776
|
useEffect as useEffect18,
|
|
12772
12777
|
useMemo as useMemo9
|
|
@@ -12783,8 +12788,8 @@ function TokenSwipePill({
|
|
|
12783
12788
|
}) {
|
|
12784
12789
|
const [isDragging, setIsDragging] = useState19(false);
|
|
12785
12790
|
const [dragOffset, setDragOffset] = useState19(0);
|
|
12786
|
-
const startXRef =
|
|
12787
|
-
const containerRef =
|
|
12791
|
+
const startXRef = useRef8(0);
|
|
12792
|
+
const containerRef = useRef8(null);
|
|
12788
12793
|
const currentIndex = tokens.findIndex(
|
|
12789
12794
|
(t) => normalizeAddress2(
|
|
12790
12795
|
t.address,
|
|
@@ -14114,7 +14119,7 @@ var init_ErrorPage = __esm({
|
|
|
14114
14119
|
});
|
|
14115
14120
|
|
|
14116
14121
|
// src/widget/components/ImageLoader.tsx
|
|
14117
|
-
import { useCallback as useCallback15, useEffect as useEffect20, useMemo as useMemo11, useRef as
|
|
14122
|
+
import { useCallback as useCallback15, useEffect as useEffect20, useMemo as useMemo11, useRef as useRef9, useState as useState21 } from "react";
|
|
14118
14123
|
import { jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
14119
14124
|
function Skeleton({
|
|
14120
14125
|
background,
|
|
@@ -14146,10 +14151,10 @@ function ImageLoader({
|
|
|
14146
14151
|
const [status, setStatus] = useState21("idle");
|
|
14147
14152
|
const [attempt, setAttempt] = useState21(0);
|
|
14148
14153
|
const [srcIsEmpty, setSrcIsEmpty] = useState21(false);
|
|
14149
|
-
const imgRef =
|
|
14150
|
-
const observerRef =
|
|
14151
|
-
const onLoadRef =
|
|
14152
|
-
const onErrorRef =
|
|
14154
|
+
const imgRef = useRef9(null);
|
|
14155
|
+
const observerRef = useRef9(null);
|
|
14156
|
+
const onLoadRef = useRef9(onLoad);
|
|
14157
|
+
const onErrorRef = useRef9(onError);
|
|
14153
14158
|
useEffect20(() => {
|
|
14154
14159
|
onLoadRef.current = onLoad;
|
|
14155
14160
|
onErrorRef.current = onError;
|
|
@@ -17263,7 +17268,7 @@ var init_WalletNamespaceTabs = __esm({
|
|
|
17263
17268
|
});
|
|
17264
17269
|
|
|
17265
17270
|
// src/widget/features/wallet/components/CryptoWalletDropdownContent.tsx
|
|
17266
|
-
import { useEffect as useEffect24, useMemo as useMemo17, useRef as
|
|
17271
|
+
import { useEffect as useEffect24, useMemo as useMemo17, useRef as useRef10, useState as useState24 } from "react";
|
|
17267
17272
|
import { Fragment as Fragment7, jsx as jsx36, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
17268
17273
|
function ecosystemToNamespace(ecosystem) {
|
|
17269
17274
|
switch (ecosystem.trim().toLowerCase()) {
|
|
@@ -17350,7 +17355,7 @@ function MobileWalletDropdownContent({
|
|
|
17350
17355
|
const { selectedNamespace, setSelectedNamespace } = useDepositWallet();
|
|
17351
17356
|
const { walletMetaId, isConnected, status, detected } = useWalletInfo();
|
|
17352
17357
|
const [hoveredId, setHoveredId] = useState24(null);
|
|
17353
|
-
const storeFallbackTimeoutRef =
|
|
17358
|
+
const storeFallbackTimeoutRef = useRef10(
|
|
17354
17359
|
null
|
|
17355
17360
|
);
|
|
17356
17361
|
useEffect24(() => {
|
|
@@ -17821,7 +17826,7 @@ var init_HomePaymentOptions = __esm({
|
|
|
17821
17826
|
});
|
|
17822
17827
|
|
|
17823
17828
|
// src/widget/features/wallet/hooks/useHomeWalletActions.ts
|
|
17824
|
-
import { useCallback as useCallback18, useEffect as useEffect25, useMemo as useMemo18, useRef as
|
|
17829
|
+
import { useCallback as useCallback18, useEffect as useEffect25, useMemo as useMemo18, useRef as useRef11, useState as useState25 } from "react";
|
|
17825
17830
|
function useHomeWalletActions({
|
|
17826
17831
|
connectWallet,
|
|
17827
17832
|
detectedWallets,
|
|
@@ -17832,8 +17837,8 @@ function useHomeWalletActions({
|
|
|
17832
17837
|
}) {
|
|
17833
17838
|
const [isCryptoDropdownOpen, setIsCryptoDropdownOpen] = useState25(false);
|
|
17834
17839
|
const [isFiatDropdownOpen, setIsFiatDropdownOpen] = useState25(false);
|
|
17835
|
-
const cryptoDropdownRef =
|
|
17836
|
-
const fiatDropdownRef =
|
|
17840
|
+
const cryptoDropdownRef = useRef11(null);
|
|
17841
|
+
const fiatDropdownRef = useRef11(null);
|
|
17837
17842
|
const { disconnect } = useWalletInfo();
|
|
17838
17843
|
useEffect25(() => {
|
|
17839
17844
|
const handleClickOutside = (event) => {
|
|
@@ -32088,7 +32093,7 @@ var init_smart_account2 = __esm({
|
|
|
32088
32093
|
});
|
|
32089
32094
|
|
|
32090
32095
|
// src/widget/features/transaction/hooks/useTransactionActionModel.ts
|
|
32091
|
-
import { useCallback as useCallback19, useEffect as useEffect26, useMemo as useMemo20, useRef as
|
|
32096
|
+
import { useCallback as useCallback19, useEffect as useEffect26, useMemo as useMemo20, useRef as useRef12, useState as useState26 } from "react";
|
|
32092
32097
|
import { encodeFunctionData as encodeFunctionData9, erc20Abi } from "viem";
|
|
32093
32098
|
function normalizeTokenAddressForCompare(chain, addr) {
|
|
32094
32099
|
const chainType = (chain.type ?? chain.chainType ?? "").toLowerCase();
|
|
@@ -32110,7 +32115,7 @@ function useTransactionActionModel({
|
|
|
32110
32115
|
walletAddress,
|
|
32111
32116
|
walletStatus
|
|
32112
32117
|
}) {
|
|
32113
|
-
const feeDataCacheRef =
|
|
32118
|
+
const feeDataCacheRef = useRef12({});
|
|
32114
32119
|
const { isSubmitting, submitTransaction } = useTransactionSubmit();
|
|
32115
32120
|
const { trackEvent } = useGTMTracker();
|
|
32116
32121
|
const destinationConfig = (() => {
|
|
@@ -33251,7 +33256,7 @@ var init_CryptoPay = __esm({
|
|
|
33251
33256
|
});
|
|
33252
33257
|
|
|
33253
33258
|
// src/widget/pages/Processing.tsx
|
|
33254
|
-
import { useEffect as useEffect29, useMemo as useMemo22, useRef as
|
|
33259
|
+
import { useEffect as useEffect29, useMemo as useMemo22, useRef as useRef13 } from "react";
|
|
33255
33260
|
import { jsx as jsx47, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
33256
33261
|
function getProgressFromStatus(status) {
|
|
33257
33262
|
switch (status) {
|
|
@@ -33290,7 +33295,7 @@ function Processing({ style }) {
|
|
|
33290
33295
|
const { resetState, setCurrentStep } = useDepositNavigation();
|
|
33291
33296
|
const { transactionStatus, transactionHash, intentId } = useDepositTransaction();
|
|
33292
33297
|
const { transaction, startPolling, isPolling } = useTransactionPolling();
|
|
33293
|
-
const hasStartedPolling =
|
|
33298
|
+
const hasStartedPolling = useRef13(false);
|
|
33294
33299
|
useEffect29(() => {
|
|
33295
33300
|
return () => {
|
|
33296
33301
|
hasStartedPolling.current = false;
|
|
@@ -33647,15 +33652,31 @@ var init_WidgetRouter = __esm({
|
|
|
33647
33652
|
}
|
|
33648
33653
|
});
|
|
33649
33654
|
|
|
33655
|
+
// src/widget/app/WidgetAnalytics.tsx
|
|
33656
|
+
import { Fragment as Fragment10, jsx as jsx51 } from "react/jsx-runtime";
|
|
33657
|
+
function WidgetAnalytics({
|
|
33658
|
+
children
|
|
33659
|
+
}) {
|
|
33660
|
+
useGTM(GTM_ID);
|
|
33661
|
+
return /* @__PURE__ */ jsx51(Fragment10, { children });
|
|
33662
|
+
}
|
|
33663
|
+
var init_WidgetAnalytics = __esm({
|
|
33664
|
+
"src/widget/app/WidgetAnalytics.tsx"() {
|
|
33665
|
+
"use strict";
|
|
33666
|
+
init_hooks();
|
|
33667
|
+
init_constants();
|
|
33668
|
+
}
|
|
33669
|
+
});
|
|
33670
|
+
|
|
33650
33671
|
// src/modes/swap/hooks/useSwapRoute.ts
|
|
33651
|
-
import { useCallback as useCallback20, useRef as
|
|
33672
|
+
import { useCallback as useCallback20, useRef as useRef14, useState as useState28 } from "react";
|
|
33652
33673
|
function useSwapRoute() {
|
|
33653
33674
|
const [state, setState] = useState28({
|
|
33654
33675
|
data: null,
|
|
33655
33676
|
loading: false,
|
|
33656
33677
|
error: null
|
|
33657
33678
|
});
|
|
33658
|
-
const abortRef =
|
|
33679
|
+
const abortRef = useRef14(false);
|
|
33659
33680
|
const fetch2 = useCallback20(
|
|
33660
33681
|
async (params) => {
|
|
33661
33682
|
const { fromToken, fromChain, toToken, toChain, amount, walletAddress } = params;
|
|
@@ -33715,7 +33736,7 @@ var init_useSwapRoute = __esm({
|
|
|
33715
33736
|
});
|
|
33716
33737
|
|
|
33717
33738
|
// src/modes/swap/hooks/useSwapExecution.ts
|
|
33718
|
-
import { useCallback as useCallback21, useRef as
|
|
33739
|
+
import { useCallback as useCallback21, useRef as useRef15, useState as useState29 } from "react";
|
|
33719
33740
|
import { encodeFunctionData as encodeFunctionData10, erc20Abi as erc20Abi2 } from "viem";
|
|
33720
33741
|
function normalizeTx(raw) {
|
|
33721
33742
|
const r = raw;
|
|
@@ -33755,11 +33776,11 @@ function useSwapExecution(fromChain) {
|
|
|
33755
33776
|
isSubmitting: false,
|
|
33756
33777
|
allowanceStatus: "unknown"
|
|
33757
33778
|
});
|
|
33758
|
-
const saFailedUntilRef =
|
|
33759
|
-
const pollingRef =
|
|
33760
|
-
const timeoutRef =
|
|
33761
|
-
const abortRef =
|
|
33762
|
-
const pollCountRef =
|
|
33779
|
+
const saFailedUntilRef = useRef15(0);
|
|
33780
|
+
const pollingRef = useRef15(null);
|
|
33781
|
+
const timeoutRef = useRef15(null);
|
|
33782
|
+
const abortRef = useRef15(false);
|
|
33783
|
+
const pollCountRef = useRef15(0);
|
|
33763
33784
|
const clearPolling = useCallback21(() => {
|
|
33764
33785
|
abortRef.current = true;
|
|
33765
33786
|
if (pollingRef.current) clearTimeout(pollingRef.current);
|
|
@@ -34206,6 +34227,36 @@ var init_walletBalance = __esm({
|
|
|
34206
34227
|
}
|
|
34207
34228
|
});
|
|
34208
34229
|
|
|
34230
|
+
// src/modes/swap/analytics.ts
|
|
34231
|
+
function chainLabel(chain) {
|
|
34232
|
+
return chain?.networkName ?? chain?.axelarChainName ?? chain?.chainId ?? UNKNOWN;
|
|
34233
|
+
}
|
|
34234
|
+
function tokenLabel(token) {
|
|
34235
|
+
return token?.symbol ?? UNKNOWN;
|
|
34236
|
+
}
|
|
34237
|
+
function buildSwapPaymentParams(ctx) {
|
|
34238
|
+
return {
|
|
34239
|
+
from_chain: chainLabel(ctx.fromChain),
|
|
34240
|
+
from_token: tokenLabel(ctx.fromToken),
|
|
34241
|
+
to_chain: chainLabel(ctx.toChain),
|
|
34242
|
+
to_token: tokenLabel(ctx.toToken),
|
|
34243
|
+
domain: ctx.domain
|
|
34244
|
+
};
|
|
34245
|
+
}
|
|
34246
|
+
function claimAttemptOnce(slot, attempt) {
|
|
34247
|
+
if (!attempt) return false;
|
|
34248
|
+
if (slot.current === attempt) return false;
|
|
34249
|
+
slot.current = attempt;
|
|
34250
|
+
return true;
|
|
34251
|
+
}
|
|
34252
|
+
var UNKNOWN;
|
|
34253
|
+
var init_analytics = __esm({
|
|
34254
|
+
"src/modes/swap/analytics.ts"() {
|
|
34255
|
+
"use strict";
|
|
34256
|
+
UNKNOWN = "unknown";
|
|
34257
|
+
}
|
|
34258
|
+
});
|
|
34259
|
+
|
|
34209
34260
|
// src/core/forex.ts
|
|
34210
34261
|
async function fetchForexRates(base2 = "USD") {
|
|
34211
34262
|
let r;
|
|
@@ -34235,12 +34286,12 @@ var init_forex = __esm({
|
|
|
34235
34286
|
});
|
|
34236
34287
|
|
|
34237
34288
|
// src/modes/swap/hooks/useForex.ts
|
|
34238
|
-
import { useEffect as useEffect30, useRef as
|
|
34289
|
+
import { useEffect as useEffect30, useRef as useRef16, useState as useState30 } from "react";
|
|
34239
34290
|
function useForex() {
|
|
34240
34291
|
const [rates, setRates] = useState30({ USD: 1 });
|
|
34241
34292
|
const [error, setError] = useState30(null);
|
|
34242
34293
|
const [lastUpdated, setLastUpdated] = useState30(null);
|
|
34243
|
-
const timerRef =
|
|
34294
|
+
const timerRef = useRef16(null);
|
|
34244
34295
|
useEffect30(() => {
|
|
34245
34296
|
let cancelled = false;
|
|
34246
34297
|
const load = () => {
|
|
@@ -34279,7 +34330,7 @@ var init_useForex = __esm({
|
|
|
34279
34330
|
|
|
34280
34331
|
// src/modes/swap/components/SwapTokenSelect.tsx
|
|
34281
34332
|
import { useState as useState31, useMemo as useMemo26, useEffect as useEffect31 } from "react";
|
|
34282
|
-
import { jsx as
|
|
34333
|
+
import { jsx as jsx52, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
34283
34334
|
function SwapTokenSelect({
|
|
34284
34335
|
side,
|
|
34285
34336
|
selectedChain: initialChain,
|
|
@@ -34423,7 +34474,7 @@ function SwapTokenSelect({
|
|
|
34423
34474
|
borderBottom: `1px solid ${colors.border}`
|
|
34424
34475
|
},
|
|
34425
34476
|
children: [
|
|
34426
|
-
/* @__PURE__ */
|
|
34477
|
+
/* @__PURE__ */ jsx52(
|
|
34427
34478
|
"button",
|
|
34428
34479
|
{
|
|
34429
34480
|
type: "button",
|
|
@@ -34437,7 +34488,7 @@ function SwapTokenSelect({
|
|
|
34437
34488
|
cursor: "pointer"
|
|
34438
34489
|
},
|
|
34439
34490
|
"aria-label": "Go back",
|
|
34440
|
-
children: /* @__PURE__ */
|
|
34491
|
+
children: /* @__PURE__ */ jsx52(
|
|
34441
34492
|
"svg",
|
|
34442
34493
|
{
|
|
34443
34494
|
style: {
|
|
@@ -34449,7 +34500,7 @@ function SwapTokenSelect({
|
|
|
34449
34500
|
fill: "none",
|
|
34450
34501
|
stroke: "currentColor",
|
|
34451
34502
|
strokeWidth: 2,
|
|
34452
|
-
children: /* @__PURE__ */
|
|
34503
|
+
children: /* @__PURE__ */ jsx52(
|
|
34453
34504
|
"path",
|
|
34454
34505
|
{
|
|
34455
34506
|
strokeLinecap: "round",
|
|
@@ -34461,7 +34512,7 @@ function SwapTokenSelect({
|
|
|
34461
34512
|
)
|
|
34462
34513
|
}
|
|
34463
34514
|
),
|
|
34464
|
-
/* @__PURE__ */
|
|
34515
|
+
/* @__PURE__ */ jsx52(
|
|
34465
34516
|
"h1",
|
|
34466
34517
|
{
|
|
34467
34518
|
style: {
|
|
@@ -34479,7 +34530,7 @@ function SwapTokenSelect({
|
|
|
34479
34530
|
}
|
|
34480
34531
|
),
|
|
34481
34532
|
/* @__PURE__ */ jsxs42("div", { style: { flex: 1, display: "flex", overflow: "hidden" }, children: [
|
|
34482
|
-
/* @__PURE__ */
|
|
34533
|
+
/* @__PURE__ */ jsx52(
|
|
34483
34534
|
ChainSelectorPanel,
|
|
34484
34535
|
{
|
|
34485
34536
|
error: chainsError,
|
|
@@ -34490,7 +34541,7 @@ function SwapTokenSelect({
|
|
|
34490
34541
|
popularChains
|
|
34491
34542
|
}
|
|
34492
34543
|
),
|
|
34493
|
-
/* @__PURE__ */
|
|
34544
|
+
/* @__PURE__ */ jsx52(
|
|
34494
34545
|
TokenSelectorPanel,
|
|
34495
34546
|
{
|
|
34496
34547
|
filteredTokens: visibleTokens,
|
|
@@ -34509,7 +34560,7 @@ function SwapTokenSelect({
|
|
|
34509
34560
|
}
|
|
34510
34561
|
)
|
|
34511
34562
|
] }),
|
|
34512
|
-
/* @__PURE__ */
|
|
34563
|
+
/* @__PURE__ */ jsx52(WidgetSecurityFooter, {})
|
|
34513
34564
|
]
|
|
34514
34565
|
}
|
|
34515
34566
|
);
|
|
@@ -34599,8 +34650,8 @@ var init_currency = __esm({
|
|
|
34599
34650
|
});
|
|
34600
34651
|
|
|
34601
34652
|
// src/modes/swap/components/SwapWalletSelector/SwapWalletSelectorMobile.tsx
|
|
34602
|
-
import { useEffect as useEffect32, useMemo as useMemo27, useRef as
|
|
34603
|
-
import { Fragment as
|
|
34653
|
+
import { useEffect as useEffect32, useMemo as useMemo27, useRef as useRef17, useState as useState32 } from "react";
|
|
34654
|
+
import { Fragment as Fragment11, jsx as jsx53, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
34604
34655
|
function SwapWalletSelectorMobile({
|
|
34605
34656
|
walletStatus,
|
|
34606
34657
|
walletAddress,
|
|
@@ -34620,8 +34671,8 @@ function SwapWalletSelectorMobile({
|
|
|
34620
34671
|
const [wcConnecting, setWcConnecting] = useState32(false);
|
|
34621
34672
|
const [connectingId, setConnectingId] = useState32(null);
|
|
34622
34673
|
const [selectedNamespace, setSelectedNamespace] = useState32("evm");
|
|
34623
|
-
const prevStatusRef =
|
|
34624
|
-
const storeFallbackTimeoutRef =
|
|
34674
|
+
const prevStatusRef = useRef17(walletStatus);
|
|
34675
|
+
const storeFallbackTimeoutRef = useRef17(
|
|
34625
34676
|
null
|
|
34626
34677
|
);
|
|
34627
34678
|
useEffect32(() => {
|
|
@@ -34742,7 +34793,7 @@ function SwapWalletSelectorMobile({
|
|
|
34742
34793
|
borderBottom: `1px solid ${colors.border}`
|
|
34743
34794
|
},
|
|
34744
34795
|
children: [
|
|
34745
|
-
/* @__PURE__ */
|
|
34796
|
+
/* @__PURE__ */ jsx53(
|
|
34746
34797
|
"button",
|
|
34747
34798
|
{
|
|
34748
34799
|
type: "button",
|
|
@@ -34755,7 +34806,7 @@ function SwapWalletSelectorMobile({
|
|
|
34755
34806
|
border: 0,
|
|
34756
34807
|
cursor: "pointer"
|
|
34757
34808
|
},
|
|
34758
|
-
children: /* @__PURE__ */
|
|
34809
|
+
children: /* @__PURE__ */ jsx53(
|
|
34759
34810
|
"svg",
|
|
34760
34811
|
{
|
|
34761
34812
|
style: {
|
|
@@ -34767,7 +34818,7 @@ function SwapWalletSelectorMobile({
|
|
|
34767
34818
|
fill: "none",
|
|
34768
34819
|
stroke: "currentColor",
|
|
34769
34820
|
strokeWidth: 2,
|
|
34770
|
-
children: /* @__PURE__ */
|
|
34821
|
+
children: /* @__PURE__ */ jsx53(
|
|
34771
34822
|
"path",
|
|
34772
34823
|
{
|
|
34773
34824
|
strokeLinecap: "round",
|
|
@@ -34779,7 +34830,7 @@ function SwapWalletSelectorMobile({
|
|
|
34779
34830
|
)
|
|
34780
34831
|
}
|
|
34781
34832
|
),
|
|
34782
|
-
/* @__PURE__ */
|
|
34833
|
+
/* @__PURE__ */ jsx53(
|
|
34783
34834
|
"h1",
|
|
34784
34835
|
{
|
|
34785
34836
|
style: {
|
|
@@ -34792,11 +34843,11 @@ function SwapWalletSelectorMobile({
|
|
|
34792
34843
|
children: "Connect Wallet"
|
|
34793
34844
|
}
|
|
34794
34845
|
),
|
|
34795
|
-
/* @__PURE__ */
|
|
34846
|
+
/* @__PURE__ */ jsx53("div", { style: { width: "1.25rem", marginLeft: spacing[2] }, "aria-hidden": true })
|
|
34796
34847
|
]
|
|
34797
34848
|
}
|
|
34798
34849
|
),
|
|
34799
|
-
/* @__PURE__ */
|
|
34850
|
+
/* @__PURE__ */ jsx53("div", { style: { padding: `${spacing[3]} ${spacing[4]} 0` }, children: /* @__PURE__ */ jsx53(
|
|
34800
34851
|
"div",
|
|
34801
34852
|
{
|
|
34802
34853
|
style: {
|
|
@@ -34807,7 +34858,7 @@ function SwapWalletSelectorMobile({
|
|
|
34807
34858
|
padding: "3px",
|
|
34808
34859
|
gap: "2px"
|
|
34809
34860
|
},
|
|
34810
|
-
children: tabs.map((t) => /* @__PURE__ */
|
|
34861
|
+
children: tabs.map((t) => /* @__PURE__ */ jsx53(
|
|
34811
34862
|
"button",
|
|
34812
34863
|
{
|
|
34813
34864
|
onClick: () => setSelectedNamespace(t.id),
|
|
@@ -34841,8 +34892,8 @@ function SwapWalletSelectorMobile({
|
|
|
34841
34892
|
},
|
|
34842
34893
|
children: [
|
|
34843
34894
|
mobileWalletEntries.length === 0 ? /* @__PURE__ */ jsxs43("div", { style: { textAlign: "center", padding: `${spacing[8]} 0` }, children: [
|
|
34844
|
-
/* @__PURE__ */
|
|
34845
|
-
/* @__PURE__ */
|
|
34895
|
+
/* @__PURE__ */ jsx53("div", { style: { fontSize: "2.5rem", marginBottom: spacing[4] }, children: "\u{1F45B}" }),
|
|
34896
|
+
/* @__PURE__ */ jsx53(
|
|
34846
34897
|
"h3",
|
|
34847
34898
|
{
|
|
34848
34899
|
style: {
|
|
@@ -34854,7 +34905,7 @@ function SwapWalletSelectorMobile({
|
|
|
34854
34905
|
children: "No Wallets Found"
|
|
34855
34906
|
}
|
|
34856
34907
|
),
|
|
34857
|
-
/* @__PURE__ */
|
|
34908
|
+
/* @__PURE__ */ jsx53(
|
|
34858
34909
|
"p",
|
|
34859
34910
|
{
|
|
34860
34911
|
style: {
|
|
@@ -34865,7 +34916,7 @@ function SwapWalletSelectorMobile({
|
|
|
34865
34916
|
children: "Please install a web3 wallet to continue."
|
|
34866
34917
|
}
|
|
34867
34918
|
),
|
|
34868
|
-
/* @__PURE__ */
|
|
34919
|
+
/* @__PURE__ */ jsx53(
|
|
34869
34920
|
"a",
|
|
34870
34921
|
{
|
|
34871
34922
|
href: "https://metamask.io/download/",
|
|
@@ -34886,7 +34937,7 @@ function SwapWalletSelectorMobile({
|
|
|
34886
34937
|
children: "Install MetaMask"
|
|
34887
34938
|
}
|
|
34888
34939
|
)
|
|
34889
|
-
] }) : /* @__PURE__ */
|
|
34940
|
+
] }) : /* @__PURE__ */ jsx53(
|
|
34890
34941
|
"div",
|
|
34891
34942
|
{
|
|
34892
34943
|
style: {
|
|
@@ -34920,7 +34971,7 @@ function SwapWalletSelectorMobile({
|
|
|
34920
34971
|
isRowDisabled && { opacity: 0.4 }
|
|
34921
34972
|
),
|
|
34922
34973
|
children: [
|
|
34923
|
-
/* @__PURE__ */
|
|
34974
|
+
/* @__PURE__ */ jsx53(
|
|
34924
34975
|
"div",
|
|
34925
34976
|
{
|
|
34926
34977
|
style: {
|
|
@@ -34934,7 +34985,7 @@ function SwapWalletSelectorMobile({
|
|
|
34934
34985
|
overflow: "hidden",
|
|
34935
34986
|
flexShrink: 0
|
|
34936
34987
|
},
|
|
34937
|
-
children: meta.logo ? /* @__PURE__ */
|
|
34988
|
+
children: meta.logo ? /* @__PURE__ */ jsx53(
|
|
34938
34989
|
"img",
|
|
34939
34990
|
{
|
|
34940
34991
|
src: meta.logo,
|
|
@@ -34945,11 +34996,11 @@ function SwapWalletSelectorMobile({
|
|
|
34945
34996
|
objectFit: "contain"
|
|
34946
34997
|
}
|
|
34947
34998
|
}
|
|
34948
|
-
) : /* @__PURE__ */
|
|
34999
|
+
) : /* @__PURE__ */ jsx53("span", { style: { fontSize: "1.5rem" }, children: meta.emoji || "\u{1F45B}" })
|
|
34949
35000
|
}
|
|
34950
35001
|
),
|
|
34951
35002
|
/* @__PURE__ */ jsxs43("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
34952
|
-
/* @__PURE__ */
|
|
35003
|
+
/* @__PURE__ */ jsx53(
|
|
34953
35004
|
"p",
|
|
34954
35005
|
{
|
|
34955
35006
|
style: {
|
|
@@ -34974,7 +35025,7 @@ function SwapWalletSelectorMobile({
|
|
|
34974
35025
|
}
|
|
34975
35026
|
)
|
|
34976
35027
|
] }),
|
|
34977
|
-
isConnecting ? /* @__PURE__ */
|
|
35028
|
+
isConnecting ? /* @__PURE__ */ jsx53(
|
|
34978
35029
|
"div",
|
|
34979
35030
|
{
|
|
34980
35031
|
style: {
|
|
@@ -34987,7 +35038,7 @@ function SwapWalletSelectorMobile({
|
|
|
34987
35038
|
flexShrink: 0
|
|
34988
35039
|
}
|
|
34989
35040
|
}
|
|
34990
|
-
) : isWalletConnected ? /* @__PURE__ */
|
|
35041
|
+
) : isWalletConnected ? /* @__PURE__ */ jsx53(
|
|
34991
35042
|
"button",
|
|
34992
35043
|
{
|
|
34993
35044
|
onClick: handleDisconnect,
|
|
@@ -35004,7 +35055,7 @@ function SwapWalletSelectorMobile({
|
|
|
35004
35055
|
},
|
|
35005
35056
|
children: "Disconnect"
|
|
35006
35057
|
}
|
|
35007
|
-
) : /* @__PURE__ */
|
|
35058
|
+
) : /* @__PURE__ */ jsx53(
|
|
35008
35059
|
"button",
|
|
35009
35060
|
{
|
|
35010
35061
|
onClick: () => void handleClick(entry),
|
|
@@ -35036,8 +35087,8 @@ function SwapWalletSelectorMobile({
|
|
|
35036
35087
|
})
|
|
35037
35088
|
}
|
|
35038
35089
|
),
|
|
35039
|
-
selectedNamespace === "evm" && /* @__PURE__ */ jsxs43(
|
|
35040
|
-
/* @__PURE__ */
|
|
35090
|
+
selectedNamespace === "evm" && /* @__PURE__ */ jsxs43(Fragment11, { children: [
|
|
35091
|
+
/* @__PURE__ */ jsx53(
|
|
35041
35092
|
"div",
|
|
35042
35093
|
{
|
|
35043
35094
|
style: {
|
|
@@ -35073,7 +35124,7 @@ function SwapWalletSelectorMobile({
|
|
|
35073
35124
|
),
|
|
35074
35125
|
onClick: !wcConnected && !wcRowDisabled ? () => void handleWalletConnect() : void 0,
|
|
35075
35126
|
children: [
|
|
35076
|
-
/* @__PURE__ */
|
|
35127
|
+
/* @__PURE__ */ jsx53(
|
|
35077
35128
|
"div",
|
|
35078
35129
|
{
|
|
35079
35130
|
style: {
|
|
@@ -35086,7 +35137,7 @@ function SwapWalletSelectorMobile({
|
|
|
35086
35137
|
justifyContent: "center",
|
|
35087
35138
|
flexShrink: 0
|
|
35088
35139
|
},
|
|
35089
|
-
children: /* @__PURE__ */
|
|
35140
|
+
children: /* @__PURE__ */ jsx53(
|
|
35090
35141
|
"svg",
|
|
35091
35142
|
{
|
|
35092
35143
|
style: {
|
|
@@ -35096,13 +35147,13 @@ function SwapWalletSelectorMobile({
|
|
|
35096
35147
|
},
|
|
35097
35148
|
viewBox: "0 0 24 24",
|
|
35098
35149
|
fill: "currentColor",
|
|
35099
|
-
children: /* @__PURE__ */
|
|
35150
|
+
children: /* @__PURE__ */ jsx53("path", { d: "M6.09 10.56c3.26-3.2 8.56-3.2 11.82 0l.39.39a.4.4 0 010 .58l-1.34 1.31a.21.21 0 01-.3 0l-.54-.53c-2.28-2.23-5.97-2.23-8.24 0l-.58.56a.21.21 0 01-.3 0L5.66 11.6a.4.4 0 010-.58l.43-.46zm14.6 2.72l1.2 1.17a.4.4 0 010 .58l-5.38 5.27a.43.43 0 01-.6 0l-3.82-3.74a.11.11 0 00-.15 0l-3.82 3.74a.43.43 0 01-.6 0L2.15 15.03a.4.4 0 010-.58l1.2-1.17a.43.43 0 01.6 0l3.82 3.74c.04.04.1.04.15 0l3.82-3.74a.43.43 0 01.6 0l3.82 3.74c.04.04.1.04.15 0l3.82-3.74a.43.43 0 01.6 0z" })
|
|
35100
35151
|
}
|
|
35101
35152
|
)
|
|
35102
35153
|
}
|
|
35103
35154
|
),
|
|
35104
35155
|
/* @__PURE__ */ jsxs43("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
35105
|
-
/* @__PURE__ */
|
|
35156
|
+
/* @__PURE__ */ jsx53(
|
|
35106
35157
|
"p",
|
|
35107
35158
|
{
|
|
35108
35159
|
style: {
|
|
@@ -35127,7 +35178,7 @@ function SwapWalletSelectorMobile({
|
|
|
35127
35178
|
}
|
|
35128
35179
|
)
|
|
35129
35180
|
] }),
|
|
35130
|
-
wcConnecting ? /* @__PURE__ */
|
|
35181
|
+
wcConnecting ? /* @__PURE__ */ jsx53(
|
|
35131
35182
|
"div",
|
|
35132
35183
|
{
|
|
35133
35184
|
style: {
|
|
@@ -35140,7 +35191,7 @@ function SwapWalletSelectorMobile({
|
|
|
35140
35191
|
flexShrink: 0
|
|
35141
35192
|
}
|
|
35142
35193
|
}
|
|
35143
|
-
) : wcConnected ? /* @__PURE__ */
|
|
35194
|
+
) : wcConnected ? /* @__PURE__ */ jsx53(
|
|
35144
35195
|
"button",
|
|
35145
35196
|
{
|
|
35146
35197
|
onClick: (e2) => {
|
|
@@ -35160,7 +35211,7 @@ function SwapWalletSelectorMobile({
|
|
|
35160
35211
|
},
|
|
35161
35212
|
children: "Disconnect"
|
|
35162
35213
|
}
|
|
35163
|
-
) : /* @__PURE__ */
|
|
35214
|
+
) : /* @__PURE__ */ jsx53(
|
|
35164
35215
|
"button",
|
|
35165
35216
|
{
|
|
35166
35217
|
onClick: (e2) => {
|
|
@@ -35215,8 +35266,8 @@ var init_SwapWalletSelectorMobile = __esm({
|
|
|
35215
35266
|
});
|
|
35216
35267
|
|
|
35217
35268
|
// src/modes/swap/components/SwapWalletSelector/SwapWalletSelectorDesktop.tsx
|
|
35218
|
-
import { useEffect as useEffect33, useMemo as useMemo28, useRef as
|
|
35219
|
-
import { Fragment as
|
|
35269
|
+
import { useEffect as useEffect33, useMemo as useMemo28, useRef as useRef18, useState as useState33 } from "react";
|
|
35270
|
+
import { Fragment as Fragment12, jsx as jsx54, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
35220
35271
|
function SwapWalletSelectorDesktop({
|
|
35221
35272
|
walletStatus,
|
|
35222
35273
|
walletAddress,
|
|
@@ -35236,7 +35287,7 @@ function SwapWalletSelectorDesktop({
|
|
|
35236
35287
|
const [connectingId, setConnectingId] = useState33(null);
|
|
35237
35288
|
const [timerExpired, setTimerExpired] = useState33(false);
|
|
35238
35289
|
const [selectedNamespace, setSelectedNamespace] = useState33("evm");
|
|
35239
|
-
const prevStatusRef =
|
|
35290
|
+
const prevStatusRef = useRef18(walletStatus);
|
|
35240
35291
|
useEffect33(() => {
|
|
35241
35292
|
const t = setTimeout(() => setTimerExpired(true), 450);
|
|
35242
35293
|
return () => clearTimeout(t);
|
|
@@ -35320,7 +35371,7 @@ function SwapWalletSelectorDesktop({
|
|
|
35320
35371
|
borderBottom: `1px solid ${colors.border}`
|
|
35321
35372
|
},
|
|
35322
35373
|
children: [
|
|
35323
|
-
/* @__PURE__ */
|
|
35374
|
+
/* @__PURE__ */ jsx54(
|
|
35324
35375
|
"button",
|
|
35325
35376
|
{
|
|
35326
35377
|
type: "button",
|
|
@@ -35333,7 +35384,7 @@ function SwapWalletSelectorDesktop({
|
|
|
35333
35384
|
border: 0,
|
|
35334
35385
|
cursor: "pointer"
|
|
35335
35386
|
},
|
|
35336
|
-
children: /* @__PURE__ */
|
|
35387
|
+
children: /* @__PURE__ */ jsx54(
|
|
35337
35388
|
"svg",
|
|
35338
35389
|
{
|
|
35339
35390
|
style: {
|
|
@@ -35345,7 +35396,7 @@ function SwapWalletSelectorDesktop({
|
|
|
35345
35396
|
fill: "none",
|
|
35346
35397
|
stroke: "currentColor",
|
|
35347
35398
|
strokeWidth: 2,
|
|
35348
|
-
children: /* @__PURE__ */
|
|
35399
|
+
children: /* @__PURE__ */ jsx54(
|
|
35349
35400
|
"path",
|
|
35350
35401
|
{
|
|
35351
35402
|
strokeLinecap: "round",
|
|
@@ -35357,7 +35408,7 @@ function SwapWalletSelectorDesktop({
|
|
|
35357
35408
|
)
|
|
35358
35409
|
}
|
|
35359
35410
|
),
|
|
35360
|
-
/* @__PURE__ */
|
|
35411
|
+
/* @__PURE__ */ jsx54(
|
|
35361
35412
|
"h1",
|
|
35362
35413
|
{
|
|
35363
35414
|
style: {
|
|
@@ -35370,7 +35421,7 @@ function SwapWalletSelectorDesktop({
|
|
|
35370
35421
|
children: "Connect Wallet"
|
|
35371
35422
|
}
|
|
35372
35423
|
),
|
|
35373
|
-
/* @__PURE__ */
|
|
35424
|
+
/* @__PURE__ */ jsx54(
|
|
35374
35425
|
"div",
|
|
35375
35426
|
{
|
|
35376
35427
|
style: {
|
|
@@ -35381,7 +35432,7 @@ function SwapWalletSelectorDesktop({
|
|
|
35381
35432
|
padding: "3px",
|
|
35382
35433
|
gap: "2px"
|
|
35383
35434
|
},
|
|
35384
|
-
children: tabs.map((t) => /* @__PURE__ */
|
|
35435
|
+
children: tabs.map((t) => /* @__PURE__ */ jsx54(
|
|
35385
35436
|
"button",
|
|
35386
35437
|
{
|
|
35387
35438
|
onClick: () => setSelectedNamespace(t.id),
|
|
@@ -35430,7 +35481,7 @@ function SwapWalletSelectorDesktop({
|
|
|
35430
35481
|
animation: "tw-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite"
|
|
35431
35482
|
},
|
|
35432
35483
|
children: [
|
|
35433
|
-
/* @__PURE__ */
|
|
35484
|
+
/* @__PURE__ */ jsx54(
|
|
35434
35485
|
"div",
|
|
35435
35486
|
{
|
|
35436
35487
|
style: {
|
|
@@ -35441,7 +35492,7 @@ function SwapWalletSelectorDesktop({
|
|
|
35441
35492
|
}
|
|
35442
35493
|
}
|
|
35443
35494
|
),
|
|
35444
|
-
/* @__PURE__ */
|
|
35495
|
+
/* @__PURE__ */ jsx54(
|
|
35445
35496
|
"div",
|
|
35446
35497
|
{
|
|
35447
35498
|
style: {
|
|
@@ -35456,7 +35507,7 @@ function SwapWalletSelectorDesktop({
|
|
|
35456
35507
|
},
|
|
35457
35508
|
i
|
|
35458
35509
|
)),
|
|
35459
|
-
/* @__PURE__ */
|
|
35510
|
+
/* @__PURE__ */ jsx54(
|
|
35460
35511
|
"p",
|
|
35461
35512
|
{
|
|
35462
35513
|
style: {
|
|
@@ -35471,8 +35522,8 @@ function SwapWalletSelectorDesktop({
|
|
|
35471
35522
|
]
|
|
35472
35523
|
}
|
|
35473
35524
|
) : filteredWallets.length === 0 ? /* @__PURE__ */ jsxs44("div", { style: { textAlign: "center", padding: `${spacing[8]} 0` }, children: [
|
|
35474
|
-
/* @__PURE__ */
|
|
35475
|
-
/* @__PURE__ */
|
|
35525
|
+
/* @__PURE__ */ jsx54("div", { style: { fontSize: "2.5rem", marginBottom: spacing[4] }, children: "\u{1F45B}" }),
|
|
35526
|
+
/* @__PURE__ */ jsx54(
|
|
35476
35527
|
"h3",
|
|
35477
35528
|
{
|
|
35478
35529
|
style: {
|
|
@@ -35484,7 +35535,7 @@ function SwapWalletSelectorDesktop({
|
|
|
35484
35535
|
children: "No Wallets Found"
|
|
35485
35536
|
}
|
|
35486
35537
|
),
|
|
35487
|
-
/* @__PURE__ */
|
|
35538
|
+
/* @__PURE__ */ jsx54(
|
|
35488
35539
|
"p",
|
|
35489
35540
|
{
|
|
35490
35541
|
style: {
|
|
@@ -35495,7 +35546,7 @@ function SwapWalletSelectorDesktop({
|
|
|
35495
35546
|
children: "Please install a web3 wallet to continue."
|
|
35496
35547
|
}
|
|
35497
35548
|
),
|
|
35498
|
-
/* @__PURE__ */
|
|
35549
|
+
/* @__PURE__ */ jsx54(
|
|
35499
35550
|
"a",
|
|
35500
35551
|
{
|
|
35501
35552
|
href: "https://metamask.io/download/",
|
|
@@ -35516,7 +35567,7 @@ function SwapWalletSelectorDesktop({
|
|
|
35516
35567
|
children: "Install MetaMask"
|
|
35517
35568
|
}
|
|
35518
35569
|
)
|
|
35519
|
-
] }) : /* @__PURE__ */
|
|
35570
|
+
] }) : /* @__PURE__ */ jsx54(
|
|
35520
35571
|
"div",
|
|
35521
35572
|
{
|
|
35522
35573
|
style: {
|
|
@@ -35547,7 +35598,7 @@ function SwapWalletSelectorDesktop({
|
|
|
35547
35598
|
}
|
|
35548
35599
|
),
|
|
35549
35600
|
children: [
|
|
35550
|
-
/* @__PURE__ */
|
|
35601
|
+
/* @__PURE__ */ jsx54(
|
|
35551
35602
|
"div",
|
|
35552
35603
|
{
|
|
35553
35604
|
style: {
|
|
@@ -35561,7 +35612,7 @@ function SwapWalletSelectorDesktop({
|
|
|
35561
35612
|
overflow: "hidden",
|
|
35562
35613
|
flexShrink: 0
|
|
35563
35614
|
},
|
|
35564
|
-
children: wallet.meta.logo ? /* @__PURE__ */
|
|
35615
|
+
children: wallet.meta.logo ? /* @__PURE__ */ jsx54(
|
|
35565
35616
|
"img",
|
|
35566
35617
|
{
|
|
35567
35618
|
src: wallet.meta.logo,
|
|
@@ -35572,7 +35623,7 @@ function SwapWalletSelectorDesktop({
|
|
|
35572
35623
|
objectFit: "contain"
|
|
35573
35624
|
}
|
|
35574
35625
|
}
|
|
35575
|
-
) : wallet.detail?.info?.icon ? /* @__PURE__ */
|
|
35626
|
+
) : wallet.detail?.info?.icon ? /* @__PURE__ */ jsx54(
|
|
35576
35627
|
"img",
|
|
35577
35628
|
{
|
|
35578
35629
|
src: wallet.detail.info.icon,
|
|
@@ -35583,11 +35634,11 @@ function SwapWalletSelectorDesktop({
|
|
|
35583
35634
|
objectFit: "contain"
|
|
35584
35635
|
}
|
|
35585
35636
|
}
|
|
35586
|
-
) : /* @__PURE__ */
|
|
35637
|
+
) : /* @__PURE__ */ jsx54("span", { style: { fontSize: "1.5rem" }, children: wallet.meta.emoji || "\u{1F45B}" })
|
|
35587
35638
|
}
|
|
35588
35639
|
),
|
|
35589
35640
|
/* @__PURE__ */ jsxs44("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
35590
|
-
/* @__PURE__ */
|
|
35641
|
+
/* @__PURE__ */ jsx54(
|
|
35591
35642
|
"p",
|
|
35592
35643
|
{
|
|
35593
35644
|
style: {
|
|
@@ -35612,7 +35663,7 @@ function SwapWalletSelectorDesktop({
|
|
|
35612
35663
|
}
|
|
35613
35664
|
)
|
|
35614
35665
|
] }),
|
|
35615
|
-
isConnecting ? /* @__PURE__ */
|
|
35666
|
+
isConnecting ? /* @__PURE__ */ jsx54(
|
|
35616
35667
|
"div",
|
|
35617
35668
|
{
|
|
35618
35669
|
style: {
|
|
@@ -35625,7 +35676,7 @@ function SwapWalletSelectorDesktop({
|
|
|
35625
35676
|
flexShrink: 0
|
|
35626
35677
|
}
|
|
35627
35678
|
}
|
|
35628
|
-
) : isWalletConnected ? /* @__PURE__ */
|
|
35679
|
+
) : isWalletConnected ? /* @__PURE__ */ jsx54(
|
|
35629
35680
|
"button",
|
|
35630
35681
|
{
|
|
35631
35682
|
onClick: handleDisconnect,
|
|
@@ -35642,7 +35693,7 @@ function SwapWalletSelectorDesktop({
|
|
|
35642
35693
|
},
|
|
35643
35694
|
children: "Disconnect"
|
|
35644
35695
|
}
|
|
35645
|
-
) : /* @__PURE__ */
|
|
35696
|
+
) : /* @__PURE__ */ jsx54(
|
|
35646
35697
|
"button",
|
|
35647
35698
|
{
|
|
35648
35699
|
onClick: () => void handleClick(wallet),
|
|
@@ -35674,8 +35725,8 @@ function SwapWalletSelectorDesktop({
|
|
|
35674
35725
|
})
|
|
35675
35726
|
}
|
|
35676
35727
|
),
|
|
35677
|
-
selectedNamespace === "evm" && /* @__PURE__ */ jsxs44(
|
|
35678
|
-
/* @__PURE__ */
|
|
35728
|
+
selectedNamespace === "evm" && /* @__PURE__ */ jsxs44(Fragment12, { children: [
|
|
35729
|
+
/* @__PURE__ */ jsx54(
|
|
35679
35730
|
"div",
|
|
35680
35731
|
{
|
|
35681
35732
|
style: {
|
|
@@ -35709,7 +35760,7 @@ function SwapWalletSelectorDesktop({
|
|
|
35709
35760
|
),
|
|
35710
35761
|
onClick: !wcConnected ? () => void handleWalletConnect() : void 0,
|
|
35711
35762
|
children: [
|
|
35712
|
-
/* @__PURE__ */
|
|
35763
|
+
/* @__PURE__ */ jsx54(
|
|
35713
35764
|
"div",
|
|
35714
35765
|
{
|
|
35715
35766
|
style: {
|
|
@@ -35722,7 +35773,7 @@ function SwapWalletSelectorDesktop({
|
|
|
35722
35773
|
justifyContent: "center",
|
|
35723
35774
|
flexShrink: 0
|
|
35724
35775
|
},
|
|
35725
|
-
children: /* @__PURE__ */
|
|
35776
|
+
children: /* @__PURE__ */ jsx54(
|
|
35726
35777
|
"svg",
|
|
35727
35778
|
{
|
|
35728
35779
|
style: {
|
|
@@ -35732,13 +35783,13 @@ function SwapWalletSelectorDesktop({
|
|
|
35732
35783
|
},
|
|
35733
35784
|
viewBox: "0 0 24 24",
|
|
35734
35785
|
fill: "currentColor",
|
|
35735
|
-
children: /* @__PURE__ */
|
|
35786
|
+
children: /* @__PURE__ */ jsx54("path", { d: "M6.09 10.56c3.26-3.2 8.56-3.2 11.82 0l.39.39a.4.4 0 010 .58l-1.34 1.31a.21.21 0 01-.3 0l-.54-.53c-2.28-2.23-5.97-2.23-8.24 0l-.58.56a.21.21 0 01-.3 0L5.66 11.6a.4.4 0 010-.58l.43-.46zm14.6 2.72l1.2 1.17a.4.4 0 010 .58l-5.38 5.27a.43.43 0 01-.6 0l-3.82-3.74a.11.11 0 00-.15 0l-3.82 3.74a.43.43 0 01-.6 0L2.15 15.03a.4.4 0 010-.58l1.2-1.17a.43.43 0 01.6 0l3.82 3.74c.04.04.1.04.15 0l3.82-3.74a.43.43 0 01.6 0l3.82 3.74c.04.04.1.04.15 0l3.82-3.74a.43.43 0 01.6 0z" })
|
|
35736
35787
|
}
|
|
35737
35788
|
)
|
|
35738
35789
|
}
|
|
35739
35790
|
),
|
|
35740
35791
|
/* @__PURE__ */ jsxs44("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
35741
|
-
/* @__PURE__ */
|
|
35792
|
+
/* @__PURE__ */ jsx54(
|
|
35742
35793
|
"p",
|
|
35743
35794
|
{
|
|
35744
35795
|
style: {
|
|
@@ -35763,7 +35814,7 @@ function SwapWalletSelectorDesktop({
|
|
|
35763
35814
|
}
|
|
35764
35815
|
)
|
|
35765
35816
|
] }),
|
|
35766
|
-
wcConnecting ? /* @__PURE__ */
|
|
35817
|
+
wcConnecting ? /* @__PURE__ */ jsx54(
|
|
35767
35818
|
"div",
|
|
35768
35819
|
{
|
|
35769
35820
|
style: {
|
|
@@ -35776,7 +35827,7 @@ function SwapWalletSelectorDesktop({
|
|
|
35776
35827
|
flexShrink: 0
|
|
35777
35828
|
}
|
|
35778
35829
|
}
|
|
35779
|
-
) : wcConnected ? /* @__PURE__ */
|
|
35830
|
+
) : wcConnected ? /* @__PURE__ */ jsx54(
|
|
35780
35831
|
"button",
|
|
35781
35832
|
{
|
|
35782
35833
|
onClick: (e2) => {
|
|
@@ -35796,7 +35847,7 @@ function SwapWalletSelectorDesktop({
|
|
|
35796
35847
|
},
|
|
35797
35848
|
children: "Disconnect"
|
|
35798
35849
|
}
|
|
35799
|
-
) : /* @__PURE__ */
|
|
35850
|
+
) : /* @__PURE__ */ jsx54(
|
|
35800
35851
|
"button",
|
|
35801
35852
|
{
|
|
35802
35853
|
onClick: (e2) => {
|
|
@@ -35838,7 +35889,7 @@ var init_SwapWalletSelectorDesktop = __esm({
|
|
|
35838
35889
|
});
|
|
35839
35890
|
|
|
35840
35891
|
// src/modes/swap/components/SwapWalletSelector/index.tsx
|
|
35841
|
-
import { Fragment as
|
|
35892
|
+
import { Fragment as Fragment13, jsx as jsx55, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
35842
35893
|
function SwapWalletSelector({
|
|
35843
35894
|
walletStatus,
|
|
35844
35895
|
walletAddress,
|
|
@@ -35846,8 +35897,8 @@ function SwapWalletSelector({
|
|
|
35846
35897
|
onBack
|
|
35847
35898
|
}) {
|
|
35848
35899
|
const isMobile = useIsMobile();
|
|
35849
|
-
return /* @__PURE__ */ jsxs45(
|
|
35850
|
-
isMobile && /* @__PURE__ */
|
|
35900
|
+
return /* @__PURE__ */ jsxs45(Fragment13, { children: [
|
|
35901
|
+
isMobile && /* @__PURE__ */ jsx55(
|
|
35851
35902
|
SwapWalletSelectorMobile_default,
|
|
35852
35903
|
{
|
|
35853
35904
|
walletStatus,
|
|
@@ -35856,7 +35907,7 @@ function SwapWalletSelector({
|
|
|
35856
35907
|
onBack
|
|
35857
35908
|
}
|
|
35858
35909
|
),
|
|
35859
|
-
!isMobile && /* @__PURE__ */
|
|
35910
|
+
!isMobile && /* @__PURE__ */ jsx55(
|
|
35860
35911
|
SwapWalletSelectorDesktop,
|
|
35861
35912
|
{
|
|
35862
35913
|
walletStatus,
|
|
@@ -35893,11 +35944,11 @@ import {
|
|
|
35893
35944
|
useCallback as useCallback22,
|
|
35894
35945
|
useEffect as useEffect34,
|
|
35895
35946
|
useMemo as useMemo29,
|
|
35896
|
-
useRef as
|
|
35947
|
+
useRef as useRef19,
|
|
35897
35948
|
useState as useState34
|
|
35898
35949
|
} from "react";
|
|
35899
35950
|
import ReactDOM from "react-dom";
|
|
35900
|
-
import { Fragment as
|
|
35951
|
+
import { Fragment as Fragment14, jsx as jsx56, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
35901
35952
|
function fmtAmount(n, max = 6) {
|
|
35902
35953
|
if (!isFinite(n) || n === 0) return "0";
|
|
35903
35954
|
return n.toLocaleString(void 0, { maximumFractionDigits: max });
|
|
@@ -35979,8 +36030,8 @@ function RateRow({ label, value }) {
|
|
|
35979
36030
|
justifyContent: "space-between"
|
|
35980
36031
|
},
|
|
35981
36032
|
children: [
|
|
35982
|
-
/* @__PURE__ */
|
|
35983
|
-
/* @__PURE__ */
|
|
36033
|
+
/* @__PURE__ */ jsx56("span", { style: { color: colors.mutedForeground }, children: label }),
|
|
36034
|
+
/* @__PURE__ */ jsx56("span", { style: { color: colors.foreground, fontWeight: fontWeight.medium }, children: value })
|
|
35984
36035
|
]
|
|
35985
36036
|
}
|
|
35986
36037
|
);
|
|
@@ -36012,13 +36063,13 @@ function SwapMode({
|
|
|
36012
36063
|
const [completedAt, setCompletedAt] = useState34(null);
|
|
36013
36064
|
const [copiedHash, setCopiedHash] = useState34(null);
|
|
36014
36065
|
const [rateUpdated, setRateUpdated] = useState34(false);
|
|
36015
|
-
const prevToAmountRef =
|
|
36066
|
+
const prevToAmountRef = useRef19(null);
|
|
36016
36067
|
const [destAddress, setDestAddress] = useState34("");
|
|
36017
36068
|
const [quoteAge, setQuoteAge] = useState34(0);
|
|
36018
|
-
const quoteTimestampRef =
|
|
36069
|
+
const quoteTimestampRef = useRef19(null);
|
|
36019
36070
|
const [quoteLoadingMsgIdx, setQuoteLoadingMsgIdx] = useState34(0);
|
|
36020
36071
|
const [quoteLoadingMsgVisible, setQuoteLoadingMsgVisible] = useState34(true);
|
|
36021
|
-
const latestFetchParamsRef =
|
|
36072
|
+
const latestFetchParamsRef = useRef19(null);
|
|
36022
36073
|
const { rates: forexRates } = useForex();
|
|
36023
36074
|
const currencyMeta = getCurrencyMeta(selectedCurrency);
|
|
36024
36075
|
const currencyRate = forexRates[selectedCurrency] ?? 1;
|
|
@@ -36034,9 +36085,12 @@ function SwapMode({
|
|
|
36034
36085
|
},
|
|
36035
36086
|
[currencyRate, selectedCurrency]
|
|
36036
36087
|
);
|
|
36037
|
-
const settingsRef =
|
|
36038
|
-
const currencyDropdownRef =
|
|
36088
|
+
const settingsRef = useRef19(null);
|
|
36089
|
+
const currencyDropdownRef = useRef19(null);
|
|
36039
36090
|
const { emitEvent } = useTrustware();
|
|
36091
|
+
const { trackEvent } = useGTMTracker();
|
|
36092
|
+
const initiatedAttemptRef = useRef19(null);
|
|
36093
|
+
const completedAttemptRef = useRef19(null);
|
|
36040
36094
|
const { features, theme: configTheme } = useTrustwareConfig();
|
|
36041
36095
|
const effectiveThemeSetting = themeProp ?? configTheme ?? "system";
|
|
36042
36096
|
const { resolvedTheme, toggleTheme } = useThemePreference(
|
|
@@ -36069,7 +36123,7 @@ function SwapMode({
|
|
|
36069
36123
|
() => [...popularChains, ...otherChains],
|
|
36070
36124
|
[popularChains, otherChains]
|
|
36071
36125
|
);
|
|
36072
|
-
const destInitialized =
|
|
36126
|
+
const destInitialized = useRef19(false);
|
|
36073
36127
|
useEffect34(() => {
|
|
36074
36128
|
if (!defaultDestRef || destInitialized.current || allChains.length === 0)
|
|
36075
36129
|
return;
|
|
@@ -36278,6 +36332,16 @@ function SwapMode({
|
|
|
36278
36332
|
}, []);
|
|
36279
36333
|
const handleExecute = useCallback22(async () => {
|
|
36280
36334
|
if (!route.data) return;
|
|
36335
|
+
const paymentParams = buildSwapPaymentParams({
|
|
36336
|
+
fromChain,
|
|
36337
|
+
fromToken,
|
|
36338
|
+
toChain,
|
|
36339
|
+
toToken,
|
|
36340
|
+
domain: window.origin
|
|
36341
|
+
});
|
|
36342
|
+
if (claimAttemptOnce(initiatedAttemptRef, route.data)) {
|
|
36343
|
+
trackEvent("payment_initiated", paymentParams);
|
|
36344
|
+
}
|
|
36281
36345
|
setStage("processing");
|
|
36282
36346
|
const fromTokenAddress = fromToken?.address ?? fromToken?.address;
|
|
36283
36347
|
const fromTokenDecimals = fromToken?.decimals ?? void 0;
|
|
@@ -36293,12 +36357,25 @@ function SwapMode({
|
|
|
36293
36357
|
walletAddress ?? void 0,
|
|
36294
36358
|
maxApproval,
|
|
36295
36359
|
() => {
|
|
36360
|
+
if (claimAttemptOnce(completedAttemptRef, routeToSend)) {
|
|
36361
|
+
trackEvent("payment_completed", paymentParams);
|
|
36362
|
+
}
|
|
36296
36363
|
setCompletedAt(/* @__PURE__ */ new Date());
|
|
36297
36364
|
setStage("success");
|
|
36298
36365
|
},
|
|
36299
36366
|
() => setStage("error")
|
|
36300
36367
|
);
|
|
36301
|
-
}, [
|
|
36368
|
+
}, [
|
|
36369
|
+
route,
|
|
36370
|
+
execution,
|
|
36371
|
+
fromChain,
|
|
36372
|
+
fromToken,
|
|
36373
|
+
toChain,
|
|
36374
|
+
toToken,
|
|
36375
|
+
walletAddress,
|
|
36376
|
+
maxApproval,
|
|
36377
|
+
trackEvent
|
|
36378
|
+
]);
|
|
36302
36379
|
const handleReset = useCallback22(() => {
|
|
36303
36380
|
execution.reset();
|
|
36304
36381
|
route.clear();
|
|
@@ -36508,7 +36585,7 @@ function SwapMode({
|
|
|
36508
36585
|
useEffect34(() => {
|
|
36509
36586
|
setDestAddress("");
|
|
36510
36587
|
}, [toChainType]);
|
|
36511
|
-
const fetchRef =
|
|
36588
|
+
const fetchRef = useRef19(route.fetch);
|
|
36512
36589
|
useEffect34(() => {
|
|
36513
36590
|
fetchRef.current = route.fetch;
|
|
36514
36591
|
});
|
|
@@ -36572,7 +36649,7 @@ function SwapMode({
|
|
|
36572
36649
|
quoteTimestampRef.current = route.data ? Date.now() : null;
|
|
36573
36650
|
setQuoteAge(0);
|
|
36574
36651
|
}, [route.data]);
|
|
36575
|
-
const msgTimeoutRef =
|
|
36652
|
+
const msgTimeoutRef = useRef19(null);
|
|
36576
36653
|
useEffect34(() => {
|
|
36577
36654
|
if (!route.loading) {
|
|
36578
36655
|
setQuoteLoadingMsgIdx(0);
|
|
@@ -36645,7 +36722,7 @@ function SwapMode({
|
|
|
36645
36722
|
return () => document.removeEventListener("mousedown", handler);
|
|
36646
36723
|
}, [showCurrencyDropdown]);
|
|
36647
36724
|
if (stage === "select-from") {
|
|
36648
|
-
return /* @__PURE__ */
|
|
36725
|
+
return /* @__PURE__ */ jsx56(WidgetContainer, { theme: resolvedTheme, style, children: /* @__PURE__ */ jsx56(
|
|
36649
36726
|
SwapTokenSelect,
|
|
36650
36727
|
{
|
|
36651
36728
|
side: "from",
|
|
@@ -36663,7 +36740,7 @@ function SwapMode({
|
|
|
36663
36740
|
) });
|
|
36664
36741
|
}
|
|
36665
36742
|
if (stage === "select-to" && !lockDestToken) {
|
|
36666
|
-
return /* @__PURE__ */
|
|
36743
|
+
return /* @__PURE__ */ jsx56(WidgetContainer, { theme: resolvedTheme, style, children: /* @__PURE__ */ jsx56(
|
|
36667
36744
|
SwapTokenSelect,
|
|
36668
36745
|
{
|
|
36669
36746
|
side: "to",
|
|
@@ -36683,7 +36760,7 @@ function SwapMode({
|
|
|
36683
36760
|
}
|
|
36684
36761
|
if (stage === "connect-wallet") {
|
|
36685
36762
|
return /* @__PURE__ */ jsxs46(WidgetContainer, { theme: resolvedTheme, style, children: [
|
|
36686
|
-
/* @__PURE__ */
|
|
36763
|
+
/* @__PURE__ */ jsx56(
|
|
36687
36764
|
SwapWalletSelector_default,
|
|
36688
36765
|
{
|
|
36689
36766
|
walletStatus,
|
|
@@ -36692,7 +36769,7 @@ function SwapMode({
|
|
|
36692
36769
|
onBack: handleWalletConnected
|
|
36693
36770
|
}
|
|
36694
36771
|
),
|
|
36695
|
-
isConnected && /* @__PURE__ */
|
|
36772
|
+
isConnected && /* @__PURE__ */ jsx56("div", { style: { padding: `0 ${spacing[4]} ${spacing[4]}` }, children: /* @__PURE__ */ jsx56(
|
|
36696
36773
|
"button",
|
|
36697
36774
|
{
|
|
36698
36775
|
onClick: () => setStage("home"),
|
|
@@ -36725,7 +36802,7 @@ function SwapMode({
|
|
|
36725
36802
|
const offset = circ - progress / 100 * circ;
|
|
36726
36803
|
const isApproving = txStatus === "approving";
|
|
36727
36804
|
const title = isApproving ? "Approving..." : "Order Submitted";
|
|
36728
|
-
return /* @__PURE__ */
|
|
36805
|
+
return /* @__PURE__ */ jsx56(WidgetContainer, { theme: resolvedTheme, style, children: /* @__PURE__ */ jsxs46("div", { style: { padding: `${spacing[5]} ${spacing[6]} ${spacing[6]}` }, children: [
|
|
36729
36806
|
/* @__PURE__ */ jsxs46(
|
|
36730
36807
|
"div",
|
|
36731
36808
|
{
|
|
@@ -36736,7 +36813,7 @@ function SwapMode({
|
|
|
36736
36813
|
marginBottom: spacing[5]
|
|
36737
36814
|
},
|
|
36738
36815
|
children: [
|
|
36739
|
-
/* @__PURE__ */
|
|
36816
|
+
/* @__PURE__ */ jsx56(
|
|
36740
36817
|
"button",
|
|
36741
36818
|
{
|
|
36742
36819
|
onClick: handleReset,
|
|
@@ -36751,7 +36828,7 @@ function SwapMode({
|
|
|
36751
36828
|
border: 0,
|
|
36752
36829
|
cursor: "pointer"
|
|
36753
36830
|
},
|
|
36754
|
-
children: /* @__PURE__ */
|
|
36831
|
+
children: /* @__PURE__ */ jsx56(
|
|
36755
36832
|
"svg",
|
|
36756
36833
|
{
|
|
36757
36834
|
style: {
|
|
@@ -36765,12 +36842,12 @@ function SwapMode({
|
|
|
36765
36842
|
strokeWidth: 2,
|
|
36766
36843
|
strokeLinecap: "round",
|
|
36767
36844
|
strokeLinejoin: "round",
|
|
36768
|
-
children: /* @__PURE__ */
|
|
36845
|
+
children: /* @__PURE__ */ jsx56("path", { d: "M19 12H5m7-7-7 7 7 7" })
|
|
36769
36846
|
}
|
|
36770
36847
|
)
|
|
36771
36848
|
}
|
|
36772
36849
|
),
|
|
36773
|
-
/* @__PURE__ */
|
|
36850
|
+
/* @__PURE__ */ jsx56(
|
|
36774
36851
|
"button",
|
|
36775
36852
|
{
|
|
36776
36853
|
onClick: handleReset,
|
|
@@ -36787,7 +36864,7 @@ function SwapMode({
|
|
|
36787
36864
|
]
|
|
36788
36865
|
}
|
|
36789
36866
|
),
|
|
36790
|
-
/* @__PURE__ */
|
|
36867
|
+
/* @__PURE__ */ jsx56(
|
|
36791
36868
|
"h1",
|
|
36792
36869
|
{
|
|
36793
36870
|
style: {
|
|
@@ -36832,7 +36909,7 @@ function SwapMode({
|
|
|
36832
36909
|
height: ringSize,
|
|
36833
36910
|
style: { position: "absolute", inset: 0 },
|
|
36834
36911
|
children: [
|
|
36835
|
-
/* @__PURE__ */
|
|
36912
|
+
/* @__PURE__ */ jsx56(
|
|
36836
36913
|
"circle",
|
|
36837
36914
|
{
|
|
36838
36915
|
cx: ringSize / 2,
|
|
@@ -36843,7 +36920,7 @@ function SwapMode({
|
|
|
36843
36920
|
strokeWidth: ringStroke
|
|
36844
36921
|
}
|
|
36845
36922
|
),
|
|
36846
|
-
/* @__PURE__ */
|
|
36923
|
+
/* @__PURE__ */ jsx56(
|
|
36847
36924
|
"circle",
|
|
36848
36925
|
{
|
|
36849
36926
|
cx: ringSize / 2,
|
|
@@ -36873,7 +36950,7 @@ function SwapMode({
|
|
|
36873
36950
|
textAlign: "center"
|
|
36874
36951
|
},
|
|
36875
36952
|
children: [
|
|
36876
|
-
/* @__PURE__ */
|
|
36953
|
+
/* @__PURE__ */ jsx56(
|
|
36877
36954
|
"span",
|
|
36878
36955
|
{
|
|
36879
36956
|
style: {
|
|
@@ -36896,7 +36973,7 @@ function SwapMode({
|
|
|
36896
36973
|
gap: spacing[1.5]
|
|
36897
36974
|
},
|
|
36898
36975
|
children: [
|
|
36899
|
-
fromToken?.iconUrl ? /* @__PURE__ */
|
|
36976
|
+
fromToken?.iconUrl ? /* @__PURE__ */ jsx56(
|
|
36900
36977
|
"img",
|
|
36901
36978
|
{
|
|
36902
36979
|
src: fromToken.iconUrl,
|
|
@@ -36907,7 +36984,7 @@ function SwapMode({
|
|
|
36907
36984
|
},
|
|
36908
36985
|
alt: ""
|
|
36909
36986
|
}
|
|
36910
|
-
) : /* @__PURE__ */
|
|
36987
|
+
) : /* @__PURE__ */ jsx56(
|
|
36911
36988
|
"div",
|
|
36912
36989
|
{
|
|
36913
36990
|
style: {
|
|
@@ -36918,7 +36995,7 @@ function SwapMode({
|
|
|
36918
36995
|
}
|
|
36919
36996
|
}
|
|
36920
36997
|
),
|
|
36921
|
-
/* @__PURE__ */
|
|
36998
|
+
/* @__PURE__ */ jsx56(
|
|
36922
36999
|
"svg",
|
|
36923
37000
|
{
|
|
36924
37001
|
style: {
|
|
@@ -36932,10 +37009,10 @@ function SwapMode({
|
|
|
36932
37009
|
strokeWidth: 2,
|
|
36933
37010
|
strokeLinecap: "round",
|
|
36934
37011
|
strokeLinejoin: "round",
|
|
36935
|
-
children: /* @__PURE__ */
|
|
37012
|
+
children: /* @__PURE__ */ jsx56("path", { d: "M5 12h14m-7-7 7 7-7 7" })
|
|
36936
37013
|
}
|
|
36937
37014
|
),
|
|
36938
|
-
toToken?.iconUrl ? /* @__PURE__ */
|
|
37015
|
+
toToken?.iconUrl ? /* @__PURE__ */ jsx56(
|
|
36939
37016
|
"img",
|
|
36940
37017
|
{
|
|
36941
37018
|
src: toToken.iconUrl,
|
|
@@ -36946,7 +37023,7 @@ function SwapMode({
|
|
|
36946
37023
|
},
|
|
36947
37024
|
alt: ""
|
|
36948
37025
|
}
|
|
36949
|
-
) : /* @__PURE__ */
|
|
37026
|
+
) : /* @__PURE__ */ jsx56(
|
|
36950
37027
|
"div",
|
|
36951
37028
|
{
|
|
36952
37029
|
style: {
|
|
@@ -36972,7 +37049,7 @@ function SwapMode({
|
|
|
36972
37049
|
children: [
|
|
36973
37050
|
fromToken?.symbol,
|
|
36974
37051
|
" ",
|
|
36975
|
-
/* @__PURE__ */
|
|
37052
|
+
/* @__PURE__ */ jsx56(
|
|
36976
37053
|
"span",
|
|
36977
37054
|
{
|
|
36978
37055
|
style: {
|
|
@@ -37017,7 +37094,7 @@ function SwapMode({
|
|
|
37017
37094
|
justifyContent: "space-between"
|
|
37018
37095
|
},
|
|
37019
37096
|
children: [
|
|
37020
|
-
/* @__PURE__ */
|
|
37097
|
+
/* @__PURE__ */ jsx56(
|
|
37021
37098
|
ProcessingStepNode,
|
|
37022
37099
|
{
|
|
37023
37100
|
active: activeStep >= 0,
|
|
@@ -37026,8 +37103,8 @@ function SwapMode({
|
|
|
37026
37103
|
label: `Sending ${fromToken?.symbol ?? ""}`
|
|
37027
37104
|
}
|
|
37028
37105
|
),
|
|
37029
|
-
/* @__PURE__ */
|
|
37030
|
-
/* @__PURE__ */
|
|
37106
|
+
/* @__PURE__ */ jsx56(ProcessingStepLine, { done: activeStep > 0 }),
|
|
37107
|
+
/* @__PURE__ */ jsx56(
|
|
37031
37108
|
ProcessingStepNode,
|
|
37032
37109
|
{
|
|
37033
37110
|
active: activeStep >= 1,
|
|
@@ -37036,8 +37113,8 @@ function SwapMode({
|
|
|
37036
37113
|
label: "Create Order"
|
|
37037
37114
|
}
|
|
37038
37115
|
),
|
|
37039
|
-
/* @__PURE__ */
|
|
37040
|
-
/* @__PURE__ */
|
|
37116
|
+
/* @__PURE__ */ jsx56(ProcessingStepLine, { done: activeStep > 1 }),
|
|
37117
|
+
/* @__PURE__ */ jsx56(
|
|
37041
37118
|
ProcessingStepNode,
|
|
37042
37119
|
{
|
|
37043
37120
|
active: activeStep >= 2,
|
|
@@ -37095,16 +37172,16 @@ function SwapMode({
|
|
|
37095
37172
|
strokeLinecap: "round",
|
|
37096
37173
|
strokeLinejoin: "round",
|
|
37097
37174
|
children: [
|
|
37098
|
-
/* @__PURE__ */
|
|
37099
|
-
/* @__PURE__ */
|
|
37100
|
-
/* @__PURE__ */
|
|
37175
|
+
/* @__PURE__ */ jsx56("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }),
|
|
37176
|
+
/* @__PURE__ */ jsx56("polyline", { points: "15 3 21 3 21 9" }),
|
|
37177
|
+
/* @__PURE__ */ jsx56("line", { x1: "10", y1: "14", x2: "21", y2: "3" })
|
|
37101
37178
|
]
|
|
37102
37179
|
}
|
|
37103
37180
|
)
|
|
37104
37181
|
]
|
|
37105
37182
|
}
|
|
37106
37183
|
),
|
|
37107
|
-
/* @__PURE__ */
|
|
37184
|
+
/* @__PURE__ */ jsx56(
|
|
37108
37185
|
"button",
|
|
37109
37186
|
{
|
|
37110
37187
|
onClick: () => handleCopyHash(txHash),
|
|
@@ -37121,7 +37198,7 @@ function SwapMode({
|
|
|
37121
37198
|
padding: 0,
|
|
37122
37199
|
transition: "color 0.15s"
|
|
37123
37200
|
},
|
|
37124
|
-
children: isCopied ? "Copied!" : /* @__PURE__ */ jsxs46(
|
|
37201
|
+
children: isCopied ? "Copied!" : /* @__PURE__ */ jsxs46(Fragment14, { children: [
|
|
37125
37202
|
txHash.slice(0, 6),
|
|
37126
37203
|
"\u2026",
|
|
37127
37204
|
txHash.slice(-4),
|
|
@@ -37136,7 +37213,7 @@ function SwapMode({
|
|
|
37136
37213
|
strokeLinecap: "round",
|
|
37137
37214
|
strokeLinejoin: "round",
|
|
37138
37215
|
children: [
|
|
37139
|
-
/* @__PURE__ */
|
|
37216
|
+
/* @__PURE__ */ jsx56(
|
|
37140
37217
|
"rect",
|
|
37141
37218
|
{
|
|
37142
37219
|
x: "9",
|
|
@@ -37147,7 +37224,7 @@ function SwapMode({
|
|
|
37147
37224
|
ry: "2"
|
|
37148
37225
|
}
|
|
37149
37226
|
),
|
|
37150
|
-
/* @__PURE__ */
|
|
37227
|
+
/* @__PURE__ */ jsx56("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
37151
37228
|
]
|
|
37152
37229
|
}
|
|
37153
37230
|
)
|
|
@@ -37175,8 +37252,8 @@ function SwapMode({
|
|
|
37175
37252
|
dateStyle: "medium",
|
|
37176
37253
|
timeStyle: "short"
|
|
37177
37254
|
}) ?? null;
|
|
37178
|
-
return /* @__PURE__ */
|
|
37179
|
-
/* @__PURE__ */
|
|
37255
|
+
return /* @__PURE__ */ jsx56(WidgetContainer, { theme: resolvedTheme, style, children: /* @__PURE__ */ jsxs46("div", { style: { position: "relative", overflow: "hidden" }, children: [
|
|
37256
|
+
/* @__PURE__ */ jsx56(Suspense2, { fallback: null, children: /* @__PURE__ */ jsx56(ConfettiEffect3, { isActive: true, pieceCount: 60, clearDelay: 4e3 }) }),
|
|
37180
37257
|
/* @__PURE__ */ jsxs46("div", { style: { padding: `${spacing[6]} ${spacing[6]} 0` }, children: [
|
|
37181
37258
|
/* @__PURE__ */ jsxs46(
|
|
37182
37259
|
"div",
|
|
@@ -37188,7 +37265,7 @@ function SwapMode({
|
|
|
37188
37265
|
marginBottom: spacing[5]
|
|
37189
37266
|
},
|
|
37190
37267
|
children: [
|
|
37191
|
-
/* @__PURE__ */
|
|
37268
|
+
/* @__PURE__ */ jsx56(
|
|
37192
37269
|
"div",
|
|
37193
37270
|
{
|
|
37194
37271
|
style: {
|
|
@@ -37201,7 +37278,7 @@ function SwapMode({
|
|
|
37201
37278
|
justifyContent: "center",
|
|
37202
37279
|
flexShrink: 0
|
|
37203
37280
|
},
|
|
37204
|
-
children: /* @__PURE__ */
|
|
37281
|
+
children: /* @__PURE__ */ jsx56(
|
|
37205
37282
|
"svg",
|
|
37206
37283
|
{
|
|
37207
37284
|
style: {
|
|
@@ -37215,12 +37292,12 @@ function SwapMode({
|
|
|
37215
37292
|
strokeWidth: 3,
|
|
37216
37293
|
strokeLinecap: "round",
|
|
37217
37294
|
strokeLinejoin: "round",
|
|
37218
|
-
children: /* @__PURE__ */
|
|
37295
|
+
children: /* @__PURE__ */ jsx56("path", { d: "M20 6L9 17l-5-5" })
|
|
37219
37296
|
}
|
|
37220
37297
|
)
|
|
37221
37298
|
}
|
|
37222
37299
|
),
|
|
37223
|
-
/* @__PURE__ */
|
|
37300
|
+
/* @__PURE__ */ jsx56(
|
|
37224
37301
|
"h2",
|
|
37225
37302
|
{
|
|
37226
37303
|
style: {
|
|
@@ -37264,7 +37341,7 @@ function SwapMode({
|
|
|
37264
37341
|
},
|
|
37265
37342
|
children: [
|
|
37266
37343
|
fromToken?.iconUrl && /* @__PURE__ */ jsxs46("div", { style: { position: "relative", flexShrink: 0 }, children: [
|
|
37267
|
-
/* @__PURE__ */
|
|
37344
|
+
/* @__PURE__ */ jsx56(
|
|
37268
37345
|
"img",
|
|
37269
37346
|
{
|
|
37270
37347
|
src: fromToken.iconUrl,
|
|
@@ -37276,7 +37353,7 @@ function SwapMode({
|
|
|
37276
37353
|
}
|
|
37277
37354
|
}
|
|
37278
37355
|
),
|
|
37279
|
-
fromChain?.chainIconURI && /* @__PURE__ */
|
|
37356
|
+
fromChain?.chainIconURI && /* @__PURE__ */ jsx56(
|
|
37280
37357
|
"img",
|
|
37281
37358
|
{
|
|
37282
37359
|
src: fromChain.chainIconURI,
|
|
@@ -37294,7 +37371,7 @@ function SwapMode({
|
|
|
37294
37371
|
}
|
|
37295
37372
|
)
|
|
37296
37373
|
] }),
|
|
37297
|
-
/* @__PURE__ */
|
|
37374
|
+
/* @__PURE__ */ jsx56("span", { style: { color: colors.mutedForeground }, children: "You sold" })
|
|
37298
37375
|
]
|
|
37299
37376
|
}
|
|
37300
37377
|
),
|
|
@@ -37336,7 +37413,7 @@ function SwapMode({
|
|
|
37336
37413
|
},
|
|
37337
37414
|
children: [
|
|
37338
37415
|
toToken?.iconUrl && /* @__PURE__ */ jsxs46("div", { style: { position: "relative", flexShrink: 0 }, children: [
|
|
37339
|
-
/* @__PURE__ */
|
|
37416
|
+
/* @__PURE__ */ jsx56(
|
|
37340
37417
|
"img",
|
|
37341
37418
|
{
|
|
37342
37419
|
src: toToken.iconUrl,
|
|
@@ -37348,7 +37425,7 @@ function SwapMode({
|
|
|
37348
37425
|
}
|
|
37349
37426
|
}
|
|
37350
37427
|
),
|
|
37351
|
-
toChain?.chainIconURI && /* @__PURE__ */
|
|
37428
|
+
toChain?.chainIconURI && /* @__PURE__ */ jsx56(
|
|
37352
37429
|
"img",
|
|
37353
37430
|
{
|
|
37354
37431
|
src: toChain.chainIconURI,
|
|
@@ -37366,7 +37443,7 @@ function SwapMode({
|
|
|
37366
37443
|
}
|
|
37367
37444
|
)
|
|
37368
37445
|
] }),
|
|
37369
|
-
/* @__PURE__ */
|
|
37446
|
+
/* @__PURE__ */ jsx56("span", { style: { color: colors.mutedForeground }, children: "Received" })
|
|
37370
37447
|
]
|
|
37371
37448
|
}
|
|
37372
37449
|
),
|
|
@@ -37387,7 +37464,7 @@ function SwapMode({
|
|
|
37387
37464
|
]
|
|
37388
37465
|
}
|
|
37389
37466
|
),
|
|
37390
|
-
/* @__PURE__ */
|
|
37467
|
+
/* @__PURE__ */ jsx56(
|
|
37391
37468
|
"div",
|
|
37392
37469
|
{
|
|
37393
37470
|
style: {
|
|
@@ -37407,28 +37484,28 @@ function SwapMode({
|
|
|
37407
37484
|
fontSize: fontSize.sm
|
|
37408
37485
|
},
|
|
37409
37486
|
children: [
|
|
37410
|
-
fromUsd > 0 && /* @__PURE__ */
|
|
37487
|
+
fromUsd > 0 && /* @__PURE__ */ jsx56(
|
|
37411
37488
|
SuccessReceiptRow,
|
|
37412
37489
|
{
|
|
37413
37490
|
label: "Value sold",
|
|
37414
37491
|
value: fmtLocal(fromUsd)
|
|
37415
37492
|
}
|
|
37416
37493
|
),
|
|
37417
|
-
toUsd > 0 && /* @__PURE__ */
|
|
37494
|
+
toUsd > 0 && /* @__PURE__ */ jsx56(
|
|
37418
37495
|
SuccessReceiptRow,
|
|
37419
37496
|
{
|
|
37420
37497
|
label: "Value received",
|
|
37421
37498
|
value: fmtLocal(toUsd)
|
|
37422
37499
|
}
|
|
37423
37500
|
),
|
|
37424
|
-
effectiveRate && /* @__PURE__ */
|
|
37501
|
+
effectiveRate && /* @__PURE__ */ jsx56(
|
|
37425
37502
|
SuccessReceiptRow,
|
|
37426
37503
|
{
|
|
37427
37504
|
label: "Effective rate",
|
|
37428
37505
|
value: effectiveRate
|
|
37429
37506
|
}
|
|
37430
37507
|
),
|
|
37431
|
-
completedStr && /* @__PURE__ */
|
|
37508
|
+
completedStr && /* @__PURE__ */ jsx56(SuccessReceiptRow, { label: "Completed", value: completedStr }),
|
|
37432
37509
|
txHash && (() => {
|
|
37433
37510
|
const srcUrl = buildExplorerUrl(
|
|
37434
37511
|
txHash,
|
|
@@ -37445,7 +37522,7 @@ function SwapMode({
|
|
|
37445
37522
|
justifyContent: "space-between"
|
|
37446
37523
|
},
|
|
37447
37524
|
children: [
|
|
37448
|
-
/* @__PURE__ */
|
|
37525
|
+
/* @__PURE__ */ jsx56("span", { style: { color: colors.mutedForeground }, children: destTxHash ? "Source tx" : "Transaction" }),
|
|
37449
37526
|
/* @__PURE__ */ jsxs46(
|
|
37450
37527
|
"div",
|
|
37451
37528
|
{
|
|
@@ -37486,16 +37563,16 @@ function SwapMode({
|
|
|
37486
37563
|
strokeLinecap: "round",
|
|
37487
37564
|
strokeLinejoin: "round",
|
|
37488
37565
|
children: [
|
|
37489
|
-
/* @__PURE__ */
|
|
37490
|
-
/* @__PURE__ */
|
|
37491
|
-
/* @__PURE__ */
|
|
37566
|
+
/* @__PURE__ */ jsx56("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }),
|
|
37567
|
+
/* @__PURE__ */ jsx56("polyline", { points: "15 3 21 3 21 9" }),
|
|
37568
|
+
/* @__PURE__ */ jsx56("line", { x1: "10", y1: "14", x2: "21", y2: "3" })
|
|
37492
37569
|
]
|
|
37493
37570
|
}
|
|
37494
37571
|
)
|
|
37495
37572
|
]
|
|
37496
37573
|
}
|
|
37497
37574
|
),
|
|
37498
|
-
/* @__PURE__ */
|
|
37575
|
+
/* @__PURE__ */ jsx56(
|
|
37499
37576
|
"button",
|
|
37500
37577
|
{
|
|
37501
37578
|
onClick: () => handleCopyHash(txHash),
|
|
@@ -37527,7 +37604,7 @@ function SwapMode({
|
|
|
37527
37604
|
strokeLinecap: "round",
|
|
37528
37605
|
strokeLinejoin: "round",
|
|
37529
37606
|
children: [
|
|
37530
|
-
/* @__PURE__ */
|
|
37607
|
+
/* @__PURE__ */ jsx56(
|
|
37531
37608
|
"rect",
|
|
37532
37609
|
{
|
|
37533
37610
|
x: "9",
|
|
@@ -37538,7 +37615,7 @@ function SwapMode({
|
|
|
37538
37615
|
ry: "2"
|
|
37539
37616
|
}
|
|
37540
37617
|
),
|
|
37541
|
-
/* @__PURE__ */
|
|
37618
|
+
/* @__PURE__ */ jsx56("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
37542
37619
|
]
|
|
37543
37620
|
}
|
|
37544
37621
|
)
|
|
@@ -37567,7 +37644,7 @@ function SwapMode({
|
|
|
37567
37644
|
justifyContent: "space-between"
|
|
37568
37645
|
},
|
|
37569
37646
|
children: [
|
|
37570
|
-
/* @__PURE__ */
|
|
37647
|
+
/* @__PURE__ */ jsx56("span", { style: { color: colors.mutedForeground }, children: "Destination tx" }),
|
|
37571
37648
|
/* @__PURE__ */ jsxs46(
|
|
37572
37649
|
"div",
|
|
37573
37650
|
{
|
|
@@ -37608,16 +37685,16 @@ function SwapMode({
|
|
|
37608
37685
|
strokeLinecap: "round",
|
|
37609
37686
|
strokeLinejoin: "round",
|
|
37610
37687
|
children: [
|
|
37611
|
-
/* @__PURE__ */
|
|
37612
|
-
/* @__PURE__ */
|
|
37613
|
-
/* @__PURE__ */
|
|
37688
|
+
/* @__PURE__ */ jsx56("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }),
|
|
37689
|
+
/* @__PURE__ */ jsx56("polyline", { points: "15 3 21 3 21 9" }),
|
|
37690
|
+
/* @__PURE__ */ jsx56("line", { x1: "10", y1: "14", x2: "21", y2: "3" })
|
|
37614
37691
|
]
|
|
37615
37692
|
}
|
|
37616
37693
|
)
|
|
37617
37694
|
]
|
|
37618
37695
|
}
|
|
37619
37696
|
),
|
|
37620
|
-
/* @__PURE__ */
|
|
37697
|
+
/* @__PURE__ */ jsx56(
|
|
37621
37698
|
"button",
|
|
37622
37699
|
{
|
|
37623
37700
|
onClick: () => handleCopyHash(destTxHash),
|
|
@@ -37648,7 +37725,7 @@ function SwapMode({
|
|
|
37648
37725
|
strokeLinecap: "round",
|
|
37649
37726
|
strokeLinejoin: "round",
|
|
37650
37727
|
children: [
|
|
37651
|
-
/* @__PURE__ */
|
|
37728
|
+
/* @__PURE__ */ jsx56(
|
|
37652
37729
|
"rect",
|
|
37653
37730
|
{
|
|
37654
37731
|
x: "9",
|
|
@@ -37659,7 +37736,7 @@ function SwapMode({
|
|
|
37659
37736
|
ry: "2"
|
|
37660
37737
|
}
|
|
37661
37738
|
),
|
|
37662
|
-
/* @__PURE__ */
|
|
37739
|
+
/* @__PURE__ */ jsx56("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
37663
37740
|
]
|
|
37664
37741
|
}
|
|
37665
37742
|
)
|
|
@@ -37689,7 +37766,7 @@ function SwapMode({
|
|
|
37689
37766
|
gap: spacing[2]
|
|
37690
37767
|
},
|
|
37691
37768
|
children: [
|
|
37692
|
-
/* @__PURE__ */
|
|
37769
|
+
/* @__PURE__ */ jsx56(
|
|
37693
37770
|
"button",
|
|
37694
37771
|
{
|
|
37695
37772
|
onClick: handleReset,
|
|
@@ -37736,7 +37813,7 @@ function SwapMode({
|
|
|
37736
37813
|
] }) });
|
|
37737
37814
|
}
|
|
37738
37815
|
if (stage === "error") {
|
|
37739
|
-
return /* @__PURE__ */
|
|
37816
|
+
return /* @__PURE__ */ jsx56(WidgetContainer, { theme: resolvedTheme, style, children: /* @__PURE__ */ jsx56(
|
|
37740
37817
|
ErrorPage,
|
|
37741
37818
|
{
|
|
37742
37819
|
error: mapError(execution.errorMessage),
|
|
@@ -37748,7 +37825,7 @@ function SwapMode({
|
|
|
37748
37825
|
if (stage === "review") {
|
|
37749
37826
|
const reviewToAmount = toAmount ?? displayToAmount;
|
|
37750
37827
|
const reviewToUsd = toUsd > 0 ? toUsd : displayToUsd;
|
|
37751
|
-
return /* @__PURE__ */
|
|
37828
|
+
return /* @__PURE__ */ jsx56(WidgetContainer, { theme: resolvedTheme, style, children: /* @__PURE__ */ jsxs46(
|
|
37752
37829
|
"div",
|
|
37753
37830
|
{
|
|
37754
37831
|
style: {
|
|
@@ -37767,7 +37844,7 @@ function SwapMode({
|
|
|
37767
37844
|
marginBottom: spacing[5]
|
|
37768
37845
|
},
|
|
37769
37846
|
children: [
|
|
37770
|
-
/* @__PURE__ */
|
|
37847
|
+
/* @__PURE__ */ jsx56(
|
|
37771
37848
|
"span",
|
|
37772
37849
|
{
|
|
37773
37850
|
style: {
|
|
@@ -37778,7 +37855,7 @@ function SwapMode({
|
|
|
37778
37855
|
children: "You're swapping"
|
|
37779
37856
|
}
|
|
37780
37857
|
),
|
|
37781
|
-
/* @__PURE__ */
|
|
37858
|
+
/* @__PURE__ */ jsx56(
|
|
37782
37859
|
"button",
|
|
37783
37860
|
{
|
|
37784
37861
|
onClick: () => setStage("home"),
|
|
@@ -37793,7 +37870,7 @@ function SwapMode({
|
|
|
37793
37870
|
border: 0,
|
|
37794
37871
|
cursor: "pointer"
|
|
37795
37872
|
},
|
|
37796
|
-
children: /* @__PURE__ */
|
|
37873
|
+
children: /* @__PURE__ */ jsx56(
|
|
37797
37874
|
"svg",
|
|
37798
37875
|
{
|
|
37799
37876
|
style: {
|
|
@@ -37807,7 +37884,7 @@ function SwapMode({
|
|
|
37807
37884
|
strokeWidth: 2,
|
|
37808
37885
|
strokeLinecap: "round",
|
|
37809
37886
|
strokeLinejoin: "round",
|
|
37810
|
-
children: /* @__PURE__ */
|
|
37887
|
+
children: /* @__PURE__ */ jsx56("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
37811
37888
|
}
|
|
37812
37889
|
)
|
|
37813
37890
|
}
|
|
@@ -37841,7 +37918,7 @@ function SwapMode({
|
|
|
37841
37918
|
]
|
|
37842
37919
|
}
|
|
37843
37920
|
),
|
|
37844
|
-
/* @__PURE__ */
|
|
37921
|
+
/* @__PURE__ */ jsx56(
|
|
37845
37922
|
"p",
|
|
37846
37923
|
{
|
|
37847
37924
|
style: {
|
|
@@ -37853,7 +37930,7 @@ function SwapMode({
|
|
|
37853
37930
|
}
|
|
37854
37931
|
)
|
|
37855
37932
|
] }),
|
|
37856
|
-
fromToken?.iconUrl && /* @__PURE__ */
|
|
37933
|
+
fromToken?.iconUrl && /* @__PURE__ */ jsx56(
|
|
37857
37934
|
TokenIcon,
|
|
37858
37935
|
{
|
|
37859
37936
|
icon: fromToken.iconUrl,
|
|
@@ -37864,7 +37941,7 @@ function SwapMode({
|
|
|
37864
37941
|
]
|
|
37865
37942
|
}
|
|
37866
37943
|
),
|
|
37867
|
-
/* @__PURE__ */
|
|
37944
|
+
/* @__PURE__ */ jsx56(
|
|
37868
37945
|
"div",
|
|
37869
37946
|
{
|
|
37870
37947
|
style: {
|
|
@@ -37872,7 +37949,7 @@ function SwapMode({
|
|
|
37872
37949
|
justifyContent: "center",
|
|
37873
37950
|
margin: `${spacing[3]} 0`
|
|
37874
37951
|
},
|
|
37875
|
-
children: /* @__PURE__ */
|
|
37952
|
+
children: /* @__PURE__ */ jsx56(
|
|
37876
37953
|
"svg",
|
|
37877
37954
|
{
|
|
37878
37955
|
style: {
|
|
@@ -37886,7 +37963,7 @@ function SwapMode({
|
|
|
37886
37963
|
strokeWidth: 2,
|
|
37887
37964
|
strokeLinecap: "round",
|
|
37888
37965
|
strokeLinejoin: "round",
|
|
37889
|
-
children: /* @__PURE__ */
|
|
37966
|
+
children: /* @__PURE__ */ jsx56("path", { d: "M12 5v14m-7-7l7 7 7-7" })
|
|
37890
37967
|
}
|
|
37891
37968
|
)
|
|
37892
37969
|
}
|
|
@@ -37917,7 +37994,7 @@ function SwapMode({
|
|
|
37917
37994
|
]
|
|
37918
37995
|
}
|
|
37919
37996
|
),
|
|
37920
|
-
/* @__PURE__ */
|
|
37997
|
+
/* @__PURE__ */ jsx56(
|
|
37921
37998
|
"p",
|
|
37922
37999
|
{
|
|
37923
38000
|
style: {
|
|
@@ -37929,7 +38006,7 @@ function SwapMode({
|
|
|
37929
38006
|
}
|
|
37930
38007
|
)
|
|
37931
38008
|
] }),
|
|
37932
|
-
toToken?.iconUrl && /* @__PURE__ */
|
|
38009
|
+
toToken?.iconUrl && /* @__PURE__ */ jsx56(
|
|
37933
38010
|
TokenIcon,
|
|
37934
38011
|
{
|
|
37935
38012
|
icon: toToken.iconUrl,
|
|
@@ -37959,7 +38036,7 @@ function SwapMode({
|
|
|
37959
38036
|
padding: 0
|
|
37960
38037
|
},
|
|
37961
38038
|
children: [
|
|
37962
|
-
/* @__PURE__ */
|
|
38039
|
+
/* @__PURE__ */ jsx56(
|
|
37963
38040
|
"div",
|
|
37964
38041
|
{
|
|
37965
38042
|
style: { flex: 1, height: "1px", backgroundColor: colors.border }
|
|
@@ -37977,7 +38054,7 @@ function SwapMode({
|
|
|
37977
38054
|
},
|
|
37978
38055
|
children: [
|
|
37979
38056
|
showReviewDetails ? "Hide details" : "View details",
|
|
37980
|
-
/* @__PURE__ */
|
|
38057
|
+
/* @__PURE__ */ jsx56(
|
|
37981
38058
|
"svg",
|
|
37982
38059
|
{
|
|
37983
38060
|
style: {
|
|
@@ -37992,7 +38069,7 @@ function SwapMode({
|
|
|
37992
38069
|
strokeWidth: 2,
|
|
37993
38070
|
strokeLinecap: "round",
|
|
37994
38071
|
strokeLinejoin: "round",
|
|
37995
|
-
children: /* @__PURE__ */
|
|
38072
|
+
children: /* @__PURE__ */ jsx56("path", { d: "M6 9l6 6 6-6" })
|
|
37996
38073
|
}
|
|
37997
38074
|
),
|
|
37998
38075
|
route.data && /* @__PURE__ */ jsxs46(
|
|
@@ -38008,7 +38085,7 @@ function SwapMode({
|
|
|
38008
38085
|
marginLeft: "0.125rem"
|
|
38009
38086
|
},
|
|
38010
38087
|
children: [
|
|
38011
|
-
/* @__PURE__ */
|
|
38088
|
+
/* @__PURE__ */ jsx56(
|
|
38012
38089
|
"circle",
|
|
38013
38090
|
{
|
|
38014
38091
|
cx: "7",
|
|
@@ -38019,7 +38096,7 @@ function SwapMode({
|
|
|
38019
38096
|
strokeWidth: "1.5"
|
|
38020
38097
|
}
|
|
38021
38098
|
),
|
|
38022
|
-
/* @__PURE__ */
|
|
38099
|
+
/* @__PURE__ */ jsx56(
|
|
38023
38100
|
"circle",
|
|
38024
38101
|
{
|
|
38025
38102
|
cx: "7",
|
|
@@ -38040,7 +38117,7 @@ function SwapMode({
|
|
|
38040
38117
|
]
|
|
38041
38118
|
}
|
|
38042
38119
|
),
|
|
38043
|
-
/* @__PURE__ */
|
|
38120
|
+
/* @__PURE__ */ jsx56(
|
|
38044
38121
|
"div",
|
|
38045
38122
|
{
|
|
38046
38123
|
style: { flex: 1, height: "1px", backgroundColor: colors.border }
|
|
@@ -38060,7 +38137,7 @@ function SwapMode({
|
|
|
38060
38137
|
marginBottom: spacing[2]
|
|
38061
38138
|
},
|
|
38062
38139
|
children: [
|
|
38063
|
-
exchangeRate !== null && /* @__PURE__ */
|
|
38140
|
+
exchangeRate !== null && /* @__PURE__ */ jsx56(
|
|
38064
38141
|
ReviewDetailRow,
|
|
38065
38142
|
{
|
|
38066
38143
|
label: "Rate",
|
|
@@ -38068,7 +38145,7 @@ function SwapMode({
|
|
|
38068
38145
|
value: `1 ${fromToken?.symbol} = ${fmtAmount(1 / (exchangeRate ?? 1), 4)} ${toToken?.symbol} ($${fmtAmount(fromTokenPriceUSD, 2)})`
|
|
38069
38146
|
}
|
|
38070
38147
|
),
|
|
38071
|
-
/* @__PURE__ */
|
|
38148
|
+
/* @__PURE__ */ jsx56(
|
|
38072
38149
|
ReviewDetailRow,
|
|
38073
38150
|
{
|
|
38074
38151
|
label: "Fee",
|
|
@@ -38076,12 +38153,12 @@ function SwapMode({
|
|
|
38076
38153
|
value: protocolFeeUsd !== null ? fmtLocal(protocolFeeUsd) : "Free"
|
|
38077
38154
|
}
|
|
38078
38155
|
),
|
|
38079
|
-
/* @__PURE__ */
|
|
38156
|
+
/* @__PURE__ */ jsx56(
|
|
38080
38157
|
ReviewDetailRow,
|
|
38081
38158
|
{
|
|
38082
38159
|
label: "Network cost",
|
|
38083
38160
|
tooltip: "Estimated gas fee paid to the blockchain network",
|
|
38084
|
-
value: isGasSponsored ? /* @__PURE__ */
|
|
38161
|
+
value: isGasSponsored ? /* @__PURE__ */ jsx56(SponsoredBadge, {}) : networkCostUsd !== null ? /* @__PURE__ */ jsxs46(
|
|
38085
38162
|
"span",
|
|
38086
38163
|
{
|
|
38087
38164
|
style: {
|
|
@@ -38090,14 +38167,14 @@ function SwapMode({
|
|
|
38090
38167
|
gap: "0.25rem"
|
|
38091
38168
|
},
|
|
38092
38169
|
children: [
|
|
38093
|
-
/* @__PURE__ */
|
|
38170
|
+
/* @__PURE__ */ jsx56(GasIcon, { size: "0.875rem" }),
|
|
38094
38171
|
fmtLocal(networkCostUsd)
|
|
38095
38172
|
]
|
|
38096
38173
|
}
|
|
38097
38174
|
) : "\u2014"
|
|
38098
38175
|
}
|
|
38099
38176
|
),
|
|
38100
|
-
/* @__PURE__ */
|
|
38177
|
+
/* @__PURE__ */ jsx56(
|
|
38101
38178
|
ReviewDetailRow,
|
|
38102
38179
|
{
|
|
38103
38180
|
label: "Max slippage",
|
|
@@ -38105,12 +38182,12 @@ function SwapMode({
|
|
|
38105
38182
|
value: `${slippage}%`
|
|
38106
38183
|
}
|
|
38107
38184
|
),
|
|
38108
|
-
(routePath || route.data?.route?.provider) && /* @__PURE__ */
|
|
38185
|
+
(routePath || route.data?.route?.provider) && /* @__PURE__ */ jsx56(
|
|
38109
38186
|
ReviewDetailRow,
|
|
38110
38187
|
{
|
|
38111
38188
|
label: "Route",
|
|
38112
38189
|
tooltip: "Protocol or bridge used to execute your swap",
|
|
38113
|
-
value: /* @__PURE__ */
|
|
38190
|
+
value: /* @__PURE__ */ jsx56(
|
|
38114
38191
|
"span",
|
|
38115
38192
|
{
|
|
38116
38193
|
style: {
|
|
@@ -38130,7 +38207,7 @@ function SwapMode({
|
|
|
38130
38207
|
]
|
|
38131
38208
|
}
|
|
38132
38209
|
),
|
|
38133
|
-
/* @__PURE__ */
|
|
38210
|
+
/* @__PURE__ */ jsx56(
|
|
38134
38211
|
SwapActionArea,
|
|
38135
38212
|
{
|
|
38136
38213
|
fromTokenSymbol: fromToken?.symbol ?? "",
|
|
@@ -38154,7 +38231,7 @@ function SwapMode({
|
|
|
38154
38231
|
const ctaDisabled = !hasTokens || !hasAmount || insufficient || isConnected && needsDestAddress && !isValidDestAddress || route.loading || feesExceedOutput;
|
|
38155
38232
|
const ctaAction = !isConnected ? handleConnectAndReview : () => void handleReview();
|
|
38156
38233
|
const showRateRow = hasTokens && exchangeRate !== null;
|
|
38157
|
-
return /* @__PURE__ */
|
|
38234
|
+
return /* @__PURE__ */ jsx56(WidgetContainer, { theme: resolvedTheme, style, children: /* @__PURE__ */ jsxs46(
|
|
38158
38235
|
"div",
|
|
38159
38236
|
{
|
|
38160
38237
|
style: { display: "flex", flexDirection: "column", minHeight: "500px" },
|
|
@@ -38170,7 +38247,7 @@ function SwapMode({
|
|
|
38170
38247
|
marginBottom: spacing[1]
|
|
38171
38248
|
},
|
|
38172
38249
|
children: [
|
|
38173
|
-
/* @__PURE__ */
|
|
38250
|
+
/* @__PURE__ */ jsx56(
|
|
38174
38251
|
"span",
|
|
38175
38252
|
{
|
|
38176
38253
|
style: {
|
|
@@ -38212,7 +38289,7 @@ function SwapMode({
|
|
|
38212
38289
|
walletAddress.slice(-4)
|
|
38213
38290
|
]
|
|
38214
38291
|
}
|
|
38215
|
-
) : /* @__PURE__ */
|
|
38292
|
+
) : /* @__PURE__ */ jsx56(
|
|
38216
38293
|
"button",
|
|
38217
38294
|
{
|
|
38218
38295
|
onClick: handleConnectAndReview,
|
|
@@ -38227,7 +38304,7 @@ function SwapMode({
|
|
|
38227
38304
|
children: "Connect wallet"
|
|
38228
38305
|
}
|
|
38229
38306
|
),
|
|
38230
|
-
/* @__PURE__ */
|
|
38307
|
+
/* @__PURE__ */ jsx56(
|
|
38231
38308
|
"button",
|
|
38232
38309
|
{
|
|
38233
38310
|
onClick: () => setShowSettings((v) => !v),
|
|
@@ -38256,8 +38333,8 @@ function SwapMode({
|
|
|
38256
38333
|
strokeLinecap: "round",
|
|
38257
38334
|
strokeLinejoin: "round",
|
|
38258
38335
|
children: [
|
|
38259
|
-
/* @__PURE__ */
|
|
38260
|
-
/* @__PURE__ */
|
|
38336
|
+
/* @__PURE__ */ jsx56("circle", { cx: "12", cy: "12", r: "3" }),
|
|
38337
|
+
/* @__PURE__ */ jsx56("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z" })
|
|
38261
38338
|
]
|
|
38262
38339
|
}
|
|
38263
38340
|
)
|
|
@@ -38279,7 +38356,7 @@ function SwapMode({
|
|
|
38279
38356
|
zIndex: 100
|
|
38280
38357
|
},
|
|
38281
38358
|
children: [
|
|
38282
|
-
/* @__PURE__ */
|
|
38359
|
+
/* @__PURE__ */ jsx56(
|
|
38283
38360
|
"p",
|
|
38284
38361
|
{
|
|
38285
38362
|
style: {
|
|
@@ -38293,7 +38370,7 @@ function SwapMode({
|
|
|
38293
38370
|
children: "Appearance"
|
|
38294
38371
|
}
|
|
38295
38372
|
),
|
|
38296
|
-
/* @__PURE__ */
|
|
38373
|
+
/* @__PURE__ */ jsx56("div", { style: { marginBottom: spacing[4] }, children: /* @__PURE__ */ jsxs46(
|
|
38297
38374
|
"div",
|
|
38298
38375
|
{
|
|
38299
38376
|
style: {
|
|
@@ -38303,7 +38380,7 @@ function SwapMode({
|
|
|
38303
38380
|
},
|
|
38304
38381
|
children: [
|
|
38305
38382
|
/* @__PURE__ */ jsxs46("div", { children: [
|
|
38306
|
-
/* @__PURE__ */
|
|
38383
|
+
/* @__PURE__ */ jsx56(
|
|
38307
38384
|
"p",
|
|
38308
38385
|
{
|
|
38309
38386
|
style: {
|
|
@@ -38314,7 +38391,7 @@ function SwapMode({
|
|
|
38314
38391
|
children: "Dark mode"
|
|
38315
38392
|
}
|
|
38316
38393
|
),
|
|
38317
|
-
/* @__PURE__ */
|
|
38394
|
+
/* @__PURE__ */ jsx56(
|
|
38318
38395
|
"p",
|
|
38319
38396
|
{
|
|
38320
38397
|
style: {
|
|
@@ -38326,7 +38403,7 @@ function SwapMode({
|
|
|
38326
38403
|
}
|
|
38327
38404
|
)
|
|
38328
38405
|
] }),
|
|
38329
|
-
/* @__PURE__ */
|
|
38406
|
+
/* @__PURE__ */ jsx56(
|
|
38330
38407
|
"button",
|
|
38331
38408
|
{
|
|
38332
38409
|
role: "switch",
|
|
@@ -38343,7 +38420,7 @@ function SwapMode({
|
|
|
38343
38420
|
transition: "background-color 0.2s",
|
|
38344
38421
|
flexShrink: 0
|
|
38345
38422
|
},
|
|
38346
|
-
children: /* @__PURE__ */
|
|
38423
|
+
children: /* @__PURE__ */ jsx56(
|
|
38347
38424
|
"span",
|
|
38348
38425
|
{
|
|
38349
38426
|
style: {
|
|
@@ -38364,7 +38441,7 @@ function SwapMode({
|
|
|
38364
38441
|
]
|
|
38365
38442
|
}
|
|
38366
38443
|
) }),
|
|
38367
|
-
/* @__PURE__ */
|
|
38444
|
+
/* @__PURE__ */ jsx56(
|
|
38368
38445
|
"p",
|
|
38369
38446
|
{
|
|
38370
38447
|
style: {
|
|
@@ -38379,7 +38456,7 @@ function SwapMode({
|
|
|
38379
38456
|
}
|
|
38380
38457
|
),
|
|
38381
38458
|
/* @__PURE__ */ jsxs46("div", { style: { marginBottom: spacing[4] }, children: [
|
|
38382
|
-
/* @__PURE__ */
|
|
38459
|
+
/* @__PURE__ */ jsx56(
|
|
38383
38460
|
"p",
|
|
38384
38461
|
{
|
|
38385
38462
|
style: {
|
|
@@ -38417,7 +38494,7 @@ function SwapMode({
|
|
|
38417
38494
|
},
|
|
38418
38495
|
v
|
|
38419
38496
|
)),
|
|
38420
|
-
/* @__PURE__ */
|
|
38497
|
+
/* @__PURE__ */ jsx56("div", { style: { flex: 1.5, position: "relative" }, children: /* @__PURE__ */ jsx56(
|
|
38421
38498
|
"input",
|
|
38422
38499
|
{
|
|
38423
38500
|
type: "number",
|
|
@@ -38448,7 +38525,7 @@ function SwapMode({
|
|
|
38448
38525
|
}
|
|
38449
38526
|
) })
|
|
38450
38527
|
] }),
|
|
38451
|
-
slippage > 5 && /* @__PURE__ */
|
|
38528
|
+
slippage > 5 && /* @__PURE__ */ jsx56(
|
|
38452
38529
|
"p",
|
|
38453
38530
|
{
|
|
38454
38531
|
style: {
|
|
@@ -38460,7 +38537,7 @@ function SwapMode({
|
|
|
38460
38537
|
}
|
|
38461
38538
|
)
|
|
38462
38539
|
] }),
|
|
38463
|
-
canSetMaxApproval && /* @__PURE__ */
|
|
38540
|
+
canSetMaxApproval && /* @__PURE__ */ jsx56("div", { style: { marginBottom: spacing[4] }, children: /* @__PURE__ */ jsxs46(
|
|
38464
38541
|
"div",
|
|
38465
38542
|
{
|
|
38466
38543
|
style: {
|
|
@@ -38470,7 +38547,7 @@ function SwapMode({
|
|
|
38470
38547
|
},
|
|
38471
38548
|
children: [
|
|
38472
38549
|
/* @__PURE__ */ jsxs46("div", { children: [
|
|
38473
|
-
/* @__PURE__ */
|
|
38550
|
+
/* @__PURE__ */ jsx56(
|
|
38474
38551
|
"p",
|
|
38475
38552
|
{
|
|
38476
38553
|
style: {
|
|
@@ -38481,7 +38558,7 @@ function SwapMode({
|
|
|
38481
38558
|
children: "Max approval"
|
|
38482
38559
|
}
|
|
38483
38560
|
),
|
|
38484
|
-
/* @__PURE__ */
|
|
38561
|
+
/* @__PURE__ */ jsx56(
|
|
38485
38562
|
"p",
|
|
38486
38563
|
{
|
|
38487
38564
|
style: {
|
|
@@ -38493,7 +38570,7 @@ function SwapMode({
|
|
|
38493
38570
|
}
|
|
38494
38571
|
)
|
|
38495
38572
|
] }),
|
|
38496
|
-
/* @__PURE__ */
|
|
38573
|
+
/* @__PURE__ */ jsx56(
|
|
38497
38574
|
"button",
|
|
38498
38575
|
{
|
|
38499
38576
|
role: "switch",
|
|
@@ -38510,7 +38587,7 @@ function SwapMode({
|
|
|
38510
38587
|
transition: "background-color 0.2s",
|
|
38511
38588
|
flexShrink: 0
|
|
38512
38589
|
},
|
|
38513
|
-
children: /* @__PURE__ */
|
|
38590
|
+
children: /* @__PURE__ */ jsx56(
|
|
38514
38591
|
"span",
|
|
38515
38592
|
{
|
|
38516
38593
|
style: {
|
|
@@ -38541,7 +38618,7 @@ function SwapMode({
|
|
|
38541
38618
|
gap: spacing[3]
|
|
38542
38619
|
},
|
|
38543
38620
|
children: [
|
|
38544
|
-
/* @__PURE__ */
|
|
38621
|
+
/* @__PURE__ */ jsx56(
|
|
38545
38622
|
"p",
|
|
38546
38623
|
{
|
|
38547
38624
|
style: {
|
|
@@ -38579,9 +38656,9 @@ function SwapMode({
|
|
|
38579
38656
|
whiteSpace: "nowrap"
|
|
38580
38657
|
},
|
|
38581
38658
|
children: [
|
|
38582
|
-
/* @__PURE__ */
|
|
38583
|
-
/* @__PURE__ */
|
|
38584
|
-
/* @__PURE__ */
|
|
38659
|
+
/* @__PURE__ */ jsx56("span", { children: currencySymbol }),
|
|
38660
|
+
/* @__PURE__ */ jsx56("span", { children: selectedCurrency }),
|
|
38661
|
+
/* @__PURE__ */ jsx56(
|
|
38585
38662
|
"svg",
|
|
38586
38663
|
{
|
|
38587
38664
|
style: {
|
|
@@ -38597,13 +38674,13 @@ function SwapMode({
|
|
|
38597
38674
|
strokeWidth: 2.5,
|
|
38598
38675
|
strokeLinecap: "round",
|
|
38599
38676
|
strokeLinejoin: "round",
|
|
38600
|
-
children: /* @__PURE__ */
|
|
38677
|
+
children: /* @__PURE__ */ jsx56("path", { d: "M6 9l6 6 6-6" })
|
|
38601
38678
|
}
|
|
38602
38679
|
)
|
|
38603
38680
|
]
|
|
38604
38681
|
}
|
|
38605
38682
|
),
|
|
38606
|
-
showCurrencyDropdown && /* @__PURE__ */
|
|
38683
|
+
showCurrencyDropdown && /* @__PURE__ */ jsx56(
|
|
38607
38684
|
"div",
|
|
38608
38685
|
{
|
|
38609
38686
|
style: {
|
|
@@ -38645,7 +38722,7 @@ function SwapMode({
|
|
|
38645
38722
|
fontFamily: "inherit"
|
|
38646
38723
|
},
|
|
38647
38724
|
children: [
|
|
38648
|
-
/* @__PURE__ */
|
|
38725
|
+
/* @__PURE__ */ jsx56(
|
|
38649
38726
|
"span",
|
|
38650
38727
|
{
|
|
38651
38728
|
style: {
|
|
@@ -38656,8 +38733,8 @@ function SwapMode({
|
|
|
38656
38733
|
children: c.symbol
|
|
38657
38734
|
}
|
|
38658
38735
|
),
|
|
38659
|
-
/* @__PURE__ */
|
|
38660
|
-
/* @__PURE__ */
|
|
38736
|
+
/* @__PURE__ */ jsx56("span", { style: { flexShrink: 0 }, children: c.code }),
|
|
38737
|
+
/* @__PURE__ */ jsx56(
|
|
38661
38738
|
"span",
|
|
38662
38739
|
{
|
|
38663
38740
|
style: {
|
|
@@ -38692,7 +38769,7 @@ function SwapMode({
|
|
|
38692
38769
|
]
|
|
38693
38770
|
}
|
|
38694
38771
|
),
|
|
38695
|
-
/* @__PURE__ */
|
|
38772
|
+
/* @__PURE__ */ jsx56("div", { style: { padding: `0 ${spacing[3]}` }, children: /* @__PURE__ */ jsxs46(
|
|
38696
38773
|
"div",
|
|
38697
38774
|
{
|
|
38698
38775
|
onMouseEnter: () => setHoverSell(true),
|
|
@@ -38714,7 +38791,7 @@ function SwapMode({
|
|
|
38714
38791
|
marginBottom: spacing[1]
|
|
38715
38792
|
},
|
|
38716
38793
|
children: [
|
|
38717
|
-
/* @__PURE__ */
|
|
38794
|
+
/* @__PURE__ */ jsx56(
|
|
38718
38795
|
"span",
|
|
38719
38796
|
{
|
|
38720
38797
|
style: {
|
|
@@ -38725,7 +38802,7 @@ function SwapMode({
|
|
|
38725
38802
|
children: "Sell"
|
|
38726
38803
|
}
|
|
38727
38804
|
),
|
|
38728
|
-
/* @__PURE__ */
|
|
38805
|
+
/* @__PURE__ */ jsx56(
|
|
38729
38806
|
"div",
|
|
38730
38807
|
{
|
|
38731
38808
|
style: {
|
|
@@ -38736,7 +38813,7 @@ function SwapMode({
|
|
|
38736
38813
|
transition: "opacity 0.2s",
|
|
38737
38814
|
pointerEvents: hoverSell && fromBalance !== null ? "auto" : "none"
|
|
38738
38815
|
},
|
|
38739
|
-
children: PERCENT_OPTIONS.map((p) => /* @__PURE__ */
|
|
38816
|
+
children: PERCENT_OPTIONS.map((p) => /* @__PURE__ */ jsx56(
|
|
38740
38817
|
"button",
|
|
38741
38818
|
{
|
|
38742
38819
|
onClick: () => {
|
|
@@ -38797,7 +38874,7 @@ function SwapMode({
|
|
|
38797
38874
|
{
|
|
38798
38875
|
style: { display: "flex", alignItems: "center", gap: spacing[3] },
|
|
38799
38876
|
children: [
|
|
38800
|
-
amountInputMode === "usd" && /* @__PURE__ */
|
|
38877
|
+
amountInputMode === "usd" && /* @__PURE__ */ jsx56(
|
|
38801
38878
|
"span",
|
|
38802
38879
|
{
|
|
38803
38880
|
style: {
|
|
@@ -38812,7 +38889,7 @@ function SwapMode({
|
|
|
38812
38889
|
children: currencySymbol
|
|
38813
38890
|
}
|
|
38814
38891
|
),
|
|
38815
|
-
/* @__PURE__ */
|
|
38892
|
+
/* @__PURE__ */ jsx56(
|
|
38816
38893
|
"input",
|
|
38817
38894
|
{
|
|
38818
38895
|
inputMode: "decimal",
|
|
@@ -38838,22 +38915,7 @@ function SwapMode({
|
|
|
38838
38915
|
}
|
|
38839
38916
|
}
|
|
38840
38917
|
),
|
|
38841
|
-
|
|
38842
|
-
"span",
|
|
38843
|
-
{
|
|
38844
|
-
style: {
|
|
38845
|
-
fontSize: scaleFontSize(amount || "0"),
|
|
38846
|
-
fontWeight: fontWeight.medium,
|
|
38847
|
-
letterSpacing: "-0.02em",
|
|
38848
|
-
color: amount ? colors.foreground : `${colors.mutedForeground}80`,
|
|
38849
|
-
transition: "font-size 0.15s ease",
|
|
38850
|
-
flexShrink: 0,
|
|
38851
|
-
userSelect: "none"
|
|
38852
|
-
},
|
|
38853
|
-
children: fromToken.symbol
|
|
38854
|
-
}
|
|
38855
|
-
),
|
|
38856
|
-
/* @__PURE__ */ jsx55(
|
|
38918
|
+
/* @__PURE__ */ jsx56(
|
|
38857
38919
|
TokenPillButton,
|
|
38858
38920
|
{
|
|
38859
38921
|
token: fromToken,
|
|
@@ -38895,8 +38957,8 @@ function SwapMode({
|
|
|
38895
38957
|
fontFamily: "inherit"
|
|
38896
38958
|
},
|
|
38897
38959
|
children: [
|
|
38898
|
-
/* @__PURE__ */
|
|
38899
|
-
hasFromUsdPrice && /* @__PURE__ */
|
|
38960
|
+
/* @__PURE__ */ jsx56("span", { children: amountInputMode === "usd" ? fromToken ? `${fmtAmount(tokenSellNum, 5)} ${fromToken.symbol}` : "0" : hasFromUsdPrice ? fmtLocal(usdSellNum) : "USD pricing unavailable" }),
|
|
38961
|
+
hasFromUsdPrice && /* @__PURE__ */ jsx56(
|
|
38900
38962
|
"svg",
|
|
38901
38963
|
{
|
|
38902
38964
|
style: { width: "0.75rem", height: "0.75rem" },
|
|
@@ -38906,7 +38968,7 @@ function SwapMode({
|
|
|
38906
38968
|
strokeWidth: 2,
|
|
38907
38969
|
strokeLinecap: "round",
|
|
38908
38970
|
strokeLinejoin: "round",
|
|
38909
|
-
children: /* @__PURE__ */
|
|
38971
|
+
children: /* @__PURE__ */ jsx56("path", { d: "M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4" })
|
|
38910
38972
|
}
|
|
38911
38973
|
)
|
|
38912
38974
|
]
|
|
@@ -38927,7 +38989,7 @@ function SwapMode({
|
|
|
38927
38989
|
]
|
|
38928
38990
|
}
|
|
38929
38991
|
) }),
|
|
38930
|
-
/* @__PURE__ */
|
|
38992
|
+
/* @__PURE__ */ jsx56("div", { style: { position: "relative", height: 0, zIndex: 10 }, children: /* @__PURE__ */ jsx56(
|
|
38931
38993
|
"button",
|
|
38932
38994
|
{
|
|
38933
38995
|
onClick: handleFlip,
|
|
@@ -38948,7 +39010,7 @@ function SwapMode({
|
|
|
38948
39010
|
cursor: lockDestToken ? "default" : "pointer",
|
|
38949
39011
|
opacity: lockDestToken ? 0.4 : 1
|
|
38950
39012
|
},
|
|
38951
|
-
children: /* @__PURE__ */
|
|
39013
|
+
children: /* @__PURE__ */ jsx56(
|
|
38952
39014
|
"svg",
|
|
38953
39015
|
{
|
|
38954
39016
|
style: {
|
|
@@ -38960,7 +39022,7 @@ function SwapMode({
|
|
|
38960
39022
|
fill: "none",
|
|
38961
39023
|
stroke: "currentColor",
|
|
38962
39024
|
strokeWidth: 2,
|
|
38963
|
-
children: /* @__PURE__ */
|
|
39025
|
+
children: /* @__PURE__ */ jsx56(
|
|
38964
39026
|
"path",
|
|
38965
39027
|
{
|
|
38966
39028
|
strokeLinecap: "round",
|
|
@@ -38972,7 +39034,7 @@ function SwapMode({
|
|
|
38972
39034
|
)
|
|
38973
39035
|
}
|
|
38974
39036
|
) }),
|
|
38975
|
-
/* @__PURE__ */
|
|
39037
|
+
/* @__PURE__ */ jsx56("div", { style: { padding: `0 ${spacing[3]}`, marginTop: spacing[3] }, children: /* @__PURE__ */ jsxs46(
|
|
38976
39038
|
"div",
|
|
38977
39039
|
{
|
|
38978
39040
|
style: {
|
|
@@ -38981,7 +39043,7 @@ function SwapMode({
|
|
|
38981
39043
|
padding: `${spacing[5]} ${spacing[5]} ${spacing[5]}`
|
|
38982
39044
|
},
|
|
38983
39045
|
children: [
|
|
38984
|
-
/* @__PURE__ */
|
|
39046
|
+
/* @__PURE__ */ jsx56(
|
|
38985
39047
|
"span",
|
|
38986
39048
|
{
|
|
38987
39049
|
style: {
|
|
@@ -39002,7 +39064,7 @@ function SwapMode({
|
|
|
39002
39064
|
marginTop: spacing[1]
|
|
39003
39065
|
},
|
|
39004
39066
|
children: [
|
|
39005
|
-
/* @__PURE__ */
|
|
39067
|
+
/* @__PURE__ */ jsx56(
|
|
39006
39068
|
"div",
|
|
39007
39069
|
{
|
|
39008
39070
|
style: {
|
|
@@ -39015,7 +39077,7 @@ function SwapMode({
|
|
|
39015
39077
|
},
|
|
39016
39078
|
children: displayToAmount !== null ? (() => {
|
|
39017
39079
|
const s = `${isEstimate ? "~" : ""}${fmtAmount(displayToAmount, 5)}`;
|
|
39018
|
-
return /* @__PURE__ */
|
|
39080
|
+
return /* @__PURE__ */ jsx56(
|
|
39019
39081
|
"span",
|
|
39020
39082
|
{
|
|
39021
39083
|
style: {
|
|
@@ -39026,7 +39088,7 @@ function SwapMode({
|
|
|
39026
39088
|
children: s
|
|
39027
39089
|
}
|
|
39028
39090
|
);
|
|
39029
|
-
})() : route.loading ? /* @__PURE__ */
|
|
39091
|
+
})() : route.loading ? /* @__PURE__ */ jsx56(
|
|
39030
39092
|
"span",
|
|
39031
39093
|
{
|
|
39032
39094
|
style: {
|
|
@@ -39036,7 +39098,7 @@ function SwapMode({
|
|
|
39036
39098
|
},
|
|
39037
39099
|
children: "\u2026"
|
|
39038
39100
|
}
|
|
39039
|
-
) : /* @__PURE__ */
|
|
39101
|
+
) : /* @__PURE__ */ jsx56(
|
|
39040
39102
|
"span",
|
|
39041
39103
|
{
|
|
39042
39104
|
style: {
|
|
@@ -39049,7 +39111,7 @@ function SwapMode({
|
|
|
39049
39111
|
},
|
|
39050
39112
|
rateUpdated ? "flash" : "stable"
|
|
39051
39113
|
),
|
|
39052
|
-
/* @__PURE__ */
|
|
39114
|
+
/* @__PURE__ */ jsx56(
|
|
39053
39115
|
TokenPillButton,
|
|
39054
39116
|
{
|
|
39055
39117
|
token: toToken,
|
|
@@ -39075,7 +39137,7 @@ function SwapMode({
|
|
|
39075
39137
|
color: colors.mutedForeground
|
|
39076
39138
|
},
|
|
39077
39139
|
children: [
|
|
39078
|
-
/* @__PURE__ */
|
|
39140
|
+
/* @__PURE__ */ jsx56("span", { children: displayToUsd > 0 ? `${isEstimate ? "~" : ""}${fmtLocal(displayToUsd)}` : "" }),
|
|
39079
39141
|
priceImpact !== null && /* @__PURE__ */ jsxs46(
|
|
39080
39142
|
"span",
|
|
39081
39143
|
{
|
|
@@ -39122,7 +39184,7 @@ function SwapMode({
|
|
|
39122
39184
|
}
|
|
39123
39185
|
),
|
|
39124
39186
|
/* @__PURE__ */ jsxs46("div", { style: { position: "relative" }, children: [
|
|
39125
|
-
/* @__PURE__ */
|
|
39187
|
+
/* @__PURE__ */ jsx56(
|
|
39126
39188
|
"input",
|
|
39127
39189
|
{
|
|
39128
39190
|
type: "text",
|
|
@@ -39145,7 +39207,7 @@ function SwapMode({
|
|
|
39145
39207
|
}
|
|
39146
39208
|
}
|
|
39147
39209
|
),
|
|
39148
|
-
/* @__PURE__ */
|
|
39210
|
+
/* @__PURE__ */ jsx56(
|
|
39149
39211
|
"button",
|
|
39150
39212
|
{
|
|
39151
39213
|
type: "button",
|
|
@@ -39192,7 +39254,7 @@ function SwapMode({
|
|
|
39192
39254
|
]
|
|
39193
39255
|
}
|
|
39194
39256
|
) }),
|
|
39195
|
-
route.error && !route.loading && /* @__PURE__ */
|
|
39257
|
+
route.error && !route.loading && /* @__PURE__ */ jsx56(
|
|
39196
39258
|
"p",
|
|
39197
39259
|
{
|
|
39198
39260
|
style: {
|
|
@@ -39217,13 +39279,13 @@ function SwapMode({
|
|
|
39217
39279
|
padding: `0 ${spacing[3]}`
|
|
39218
39280
|
},
|
|
39219
39281
|
children: [
|
|
39220
|
-
/* @__PURE__ */
|
|
39282
|
+
/* @__PURE__ */ jsx56(
|
|
39221
39283
|
"svg",
|
|
39222
39284
|
{
|
|
39223
39285
|
className: "tw-animate-spin",
|
|
39224
39286
|
style: { width: "0.875rem", height: "0.875rem", flexShrink: 0 },
|
|
39225
39287
|
viewBox: "0 0 88 88",
|
|
39226
|
-
children: /* @__PURE__ */
|
|
39288
|
+
children: /* @__PURE__ */ jsx56(
|
|
39227
39289
|
"circle",
|
|
39228
39290
|
{
|
|
39229
39291
|
cx: "44",
|
|
@@ -39238,7 +39300,7 @@ function SwapMode({
|
|
|
39238
39300
|
)
|
|
39239
39301
|
}
|
|
39240
39302
|
),
|
|
39241
|
-
/* @__PURE__ */
|
|
39303
|
+
/* @__PURE__ */ jsx56(
|
|
39242
39304
|
"span",
|
|
39243
39305
|
{
|
|
39244
39306
|
style: {
|
|
@@ -39253,7 +39315,7 @@ function SwapMode({
|
|
|
39253
39315
|
]
|
|
39254
39316
|
}
|
|
39255
39317
|
),
|
|
39256
|
-
/* @__PURE__ */
|
|
39318
|
+
/* @__PURE__ */ jsx56("div", { style: { padding: `${spacing[2]} ${spacing[3]} 0` }, children: /* @__PURE__ */ jsx56(
|
|
39257
39319
|
"button",
|
|
39258
39320
|
{
|
|
39259
39321
|
disabled: ctaDisabled,
|
|
@@ -39328,8 +39390,8 @@ function SwapMode({
|
|
|
39328
39390
|
flexShrink: 0
|
|
39329
39391
|
},
|
|
39330
39392
|
children: [
|
|
39331
|
-
!isGasSponsored && /* @__PURE__ */
|
|
39332
|
-
/* @__PURE__ */
|
|
39393
|
+
!isGasSponsored && /* @__PURE__ */ jsx56(GasIcon, {}),
|
|
39394
|
+
/* @__PURE__ */ jsx56(
|
|
39333
39395
|
"span",
|
|
39334
39396
|
{
|
|
39335
39397
|
style: isGasSponsored ? { color: colors.green[500] } : void 0,
|
|
@@ -39348,7 +39410,7 @@ function SwapMode({
|
|
|
39348
39410
|
opacity: 0.75
|
|
39349
39411
|
},
|
|
39350
39412
|
children: [
|
|
39351
|
-
/* @__PURE__ */
|
|
39413
|
+
/* @__PURE__ */ jsx56(
|
|
39352
39414
|
"circle",
|
|
39353
39415
|
{
|
|
39354
39416
|
cx: "7",
|
|
@@ -39359,7 +39421,7 @@ function SwapMode({
|
|
|
39359
39421
|
strokeWidth: "1.5"
|
|
39360
39422
|
}
|
|
39361
39423
|
),
|
|
39362
|
-
/* @__PURE__ */
|
|
39424
|
+
/* @__PURE__ */ jsx56(
|
|
39363
39425
|
"circle",
|
|
39364
39426
|
{
|
|
39365
39427
|
cx: "7",
|
|
@@ -39377,7 +39439,7 @@ function SwapMode({
|
|
|
39377
39439
|
]
|
|
39378
39440
|
}
|
|
39379
39441
|
),
|
|
39380
|
-
/* @__PURE__ */
|
|
39442
|
+
/* @__PURE__ */ jsx56(
|
|
39381
39443
|
"svg",
|
|
39382
39444
|
{
|
|
39383
39445
|
style: {
|
|
@@ -39392,7 +39454,7 @@ function SwapMode({
|
|
|
39392
39454
|
strokeWidth: 2,
|
|
39393
39455
|
strokeLinecap: "round",
|
|
39394
39456
|
strokeLinejoin: "round",
|
|
39395
|
-
children: /* @__PURE__ */
|
|
39457
|
+
children: /* @__PURE__ */ jsx56("path", { d: "M6 9l6 6 6-6" })
|
|
39396
39458
|
}
|
|
39397
39459
|
)
|
|
39398
39460
|
]
|
|
@@ -39413,18 +39475,18 @@ function SwapMode({
|
|
|
39413
39475
|
gap: spacing[2.5]
|
|
39414
39476
|
},
|
|
39415
39477
|
children: [
|
|
39416
|
-
/* @__PURE__ */
|
|
39478
|
+
/* @__PURE__ */ jsx56(
|
|
39417
39479
|
RateRow,
|
|
39418
39480
|
{
|
|
39419
39481
|
label: "Fee",
|
|
39420
39482
|
value: protocolFeeUsd !== null ? fmtLocal(protocolFeeUsd) : "Free"
|
|
39421
39483
|
}
|
|
39422
39484
|
),
|
|
39423
|
-
/* @__PURE__ */
|
|
39485
|
+
/* @__PURE__ */ jsx56(
|
|
39424
39486
|
RateRow,
|
|
39425
39487
|
{
|
|
39426
39488
|
label: "Network cost",
|
|
39427
|
-
value: isGasSponsored ? /* @__PURE__ */
|
|
39489
|
+
value: isGasSponsored ? /* @__PURE__ */ jsx56(SponsoredBadge, {}) : networkCostUsd !== null ? /* @__PURE__ */ jsxs46(
|
|
39428
39490
|
"span",
|
|
39429
39491
|
{
|
|
39430
39492
|
style: {
|
|
@@ -39433,19 +39495,19 @@ function SwapMode({
|
|
|
39433
39495
|
gap: "0.25rem"
|
|
39434
39496
|
},
|
|
39435
39497
|
children: [
|
|
39436
|
-
/* @__PURE__ */
|
|
39498
|
+
/* @__PURE__ */ jsx56(GasIcon, { size: "0.75rem" }),
|
|
39437
39499
|
fmtLocal(networkCostUsd)
|
|
39438
39500
|
]
|
|
39439
39501
|
}
|
|
39440
|
-
) : /* @__PURE__ */
|
|
39502
|
+
) : /* @__PURE__ */ jsx56("span", { style: { color: colors.mutedForeground }, children: "Available after quote" })
|
|
39441
39503
|
}
|
|
39442
39504
|
),
|
|
39443
|
-
/* @__PURE__ */
|
|
39444
|
-
/* @__PURE__ */
|
|
39505
|
+
/* @__PURE__ */ jsx56(RateRow, { label: "Max slippage", value: `${slippage}%` }),
|
|
39506
|
+
/* @__PURE__ */ jsx56(
|
|
39445
39507
|
RateRow,
|
|
39446
39508
|
{
|
|
39447
39509
|
label: "Route",
|
|
39448
|
-
value: routePath ? /* @__PURE__ */
|
|
39510
|
+
value: routePath ? /* @__PURE__ */ jsx56(
|
|
39449
39511
|
"span",
|
|
39450
39512
|
{
|
|
39451
39513
|
style: {
|
|
@@ -39459,7 +39521,7 @@ function SwapMode({
|
|
|
39459
39521
|
title: routePath,
|
|
39460
39522
|
children: routePath
|
|
39461
39523
|
}
|
|
39462
|
-
) : route.data?.route?.provider ?? /* @__PURE__ */
|
|
39524
|
+
) : route.data?.route?.provider ?? /* @__PURE__ */ jsx56("span", { style: { color: colors.mutedForeground }, children: "Available after quote" })
|
|
39463
39525
|
}
|
|
39464
39526
|
)
|
|
39465
39527
|
]
|
|
@@ -39468,7 +39530,7 @@ function SwapMode({
|
|
|
39468
39530
|
]
|
|
39469
39531
|
}
|
|
39470
39532
|
),
|
|
39471
|
-
/* @__PURE__ */
|
|
39533
|
+
/* @__PURE__ */ jsx56(WidgetSecurityFooter, {})
|
|
39472
39534
|
]
|
|
39473
39535
|
}
|
|
39474
39536
|
) });
|
|
@@ -39515,7 +39577,7 @@ function SwapActionArea({
|
|
|
39515
39577
|
marginBottom: spacing[3]
|
|
39516
39578
|
},
|
|
39517
39579
|
children: [
|
|
39518
|
-
/* @__PURE__ */
|
|
39580
|
+
/* @__PURE__ */ jsx56(
|
|
39519
39581
|
"svg",
|
|
39520
39582
|
{
|
|
39521
39583
|
style: {
|
|
@@ -39525,10 +39587,10 @@ function SwapActionArea({
|
|
|
39525
39587
|
},
|
|
39526
39588
|
viewBox: "0 0 24 24",
|
|
39527
39589
|
fill: "currentColor",
|
|
39528
|
-
children: /* @__PURE__ */
|
|
39590
|
+
children: /* @__PURE__ */ jsx56("path", { d: "M12 2l2.09 6.26L20 10l-5.91 1.74L12 18l-2.09-6.26L4 10l5.91-1.74z" })
|
|
39529
39591
|
}
|
|
39530
39592
|
),
|
|
39531
|
-
/* @__PURE__ */
|
|
39593
|
+
/* @__PURE__ */ jsx56(
|
|
39532
39594
|
"span",
|
|
39533
39595
|
{
|
|
39534
39596
|
style: {
|
|
@@ -39542,8 +39604,8 @@ function SwapActionArea({
|
|
|
39542
39604
|
]
|
|
39543
39605
|
}
|
|
39544
39606
|
),
|
|
39545
|
-
quoteUnavailable ? /* @__PURE__ */ jsxs46(
|
|
39546
|
-
/* @__PURE__ */
|
|
39607
|
+
quoteUnavailable ? /* @__PURE__ */ jsxs46(Fragment14, { children: [
|
|
39608
|
+
/* @__PURE__ */ jsx56(
|
|
39547
39609
|
"p",
|
|
39548
39610
|
{
|
|
39549
39611
|
style: {
|
|
@@ -39555,7 +39617,7 @@ function SwapActionArea({
|
|
|
39555
39617
|
children: quoteError ?? "This quote expired."
|
|
39556
39618
|
}
|
|
39557
39619
|
),
|
|
39558
|
-
/* @__PURE__ */
|
|
39620
|
+
/* @__PURE__ */ jsx56(
|
|
39559
39621
|
"button",
|
|
39560
39622
|
{
|
|
39561
39623
|
onClick: onRetryQuote,
|
|
@@ -39573,7 +39635,7 @@ function SwapActionArea({
|
|
|
39573
39635
|
children: "Get a new quote"
|
|
39574
39636
|
}
|
|
39575
39637
|
)
|
|
39576
|
-
] }) : /* @__PURE__ */
|
|
39638
|
+
] }) : /* @__PURE__ */ jsx56(
|
|
39577
39639
|
"button",
|
|
39578
39640
|
{
|
|
39579
39641
|
onClick: onExecute,
|
|
@@ -39651,7 +39713,7 @@ function TokenPillButton({
|
|
|
39651
39713
|
},
|
|
39652
39714
|
children: [
|
|
39653
39715
|
placeholder,
|
|
39654
|
-
/* @__PURE__ */
|
|
39716
|
+
/* @__PURE__ */ jsx56(
|
|
39655
39717
|
"svg",
|
|
39656
39718
|
{
|
|
39657
39719
|
style: { width: "1rem", height: "1rem" },
|
|
@@ -39659,7 +39721,7 @@ function TokenPillButton({
|
|
|
39659
39721
|
fill: "none",
|
|
39660
39722
|
stroke: "currentColor",
|
|
39661
39723
|
strokeWidth: 2,
|
|
39662
|
-
children: /* @__PURE__ */
|
|
39724
|
+
children: /* @__PURE__ */ jsx56(
|
|
39663
39725
|
"path",
|
|
39664
39726
|
{
|
|
39665
39727
|
strokeLinecap: "round",
|
|
@@ -39694,7 +39756,7 @@ function TokenPillButton({
|
|
|
39694
39756
|
},
|
|
39695
39757
|
children: [
|
|
39696
39758
|
/* @__PURE__ */ jsxs46("div", { style: { position: "relative" }, children: [
|
|
39697
|
-
iconUrl ? /* @__PURE__ */
|
|
39759
|
+
iconUrl ? /* @__PURE__ */ jsx56(
|
|
39698
39760
|
"img",
|
|
39699
39761
|
{
|
|
39700
39762
|
src: iconUrl,
|
|
@@ -39706,7 +39768,7 @@ function TokenPillButton({
|
|
|
39706
39768
|
objectFit: "cover"
|
|
39707
39769
|
}
|
|
39708
39770
|
}
|
|
39709
|
-
) : /* @__PURE__ */
|
|
39771
|
+
) : /* @__PURE__ */ jsx56(
|
|
39710
39772
|
"div",
|
|
39711
39773
|
{
|
|
39712
39774
|
style: {
|
|
@@ -39718,7 +39780,7 @@ function TokenPillButton({
|
|
|
39718
39780
|
alignItems: "center",
|
|
39719
39781
|
justifyContent: "center"
|
|
39720
39782
|
},
|
|
39721
|
-
children: /* @__PURE__ */
|
|
39783
|
+
children: /* @__PURE__ */ jsx56(
|
|
39722
39784
|
"span",
|
|
39723
39785
|
{
|
|
39724
39786
|
style: {
|
|
@@ -39731,7 +39793,7 @@ function TokenPillButton({
|
|
|
39731
39793
|
)
|
|
39732
39794
|
}
|
|
39733
39795
|
),
|
|
39734
|
-
chainIcon && /* @__PURE__ */
|
|
39796
|
+
chainIcon && /* @__PURE__ */ jsx56(
|
|
39735
39797
|
"img",
|
|
39736
39798
|
{
|
|
39737
39799
|
src: chainIcon,
|
|
@@ -39749,7 +39811,7 @@ function TokenPillButton({
|
|
|
39749
39811
|
}
|
|
39750
39812
|
)
|
|
39751
39813
|
] }),
|
|
39752
|
-
/* @__PURE__ */
|
|
39814
|
+
/* @__PURE__ */ jsx56(
|
|
39753
39815
|
"span",
|
|
39754
39816
|
{
|
|
39755
39817
|
style: {
|
|
@@ -39760,7 +39822,7 @@ function TokenPillButton({
|
|
|
39760
39822
|
children: token.symbol
|
|
39761
39823
|
}
|
|
39762
39824
|
),
|
|
39763
|
-
!disabled && /* @__PURE__ */
|
|
39825
|
+
!disabled && /* @__PURE__ */ jsx56(
|
|
39764
39826
|
"svg",
|
|
39765
39827
|
{
|
|
39766
39828
|
style: {
|
|
@@ -39772,7 +39834,7 @@ function TokenPillButton({
|
|
|
39772
39834
|
fill: "none",
|
|
39773
39835
|
stroke: "currentColor",
|
|
39774
39836
|
strokeWidth: 2,
|
|
39775
|
-
children: /* @__PURE__ */
|
|
39837
|
+
children: /* @__PURE__ */ jsx56(
|
|
39776
39838
|
"path",
|
|
39777
39839
|
{
|
|
39778
39840
|
strokeLinecap: "round",
|
|
@@ -39794,7 +39856,7 @@ function TokenIcon({
|
|
|
39794
39856
|
const imgSize = size === "lg" ? "2.75rem" : "2.5rem";
|
|
39795
39857
|
const badgeSize = size === "lg" ? "1.125rem" : "1rem";
|
|
39796
39858
|
return /* @__PURE__ */ jsxs46("div", { style: { position: "relative", flexShrink: 0 }, children: [
|
|
39797
|
-
/* @__PURE__ */
|
|
39859
|
+
/* @__PURE__ */ jsx56(
|
|
39798
39860
|
"img",
|
|
39799
39861
|
{
|
|
39800
39862
|
src: icon,
|
|
@@ -39802,7 +39864,7 @@ function TokenIcon({
|
|
|
39802
39864
|
style: { width: imgSize, height: imgSize, borderRadius: "9999px" }
|
|
39803
39865
|
}
|
|
39804
39866
|
),
|
|
39805
|
-
chainIcon && /* @__PURE__ */
|
|
39867
|
+
chainIcon && /* @__PURE__ */ jsx56(
|
|
39806
39868
|
"img",
|
|
39807
39869
|
{
|
|
39808
39870
|
src: chainIcon,
|
|
@@ -39826,7 +39888,7 @@ function ReviewDetailRow({
|
|
|
39826
39888
|
value,
|
|
39827
39889
|
tooltip
|
|
39828
39890
|
}) {
|
|
39829
|
-
const iconRef =
|
|
39891
|
+
const iconRef = useRef19(null);
|
|
39830
39892
|
const [tipPos, setTipPos] = useState34(null);
|
|
39831
39893
|
const handleMouseEnter = () => {
|
|
39832
39894
|
if (!tooltip || !iconRef.current) return;
|
|
@@ -39854,7 +39916,7 @@ function ReviewDetailRow({
|
|
|
39854
39916
|
},
|
|
39855
39917
|
children: [
|
|
39856
39918
|
label,
|
|
39857
|
-
/* @__PURE__ */
|
|
39919
|
+
/* @__PURE__ */ jsx56(
|
|
39858
39920
|
"span",
|
|
39859
39921
|
{
|
|
39860
39922
|
ref: iconRef,
|
|
@@ -39877,8 +39939,8 @@ function ReviewDetailRow({
|
|
|
39877
39939
|
strokeLinecap: "round",
|
|
39878
39940
|
strokeLinejoin: "round",
|
|
39879
39941
|
children: [
|
|
39880
|
-
/* @__PURE__ */
|
|
39881
|
-
/* @__PURE__ */
|
|
39942
|
+
/* @__PURE__ */ jsx56("circle", { cx: "12", cy: "12", r: "10" }),
|
|
39943
|
+
/* @__PURE__ */ jsx56("path", { d: "M12 16v-4M12 8h.01" })
|
|
39882
39944
|
]
|
|
39883
39945
|
}
|
|
39884
39946
|
)
|
|
@@ -39887,9 +39949,9 @@ function ReviewDetailRow({
|
|
|
39887
39949
|
]
|
|
39888
39950
|
}
|
|
39889
39951
|
),
|
|
39890
|
-
/* @__PURE__ */
|
|
39952
|
+
/* @__PURE__ */ jsx56("span", { style: { color: colors.foreground, fontWeight: fontWeight.medium }, children: value }),
|
|
39891
39953
|
tooltip && tipPos && typeof document !== "undefined" && ReactDOM.createPortal(
|
|
39892
|
-
/* @__PURE__ */
|
|
39954
|
+
/* @__PURE__ */ jsx56(
|
|
39893
39955
|
"span",
|
|
39894
39956
|
{
|
|
39895
39957
|
style: {
|
|
@@ -39929,10 +39991,10 @@ function GasIcon({ size = "0.875rem" }) {
|
|
|
39929
39991
|
strokeLinecap: "round",
|
|
39930
39992
|
strokeLinejoin: "round",
|
|
39931
39993
|
children: [
|
|
39932
|
-
/* @__PURE__ */
|
|
39933
|
-
/* @__PURE__ */
|
|
39934
|
-
/* @__PURE__ */
|
|
39935
|
-
/* @__PURE__ */
|
|
39994
|
+
/* @__PURE__ */ jsx56("path", { d: "M3 22V7a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v15" }),
|
|
39995
|
+
/* @__PURE__ */ jsx56("path", { d: "M3 11h11" }),
|
|
39996
|
+
/* @__PURE__ */ jsx56("path", { d: "M17 5h1a2 2 0 0 1 2 2v2.5a1.5 1.5 0 0 0 3 0V7l-3-3" }),
|
|
39997
|
+
/* @__PURE__ */ jsx56("path", { d: "M19 22V12" })
|
|
39936
39998
|
]
|
|
39937
39999
|
}
|
|
39938
40000
|
);
|
|
@@ -39949,13 +40011,13 @@ function SponsoredBadge() {
|
|
|
39949
40011
|
fontWeight: fontWeight.medium
|
|
39950
40012
|
},
|
|
39951
40013
|
children: [
|
|
39952
|
-
/* @__PURE__ */
|
|
40014
|
+
/* @__PURE__ */ jsx56(
|
|
39953
40015
|
"svg",
|
|
39954
40016
|
{
|
|
39955
40017
|
style: { width: "0.75rem", height: "0.75rem" },
|
|
39956
40018
|
viewBox: "0 0 24 24",
|
|
39957
40019
|
fill: "currentColor",
|
|
39958
|
-
children: /* @__PURE__ */
|
|
40020
|
+
children: /* @__PURE__ */ jsx56("path", { d: "M12 2l2.09 6.26L20 10l-5.91 1.74L12 18l-2.09-6.26L4 10l5.91-1.74z" })
|
|
39959
40021
|
}
|
|
39960
40022
|
),
|
|
39961
40023
|
"Sponsored"
|
|
@@ -39976,8 +40038,8 @@ function SuccessReceiptRow({
|
|
|
39976
40038
|
justifyContent: "space-between"
|
|
39977
40039
|
},
|
|
39978
40040
|
children: [
|
|
39979
|
-
/* @__PURE__ */
|
|
39980
|
-
/* @__PURE__ */
|
|
40041
|
+
/* @__PURE__ */ jsx56("span", { style: { color: colors.mutedForeground }, children: label }),
|
|
40042
|
+
/* @__PURE__ */ jsx56("span", { style: { fontWeight: fontWeight.medium, color: colors.foreground }, children: value })
|
|
39981
40043
|
]
|
|
39982
40044
|
}
|
|
39983
40045
|
);
|
|
@@ -39991,7 +40053,7 @@ function ProcessingStepNode({
|
|
|
39991
40053
|
const nodeColor = done ? colors.green[500] : active ? `hsl(var(--tw-primary))` : colors.border;
|
|
39992
40054
|
const iconColor = done ? "#fff" : active ? `hsl(var(--tw-primary))` : colors.mutedForeground;
|
|
39993
40055
|
const nodeBg = done ? colors.green[500] : "transparent";
|
|
39994
|
-
const iconEl = icon === "send" ? /* @__PURE__ */
|
|
40056
|
+
const iconEl = icon === "send" ? /* @__PURE__ */ jsx56(
|
|
39995
40057
|
"svg",
|
|
39996
40058
|
{
|
|
39997
40059
|
style: { width: "0.875rem", height: "0.875rem", color: iconColor },
|
|
@@ -40001,9 +40063,9 @@ function ProcessingStepNode({
|
|
|
40001
40063
|
strokeWidth: 2,
|
|
40002
40064
|
strokeLinecap: "round",
|
|
40003
40065
|
strokeLinejoin: "round",
|
|
40004
|
-
children: /* @__PURE__ */
|
|
40066
|
+
children: /* @__PURE__ */ jsx56("path", { d: "M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z" })
|
|
40005
40067
|
}
|
|
40006
|
-
) : icon === "plus" ? /* @__PURE__ */
|
|
40068
|
+
) : icon === "plus" ? /* @__PURE__ */ jsx56(
|
|
40007
40069
|
"svg",
|
|
40008
40070
|
{
|
|
40009
40071
|
style: { width: "0.875rem", height: "0.875rem", color: iconColor },
|
|
@@ -40013,7 +40075,7 @@ function ProcessingStepNode({
|
|
|
40013
40075
|
strokeWidth: 2,
|
|
40014
40076
|
strokeLinecap: "round",
|
|
40015
40077
|
strokeLinejoin: "round",
|
|
40016
|
-
children: /* @__PURE__ */
|
|
40078
|
+
children: /* @__PURE__ */ jsx56("path", { d: "M12 5v14M5 12h14" })
|
|
40017
40079
|
}
|
|
40018
40080
|
) : /* @__PURE__ */ jsxs46(
|
|
40019
40081
|
"svg",
|
|
@@ -40026,12 +40088,12 @@ function ProcessingStepNode({
|
|
|
40026
40088
|
strokeLinecap: "round",
|
|
40027
40089
|
strokeLinejoin: "round",
|
|
40028
40090
|
children: [
|
|
40029
|
-
/* @__PURE__ */
|
|
40030
|
-
/* @__PURE__ */
|
|
40091
|
+
/* @__PURE__ */ jsx56("path", { d: "M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z" }),
|
|
40092
|
+
/* @__PURE__ */ jsx56("line", { x1: "4", y1: "22", x2: "4", y2: "15" })
|
|
40031
40093
|
]
|
|
40032
40094
|
}
|
|
40033
40095
|
);
|
|
40034
|
-
const doneIcon = /* @__PURE__ */
|
|
40096
|
+
const doneIcon = /* @__PURE__ */ jsx56(
|
|
40035
40097
|
"svg",
|
|
40036
40098
|
{
|
|
40037
40099
|
style: { width: "0.875rem", height: "0.875rem", color: "#fff" },
|
|
@@ -40041,7 +40103,7 @@ function ProcessingStepNode({
|
|
|
40041
40103
|
strokeWidth: 3,
|
|
40042
40104
|
strokeLinecap: "round",
|
|
40043
40105
|
strokeLinejoin: "round",
|
|
40044
|
-
children: /* @__PURE__ */
|
|
40106
|
+
children: /* @__PURE__ */ jsx56("path", { d: "M20 6L9 17l-5-5" })
|
|
40045
40107
|
}
|
|
40046
40108
|
);
|
|
40047
40109
|
return /* @__PURE__ */ jsxs46(
|
|
@@ -40055,7 +40117,7 @@ function ProcessingStepNode({
|
|
|
40055
40117
|
maxWidth: "5rem"
|
|
40056
40118
|
},
|
|
40057
40119
|
children: [
|
|
40058
|
-
/* @__PURE__ */
|
|
40120
|
+
/* @__PURE__ */ jsx56(
|
|
40059
40121
|
"div",
|
|
40060
40122
|
{
|
|
40061
40123
|
style: {
|
|
@@ -40073,7 +40135,7 @@ function ProcessingStepNode({
|
|
|
40073
40135
|
children: done ? doneIcon : iconEl
|
|
40074
40136
|
}
|
|
40075
40137
|
),
|
|
40076
|
-
/* @__PURE__ */
|
|
40138
|
+
/* @__PURE__ */ jsx56(
|
|
40077
40139
|
"span",
|
|
40078
40140
|
{
|
|
40079
40141
|
style: {
|
|
@@ -40092,7 +40154,7 @@ function ProcessingStepNode({
|
|
|
40092
40154
|
);
|
|
40093
40155
|
}
|
|
40094
40156
|
function ProcessingStepLine({ done }) {
|
|
40095
|
-
return /* @__PURE__ */
|
|
40157
|
+
return /* @__PURE__ */ jsx56(
|
|
40096
40158
|
"div",
|
|
40097
40159
|
{
|
|
40098
40160
|
style: {
|
|
@@ -40127,6 +40189,7 @@ var init_SwapMode = __esm({
|
|
|
40127
40189
|
init_useSwapRoute();
|
|
40128
40190
|
init_useSwapExecution();
|
|
40129
40191
|
init_walletBalance();
|
|
40192
|
+
init_analytics();
|
|
40130
40193
|
init_useForex();
|
|
40131
40194
|
init_SwapTokenSelect();
|
|
40132
40195
|
init_currency();
|
|
@@ -40165,12 +40228,12 @@ var init_swap = __esm({
|
|
|
40165
40228
|
import {
|
|
40166
40229
|
useState as useState35,
|
|
40167
40230
|
useEffect as useEffect35,
|
|
40168
|
-
useRef as
|
|
40231
|
+
useRef as useRef20,
|
|
40169
40232
|
useCallback as useCallback23,
|
|
40170
40233
|
useImperativeHandle,
|
|
40171
40234
|
forwardRef
|
|
40172
40235
|
} from "react";
|
|
40173
|
-
import { Fragment as
|
|
40236
|
+
import { Fragment as Fragment15, jsx as jsx57, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
40174
40237
|
function WidgetContent({
|
|
40175
40238
|
style,
|
|
40176
40239
|
onStateChange,
|
|
@@ -40202,8 +40265,8 @@ function WidgetContent({
|
|
|
40202
40265
|
onStateChange
|
|
40203
40266
|
]);
|
|
40204
40267
|
return /* @__PURE__ */ jsxs47("div", { style: mergeStyles(widgetContentContainerStyle, style), children: [
|
|
40205
|
-
showThemeToggle && /* @__PURE__ */
|
|
40206
|
-
/* @__PURE__ */
|
|
40268
|
+
showThemeToggle && /* @__PURE__ */ jsx57("div", { style: themeToggleContainerStyle, children: /* @__PURE__ */ jsx57(ThemeToggle, { theme: resolvedTheme, onToggle: toggleTheme }) }),
|
|
40269
|
+
/* @__PURE__ */ jsx57(
|
|
40207
40270
|
WidgetRouter,
|
|
40208
40271
|
{
|
|
40209
40272
|
currentStep,
|
|
@@ -40225,7 +40288,6 @@ function WidgetInner({
|
|
|
40225
40288
|
const { resolvedTheme } = useDepositUi();
|
|
40226
40289
|
const { status, revalidate, errors } = useTrustware();
|
|
40227
40290
|
const [showConfirmDialog, setShowConfirmDialog] = useState35(false);
|
|
40228
|
-
useGTM(GTM_ID);
|
|
40229
40291
|
const handleCloseRequest = useCallback23(() => {
|
|
40230
40292
|
if (ACTIVE_TRANSACTION_STATUSES.includes(transactionStatus)) {
|
|
40231
40293
|
setShowConfirmDialog(true);
|
|
@@ -40253,16 +40315,16 @@ function WidgetInner({
|
|
|
40253
40315
|
const handleRefresh = useCallback23(() => {
|
|
40254
40316
|
revalidate?.();
|
|
40255
40317
|
}, [revalidate]);
|
|
40256
|
-
return /* @__PURE__ */ jsxs47(
|
|
40318
|
+
return /* @__PURE__ */ jsxs47(Fragment15, { children: [
|
|
40257
40319
|
/* @__PURE__ */ jsxs47(WidgetContainer, { theme: effectiveTheme, style, children: [
|
|
40258
|
-
/* @__PURE__ */
|
|
40320
|
+
/* @__PURE__ */ jsx57(
|
|
40259
40321
|
WidgetContent,
|
|
40260
40322
|
{
|
|
40261
40323
|
onStateChange,
|
|
40262
40324
|
showThemeToggle
|
|
40263
40325
|
}
|
|
40264
40326
|
),
|
|
40265
|
-
/* @__PURE__ */
|
|
40327
|
+
/* @__PURE__ */ jsx57(
|
|
40266
40328
|
InitErrorOverlay,
|
|
40267
40329
|
{
|
|
40268
40330
|
open: initBlocked,
|
|
@@ -40273,7 +40335,7 @@ function WidgetInner({
|
|
|
40273
40335
|
}
|
|
40274
40336
|
)
|
|
40275
40337
|
] }),
|
|
40276
|
-
/* @__PURE__ */
|
|
40338
|
+
/* @__PURE__ */ jsx57(
|
|
40277
40339
|
ConfirmCloseDialog,
|
|
40278
40340
|
{
|
|
40279
40341
|
open: showConfirmDialog,
|
|
@@ -40299,8 +40361,7 @@ var init_TrustwareWidgetV2 = __esm({
|
|
|
40299
40361
|
init_provider();
|
|
40300
40362
|
init_manager();
|
|
40301
40363
|
init_useTrustwareConfig();
|
|
40302
|
-
|
|
40303
|
-
init_constants();
|
|
40364
|
+
init_WidgetAnalytics();
|
|
40304
40365
|
init_swap();
|
|
40305
40366
|
widgetContentContainerStyle = {
|
|
40306
40367
|
position: "relative",
|
|
@@ -40324,7 +40385,7 @@ var init_TrustwareWidgetV2 = __esm({
|
|
|
40324
40385
|
showThemeToggle = true
|
|
40325
40386
|
}, ref) {
|
|
40326
40387
|
const [isOpen, setIsOpen] = useState35(defaultOpen);
|
|
40327
|
-
const closeRequestRef =
|
|
40388
|
+
const closeRequestRef = useRef20(null);
|
|
40328
40389
|
const config = useTrustwareConfig();
|
|
40329
40390
|
const effectiveInitialStep = initialStep;
|
|
40330
40391
|
const open = useCallback23(() => {
|
|
@@ -40355,10 +40416,10 @@ var init_TrustwareWidgetV2 = __esm({
|
|
|
40355
40416
|
if (!isOpen) {
|
|
40356
40417
|
return null;
|
|
40357
40418
|
}
|
|
40358
|
-
|
|
40359
|
-
|
|
40360
|
-
|
|
40361
|
-
|
|
40419
|
+
return /* @__PURE__ */ jsx57(WidgetAnalytics, { children: config.mode === "swap" ? (
|
|
40420
|
+
// Swap Mode bypasses DepositProvider — fully standalone
|
|
40421
|
+
/* @__PURE__ */ jsx57(SwapMode, { theme, style })
|
|
40422
|
+
) : /* @__PURE__ */ jsx57(DepositProvider, { initialStep: effectiveInitialStep, children: /* @__PURE__ */ jsx57(
|
|
40362
40423
|
WidgetInner,
|
|
40363
40424
|
{
|
|
40364
40425
|
theme,
|
|
@@ -40367,7 +40428,7 @@ var init_TrustwareWidgetV2 = __esm({
|
|
|
40367
40428
|
closeRequestRef,
|
|
40368
40429
|
showThemeToggle
|
|
40369
40430
|
}
|
|
40370
|
-
) });
|
|
40431
|
+
) }) });
|
|
40371
40432
|
});
|
|
40372
40433
|
}
|
|
40373
40434
|
});
|