@rhinestone/deposit-modal 0.1.52 → 0.1.54
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/{DepositModalReown-63LD7KSU.mjs → DepositModalReown-5QKEE7R3.mjs} +4 -4
- package/dist/{DepositModalReown-SXQJYLTX.cjs → DepositModalReown-XKP2Z55X.cjs} +7 -7
- package/dist/{WithdrawModalReown-PUIM36NO.mjs → WithdrawModalReown-DN6OKFGR.mjs} +4 -4
- package/dist/{WithdrawModalReown-JD665MKM.cjs → WithdrawModalReown-ZQCNJLSP.cjs} +7 -7
- package/dist/{chunk-VYYJWMEI.mjs → chunk-AJUR6FAP.mjs} +121 -27
- package/dist/{chunk-ZJQZEIHA.mjs → chunk-CIXHTOO3.mjs} +1 -1
- package/dist/{chunk-RVKMKH2C.cjs → chunk-EAEDK474.cjs} +250 -319
- package/dist/{chunk-JL3R3JT6.cjs → chunk-GOMHX544.cjs} +80 -74
- package/dist/{chunk-MKSZIA74.mjs → chunk-JQTV5JTB.mjs} +238 -307
- package/dist/{chunk-UPA7N6GY.mjs → chunk-MBURQ26S.mjs} +10 -1
- package/dist/{chunk-XAGXQV4K.cjs → chunk-N2Y34LQO.cjs} +9 -0
- package/dist/{chunk-ZW4SRCW5.cjs → chunk-QJVXCBUI.cjs} +332 -238
- package/dist/{chunk-NELAYNA3.cjs → chunk-R6U6BHCV.cjs} +1 -1
- package/dist/{chunk-R64A3IEI.mjs → chunk-XXB2LVUB.mjs} +23 -17
- package/dist/constants.cjs +2 -2
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +4 -4
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +3 -3
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +4 -4
- package/dist/reown.cjs +5 -5
- package/dist/reown.d.cts +1 -1
- package/dist/reown.d.ts +1 -1
- package/dist/reown.mjs +4 -4
- package/dist/styles.css +357 -243
- package/dist/{types-D1nvo2dK.d.ts → types-BPE95RUG.d.ts} +2 -0
- package/dist/{types-DgiqazTb.d.cts → types-Cm5vGVK2.d.cts} +2 -0
- package/dist/withdraw.cjs +4 -4
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +3 -3
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DepositModalInner
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AJUR6FAP.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ReownWalletProvider,
|
|
6
6
|
useReownWallet
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-MBURQ26S.mjs";
|
|
8
|
+
import "./chunk-JQTV5JTB.mjs";
|
|
9
|
+
import "./chunk-CIXHTOO3.mjs";
|
|
10
10
|
|
|
11
11
|
// src/DepositModalReown.tsx
|
|
12
12
|
import { useCallback, useMemo } from "react";
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkQJVXCBUIcjs = require('./chunk-QJVXCBUI.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
7
|
+
var _chunkN2Y34LQOcjs = require('./chunk-N2Y34LQO.cjs');
|
|
8
|
+
require('./chunk-EAEDK474.cjs');
|
|
9
|
+
require('./chunk-R6U6BHCV.cjs');
|
|
10
10
|
|
|
11
11
|
// src/DepositModalReown.tsx
|
|
12
12
|
var _react = require('react');
|
|
13
13
|
var _react3 = require('@reown/appkit/react');
|
|
14
14
|
var _jsxruntime = require('react/jsx-runtime');
|
|
15
15
|
function DepositModalWithReown(props) {
|
|
16
|
-
const reown =
|
|
16
|
+
const reown = _chunkN2Y34LQOcjs.useReownWallet.call(void 0, );
|
|
17
17
|
const enableSolana = _nullishCoalesce(props.enableSolana, () => ( true));
|
|
18
18
|
const { walletProvider: solanaWalletProvider } = _react3.useAppKitProvider.call(void 0,
|
|
19
19
|
enableSolana ? "solana" : "eip155"
|
|
@@ -32,7 +32,7 @@ function DepositModalWithReown(props) {
|
|
|
32
32
|
reown.disconnect();
|
|
33
33
|
}, [reown.disconnect]);
|
|
34
34
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
35
|
-
|
|
35
|
+
_chunkQJVXCBUIcjs.DepositModalInner,
|
|
36
36
|
{
|
|
37
37
|
...props,
|
|
38
38
|
reownWallet: reownWithSolana,
|
|
@@ -43,7 +43,7 @@ function DepositModalWithReown(props) {
|
|
|
43
43
|
}
|
|
44
44
|
function DepositModalReown(props) {
|
|
45
45
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
46
|
-
|
|
46
|
+
_chunkN2Y34LQOcjs.ReownWalletProvider,
|
|
47
47
|
{
|
|
48
48
|
projectId: props.reownAppId,
|
|
49
49
|
theme: props.theme,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WithdrawModalInner
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XXB2LVUB.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ReownWalletProvider,
|
|
6
6
|
useReownWallet
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-MBURQ26S.mjs";
|
|
8
|
+
import "./chunk-JQTV5JTB.mjs";
|
|
9
|
+
import "./chunk-CIXHTOO3.mjs";
|
|
10
10
|
|
|
11
11
|
// src/WithdrawModalReown.tsx
|
|
12
12
|
import { useCallback } from "react";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkGOMHX544cjs = require('./chunk-GOMHX544.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
7
|
+
var _chunkN2Y34LQOcjs = require('./chunk-N2Y34LQO.cjs');
|
|
8
|
+
require('./chunk-EAEDK474.cjs');
|
|
9
|
+
require('./chunk-R6U6BHCV.cjs');
|
|
10
10
|
|
|
11
11
|
// src/WithdrawModalReown.tsx
|
|
12
12
|
var _react = require('react');
|
|
13
13
|
var _jsxruntime = require('react/jsx-runtime');
|
|
14
14
|
function WithdrawModalWithReown(props) {
|
|
15
|
-
const reown =
|
|
15
|
+
const reown = _chunkN2Y34LQOcjs.useReownWallet.call(void 0, );
|
|
16
16
|
const handleConnect = _react.useCallback.call(void 0, () => {
|
|
17
17
|
reown.openConnect();
|
|
18
18
|
}, [reown.openConnect]);
|
|
@@ -20,7 +20,7 @@ function WithdrawModalWithReown(props) {
|
|
|
20
20
|
reown.disconnect();
|
|
21
21
|
}, [reown.disconnect]);
|
|
22
22
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
23
|
-
|
|
23
|
+
_chunkGOMHX544cjs.WithdrawModalInner,
|
|
24
24
|
{
|
|
25
25
|
...props,
|
|
26
26
|
reownWallet: reown,
|
|
@@ -30,7 +30,7 @@ function WithdrawModalWithReown(props) {
|
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
32
|
function WithdrawModalReown(props) {
|
|
33
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
33
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkN2Y34LQOcjs.ReownWalletProvider, { projectId: props.reownAppId, theme: props.theme, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawModalWithReown, { ...props }) });
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
toEvmCaip2,
|
|
26
26
|
tokenFormatter,
|
|
27
27
|
txRefsMatch
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-JQTV5JTB.mjs";
|
|
29
29
|
import {
|
|
30
30
|
DEFAULT_BACKEND_URL,
|
|
31
31
|
DEFAULT_SIGNER_ADDRESS,
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
getTokenIcon,
|
|
42
42
|
getTokenSymbol,
|
|
43
43
|
isStablecoinSymbol
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-CIXHTOO3.mjs";
|
|
45
45
|
|
|
46
46
|
// src/DepositModal.tsx
|
|
47
47
|
import {
|
|
@@ -695,9 +695,8 @@ function AmountStep({
|
|
|
695
695
|
return;
|
|
696
696
|
}
|
|
697
697
|
if (uiConfig?.minDepositUsd && usdValue < uiConfig.minDepositUsd) {
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
);
|
|
698
|
+
setAmount(uiConfig.minDepositUsd.toString());
|
|
699
|
+
setError(null);
|
|
701
700
|
return;
|
|
702
701
|
}
|
|
703
702
|
}
|
|
@@ -737,7 +736,7 @@ function AmountStep({
|
|
|
737
736
|
autoFocus: true
|
|
738
737
|
}
|
|
739
738
|
) }),
|
|
740
|
-
|
|
739
|
+
/* @__PURE__ */ jsx3("div", { className: "rs-amount-available", children: /* @__PURE__ */ jsxs3("span", { className: "rs-amount-available-value", children: [
|
|
741
740
|
formattedBalance,
|
|
742
741
|
" ",
|
|
743
742
|
asset.symbol,
|
|
@@ -881,6 +880,10 @@ function AmountStep({
|
|
|
881
880
|
}
|
|
882
881
|
)
|
|
883
882
|
] }),
|
|
883
|
+
uiConfig?.minDepositUsd && /* @__PURE__ */ jsxs3("div", { className: "rs-amount-minimum", children: [
|
|
884
|
+
currencyFormatter.format(uiConfig.minDepositUsd),
|
|
885
|
+
" minimum deposit"
|
|
886
|
+
] }),
|
|
884
887
|
error && /* @__PURE__ */ jsxs3("div", { className: "rs-amount-error", children: [
|
|
885
888
|
/* @__PURE__ */ jsx3(
|
|
886
889
|
"svg",
|
|
@@ -909,7 +912,7 @@ function AmountStep({
|
|
|
909
912
|
onClick: handleContinue,
|
|
910
913
|
fullWidth: true,
|
|
911
914
|
disabled: !amount || chainMismatch,
|
|
912
|
-
children: "Continue"
|
|
915
|
+
children: uiConfig?.minDepositUsd && parseFloat(amount) > 0 && parseFloat(amount) < uiConfig.minDepositUsd ? "Update order" : "Continue"
|
|
913
916
|
}
|
|
914
917
|
) }),
|
|
915
918
|
/* @__PURE__ */ jsx3(PoweredBy, {})
|
|
@@ -1450,11 +1453,23 @@ function DepositAddressStep({
|
|
|
1450
1453
|
smartAccount,
|
|
1451
1454
|
solanaDepositAddress,
|
|
1452
1455
|
service,
|
|
1456
|
+
allowedRoutes,
|
|
1453
1457
|
onDepositDetected,
|
|
1454
1458
|
onError
|
|
1455
1459
|
}) {
|
|
1456
1460
|
const hasSolana = Boolean(solanaDepositAddress);
|
|
1457
|
-
const
|
|
1461
|
+
const allowedChainSet = useMemo4(
|
|
1462
|
+
() => allowedRoutes?.sourceChains ? new Set(allowedRoutes.sourceChains) : null,
|
|
1463
|
+
[allowedRoutes?.sourceChains]
|
|
1464
|
+
);
|
|
1465
|
+
const allowedTokenSet = useMemo4(
|
|
1466
|
+
() => allowedRoutes?.sourceTokens ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null,
|
|
1467
|
+
[allowedRoutes?.sourceTokens]
|
|
1468
|
+
);
|
|
1469
|
+
const evmChainIds = useMemo4(() => {
|
|
1470
|
+
const all = getSupportedChainIds();
|
|
1471
|
+
return allowedChainSet ? all.filter((id) => allowedChainSet.has(id)) : all;
|
|
1472
|
+
}, [allowedChainSet]);
|
|
1458
1473
|
const chainOptions = useMemo4(
|
|
1459
1474
|
() => hasSolana ? [...evmChainIds, "solana"] : evmChainIds,
|
|
1460
1475
|
[evmChainIds, hasSolana]
|
|
@@ -1463,10 +1478,10 @@ function DepositAddressStep({
|
|
|
1463
1478
|
const defaultChainId = evmChainIds.includes(BASE_CHAIN_ID) ? BASE_CHAIN_ID : evmChainIds[0];
|
|
1464
1479
|
const [sourceChainId, setSourceChainId] = useState6(defaultChainId);
|
|
1465
1480
|
const isSolana = sourceChainId === "solana";
|
|
1466
|
-
const tokensForChain = useMemo4(
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
);
|
|
1481
|
+
const tokensForChain = useMemo4(() => {
|
|
1482
|
+
const all = isSolana ? SOLANA_TOKENS.map((t) => t.symbol) : getTargetTokenSymbolsForChain(sourceChainId);
|
|
1483
|
+
return allowedTokenSet ? all.filter((s) => allowedTokenSet.has(s.toUpperCase())) : all;
|
|
1484
|
+
}, [sourceChainId, isSolana, allowedTokenSet]);
|
|
1470
1485
|
const defaultToken = tokensForChain.includes("USDC") ? "USDC" : tokensForChain[0] ?? "USDC";
|
|
1471
1486
|
const [sourceTokenSymbol, setSourceTokenSymbol] = useState6(defaultToken);
|
|
1472
1487
|
useEffect6(() => {
|
|
@@ -2122,9 +2137,8 @@ function SolanaAmountStep({
|
|
|
2122
2137
|
return;
|
|
2123
2138
|
}
|
|
2124
2139
|
if (uiConfig?.minDepositUsd && usdValue < uiConfig.minDepositUsd) {
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
);
|
|
2140
|
+
setAmount(uiConfig.minDepositUsd.toString());
|
|
2141
|
+
setError(null);
|
|
2128
2142
|
return;
|
|
2129
2143
|
}
|
|
2130
2144
|
}
|
|
@@ -2223,6 +2237,10 @@ function SolanaAmountStep({
|
|
|
2223
2237
|
}
|
|
2224
2238
|
)
|
|
2225
2239
|
] }),
|
|
2240
|
+
uiConfig?.minDepositUsd && /* @__PURE__ */ jsxs8("div", { className: "rs-amount-minimum", children: [
|
|
2241
|
+
currencyFormatter.format(uiConfig.minDepositUsd),
|
|
2242
|
+
" minimum deposit"
|
|
2243
|
+
] }),
|
|
2226
2244
|
error && /* @__PURE__ */ jsxs8("div", { className: "rs-amount-error", children: [
|
|
2227
2245
|
/* @__PURE__ */ jsx8(
|
|
2228
2246
|
"svg",
|
|
@@ -2251,7 +2269,7 @@ function SolanaAmountStep({
|
|
|
2251
2269
|
onClick: handleContinue,
|
|
2252
2270
|
fullWidth: true,
|
|
2253
2271
|
disabled: !amount,
|
|
2254
|
-
children: "Continue"
|
|
2272
|
+
children: uiConfig?.minDepositUsd && parseFloat(amount) > 0 && parseFloat(amount) < uiConfig.minDepositUsd ? "Update order" : "Continue"
|
|
2255
2273
|
}
|
|
2256
2274
|
) }),
|
|
2257
2275
|
/* @__PURE__ */ jsx8(PoweredBy, {})
|
|
@@ -2522,6 +2540,7 @@ function SolanaConfirmStep({
|
|
|
2522
2540
|
|
|
2523
2541
|
// src/DepositFlow.tsx
|
|
2524
2542
|
import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2543
|
+
var QR_AUTO_ADVANCE_HYDRATION_GRACE_MS = 1e3;
|
|
2525
2544
|
function isSameRoute(sourceChain, sourceToken, targetChain, targetToken) {
|
|
2526
2545
|
return sourceChain === targetChain && sourceToken.toLowerCase() === targetToken.toLowerCase();
|
|
2527
2546
|
}
|
|
@@ -2532,6 +2551,7 @@ function DepositFlow({
|
|
|
2532
2551
|
dappWalletClient,
|
|
2533
2552
|
dappPublicClient,
|
|
2534
2553
|
dappAddress,
|
|
2554
|
+
hasDappWalletClientProp,
|
|
2535
2555
|
targetChain,
|
|
2536
2556
|
targetToken,
|
|
2537
2557
|
service,
|
|
@@ -2561,11 +2581,18 @@ function DepositFlow({
|
|
|
2561
2581
|
onError,
|
|
2562
2582
|
debug
|
|
2563
2583
|
}) {
|
|
2584
|
+
const hasInitialReownSession = Boolean(
|
|
2585
|
+
enableSolana ? reownWallet?.isConnected || reownWallet?.address : reownWallet?.address
|
|
2586
|
+
);
|
|
2587
|
+
const hasInitialWalletHydrationPending = Boolean(
|
|
2588
|
+
dappAddress && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasInitialReownSession && !reownWallet.isReady)
|
|
2589
|
+
);
|
|
2564
2590
|
const [step, setStep] = useState10({ type: "setup" });
|
|
2565
2591
|
const [flowMode, setFlowMode] = useState10(null);
|
|
2566
2592
|
const [totalBalanceUsd, setTotalBalanceUsd] = useState10(0);
|
|
2567
2593
|
const [isConnectSelectionConfirmed, setIsConnectSelectionConfirmed] = useState10(false);
|
|
2568
2594
|
const [selectedWalletId, setSelectedWalletId] = useState10(null);
|
|
2595
|
+
const [hasQrAutoAdvanceGraceElapsed, setHasQrAutoAdvanceGraceElapsed] = useState10(() => !hasInitialWalletHydrationPending);
|
|
2569
2596
|
const flowModeRef = useRef5(null);
|
|
2570
2597
|
const portfolioAssetsRef = useRef5([]);
|
|
2571
2598
|
const stableWalletSignerRef = useRef5(null);
|
|
@@ -2663,7 +2690,21 @@ function DepositFlow({
|
|
|
2663
2690
|
const hasReownSession = Boolean(
|
|
2664
2691
|
enableSolana ? reownWallet?.isConnected || reownWallet?.address : reownWallet?.address
|
|
2665
2692
|
);
|
|
2693
|
+
const isWalletHydrationPending = Boolean(
|
|
2694
|
+
dappAddress && !hasWalletOptions && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasReownSession && !reownWallet.isReady)
|
|
2695
|
+
);
|
|
2666
2696
|
const showConnectStep = flowMode === null && !canAutoLock && !isConnectSelectionConfirmed;
|
|
2697
|
+
useEffect9(() => {
|
|
2698
|
+
if (!isWalletHydrationPending) {
|
|
2699
|
+
setHasQrAutoAdvanceGraceElapsed(true);
|
|
2700
|
+
return;
|
|
2701
|
+
}
|
|
2702
|
+
setHasQrAutoAdvanceGraceElapsed(false);
|
|
2703
|
+
const timeout = window.setTimeout(() => {
|
|
2704
|
+
setHasQrAutoAdvanceGraceElapsed(true);
|
|
2705
|
+
}, QR_AUTO_ADVANCE_HYDRATION_GRACE_MS);
|
|
2706
|
+
return () => window.clearTimeout(timeout);
|
|
2707
|
+
}, [isWalletHydrationPending]);
|
|
2667
2708
|
const walletSelectionKey = useMemo7(() => {
|
|
2668
2709
|
if (flowMode !== "wallet") return null;
|
|
2669
2710
|
if (canAutoLock) {
|
|
@@ -3192,13 +3233,14 @@ function DepositFlow({
|
|
|
3192
3233
|
return;
|
|
3193
3234
|
}
|
|
3194
3235
|
}
|
|
3195
|
-
if (!hasWalletOptions && dappAddress && !hasReownSession && !dappWalletClient) {
|
|
3236
|
+
if (!hasWalletOptions && dappAddress && !hasReownSession && !dappWalletClient && hasQrAutoAdvanceGraceElapsed) {
|
|
3196
3237
|
handleSelectTransferCrypto();
|
|
3197
3238
|
setIsConnectSelectionConfirmed(true);
|
|
3198
3239
|
}
|
|
3199
3240
|
}, [
|
|
3200
3241
|
hasWalletOptions,
|
|
3201
3242
|
hasReownSession,
|
|
3243
|
+
hasQrAutoAdvanceGraceElapsed,
|
|
3202
3244
|
enableSolana,
|
|
3203
3245
|
isConnectSelectionConfirmed,
|
|
3204
3246
|
flowMode,
|
|
@@ -3268,6 +3310,7 @@ function DepositFlow({
|
|
|
3268
3310
|
smartAccount: step.smartAccount,
|
|
3269
3311
|
solanaDepositAddress: enableSolana ? step.solanaDepositAddress : void 0,
|
|
3270
3312
|
service,
|
|
3313
|
+
allowedRoutes,
|
|
3271
3314
|
onDepositDetected: handleDepositAddressDetected,
|
|
3272
3315
|
onError: handleError
|
|
3273
3316
|
}
|
|
@@ -3527,25 +3570,43 @@ function DepositFlow({
|
|
|
3527
3570
|
// src/DepositModal.tsx
|
|
3528
3571
|
import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3529
3572
|
var ReownDepositInner = lazy(
|
|
3530
|
-
() => import("./DepositModalReown-
|
|
3573
|
+
() => import("./DepositModalReown-5QKEE7R3.mjs").then((m) => ({ default: m.DepositModalReown }))
|
|
3531
3574
|
);
|
|
3532
3575
|
function DepositModal(props) {
|
|
3533
3576
|
const needsReown = !!props.reownAppId;
|
|
3577
|
+
const hasDappWalletClientProp = Object.prototype.hasOwnProperty.call(
|
|
3578
|
+
props,
|
|
3579
|
+
"dappWalletClient"
|
|
3580
|
+
);
|
|
3534
3581
|
if (needsReown) {
|
|
3535
|
-
return /* @__PURE__ */ jsx11(Suspense, { fallback: null, children: /* @__PURE__ */ jsx11(
|
|
3582
|
+
return /* @__PURE__ */ jsx11(Suspense, { fallback: null, children: /* @__PURE__ */ jsx11(
|
|
3583
|
+
ReownDepositInner,
|
|
3584
|
+
{
|
|
3585
|
+
...props,
|
|
3586
|
+
hasDappWalletClientProp
|
|
3587
|
+
}
|
|
3588
|
+
) });
|
|
3536
3589
|
}
|
|
3537
|
-
return /* @__PURE__ */ jsx11(
|
|
3590
|
+
return /* @__PURE__ */ jsx11(
|
|
3591
|
+
DepositModalInner,
|
|
3592
|
+
{
|
|
3593
|
+
...props,
|
|
3594
|
+
hasDappWalletClientProp
|
|
3595
|
+
}
|
|
3596
|
+
);
|
|
3538
3597
|
}
|
|
3539
3598
|
DepositModal.displayName = "DepositModal";
|
|
3540
3599
|
function DepositModalInner({
|
|
3541
3600
|
dappWalletClient,
|
|
3542
3601
|
dappPublicClient,
|
|
3543
3602
|
dappAddress,
|
|
3603
|
+
hasDappWalletClientProp,
|
|
3544
3604
|
targetChain: targetChainProp,
|
|
3545
3605
|
targetToken,
|
|
3546
3606
|
isOpen,
|
|
3547
3607
|
onClose,
|
|
3548
3608
|
inline,
|
|
3609
|
+
closeOnOverlayClick,
|
|
3549
3610
|
sourceChain: sourceChainProp,
|
|
3550
3611
|
sourceToken,
|
|
3551
3612
|
defaultAmount,
|
|
@@ -3635,6 +3696,7 @@ function DepositModalInner({
|
|
|
3635
3696
|
onClose,
|
|
3636
3697
|
className,
|
|
3637
3698
|
inline,
|
|
3699
|
+
closeOnOverlayClick,
|
|
3638
3700
|
children: /* @__PURE__ */ jsxs11("div", { ref: modalRef, className: "rs-modal", children: [
|
|
3639
3701
|
/* @__PURE__ */ jsxs11("div", { className: "rs-modal-header--redesigned", children: [
|
|
3640
3702
|
/* @__PURE__ */ jsx11("div", { className: "rs-modal-header-nav-left", children: showBackButton && canGoBack && /* @__PURE__ */ jsx11(
|
|
@@ -3677,13 +3739,44 @@ function DepositModalInner({
|
|
|
3677
3739
|
}
|
|
3678
3740
|
),
|
|
3679
3741
|
/* @__PURE__ */ jsx11("span", { className: "rs-modal-header-title", children: title }),
|
|
3680
|
-
showStepper && /* @__PURE__ */
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3742
|
+
showStepper && currentStepIndex >= 2 && /* @__PURE__ */ jsxs11("div", { className: "rs-step-indicator", style: { marginLeft: 8 }, children: [
|
|
3743
|
+
/* @__PURE__ */ jsx11(
|
|
3744
|
+
"div",
|
|
3745
|
+
{
|
|
3746
|
+
className: `rs-step-indicator-node ${currentStepIndex >= 4 ? "rs-step-indicator-node--complete" : "rs-step-indicator-node--active"}`,
|
|
3747
|
+
children: currentStepIndex >= 4 ? /* @__PURE__ */ jsx11(
|
|
3748
|
+
"svg",
|
|
3749
|
+
{
|
|
3750
|
+
viewBox: "0 0 24 24",
|
|
3751
|
+
fill: "none",
|
|
3752
|
+
stroke: "currentColor",
|
|
3753
|
+
strokeWidth: "3",
|
|
3754
|
+
children: /* @__PURE__ */ jsx11(
|
|
3755
|
+
"path",
|
|
3756
|
+
{
|
|
3757
|
+
strokeLinecap: "round",
|
|
3758
|
+
strokeLinejoin: "round",
|
|
3759
|
+
d: "M5 12l5 5L20 7"
|
|
3760
|
+
}
|
|
3761
|
+
)
|
|
3762
|
+
}
|
|
3763
|
+
) : "1"
|
|
3764
|
+
}
|
|
3765
|
+
),
|
|
3766
|
+
/* @__PURE__ */ jsx11(
|
|
3767
|
+
"div",
|
|
3768
|
+
{
|
|
3769
|
+
className: `rs-step-indicator-line ${currentStepIndex >= 4 ? "rs-step-indicator-line--active" : ""}`
|
|
3770
|
+
}
|
|
3771
|
+
),
|
|
3772
|
+
/* @__PURE__ */ jsx11(
|
|
3773
|
+
"div",
|
|
3774
|
+
{
|
|
3775
|
+
className: `rs-step-indicator-node ${currentStepIndex >= 4 ? "rs-step-indicator-node--active" : "rs-step-indicator-node--inactive"}`,
|
|
3776
|
+
children: "2"
|
|
3777
|
+
}
|
|
3778
|
+
)
|
|
3779
|
+
] })
|
|
3687
3780
|
] }),
|
|
3688
3781
|
balance && /* @__PURE__ */ jsxs11("div", { className: "rs-modal-header-balance", children: [
|
|
3689
3782
|
/* @__PURE__ */ jsxs11("span", { children: [
|
|
@@ -3726,6 +3819,7 @@ function DepositModalInner({
|
|
|
3726
3819
|
dappWalletClient,
|
|
3727
3820
|
dappPublicClient,
|
|
3728
3821
|
dappAddress,
|
|
3822
|
+
hasDappWalletClientProp,
|
|
3729
3823
|
targetChain,
|
|
3730
3824
|
targetToken,
|
|
3731
3825
|
service,
|
|
@@ -26,7 +26,7 @@ var SUPPORTED_TOKEN_MATRIX = {
|
|
|
26
26
|
ETH: [mainnet.id, base.id, arbitrum.id, optimism.id, polygon.id, soneium.id],
|
|
27
27
|
WETH: [mainnet.id, base.id, arbitrum.id, optimism.id, polygon.id, soneium.id],
|
|
28
28
|
USDC: [mainnet.id, base.id, arbitrum.id, optimism.id, polygon.id, soneium.id],
|
|
29
|
-
USDT: [mainnet.id, arbitrum.id, polygon.id, bsc.id, plasma.id]
|
|
29
|
+
USDT: [mainnet.id, arbitrum.id, optimism.id, polygon.id, bsc.id, plasma.id]
|
|
30
30
|
};
|
|
31
31
|
var CHAIN_DISPLAY_ORDER = [
|
|
32
32
|
mainnet.id,
|