@rhinestone/deposit-modal 0.0.0-dev-20260702165250 → 0.0.0-dev-20260703144336
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-6FK5K7TT.mjs → DepositModalReown-EJXUL2TH.mjs} +3 -3
- package/dist/{DepositModalReown-5UDCX5BE.cjs → DepositModalReown-SB2P2CJ6.cjs} +6 -6
- package/dist/{WithdrawModalReown-YWEYDTS4.cjs → WithdrawModalReown-43WLYNBY.cjs} +6 -6
- package/dist/{WithdrawModalReown-UIZMDP5U.mjs → WithdrawModalReown-SHPKKFSL.mjs} +3 -3
- package/dist/{chunk-ABZ2BP2A.mjs → chunk-FTFC73H5.mjs} +1 -1
- package/dist/{chunk-MAUMKYS2.mjs → chunk-FZ5G7CTG.mjs} +120 -24
- package/dist/{chunk-HA3IJ7IR.mjs → chunk-GKXBBP45.mjs} +108 -34
- package/dist/{chunk-QIJDTAN4.cjs → chunk-IP7BMQSB.cjs} +4 -4
- package/dist/{chunk-5EWWCYTA.cjs → chunk-L4QRYIVA.cjs} +57 -57
- package/dist/{chunk-Q7RXYKBM.cjs → chunk-QSDQ7UDT.cjs} +147 -73
- package/dist/{chunk-N7TOQW24.cjs → chunk-VLUN7ORG.cjs} +461 -365
- package/dist/{chunk-CYI7LORX.mjs → chunk-Y22SUCEZ.mjs} +2 -2
- package/dist/deposit.cjs +3 -3
- package/dist/deposit.mjs +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.mjs +3 -3
- package/dist/styles.css +49 -12
- package/dist/withdraw.cjs +3 -3
- package/dist/withdraw.mjs +2 -2
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DepositModalInner
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FZ5G7CTG.mjs";
|
|
4
4
|
import "./chunk-FJWLC4AM.mjs";
|
|
5
5
|
import {
|
|
6
6
|
ReownWalletProvider,
|
|
7
7
|
useReownWallet
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-FTFC73H5.mjs";
|
|
9
|
+
import "./chunk-GKXBBP45.mjs";
|
|
10
10
|
import "./chunk-F7P4MV72.mjs";
|
|
11
11
|
import "./chunk-WJX3TJFK.mjs";
|
|
12
12
|
|
|
@@ -1,12 +1,12 @@
|
|
|
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 _chunkVLUN7ORGcjs = require('./chunk-VLUN7ORG.cjs');
|
|
4
4
|
require('./chunk-NRNJAQUA.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
require('./chunk-
|
|
8
|
+
var _chunkIP7BMQSBcjs = require('./chunk-IP7BMQSB.cjs');
|
|
9
|
+
require('./chunk-QSDQ7UDT.cjs');
|
|
10
10
|
require('./chunk-UEKPBRBY.cjs');
|
|
11
11
|
require('./chunk-ABVRVW3P.cjs');
|
|
12
12
|
|
|
@@ -16,7 +16,7 @@ var _react3 = require('@reown/appkit/react');
|
|
|
16
16
|
var _react5 = require('@reown/appkit-adapter-solana/react');
|
|
17
17
|
var _jsxruntime = require('react/jsx-runtime');
|
|
18
18
|
function DepositModalWithReown(props) {
|
|
19
|
-
const reown =
|
|
19
|
+
const reown = _chunkIP7BMQSBcjs.useReownWallet.call(void 0, );
|
|
20
20
|
const enableSolana = _nullishCoalesce(props.enableSolana, () => ( true));
|
|
21
21
|
const { walletProvider: solanaWalletProvider } = _react3.useAppKitProvider.call(void 0,
|
|
22
22
|
enableSolana ? "solana" : "eip155"
|
|
@@ -37,7 +37,7 @@ function DepositModalWithReown(props) {
|
|
|
37
37
|
reown.disconnect();
|
|
38
38
|
}, [reown.disconnect]);
|
|
39
39
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
40
|
-
|
|
40
|
+
_chunkVLUN7ORGcjs.DepositModalInner,
|
|
41
41
|
{
|
|
42
42
|
...props,
|
|
43
43
|
reownWallet: reownWithSolana,
|
|
@@ -48,7 +48,7 @@ function DepositModalWithReown(props) {
|
|
|
48
48
|
}
|
|
49
49
|
function DepositModalReown(props) {
|
|
50
50
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
51
|
-
|
|
51
|
+
_chunkIP7BMQSBcjs.ReownWalletProvider,
|
|
52
52
|
{
|
|
53
53
|
projectId: props.reownAppId,
|
|
54
54
|
theme: props.theme,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkL4QRYIVAcjs = require('./chunk-L4QRYIVA.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('./chunk-
|
|
7
|
+
var _chunkIP7BMQSBcjs = require('./chunk-IP7BMQSB.cjs');
|
|
8
|
+
require('./chunk-QSDQ7UDT.cjs');
|
|
9
9
|
require('./chunk-UEKPBRBY.cjs');
|
|
10
10
|
require('./chunk-ABVRVW3P.cjs');
|
|
11
11
|
|
|
@@ -13,7 +13,7 @@ require('./chunk-ABVRVW3P.cjs');
|
|
|
13
13
|
var _react = require('react');
|
|
14
14
|
var _jsxruntime = require('react/jsx-runtime');
|
|
15
15
|
function WithdrawModalWithReown(props) {
|
|
16
|
-
const reown =
|
|
16
|
+
const reown = _chunkIP7BMQSBcjs.useReownWallet.call(void 0, );
|
|
17
17
|
const handleConnect = _react.useCallback.call(void 0, () => {
|
|
18
18
|
reown.openConnect();
|
|
19
19
|
}, [reown.openConnect]);
|
|
@@ -21,7 +21,7 @@ function WithdrawModalWithReown(props) {
|
|
|
21
21
|
reown.disconnect();
|
|
22
22
|
}, [reown.disconnect]);
|
|
23
23
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
24
|
-
|
|
24
|
+
_chunkL4QRYIVAcjs.WithdrawModalInner,
|
|
25
25
|
{
|
|
26
26
|
...props,
|
|
27
27
|
reownWallet: reown,
|
|
@@ -32,7 +32,7 @@ function WithdrawModalWithReown(props) {
|
|
|
32
32
|
}
|
|
33
33
|
function WithdrawModalReown(props) {
|
|
34
34
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
35
|
-
|
|
35
|
+
_chunkIP7BMQSBcjs.ReownWalletProvider,
|
|
36
36
|
{
|
|
37
37
|
projectId: props.reownAppId,
|
|
38
38
|
theme: props.theme,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WithdrawModalInner
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Y22SUCEZ.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ReownWalletProvider,
|
|
6
6
|
useReownWallet
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-FTFC73H5.mjs";
|
|
8
|
+
import "./chunk-GKXBBP45.mjs";
|
|
9
9
|
import "./chunk-F7P4MV72.mjs";
|
|
10
10
|
import "./chunk-WJX3TJFK.mjs";
|
|
11
11
|
|
|
@@ -68,7 +68,7 @@ import {
|
|
|
68
68
|
useLatestRef,
|
|
69
69
|
useRpcUrls,
|
|
70
70
|
useStableRpcUrls
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-GKXBBP45.mjs";
|
|
72
72
|
import {
|
|
73
73
|
SAFE_ABI
|
|
74
74
|
} from "./chunk-F7P4MV72.mjs";
|
|
@@ -1008,7 +1008,13 @@ function ConfirmStep({
|
|
|
1008
1008
|
});
|
|
1009
1009
|
}
|
|
1010
1010
|
onDepositSubmitted?.(hash, asset.chainId, amountUnits.toString());
|
|
1011
|
-
onConfirm(
|
|
1011
|
+
onConfirm(
|
|
1012
|
+
hash,
|
|
1013
|
+
asset.chainId,
|
|
1014
|
+
amountUnits.toString(),
|
|
1015
|
+
resolvedSourceToken,
|
|
1016
|
+
quote?.fees?.breakdown
|
|
1017
|
+
);
|
|
1012
1018
|
} catch (err) {
|
|
1013
1019
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
1014
1020
|
const message = formatUserError(raw);
|
|
@@ -2244,7 +2250,8 @@ function SwappedIframeStep({
|
|
|
2244
2250
|
onSwappedFailed,
|
|
2245
2251
|
onClose,
|
|
2246
2252
|
onGoBack,
|
|
2247
|
-
onError
|
|
2253
|
+
onError,
|
|
2254
|
+
onImmersiveChange
|
|
2248
2255
|
}) {
|
|
2249
2256
|
const [widgetUrl, setWidgetUrl] = useState6(null);
|
|
2250
2257
|
const [loadError, setLoadError] = useState6(null);
|
|
@@ -2272,6 +2279,8 @@ function SwappedIframeStep({
|
|
|
2272
2279
|
onErrorRef.current = onError;
|
|
2273
2280
|
const onGoBackRef = useRef6(onGoBack);
|
|
2274
2281
|
onGoBackRef.current = onGoBack;
|
|
2282
|
+
const onImmersiveChangeRef = useRef6(onImmersiveChange);
|
|
2283
|
+
onImmersiveChangeRef.current = onImmersiveChange;
|
|
2275
2284
|
const loadUrlRef = useRef6(loadUrl);
|
|
2276
2285
|
loadUrlRef.current = loadUrl;
|
|
2277
2286
|
useEffect6(() => {
|
|
@@ -2442,14 +2451,16 @@ function SwappedIframeStep({
|
|
|
2442
2451
|
if (!txHash) return;
|
|
2443
2452
|
completeFiredRef.current = true;
|
|
2444
2453
|
onSwappedCompleteRef.current({
|
|
2454
|
+
smartAccount,
|
|
2445
2455
|
txHash,
|
|
2446
2456
|
orderCrypto: orderState?.orderCrypto ?? null,
|
|
2447
2457
|
// Base-unit source amount from the deposit row/event, consistent with the
|
|
2448
2458
|
// wallet/QR path. ProcessingStep + onLifecycle expect base units.
|
|
2449
2459
|
amount: getEventSourceDetails(latestEvent ?? void 0).amount ?? null,
|
|
2460
|
+
expectedOrderUuid: expectedOrderUuidRef.current,
|
|
2450
2461
|
initialEvent: latestEvent ?? void 0
|
|
2451
2462
|
});
|
|
2452
|
-
}, [latestEvent, orderState]);
|
|
2463
|
+
}, [latestEvent, orderState, smartAccount]);
|
|
2453
2464
|
useEffect6(() => {
|
|
2454
2465
|
if (failedFiredRef.current || completeFiredRef.current) return;
|
|
2455
2466
|
if (!isFailedEvent(latestEvent ?? void 0)) return;
|
|
@@ -2462,6 +2473,11 @@ function SwappedIframeStep({
|
|
|
2462
2473
|
failureMessageForEvent(latestEvent ?? void 0)
|
|
2463
2474
|
);
|
|
2464
2475
|
}, [latestEvent]);
|
|
2476
|
+
const immersive = phase === "iframe" && !loadError;
|
|
2477
|
+
useEffect6(() => {
|
|
2478
|
+
onImmersiveChangeRef.current?.(immersive);
|
|
2479
|
+
}, [immersive]);
|
|
2480
|
+
useEffect6(() => () => onImmersiveChangeRef.current?.(false), []);
|
|
2465
2481
|
if (phase === "tracker") {
|
|
2466
2482
|
const paymentReceived = stepStates[0] === "complete";
|
|
2467
2483
|
if (variant === "connect" && !terminalState && paymentReceived) {
|
|
@@ -2508,7 +2524,7 @@ function SwappedIframeStep({
|
|
|
2508
2524
|
retryToken
|
|
2509
2525
|
)
|
|
2510
2526
|
] }) }),
|
|
2511
|
-
/* @__PURE__ */ jsx9(PoweredBy, {})
|
|
2527
|
+
loadError && /* @__PURE__ */ jsx9(PoweredBy, {})
|
|
2512
2528
|
] });
|
|
2513
2529
|
}
|
|
2514
2530
|
function deriveStepStates(swappedStatus, latestEvent) {
|
|
@@ -2519,7 +2535,7 @@ function deriveStepStates(swappedStatus, latestEvent) {
|
|
|
2519
2535
|
return ["failed", "pending", "pending", "pending"];
|
|
2520
2536
|
}
|
|
2521
2537
|
const step1Complete = swappedStatus === "order_completed" || swappedStatus === "order_broadcasted";
|
|
2522
|
-
const step2Complete = latestEvent !== null;
|
|
2538
|
+
const step2Complete = latestEvent !== null || swappedStatus === "order_broadcasted";
|
|
2523
2539
|
const step3Complete = latestEvent?.type === "bridge-complete";
|
|
2524
2540
|
if (step3Complete) {
|
|
2525
2541
|
return ["complete", "complete", "complete", "pending"];
|
|
@@ -2571,7 +2587,8 @@ function FiatOnrampStep({
|
|
|
2571
2587
|
onSwappedFailed,
|
|
2572
2588
|
onClose,
|
|
2573
2589
|
onGoBack,
|
|
2574
|
-
onError
|
|
2590
|
+
onError,
|
|
2591
|
+
onImmersiveChange
|
|
2575
2592
|
}) {
|
|
2576
2593
|
const loadUrl = useCallback3(async () => {
|
|
2577
2594
|
const prefetched = consumePrefetchedUrl?.(smartAccount, paymentMethod);
|
|
@@ -2602,7 +2619,8 @@ function FiatOnrampStep({
|
|
|
2602
2619
|
onSwappedFailed,
|
|
2603
2620
|
onClose,
|
|
2604
2621
|
onGoBack,
|
|
2605
|
-
onError
|
|
2622
|
+
onError,
|
|
2623
|
+
onImmersiveChange
|
|
2606
2624
|
}
|
|
2607
2625
|
);
|
|
2608
2626
|
}
|
|
@@ -2648,7 +2666,8 @@ function ExchangeConnectStep({
|
|
|
2648
2666
|
onSwappedFailed,
|
|
2649
2667
|
onClose,
|
|
2650
2668
|
onGoBack,
|
|
2651
|
-
onError
|
|
2669
|
+
onError,
|
|
2670
|
+
onImmersiveChange
|
|
2652
2671
|
}) {
|
|
2653
2672
|
const loadUrl = useCallback4(async () => {
|
|
2654
2673
|
const res = await service.getSwappedConnectUrl({
|
|
@@ -2672,7 +2691,8 @@ function ExchangeConnectStep({
|
|
|
2672
2691
|
onSwappedFailed,
|
|
2673
2692
|
onClose,
|
|
2674
2693
|
onGoBack,
|
|
2675
|
-
onError
|
|
2694
|
+
onError,
|
|
2695
|
+
onImmersiveChange
|
|
2676
2696
|
}
|
|
2677
2697
|
);
|
|
2678
2698
|
}
|
|
@@ -4182,7 +4202,8 @@ function createInitialState(overrides) {
|
|
|
4182
4202
|
txHash: null,
|
|
4183
4203
|
directTransfer: false,
|
|
4184
4204
|
swappedContext: null,
|
|
4185
|
-
initialEvent: null
|
|
4205
|
+
initialEvent: null,
|
|
4206
|
+
quoteFeeBreakdown: null
|
|
4186
4207
|
},
|
|
4187
4208
|
dappImport: {
|
|
4188
4209
|
activeProviderId: null,
|
|
@@ -4792,10 +4813,22 @@ function applyAction(state, action) {
|
|
|
4792
4813
|
txHash: action.txHash,
|
|
4793
4814
|
directTransfer: action.directTransfer ?? false,
|
|
4794
4815
|
swappedContext: action.swappedContext ?? null,
|
|
4795
|
-
initialEvent: action.initialEvent ?? null
|
|
4816
|
+
initialEvent: action.initialEvent ?? null,
|
|
4817
|
+
quoteFeeBreakdown: action.quoteFeeBreakdown ?? null
|
|
4796
4818
|
},
|
|
4797
4819
|
flow: { ...state.flow, step: "processing" }
|
|
4798
4820
|
};
|
|
4821
|
+
case "processing/quote-fee-breakdown-loaded":
|
|
4822
|
+
if (state.flow.step !== "processing" || state.processing.txHash?.toLowerCase() !== action.txHash.toLowerCase()) {
|
|
4823
|
+
return state;
|
|
4824
|
+
}
|
|
4825
|
+
return {
|
|
4826
|
+
...state,
|
|
4827
|
+
processing: {
|
|
4828
|
+
...state.processing,
|
|
4829
|
+
quoteFeeBreakdown: action.quoteFeeBreakdown
|
|
4830
|
+
}
|
|
4831
|
+
};
|
|
4799
4832
|
case "dapp-import/availability-loading":
|
|
4800
4833
|
return {
|
|
4801
4834
|
...state,
|
|
@@ -4963,7 +4996,8 @@ function applyAction(state, action) {
|
|
|
4963
4996
|
txHash: null,
|
|
4964
4997
|
directTransfer: false,
|
|
4965
4998
|
swappedContext: null,
|
|
4966
|
-
initialEvent: null
|
|
4999
|
+
initialEvent: null,
|
|
5000
|
+
quoteFeeBreakdown: null
|
|
4967
5001
|
},
|
|
4968
5002
|
// Drop fetched availability wholesale. The fetch effect refetches
|
|
4969
5003
|
// unconditionally on remount (so keeping the map saves nothing),
|
|
@@ -5320,6 +5354,33 @@ function isSameRoute2(sourceChain, sourceToken, targetChain, targetToken) {
|
|
|
5320
5354
|
var SWAPPED_SOURCE_CHAIN = 8453;
|
|
5321
5355
|
var SWAPPED_SOURCE_TOKEN = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
|
|
5322
5356
|
var SWAPPED_SOURCE_DECIMALS = 6;
|
|
5357
|
+
var SWAPPED_QUOTE_FEE_TIMEOUT_MS = 1500;
|
|
5358
|
+
async function fetchQuoteFeeBreakdown(params) {
|
|
5359
|
+
try {
|
|
5360
|
+
if (BigInt(params.amount) <= 0n) return void 0;
|
|
5361
|
+
} catch {
|
|
5362
|
+
return void 0;
|
|
5363
|
+
}
|
|
5364
|
+
let timeoutId;
|
|
5365
|
+
try {
|
|
5366
|
+
const quote = await Promise.race([
|
|
5367
|
+
params.service.getQuotePreview({
|
|
5368
|
+
account: params.account,
|
|
5369
|
+
sourceChainId: params.sourceChainId,
|
|
5370
|
+
sourceToken: params.sourceToken,
|
|
5371
|
+
amount: params.amount
|
|
5372
|
+
}),
|
|
5373
|
+
new Promise((resolve) => {
|
|
5374
|
+
timeoutId = setTimeout(resolve, SWAPPED_QUOTE_FEE_TIMEOUT_MS, null);
|
|
5375
|
+
})
|
|
5376
|
+
]);
|
|
5377
|
+
return quote?.fees?.breakdown;
|
|
5378
|
+
} catch {
|
|
5379
|
+
return void 0;
|
|
5380
|
+
} finally {
|
|
5381
|
+
if (timeoutId !== void 0) clearTimeout(timeoutId);
|
|
5382
|
+
}
|
|
5383
|
+
}
|
|
5323
5384
|
var DEFAULT_FIAT_ONRAMP_METHODS = [
|
|
5324
5385
|
{
|
|
5325
5386
|
method: "creditcard",
|
|
@@ -5460,7 +5521,8 @@ function deriveStep(flow, d, p, activeEntry, fiat, exchange) {
|
|
|
5460
5521
|
inputAmountUsd: d.inputAmountUsd ?? void 0,
|
|
5461
5522
|
directTransfer: p.directTransfer,
|
|
5462
5523
|
swappedContext: p.swappedContext ?? void 0,
|
|
5463
|
-
initialEvent: p.initialEvent ?? void 0
|
|
5524
|
+
initialEvent: p.initialEvent ?? void 0,
|
|
5525
|
+
quoteFeeBreakdown: p.quoteFeeBreakdown ?? void 0
|
|
5464
5526
|
};
|
|
5465
5527
|
}
|
|
5466
5528
|
}
|
|
@@ -5511,6 +5573,7 @@ function DepositFlow({
|
|
|
5511
5573
|
uiConfig,
|
|
5512
5574
|
allowedRoutes,
|
|
5513
5575
|
onStepChange,
|
|
5576
|
+
onSwappedImmersiveChange,
|
|
5514
5577
|
onClose,
|
|
5515
5578
|
onLifecycle,
|
|
5516
5579
|
onEvent,
|
|
@@ -6636,7 +6699,7 @@ function DepositFlow({
|
|
|
6636
6699
|
[targetToken, targetChain, storeApi, activeOwner]
|
|
6637
6700
|
);
|
|
6638
6701
|
const handleDepositSubmitted = useCallback7(
|
|
6639
|
-
(txHash, chainId, amount, token) => {
|
|
6702
|
+
(txHash, chainId, amount, token, quoteFeeBreakdown) => {
|
|
6640
6703
|
logFlow("evm:submitted", {
|
|
6641
6704
|
txHash,
|
|
6642
6705
|
sourceChain: chainId,
|
|
@@ -6655,7 +6718,8 @@ function DepositFlow({
|
|
|
6655
6718
|
sourceSymbol: asset?.symbol,
|
|
6656
6719
|
sourceDecimals: asset?.decimals,
|
|
6657
6720
|
inputAmountUsd: depositAtSubmit.inputAmountUsd ?? void 0,
|
|
6658
|
-
directTransfer: !dappImport && isSameRoute2(chainId, token, targetChain, targetToken)
|
|
6721
|
+
directTransfer: !dappImport && isSameRoute2(chainId, token, targetChain, targetToken),
|
|
6722
|
+
quoteFeeBreakdown
|
|
6659
6723
|
});
|
|
6660
6724
|
},
|
|
6661
6725
|
[logFlow, storeApi, targetChain, targetToken]
|
|
@@ -6670,10 +6734,12 @@ function DepositFlow({
|
|
|
6670
6734
|
const stateAtComplete = storeApi.getState();
|
|
6671
6735
|
const swappedContext = stateAtComplete.flow.mode === "exchange-connect" ? {
|
|
6672
6736
|
variant: "connect",
|
|
6673
|
-
method: stateAtComplete.exchange.selectedConnection
|
|
6737
|
+
method: stateAtComplete.exchange.selectedConnection,
|
|
6738
|
+
expectedOrderUuid: info.expectedOrderUuid
|
|
6674
6739
|
} : stateAtComplete.flow.mode === "fiat-onramp" ? {
|
|
6675
6740
|
variant: "fiat",
|
|
6676
|
-
method: stateAtComplete.fiat.selectedMethod
|
|
6741
|
+
method: stateAtComplete.fiat.selectedMethod,
|
|
6742
|
+
expectedOrderUuid: info.expectedOrderUuid
|
|
6677
6743
|
} : void 0;
|
|
6678
6744
|
storeApi.dispatch({
|
|
6679
6745
|
type: "deposit/submitted",
|
|
@@ -6693,8 +6759,23 @@ function DepositFlow({
|
|
|
6693
6759
|
amount,
|
|
6694
6760
|
sourceDecimals: SWAPPED_SOURCE_DECIMALS
|
|
6695
6761
|
});
|
|
6762
|
+
void (async () => {
|
|
6763
|
+
const quoteFeeBreakdown = await fetchQuoteFeeBreakdown({
|
|
6764
|
+
service,
|
|
6765
|
+
account: info.smartAccount,
|
|
6766
|
+
sourceChainId: SWAPPED_SOURCE_CHAIN,
|
|
6767
|
+
sourceToken: SWAPPED_SOURCE_TOKEN,
|
|
6768
|
+
amount
|
|
6769
|
+
});
|
|
6770
|
+
if (!quoteFeeBreakdown) return;
|
|
6771
|
+
storeApi.dispatch({
|
|
6772
|
+
type: "processing/quote-fee-breakdown-loaded",
|
|
6773
|
+
txHash: info.txHash,
|
|
6774
|
+
quoteFeeBreakdown
|
|
6775
|
+
});
|
|
6776
|
+
})();
|
|
6696
6777
|
},
|
|
6697
|
-
[logFlow,
|
|
6778
|
+
[logFlow, onLifecycleRef, service, storeApi]
|
|
6698
6779
|
);
|
|
6699
6780
|
const handleDepositSubmittedCallback = useCallback7(
|
|
6700
6781
|
(txHash, sourceChain, amount) => {
|
|
@@ -6936,7 +7017,8 @@ function DepositFlow({
|
|
|
6936
7017
|
onClose: onClose ?? (() => {
|
|
6937
7018
|
}),
|
|
6938
7019
|
onGoBack: handleBack,
|
|
6939
|
-
onError: handleError
|
|
7020
|
+
onError: handleError,
|
|
7021
|
+
onImmersiveChange: onSwappedImmersiveChange
|
|
6940
7022
|
}
|
|
6941
7023
|
),
|
|
6942
7024
|
step.type === "processing" && /* @__PURE__ */ jsx19(
|
|
@@ -6954,10 +7036,12 @@ function DepositFlow({
|
|
|
6954
7036
|
sourceDecimals: step.sourceDecimals,
|
|
6955
7037
|
amountUsd: step.inputAmountUsd,
|
|
6956
7038
|
swappedContext: step.swappedContext,
|
|
7039
|
+
quoteFeeBreakdown: step.quoteFeeBreakdown,
|
|
6957
7040
|
service,
|
|
6958
7041
|
directTransfer: step.directTransfer,
|
|
6959
7042
|
initialEvent: step.initialEvent,
|
|
6960
7043
|
isSwappedOrder: true,
|
|
7044
|
+
uiConfig,
|
|
6961
7045
|
onClose,
|
|
6962
7046
|
onNewDeposit: handleNewDeposit,
|
|
6963
7047
|
onDepositComplete: handleDepositComplete,
|
|
@@ -7005,7 +7089,8 @@ function DepositFlow({
|
|
|
7005
7089
|
onClose: onClose ?? (() => {
|
|
7006
7090
|
}),
|
|
7007
7091
|
onGoBack: handleBack,
|
|
7008
|
-
onError: handleError
|
|
7092
|
+
onError: handleError,
|
|
7093
|
+
onImmersiveChange: onSwappedImmersiveChange
|
|
7009
7094
|
}
|
|
7010
7095
|
),
|
|
7011
7096
|
step.type === "processing" && /* @__PURE__ */ jsx19(
|
|
@@ -7023,10 +7108,12 @@ function DepositFlow({
|
|
|
7023
7108
|
sourceDecimals: step.sourceDecimals,
|
|
7024
7109
|
amountUsd: step.inputAmountUsd,
|
|
7025
7110
|
swappedContext: step.swappedContext,
|
|
7111
|
+
quoteFeeBreakdown: step.quoteFeeBreakdown,
|
|
7026
7112
|
service,
|
|
7027
7113
|
directTransfer: step.directTransfer,
|
|
7028
7114
|
initialEvent: step.initialEvent,
|
|
7029
7115
|
isSwappedOrder: true,
|
|
7116
|
+
uiConfig,
|
|
7030
7117
|
onClose,
|
|
7031
7118
|
onNewDeposit: handleNewDeposit,
|
|
7032
7119
|
onDepositComplete: handleDepositComplete,
|
|
@@ -7156,6 +7243,7 @@ function DepositFlow({
|
|
|
7156
7243
|
service,
|
|
7157
7244
|
directTransfer: effectiveStep.directTransfer,
|
|
7158
7245
|
initialEvent: effectiveStep.initialEvent,
|
|
7246
|
+
quoteFeeBreakdown: effectiveStep.quoteFeeBreakdown,
|
|
7159
7247
|
onClose,
|
|
7160
7248
|
onNewDeposit: handleNewDeposit,
|
|
7161
7249
|
onDepositComplete: handleDepositComplete,
|
|
@@ -7318,6 +7406,7 @@ function DepositFlow({
|
|
|
7318
7406
|
service,
|
|
7319
7407
|
directTransfer: effectiveStep.directTransfer,
|
|
7320
7408
|
initialEvent: effectiveStep.initialEvent,
|
|
7409
|
+
quoteFeeBreakdown: effectiveStep.quoteFeeBreakdown,
|
|
7321
7410
|
uiConfig,
|
|
7322
7411
|
onClose,
|
|
7323
7412
|
onNewDeposit: handleNewDeposit,
|
|
@@ -7618,7 +7707,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
|
7618
7707
|
// src/DepositModal.tsx
|
|
7619
7708
|
import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
7620
7709
|
var ReownDepositInner = lazy2(
|
|
7621
|
-
() => import("./DepositModalReown-
|
|
7710
|
+
() => import("./DepositModalReown-EJXUL2TH.mjs").then((m) => ({ default: m.DepositModalReown }))
|
|
7622
7711
|
);
|
|
7623
7712
|
function sortByCreatedAtDesc(items) {
|
|
7624
7713
|
return [...items].sort((a, b) => {
|
|
@@ -7698,6 +7787,7 @@ function DepositModalInner({
|
|
|
7698
7787
|
const modalRef = useRef9(null);
|
|
7699
7788
|
const onReadyRef = useLatestRef(onReady);
|
|
7700
7789
|
const [currentScreen, setCurrentScreen] = useState13("connect");
|
|
7790
|
+
const [swappedImmersive, setSwappedImmersive] = useState13(false);
|
|
7701
7791
|
const [backHandler, setBackHandler] = useState13(
|
|
7702
7792
|
void 0
|
|
7703
7793
|
);
|
|
@@ -7860,6 +7950,9 @@ function DepositModalInner({
|
|
|
7860
7950
|
cursorRef.current = null;
|
|
7861
7951
|
historyStaleRef.current = false;
|
|
7862
7952
|
historyLoadedRef.current = false;
|
|
7953
|
+
setCurrentScreen("connect");
|
|
7954
|
+
setBackHandler(void 0);
|
|
7955
|
+
setSwappedImmersive(false);
|
|
7863
7956
|
}
|
|
7864
7957
|
}, [isOpen]);
|
|
7865
7958
|
useEffect11(() => {
|
|
@@ -7869,6 +7962,8 @@ function DepositModalInner({
|
|
|
7869
7962
|
}, [isOpen, store]);
|
|
7870
7963
|
const showBackButton = uiConfig?.showBackButton ?? true;
|
|
7871
7964
|
const canGoBack = backHandler !== void 0;
|
|
7965
|
+
const hideHeaderChrome = swappedImmersive;
|
|
7966
|
+
const modalClassName = `rs-modal${hideHeaderChrome ? " rs-modal--swapped-iframe" : ""}`;
|
|
7872
7967
|
return /* @__PURE__ */ jsx21(RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ jsx21(DepositStoreProvider, { store, children: /* @__PURE__ */ jsx21(
|
|
7873
7968
|
Modal,
|
|
7874
7969
|
{
|
|
@@ -7877,8 +7972,8 @@ function DepositModalInner({
|
|
|
7877
7972
|
className,
|
|
7878
7973
|
inline,
|
|
7879
7974
|
closeOnOverlayClick,
|
|
7880
|
-
children: /* @__PURE__ */ jsxs19("div", { ref: modalRef, className:
|
|
7881
|
-
/* @__PURE__ */ jsxs19("div", { className: "rs-modal-header--redesigned", children: [
|
|
7975
|
+
children: /* @__PURE__ */ jsxs19("div", { ref: modalRef, className: modalClassName, children: [
|
|
7976
|
+
!hideHeaderChrome && /* @__PURE__ */ jsxs19("div", { className: "rs-modal-header--redesigned", children: [
|
|
7882
7977
|
/* @__PURE__ */ jsx21("div", { className: "rs-modal-header-nav-left", children: showBackButton && canGoBack && backHandler && /* @__PURE__ */ jsx21(
|
|
7883
7978
|
"button",
|
|
7884
7979
|
{
|
|
@@ -7947,6 +8042,7 @@ function DepositModalInner({
|
|
|
7947
8042
|
uiConfig,
|
|
7948
8043
|
allowedRoutes,
|
|
7949
8044
|
onStepChange: handleStepChange,
|
|
8045
|
+
onSwappedImmersiveChange: setSwappedImmersive,
|
|
7950
8046
|
onClose,
|
|
7951
8047
|
onLifecycle: handleLifecycle,
|
|
7952
8048
|
onEvent,
|