@rhinestone/deposit-modal 0.3.0-alpha.3 → 0.3.0-alpha.5
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-6QBOLFNL.mjs → DepositModalReown-3VZ5AKV2.mjs} +2 -2
- package/dist/{DepositModalReown-DVRWDPYV.cjs → DepositModalReown-PPX34UAK.cjs} +3 -3
- package/dist/{WithdrawModalReown-KGFCNAJP.cjs → WithdrawModalReown-4B6IMTBB.cjs} +3 -3
- package/dist/{WithdrawModalReown-UO7XCJ7K.mjs → WithdrawModalReown-BB3MZAIO.mjs} +2 -2
- package/dist/{chunk-UEYFJM5Y.cjs → chunk-BB6UVRAV.cjs} +74 -74
- package/dist/{chunk-TFXIQ7YH.mjs → chunk-CTYKQ4B4.mjs} +295 -171
- package/dist/{chunk-V6NJIPSS.cjs → chunk-DX2D2TRZ.cjs} +239 -115
- package/dist/{chunk-GE3TMZEL.mjs → chunk-QI6Q7V6O.mjs} +19 -19
- package/dist/{chunk-IATY2C5R.cjs → chunk-TTD2FEA2.cjs} +374 -313
- package/dist/{chunk-QLTTDVFU.mjs → chunk-ZUWAIMMH.mjs} +163 -102
- 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 +396 -177
- package/dist/withdraw.cjs +3 -3
- package/dist/withdraw.mjs +2 -2
- package/package.json +1 -1
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
|
|
51
|
-
var
|
|
51
|
+
var _chunkDX2D2TRZcjs = require('./chunk-DX2D2TRZ.cjs');
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
|
|
@@ -106,7 +106,7 @@ function AssetSelectStep({
|
|
|
106
106
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
107
107
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
108
108
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
109
|
-
return
|
|
109
|
+
return _chunkDX2D2TRZcjs.getAssetId.call(void 0, {
|
|
110
110
|
chainId: defaultSourceChain,
|
|
111
111
|
token: defaultSourceToken
|
|
112
112
|
});
|
|
@@ -123,7 +123,7 @@ function AssetSelectStep({
|
|
|
123
123
|
try {
|
|
124
124
|
const portfolio = await service.fetchPortfolio(address);
|
|
125
125
|
if (!active) return;
|
|
126
|
-
const portfolioAssets =
|
|
126
|
+
const portfolioAssets = _chunkDX2D2TRZcjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
127
127
|
setAssets(portfolioAssets);
|
|
128
128
|
const hasNative = portfolioAssets.some(
|
|
129
129
|
(asset) => asset.token.toLowerCase() === _chunkIVTXEYB2cjs.NATIVE_TOKEN_ADDRESS
|
|
@@ -204,7 +204,7 @@ function AssetSelectStep({
|
|
|
204
204
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
205
205
|
const numeric = Number(raw);
|
|
206
206
|
if (!Number.isFinite(numeric)) return raw;
|
|
207
|
-
return
|
|
207
|
+
return _chunkDX2D2TRZcjs.tokenFormatter.format(numeric);
|
|
208
208
|
} catch (e3) {
|
|
209
209
|
return asset.balance;
|
|
210
210
|
}
|
|
@@ -212,20 +212,20 @@ function AssetSelectStep({
|
|
|
212
212
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
213
213
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
214
214
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
215
|
-
|
|
215
|
+
_chunkDX2D2TRZcjs.BodyHeader,
|
|
216
216
|
{
|
|
217
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
217
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.WalletIcon, {}),
|
|
218
218
|
title: "Your assets",
|
|
219
219
|
subtitle: "Select source assets to transfer"
|
|
220
220
|
}
|
|
221
221
|
),
|
|
222
222
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
223
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
223
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
224
224
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
225
225
|
] }),
|
|
226
226
|
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-alert rs-alert--error", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-alert-text", children: error }) }),
|
|
227
227
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
228
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
228
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
229
229
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
230
230
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
231
231
|
address.slice(0, 6),
|
|
@@ -292,14 +292,14 @@ function AssetSelectStep({
|
|
|
292
292
|
] })
|
|
293
293
|
] })
|
|
294
294
|
] }),
|
|
295
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ?
|
|
295
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunkDX2D2TRZcjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
296
296
|
]
|
|
297
297
|
},
|
|
298
298
|
asset.id
|
|
299
299
|
);
|
|
300
300
|
}) }),
|
|
301
301
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
302
|
-
|
|
302
|
+
_chunkDX2D2TRZcjs.Button,
|
|
303
303
|
{
|
|
304
304
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
305
305
|
disabled: !selectedAsset,
|
|
@@ -308,7 +308,7 @@ function AssetSelectStep({
|
|
|
308
308
|
}
|
|
309
309
|
)
|
|
310
310
|
] }),
|
|
311
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
311
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.PoweredBy, {})
|
|
312
312
|
] });
|
|
313
313
|
}
|
|
314
314
|
async function fetchNativeAssets(address, publicClient, existing) {
|
|
@@ -316,7 +316,7 @@ async function fetchNativeAssets(address, publicClient, existing) {
|
|
|
316
316
|
const connectedChainId = _optionalChain([publicClient, 'access', _7 => _7.chain, 'optionalAccess', _8 => _8.id]);
|
|
317
317
|
if (!connectedChainId) return [];
|
|
318
318
|
if (!_chunkIVTXEYB2cjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
|
|
319
|
-
const id =
|
|
319
|
+
const id = _chunkDX2D2TRZcjs.getAssetId.call(void 0, {
|
|
320
320
|
chainId: connectedChainId,
|
|
321
321
|
token: _chunkIVTXEYB2cjs.NATIVE_TOKEN_ADDRESS
|
|
322
322
|
});
|
|
@@ -420,7 +420,7 @@ function AmountStep({
|
|
|
420
420
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
421
421
|
if (!balanceTarget || !publicClient) return;
|
|
422
422
|
try {
|
|
423
|
-
const bal =
|
|
423
|
+
const bal = _chunkDX2D2TRZcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
424
424
|
address: asset.token,
|
|
425
425
|
abi: _viem.erc20Abi,
|
|
426
426
|
functionName: "balanceOf",
|
|
@@ -441,7 +441,7 @@ function AmountStep({
|
|
|
441
441
|
hasAttemptedSwitch.current = true;
|
|
442
442
|
switchChain(asset.chainId).catch((err) => {
|
|
443
443
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
444
|
-
setError(
|
|
444
|
+
setError(_chunkDX2D2TRZcjs.formatUserError.call(void 0, raw));
|
|
445
445
|
});
|
|
446
446
|
}
|
|
447
447
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -475,7 +475,7 @@ function AmountStep({
|
|
|
475
475
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
476
476
|
const numeric = Number(raw);
|
|
477
477
|
if (!Number.isFinite(numeric)) return raw;
|
|
478
|
-
return
|
|
478
|
+
return _chunkDX2D2TRZcjs.tokenFormatter.format(numeric);
|
|
479
479
|
} catch (e8) {
|
|
480
480
|
return "\u2026";
|
|
481
481
|
}
|
|
@@ -586,7 +586,7 @@ function AmountStep({
|
|
|
586
586
|
liquidityWarning
|
|
587
587
|
);
|
|
588
588
|
};
|
|
589
|
-
const continueLabel =
|
|
589
|
+
const continueLabel = exceedsBalance ? "Insufficient balance" : isAboveMax ? "Continue with max allowed deposit" : isBelowMin ? "Continue with minimum deposit" : "Continue";
|
|
590
590
|
const continueDisabled = chainMismatch || isCheckingLiquidity || exceedsBalance || numericAmount === 0 && !isBelowMin || balance === null;
|
|
591
591
|
const sourceChainName = _chunkIVTXEYB2cjs.getChainName.call(void 0, asset.chainId);
|
|
592
592
|
const targetChainName = _chunkIVTXEYB2cjs.getChainName.call(void 0, targetChain);
|
|
@@ -594,7 +594,7 @@ function AmountStep({
|
|
|
594
594
|
const targetTokenIcon = _chunkIVTXEYB2cjs.getTokenIcon.call(void 0, targetSymbol);
|
|
595
595
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
596
596
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
597
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
597
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.WalletIcon, {}), title: "Wallet deposit" }),
|
|
598
598
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
599
599
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
600
600
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-input-row", children: [
|
|
@@ -620,13 +620,13 @@ function AmountStep({
|
|
|
620
620
|
" available",
|
|
621
621
|
balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
622
622
|
" (~",
|
|
623
|
-
|
|
623
|
+
_chunkDX2D2TRZcjs.currencyFormatter.format(balanceUsd),
|
|
624
624
|
")"
|
|
625
625
|
] })
|
|
626
626
|
] }),
|
|
627
627
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
628
628
|
"Min. deposit ",
|
|
629
|
-
|
|
629
|
+
_chunkDX2D2TRZcjs.currencyFormatter.format(minDepositUsd)
|
|
630
630
|
] })
|
|
631
631
|
] })
|
|
632
632
|
] }),
|
|
@@ -667,24 +667,26 @@ function AmountStep({
|
|
|
667
667
|
] }),
|
|
668
668
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
669
669
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
670
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
670
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkDX2D2TRZcjs.currencyFormatter.format(balanceAfterUsd) })
|
|
671
671
|
] })
|
|
672
672
|
] }),
|
|
673
673
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", role: "alert", children: [
|
|
674
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
674
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.AlertTriangleIcon, { style: { width: 16, height: 16, flexShrink: 0 } }),
|
|
675
675
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: error })
|
|
676
676
|
] }),
|
|
677
677
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
678
|
-
|
|
678
|
+
_chunkDX2D2TRZcjs.Button,
|
|
679
679
|
{
|
|
680
680
|
onClick: handleContinue,
|
|
681
681
|
fullWidth: true,
|
|
682
|
+
loading: isCheckingLiquidity,
|
|
683
|
+
loadingText: "Checking liquidity\u2026",
|
|
682
684
|
disabled: continueDisabled,
|
|
683
685
|
children: continueLabel
|
|
684
686
|
}
|
|
685
687
|
)
|
|
686
688
|
] }),
|
|
687
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
689
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.PoweredBy, {})
|
|
688
690
|
] });
|
|
689
691
|
}
|
|
690
692
|
|
|
@@ -756,7 +758,7 @@ function ConfirmStep({
|
|
|
756
758
|
hasAttemptedSwitch.current = true;
|
|
757
759
|
switchChain(asset.chainId).catch((err) => {
|
|
758
760
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
759
|
-
setError(
|
|
761
|
+
setError(_chunkDX2D2TRZcjs.formatUserError.call(void 0, raw));
|
|
760
762
|
});
|
|
761
763
|
}
|
|
762
764
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -803,7 +805,7 @@ function ConfirmStep({
|
|
|
803
805
|
const result = await executeTransfer(amountUnits);
|
|
804
806
|
hash = result.txHash;
|
|
805
807
|
resolvedSourceToken = result.sourceToken;
|
|
806
|
-
} else if (
|
|
808
|
+
} else if (_chunkDX2D2TRZcjs.isNativeAsset.call(void 0, asset)) {
|
|
807
809
|
hash = await walletClient.sendTransaction({
|
|
808
810
|
account,
|
|
809
811
|
chain,
|
|
@@ -824,7 +826,7 @@ function ConfirmStep({
|
|
|
824
826
|
onConfirm(hash, asset.chainId, amountUnits.toString(), resolvedSourceToken);
|
|
825
827
|
} catch (err) {
|
|
826
828
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
827
|
-
const message =
|
|
829
|
+
const message = _chunkDX2D2TRZcjs.formatUserError.call(void 0, raw);
|
|
828
830
|
setError(message);
|
|
829
831
|
_optionalChain([onError, 'optionalCall', _23 => _23(message, "TRANSFER_ERROR")]);
|
|
830
832
|
} finally {
|
|
@@ -833,51 +835,51 @@ function ConfirmStep({
|
|
|
833
835
|
};
|
|
834
836
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
835
837
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
836
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
837
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-
|
|
838
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-
|
|
838
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.WalletIcon, {}), title: "Review deposit" }),
|
|
839
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
|
|
840
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
839
841
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
840
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-
|
|
842
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
841
843
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceChainName }),
|
|
842
|
-
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-
|
|
844
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: sourceChainIcon, alt: "" }) })
|
|
843
845
|
] })
|
|
844
846
|
] }),
|
|
845
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-
|
|
847
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
846
848
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
|
|
847
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-
|
|
849
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
848
850
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName }),
|
|
849
|
-
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-
|
|
851
|
+
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: targetChainIcon, alt: "" }) })
|
|
850
852
|
] })
|
|
851
853
|
] }),
|
|
852
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-
|
|
854
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
853
855
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Estimated time" }),
|
|
854
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-
|
|
856
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: estimatedTime })
|
|
855
857
|
] }),
|
|
856
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-
|
|
858
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
857
859
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "You send" }),
|
|
858
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-
|
|
860
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
859
861
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { children: [
|
|
860
862
|
formattedSendAmount,
|
|
861
863
|
" ",
|
|
862
864
|
asset.symbol
|
|
863
865
|
] }),
|
|
864
|
-
sourceTokenIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-
|
|
866
|
+
sourceTokenIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: sourceTokenIcon, alt: "" }) })
|
|
865
867
|
] })
|
|
866
868
|
] }),
|
|
867
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-
|
|
869
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
868
870
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Receive" }),
|
|
869
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-
|
|
871
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
870
872
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { children: [
|
|
871
873
|
receiveAmount,
|
|
872
874
|
" ",
|
|
873
875
|
targetSymbol
|
|
874
876
|
] }),
|
|
875
|
-
targetTokenIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-
|
|
877
|
+
targetTokenIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: targetTokenIcon, alt: "" }) })
|
|
876
878
|
] })
|
|
877
879
|
] }),
|
|
878
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-
|
|
880
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
879
881
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Fees" }),
|
|
880
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-
|
|
882
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
881
883
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
882
884
|
"span",
|
|
883
885
|
{
|
|
@@ -885,7 +887,7 @@ function ConfirmStep({
|
|
|
885
887
|
children: "$0.05"
|
|
886
888
|
}
|
|
887
889
|
),
|
|
888
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
890
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.Tooltip, { content: feeTooltip, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-info", "aria-label": "Fee info", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.InfoIcon, {}) }) })
|
|
889
891
|
] })
|
|
890
892
|
] })
|
|
891
893
|
] }),
|
|
@@ -896,19 +898,19 @@ function ConfirmStep({
|
|
|
896
898
|
// post-unwrap route works. Surface as a soft warning rather
|
|
897
899
|
// than a red blocker until the orchestrator handles it.
|
|
898
900
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error rs-amount-error--warning", role: "status", children: [
|
|
899
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
901
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.AlertTriangleIcon, { style: { width: 16, height: 16, flexShrink: 0 } }),
|
|
900
902
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Low liquidity detected \u2014 deposit may take longer" })
|
|
901
903
|
] })
|
|
902
904
|
) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", role: "status", children: [
|
|
903
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
905
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.AlertTriangleIcon, { style: { width: 16, height: 16, flexShrink: 0 } }),
|
|
904
906
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: liquidityWarning.kind === "unavailable" ? "Route may be unavailable" : "Liquidity check failed" })
|
|
905
907
|
] })),
|
|
906
908
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", role: "alert", children: [
|
|
907
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
909
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.AlertTriangleIcon, { style: { width: 16, height: 16, flexShrink: 0 } }),
|
|
908
910
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: error })
|
|
909
911
|
] }),
|
|
910
912
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
911
|
-
|
|
913
|
+
_chunkDX2D2TRZcjs.Button,
|
|
912
914
|
{
|
|
913
915
|
onClick: handleConfirm,
|
|
914
916
|
loading: isSubmitting,
|
|
@@ -919,7 +921,7 @@ function ConfirmStep({
|
|
|
919
921
|
}
|
|
920
922
|
)
|
|
921
923
|
] }),
|
|
922
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
924
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.PoweredBy, {})
|
|
923
925
|
] });
|
|
924
926
|
}
|
|
925
927
|
|
|
@@ -942,9 +944,9 @@ var INITIAL_POLL_INTERVAL = 3e3;
|
|
|
942
944
|
var MAX_POLL_INTERVAL = 3e4;
|
|
943
945
|
var BACKOFF_MULTIPLIER = 1.5;
|
|
944
946
|
function isEventForTx(event, txHash) {
|
|
945
|
-
const eventTxHash =
|
|
947
|
+
const eventTxHash = _chunkDX2D2TRZcjs.getEventTxHash.call(void 0, event);
|
|
946
948
|
if (!eventTxHash) return false;
|
|
947
|
-
return
|
|
949
|
+
return _chunkDX2D2TRZcjs.txRefsMatch.call(void 0, eventTxHash, txHash);
|
|
948
950
|
}
|
|
949
951
|
function truncateHash(hash) {
|
|
950
952
|
return `${hash.slice(0, 4)}\u2026${hash.slice(-4)}`;
|
|
@@ -994,7 +996,7 @@ function formatBridgeFailedMessage(event) {
|
|
|
994
996
|
}
|
|
995
997
|
return "Bridge failed";
|
|
996
998
|
}
|
|
997
|
-
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
999
|
+
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.ExternalLinkIcon, { className: "rs-deposit-notification-link-icon" });
|
|
998
1000
|
function DepositNotification({
|
|
999
1001
|
deposit,
|
|
1000
1002
|
smartAccount,
|
|
@@ -1022,7 +1024,7 @@ function DepositNotification({
|
|
|
1022
1024
|
const pollIntervalRef = _react.useRef.call(void 0, INITIAL_POLL_INTERVAL);
|
|
1023
1025
|
const pollTimeoutRef = _react.useRef.call(void 0, null);
|
|
1024
1026
|
const completedRef = _react.useRef.call(void 0, _nullishCoalesce(directTransfer, () => ( false)));
|
|
1025
|
-
const depositContextRef =
|
|
1027
|
+
const depositContextRef = _chunkDX2D2TRZcjs.useLatestRef.call(void 0, {
|
|
1026
1028
|
amount,
|
|
1027
1029
|
sourceChain,
|
|
1028
1030
|
sourceToken: token,
|
|
@@ -1031,8 +1033,8 @@ function DepositNotification({
|
|
|
1031
1033
|
waitForFinalTx,
|
|
1032
1034
|
hasPostBridgeActions
|
|
1033
1035
|
});
|
|
1034
|
-
const onCompleteRef =
|
|
1035
|
-
const onFailedRef =
|
|
1036
|
+
const onCompleteRef = _chunkDX2D2TRZcjs.useLatestRef.call(void 0, onComplete);
|
|
1037
|
+
const onFailedRef = _chunkDX2D2TRZcjs.useLatestRef.call(void 0, onFailed);
|
|
1036
1038
|
const handleComplete = _react.useCallback.call(void 0,
|
|
1037
1039
|
(destTxHash) => {
|
|
1038
1040
|
if (completedRef.current) return;
|
|
@@ -1140,29 +1142,45 @@ function DepositNotification({
|
|
|
1140
1142
|
const destExplorerUrl = destinationTxHash ? _chunkIVTXEYB2cjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
|
|
1141
1143
|
const title = status === "complete" ? "Deposit completed" : status === "failed" ? "Deposit failed" : "Deposit received and processing\u2026";
|
|
1142
1144
|
const subtitle = status === "complete" ? "Your deposit has been credited to your account." : status === "failed" ? "Your deposit could not be processed." : "Your deposit will be credited to your account shortly.";
|
|
1143
|
-
const statusIcon = status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--complete", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1145
|
+
const statusIcon = status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--complete", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.CheckIcon, {}) }) : status === "failed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--failed", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.CloseIcon, {}) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--processing", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.Spinner, {}) });
|
|
1146
|
+
const showClose = status !== "processing";
|
|
1144
1147
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1145
1148
|
"div",
|
|
1146
1149
|
{
|
|
1147
|
-
className: `rs-deposit-notification rs-deposit-notification--${status}`,
|
|
1150
|
+
className: `rs-deposit-notification rs-deposit-notification--${status} ${expanded ? "rs-deposit-notification--expanded" : ""}`,
|
|
1148
1151
|
children: [
|
|
1149
1152
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-notification-header", children: [
|
|
1150
1153
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-icon", children: statusIcon }),
|
|
1151
1154
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-notification-content", children: [
|
|
1152
|
-
/* @__PURE__ */ _jsxruntime.
|
|
1155
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-notification-title-row", children: [
|
|
1156
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-deposit-notification-title", children: title }),
|
|
1157
|
+
showClose && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1158
|
+
"button",
|
|
1159
|
+
{
|
|
1160
|
+
type: "button",
|
|
1161
|
+
className: "rs-deposit-notification-close",
|
|
1162
|
+
onClick: () => onDismiss(deposit.id),
|
|
1163
|
+
"aria-label": "Dismiss",
|
|
1164
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.CloseIcon, {})
|
|
1165
|
+
}
|
|
1166
|
+
)
|
|
1167
|
+
] }),
|
|
1153
1168
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-subtitle", children: subtitle })
|
|
1154
|
-
] })
|
|
1155
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1156
|
-
"button",
|
|
1157
|
-
{
|
|
1158
|
-
type: "button",
|
|
1159
|
-
className: "rs-deposit-notification-close",
|
|
1160
|
-
onClick: () => onDismiss(deposit.id),
|
|
1161
|
-
"aria-label": "Dismiss",
|
|
1162
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV6NJIPSScjs.CloseIcon, {})
|
|
1163
|
-
}
|
|
1164
|
-
)
|
|
1169
|
+
] })
|
|
1165
1170
|
] }),
|
|
1171
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1172
|
+
"button",
|
|
1173
|
+
{
|
|
1174
|
+
type: "button",
|
|
1175
|
+
className: "rs-deposit-notification-toggle",
|
|
1176
|
+
onClick: () => setExpanded(!expanded),
|
|
1177
|
+
"aria-expanded": expanded,
|
|
1178
|
+
children: [
|
|
1179
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: expanded ? "See less details" : "See more details" }),
|
|
1180
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.ChevronDownIcon, { className: "rs-deposit-notification-toggle-chevron" })
|
|
1181
|
+
]
|
|
1182
|
+
}
|
|
1183
|
+
),
|
|
1166
1184
|
expanded && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-notification-details", children: [
|
|
1167
1185
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-notification-row", children: [
|
|
1168
1186
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-deposit-notification-label", children: "Deposit tx" }),
|
|
@@ -1204,16 +1222,7 @@ function DepositNotification({
|
|
|
1204
1222
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-deposit-notification-label", children: "Order filled" }),
|
|
1205
1223
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-deposit-notification-value", children: formatTimestamp(completedAt) })
|
|
1206
1224
|
] })
|
|
1207
|
-
] })
|
|
1208
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1209
|
-
"button",
|
|
1210
|
-
{
|
|
1211
|
-
type: "button",
|
|
1212
|
-
className: "rs-deposit-notification-toggle",
|
|
1213
|
-
onClick: () => setExpanded(!expanded),
|
|
1214
|
-
children: expanded ? "See less" : "See more"
|
|
1215
|
-
}
|
|
1216
|
-
)
|
|
1225
|
+
] })
|
|
1217
1226
|
]
|
|
1218
1227
|
}
|
|
1219
1228
|
);
|
|
@@ -1429,7 +1438,6 @@ function DepositAddressStep({
|
|
|
1429
1438
|
onDepositComplete,
|
|
1430
1439
|
onDepositFailed,
|
|
1431
1440
|
onCopyAddress,
|
|
1432
|
-
onRequestWalletPicker,
|
|
1433
1441
|
onError
|
|
1434
1442
|
}) {
|
|
1435
1443
|
const hasSolana = Boolean(solanaDepositAddress);
|
|
@@ -1647,10 +1655,10 @@ function DepositAddressStep({
|
|
|
1647
1655
|
return;
|
|
1648
1656
|
}
|
|
1649
1657
|
const event = status.lastEvent;
|
|
1650
|
-
const eventTxHash =
|
|
1658
|
+
const eventTxHash = _chunkDX2D2TRZcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkDX2D2TRZcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
1651
1659
|
if (baselineTxHashRef.current === void 0) {
|
|
1652
1660
|
baselineTxHashRef.current = eventTxHash;
|
|
1653
|
-
} else if (eventTxHash && (!baselineTxHashRef.current || !
|
|
1661
|
+
} else if (eventTxHash && (!baselineTxHashRef.current || !_chunkDX2D2TRZcjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
|
|
1654
1662
|
const details = getDepositEventDetails(event);
|
|
1655
1663
|
const chainId = _nullishCoalesce(details.chainId, () => ( "unknown"));
|
|
1656
1664
|
const amount = _nullishCoalesce(details.amount, () => ( "0"));
|
|
@@ -1723,7 +1731,7 @@ function DepositAddressStep({
|
|
|
1723
1731
|
const qrIconSrc = _chunkIVTXEYB2cjs.getChainIcon.call(void 0, sourceChainId);
|
|
1724
1732
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-step--with-notifications", children: [
|
|
1725
1733
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
1726
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1734
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.HandCoinsIcon, {}), title: "Transfer crypto" }),
|
|
1727
1735
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", children: [
|
|
1728
1736
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", ref: chainDropdownRef, children: [
|
|
1729
1737
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
@@ -1731,7 +1739,8 @@ function DepositAddressStep({
|
|
|
1731
1739
|
"button",
|
|
1732
1740
|
{
|
|
1733
1741
|
type: "button",
|
|
1734
|
-
className: "rs-deposit-address-dropdown-trigger"
|
|
1742
|
+
className: `rs-deposit-address-dropdown-trigger ${chainDropdownOpen ? "rs-deposit-address-dropdown-trigger--open" : ""}`,
|
|
1743
|
+
"aria-expanded": chainDropdownOpen,
|
|
1735
1744
|
onClick: () => {
|
|
1736
1745
|
setChainDropdownOpen(!chainDropdownOpen);
|
|
1737
1746
|
setTokenDropdownOpen(false);
|
|
@@ -1746,7 +1755,7 @@ function DepositAddressStep({
|
|
|
1746
1755
|
}
|
|
1747
1756
|
),
|
|
1748
1757
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunkIVTXEYB2cjs.getChainName.call(void 0, sourceChainId) }),
|
|
1749
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1758
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
1750
1759
|
]
|
|
1751
1760
|
}
|
|
1752
1761
|
),
|
|
@@ -1779,9 +1788,9 @@ function DepositAddressStep({
|
|
|
1779
1788
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Supported token" }),
|
|
1780
1789
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
1781
1790
|
"Min.$",
|
|
1782
|
-
_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _71 => _71.minDepositUsd]), () => ( 0.1)),
|
|
1783
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1784
|
-
|
|
1791
|
+
(_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _71 => _71.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
1792
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1793
|
+
_chunkDX2D2TRZcjs.InfoIcon,
|
|
1785
1794
|
{
|
|
1786
1795
|
className: "rs-deposit-address-min-icon",
|
|
1787
1796
|
"aria-hidden": "true"
|
|
@@ -1793,7 +1802,8 @@ function DepositAddressStep({
|
|
|
1793
1802
|
"button",
|
|
1794
1803
|
{
|
|
1795
1804
|
type: "button",
|
|
1796
|
-
className: "rs-deposit-address-dropdown-trigger"
|
|
1805
|
+
className: `rs-deposit-address-dropdown-trigger ${tokenDropdownOpen ? "rs-deposit-address-dropdown-trigger--open" : ""}`,
|
|
1806
|
+
"aria-expanded": tokenDropdownOpen,
|
|
1797
1807
|
onClick: () => {
|
|
1798
1808
|
setTokenDropdownOpen(!tokenDropdownOpen);
|
|
1799
1809
|
setChainDropdownOpen(false);
|
|
@@ -1808,7 +1818,7 @@ function DepositAddressStep({
|
|
|
1808
1818
|
}
|
|
1809
1819
|
),
|
|
1810
1820
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceTokenSymbol }),
|
|
1811
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1821
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
1812
1822
|
]
|
|
1813
1823
|
}
|
|
1814
1824
|
),
|
|
@@ -1850,16 +1860,16 @@ function DepositAddressStep({
|
|
|
1850
1860
|
"div",
|
|
1851
1861
|
{
|
|
1852
1862
|
style: {
|
|
1853
|
-
width:
|
|
1854
|
-
height:
|
|
1863
|
+
width: 200,
|
|
1864
|
+
height: 200,
|
|
1855
1865
|
display: "flex",
|
|
1856
1866
|
alignItems: "center",
|
|
1857
1867
|
justifyContent: "center"
|
|
1858
1868
|
},
|
|
1859
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1869
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.Spinner, {})
|
|
1860
1870
|
}
|
|
1861
1871
|
),
|
|
1862
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, QRCode, { value: displayAddress, size:
|
|
1872
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, QRCode, { value: displayAddress, size: 200, iconSrc: qrIconSrc })
|
|
1863
1873
|
}
|
|
1864
1874
|
) }),
|
|
1865
1875
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-value", children: displayAddress })
|
|
@@ -1871,7 +1881,7 @@ function DepositAddressStep({
|
|
|
1871
1881
|
className: "rs-deposit-address-copy",
|
|
1872
1882
|
onClick: handleCopy,
|
|
1873
1883
|
children: [
|
|
1874
|
-
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1884
|
+
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.CopyIcon, {}),
|
|
1875
1885
|
copied ? "Copied!" : "Copy address"
|
|
1876
1886
|
]
|
|
1877
1887
|
}
|
|
@@ -1896,16 +1906,16 @@ function DepositAddressStep({
|
|
|
1896
1906
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
|
|
1897
1907
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
|
|
1898
1908
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1899
|
-
|
|
1909
|
+
_chunkDX2D2TRZcjs.Tooltip,
|
|
1900
1910
|
{
|
|
1901
1911
|
className: "rs-price-impact-info",
|
|
1902
1912
|
content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
|
|
1903
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1913
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.InfoIcon, { "aria-hidden": "true" })
|
|
1904
1914
|
}
|
|
1905
1915
|
)
|
|
1906
1916
|
] }),
|
|
1907
1917
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1908
|
-
|
|
1918
|
+
_chunkDX2D2TRZcjs.ChevronDownIcon,
|
|
1909
1919
|
{
|
|
1910
1920
|
className: "rs-price-impact-chevron",
|
|
1911
1921
|
"aria-hidden": "true"
|
|
@@ -1916,29 +1926,29 @@ function DepositAddressStep({
|
|
|
1916
1926
|
),
|
|
1917
1927
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-price-impact-panel", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-panel-inner", children: [
|
|
1918
1928
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
1919
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1929
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.PercentIcon, {}) }),
|
|
1920
1930
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
1921
1931
|
"Max slippage: ",
|
|
1922
1932
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.2%" })
|
|
1923
1933
|
] }),
|
|
1924
1934
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1925
|
-
|
|
1935
|
+
_chunkDX2D2TRZcjs.Tooltip,
|
|
1926
1936
|
{
|
|
1927
1937
|
className: "rs-price-impact-info",
|
|
1928
1938
|
content: "Slippage accounts for price changes during execution. Slippage is adjusted per pair to ensure reliable execution.",
|
|
1929
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1939
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.InfoIcon, { "aria-hidden": "true" })
|
|
1930
1940
|
}
|
|
1931
1941
|
)
|
|
1932
1942
|
] }),
|
|
1933
1943
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
1934
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1944
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.ClockIcon, {}) }),
|
|
1935
1945
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
1936
1946
|
"Processing time: ",
|
|
1937
1947
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "< 1 min" })
|
|
1938
1948
|
] })
|
|
1939
1949
|
] }),
|
|
1940
1950
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
1941
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1951
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.PlusCircleIcon, {}) }),
|
|
1942
1952
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
1943
1953
|
"Max deposit:",
|
|
1944
1954
|
" ",
|
|
@@ -1952,16 +1962,7 @@ function DepositAddressStep({
|
|
|
1952
1962
|
]
|
|
1953
1963
|
}
|
|
1954
1964
|
),
|
|
1955
|
-
pollingError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-error", children: pollingError })
|
|
1956
|
-
onRequestWalletPicker && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1957
|
-
"button",
|
|
1958
|
-
{
|
|
1959
|
-
type: "button",
|
|
1960
|
-
className: "rs-connect-wallet-manage",
|
|
1961
|
-
onClick: onRequestWalletPicker,
|
|
1962
|
-
children: "Use a wallet to deposit instead"
|
|
1963
|
-
}
|
|
1964
|
-
)
|
|
1965
|
+
pollingError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-error", children: pollingError })
|
|
1965
1966
|
] }),
|
|
1966
1967
|
notifications.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notifications", children: notifications.map((deposit) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1967
1968
|
DepositNotification,
|
|
@@ -1980,7 +1981,7 @@ function DepositAddressStep({
|
|
|
1980
1981
|
},
|
|
1981
1982
|
deposit.id
|
|
1982
1983
|
)) }),
|
|
1983
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1984
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.PoweredBy, {})
|
|
1984
1985
|
] });
|
|
1985
1986
|
}
|
|
1986
1987
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -2011,7 +2012,7 @@ function SolanaTokenSelectStep({
|
|
|
2011
2012
|
setError(null);
|
|
2012
2013
|
const portfolioBySymbol = {};
|
|
2013
2014
|
try {
|
|
2014
|
-
|
|
2015
|
+
_chunkDX2D2TRZcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
|
|
2015
2016
|
solanaAddress
|
|
2016
2017
|
});
|
|
2017
2018
|
const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
|
|
@@ -2034,12 +2035,12 @@ function SolanaTokenSelectStep({
|
|
|
2034
2035
|
};
|
|
2035
2036
|
}
|
|
2036
2037
|
}
|
|
2037
|
-
|
|
2038
|
+
_chunkDX2D2TRZcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
|
|
2038
2039
|
symbols: Object.keys(portfolioBySymbol)
|
|
2039
2040
|
});
|
|
2040
2041
|
} catch (err) {
|
|
2041
2042
|
if (!active) return;
|
|
2042
|
-
|
|
2043
|
+
_chunkDX2D2TRZcjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
|
|
2043
2044
|
solanaAddress
|
|
2044
2045
|
});
|
|
2045
2046
|
setError(
|
|
@@ -2086,9 +2087,9 @@ function SolanaTokenSelectStep({
|
|
|
2086
2087
|
}
|
|
2087
2088
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
2088
2089
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: { padding: "0 12px 12px" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2089
|
-
|
|
2090
|
+
_chunkDX2D2TRZcjs.BodyHeader,
|
|
2090
2091
|
{
|
|
2091
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2092
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.CoinsIcon, {}),
|
|
2092
2093
|
title: "Select asset",
|
|
2093
2094
|
subtitle: "Pick a Solana token to deposit"
|
|
2094
2095
|
}
|
|
@@ -2100,11 +2101,11 @@ function SolanaTokenSelectStep({
|
|
|
2100
2101
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
2101
2102
|
children: [
|
|
2102
2103
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
2103
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2104
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
2104
2105
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
2105
2106
|
] }),
|
|
2106
2107
|
!loading && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
2107
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2108
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
2108
2109
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
2109
2110
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
2110
2111
|
solanaAddress.slice(0, 6),
|
|
@@ -2120,7 +2121,7 @@ function SolanaTokenSelectStep({
|
|
|
2120
2121
|
try {
|
|
2121
2122
|
const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
|
|
2122
2123
|
const numeric = Number(raw);
|
|
2123
|
-
formattedBalance = Number.isFinite(numeric) ?
|
|
2124
|
+
formattedBalance = Number.isFinite(numeric) ? _chunkDX2D2TRZcjs.tokenFormatter.format(numeric) : raw;
|
|
2124
2125
|
} catch (e16) {
|
|
2125
2126
|
formattedBalance = "...";
|
|
2126
2127
|
}
|
|
@@ -2164,7 +2165,7 @@ function SolanaTokenSelectStep({
|
|
|
2164
2165
|
] })
|
|
2165
2166
|
] })
|
|
2166
2167
|
] }),
|
|
2167
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ?
|
|
2168
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunkDX2D2TRZcjs.currencyFormatter.format(entry.balanceUsd) : `${formattedBalance} ${entry.token.symbol}` })
|
|
2168
2169
|
]
|
|
2169
2170
|
},
|
|
2170
2171
|
entry.token.symbol
|
|
@@ -2174,7 +2175,7 @@ function SolanaTokenSelectStep({
|
|
|
2174
2175
|
}
|
|
2175
2176
|
),
|
|
2176
2177
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2177
|
-
|
|
2178
|
+
_chunkDX2D2TRZcjs.Button,
|
|
2178
2179
|
{
|
|
2179
2180
|
onClick: () => selectedEntry && onContinue(
|
|
2180
2181
|
selectedEntry.token,
|
|
@@ -2186,7 +2187,7 @@ function SolanaTokenSelectStep({
|
|
|
2186
2187
|
children: "Continue"
|
|
2187
2188
|
}
|
|
2188
2189
|
) }),
|
|
2189
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2190
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.PoweredBy, {})
|
|
2190
2191
|
] });
|
|
2191
2192
|
}
|
|
2192
2193
|
|
|
@@ -2244,7 +2245,7 @@ function SolanaAmountStep({
|
|
|
2244
2245
|
const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
|
|
2245
2246
|
const numeric = Number(raw);
|
|
2246
2247
|
if (!Number.isFinite(numeric)) return raw;
|
|
2247
|
-
return
|
|
2248
|
+
return _chunkDX2D2TRZcjs.tokenFormatter.format(numeric);
|
|
2248
2249
|
} catch (e18) {
|
|
2249
2250
|
return "\u2026";
|
|
2250
2251
|
}
|
|
@@ -2303,7 +2304,7 @@ function SolanaAmountStep({
|
|
|
2303
2304
|
const factor = 1e3;
|
|
2304
2305
|
const truncated = Math.floor(value * factor) / factor;
|
|
2305
2306
|
const formatted = truncated.toFixed(3).replace(/\.?0+$/, "");
|
|
2306
|
-
|
|
2307
|
+
_chunkDX2D2TRZcjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
|
|
2307
2308
|
percentage,
|
|
2308
2309
|
symbol: token.symbol,
|
|
2309
2310
|
formatted
|
|
@@ -2341,7 +2342,7 @@ function SolanaAmountStep({
|
|
|
2341
2342
|
try {
|
|
2342
2343
|
amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
|
|
2343
2344
|
} catch (e23) {
|
|
2344
|
-
|
|
2345
|
+
_chunkDX2D2TRZcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2345
2346
|
amount,
|
|
2346
2347
|
sourceAmount: sourceAmountStr,
|
|
2347
2348
|
reason: "parse-units-failed"
|
|
@@ -2356,7 +2357,7 @@ function SolanaAmountStep({
|
|
|
2356
2357
|
);
|
|
2357
2358
|
return;
|
|
2358
2359
|
}
|
|
2359
|
-
|
|
2360
|
+
_chunkDX2D2TRZcjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
|
|
2360
2361
|
symbol: token.symbol,
|
|
2361
2362
|
inputAmountUsd: amount,
|
|
2362
2363
|
sourceAmount: sourceAmountStr,
|
|
@@ -2370,7 +2371,7 @@ function SolanaAmountStep({
|
|
|
2370
2371
|
const sourceTokenIcon = _chunkIVTXEYB2cjs.getTokenIcon.call(void 0, token.symbol);
|
|
2371
2372
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
2372
2373
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2373
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2374
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.WalletIcon, {}), title: "Wallet deposit" }),
|
|
2374
2375
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
2375
2376
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
2376
2377
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-input-row", children: [
|
|
@@ -2396,13 +2397,13 @@ function SolanaAmountStep({
|
|
|
2396
2397
|
" available",
|
|
2397
2398
|
computedBalanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2398
2399
|
" (~",
|
|
2399
|
-
|
|
2400
|
+
_chunkDX2D2TRZcjs.currencyFormatter.format(computedBalanceUsd),
|
|
2400
2401
|
")"
|
|
2401
2402
|
] })
|
|
2402
2403
|
] }),
|
|
2403
2404
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
2404
2405
|
"Min. deposit ",
|
|
2405
|
-
|
|
2406
|
+
_chunkDX2D2TRZcjs.currencyFormatter.format(minDepositUsd)
|
|
2406
2407
|
] })
|
|
2407
2408
|
] })
|
|
2408
2409
|
] }),
|
|
@@ -2441,15 +2442,15 @@ function SolanaAmountStep({
|
|
|
2441
2442
|
] }),
|
|
2442
2443
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
2443
2444
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
2444
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
2445
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkDX2D2TRZcjs.currencyFormatter.format(balanceAfterUsd) })
|
|
2445
2446
|
] })
|
|
2446
2447
|
] }),
|
|
2447
2448
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", role: "alert", children: [
|
|
2448
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2449
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.AlertTriangleIcon, { style: { width: 16, height: 16, flexShrink: 0 } }),
|
|
2449
2450
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: error })
|
|
2450
2451
|
] }),
|
|
2451
2452
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2452
|
-
|
|
2453
|
+
_chunkDX2D2TRZcjs.Button,
|
|
2453
2454
|
{
|
|
2454
2455
|
onClick: handleContinue,
|
|
2455
2456
|
fullWidth: true,
|
|
@@ -2458,7 +2459,7 @@ function SolanaAmountStep({
|
|
|
2458
2459
|
}
|
|
2459
2460
|
)
|
|
2460
2461
|
] }),
|
|
2461
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2462
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.PoweredBy, {})
|
|
2462
2463
|
] });
|
|
2463
2464
|
}
|
|
2464
2465
|
|
|
@@ -2502,7 +2503,7 @@ function SolanaConfirmStep({
|
|
|
2502
2503
|
const receiveAmount = isSameToken ? formattedReceiveAmount : `~ ${formattedReceiveAmount}`;
|
|
2503
2504
|
const handleConfirm = async () => {
|
|
2504
2505
|
if (!solanaProvider) {
|
|
2505
|
-
|
|
2506
|
+
_chunkDX2D2TRZcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
2506
2507
|
reason: "missing-provider"
|
|
2507
2508
|
});
|
|
2508
2509
|
setError("Solana wallet not connected");
|
|
@@ -2510,7 +2511,7 @@ function SolanaConfirmStep({
|
|
|
2510
2511
|
}
|
|
2511
2512
|
const parsedAmount = parseFloat(sourceAmount);
|
|
2512
2513
|
if (isNaN(parsedAmount) || parsedAmount <= 0) {
|
|
2513
|
-
|
|
2514
|
+
_chunkDX2D2TRZcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
2514
2515
|
reason: "invalid-amount",
|
|
2515
2516
|
sourceAmount
|
|
2516
2517
|
});
|
|
@@ -2519,7 +2520,7 @@ function SolanaConfirmStep({
|
|
|
2519
2520
|
}
|
|
2520
2521
|
setError(null);
|
|
2521
2522
|
setIsSubmitting(true);
|
|
2522
|
-
|
|
2523
|
+
_chunkDX2D2TRZcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
|
|
2523
2524
|
smartAccount,
|
|
2524
2525
|
solanaAddress,
|
|
2525
2526
|
solanaDepositAddress,
|
|
@@ -2529,7 +2530,7 @@ function SolanaConfirmStep({
|
|
|
2529
2530
|
});
|
|
2530
2531
|
try {
|
|
2531
2532
|
const check = await service.checkAccount(smartAccount);
|
|
2532
|
-
|
|
2533
|
+
_chunkDX2D2TRZcjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
|
|
2533
2534
|
smartAccount,
|
|
2534
2535
|
isRegistered: check.isRegistered,
|
|
2535
2536
|
targetChain: check.targetChain,
|
|
@@ -2542,7 +2543,7 @@ function SolanaConfirmStep({
|
|
|
2542
2543
|
}
|
|
2543
2544
|
const connection = getSolanaConnection();
|
|
2544
2545
|
const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
|
|
2545
|
-
|
|
2546
|
+
_chunkDX2D2TRZcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
|
|
2546
2547
|
token: token.symbol,
|
|
2547
2548
|
sourceAmount,
|
|
2548
2549
|
amountUnits: amountUnits.toString()
|
|
@@ -2559,7 +2560,7 @@ function SolanaConfirmStep({
|
|
|
2559
2560
|
token.mint,
|
|
2560
2561
|
amountUnits
|
|
2561
2562
|
);
|
|
2562
|
-
|
|
2563
|
+
_chunkDX2D2TRZcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
2563
2564
|
token: token.symbol,
|
|
2564
2565
|
instructionCount: transaction.instructions.length,
|
|
2565
2566
|
feePayer: _optionalChain([transaction, 'access', _75 => _75.feePayer, 'optionalAccess', _76 => _76.toBase58, 'call', _77 => _77()]),
|
|
@@ -2570,15 +2571,15 @@ function SolanaConfirmStep({
|
|
|
2570
2571
|
connection,
|
|
2571
2572
|
transaction
|
|
2572
2573
|
);
|
|
2573
|
-
|
|
2574
|
+
_chunkDX2D2TRZcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
|
|
2574
2575
|
txHash,
|
|
2575
2576
|
amountUnits: amountUnits.toString()
|
|
2576
2577
|
});
|
|
2577
2578
|
onConfirm(txHash, amountUnits.toString());
|
|
2578
2579
|
} catch (err) {
|
|
2579
2580
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
2580
|
-
const message =
|
|
2581
|
-
|
|
2581
|
+
const message = _chunkDX2D2TRZcjs.formatUserError.call(void 0, raw);
|
|
2582
|
+
_chunkDX2D2TRZcjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
|
|
2582
2583
|
smartAccount,
|
|
2583
2584
|
token: token.symbol,
|
|
2584
2585
|
sourceAmount
|
|
@@ -2590,7 +2591,7 @@ function SolanaConfirmStep({
|
|
|
2590
2591
|
}
|
|
2591
2592
|
};
|
|
2592
2593
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
2593
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: { padding: "0 12px 12px" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2594
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: { padding: "0 12px 12px" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.WalletIcon, {}), title: "Review deposit" }) }),
|
|
2594
2595
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step-body rs-space-y-3", style: { paddingTop: 0 }, children: [
|
|
2595
2596
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-card", children: [
|
|
2596
2597
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-card-row", children: [
|
|
@@ -2689,12 +2690,12 @@ function SolanaConfirmStep({
|
|
|
2689
2690
|
] })
|
|
2690
2691
|
] }),
|
|
2691
2692
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-alert rs-alert--error", children: [
|
|
2692
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2693
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.AlertTriangleIcon, { className: "rs-alert-icon" }),
|
|
2693
2694
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-alert-text", children: error })
|
|
2694
2695
|
] })
|
|
2695
2696
|
] }),
|
|
2696
2697
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2697
|
-
|
|
2698
|
+
_chunkDX2D2TRZcjs.Button,
|
|
2698
2699
|
{
|
|
2699
2700
|
onClick: handleConfirm,
|
|
2700
2701
|
loading: isSubmitting,
|
|
@@ -2703,7 +2704,7 @@ function SolanaConfirmStep({
|
|
|
2703
2704
|
children: "Continue"
|
|
2704
2705
|
}
|
|
2705
2706
|
) }),
|
|
2706
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2707
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.PoweredBy, {})
|
|
2707
2708
|
] });
|
|
2708
2709
|
}
|
|
2709
2710
|
|
|
@@ -2717,24 +2718,24 @@ function DappImportAssetSelectStep({
|
|
|
2717
2718
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
2718
2719
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2719
2720
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2720
|
-
|
|
2721
|
+
_chunkDX2D2TRZcjs.BodyHeader,
|
|
2721
2722
|
{
|
|
2722
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2723
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.HandCoinsIcon, {}),
|
|
2723
2724
|
title: `Transfer from ${sourceLabel}`,
|
|
2724
2725
|
subtitle: "Pick the balance to import"
|
|
2725
2726
|
}
|
|
2726
2727
|
),
|
|
2727
2728
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-list", children: assets.map((asset) => {
|
|
2728
|
-
const balanceTokens = asset.balance ?
|
|
2729
|
+
const balanceTokens = asset.balance ? _chunkDX2D2TRZcjs.tokenFormatter.format(
|
|
2729
2730
|
Number(asset.balance) / 10 ** asset.decimals
|
|
2730
2731
|
) : "0";
|
|
2731
|
-
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ?
|
|
2732
|
+
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ? _chunkDX2D2TRZcjs.currencyFormatter.format(asset.balanceUsd) : `${balanceTokens} ${asset.symbol}`;
|
|
2732
2733
|
const iconSrc = _chunkIVTXEYB2cjs.getTokenIcon.call(void 0, asset.symbol);
|
|
2733
2734
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2734
|
-
|
|
2735
|
+
_chunkDX2D2TRZcjs.ListRow,
|
|
2735
2736
|
{
|
|
2736
2737
|
leadingMedia: iconSrc || void 0,
|
|
2737
|
-
leading: iconSrc ? void 0 : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2738
|
+
leading: iconSrc ? void 0 : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.HandCoinsIcon, {}),
|
|
2738
2739
|
title: asset.symbol,
|
|
2739
2740
|
subtitle: `${balanceTokens} on ${_chunkIVTXEYB2cjs.getChainName.call(void 0, asset.chainId)}`,
|
|
2740
2741
|
meta: balanceUsd,
|
|
@@ -2744,7 +2745,7 @@ function DappImportAssetSelectStep({
|
|
|
2744
2745
|
);
|
|
2745
2746
|
}) })
|
|
2746
2747
|
] }),
|
|
2747
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2748
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.PoweredBy, {})
|
|
2748
2749
|
] });
|
|
2749
2750
|
}
|
|
2750
2751
|
DappImportAssetSelectStep.displayName = "DappImportAssetSelectStep";
|
|
@@ -2855,7 +2856,7 @@ async function executePolymarketSafeTransfer(params) {
|
|
|
2855
2856
|
}
|
|
2856
2857
|
const isOwner = await publicClient.readContract({
|
|
2857
2858
|
address: safeAddress,
|
|
2858
|
-
abi:
|
|
2859
|
+
abi: _chunkDX2D2TRZcjs.SAFE_ABI,
|
|
2859
2860
|
functionName: "isOwner",
|
|
2860
2861
|
args: [account.address]
|
|
2861
2862
|
});
|
|
@@ -2872,7 +2873,7 @@ async function executePolymarketSafeTransfer(params) {
|
|
|
2872
2873
|
account,
|
|
2873
2874
|
chain,
|
|
2874
2875
|
address: safeAddress,
|
|
2875
|
-
abi:
|
|
2876
|
+
abi: _chunkDX2D2TRZcjs.SAFE_ABI,
|
|
2876
2877
|
functionName: "execTransaction",
|
|
2877
2878
|
args: [
|
|
2878
2879
|
safeTx.to,
|
|
@@ -2891,7 +2892,7 @@ async function executePolymarketSafeTransfer(params) {
|
|
|
2891
2892
|
hash: txHash
|
|
2892
2893
|
});
|
|
2893
2894
|
const parsed = _viem.parseEventLogs.call(void 0, {
|
|
2894
|
-
abi:
|
|
2895
|
+
abi: _chunkDX2D2TRZcjs.SAFE_ABI,
|
|
2895
2896
|
logs: receipt.logs.filter(
|
|
2896
2897
|
(log) => log.address.toLowerCase() === safeAddress.toLowerCase()
|
|
2897
2898
|
),
|
|
@@ -3661,15 +3662,15 @@ var SetupError = class extends Error {
|
|
|
3661
3662
|
}
|
|
3662
3663
|
};
|
|
3663
3664
|
async function resolveSessionOwner(eoaAddress) {
|
|
3664
|
-
const local =
|
|
3665
|
+
const local = _chunkDX2D2TRZcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
3665
3666
|
if (local) {
|
|
3666
3667
|
return {
|
|
3667
|
-
account:
|
|
3668
|
+
account: _chunkDX2D2TRZcjs.accountFromPrivateKey.call(void 0, local.privateKey),
|
|
3668
3669
|
address: local.address
|
|
3669
3670
|
};
|
|
3670
3671
|
}
|
|
3671
|
-
const created =
|
|
3672
|
-
|
|
3672
|
+
const created = _chunkDX2D2TRZcjs.createSessionOwnerKey.call(void 0, );
|
|
3673
|
+
_chunkDX2D2TRZcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
3673
3674
|
return { account: created.account, address: created.address };
|
|
3674
3675
|
}
|
|
3675
3676
|
function stableStringify(value) {
|
|
@@ -3717,22 +3718,32 @@ function computeCacheKey(input, sessionOwnerAddress) {
|
|
|
3717
3718
|
function computeIsCacheable(input) {
|
|
3718
3719
|
return !input.forceRegister && !(_nullishCoalesce(_optionalChain([input, 'access', _91 => _91.postBridgeActions, 'optionalAccess', _92 => _92.length]), () => ( 0)));
|
|
3719
3720
|
}
|
|
3721
|
+
var SETUP_REQUEST_DEDUPE_TTL_MS = 3e4;
|
|
3722
|
+
var setupRequestDedupe = /* @__PURE__ */ new Map();
|
|
3723
|
+
function readDedupedAccountSetupResult(requestKey) {
|
|
3724
|
+
const now = Date.now();
|
|
3725
|
+
const existing = setupRequestDedupe.get(requestKey);
|
|
3726
|
+
if (_optionalChain([existing, 'optionalAccess', _93 => _93.settled]) && existing.expiresAt > now && existing.result) {
|
|
3727
|
+
return existing.result;
|
|
3728
|
+
}
|
|
3729
|
+
return null;
|
|
3730
|
+
}
|
|
3720
3731
|
async function runAccountSetup(input, deps) {
|
|
3721
3732
|
const { service, debug } = deps;
|
|
3722
3733
|
const enableSolana = _nullishCoalesce(input.enableSolana, () => ( true));
|
|
3723
3734
|
try {
|
|
3724
3735
|
const sessionOwner = await resolveSessionOwner(input.ownerAddress);
|
|
3725
3736
|
const cacheKey = computeCacheKey(input, sessionOwner.address);
|
|
3726
|
-
|
|
3737
|
+
_chunkDX2D2TRZcjs.debugLog.call(void 0, debug, "account-setup", "setup:start", {
|
|
3727
3738
|
owner: input.ownerAddress,
|
|
3728
3739
|
sessionOwner: sessionOwner.address,
|
|
3729
|
-
hasPostBridgeActions: Boolean(_optionalChain([input, 'access',
|
|
3740
|
+
hasPostBridgeActions: Boolean(_optionalChain([input, 'access', _94 => _94.postBridgeActions, 'optionalAccess', _95 => _95.length])),
|
|
3730
3741
|
forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
|
|
3731
3742
|
});
|
|
3732
3743
|
const setup = await service.setupAccount({
|
|
3733
3744
|
ownerAddress: input.ownerAddress,
|
|
3734
3745
|
sessionOwnerAddress: sessionOwner.address,
|
|
3735
|
-
targetChain:
|
|
3746
|
+
targetChain: _chunkDX2D2TRZcjs.toEvmCaip2.call(void 0, input.targetChain),
|
|
3736
3747
|
targetToken: input.targetToken,
|
|
3737
3748
|
recipient: input.recipient,
|
|
3738
3749
|
postBridgeActions: input.postBridgeActions,
|
|
@@ -3771,7 +3782,7 @@ async function runAccountSetup(input, deps) {
|
|
|
3771
3782
|
primaryType: typedData.primaryType,
|
|
3772
3783
|
message: typedData.message
|
|
3773
3784
|
});
|
|
3774
|
-
const sessionDetails =
|
|
3785
|
+
const sessionDetails = _chunkDX2D2TRZcjs.buildSessionDetails.call(void 0,
|
|
3775
3786
|
setup.sessionDetailsUnsigned,
|
|
3776
3787
|
signature
|
|
3777
3788
|
);
|
|
@@ -3785,13 +3796,13 @@ async function runAccountSetup(input, deps) {
|
|
|
3785
3796
|
eoaAddress: input.ownerAddress,
|
|
3786
3797
|
sessionOwner: sessionOwner.address,
|
|
3787
3798
|
target: {
|
|
3788
|
-
chain:
|
|
3799
|
+
chain: _chunkDX2D2TRZcjs.toEvmCaip2.call(void 0, input.targetChain),
|
|
3789
3800
|
token: input.targetToken,
|
|
3790
3801
|
...input.recipient && { recipient: input.recipient },
|
|
3791
|
-
..._optionalChain([input, 'access',
|
|
3802
|
+
..._optionalChain([input, 'access', _96 => _96.postBridgeActions, 'optionalAccess', _97 => _97.length]) && {
|
|
3792
3803
|
postBridgeActions: input.postBridgeActions
|
|
3793
3804
|
},
|
|
3794
|
-
..._optionalChain([input, 'access',
|
|
3805
|
+
..._optionalChain([input, 'access', _98 => _98.outputTokenRules, 'optionalAccess', _99 => _99.length]) && {
|
|
3795
3806
|
outputTokenRules: input.outputTokenRules
|
|
3796
3807
|
},
|
|
3797
3808
|
...input.rejectUnmapped != null && {
|
|
@@ -3807,13 +3818,49 @@ async function runAccountSetup(input, deps) {
|
|
|
3807
3818
|
isRegistered: true
|
|
3808
3819
|
};
|
|
3809
3820
|
} catch (error) {
|
|
3810
|
-
|
|
3821
|
+
_chunkDX2D2TRZcjs.debugError.call(void 0, debug, "account-setup", "setup:failed", error, {
|
|
3811
3822
|
owner: input.ownerAddress
|
|
3812
3823
|
});
|
|
3813
3824
|
if (error instanceof SetupError) throw error;
|
|
3814
3825
|
throw mapError(error);
|
|
3815
3826
|
}
|
|
3816
3827
|
}
|
|
3828
|
+
function runAccountSetupDeduped(input, deps, requestKey) {
|
|
3829
|
+
const now = Date.now();
|
|
3830
|
+
const existing = setupRequestDedupe.get(requestKey);
|
|
3831
|
+
if (existing && (!existing.settled || existing.expiresAt > now)) {
|
|
3832
|
+
_chunkDX2D2TRZcjs.debugLog.call(void 0, deps.debug, "account-setup", "setup:dedupe-hit", {
|
|
3833
|
+
owner: input.ownerAddress,
|
|
3834
|
+
forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
|
|
3835
|
+
});
|
|
3836
|
+
return existing.promise;
|
|
3837
|
+
}
|
|
3838
|
+
const entry = {
|
|
3839
|
+
promise: runAccountSetup(input, deps),
|
|
3840
|
+
settled: false,
|
|
3841
|
+
expiresAt: Number.POSITIVE_INFINITY,
|
|
3842
|
+
result: null
|
|
3843
|
+
};
|
|
3844
|
+
setupRequestDedupe.set(requestKey, entry);
|
|
3845
|
+
entry.promise.then((result) => {
|
|
3846
|
+
entry.settled = true;
|
|
3847
|
+
entry.result = result;
|
|
3848
|
+
entry.expiresAt = Date.now() + SETUP_REQUEST_DEDUPE_TTL_MS;
|
|
3849
|
+
const cleanupTimer = setTimeout(() => {
|
|
3850
|
+
if (setupRequestDedupe.get(requestKey) === entry) {
|
|
3851
|
+
setupRequestDedupe.delete(requestKey);
|
|
3852
|
+
}
|
|
3853
|
+
}, SETUP_REQUEST_DEDUPE_TTL_MS);
|
|
3854
|
+
if (typeof cleanupTimer === "object" && cleanupTimer && "unref" in cleanupTimer && typeof cleanupTimer.unref === "function") {
|
|
3855
|
+
cleanupTimer.unref();
|
|
3856
|
+
}
|
|
3857
|
+
}).catch(() => {
|
|
3858
|
+
if (setupRequestDedupe.get(requestKey) === entry) {
|
|
3859
|
+
setupRequestDedupe.delete(requestKey);
|
|
3860
|
+
}
|
|
3861
|
+
});
|
|
3862
|
+
return entry.promise;
|
|
3863
|
+
}
|
|
3817
3864
|
function mapError(error) {
|
|
3818
3865
|
if (error instanceof TypeError) {
|
|
3819
3866
|
return new SetupError(
|
|
@@ -3866,15 +3913,6 @@ function AccountPreparingSkeleton({
|
|
|
3866
3913
|
) })
|
|
3867
3914
|
] });
|
|
3868
3915
|
}
|
|
3869
|
-
function SetupUpdatingBanner({
|
|
3870
|
-
status,
|
|
3871
|
-
message
|
|
3872
|
-
}) {
|
|
3873
|
-
if (status === "error") {
|
|
3874
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-error", role: "alert", children: _nullishCoalesce(message, () => ( "Couldn't update deposit details \u2014 please retry.")) });
|
|
3875
|
-
}
|
|
3876
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-state", style: { padding: "8px 16px" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-text", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-subtitle", children: "Updating deposit details\u2026" }) }) });
|
|
3877
|
-
}
|
|
3878
3916
|
var QR_AUTO_ADVANCE_HYDRATION_GRACE_MS = 1e3;
|
|
3879
3917
|
function isSameRoute2(sourceChain, sourceToken, targetChain, targetToken) {
|
|
3880
3918
|
return sourceChain === targetChain && sourceToken.toLowerCase() === targetToken.toLowerCase();
|
|
@@ -4026,12 +4064,12 @@ function DepositFlow({
|
|
|
4026
4064
|
onError,
|
|
4027
4065
|
debug
|
|
4028
4066
|
}) {
|
|
4029
|
-
const onStepChangeRef =
|
|
4030
|
-
const onEventRef =
|
|
4031
|
-
const onLifecycleRef =
|
|
4032
|
-
const onErrorRef =
|
|
4067
|
+
const onStepChangeRef = _chunkDX2D2TRZcjs.useLatestRef.call(void 0, onStepChange);
|
|
4068
|
+
const onEventRef = _chunkDX2D2TRZcjs.useLatestRef.call(void 0, onEvent);
|
|
4069
|
+
const onLifecycleRef = _chunkDX2D2TRZcjs.useLatestRef.call(void 0, onLifecycle);
|
|
4070
|
+
const onErrorRef = _chunkDX2D2TRZcjs.useLatestRef.call(void 0, onError);
|
|
4033
4071
|
const hasInitialReownSession = Boolean(
|
|
4034
|
-
enableSolana ? _optionalChain([reownWallet, 'optionalAccess',
|
|
4072
|
+
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _100 => _100.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _101 => _101.address]) : _optionalChain([reownWallet, 'optionalAccess', _102 => _102.address])
|
|
4035
4073
|
);
|
|
4036
4074
|
const hasInitialWalletHydrationPending = Boolean(
|
|
4037
4075
|
dappAddress && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasInitialReownSession && !reownWallet.isReady)
|
|
@@ -4046,19 +4084,22 @@ function DepositFlow({
|
|
|
4046
4084
|
const hasNavigatedBack = flowSlice.hasNavigatedBack;
|
|
4047
4085
|
const selectedWalletId = useDepositStore(selectedWalletIdSelector);
|
|
4048
4086
|
const [totalBalanceUsd, setTotalBalanceUsd] = _react.useState.call(void 0, 0);
|
|
4087
|
+
const [targetBalanceUsd, setTargetBalanceUsd] = _react.useState.call(void 0,
|
|
4088
|
+
void 0
|
|
4089
|
+
);
|
|
4049
4090
|
const [hasQrAutoAdvanceGraceElapsed, setHasQrAutoAdvanceGraceElapsed] = _react.useState.call(void 0, () => !hasInitialWalletHydrationPending);
|
|
4050
4091
|
const portfolioAssetsRef = _react.useRef.call(void 0, []);
|
|
4051
4092
|
const stableWalletSignerRef = _react.useRef.call(void 0, null);
|
|
4052
4093
|
const stableWalletSelectionKeyRef = _react.useRef.call(void 0, null);
|
|
4053
4094
|
const logFlow = _react.useCallback.call(void 0,
|
|
4054
4095
|
(message, data) => {
|
|
4055
|
-
|
|
4096
|
+
_chunkDX2D2TRZcjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
|
|
4056
4097
|
},
|
|
4057
4098
|
[debug]
|
|
4058
4099
|
);
|
|
4059
4100
|
const logFlowError = _react.useCallback.call(void 0,
|
|
4060
4101
|
(message, error, data) => {
|
|
4061
|
-
|
|
4102
|
+
_chunkDX2D2TRZcjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
|
|
4062
4103
|
},
|
|
4063
4104
|
[debug]
|
|
4064
4105
|
);
|
|
@@ -4081,12 +4122,12 @@ function DepositFlow({
|
|
|
4081
4122
|
return null;
|
|
4082
4123
|
}, []);
|
|
4083
4124
|
const dappSwitchChain = _react.useMemo.call(void 0, () => {
|
|
4084
|
-
if (!_optionalChain([dappWalletClient, 'optionalAccess',
|
|
4125
|
+
if (!_optionalChain([dappWalletClient, 'optionalAccess', _103 => _103.switchChain])) return void 0;
|
|
4085
4126
|
return async (chainId) => {
|
|
4086
|
-
await _optionalChain([dappWalletClient, 'access',
|
|
4127
|
+
await _optionalChain([dappWalletClient, 'access', _104 => _104.switchChain, 'optionalCall', _105 => _105({ id: chainId })]);
|
|
4087
4128
|
};
|
|
4088
4129
|
}, [dappWalletClient]);
|
|
4089
|
-
const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
4130
|
+
const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _106 => _106.account, 'optionalAccess', _107 => _107.address]), () => ( null));
|
|
4090
4131
|
const walletOptions = _react.useMemo.call(void 0, () => {
|
|
4091
4132
|
const options = [];
|
|
4092
4133
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -4100,7 +4141,7 @@ function DepositFlow({
|
|
|
4100
4141
|
});
|
|
4101
4142
|
seen.add(id);
|
|
4102
4143
|
}
|
|
4103
|
-
if (enableSolana && _optionalChain([reownWallet, 'optionalAccess',
|
|
4144
|
+
if (enableSolana && _optionalChain([reownWallet, 'optionalAccess', _108 => _108.isConnected]) && reownWallet.isSolana && reownWallet.solanaAddress && dappAddress) {
|
|
4104
4145
|
const id = _nullishCoalesce(reownWallet.caipAddress, () => ( `solana:${reownWallet.solanaAddress}`));
|
|
4105
4146
|
if (!seen.has(id)) {
|
|
4106
4147
|
options.push({
|
|
@@ -4112,7 +4153,7 @@ function DepositFlow({
|
|
|
4112
4153
|
});
|
|
4113
4154
|
seen.add(id);
|
|
4114
4155
|
}
|
|
4115
|
-
} else if (_optionalChain([reownWallet, 'optionalAccess',
|
|
4156
|
+
} else if (_optionalChain([reownWallet, 'optionalAccess', _109 => _109.address]) && reownWallet.isConnected && reownWallet.walletClient && reownWallet.publicClient && !seen.has(`evm:${reownWallet.address.toLowerCase()}`)) {
|
|
4116
4157
|
const id = `evm:${reownWallet.address.toLowerCase()}`;
|
|
4117
4158
|
if (!seen.has(id)) {
|
|
4118
4159
|
options.push({
|
|
@@ -4129,20 +4170,20 @@ function DepositFlow({
|
|
|
4129
4170
|
}, [
|
|
4130
4171
|
connectedWalletAddress,
|
|
4131
4172
|
dappAddress,
|
|
4132
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4133
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4134
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4135
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4136
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4173
|
+
_optionalChain([reownWallet, 'optionalAccess', _110 => _110.address]),
|
|
4174
|
+
_optionalChain([reownWallet, 'optionalAccess', _111 => _111.isConnected]),
|
|
4175
|
+
_optionalChain([reownWallet, 'optionalAccess', _112 => _112.walletClient]),
|
|
4176
|
+
_optionalChain([reownWallet, 'optionalAccess', _113 => _113.publicClient]),
|
|
4177
|
+
_optionalChain([reownWallet, 'optionalAccess', _114 => _114.icon]),
|
|
4137
4178
|
enableSolana,
|
|
4138
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4139
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4140
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4179
|
+
_optionalChain([reownWallet, 'optionalAccess', _115 => _115.isSolana]),
|
|
4180
|
+
_optionalChain([reownWallet, 'optionalAccess', _116 => _116.solanaAddress]),
|
|
4181
|
+
_optionalChain([reownWallet, 'optionalAccess', _117 => _117.caipAddress])
|
|
4141
4182
|
]);
|
|
4142
|
-
const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess',
|
|
4183
|
+
const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess', _118 => _118.account]) && dappAddress && !reownWallet;
|
|
4143
4184
|
const hasWalletOptions = walletOptions.length > 0;
|
|
4144
4185
|
const hasReownSession = Boolean(
|
|
4145
|
-
enableSolana ? _optionalChain([reownWallet, 'optionalAccess',
|
|
4186
|
+
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _119 => _119.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _120 => _120.address]) : _optionalChain([reownWallet, 'optionalAccess', _121 => _121.address])
|
|
4146
4187
|
);
|
|
4147
4188
|
const isWalletHydrationPending = Boolean(
|
|
4148
4189
|
dappAddress && !hasWalletOptions && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasReownSession && !reownWallet.isReady)
|
|
@@ -4182,16 +4223,16 @@ function DepositFlow({
|
|
|
4182
4223
|
return {
|
|
4183
4224
|
ownerAddress: dappAddress,
|
|
4184
4225
|
walletClient: void 0,
|
|
4185
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
4226
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkDX2D2TRZcjs.getPublicClient.call(void 0, targetChain))),
|
|
4186
4227
|
switchChain: void 0
|
|
4187
4228
|
};
|
|
4188
4229
|
}
|
|
4189
4230
|
if (canAutoLock) {
|
|
4190
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
4231
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _122 => _122.chain, 'optionalAccess', _123 => _123.id]), () => ( targetChain));
|
|
4191
4232
|
return {
|
|
4192
4233
|
ownerAddress: dappWalletClient.account.address,
|
|
4193
4234
|
walletClient: dappWalletClient,
|
|
4194
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
4235
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkDX2D2TRZcjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
4195
4236
|
switchChain: dappSwitchChain
|
|
4196
4237
|
};
|
|
4197
4238
|
}
|
|
@@ -4205,24 +4246,24 @@ function DepositFlow({
|
|
|
4205
4246
|
return {
|
|
4206
4247
|
ownerAddress: dappAddress,
|
|
4207
4248
|
walletClient: void 0,
|
|
4208
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
4249
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkDX2D2TRZcjs.getPublicClient.call(void 0, targetChain))),
|
|
4209
4250
|
switchChain: void 0
|
|
4210
4251
|
};
|
|
4211
4252
|
}
|
|
4212
|
-
if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess',
|
|
4213
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
4253
|
+
if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess', _124 => _124.account]) && selectedOption.address && dappWalletClient.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
4254
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _125 => _125.chain, 'optionalAccess', _126 => _126.id]), () => ( targetChain));
|
|
4214
4255
|
return {
|
|
4215
4256
|
ownerAddress: dappWalletClient.account.address,
|
|
4216
4257
|
walletClient: dappWalletClient,
|
|
4217
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
4258
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkDX2D2TRZcjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
4218
4259
|
switchChain: dappSwitchChain
|
|
4219
4260
|
};
|
|
4220
4261
|
}
|
|
4221
|
-
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess',
|
|
4262
|
+
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess', _127 => _127.address]) && selectedOption.address && reownWallet.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
4222
4263
|
return {
|
|
4223
4264
|
ownerAddress: reownWallet.address,
|
|
4224
4265
|
walletClient: reownWallet.walletClient,
|
|
4225
|
-
publicClient: _nullishCoalesce(reownWallet.publicClient, () => (
|
|
4266
|
+
publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunkDX2D2TRZcjs.getPublicClient.call(void 0, targetChain))),
|
|
4226
4267
|
switchChain: reownWallet.switchChain
|
|
4227
4268
|
};
|
|
4228
4269
|
}
|
|
@@ -4260,7 +4301,7 @@ function DepositFlow({
|
|
|
4260
4301
|
return {
|
|
4261
4302
|
ownerAddress: dappAddress,
|
|
4262
4303
|
walletClient: void 0,
|
|
4263
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
4304
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkDX2D2TRZcjs.getPublicClient.call(void 0, targetChain))),
|
|
4264
4305
|
switchChain: void 0
|
|
4265
4306
|
};
|
|
4266
4307
|
}
|
|
@@ -4285,37 +4326,37 @@ function DepositFlow({
|
|
|
4285
4326
|
const selectedEvmWalletOwner = _react.useMemo.call(void 0, () => {
|
|
4286
4327
|
if (!selectedWalletId) return null;
|
|
4287
4328
|
const opt = walletOptions.find((o) => o.id === selectedWalletId);
|
|
4288
|
-
if (_optionalChain([opt, 'optionalAccess',
|
|
4329
|
+
if (_optionalChain([opt, 'optionalAccess', _128 => _128.kind]) === "external" && opt.address) {
|
|
4289
4330
|
return opt.address;
|
|
4290
4331
|
}
|
|
4291
|
-
if (_optionalChain([opt, 'optionalAccess',
|
|
4332
|
+
if (_optionalChain([opt, 'optionalAccess', _129 => _129.kind]) === "connected" && opt.address) {
|
|
4292
4333
|
return opt.address;
|
|
4293
4334
|
}
|
|
4294
4335
|
return null;
|
|
4295
4336
|
}, [selectedWalletId, walletOptions]);
|
|
4296
4337
|
const dappImportOwner = _react.useMemo.call(void 0, () => {
|
|
4297
4338
|
if (selectedEvmWalletOwner) return selectedEvmWalletOwner;
|
|
4298
|
-
if (_optionalChain([reownWallet, 'optionalAccess',
|
|
4339
|
+
if (_optionalChain([reownWallet, 'optionalAccess', _130 => _130.address]) && reownWallet.isConnected) {
|
|
4299
4340
|
return reownWallet.address;
|
|
4300
4341
|
}
|
|
4301
4342
|
if (connectedWalletAddress) return connectedWalletAddress;
|
|
4302
4343
|
return null;
|
|
4303
4344
|
}, [
|
|
4304
4345
|
selectedEvmWalletOwner,
|
|
4305
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4306
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4346
|
+
_optionalChain([reownWallet, 'optionalAccess', _131 => _131.address]),
|
|
4347
|
+
_optionalChain([reownWallet, 'optionalAccess', _132 => _132.isConnected]),
|
|
4307
4348
|
connectedWalletAddress
|
|
4308
4349
|
]);
|
|
4309
4350
|
const activeOwner = _react.useMemo.call(void 0,
|
|
4310
4351
|
() => resolveOwnerForMode(flowMode, {
|
|
4311
4352
|
dappAddress,
|
|
4312
|
-
walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess',
|
|
4353
|
+
walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _133 => _133.ownerAddress]), () => ( (canAutoLock ? connectedWalletAddress : selectedEvmWalletOwner))),
|
|
4313
4354
|
dappImportOwner
|
|
4314
4355
|
}),
|
|
4315
4356
|
[
|
|
4316
4357
|
flowMode,
|
|
4317
4358
|
dappAddress,
|
|
4318
|
-
_optionalChain([signerContext, 'optionalAccess',
|
|
4359
|
+
_optionalChain([signerContext, 'optionalAccess', _134 => _134.ownerAddress]),
|
|
4319
4360
|
canAutoLock,
|
|
4320
4361
|
connectedWalletAddress,
|
|
4321
4362
|
selectedEvmWalletOwner,
|
|
@@ -4326,6 +4367,26 @@ function DepositFlow({
|
|
|
4326
4367
|
() => readSetupForOwner(setupSlice, activeOwner),
|
|
4327
4368
|
[setupSlice, activeOwner]
|
|
4328
4369
|
);
|
|
4370
|
+
const activeSmartAccount = activeEntry.smartAccount;
|
|
4371
|
+
_react.useEffect.call(void 0, () => {
|
|
4372
|
+
if (!activeSmartAccount) {
|
|
4373
|
+
setTargetBalanceUsd(void 0);
|
|
4374
|
+
return;
|
|
4375
|
+
}
|
|
4376
|
+
let active = true;
|
|
4377
|
+
service.fetchPortfolio(activeSmartAccount).then((portfolio) => {
|
|
4378
|
+
if (!active) return;
|
|
4379
|
+
const target = portfolio.tokens.find(
|
|
4380
|
+
(t) => t.chainId === targetChain && typeof t.address === "string" && t.address.toLowerCase() === targetToken.toLowerCase()
|
|
4381
|
+
);
|
|
4382
|
+
setTargetBalanceUsd(_nullishCoalesce(_optionalChain([target, 'optionalAccess', _135 => _135.balanceUsd]), () => ( 0)));
|
|
4383
|
+
}).catch(() => {
|
|
4384
|
+
if (active) setTargetBalanceUsd(0);
|
|
4385
|
+
});
|
|
4386
|
+
return () => {
|
|
4387
|
+
active = false;
|
|
4388
|
+
};
|
|
4389
|
+
}, [activeSmartAccount, targetChain, targetToken, service]);
|
|
4329
4390
|
const lastActiveSetupLifecycleKeyRef = _react.useRef.call(void 0, null);
|
|
4330
4391
|
_react.useEffect.call(void 0, () => {
|
|
4331
4392
|
if (!flowMode || !isConnectSelectionConfirmed) {
|
|
@@ -4344,12 +4405,12 @@ function DepositFlow({
|
|
|
4344
4405
|
return;
|
|
4345
4406
|
}
|
|
4346
4407
|
lastActiveSetupLifecycleKeyRef.current = lifecycleKey;
|
|
4347
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
4408
|
+
_optionalChain([onLifecycleRef, 'access', _136 => _136.current, 'optionalCall', _137 => _137({
|
|
4348
4409
|
type: "smart-account-changed",
|
|
4349
4410
|
evm: activeEntry.smartAccount,
|
|
4350
4411
|
solana: _nullishCoalesce(activeEntry.solanaDepositAddress, () => ( null))
|
|
4351
4412
|
})]);
|
|
4352
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
4413
|
+
_optionalChain([onLifecycleRef, 'access', _138 => _138.current, 'optionalCall', _139 => _139({
|
|
4353
4414
|
type: "connected",
|
|
4354
4415
|
address: activeOwner,
|
|
4355
4416
|
smartAccount: activeEntry.smartAccount
|
|
@@ -4382,7 +4443,7 @@ function DepositFlow({
|
|
|
4382
4443
|
const currentBackHandler = canGoBackFromHere ? handleBack : void 0;
|
|
4383
4444
|
const currentScreen = showConnectStep ? "connect" : effectiveStep.type;
|
|
4384
4445
|
_react.useEffect.call(void 0, () => {
|
|
4385
|
-
_optionalChain([onStepChangeRef, 'access',
|
|
4446
|
+
_optionalChain([onStepChangeRef, 'access', _140 => _140.current, 'optionalCall', _141 => _141(currentBackHandler, currentScreen)]);
|
|
4386
4447
|
}, [currentBackHandler, currentScreen, onStepChangeRef]);
|
|
4387
4448
|
const stepSendToken = effectiveStep.type === "amount" ? effectiveStep.asset.symbol : null;
|
|
4388
4449
|
const stepOpenEventKey = effectiveStep.type === "select-asset" ? "select-asset" : effectiveStep.type === "deposit-address" ? "deposit-address" : effectiveStep.type === "amount" && stepSendToken ? `amount:${stepSendToken.toLowerCase()}` : null;
|
|
@@ -4397,7 +4458,7 @@ function DepositFlow({
|
|
|
4397
4458
|
}
|
|
4398
4459
|
lastStepOpenEventKeyRef.current = stepOpenEventKey;
|
|
4399
4460
|
if (effectiveStep.type === "select-asset") {
|
|
4400
|
-
_optionalChain([onEventRef, 'access',
|
|
4461
|
+
_optionalChain([onEventRef, 'access', _142 => _142.current, 'optionalCall', _143 => _143({
|
|
4401
4462
|
type: "deposit_modal_connected_wallet_select_source_open",
|
|
4402
4463
|
total_balance_in_external_wallet: totalBalanceUsd,
|
|
4403
4464
|
pred_balance: totalBalanceUsd
|
|
@@ -4405,7 +4466,7 @@ function DepositFlow({
|
|
|
4405
4466
|
} else if (effectiveStep.type === "deposit-address") {
|
|
4406
4467
|
const chainName = _chunkIVTXEYB2cjs.getChainName.call(void 0, targetChain);
|
|
4407
4468
|
const tokenSymbol = _chunkIVTXEYB2cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
4408
|
-
_optionalChain([onEventRef, 'access',
|
|
4469
|
+
_optionalChain([onEventRef, 'access', _144 => _144.current, 'optionalCall', _145 => _145({
|
|
4409
4470
|
type: "deposit_modal_transfer_crypto_open",
|
|
4410
4471
|
default_chain: chainName,
|
|
4411
4472
|
default_token: tokenSymbol,
|
|
@@ -4413,7 +4474,7 @@ function DepositFlow({
|
|
|
4413
4474
|
})]);
|
|
4414
4475
|
} else if (effectiveStep.type === "amount" && stepSendToken) {
|
|
4415
4476
|
const receiveSymbol = _chunkIVTXEYB2cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
4416
|
-
_optionalChain([onEventRef, 'access',
|
|
4477
|
+
_optionalChain([onEventRef, 'access', _146 => _146.current, 'optionalCall', _147 => _147({
|
|
4417
4478
|
type: "deposit_modal_connected_wallet_enter_value_open",
|
|
4418
4479
|
send_token: stepSendToken,
|
|
4419
4480
|
receive_token: receiveSymbol,
|
|
@@ -4446,7 +4507,7 @@ function DepositFlow({
|
|
|
4446
4507
|
targetToken
|
|
4447
4508
|
]);
|
|
4448
4509
|
_react.useEffect.call(void 0, () => {
|
|
4449
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
4510
|
+
_optionalChain([onLifecycleRef, 'access', _148 => _148.current, 'optionalCall', _149 => _149({
|
|
4450
4511
|
type: "balance-changed",
|
|
4451
4512
|
totalUsd: totalBalanceUsd
|
|
4452
4513
|
})]);
|
|
@@ -4460,7 +4521,7 @@ function DepositFlow({
|
|
|
4460
4521
|
const handleConfirmWallet = _react.useCallback.call(void 0,
|
|
4461
4522
|
(walletId) => {
|
|
4462
4523
|
const selectedOption = walletOptions.find((o) => o.id === walletId);
|
|
4463
|
-
const mode = enableSolana && _optionalChain([selectedOption, 'optionalAccess',
|
|
4524
|
+
const mode = enableSolana && _optionalChain([selectedOption, 'optionalAccess', _150 => _150.kind]) === "solana" ? "solana-wallet" : "wallet";
|
|
4464
4525
|
storeApi.dispatch({
|
|
4465
4526
|
type: "connect/wallet-confirmed",
|
|
4466
4527
|
walletId,
|
|
@@ -4478,7 +4539,7 @@ function DepositFlow({
|
|
|
4478
4539
|
const owner = dappImportOwner;
|
|
4479
4540
|
if (owner) {
|
|
4480
4541
|
const wallet = walletOptions.find(
|
|
4481
|
-
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess',
|
|
4542
|
+
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _151 => _151.toLowerCase, 'call', _152 => _152()]) === owner.toLowerCase()
|
|
4482
4543
|
);
|
|
4483
4544
|
if (wallet) {
|
|
4484
4545
|
storeApi.dispatch({
|
|
@@ -4516,7 +4577,7 @@ function DepositFlow({
|
|
|
4516
4577
|
eoa: dappImportOwner,
|
|
4517
4578
|
getPublicClient: (chainId) => {
|
|
4518
4579
|
try {
|
|
4519
|
-
return
|
|
4580
|
+
return _chunkDX2D2TRZcjs.getPublicClient.call(void 0, chainId);
|
|
4520
4581
|
} catch (e28) {
|
|
4521
4582
|
return null;
|
|
4522
4583
|
}
|
|
@@ -4551,7 +4612,7 @@ function DepositFlow({
|
|
|
4551
4612
|
);
|
|
4552
4613
|
const connectStepDappImports = _react.useMemo.call(void 0,
|
|
4553
4614
|
() => enabledDappImportProviders.map((provider) => {
|
|
4554
|
-
const availabilityEntry = dappImportOwner && _optionalChain([dappImportAvailabilityOwner, 'optionalAccess',
|
|
4615
|
+
const availabilityEntry = dappImportOwner && _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _153 => _153.toLowerCase, 'call', _154 => _154()]) === dappImportOwner.toLowerCase() ? dappImportAvailability[provider.id] : void 0;
|
|
4555
4616
|
const dappImportSetup = readSetupForOwner(setupSlice, dappImportOwner);
|
|
4556
4617
|
const baseRow = {
|
|
4557
4618
|
id: provider.id,
|
|
@@ -4604,7 +4665,7 @@ function DepositFlow({
|
|
|
4604
4665
|
}, [activeDappImportProviderId, enabledDappImportProviders]);
|
|
4605
4666
|
const activeDappImportAvailability = _react.useMemo.call(void 0, () => {
|
|
4606
4667
|
if (!activeDappImportProviderId) return null;
|
|
4607
|
-
if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess',
|
|
4668
|
+
if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _155 => _155.toLowerCase, 'call', _156 => _156()]) !== dappImportOwner.toLowerCase()) {
|
|
4608
4669
|
return null;
|
|
4609
4670
|
}
|
|
4610
4671
|
const entry = dappImportAvailability[activeDappImportProviderId];
|
|
@@ -4617,7 +4678,7 @@ function DepositFlow({
|
|
|
4617
4678
|
dappImportOwner
|
|
4618
4679
|
]);
|
|
4619
4680
|
const handleNewDeposit = _react.useCallback.call(void 0, () => {
|
|
4620
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
4681
|
+
_optionalChain([onLifecycleRef, 'access', _157 => _157.current, 'optionalCall', _158 => _158({
|
|
4621
4682
|
type: "smart-account-changed",
|
|
4622
4683
|
evm: null,
|
|
4623
4684
|
solana: null
|
|
@@ -4665,13 +4726,13 @@ function DepositFlow({
|
|
|
4665
4726
|
};
|
|
4666
4727
|
push(dappAddress);
|
|
4667
4728
|
push(connectedWalletAddress);
|
|
4668
|
-
push(_optionalChain([reownWallet, 'optionalAccess',
|
|
4729
|
+
push(_optionalChain([reownWallet, 'optionalAccess', _159 => _159.address]));
|
|
4669
4730
|
push(dappImportOwner);
|
|
4670
4731
|
return owners;
|
|
4671
4732
|
}, [
|
|
4672
4733
|
dappAddress,
|
|
4673
4734
|
connectedWalletAddress,
|
|
4674
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4735
|
+
_optionalChain([reownWallet, 'optionalAccess', _160 => _160.address]),
|
|
4675
4736
|
dappImportOwner
|
|
4676
4737
|
]);
|
|
4677
4738
|
_react.useEffect.call(void 0, () => {
|
|
@@ -4685,7 +4746,7 @@ function DepositFlow({
|
|
|
4685
4746
|
try {
|
|
4686
4747
|
sessionOwner = await resolveSessionOwner(owner);
|
|
4687
4748
|
} catch (error) {
|
|
4688
|
-
|
|
4749
|
+
_chunkDX2D2TRZcjs.debugError.call(void 0,
|
|
4689
4750
|
debug,
|
|
4690
4751
|
"deposit-flow",
|
|
4691
4752
|
"session-owner:resolve-failed",
|
|
@@ -4704,6 +4765,28 @@ function DepositFlow({
|
|
|
4704
4765
|
if (current.requestKey === requestKey) {
|
|
4705
4766
|
return;
|
|
4706
4767
|
}
|
|
4768
|
+
const dedupedResult = readDedupedAccountSetupResult(requestKey);
|
|
4769
|
+
if (dedupedResult) {
|
|
4770
|
+
storeApi.dispatch({
|
|
4771
|
+
type: "setup/started",
|
|
4772
|
+
owner,
|
|
4773
|
+
requestKey,
|
|
4774
|
+
cacheKey,
|
|
4775
|
+
cacheable
|
|
4776
|
+
});
|
|
4777
|
+
storeApi.dispatch({
|
|
4778
|
+
type: "setup/ready",
|
|
4779
|
+
owner,
|
|
4780
|
+
requestKey,
|
|
4781
|
+
result: {
|
|
4782
|
+
smartAccount: dedupedResult.smartAccount,
|
|
4783
|
+
sessionOwnerAddress: dedupedResult.sessionOwnerAddress,
|
|
4784
|
+
solanaDepositAddress: dedupedResult.solanaDepositAddress,
|
|
4785
|
+
cacheKey: dedupedResult.cacheKey
|
|
4786
|
+
}
|
|
4787
|
+
});
|
|
4788
|
+
return;
|
|
4789
|
+
}
|
|
4707
4790
|
storeApi.dispatch({
|
|
4708
4791
|
type: "setup/started",
|
|
4709
4792
|
owner,
|
|
@@ -4712,7 +4795,11 @@ function DepositFlow({
|
|
|
4712
4795
|
cacheable
|
|
4713
4796
|
});
|
|
4714
4797
|
try {
|
|
4715
|
-
const result = await
|
|
4798
|
+
const result = await runAccountSetupDeduped(
|
|
4799
|
+
input,
|
|
4800
|
+
{ service, debug },
|
|
4801
|
+
requestKey
|
|
4802
|
+
);
|
|
4716
4803
|
storeApi.dispatch({
|
|
4717
4804
|
type: "setup/ready",
|
|
4718
4805
|
owner,
|
|
@@ -4750,7 +4837,7 @@ function DepositFlow({
|
|
|
4750
4837
|
sourceChain: data.sourceChain,
|
|
4751
4838
|
amount: data.amount
|
|
4752
4839
|
});
|
|
4753
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
4840
|
+
_optionalChain([onLifecycleRef, 'access', _161 => _161.current, 'optionalCall', _162 => _162({ type: "submitted", ...data })]);
|
|
4754
4841
|
},
|
|
4755
4842
|
[logFlow, onLifecycleRef]
|
|
4756
4843
|
);
|
|
@@ -4807,7 +4894,7 @@ function DepositFlow({
|
|
|
4807
4894
|
sourceSymbol: tokenAtSubmit.symbol,
|
|
4808
4895
|
sourceDecimals: tokenAtSubmit.decimals
|
|
4809
4896
|
});
|
|
4810
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
4897
|
+
_optionalChain([onLifecycleRef, 'access', _163 => _163.current, 'optionalCall', _164 => _164({
|
|
4811
4898
|
type: "submitted",
|
|
4812
4899
|
txHash,
|
|
4813
4900
|
sourceChain: "solana",
|
|
@@ -4818,7 +4905,7 @@ function DepositFlow({
|
|
|
4818
4905
|
);
|
|
4819
4906
|
const handleAssetContinue = _react.useCallback.call(void 0,
|
|
4820
4907
|
(asset) => {
|
|
4821
|
-
_optionalChain([onEventRef, 'access',
|
|
4908
|
+
_optionalChain([onEventRef, 'access', _165 => _165.current, 'optionalCall', _166 => _166({
|
|
4822
4909
|
type: "deposit_modal_connected_wallet_select_source_cta_click",
|
|
4823
4910
|
total_balance_in_external_wallet: totalBalanceUsd,
|
|
4824
4911
|
pred_balance: totalBalanceUsd,
|
|
@@ -4871,8 +4958,8 @@ function DepositFlow({
|
|
|
4871
4958
|
sourceChain: chainId,
|
|
4872
4959
|
sourceToken: token,
|
|
4873
4960
|
amount,
|
|
4874
|
-
sourceSymbol: _optionalChain([dappImport, 'optionalAccess',
|
|
4875
|
-
sourceDecimals: _optionalChain([dappImport, 'optionalAccess',
|
|
4961
|
+
sourceSymbol: _optionalChain([dappImport, 'optionalAccess', _167 => _167.symbol]),
|
|
4962
|
+
sourceDecimals: _optionalChain([dappImport, 'optionalAccess', _168 => _168.decimals]),
|
|
4876
4963
|
directTransfer: !dappImport && isSameRoute2(chainId, token, targetChain, targetToken)
|
|
4877
4964
|
});
|
|
4878
4965
|
},
|
|
@@ -4880,7 +4967,7 @@ function DepositFlow({
|
|
|
4880
4967
|
);
|
|
4881
4968
|
const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
|
|
4882
4969
|
(txHash, sourceChain, amount) => {
|
|
4883
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
4970
|
+
_optionalChain([onLifecycleRef, 'access', _169 => _169.current, 'optionalCall', _170 => _170({
|
|
4884
4971
|
type: "submitted",
|
|
4885
4972
|
txHash,
|
|
4886
4973
|
sourceChain,
|
|
@@ -4892,7 +4979,7 @@ function DepositFlow({
|
|
|
4892
4979
|
const handleDepositComplete = _react.useCallback.call(void 0,
|
|
4893
4980
|
(txHash, destinationTxHash, context) => {
|
|
4894
4981
|
logFlow("deposit:complete", { txHash, destinationTxHash, ...context });
|
|
4895
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
4982
|
+
_optionalChain([onLifecycleRef, 'access', _171 => _171.current, 'optionalCall', _172 => _172({
|
|
4896
4983
|
type: "complete",
|
|
4897
4984
|
txHash,
|
|
4898
4985
|
destinationTxHash,
|
|
@@ -4904,14 +4991,14 @@ function DepositFlow({
|
|
|
4904
4991
|
const handleDepositFailed = _react.useCallback.call(void 0,
|
|
4905
4992
|
(txHash, error) => {
|
|
4906
4993
|
logFlowError("deposit:failed", error, { txHash });
|
|
4907
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
4994
|
+
_optionalChain([onLifecycleRef, 'access', _173 => _173.current, 'optionalCall', _174 => _174({ type: "failed", txHash, error })]);
|
|
4908
4995
|
},
|
|
4909
4996
|
[logFlowError, onLifecycleRef]
|
|
4910
4997
|
);
|
|
4911
4998
|
const handleError = _react.useCallback.call(void 0,
|
|
4912
4999
|
(message, code) => {
|
|
4913
5000
|
logFlowError("flow:error", message, { code });
|
|
4914
|
-
_optionalChain([onErrorRef, 'access',
|
|
5001
|
+
_optionalChain([onErrorRef, 'access', _175 => _175.current, 'optionalCall', _176 => _176({ message, code })]);
|
|
4915
5002
|
},
|
|
4916
5003
|
[logFlowError, onErrorRef]
|
|
4917
5004
|
);
|
|
@@ -4993,7 +5080,7 @@ function DepositFlow({
|
|
|
4993
5080
|
);
|
|
4994
5081
|
if (showConnectStep) {
|
|
4995
5082
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4996
|
-
|
|
5083
|
+
_chunkDX2D2TRZcjs.ConnectStep,
|
|
4997
5084
|
{
|
|
4998
5085
|
walletRows,
|
|
4999
5086
|
transferCryptoState: dappAddress ? transferCryptoState : void 0,
|
|
@@ -5039,16 +5126,7 @@ function DepositFlow({
|
|
|
5039
5126
|
}
|
|
5040
5127
|
if (isDepositAddressMode) {
|
|
5041
5128
|
if (!dappAddress) return null;
|
|
5042
|
-
const isWalletPickerReachable = walletOptions.length > 0 || Boolean(reownWallet) || Boolean(onConnect);
|
|
5043
|
-
const showBanner = effectiveStep.type !== "setup" && (activeEntry.status === "loading" || activeEntry.status === "error");
|
|
5044
5129
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
5045
|
-
showBanner && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5046
|
-
SetupUpdatingBanner,
|
|
5047
|
-
{
|
|
5048
|
-
status: activeEntry.status,
|
|
5049
|
-
message: _nullishCoalesce(activeEntry.message, () => ( void 0))
|
|
5050
|
-
}
|
|
5051
|
-
),
|
|
5052
5130
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5053
5131
|
AccountPreparingSkeleton,
|
|
5054
5132
|
{
|
|
@@ -5066,7 +5144,7 @@ function DepositFlow({
|
|
|
5066
5144
|
targetChain,
|
|
5067
5145
|
targetToken,
|
|
5068
5146
|
waitForFinalTx,
|
|
5069
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
5147
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _177 => _177.length])),
|
|
5070
5148
|
uiConfig,
|
|
5071
5149
|
onDepositSubmitted: handleDepositAddressSubmitted,
|
|
5072
5150
|
onDepositComplete: handleDepositComplete,
|
|
@@ -5074,7 +5152,7 @@ function DepositFlow({
|
|
|
5074
5152
|
onCopyAddress: () => {
|
|
5075
5153
|
const chainName = _chunkIVTXEYB2cjs.getChainName.call(void 0, targetChain);
|
|
5076
5154
|
const tokenSymbol = _chunkIVTXEYB2cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
5077
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
5155
|
+
_optionalChain([onEvent, 'optionalCall', _178 => _178({
|
|
5078
5156
|
type: "deposit_modal_transfer_crypto_cta_click",
|
|
5079
5157
|
default_chain: chainName,
|
|
5080
5158
|
default_token: tokenSymbol,
|
|
@@ -5082,9 +5160,6 @@ function DepositFlow({
|
|
|
5082
5160
|
cta_name: "copy"
|
|
5083
5161
|
})]);
|
|
5084
5162
|
},
|
|
5085
|
-
onRequestWalletPicker: isWalletPickerReachable ? () => storeApi.dispatch({
|
|
5086
|
-
type: "connect/wallet-picker-requested"
|
|
5087
|
-
}) : void 0,
|
|
5088
5163
|
onError: handleError,
|
|
5089
5164
|
debug
|
|
5090
5165
|
}
|
|
@@ -5093,17 +5168,9 @@ function DepositFlow({
|
|
|
5093
5168
|
}
|
|
5094
5169
|
if (isSolanaWalletMode) {
|
|
5095
5170
|
if (!dappAddress) return null;
|
|
5096
|
-
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess',
|
|
5097
|
-
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess',
|
|
5098
|
-
const solanaShowBanner = effectiveStep.type !== "setup" && effectiveStep.type !== "processing" && (activeEntry.status === "loading" || activeEntry.status === "error");
|
|
5171
|
+
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess', _179 => _179.solanaAddress]);
|
|
5172
|
+
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess', _180 => _180.solanaProvider]);
|
|
5099
5173
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
5100
|
-
solanaShowBanner && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5101
|
-
SetupUpdatingBanner,
|
|
5102
|
-
{
|
|
5103
|
-
status: activeEntry.status,
|
|
5104
|
-
message: _nullishCoalesce(activeEntry.message, () => ( void 0))
|
|
5105
|
-
}
|
|
5106
|
-
),
|
|
5107
5174
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5108
5175
|
AccountPreparingSkeleton,
|
|
5109
5176
|
{
|
|
@@ -5134,6 +5201,7 @@ function DepositFlow({
|
|
|
5134
5201
|
targetTokenIcon: _chunkIVTXEYB2cjs.getTokenIcon.call(void 0,
|
|
5135
5202
|
_chunkIVTXEYB2cjs.getTokenSymbol.call(void 0, targetToken, targetChain)
|
|
5136
5203
|
),
|
|
5204
|
+
targetBalanceUsd,
|
|
5137
5205
|
onContinue: handleSolanaAmountContinue,
|
|
5138
5206
|
debug
|
|
5139
5207
|
}
|
|
@@ -5192,7 +5260,7 @@ function DepositFlow({
|
|
|
5192
5260
|
) })
|
|
5193
5261
|
] }) : null,
|
|
5194
5262
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5195
|
-
|
|
5263
|
+
_chunkDX2D2TRZcjs.ProcessingStep,
|
|
5196
5264
|
{
|
|
5197
5265
|
smartAccount: effectiveStep.smartAccount,
|
|
5198
5266
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
@@ -5205,7 +5273,7 @@ function DepositFlow({
|
|
|
5205
5273
|
sourceSymbol: effectiveStep.sourceSymbol,
|
|
5206
5274
|
sourceDecimals: effectiveStep.sourceDecimals,
|
|
5207
5275
|
waitForFinalTx,
|
|
5208
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
5276
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _181 => _181.length])),
|
|
5209
5277
|
service,
|
|
5210
5278
|
directTransfer: effectiveStep.directTransfer,
|
|
5211
5279
|
onClose,
|
|
@@ -5218,26 +5286,18 @@ function DepositFlow({
|
|
|
5218
5286
|
)
|
|
5219
5287
|
] });
|
|
5220
5288
|
}
|
|
5221
|
-
if (!_optionalChain([signerContext, 'optionalAccess',
|
|
5289
|
+
if (!_optionalChain([signerContext, 'optionalAccess', _182 => _182.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _183 => _183.publicClient])) {
|
|
5222
5290
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-state", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-text", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-title", children: "Connecting wallet..." }) }) }) }) });
|
|
5223
5291
|
}
|
|
5224
5292
|
const ownerAddress = signerContext.ownerAddress;
|
|
5225
|
-
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access',
|
|
5293
|
+
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _184 => _184.walletClient, 'optionalAccess', _185 => _185.chain, 'optionalAccess', _186 => _186.id]), () => ( _optionalChain([signerContext, 'access', _187 => _187.publicClient, 'access', _188 => _188.chain, 'optionalAccess', _189 => _189.id]))), () => ( targetChain));
|
|
5226
5294
|
const getReadClientForChain = (chainId) => {
|
|
5227
|
-
if (_optionalChain([signerContext, 'access',
|
|
5295
|
+
if (_optionalChain([signerContext, 'access', _190 => _190.publicClient, 'access', _191 => _191.chain, 'optionalAccess', _192 => _192.id]) === chainId) {
|
|
5228
5296
|
return signerContext.publicClient;
|
|
5229
5297
|
}
|
|
5230
|
-
return
|
|
5298
|
+
return _chunkDX2D2TRZcjs.getPublicClient.call(void 0, chainId);
|
|
5231
5299
|
};
|
|
5232
|
-
const walletShowBanner = effectiveStep.type !== "setup" && effectiveStep.type !== "processing" && (activeEntry.status === "loading" || activeEntry.status === "error");
|
|
5233
5300
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
5234
|
-
walletShowBanner && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5235
|
-
SetupUpdatingBanner,
|
|
5236
|
-
{
|
|
5237
|
-
status: activeEntry.status,
|
|
5238
|
-
message: _nullishCoalesce(activeEntry.message, () => ( void 0))
|
|
5239
|
-
}
|
|
5240
|
-
),
|
|
5241
5301
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5242
5302
|
AccountPreparingSkeleton,
|
|
5243
5303
|
{
|
|
@@ -5266,7 +5326,7 @@ function DepositFlow({
|
|
|
5266
5326
|
effectiveStep.type === "dapp-import-asset-select" && activeDappImportProvider && activeDappImportAvailability && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5267
5327
|
DappImportAssetSelectStep,
|
|
5268
5328
|
{
|
|
5269
|
-
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access',
|
|
5329
|
+
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access', _193 => _193.assets, 'access', _194 => _194[0], 'optionalAccess', _195 => _195.sourceLabel]), () => ( activeDappImportProvider.label)),
|
|
5270
5330
|
assets: activeDappImportAvailability.assets,
|
|
5271
5331
|
onSelect: handleDappImportAssetSelected
|
|
5272
5332
|
}
|
|
@@ -5288,11 +5348,12 @@ function DepositFlow({
|
|
|
5288
5348
|
targetChain,
|
|
5289
5349
|
targetToken,
|
|
5290
5350
|
uiConfig,
|
|
5351
|
+
targetBalanceUsd,
|
|
5291
5352
|
service,
|
|
5292
5353
|
onContinue: handleAmountContinue,
|
|
5293
5354
|
onCtaClick: (ctaName) => {
|
|
5294
5355
|
const receiveSymbol = _chunkIVTXEYB2cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
5295
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
5356
|
+
_optionalChain([onEvent, 'optionalCall', _196 => _196({
|
|
5296
5357
|
type: "deposit_modal_connected_wallet_enter_value_cta_click",
|
|
5297
5358
|
send_token: effectiveStep.asset.symbol,
|
|
5298
5359
|
receive_token: receiveSymbol,
|
|
@@ -5342,7 +5403,7 @@ function DepositFlow({
|
|
|
5342
5403
|
}
|
|
5343
5404
|
),
|
|
5344
5405
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5345
|
-
|
|
5406
|
+
_chunkDX2D2TRZcjs.ProcessingStep,
|
|
5346
5407
|
{
|
|
5347
5408
|
smartAccount: effectiveStep.smartAccount,
|
|
5348
5409
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
@@ -5355,7 +5416,7 @@ function DepositFlow({
|
|
|
5355
5416
|
sourceSymbol: effectiveStep.sourceSymbol,
|
|
5356
5417
|
sourceDecimals: effectiveStep.sourceDecimals,
|
|
5357
5418
|
waitForFinalTx,
|
|
5358
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
5419
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _197 => _197.length])),
|
|
5359
5420
|
service,
|
|
5360
5421
|
directTransfer: effectiveStep.directTransfer,
|
|
5361
5422
|
uiConfig,
|
|
@@ -5394,8 +5455,8 @@ function formatDate(iso) {
|
|
|
5394
5455
|
function resolveChainId(value) {
|
|
5395
5456
|
if (value === void 0 || value === null) return null;
|
|
5396
5457
|
if (typeof value === "number") return value;
|
|
5397
|
-
if (
|
|
5398
|
-
const parsed =
|
|
5458
|
+
if (_chunkDX2D2TRZcjs.isSolanaCaip2.call(void 0, value) || value === "solana") return "solana";
|
|
5459
|
+
const parsed = _chunkDX2D2TRZcjs.parseEvmChainId.call(void 0, value);
|
|
5399
5460
|
if (parsed !== null) return parsed;
|
|
5400
5461
|
const num = Number(value);
|
|
5401
5462
|
return Number.isFinite(num) ? num : null;
|
|
@@ -5509,7 +5570,7 @@ function DepositHistoryPanel({
|
|
|
5509
5570
|
className: "rs-modal-header-back",
|
|
5510
5571
|
"aria-label": "Back",
|
|
5511
5572
|
onClick: onClose,
|
|
5512
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5573
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.ChevronLeftIcon, {})
|
|
5513
5574
|
}
|
|
5514
5575
|
) }),
|
|
5515
5576
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-center" }),
|
|
@@ -5520,29 +5581,29 @@ function DepositHistoryPanel({
|
|
|
5520
5581
|
className: "rs-modal-close",
|
|
5521
5582
|
"aria-label": "Close",
|
|
5522
5583
|
onClick: onCloseModal,
|
|
5523
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5584
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.CloseIcon, {})
|
|
5524
5585
|
}
|
|
5525
5586
|
) })
|
|
5526
5587
|
] }),
|
|
5527
5588
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen", children: [
|
|
5528
5589
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen-body", children: [
|
|
5529
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5590
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.HistoryIcon, {}), title: "History" }),
|
|
5530
5591
|
isLoading && deposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
5531
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5592
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.HistoryIcon, {}) }),
|
|
5532
5593
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
5533
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5594
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.Spinner, { className: "rs-spinner--sm" }),
|
|
5534
5595
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Loading history\u2026" })
|
|
5535
5596
|
] })
|
|
5536
5597
|
] }),
|
|
5537
5598
|
error && !isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
5538
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5599
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.AlertTriangleIcon, {}) }),
|
|
5539
5600
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
5540
5601
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "Couldn't load history" }),
|
|
5541
5602
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: error })
|
|
5542
5603
|
] })
|
|
5543
5604
|
] }),
|
|
5544
5605
|
!isLoading && !error && deposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
5545
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5606
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.HistoryIcon, {}) }),
|
|
5546
5607
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
5547
5608
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "No deposits yet" }),
|
|
5548
5609
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Your deposit history will appear here" })
|
|
@@ -5562,7 +5623,7 @@ function DepositHistoryPanel({
|
|
|
5562
5623
|
)
|
|
5563
5624
|
] })
|
|
5564
5625
|
] }),
|
|
5565
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5626
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.PoweredBy, {})
|
|
5566
5627
|
] })
|
|
5567
5628
|
]
|
|
5568
5629
|
}
|
|
@@ -5636,7 +5697,7 @@ function HistoryCard({ deposit }) {
|
|
|
5636
5697
|
onClick: (e) => e.stopPropagation(),
|
|
5637
5698
|
children: [
|
|
5638
5699
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: shortenHash(deposit.sourceTxHash) }),
|
|
5639
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5700
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.ArrowUpRightIcon, {})
|
|
5640
5701
|
]
|
|
5641
5702
|
}
|
|
5642
5703
|
)
|
|
@@ -5651,7 +5712,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
|
5651
5712
|
// src/DepositModal.tsx
|
|
5652
5713
|
|
|
5653
5714
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
5654
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
5715
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-PPX34UAK.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
5655
5716
|
);
|
|
5656
5717
|
function sortByCreatedAtDesc(items) {
|
|
5657
5718
|
return [...items].sort((a, b) => {
|
|
@@ -5725,12 +5786,12 @@ function DepositModalInner({
|
|
|
5725
5786
|
debug
|
|
5726
5787
|
}) {
|
|
5727
5788
|
const modalRef = _react.useRef.call(void 0, null);
|
|
5728
|
-
const onReadyRef =
|
|
5789
|
+
const onReadyRef = _chunkDX2D2TRZcjs.useLatestRef.call(void 0, onReady);
|
|
5729
5790
|
const [currentScreen, setCurrentScreen] = _react.useState.call(void 0, "connect");
|
|
5730
5791
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
5731
5792
|
void 0
|
|
5732
5793
|
);
|
|
5733
|
-
const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
5794
|
+
const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _198 => _198.showHistoryButton]), () => ( false));
|
|
5734
5795
|
const historyButtonVisible = showHistoryButton && (currentScreen === "select-asset" || currentScreen === "deposit-address");
|
|
5735
5796
|
const [historyOpen, setHistoryOpen] = _react.useState.call(void 0, false);
|
|
5736
5797
|
const [historyDeposits, setHistoryDeposits] = _react.useState.call(void 0, []);
|
|
@@ -5744,7 +5805,7 @@ function DepositModalInner({
|
|
|
5744
5805
|
const targetChain = _chunkIVTXEYB2cjs.getChainId.call(void 0, targetChainProp);
|
|
5745
5806
|
const sourceChain = sourceChainProp ? _chunkIVTXEYB2cjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
5746
5807
|
const service = _react.useMemo.call(void 0,
|
|
5747
|
-
() =>
|
|
5808
|
+
() => _chunkDX2D2TRZcjs.createDepositService.call(void 0, backendUrl, {
|
|
5748
5809
|
debug,
|
|
5749
5810
|
debugScope: "service:deposit"
|
|
5750
5811
|
}),
|
|
@@ -5760,7 +5821,7 @@ function DepositModalInner({
|
|
|
5760
5821
|
}, [store, targetChain, targetToken]);
|
|
5761
5822
|
_react.useEffect.call(void 0, () => {
|
|
5762
5823
|
if (isOpen && modalRef.current) {
|
|
5763
|
-
|
|
5824
|
+
_chunkDX2D2TRZcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
5764
5825
|
}
|
|
5765
5826
|
}, [isOpen, theme]);
|
|
5766
5827
|
_react.useEffect.call(void 0, () => {
|
|
@@ -5768,7 +5829,7 @@ function DepositModalInner({
|
|
|
5768
5829
|
}, [solanaRpcUrl]);
|
|
5769
5830
|
_react.useEffect.call(void 0, () => {
|
|
5770
5831
|
if (isOpen) {
|
|
5771
|
-
_optionalChain([onReadyRef, 'access',
|
|
5832
|
+
_optionalChain([onReadyRef, 'access', _199 => _199.current, 'optionalCall', _200 => _200()]);
|
|
5772
5833
|
}
|
|
5773
5834
|
}, [isOpen, onReadyRef]);
|
|
5774
5835
|
const handleStepChange = _react.useCallback.call(void 0,
|
|
@@ -5844,10 +5905,10 @@ function DepositModalInner({
|
|
|
5844
5905
|
fetchHistory("initial");
|
|
5845
5906
|
}
|
|
5846
5907
|
}, [historyOpen, fetchHistory]);
|
|
5847
|
-
const onLifecycleRef =
|
|
5908
|
+
const onLifecycleRef = _chunkDX2D2TRZcjs.useLatestRef.call(void 0, onLifecycle);
|
|
5848
5909
|
const handleLifecycle = _react.useCallback.call(void 0,
|
|
5849
5910
|
(event) => {
|
|
5850
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
5911
|
+
_optionalChain([onLifecycleRef, 'access', _201 => _201.current, 'optionalCall', _202 => _202(event)]);
|
|
5851
5912
|
if (event.type === "smart-account-changed" && !event.evm && !event.solana) {
|
|
5852
5913
|
historyStaleRef.current = true;
|
|
5853
5914
|
}
|
|
@@ -5873,10 +5934,10 @@ function DepositModalInner({
|
|
|
5873
5934
|
store.dispatch({ type: "flow/reset" });
|
|
5874
5935
|
}
|
|
5875
5936
|
}, [isOpen, store]);
|
|
5876
|
-
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
5937
|
+
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _203 => _203.showBackButton]), () => ( true));
|
|
5877
5938
|
const canGoBack = backHandler !== void 0;
|
|
5878
5939
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5879
|
-
|
|
5940
|
+
_chunkDX2D2TRZcjs.Modal,
|
|
5880
5941
|
{
|
|
5881
5942
|
isOpen,
|
|
5882
5943
|
onClose,
|
|
@@ -5892,7 +5953,7 @@ function DepositModalInner({
|
|
|
5892
5953
|
className: "rs-modal-header-back",
|
|
5893
5954
|
"aria-label": "Go back",
|
|
5894
5955
|
onClick: backHandler,
|
|
5895
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5956
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.ChevronLeftIcon, {})
|
|
5896
5957
|
}
|
|
5897
5958
|
) }),
|
|
5898
5959
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
|
|
@@ -5904,7 +5965,7 @@ function DepositModalInner({
|
|
|
5904
5965
|
"aria-label": "Deposit history",
|
|
5905
5966
|
onClick: handleHistoryOpen,
|
|
5906
5967
|
disabled: !recipient,
|
|
5907
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5968
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.HistoryIcon, {})
|
|
5908
5969
|
}
|
|
5909
5970
|
),
|
|
5910
5971
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -5914,7 +5975,7 @@ function DepositModalInner({
|
|
|
5914
5975
|
onClick: onClose,
|
|
5915
5976
|
className: "rs-modal-close",
|
|
5916
5977
|
"aria-label": "Close",
|
|
5917
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5978
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDX2D2TRZcjs.CloseIcon, {})
|
|
5918
5979
|
}
|
|
5919
5980
|
)
|
|
5920
5981
|
] })
|