@rhinestone/deposit-modal 0.5.1 → 0.6.0
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-HWKF3O62.cjs → DepositModalReown-J3KYAOD3.cjs} +6 -6
- package/dist/{DepositModalReown-YJBDBCRA.mjs → DepositModalReown-YD7TLEAA.mjs} +3 -3
- package/dist/{WithdrawModalReown-USNQEAEM.cjs → WithdrawModalReown-QSQUV6HX.cjs} +6 -6
- package/dist/{WithdrawModalReown-AQTB4OZN.mjs → WithdrawModalReown-ZPDMX47Z.mjs} +3 -3
- package/dist/{chunk-KYHPKMTK.mjs → chunk-3JVGI7FC.mjs} +2 -2
- package/dist/{chunk-AMEXFHB4.cjs → chunk-7LVI3VAL.cjs} +687 -450
- package/dist/{chunk-V4XVFT25.cjs → chunk-DASS33PJ.cjs} +57 -57
- package/dist/{chunk-QEW5NAGV.mjs → chunk-DXGM6YET.mjs} +1 -1
- package/dist/{chunk-4YLVKTSU.mjs → chunk-GQDVHMOT.mjs} +107 -100
- package/dist/{chunk-XPJJWJPM.mjs → chunk-NSAODZSS.mjs} +346 -109
- package/dist/{chunk-HT364QJK.cjs → chunk-YYIE5U5K.cjs} +4 -4
- package/dist/{chunk-PDFLALUT.cjs → chunk-ZDYV536Q.cjs} +176 -169
- package/dist/deposit.cjs +3 -3
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +3 -3
- package/dist/{types-_m8w8BYq.d.cts → types-6ROxwyfG.d.cts} +1 -8
- package/dist/{types-_m8w8BYq.d.ts → types-6ROxwyfG.d.ts} +1 -8
- package/dist/withdraw.cjs +3 -3
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +2 -2
- package/package.json +1 -1
|
@@ -68,7 +68,7 @@ var _chunkNRNJAQUAcjs = require('./chunk-NRNJAQUA.cjs');
|
|
|
68
68
|
|
|
69
69
|
|
|
70
70
|
|
|
71
|
-
var
|
|
71
|
+
var _chunkZDYV536Qcjs = require('./chunk-ZDYV536Q.cjs');
|
|
72
72
|
|
|
73
73
|
|
|
74
74
|
var _chunkUEKPBRBYcjs = require('./chunk-UEKPBRBY.cjs');
|
|
@@ -146,12 +146,12 @@ function AssetSelectStep({
|
|
|
146
146
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
147
147
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
148
148
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
149
|
-
return
|
|
149
|
+
return _chunkZDYV536Qcjs.getAssetId.call(void 0, {
|
|
150
150
|
chainId: defaultSourceChain,
|
|
151
151
|
token: defaultSourceToken
|
|
152
152
|
});
|
|
153
153
|
}, [defaultSourceChain, defaultSourceToken]);
|
|
154
|
-
const onTotalBalanceComputedRef =
|
|
154
|
+
const onTotalBalanceComputedRef = _chunkZDYV536Qcjs.useLatestRef.call(void 0, onTotalBalanceComputed);
|
|
155
155
|
_react.useEffect.call(void 0, () => {
|
|
156
156
|
let active = true;
|
|
157
157
|
function emitAssetsUpdate(currentAssets) {
|
|
@@ -171,7 +171,7 @@ function AssetSelectStep({
|
|
|
171
171
|
try {
|
|
172
172
|
const portfolio = await service.fetchPortfolio(address);
|
|
173
173
|
if (!active) return;
|
|
174
|
-
const portfolioAssets =
|
|
174
|
+
const portfolioAssets = _chunkZDYV536Qcjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
175
175
|
setAssets(portfolioAssets);
|
|
176
176
|
emitAssetsUpdate(portfolioAssets);
|
|
177
177
|
const hasNative = portfolioAssets.some(
|
|
@@ -247,7 +247,7 @@ function AssetSelectStep({
|
|
|
247
247
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
248
248
|
const numeric = Number(raw);
|
|
249
249
|
if (!Number.isFinite(numeric)) return raw;
|
|
250
|
-
return
|
|
250
|
+
return _chunkZDYV536Qcjs.tokenFormatter.format(numeric);
|
|
251
251
|
} catch (e3) {
|
|
252
252
|
return asset.balance;
|
|
253
253
|
}
|
|
@@ -255,20 +255,20 @@ function AssetSelectStep({
|
|
|
255
255
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
256
256
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
257
257
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
258
|
-
|
|
258
|
+
_chunkZDYV536Qcjs.BodyHeader,
|
|
259
259
|
{
|
|
260
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
260
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.WalletIcon, {}),
|
|
261
261
|
title: "Your assets",
|
|
262
262
|
subtitle: "Select source assets to transfer"
|
|
263
263
|
}
|
|
264
264
|
),
|
|
265
265
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
266
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
266
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
267
267
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
268
268
|
] }),
|
|
269
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
269
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Callout, { variant: "error", children: error }),
|
|
270
270
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
271
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
271
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
272
272
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
273
273
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
274
274
|
address.slice(0, 6),
|
|
@@ -335,14 +335,14 @@ function AssetSelectStep({
|
|
|
335
335
|
] })
|
|
336
336
|
] })
|
|
337
337
|
] }),
|
|
338
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ?
|
|
338
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunkZDYV536Qcjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
339
339
|
]
|
|
340
340
|
},
|
|
341
341
|
asset.id
|
|
342
342
|
);
|
|
343
343
|
}) }),
|
|
344
344
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
345
|
-
|
|
345
|
+
_chunkZDYV536Qcjs.Button,
|
|
346
346
|
{
|
|
347
347
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
348
348
|
disabled: !selectedAsset,
|
|
@@ -351,7 +351,7 @@ function AssetSelectStep({
|
|
|
351
351
|
}
|
|
352
352
|
)
|
|
353
353
|
] }),
|
|
354
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
354
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PoweredBy, {})
|
|
355
355
|
] });
|
|
356
356
|
}
|
|
357
357
|
async function fetchNativeAssets(address, publicClient, existing) {
|
|
@@ -359,7 +359,7 @@ async function fetchNativeAssets(address, publicClient, existing) {
|
|
|
359
359
|
const connectedChainId = _optionalChain([publicClient, 'access', _8 => _8.chain, 'optionalAccess', _9 => _9.id]);
|
|
360
360
|
if (!connectedChainId) return [];
|
|
361
361
|
if (!_chunkABVRVW3Pcjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
|
|
362
|
-
const id =
|
|
362
|
+
const id = _chunkZDYV536Qcjs.getAssetId.call(void 0, {
|
|
363
363
|
chainId: connectedChainId,
|
|
364
364
|
token: _chunkABVRVW3Pcjs.NATIVE_TOKEN_ADDRESS
|
|
365
365
|
});
|
|
@@ -556,7 +556,7 @@ function AmountStep({
|
|
|
556
556
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
557
557
|
if (!balanceTarget || !publicClient) return;
|
|
558
558
|
try {
|
|
559
|
-
const bal =
|
|
559
|
+
const bal = _chunkZDYV536Qcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
560
560
|
address: asset.token,
|
|
561
561
|
abi: _viem.erc20Abi,
|
|
562
562
|
functionName: "balanceOf",
|
|
@@ -577,7 +577,7 @@ function AmountStep({
|
|
|
577
577
|
hasAttemptedSwitch.current = true;
|
|
578
578
|
switchChain(asset.chainId).catch((err) => {
|
|
579
579
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
580
|
-
setError(
|
|
580
|
+
setError(_chunkZDYV536Qcjs.formatUserError.call(void 0, raw));
|
|
581
581
|
});
|
|
582
582
|
}
|
|
583
583
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -630,7 +630,7 @@ function AmountStep({
|
|
|
630
630
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
631
631
|
const numeric = Number(raw);
|
|
632
632
|
if (!Number.isFinite(numeric)) return raw;
|
|
633
|
-
return
|
|
633
|
+
return _chunkZDYV536Qcjs.tokenFormatter.format(numeric);
|
|
634
634
|
} catch (e8) {
|
|
635
635
|
return "\u2026";
|
|
636
636
|
}
|
|
@@ -751,7 +751,7 @@ function AmountStep({
|
|
|
751
751
|
const targetTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, targetSymbol);
|
|
752
752
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
753
753
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
754
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
754
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.WalletIcon, {}), title: "Wallet deposit" }),
|
|
755
755
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
756
756
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
757
757
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -771,13 +771,13 @@ function AmountStep({
|
|
|
771
771
|
" available",
|
|
772
772
|
balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
773
773
|
" (~",
|
|
774
|
-
|
|
774
|
+
_chunkZDYV536Qcjs.currencyFormatter.format(balanceUsd),
|
|
775
775
|
")"
|
|
776
776
|
] })
|
|
777
777
|
] }),
|
|
778
778
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
779
779
|
"Min. deposit ",
|
|
780
|
-
|
|
780
|
+
_chunkZDYV536Qcjs.currencyFormatter.format(minDepositUsd)
|
|
781
781
|
] })
|
|
782
782
|
] })
|
|
783
783
|
] }),
|
|
@@ -818,13 +818,13 @@ function AmountStep({
|
|
|
818
818
|
] }),
|
|
819
819
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
820
820
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
821
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
821
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkZDYV536Qcjs.currencyFormatter.format(balanceAfterUsd) })
|
|
822
822
|
] })
|
|
823
823
|
] }),
|
|
824
|
-
targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
825
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
824
|
+
targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
|
|
825
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Callout, { variant: "error", children: error }),
|
|
826
826
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
827
|
-
|
|
827
|
+
_chunkZDYV536Qcjs.Button,
|
|
828
828
|
{
|
|
829
829
|
onClick: handleContinue,
|
|
830
830
|
fullWidth: true,
|
|
@@ -835,7 +835,7 @@ function AmountStep({
|
|
|
835
835
|
}
|
|
836
836
|
)
|
|
837
837
|
] }),
|
|
838
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
838
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PoweredBy, {})
|
|
839
839
|
] });
|
|
840
840
|
}
|
|
841
841
|
|
|
@@ -882,16 +882,16 @@ function ConfirmStep({
|
|
|
882
882
|
const targetChainIcon = _chunkABVRVW3Pcjs.getChainIcon.call(void 0, targetChain);
|
|
883
883
|
const sourceTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, asset.symbol);
|
|
884
884
|
const targetTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, targetSymbol);
|
|
885
|
-
const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? _nullishCoalesce(
|
|
885
|
+
const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? _nullishCoalesce(_chunkZDYV536Qcjs.formatTokenAmount.call(void 0, Number(amount), asset.symbol), () => ( "0")) : "0";
|
|
886
886
|
const receiveDisplay = (() => {
|
|
887
887
|
if (sameRoute) return `${formattedSendAmount} ${asset.symbol}`;
|
|
888
888
|
if (quote) {
|
|
889
|
-
const quoted =
|
|
889
|
+
const quoted = _chunkZDYV536Qcjs.formatQuotedReceive.call(void 0, quote.output, targetSymbol);
|
|
890
890
|
if (quoted !== void 0) return quoted;
|
|
891
891
|
}
|
|
892
892
|
const usdValue = Number(targetAmount);
|
|
893
893
|
const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
|
|
894
|
-
const estimate =
|
|
894
|
+
const estimate = _chunkZDYV536Qcjs.formatReceiveEstimate.call(void 0, {
|
|
895
895
|
sourceAmount: Number.isFinite(Number(amount)) ? Number(amount) : void 0,
|
|
896
896
|
sourceSymbol: asset.symbol,
|
|
897
897
|
targetSymbol,
|
|
@@ -910,7 +910,7 @@ function ConfirmStep({
|
|
|
910
910
|
hasAttemptedSwitch.current = true;
|
|
911
911
|
switchChain(asset.chainId).catch((err) => {
|
|
912
912
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
913
|
-
setError(
|
|
913
|
+
setError(_chunkZDYV536Qcjs.formatUserError.call(void 0, raw));
|
|
914
914
|
});
|
|
915
915
|
}
|
|
916
916
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -990,7 +990,7 @@ function ConfirmStep({
|
|
|
990
990
|
const result = await executeTransfer(amountUnits);
|
|
991
991
|
hash = result.txHash;
|
|
992
992
|
resolvedSourceToken = result.sourceToken;
|
|
993
|
-
} else if (
|
|
993
|
+
} else if (_chunkZDYV536Qcjs.isNativeAsset.call(void 0, asset)) {
|
|
994
994
|
hash = await walletClient.sendTransaction({
|
|
995
995
|
account,
|
|
996
996
|
chain,
|
|
@@ -1011,7 +1011,7 @@ function ConfirmStep({
|
|
|
1011
1011
|
onConfirm(hash, asset.chainId, amountUnits.toString(), resolvedSourceToken);
|
|
1012
1012
|
} catch (err) {
|
|
1013
1013
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
1014
|
-
const message =
|
|
1014
|
+
const message = _chunkZDYV536Qcjs.formatUserError.call(void 0, raw);
|
|
1015
1015
|
setError(message);
|
|
1016
1016
|
_optionalChain([onError, 'optionalCall', _29 => _29(message, "TRANSFER_ERROR")]);
|
|
1017
1017
|
} finally {
|
|
@@ -1020,7 +1020,7 @@ function ConfirmStep({
|
|
|
1020
1020
|
};
|
|
1021
1021
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
1022
1022
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
1023
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1023
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.WalletIcon, {}), title: "Review deposit" }),
|
|
1024
1024
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
|
|
1025
1025
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1026
1026
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
@@ -1074,14 +1074,14 @@ function ConfirmStep({
|
|
|
1074
1074
|
children: feeDisplay
|
|
1075
1075
|
}
|
|
1076
1076
|
),
|
|
1077
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1077
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.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, _chunkZDYV536Qcjs.InfoIcon, {}) }) })
|
|
1078
1078
|
] })
|
|
1079
1079
|
] })
|
|
1080
1080
|
] }),
|
|
1081
|
-
targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1082
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1081
|
+
targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
|
|
1082
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Callout, { variant: "error", children: error }),
|
|
1083
1083
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1084
|
-
|
|
1084
|
+
_chunkZDYV536Qcjs.Button,
|
|
1085
1085
|
{
|
|
1086
1086
|
onClick: handleConfirm,
|
|
1087
1087
|
loading: isSubmitting,
|
|
@@ -1092,7 +1092,7 @@ function ConfirmStep({
|
|
|
1092
1092
|
}
|
|
1093
1093
|
)
|
|
1094
1094
|
] }),
|
|
1095
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1095
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PoweredBy, {})
|
|
1096
1096
|
] });
|
|
1097
1097
|
}
|
|
1098
1098
|
|
|
@@ -1115,9 +1115,9 @@ var INITIAL_POLL_INTERVAL = 3e3;
|
|
|
1115
1115
|
var MAX_POLL_INTERVAL = 3e4;
|
|
1116
1116
|
var BACKOFF_MULTIPLIER = 1.5;
|
|
1117
1117
|
function isEventForTx(event, txHash) {
|
|
1118
|
-
const eventTxHash =
|
|
1118
|
+
const eventTxHash = _chunkZDYV536Qcjs.getEventTxHash.call(void 0, event);
|
|
1119
1119
|
if (!eventTxHash) return false;
|
|
1120
|
-
return
|
|
1120
|
+
return _chunkZDYV536Qcjs.txRefsMatch.call(void 0, eventTxHash, txHash);
|
|
1121
1121
|
}
|
|
1122
1122
|
function truncateHash(hash) {
|
|
1123
1123
|
return `${hash.slice(0, 4)}\u2026${hash.slice(-4)}`;
|
|
@@ -1167,14 +1167,13 @@ function formatBridgeFailedMessage(event) {
|
|
|
1167
1167
|
}
|
|
1168
1168
|
return "Bridge failed";
|
|
1169
1169
|
}
|
|
1170
|
-
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1170
|
+
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.ExternalLinkIcon, { className: "rs-deposit-notification-link-icon" });
|
|
1171
1171
|
function DepositNotification({
|
|
1172
1172
|
deposit,
|
|
1173
1173
|
smartAccount,
|
|
1174
1174
|
solanaDepositAddress,
|
|
1175
1175
|
targetChain,
|
|
1176
1176
|
targetToken,
|
|
1177
|
-
hasPostBridgeActions,
|
|
1178
1177
|
service,
|
|
1179
1178
|
onComplete,
|
|
1180
1179
|
onFailed,
|
|
@@ -1202,17 +1201,16 @@ function DepositNotification({
|
|
|
1202
1201
|
const pollIntervalRef = _react.useRef.call(void 0, INITIAL_POLL_INTERVAL);
|
|
1203
1202
|
const pollTimeoutRef = _react.useRef.call(void 0, null);
|
|
1204
1203
|
const completedRef = _react.useRef.call(void 0, _nullishCoalesce(directTransfer, () => ( false)));
|
|
1205
|
-
const depositContextRef =
|
|
1204
|
+
const depositContextRef = _chunkZDYV536Qcjs.useLatestRef.call(void 0, {
|
|
1206
1205
|
amount,
|
|
1207
1206
|
sourceChain,
|
|
1208
1207
|
sourceToken: token,
|
|
1209
1208
|
sourceDecimals,
|
|
1210
1209
|
targetChain,
|
|
1211
|
-
targetToken
|
|
1212
|
-
hasPostBridgeActions
|
|
1210
|
+
targetToken
|
|
1213
1211
|
});
|
|
1214
|
-
const onCompleteRef =
|
|
1215
|
-
const onFailedRef =
|
|
1212
|
+
const onCompleteRef = _chunkZDYV536Qcjs.useLatestRef.call(void 0, onComplete);
|
|
1213
|
+
const onFailedRef = _chunkZDYV536Qcjs.useLatestRef.call(void 0, onFailed);
|
|
1216
1214
|
const handleComplete = _react.useCallback.call(void 0,
|
|
1217
1215
|
(destTxHash) => {
|
|
1218
1216
|
if (completedRef.current) return;
|
|
@@ -1255,27 +1253,17 @@ function DepositNotification({
|
|
|
1255
1253
|
if (!isMounted) return;
|
|
1256
1254
|
const lastEvent = data.lastEvent;
|
|
1257
1255
|
const eventForTx = isEventForTx(lastEvent, txHash) ? lastEvent : void 0;
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
const swapTxHash = _optionalChain([eventForTx, 'access', _36 => _36.data, 'optionalAccess', _37 => _37.swap, 'optionalAccess', _38 => _38.transactionHash]);
|
|
1261
|
-
handleComplete(swapTxHash);
|
|
1262
|
-
return;
|
|
1263
|
-
}
|
|
1264
|
-
if (_optionalChain([eventForTx, 'optionalAccess', _39 => _39.type]) === "post-bridge-swap-failed") {
|
|
1265
|
-
handleFailed(formatBridgeFailedMessage(eventForTx));
|
|
1266
|
-
return;
|
|
1267
|
-
}
|
|
1268
|
-
if (_optionalChain([eventForTx, 'optionalAccess', _40 => _40.type]) === "bridge-complete" && !awaitingPostBridgeSwap) {
|
|
1269
|
-
const destTx = _optionalChain([eventForTx, 'access', _41 => _41.data, 'optionalAccess', _42 => _42.destination, 'optionalAccess', _43 => _43.transactionHash]);
|
|
1256
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _35 => _35.type]) === "bridge-complete") {
|
|
1257
|
+
const destTx = _optionalChain([eventForTx, 'access', _36 => _36.data, 'optionalAccess', _37 => _37.destination, 'optionalAccess', _38 => _38.transactionHash]);
|
|
1270
1258
|
handleComplete(destTx);
|
|
1271
1259
|
return;
|
|
1272
1260
|
}
|
|
1273
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
1261
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _39 => _39.type]) === "bridge-failed") {
|
|
1274
1262
|
handleFailed(formatBridgeFailedMessage(eventForTx));
|
|
1275
1263
|
return;
|
|
1276
1264
|
}
|
|
1277
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
1278
|
-
const errorMessage = _nullishCoalesce(_optionalChain([eventForTx, 'access',
|
|
1265
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _40 => _40.type]) === "error") {
|
|
1266
|
+
const errorMessage = _nullishCoalesce(_optionalChain([eventForTx, 'access', _41 => _41.data, 'optionalAccess', _42 => _42.message]), () => ( "Unknown error"));
|
|
1279
1267
|
handleFailed(errorMessage);
|
|
1280
1268
|
return;
|
|
1281
1269
|
}
|
|
@@ -1317,7 +1305,7 @@ function DepositNotification({
|
|
|
1317
1305
|
const destExplorerUrl = destinationTxHash ? _chunkABVRVW3Pcjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
|
|
1318
1306
|
const title = status === "complete" ? "Deposit completed" : status === "failed" ? "Deposit failed" : "Deposit received and processing\u2026";
|
|
1319
1307
|
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.";
|
|
1320
|
-
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,
|
|
1308
|
+
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, _chunkZDYV536Qcjs.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, _chunkZDYV536Qcjs.CloseIcon, {}) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--processing", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1321
1309
|
"svg",
|
|
1322
1310
|
{
|
|
1323
1311
|
className: "rs-deposit-notification-spinner",
|
|
@@ -1367,7 +1355,7 @@ function DepositNotification({
|
|
|
1367
1355
|
className: "rs-deposit-notification-close",
|
|
1368
1356
|
onClick: () => onDismiss(deposit.id),
|
|
1369
1357
|
"aria-label": "Dismiss",
|
|
1370
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1358
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.CloseIcon, {})
|
|
1371
1359
|
}
|
|
1372
1360
|
)
|
|
1373
1361
|
] }),
|
|
@@ -1383,7 +1371,7 @@ function DepositNotification({
|
|
|
1383
1371
|
"aria-expanded": expanded,
|
|
1384
1372
|
children: [
|
|
1385
1373
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: expanded ? "See less details" : "See more details" }),
|
|
1386
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1374
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.ChevronDownIcon, { className: "rs-deposit-notification-toggle-chevron" })
|
|
1387
1375
|
]
|
|
1388
1376
|
}
|
|
1389
1377
|
),
|
|
@@ -1484,7 +1472,7 @@ function resolveSolanaTokenMeta(token) {
|
|
|
1484
1472
|
return {};
|
|
1485
1473
|
}
|
|
1486
1474
|
function getDepositEventDetails(event) {
|
|
1487
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
1475
|
+
if (!_optionalChain([event, 'optionalAccess', _43 => _43.type]) || !isRecord(event.data)) return {};
|
|
1488
1476
|
if (event.type === "deposit-received") {
|
|
1489
1477
|
const chainId = asChainId(event.data.chain);
|
|
1490
1478
|
const token = asString(event.data.token);
|
|
@@ -1499,12 +1487,12 @@ function getDepositEventDetails(event) {
|
|
|
1499
1487
|
const source = isRecord(event.data.source) ? event.data.source : void 0;
|
|
1500
1488
|
const deposit = isRecord(event.data.deposit) ? event.data.deposit : void 0;
|
|
1501
1489
|
if (source || deposit) {
|
|
1502
|
-
const chainId = _nullishCoalesce(asChainId(_optionalChain([source, 'optionalAccess',
|
|
1503
|
-
const token = _nullishCoalesce(_nullishCoalesce(asString(_optionalChain([source, 'optionalAccess',
|
|
1490
|
+
const chainId = _nullishCoalesce(asChainId(_optionalChain([source, 'optionalAccess', _44 => _44.chain])), () => ( asChainId(_optionalChain([deposit, 'optionalAccess', _45 => _45.chain]))));
|
|
1491
|
+
const token = _nullishCoalesce(_nullishCoalesce(asString(_optionalChain([source, 'optionalAccess', _46 => _46.asset])), () => ( asString(_optionalChain([deposit, 'optionalAccess', _47 => _47.asset])))), () => ( asString(_optionalChain([deposit, 'optionalAccess', _48 => _48.token]))));
|
|
1504
1492
|
const solanaMeta = chainId === "solana" ? resolveSolanaTokenMeta(token) : {};
|
|
1505
1493
|
return {
|
|
1506
1494
|
chainId,
|
|
1507
|
-
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess',
|
|
1495
|
+
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess', _49 => _49.amount])), () => ( asAmount(_optionalChain([deposit, 'optionalAccess', _50 => _50.amount])))),
|
|
1508
1496
|
token,
|
|
1509
1497
|
...solanaMeta
|
|
1510
1498
|
};
|
|
@@ -1530,7 +1518,6 @@ function DepositAddressStep({
|
|
|
1530
1518
|
allowedRoutes,
|
|
1531
1519
|
targetChain,
|
|
1532
1520
|
targetToken,
|
|
1533
|
-
hasPostBridgeActions,
|
|
1534
1521
|
uiConfig,
|
|
1535
1522
|
onDepositSubmitted,
|
|
1536
1523
|
onDepositComplete,
|
|
@@ -1540,12 +1527,12 @@ function DepositAddressStep({
|
|
|
1540
1527
|
}) {
|
|
1541
1528
|
const hasSolana = Boolean(solanaDepositAddress);
|
|
1542
1529
|
const allowedChainSet = _react.useMemo.call(void 0,
|
|
1543
|
-
() => _optionalChain([allowedRoutes, 'optionalAccess',
|
|
1544
|
-
[_optionalChain([allowedRoutes, 'optionalAccess',
|
|
1530
|
+
() => _optionalChain([allowedRoutes, 'optionalAccess', _51 => _51.sourceChains]) ? new Set(allowedRoutes.sourceChains) : null,
|
|
1531
|
+
[_optionalChain([allowedRoutes, 'optionalAccess', _52 => _52.sourceChains])]
|
|
1545
1532
|
);
|
|
1546
1533
|
const allowedTokenSet = _react.useMemo.call(void 0,
|
|
1547
|
-
() => _optionalChain([allowedRoutes, 'optionalAccess',
|
|
1548
|
-
[_optionalChain([allowedRoutes, 'optionalAccess',
|
|
1534
|
+
() => _optionalChain([allowedRoutes, 'optionalAccess', _53 => _53.sourceTokens]) ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null,
|
|
1535
|
+
[_optionalChain([allowedRoutes, 'optionalAccess', _54 => _54.sourceTokens])]
|
|
1549
1536
|
);
|
|
1550
1537
|
const evmChainIds = _react.useMemo.call(void 0, () => {
|
|
1551
1538
|
const all = _chunkABVRVW3Pcjs.getSupportedChainIds.call(void 0, );
|
|
@@ -1637,8 +1624,8 @@ function DepositAddressStep({
|
|
|
1637
1624
|
function handlePointerDown(event) {
|
|
1638
1625
|
const target = event.target;
|
|
1639
1626
|
if (!target) return;
|
|
1640
|
-
const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access',
|
|
1641
|
-
const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access',
|
|
1627
|
+
const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access', _55 => _55.current, 'optionalAccess', _56 => _56.contains, 'call', _57 => _57(target)]);
|
|
1628
|
+
const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access', _58 => _58.current, 'optionalAccess', _59 => _59.contains, 'call', _60 => _60(target)]);
|
|
1642
1629
|
if (clickedChainDropdown || clickedTokenDropdown) return;
|
|
1643
1630
|
setChainDropdownOpen(false);
|
|
1644
1631
|
setTokenDropdownOpen(false);
|
|
@@ -1651,7 +1638,7 @@ function DepositAddressStep({
|
|
|
1651
1638
|
};
|
|
1652
1639
|
}, [chainDropdownOpen, tokenDropdownOpen]);
|
|
1653
1640
|
const handleCopy = _react.useCallback.call(void 0, async () => {
|
|
1654
|
-
_optionalChain([onCopyAddress, 'optionalCall',
|
|
1641
|
+
_optionalChain([onCopyAddress, 'optionalCall', _61 => _61()]);
|
|
1655
1642
|
try {
|
|
1656
1643
|
await navigator.clipboard.writeText(displayAddress);
|
|
1657
1644
|
setCopied(true);
|
|
@@ -1730,10 +1717,10 @@ function DepositAddressStep({
|
|
|
1730
1717
|
return;
|
|
1731
1718
|
}
|
|
1732
1719
|
const event = status.lastEvent;
|
|
1733
|
-
const eventTxHash =
|
|
1720
|
+
const eventTxHash = _chunkZDYV536Qcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkZDYV536Qcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
1734
1721
|
if (baselineTxHashRef.current === void 0) {
|
|
1735
1722
|
baselineTxHashRef.current = eventTxHash;
|
|
1736
|
-
} else if (eventTxHash && (!baselineTxHashRef.current || !
|
|
1723
|
+
} else if (eventTxHash && (!baselineTxHashRef.current || !_chunkZDYV536Qcjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
|
|
1737
1724
|
const details = getDepositEventDetails(event);
|
|
1738
1725
|
const chainId = _nullishCoalesce(details.chainId, () => ( "unknown"));
|
|
1739
1726
|
const amount = _nullishCoalesce(details.amount, () => ( "0"));
|
|
@@ -1765,7 +1752,7 @@ function DepositAddressStep({
|
|
|
1765
1752
|
directTransfer
|
|
1766
1753
|
};
|
|
1767
1754
|
setNotifications((prev) => [notification, ...prev]);
|
|
1768
|
-
_optionalChain([onDepositSubmittedRef, 'access',
|
|
1755
|
+
_optionalChain([onDepositSubmittedRef, 'access', _62 => _62.current, 'optionalCall', _63 => _63({
|
|
1769
1756
|
txHash: eventTxHash,
|
|
1770
1757
|
sourceChain: chainId,
|
|
1771
1758
|
amount,
|
|
@@ -1777,7 +1764,7 @@ function DepositAddressStep({
|
|
|
1777
1764
|
if (!cancelled) {
|
|
1778
1765
|
const msg = err instanceof Error ? err.message : "Failed to check status";
|
|
1779
1766
|
setPollingError(msg);
|
|
1780
|
-
_optionalChain([onErrorRef, 'access',
|
|
1767
|
+
_optionalChain([onErrorRef, 'access', _64 => _64.current, 'optionalCall', _65 => _65(msg, "STATUS_POLL_ERROR")]);
|
|
1781
1768
|
}
|
|
1782
1769
|
}
|
|
1783
1770
|
if (!cancelled) {
|
|
@@ -1793,14 +1780,14 @@ function DepositAddressStep({
|
|
|
1793
1780
|
const handleNotificationComplete = _react.useCallback.call(void 0,
|
|
1794
1781
|
(txHash, destinationTxHash, context) => {
|
|
1795
1782
|
isTrackingRef.current = false;
|
|
1796
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
1783
|
+
_optionalChain([onDepositCompleteRef, 'access', _66 => _66.current, 'optionalCall', _67 => _67(txHash, destinationTxHash, context)]);
|
|
1797
1784
|
},
|
|
1798
1785
|
[]
|
|
1799
1786
|
);
|
|
1800
1787
|
const handleNotificationFailed = _react.useCallback.call(void 0,
|
|
1801
1788
|
(txHash, error) => {
|
|
1802
1789
|
isTrackingRef.current = false;
|
|
1803
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
1790
|
+
_optionalChain([onDepositFailedRef, 'access', _68 => _68.current, 'optionalCall', _69 => _69(txHash, error)]);
|
|
1804
1791
|
},
|
|
1805
1792
|
[]
|
|
1806
1793
|
);
|
|
@@ -1810,7 +1797,7 @@ function DepositAddressStep({
|
|
|
1810
1797
|
const qrIconSrc = _chunkABVRVW3Pcjs.getChainIcon.call(void 0, sourceChainId);
|
|
1811
1798
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-step--with-notifications", children: [
|
|
1812
1799
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
1813
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1800
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
1814
1801
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", children: [
|
|
1815
1802
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", ref: chainDropdownRef, children: [
|
|
1816
1803
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
@@ -1834,7 +1821,7 @@ function DepositAddressStep({
|
|
|
1834
1821
|
}
|
|
1835
1822
|
),
|
|
1836
1823
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunkABVRVW3Pcjs.getChainName.call(void 0, sourceChainId) }),
|
|
1837
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1824
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
1838
1825
|
]
|
|
1839
1826
|
}
|
|
1840
1827
|
),
|
|
@@ -1864,9 +1851,9 @@ function DepositAddressStep({
|
|
|
1864
1851
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Supported token" }),
|
|
1865
1852
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
1866
1853
|
"Min.$",
|
|
1867
|
-
(targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID ? Math.max(_chunkABVRVW3Pcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
1868
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1869
|
-
|
|
1854
|
+
(targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID ? Math.max(_chunkABVRVW3Pcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _70 => _70.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _71 => _71.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
1855
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1856
|
+
_chunkZDYV536Qcjs.InfoIcon,
|
|
1870
1857
|
{
|
|
1871
1858
|
className: "rs-deposit-address-min-icon",
|
|
1872
1859
|
"aria-hidden": "true"
|
|
@@ -1894,7 +1881,7 @@ function DepositAddressStep({
|
|
|
1894
1881
|
}
|
|
1895
1882
|
),
|
|
1896
1883
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceTokenSymbol }),
|
|
1897
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1884
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
1898
1885
|
]
|
|
1899
1886
|
}
|
|
1900
1887
|
),
|
|
@@ -1945,7 +1932,7 @@ function DepositAddressStep({
|
|
|
1945
1932
|
className: "rs-deposit-address-copy",
|
|
1946
1933
|
onClick: handleCopy,
|
|
1947
1934
|
children: [
|
|
1948
|
-
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1935
|
+
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.CopyIcon, {}),
|
|
1949
1936
|
copied ? "Copied!" : "Copy address"
|
|
1950
1937
|
]
|
|
1951
1938
|
}
|
|
@@ -1953,7 +1940,7 @@ function DepositAddressStep({
|
|
|
1953
1940
|
]
|
|
1954
1941
|
}
|
|
1955
1942
|
),
|
|
1956
|
-
targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1943
|
+
targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Callout, { variant: "warning", children: "HyperCore's first deposit to a new account includes a ~1 USDC activation fee \u2014 send at least 1 USDC or it will fail." }),
|
|
1957
1944
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1958
1945
|
"div",
|
|
1959
1946
|
{
|
|
@@ -1971,16 +1958,16 @@ function DepositAddressStep({
|
|
|
1971
1958
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
|
|
1972
1959
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
|
|
1973
1960
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1974
|
-
|
|
1961
|
+
_chunkZDYV536Qcjs.Tooltip,
|
|
1975
1962
|
{
|
|
1976
1963
|
className: "rs-price-impact-info",
|
|
1977
1964
|
content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
|
|
1978
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1965
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.InfoIcon, { "aria-hidden": "true" })
|
|
1979
1966
|
}
|
|
1980
1967
|
)
|
|
1981
1968
|
] }),
|
|
1982
1969
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1983
|
-
|
|
1970
|
+
_chunkZDYV536Qcjs.ChevronDownIcon,
|
|
1984
1971
|
{
|
|
1985
1972
|
className: "rs-price-impact-chevron",
|
|
1986
1973
|
"aria-hidden": "true"
|
|
@@ -1991,29 +1978,29 @@ function DepositAddressStep({
|
|
|
1991
1978
|
),
|
|
1992
1979
|
/* @__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: [
|
|
1993
1980
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
1994
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1981
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PercentIcon, {}) }),
|
|
1995
1982
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
1996
1983
|
"Max slippage: ",
|
|
1997
1984
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.2%" })
|
|
1998
1985
|
] }),
|
|
1999
1986
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2000
|
-
|
|
1987
|
+
_chunkZDYV536Qcjs.Tooltip,
|
|
2001
1988
|
{
|
|
2002
1989
|
className: "rs-price-impact-info",
|
|
2003
1990
|
content: "Slippage accounts for price changes during execution. Slippage is adjusted per pair to ensure reliable execution.",
|
|
2004
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1991
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.InfoIcon, { "aria-hidden": "true" })
|
|
2005
1992
|
}
|
|
2006
1993
|
)
|
|
2007
1994
|
] }),
|
|
2008
1995
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
2009
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1996
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.ClockIcon, {}) }),
|
|
2010
1997
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
2011
1998
|
"Processing time: ",
|
|
2012
1999
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "< 1 min" })
|
|
2013
2000
|
] })
|
|
2014
2001
|
] }),
|
|
2015
2002
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
2016
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2003
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PlusCircleIcon, {}) }),
|
|
2017
2004
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
2018
2005
|
"Max deposit:",
|
|
2019
2006
|
" ",
|
|
@@ -2037,7 +2024,6 @@ function DepositAddressStep({
|
|
|
2037
2024
|
solanaDepositAddress,
|
|
2038
2025
|
targetChain,
|
|
2039
2026
|
targetToken,
|
|
2040
|
-
hasPostBridgeActions,
|
|
2041
2027
|
service,
|
|
2042
2028
|
onComplete: handleNotificationComplete,
|
|
2043
2029
|
onFailed: handleNotificationFailed,
|
|
@@ -2045,7 +2031,7 @@ function DepositAddressStep({
|
|
|
2045
2031
|
},
|
|
2046
2032
|
deposit.id
|
|
2047
2033
|
)) }),
|
|
2048
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2034
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PoweredBy, {})
|
|
2049
2035
|
] });
|
|
2050
2036
|
}
|
|
2051
2037
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -2053,6 +2039,20 @@ DepositAddressStep.displayName = "DepositAddressStep";
|
|
|
2053
2039
|
// src/components/steps/FiatOnrampStep.tsx
|
|
2054
2040
|
|
|
2055
2041
|
|
|
2042
|
+
// src/core/swapped.ts
|
|
2043
|
+
var SWAPPED_ORIGINS = [
|
|
2044
|
+
"https://connect.swapped.com",
|
|
2045
|
+
"https://sandbox.swapped.com",
|
|
2046
|
+
"https://widget.swapped.com"
|
|
2047
|
+
];
|
|
2048
|
+
var WIDGET_URL_EXPIRY_BUFFER_MS = 1e4;
|
|
2049
|
+
function isSwappedWidgetUrlFresh(res, now = Date.now()) {
|
|
2050
|
+
if (!res.expiresAt) return false;
|
|
2051
|
+
const expiry = Date.parse(res.expiresAt);
|
|
2052
|
+
if (!Number.isFinite(expiry)) return false;
|
|
2053
|
+
return expiry - now > WIDGET_URL_EXPIRY_BUFFER_MS;
|
|
2054
|
+
}
|
|
2055
|
+
|
|
2056
2056
|
// src/components/steps/SwappedIframeStep.tsx
|
|
2057
2057
|
|
|
2058
2058
|
|
|
@@ -2079,7 +2079,7 @@ function FinalisingDepositStep() {
|
|
|
2079
2079
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "rs-finalising-subtitle", children: "We are depositing your funds to the application." })
|
|
2080
2080
|
] })
|
|
2081
2081
|
] }),
|
|
2082
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2082
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PoweredBy, {})
|
|
2083
2083
|
] });
|
|
2084
2084
|
}
|
|
2085
2085
|
FinalisingDepositStep.displayName = "FinalisingDepositStep";
|
|
@@ -2109,7 +2109,7 @@ function SwappedOrderTracker({
|
|
|
2109
2109
|
];
|
|
2110
2110
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-swapped-tracker", children: [
|
|
2111
2111
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2112
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2112
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.HandCoinsIcon, {}), title }),
|
|
2113
2113
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ol", { className: "rs-swapped-tracker-steps", children: labels.map((label, idx) => {
|
|
2114
2114
|
const status = stepStates[idx];
|
|
2115
2115
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
@@ -2123,7 +2123,7 @@ function SwappedOrderTracker({
|
|
|
2123
2123
|
{
|
|
2124
2124
|
className: "rs-swapped-tracker-step-marker",
|
|
2125
2125
|
"aria-hidden": "true",
|
|
2126
|
-
children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2126
|
+
children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.CheckIcon, {}) : status === "failed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.CloseIcon, {}) : status === "active" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Spinner, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2127
2127
|
"svg",
|
|
2128
2128
|
{
|
|
2129
2129
|
className: "rs-swapped-tracker-step-ring",
|
|
@@ -2158,7 +2158,7 @@ function SwappedOrderTracker({
|
|
|
2158
2158
|
}
|
|
2159
2159
|
)
|
|
2160
2160
|
] }),
|
|
2161
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2161
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PoweredBy, {})
|
|
2162
2162
|
] });
|
|
2163
2163
|
}
|
|
2164
2164
|
function formatTrackerAmount(amount) {
|
|
@@ -2176,11 +2176,7 @@ var DEPOSIT_POLL_INTERVAL_MS = 2e3;
|
|
|
2176
2176
|
var DEPOSIT_POLL_FAST_INITIAL_DELAY_MS = 1e3;
|
|
2177
2177
|
var DEPOSIT_POLL_FAST_INTERVAL_MS = 500;
|
|
2178
2178
|
var IFRAME_LOAD_TIMEOUT_MS = 15e3;
|
|
2179
|
-
var SWAPPED_IFRAME_ORIGINS =
|
|
2180
|
-
"https://connect.swapped.com",
|
|
2181
|
-
"https://sandbox.swapped.com",
|
|
2182
|
-
"https://widget.swapped.com"
|
|
2183
|
-
]);
|
|
2179
|
+
var SWAPPED_IFRAME_ORIGINS = new Set(SWAPPED_ORIGINS);
|
|
2184
2180
|
var SWAPPED_TERMINAL_STATUSES = /* @__PURE__ */ new Set([
|
|
2185
2181
|
"order_completed",
|
|
2186
2182
|
"order_broadcasted"
|
|
@@ -2191,12 +2187,30 @@ var SWAPPED_STATUS_VALUES = /* @__PURE__ */ new Set([
|
|
|
2191
2187
|
"order_broadcasted",
|
|
2192
2188
|
"order_cancelled"
|
|
2193
2189
|
]);
|
|
2190
|
+
var SWAPPED_GO_BACK_KEY = "SWAPPED_GO_BACK";
|
|
2191
|
+
function parseMaybeJsonString(raw) {
|
|
2192
|
+
try {
|
|
2193
|
+
return JSON.parse(raw);
|
|
2194
|
+
} catch (e16) {
|
|
2195
|
+
return raw;
|
|
2196
|
+
}
|
|
2197
|
+
}
|
|
2198
|
+
function isSwappedGoBackMessage(raw) {
|
|
2199
|
+
let data = raw;
|
|
2200
|
+
if (typeof data === "string") {
|
|
2201
|
+
data = parseMaybeJsonString(data);
|
|
2202
|
+
}
|
|
2203
|
+
if (data === SWAPPED_GO_BACK_KEY) return true;
|
|
2204
|
+
if (!data || typeof data !== "object") return false;
|
|
2205
|
+
const obj = data;
|
|
2206
|
+
return obj.key === SWAPPED_GO_BACK_KEY || obj.type === SWAPPED_GO_BACK_KEY;
|
|
2207
|
+
}
|
|
2194
2208
|
function parseSwappedIframeMessage(raw) {
|
|
2195
2209
|
let data = raw;
|
|
2196
2210
|
if (typeof data === "string") {
|
|
2197
2211
|
try {
|
|
2198
2212
|
data = JSON.parse(data);
|
|
2199
|
-
} catch (
|
|
2213
|
+
} catch (e17) {
|
|
2200
2214
|
return null;
|
|
2201
2215
|
}
|
|
2202
2216
|
}
|
|
@@ -2211,6 +2225,7 @@ function parseSwappedIframeMessage(raw) {
|
|
|
2211
2225
|
return {
|
|
2212
2226
|
status: rawStatus,
|
|
2213
2227
|
orderId: _nullishCoalesce(asString2(inner.order_id), () => ( asString2(obj.orderId))),
|
|
2228
|
+
externalCustomerId: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(asString2(inner.external_customer_id), () => ( asString2(obj.external_customer_id))), () => ( asString2(inner.externalCustomerId))), () => ( asString2(obj.externalCustomerId))),
|
|
2214
2229
|
orderCrypto: _nullishCoalesce(asString2(inner.order_crypto), () => ( asString2(obj.orderCrypto))),
|
|
2215
2230
|
orderCryptoAmount: _nullishCoalesce(asString2(inner.order_crypto_amount), () => ( asString2(obj.orderCryptoAmount))),
|
|
2216
2231
|
transactionId: _nullishCoalesce(asString2(inner.transaction_id), () => ( asString2(obj.transactionId)))
|
|
@@ -2228,6 +2243,7 @@ function SwappedIframeStep({
|
|
|
2228
2243
|
onSwappedComplete,
|
|
2229
2244
|
onSwappedFailed,
|
|
2230
2245
|
onClose,
|
|
2246
|
+
onGoBack,
|
|
2231
2247
|
onError
|
|
2232
2248
|
}) {
|
|
2233
2249
|
const [widgetUrl, setWidgetUrl] = _react.useState.call(void 0, null);
|
|
@@ -2241,6 +2257,7 @@ function SwappedIframeStep({
|
|
|
2241
2257
|
const completeFiredRef = _react.useRef.call(void 0, false);
|
|
2242
2258
|
const failedFiredRef = _react.useRef.call(void 0, false);
|
|
2243
2259
|
const expectedOrderUuidRef = _react.useRef.call(void 0, null);
|
|
2260
|
+
const expectedExternalCustomerIdRef = _react.useRef.call(void 0, null);
|
|
2244
2261
|
const baselineDepositTxHashRef = _react.useRef.call(void 0, void 0);
|
|
2245
2262
|
const currentDepositTxHashRef = _react.useRef.call(void 0, null);
|
|
2246
2263
|
const fastDepositPollEnabledRef = _react.useRef.call(void 0, false);
|
|
@@ -2253,6 +2270,8 @@ function SwappedIframeStep({
|
|
|
2253
2270
|
onSwappedFailedRef.current = onSwappedFailed;
|
|
2254
2271
|
const onErrorRef = _react.useRef.call(void 0, onError);
|
|
2255
2272
|
onErrorRef.current = onError;
|
|
2273
|
+
const onGoBackRef = _react.useRef.call(void 0, onGoBack);
|
|
2274
|
+
onGoBackRef.current = onGoBack;
|
|
2256
2275
|
const loadUrlRef = _react.useRef.call(void 0, loadUrl);
|
|
2257
2276
|
loadUrlRef.current = loadUrl;
|
|
2258
2277
|
_react.useEffect.call(void 0, () => {
|
|
@@ -2264,6 +2283,7 @@ function SwappedIframeStep({
|
|
|
2264
2283
|
setLatestEvent(null);
|
|
2265
2284
|
setPhase("iframe");
|
|
2266
2285
|
expectedOrderUuidRef.current = null;
|
|
2286
|
+
expectedExternalCustomerIdRef.current = null;
|
|
2267
2287
|
completeFiredRef.current = false;
|
|
2268
2288
|
failedFiredRef.current = false;
|
|
2269
2289
|
baselineDepositTxHashRef.current = void 0;
|
|
@@ -2272,13 +2292,14 @@ function SwappedIframeStep({
|
|
|
2272
2292
|
loadUrlRef.current().then((res) => {
|
|
2273
2293
|
if (cancelled) return;
|
|
2274
2294
|
setWidgetUrl(res.url);
|
|
2295
|
+
expectedExternalCustomerIdRef.current = res.externalCustomerId;
|
|
2275
2296
|
const sep = res.externalCustomerId.indexOf(":");
|
|
2276
2297
|
expectedOrderUuidRef.current = sep >= 0 ? res.externalCustomerId.slice(sep + 1) : null;
|
|
2277
2298
|
}).catch((err) => {
|
|
2278
2299
|
if (cancelled) return;
|
|
2279
2300
|
const message = err instanceof Error ? err.message : loadErrorFallback;
|
|
2280
2301
|
setLoadError(message);
|
|
2281
|
-
_optionalChain([onErrorRef, 'access',
|
|
2302
|
+
_optionalChain([onErrorRef, 'access', _72 => _72.current, 'optionalCall', _73 => _73(message, loadErrorCode)]);
|
|
2282
2303
|
});
|
|
2283
2304
|
return () => {
|
|
2284
2305
|
cancelled = true;
|
|
@@ -2303,7 +2324,7 @@ function SwappedIframeStep({
|
|
|
2303
2324
|
if (isCurrentOrder) {
|
|
2304
2325
|
setOrderState(res);
|
|
2305
2326
|
}
|
|
2306
|
-
} catch (
|
|
2327
|
+
} catch (e18) {
|
|
2307
2328
|
}
|
|
2308
2329
|
if (!cancelled) {
|
|
2309
2330
|
timeoutId = setTimeout(poll, STATUS_POLL_INTERVAL_MS);
|
|
@@ -2324,14 +2345,14 @@ function SwappedIframeStep({
|
|
|
2324
2345
|
const status = await service.fetchLatestStatus(smartAccount);
|
|
2325
2346
|
if (cancelled) return;
|
|
2326
2347
|
const event = status.lastEvent;
|
|
2327
|
-
const eventTxHash =
|
|
2348
|
+
const eventTxHash = _chunkZDYV536Qcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkZDYV536Qcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
2328
2349
|
if (baselineDepositTxHashRef.current === void 0) {
|
|
2329
2350
|
baselineDepositTxHashRef.current = eventTxHash;
|
|
2330
|
-
} else if (eventTxHash && (!baselineDepositTxHashRef.current || !
|
|
2351
|
+
} else if (eventTxHash && (!baselineDepositTxHashRef.current || !_chunkZDYV536Qcjs.txRefsMatch.call(void 0, eventTxHash, baselineDepositTxHashRef.current))) {
|
|
2331
2352
|
currentDepositTxHashRef.current = eventTxHash;
|
|
2332
2353
|
setLatestEvent(_nullishCoalesce(event, () => ( null)));
|
|
2333
2354
|
}
|
|
2334
|
-
} catch (
|
|
2355
|
+
} catch (e19) {
|
|
2335
2356
|
}
|
|
2336
2357
|
if (!cancelled) {
|
|
2337
2358
|
const nextInterval = fastDepositPollEnabledRef.current ? DEPOSIT_POLL_FAST_INTERVAL_MS : DEPOSIT_POLL_INTERVAL_MS;
|
|
@@ -2352,32 +2373,39 @@ function SwappedIframeStep({
|
|
|
2352
2373
|
}, [service, smartAccount]);
|
|
2353
2374
|
_react.useEffect.call(void 0, () => {
|
|
2354
2375
|
if (fastDepositPollEnabledRef.current) return;
|
|
2355
|
-
const status = _optionalChain([orderState, 'optionalAccess',
|
|
2376
|
+
const status = _optionalChain([orderState, 'optionalAccess', _74 => _74.status]);
|
|
2356
2377
|
if (!status || !SWAPPED_TERMINAL_STATUSES.has(status)) return;
|
|
2357
2378
|
fastDepositPollEnabledRef.current = true;
|
|
2358
|
-
_optionalChain([rescheduleDepositPollRef, 'access',
|
|
2379
|
+
_optionalChain([rescheduleDepositPollRef, 'access', _75 => _75.current, 'optionalCall', _76 => _76(DEPOSIT_POLL_FAST_INITIAL_DELAY_MS)]);
|
|
2359
2380
|
}, [orderState]);
|
|
2360
2381
|
_react.useEffect.call(void 0, () => {
|
|
2361
2382
|
function onMessage(e) {
|
|
2362
2383
|
if (!SWAPPED_IFRAME_ORIGINS.has(e.origin)) return;
|
|
2363
|
-
if (e.source !== _optionalChain([iframeRef, 'access',
|
|
2384
|
+
if (e.source !== _optionalChain([iframeRef, 'access', _77 => _77.current, 'optionalAccess', _78 => _78.contentWindow])) return;
|
|
2385
|
+
if (isSwappedGoBackMessage(e.data)) {
|
|
2386
|
+
onGoBackRef.current();
|
|
2387
|
+
return;
|
|
2388
|
+
}
|
|
2364
2389
|
const parsed = parseSwappedIframeMessage(e.data);
|
|
2365
2390
|
if (!parsed) return;
|
|
2366
|
-
const
|
|
2367
|
-
|
|
2391
|
+
const ext = parsed.externalCustomerId;
|
|
2392
|
+
const expected = expectedExternalCustomerIdRef.current;
|
|
2393
|
+
if (!ext || !expected || ext.toLowerCase() !== expected.toLowerCase()) {
|
|
2368
2394
|
return;
|
|
2369
2395
|
}
|
|
2370
2396
|
setOrderState((prev) => ({
|
|
2371
|
-
|
|
2397
|
+
// Normalise to the uuid the backend poll also keys on, so orderState
|
|
2398
|
+
// is consistent regardless of which path set it.
|
|
2399
|
+
orderId: _nullishCoalesce(_nullishCoalesce(expectedOrderUuidRef.current, () => ( _optionalChain([prev, 'optionalAccess', _79 => _79.orderId]))), () => ( ext)),
|
|
2372
2400
|
status: parsed.status,
|
|
2373
|
-
orderCrypto: _nullishCoalesce(_nullishCoalesce(parsed.orderCrypto, () => ( _optionalChain([prev, 'optionalAccess',
|
|
2374
|
-
orderCryptoAmount: _nullishCoalesce(_nullishCoalesce(parsed.orderCryptoAmount, () => ( _optionalChain([prev, 'optionalAccess',
|
|
2375
|
-
transactionId: _nullishCoalesce(_nullishCoalesce(parsed.transactionId, () => ( _optionalChain([prev, 'optionalAccess',
|
|
2401
|
+
orderCrypto: _nullishCoalesce(_nullishCoalesce(parsed.orderCrypto, () => ( _optionalChain([prev, 'optionalAccess', _80 => _80.orderCrypto]))), () => ( null)),
|
|
2402
|
+
orderCryptoAmount: _nullishCoalesce(_nullishCoalesce(parsed.orderCryptoAmount, () => ( _optionalChain([prev, 'optionalAccess', _81 => _81.orderCryptoAmount]))), () => ( null)),
|
|
2403
|
+
transactionId: _nullishCoalesce(_nullishCoalesce(parsed.transactionId, () => ( _optionalChain([prev, 'optionalAccess', _82 => _82.transactionId]))), () => ( null)),
|
|
2376
2404
|
receivedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2377
|
-
paidAmountUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
2378
|
-
paidAmountEur: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
2379
|
-
onrampFeeUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
2380
|
-
paymentMethod: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
2405
|
+
paidAmountUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _83 => _83.paidAmountUsd]), () => ( null)),
|
|
2406
|
+
paidAmountEur: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _84 => _84.paidAmountEur]), () => ( null)),
|
|
2407
|
+
onrampFeeUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _85 => _85.onrampFeeUsd]), () => ( null)),
|
|
2408
|
+
paymentMethod: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _86 => _86.paymentMethod]), () => ( null))
|
|
2381
2409
|
}));
|
|
2382
2410
|
}
|
|
2383
2411
|
window.addEventListener("message", onMessage);
|
|
@@ -2389,17 +2417,17 @@ function SwappedIframeStep({
|
|
|
2389
2417
|
}
|
|
2390
2418
|
}, [phase, orderState]);
|
|
2391
2419
|
const stepStates = _react.useMemo.call(void 0,
|
|
2392
|
-
() => deriveStepStates(_nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
2420
|
+
() => deriveStepStates(_nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _87 => _87.status]), () => ( null)), latestEvent),
|
|
2393
2421
|
[orderState, latestEvent]
|
|
2394
2422
|
);
|
|
2395
2423
|
const terminalState = _react.useMemo.call(void 0, () => {
|
|
2396
|
-
if (
|
|
2424
|
+
if (_chunkZDYV536Qcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
|
|
2397
2425
|
return {
|
|
2398
2426
|
kind: "failed",
|
|
2399
|
-
message:
|
|
2427
|
+
message: _chunkZDYV536Qcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
|
|
2400
2428
|
};
|
|
2401
2429
|
}
|
|
2402
|
-
if (_optionalChain([orderState, 'optionalAccess',
|
|
2430
|
+
if (_optionalChain([orderState, 'optionalAccess', _88 => _88.status]) === "order_cancelled") {
|
|
2403
2431
|
const banner = bannerForStatus("order_cancelled", {});
|
|
2404
2432
|
return { kind: "cancelled", message: _nullishCoalesce(banner.detail, () => ( banner.title)) };
|
|
2405
2433
|
}
|
|
@@ -2407,30 +2435,30 @@ function SwappedIframeStep({
|
|
|
2407
2435
|
}, [latestEvent, orderState, bannerForStatus]);
|
|
2408
2436
|
_react.useEffect.call(void 0, () => {
|
|
2409
2437
|
if (completeFiredRef.current || failedFiredRef.current) return;
|
|
2410
|
-
const t = _optionalChain([latestEvent, 'optionalAccess',
|
|
2411
|
-
const isSuccess = t === "bridge-complete"
|
|
2438
|
+
const t = _optionalChain([latestEvent, 'optionalAccess', _89 => _89.type]);
|
|
2439
|
+
const isSuccess = t === "bridge-complete";
|
|
2412
2440
|
if (!isSuccess) return;
|
|
2413
2441
|
const txHash = currentDepositTxHashRef.current;
|
|
2414
2442
|
if (!txHash) return;
|
|
2415
2443
|
completeFiredRef.current = true;
|
|
2416
2444
|
onSwappedCompleteRef.current({
|
|
2417
2445
|
txHash,
|
|
2418
|
-
orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
2446
|
+
orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _90 => _90.orderCrypto]), () => ( null)),
|
|
2419
2447
|
// Base-unit source amount from the deposit row/event, consistent with the
|
|
2420
2448
|
// wallet/QR path. ProcessingStep + onLifecycle expect base units.
|
|
2421
|
-
amount: _nullishCoalesce(
|
|
2449
|
+
amount: _nullishCoalesce(_chunkZDYV536Qcjs.getEventSourceDetails.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0))).amount, () => ( null))
|
|
2422
2450
|
});
|
|
2423
2451
|
}, [latestEvent, orderState]);
|
|
2424
2452
|
_react.useEffect.call(void 0, () => {
|
|
2425
2453
|
if (failedFiredRef.current || completeFiredRef.current) return;
|
|
2426
|
-
if (!
|
|
2454
|
+
if (!_chunkZDYV536Qcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) return;
|
|
2427
2455
|
const txHash = currentDepositTxHashRef.current;
|
|
2428
2456
|
if (!txHash) return;
|
|
2429
2457
|
failedFiredRef.current = true;
|
|
2430
2458
|
setPhase("tracker");
|
|
2431
|
-
_optionalChain([onSwappedFailedRef, 'access',
|
|
2459
|
+
_optionalChain([onSwappedFailedRef, 'access', _91 => _91.current, 'optionalCall', _92 => _92(
|
|
2432
2460
|
txHash,
|
|
2433
|
-
|
|
2461
|
+
_chunkZDYV536Qcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
|
|
2434
2462
|
)]);
|
|
2435
2463
|
}, [latestEvent]);
|
|
2436
2464
|
if (phase === "tracker") {
|
|
@@ -2441,8 +2469,8 @@ function SwappedIframeStep({
|
|
|
2441
2469
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2442
2470
|
SwappedOrderTracker,
|
|
2443
2471
|
{
|
|
2444
|
-
amount: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
2445
|
-
currency: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
2472
|
+
amount: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _93 => _93.orderCryptoAmount]), () => ( null)),
|
|
2473
|
+
currency: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _94 => _94.orderCrypto]), () => ( "USDC")),
|
|
2446
2474
|
stepStates,
|
|
2447
2475
|
terminal: terminalState,
|
|
2448
2476
|
onRetry: () => setRetryToken((n) => n + 1),
|
|
@@ -2464,7 +2492,7 @@ function SwappedIframeStep({
|
|
|
2464
2492
|
}
|
|
2465
2493
|
)
|
|
2466
2494
|
] }),
|
|
2467
|
-
!loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2495
|
+
!loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Spinner, {}) }),
|
|
2468
2496
|
widgetUrl && !loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2469
2497
|
"iframe",
|
|
2470
2498
|
{
|
|
@@ -2479,11 +2507,11 @@ function SwappedIframeStep({
|
|
|
2479
2507
|
retryToken
|
|
2480
2508
|
)
|
|
2481
2509
|
] }) }),
|
|
2482
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2510
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PoweredBy, {})
|
|
2483
2511
|
] });
|
|
2484
2512
|
}
|
|
2485
2513
|
function deriveStepStates(swappedStatus, latestEvent) {
|
|
2486
|
-
if (
|
|
2514
|
+
if (_chunkZDYV536Qcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
|
|
2487
2515
|
return ["complete", "complete", "failed", "pending"];
|
|
2488
2516
|
}
|
|
2489
2517
|
if (swappedStatus === "order_cancelled") {
|
|
@@ -2491,7 +2519,7 @@ function deriveStepStates(swappedStatus, latestEvent) {
|
|
|
2491
2519
|
}
|
|
2492
2520
|
const step1Complete = swappedStatus === "order_completed" || swappedStatus === "order_broadcasted";
|
|
2493
2521
|
const step2Complete = latestEvent !== null;
|
|
2494
|
-
const step3Complete = _optionalChain([latestEvent, 'optionalAccess',
|
|
2522
|
+
const step3Complete = _optionalChain([latestEvent, 'optionalAccess', _95 => _95.type]) === "bridge-complete";
|
|
2495
2523
|
if (step3Complete) {
|
|
2496
2524
|
return ["complete", "complete", "complete", "pending"];
|
|
2497
2525
|
}
|
|
@@ -2537,18 +2565,27 @@ function FiatOnrampStep({
|
|
|
2537
2565
|
smartAccount,
|
|
2538
2566
|
service,
|
|
2539
2567
|
paymentMethod,
|
|
2568
|
+
consumePrefetchedUrl,
|
|
2540
2569
|
onSwappedComplete,
|
|
2541
2570
|
onSwappedFailed,
|
|
2542
2571
|
onClose,
|
|
2572
|
+
onGoBack,
|
|
2543
2573
|
onError
|
|
2544
2574
|
}) {
|
|
2545
2575
|
const loadUrl = _react.useCallback.call(void 0, async () => {
|
|
2546
|
-
const
|
|
2576
|
+
const prefetched = _optionalChain([consumePrefetchedUrl, 'optionalCall', _96 => _96(smartAccount, paymentMethod)]);
|
|
2577
|
+
if (prefetched) {
|
|
2578
|
+
try {
|
|
2579
|
+
const cached = await prefetched;
|
|
2580
|
+
if (isSwappedWidgetUrlFresh(cached)) return cached;
|
|
2581
|
+
} catch (e20) {
|
|
2582
|
+
}
|
|
2583
|
+
}
|
|
2584
|
+
return service.getSwappedWidgetUrl({
|
|
2547
2585
|
smartAccount,
|
|
2548
2586
|
method: paymentMethod
|
|
2549
2587
|
});
|
|
2550
|
-
|
|
2551
|
-
}, [service, smartAccount, paymentMethod]);
|
|
2588
|
+
}, [service, smartAccount, paymentMethod, consumePrefetchedUrl]);
|
|
2552
2589
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2553
2590
|
SwappedIframeStep,
|
|
2554
2591
|
{
|
|
@@ -2563,6 +2600,7 @@ function FiatOnrampStep({
|
|
|
2563
2600
|
onSwappedComplete,
|
|
2564
2601
|
onSwappedFailed,
|
|
2565
2602
|
onClose,
|
|
2603
|
+
onGoBack,
|
|
2566
2604
|
onError
|
|
2567
2605
|
}
|
|
2568
2606
|
);
|
|
@@ -2608,6 +2646,7 @@ function ExchangeConnectStep({
|
|
|
2608
2646
|
onSwappedComplete,
|
|
2609
2647
|
onSwappedFailed,
|
|
2610
2648
|
onClose,
|
|
2649
|
+
onGoBack,
|
|
2611
2650
|
onError
|
|
2612
2651
|
}) {
|
|
2613
2652
|
const loadUrl = _react.useCallback.call(void 0, async () => {
|
|
@@ -2631,6 +2670,7 @@ function ExchangeConnectStep({
|
|
|
2631
2670
|
onSwappedComplete,
|
|
2632
2671
|
onSwappedFailed,
|
|
2633
2672
|
onClose,
|
|
2673
|
+
onGoBack,
|
|
2634
2674
|
onError
|
|
2635
2675
|
}
|
|
2636
2676
|
);
|
|
@@ -2643,7 +2683,7 @@ ExchangeConnectStep.displayName = "ExchangeConnectStep";
|
|
|
2643
2683
|
function ExchangeLogo({ exchange }) {
|
|
2644
2684
|
const [failed, setFailed] = _react.useState.call(void 0, false);
|
|
2645
2685
|
if (!exchange.logoUrl || failed) {
|
|
2646
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2686
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.BankIcon, {});
|
|
2647
2687
|
}
|
|
2648
2688
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2649
2689
|
"img",
|
|
@@ -2678,7 +2718,7 @@ function ExchangeSelectStep({
|
|
|
2678
2718
|
const message = err instanceof Error ? err.message : "Failed to load exchanges";
|
|
2679
2719
|
setExchanges([]);
|
|
2680
2720
|
setError(message);
|
|
2681
|
-
_optionalChain([onError, 'optionalCall',
|
|
2721
|
+
_optionalChain([onError, 'optionalCall', _97 => _97(message, "SWAPPED_CONNECT_EXCHANGES_FAILED")]);
|
|
2682
2722
|
}).finally(() => {
|
|
2683
2723
|
if (!cancelled) setLoading(false);
|
|
2684
2724
|
});
|
|
@@ -2689,14 +2729,14 @@ function ExchangeSelectStep({
|
|
|
2689
2729
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-exchange-select", children: [
|
|
2690
2730
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2691
2731
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2692
|
-
|
|
2732
|
+
_chunkZDYV536Qcjs.BodyHeader,
|
|
2693
2733
|
{
|
|
2694
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2734
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.UnplugIcon, {}),
|
|
2695
2735
|
title: "Connect exchange",
|
|
2696
2736
|
subtitle: "Select an exchange to connect"
|
|
2697
2737
|
}
|
|
2698
2738
|
),
|
|
2699
|
-
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2739
|
+
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Spinner, {}) }),
|
|
2700
2740
|
!loading && error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: [
|
|
2701
2741
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state-title", children: "Couldn\u2019t load exchanges" }),
|
|
2702
2742
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2722,7 +2762,7 @@ function ExchangeSelectStep({
|
|
|
2722
2762
|
)
|
|
2723
2763
|
] }),
|
|
2724
2764
|
!loading && !error && exchanges.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-grid", children: exchanges.map((exchange) => {
|
|
2725
|
-
const brand =
|
|
2765
|
+
const brand = _chunkZDYV536Qcjs.getExchangeLogo.call(void 0, exchange.name, exchange.connection);
|
|
2726
2766
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2727
2767
|
"button",
|
|
2728
2768
|
{
|
|
@@ -2745,7 +2785,7 @@ function ExchangeSelectStep({
|
|
|
2745
2785
|
);
|
|
2746
2786
|
}) })
|
|
2747
2787
|
] }),
|
|
2748
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2788
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PoweredBy, {})
|
|
2749
2789
|
] });
|
|
2750
2790
|
}
|
|
2751
2791
|
ExchangeSelectStep.displayName = "ExchangeSelectStep";
|
|
@@ -2757,8 +2797,8 @@ function DepositAddressSkeleton({
|
|
|
2757
2797
|
uiConfig,
|
|
2758
2798
|
allowedRoutes
|
|
2759
2799
|
}) {
|
|
2760
|
-
const allowedChainSet = _optionalChain([allowedRoutes, 'optionalAccess',
|
|
2761
|
-
const allowedTokenSet = _optionalChain([allowedRoutes, 'optionalAccess',
|
|
2800
|
+
const allowedChainSet = _optionalChain([allowedRoutes, 'optionalAccess', _98 => _98.sourceChains]) ? new Set(allowedRoutes.sourceChains) : null;
|
|
2801
|
+
const allowedTokenSet = _optionalChain([allowedRoutes, 'optionalAccess', _99 => _99.sourceTokens]) ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null;
|
|
2762
2802
|
const evmChainIds = (() => {
|
|
2763
2803
|
const all = _chunkABVRVW3Pcjs.getSupportedChainIds.call(void 0, );
|
|
2764
2804
|
return allowedChainSet ? all.filter((id) => allowedChainSet.has(id)) : all;
|
|
@@ -2775,7 +2815,7 @@ function DepositAddressSkeleton({
|
|
|
2775
2815
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", "aria-busy": "true", children: [
|
|
2776
2816
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: "Preparing deposit details\u2026" }),
|
|
2777
2817
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
2778
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2818
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
2779
2819
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", "aria-hidden": "true", children: [
|
|
2780
2820
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
2781
2821
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
@@ -2789,7 +2829,7 @@ function DepositAddressSkeleton({
|
|
|
2789
2829
|
}
|
|
2790
2830
|
),
|
|
2791
2831
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainName }),
|
|
2792
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2832
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2793
2833
|
] })
|
|
2794
2834
|
] }),
|
|
2795
2835
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
@@ -2797,9 +2837,9 @@ function DepositAddressSkeleton({
|
|
|
2797
2837
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Supported token" }),
|
|
2798
2838
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
2799
2839
|
"Min.$",
|
|
2800
|
-
(_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
2801
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2802
|
-
|
|
2840
|
+
(_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _100 => _100.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
2841
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2842
|
+
_chunkZDYV536Qcjs.InfoIcon,
|
|
2803
2843
|
{
|
|
2804
2844
|
className: "rs-deposit-address-min-icon",
|
|
2805
2845
|
"aria-hidden": "true"
|
|
@@ -2817,7 +2857,7 @@ function DepositAddressSkeleton({
|
|
|
2817
2857
|
}
|
|
2818
2858
|
),
|
|
2819
2859
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: defaultToken }),
|
|
2820
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2860
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2821
2861
|
] })
|
|
2822
2862
|
] })
|
|
2823
2863
|
] }),
|
|
@@ -2838,7 +2878,7 @@ function DepositAddressSkeleton({
|
|
|
2838
2878
|
disabled: true,
|
|
2839
2879
|
"aria-hidden": "true",
|
|
2840
2880
|
children: [
|
|
2841
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2881
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.CopyIcon, {}),
|
|
2842
2882
|
"Copy address"
|
|
2843
2883
|
]
|
|
2844
2884
|
}
|
|
@@ -2851,16 +2891,16 @@ function DepositAddressSkeleton({
|
|
|
2851
2891
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
|
|
2852
2892
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
|
|
2853
2893
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2854
|
-
|
|
2894
|
+
_chunkZDYV536Qcjs.Tooltip,
|
|
2855
2895
|
{
|
|
2856
2896
|
className: "rs-price-impact-info",
|
|
2857
2897
|
content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
|
|
2858
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2898
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.InfoIcon, { "aria-hidden": "true" })
|
|
2859
2899
|
}
|
|
2860
2900
|
)
|
|
2861
2901
|
] }),
|
|
2862
2902
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2863
|
-
|
|
2903
|
+
_chunkZDYV536Qcjs.ChevronDownIcon,
|
|
2864
2904
|
{
|
|
2865
2905
|
className: "rs-price-impact-chevron",
|
|
2866
2906
|
"aria-hidden": "true"
|
|
@@ -2868,7 +2908,7 @@ function DepositAddressSkeleton({
|
|
|
2868
2908
|
)
|
|
2869
2909
|
] }) })
|
|
2870
2910
|
] }),
|
|
2871
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2911
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PoweredBy, {})
|
|
2872
2912
|
] });
|
|
2873
2913
|
}
|
|
2874
2914
|
DepositAddressSkeleton.displayName = "DepositAddressSkeleton";
|
|
@@ -2900,7 +2940,7 @@ function SolanaTokenSelectStep({
|
|
|
2900
2940
|
setError(null);
|
|
2901
2941
|
const portfolioBySymbol = {};
|
|
2902
2942
|
try {
|
|
2903
|
-
|
|
2943
|
+
_chunkZDYV536Qcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
|
|
2904
2944
|
solanaAddress
|
|
2905
2945
|
});
|
|
2906
2946
|
const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
|
|
@@ -2911,7 +2951,7 @@ function SolanaTokenSelectStep({
|
|
|
2911
2951
|
let parsed = 0n;
|
|
2912
2952
|
try {
|
|
2913
2953
|
parsed = BigInt(t.balance || "0");
|
|
2914
|
-
} catch (
|
|
2954
|
+
} catch (e21) {
|
|
2915
2955
|
parsed = 0n;
|
|
2916
2956
|
}
|
|
2917
2957
|
if (parsed <= 0n) continue;
|
|
@@ -2923,12 +2963,12 @@ function SolanaTokenSelectStep({
|
|
|
2923
2963
|
};
|
|
2924
2964
|
}
|
|
2925
2965
|
}
|
|
2926
|
-
|
|
2966
|
+
_chunkZDYV536Qcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
|
|
2927
2967
|
symbols: Object.keys(portfolioBySymbol)
|
|
2928
2968
|
});
|
|
2929
2969
|
} catch (err) {
|
|
2930
2970
|
if (!active) return;
|
|
2931
|
-
|
|
2971
|
+
_chunkZDYV536Qcjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
|
|
2932
2972
|
solanaAddress
|
|
2933
2973
|
});
|
|
2934
2974
|
setError(
|
|
@@ -2953,7 +2993,7 @@ function SolanaTokenSelectStep({
|
|
|
2953
2993
|
setTokenBalances(results);
|
|
2954
2994
|
setLoading(false);
|
|
2955
2995
|
const totalUsd = results.reduce((sum, r) => sum + r.balanceUsd, 0);
|
|
2956
|
-
_optionalChain([onTotalBalanceComputed, 'optionalCall',
|
|
2996
|
+
_optionalChain([onTotalBalanceComputed, 'optionalCall', _101 => _101(totalUsd)]);
|
|
2957
2997
|
}
|
|
2958
2998
|
void loadBalances();
|
|
2959
2999
|
return () => {
|
|
@@ -2975,8 +3015,8 @@ function SolanaTokenSelectStep({
|
|
|
2975
3015
|
const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
|
|
2976
3016
|
const numeric = Number(raw);
|
|
2977
3017
|
if (!Number.isFinite(numeric)) return raw;
|
|
2978
|
-
return
|
|
2979
|
-
} catch (
|
|
3018
|
+
return _chunkZDYV536Qcjs.tokenFormatter.format(numeric);
|
|
3019
|
+
} catch (e22) {
|
|
2980
3020
|
return "--";
|
|
2981
3021
|
}
|
|
2982
3022
|
};
|
|
@@ -2985,20 +3025,20 @@ function SolanaTokenSelectStep({
|
|
|
2985
3025
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
2986
3026
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
2987
3027
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2988
|
-
|
|
3028
|
+
_chunkZDYV536Qcjs.BodyHeader,
|
|
2989
3029
|
{
|
|
2990
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3030
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.WalletIcon, {}),
|
|
2991
3031
|
title: "Your assets",
|
|
2992
3032
|
subtitle: "Select source assets to transfer"
|
|
2993
3033
|
}
|
|
2994
3034
|
),
|
|
2995
3035
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
2996
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3036
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
2997
3037
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
2998
3038
|
] }),
|
|
2999
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3039
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Callout, { variant: "error", children: error }),
|
|
3000
3040
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
3001
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3041
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
3002
3042
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
3003
3043
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
3004
3044
|
solanaAddress.slice(0, 6),
|
|
@@ -3047,14 +3087,14 @@ function SolanaTokenSelectStep({
|
|
|
3047
3087
|
] })
|
|
3048
3088
|
] })
|
|
3049
3089
|
] }),
|
|
3050
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ?
|
|
3090
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunkZDYV536Qcjs.currencyFormatter.format(entry.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${entry.token.symbol}` : "--" })
|
|
3051
3091
|
]
|
|
3052
3092
|
},
|
|
3053
3093
|
entry.token.symbol
|
|
3054
3094
|
);
|
|
3055
3095
|
}) }),
|
|
3056
3096
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3057
|
-
|
|
3097
|
+
_chunkZDYV536Qcjs.Button,
|
|
3058
3098
|
{
|
|
3059
3099
|
onClick: () => selectedEntry && onContinue(
|
|
3060
3100
|
selectedEntry.token,
|
|
@@ -3067,7 +3107,7 @@ function SolanaTokenSelectStep({
|
|
|
3067
3107
|
}
|
|
3068
3108
|
)
|
|
3069
3109
|
] }),
|
|
3070
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3110
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PoweredBy, {})
|
|
3071
3111
|
] });
|
|
3072
3112
|
}
|
|
3073
3113
|
|
|
@@ -3100,7 +3140,7 @@ function SolanaAmountStep({
|
|
|
3100
3140
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
3101
3141
|
const hasAppliedDefaultRef = _react.useRef.call(void 0, false);
|
|
3102
3142
|
const isSourceStablecoin = _chunkABVRVW3Pcjs.isStablecoinSymbol.call(void 0, token.symbol);
|
|
3103
|
-
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess',
|
|
3143
|
+
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess', _102 => _102.trim, 'call', _103 => _103(), 'access', _104 => _104.toLowerCase, 'call', _105 => _105()]) === "max";
|
|
3104
3144
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
3105
3145
|
if (isSourceStablecoin) return 1;
|
|
3106
3146
|
try {
|
|
@@ -3110,7 +3150,7 @@ function SolanaAmountStep({
|
|
|
3110
3150
|
}
|
|
3111
3151
|
const price = balanceUsd / balanceUnits;
|
|
3112
3152
|
return price > 0 ? price : null;
|
|
3113
|
-
} catch (
|
|
3153
|
+
} catch (e23) {
|
|
3114
3154
|
return null;
|
|
3115
3155
|
}
|
|
3116
3156
|
}, [isSourceStablecoin, balance, token.decimals, balanceUsd]);
|
|
@@ -3120,8 +3160,8 @@ function SolanaAmountStep({
|
|
|
3120
3160
|
const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
|
|
3121
3161
|
const numeric = Number(raw);
|
|
3122
3162
|
if (!Number.isFinite(numeric)) return raw;
|
|
3123
|
-
return
|
|
3124
|
-
} catch (
|
|
3163
|
+
return _chunkZDYV536Qcjs.tokenFormatter.format(numeric);
|
|
3164
|
+
} catch (e24) {
|
|
3125
3165
|
return "\u2026";
|
|
3126
3166
|
}
|
|
3127
3167
|
}, [balance, token.decimals]);
|
|
@@ -3132,7 +3172,7 @@ function SolanaAmountStep({
|
|
|
3132
3172
|
if (tokenPriceUsd !== null) return balanceUnits * tokenPriceUsd;
|
|
3133
3173
|
if (Number.isFinite(balanceUsd) && balanceUsd > 0) return balanceUsd;
|
|
3134
3174
|
return null;
|
|
3135
|
-
} catch (
|
|
3175
|
+
} catch (e25) {
|
|
3136
3176
|
return null;
|
|
3137
3177
|
}
|
|
3138
3178
|
}, [balance, token.decimals, tokenPriceUsd, balanceUsd]);
|
|
@@ -3146,7 +3186,7 @@ function SolanaAmountStep({
|
|
|
3146
3186
|
if (!Number.isFinite(spendableUnits) || spendableUnits < 0) return null;
|
|
3147
3187
|
if (tokenPriceUsd !== null) return spendableUnits * tokenPriceUsd;
|
|
3148
3188
|
return null;
|
|
3149
|
-
} catch (
|
|
3189
|
+
} catch (e26) {
|
|
3150
3190
|
return null;
|
|
3151
3191
|
}
|
|
3152
3192
|
}, [spendableBalance, token.decimals, tokenPriceUsd]);
|
|
@@ -3161,7 +3201,7 @@ function SolanaAmountStep({
|
|
|
3161
3201
|
const factor = 1e3;
|
|
3162
3202
|
const truncated = Math.floor(value * factor) / factor;
|
|
3163
3203
|
return truncated.toFixed(3).replace(/\.?0+$/, "");
|
|
3164
|
-
} catch (
|
|
3204
|
+
} catch (e27) {
|
|
3165
3205
|
return "";
|
|
3166
3206
|
}
|
|
3167
3207
|
},
|
|
@@ -3198,12 +3238,12 @@ function SolanaAmountStep({
|
|
|
3198
3238
|
const raw = isSourceStablecoin || !hasPricing ? numericAmount : numericAmount / (_nullishCoalesce(tokenPriceUsd, () => ( 1)));
|
|
3199
3239
|
try {
|
|
3200
3240
|
return _viem.parseUnits.call(void 0, raw.toString(), token.decimals);
|
|
3201
|
-
} catch (
|
|
3241
|
+
} catch (e28) {
|
|
3202
3242
|
return null;
|
|
3203
3243
|
}
|
|
3204
3244
|
}, [numericAmount, isSourceStablecoin, hasPricing, tokenPriceUsd, token.decimals]);
|
|
3205
|
-
const minDepositUsd = targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID ? Math.max(_chunkABVRVW3Pcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3206
|
-
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3245
|
+
const minDepositUsd = targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID ? Math.max(_chunkABVRVW3Pcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _106 => _106.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _107 => _107.minDepositUsd]), () => ( null));
|
|
3246
|
+
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _108 => _108.maxDepositUsd]), () => ( null));
|
|
3207
3247
|
const isBelowMin = minDepositUsd !== null && numericAmount > 0 && numericAmount < minDepositUsd;
|
|
3208
3248
|
const isAboveMax = maxDepositUsd !== null && numericAmount > maxDepositUsd;
|
|
3209
3249
|
const exceedsBalance = Boolean(
|
|
@@ -3213,7 +3253,7 @@ function SolanaAmountStep({
|
|
|
3213
3253
|
const handlePresetClick = (percentage) => {
|
|
3214
3254
|
const formatted = computePresetAmount(percentage);
|
|
3215
3255
|
if (!formatted) return;
|
|
3216
|
-
|
|
3256
|
+
_chunkZDYV536Qcjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
|
|
3217
3257
|
percentage,
|
|
3218
3258
|
symbol: token.symbol,
|
|
3219
3259
|
formatted
|
|
@@ -3247,8 +3287,8 @@ function SolanaAmountStep({
|
|
|
3247
3287
|
let amountInUnits;
|
|
3248
3288
|
try {
|
|
3249
3289
|
amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
|
|
3250
|
-
} catch (
|
|
3251
|
-
|
|
3290
|
+
} catch (e29) {
|
|
3291
|
+
_chunkZDYV536Qcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
3252
3292
|
amount,
|
|
3253
3293
|
sourceAmount: sourceAmountStr,
|
|
3254
3294
|
reason: "parse-units-failed"
|
|
@@ -3263,7 +3303,7 @@ function SolanaAmountStep({
|
|
|
3263
3303
|
);
|
|
3264
3304
|
return;
|
|
3265
3305
|
}
|
|
3266
|
-
|
|
3306
|
+
_chunkZDYV536Qcjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
|
|
3267
3307
|
symbol: token.symbol,
|
|
3268
3308
|
inputAmountUsd: amount,
|
|
3269
3309
|
sourceAmount: sourceAmountStr,
|
|
@@ -3277,7 +3317,7 @@ function SolanaAmountStep({
|
|
|
3277
3317
|
const sourceTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, token.symbol);
|
|
3278
3318
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
3279
3319
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3280
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3320
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.WalletIcon, {}), title: "Wallet deposit" }),
|
|
3281
3321
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
3282
3322
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
3283
3323
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3297,13 +3337,13 @@ function SolanaAmountStep({
|
|
|
3297
3337
|
" available",
|
|
3298
3338
|
computedBalanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
3299
3339
|
" (~",
|
|
3300
|
-
|
|
3340
|
+
_chunkZDYV536Qcjs.currencyFormatter.format(computedBalanceUsd),
|
|
3301
3341
|
")"
|
|
3302
3342
|
] })
|
|
3303
3343
|
] }),
|
|
3304
3344
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
3305
3345
|
"Min. deposit ",
|
|
3306
|
-
|
|
3346
|
+
_chunkZDYV536Qcjs.currencyFormatter.format(minDepositUsd)
|
|
3307
3347
|
] })
|
|
3308
3348
|
] })
|
|
3309
3349
|
] }),
|
|
@@ -3342,13 +3382,13 @@ function SolanaAmountStep({
|
|
|
3342
3382
|
] }),
|
|
3343
3383
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
3344
3384
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
3345
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
3385
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkZDYV536Qcjs.currencyFormatter.format(balanceAfterUsd) })
|
|
3346
3386
|
] })
|
|
3347
3387
|
] }),
|
|
3348
|
-
targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3349
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3388
|
+
targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
|
|
3389
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Callout, { variant: "error", children: error }),
|
|
3350
3390
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3351
|
-
|
|
3391
|
+
_chunkZDYV536Qcjs.Button,
|
|
3352
3392
|
{
|
|
3353
3393
|
onClick: handleContinue,
|
|
3354
3394
|
fullWidth: true,
|
|
@@ -3357,7 +3397,7 @@ function SolanaAmountStep({
|
|
|
3357
3397
|
}
|
|
3358
3398
|
)
|
|
3359
3399
|
] }),
|
|
3360
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3400
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PoweredBy, {})
|
|
3361
3401
|
] });
|
|
3362
3402
|
}
|
|
3363
3403
|
|
|
@@ -3380,10 +3420,10 @@ var _spltoken = require('@solana/spl-token');
|
|
|
3380
3420
|
var DEFAULT_SOLANA_RPC_URL = "https://api.mainnet.solana.com";
|
|
3381
3421
|
var cachedConnections = /* @__PURE__ */ new Map();
|
|
3382
3422
|
function getSolanaRpcUrl(rpcUrls) {
|
|
3383
|
-
return _nullishCoalesce(
|
|
3423
|
+
return _nullishCoalesce(_chunkZDYV536Qcjs.rpcUrlFor.call(void 0, rpcUrls, "solana"), () => ( DEFAULT_SOLANA_RPC_URL));
|
|
3384
3424
|
}
|
|
3385
3425
|
function hasConfiguredSolanaRpcUrl(rpcUrls) {
|
|
3386
|
-
return
|
|
3426
|
+
return _chunkZDYV536Qcjs.rpcUrlFor.call(void 0, rpcUrls, "solana") !== void 0;
|
|
3387
3427
|
}
|
|
3388
3428
|
function getSolanaConnection(rpcUrls) {
|
|
3389
3429
|
const rpcUrl = getSolanaRpcUrl(rpcUrls);
|
|
@@ -3485,7 +3525,7 @@ function SolanaConfirmStep({
|
|
|
3485
3525
|
onError,
|
|
3486
3526
|
debug
|
|
3487
3527
|
}) {
|
|
3488
|
-
const rpcUrls =
|
|
3528
|
+
const rpcUrls = _chunkZDYV536Qcjs.useRpcUrls.call(void 0, );
|
|
3489
3529
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
3490
3530
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
3491
3531
|
const targetSymbol = _chunkABVRVW3Pcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
@@ -3495,13 +3535,13 @@ function SolanaConfirmStep({
|
|
|
3495
3535
|
const targetChainIcon = _chunkABVRVW3Pcjs.getChainIcon.call(void 0, targetChain);
|
|
3496
3536
|
const sourceTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, token.symbol);
|
|
3497
3537
|
const targetTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, targetSymbol);
|
|
3498
|
-
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3499
|
-
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3500
|
-
const formattedAmount = sourceAmount && Number.isFinite(Number(sourceAmount)) ? _nullishCoalesce(
|
|
3538
|
+
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _109 => _109.feeSponsored]), () => ( false));
|
|
3539
|
+
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _110 => _110.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
3540
|
+
const formattedAmount = sourceAmount && Number.isFinite(Number(sourceAmount)) ? _nullishCoalesce(_chunkZDYV536Qcjs.formatTokenAmount.call(void 0, Number(sourceAmount), token.symbol), () => ( "0")) : "0";
|
|
3501
3541
|
const receiveDisplay = (() => {
|
|
3502
3542
|
const usdValue = Number(targetAmount);
|
|
3503
3543
|
const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
|
|
3504
|
-
const estimate =
|
|
3544
|
+
const estimate = _chunkZDYV536Qcjs.formatReceiveEstimate.call(void 0, {
|
|
3505
3545
|
sourceAmount: Number.isFinite(Number(sourceAmount)) ? Number(sourceAmount) : void 0,
|
|
3506
3546
|
sourceSymbol: token.symbol,
|
|
3507
3547
|
targetSymbol,
|
|
@@ -3513,7 +3553,7 @@ function SolanaConfirmStep({
|
|
|
3513
3553
|
})();
|
|
3514
3554
|
const handleConfirm = async () => {
|
|
3515
3555
|
if (!solanaProvider) {
|
|
3516
|
-
|
|
3556
|
+
_chunkZDYV536Qcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
3517
3557
|
reason: "missing-provider"
|
|
3518
3558
|
});
|
|
3519
3559
|
setError("Solana wallet not connected");
|
|
@@ -3521,7 +3561,7 @@ function SolanaConfirmStep({
|
|
|
3521
3561
|
}
|
|
3522
3562
|
const parsedAmount = parseFloat(sourceAmount);
|
|
3523
3563
|
if (isNaN(parsedAmount) || parsedAmount <= 0) {
|
|
3524
|
-
|
|
3564
|
+
_chunkZDYV536Qcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
3525
3565
|
reason: "invalid-amount",
|
|
3526
3566
|
sourceAmount
|
|
3527
3567
|
});
|
|
@@ -3530,7 +3570,7 @@ function SolanaConfirmStep({
|
|
|
3530
3570
|
}
|
|
3531
3571
|
setError(null);
|
|
3532
3572
|
setIsSubmitting(true);
|
|
3533
|
-
|
|
3573
|
+
_chunkZDYV536Qcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
|
|
3534
3574
|
smartAccount,
|
|
3535
3575
|
solanaAddress,
|
|
3536
3576
|
solanaDepositAddress,
|
|
@@ -3540,7 +3580,7 @@ function SolanaConfirmStep({
|
|
|
3540
3580
|
});
|
|
3541
3581
|
try {
|
|
3542
3582
|
const check = await service.checkAccount(smartAccount);
|
|
3543
|
-
|
|
3583
|
+
_chunkZDYV536Qcjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
|
|
3544
3584
|
smartAccount,
|
|
3545
3585
|
isRegistered: check.isRegistered,
|
|
3546
3586
|
targetChain: check.targetChain,
|
|
@@ -3553,7 +3593,7 @@ function SolanaConfirmStep({
|
|
|
3553
3593
|
}
|
|
3554
3594
|
const connection = hasConfiguredSolanaRpcUrl(rpcUrls) ? getSolanaConnection(rpcUrls) : _nullishCoalesce(solanaConnection, () => ( getSolanaConnection(rpcUrls)));
|
|
3555
3595
|
const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
|
|
3556
|
-
|
|
3596
|
+
_chunkZDYV536Qcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
|
|
3557
3597
|
token: token.symbol,
|
|
3558
3598
|
sourceAmount,
|
|
3559
3599
|
amountUnits: amountUnits.toString()
|
|
@@ -3570,10 +3610,10 @@ function SolanaConfirmStep({
|
|
|
3570
3610
|
token.mint,
|
|
3571
3611
|
amountUnits
|
|
3572
3612
|
);
|
|
3573
|
-
|
|
3613
|
+
_chunkZDYV536Qcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
3574
3614
|
token: token.symbol,
|
|
3575
3615
|
instructionCount: transaction.instructions.length,
|
|
3576
|
-
feePayer: _optionalChain([transaction, 'access',
|
|
3616
|
+
feePayer: _optionalChain([transaction, 'access', _111 => _111.feePayer, 'optionalAccess', _112 => _112.toBase58, 'call', _113 => _113()]),
|
|
3577
3617
|
recentBlockhash: transaction.recentBlockhash
|
|
3578
3618
|
});
|
|
3579
3619
|
const txHash = await sendSolanaTransaction(
|
|
@@ -3581,28 +3621,28 @@ function SolanaConfirmStep({
|
|
|
3581
3621
|
connection,
|
|
3582
3622
|
transaction
|
|
3583
3623
|
);
|
|
3584
|
-
|
|
3624
|
+
_chunkZDYV536Qcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
|
|
3585
3625
|
txHash,
|
|
3586
3626
|
amountUnits: amountUnits.toString()
|
|
3587
3627
|
});
|
|
3588
3628
|
onConfirm(txHash, amountUnits.toString());
|
|
3589
3629
|
} catch (err) {
|
|
3590
3630
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
3591
|
-
const message =
|
|
3592
|
-
|
|
3631
|
+
const message = _chunkZDYV536Qcjs.formatUserError.call(void 0, raw);
|
|
3632
|
+
_chunkZDYV536Qcjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
|
|
3593
3633
|
smartAccount,
|
|
3594
3634
|
token: token.symbol,
|
|
3595
3635
|
sourceAmount
|
|
3596
3636
|
});
|
|
3597
3637
|
setError(message);
|
|
3598
|
-
_optionalChain([onError, 'optionalCall',
|
|
3638
|
+
_optionalChain([onError, 'optionalCall', _114 => _114(message, "SOLANA_TRANSFER_ERROR")]);
|
|
3599
3639
|
} finally {
|
|
3600
3640
|
setIsSubmitting(false);
|
|
3601
3641
|
}
|
|
3602
3642
|
};
|
|
3603
3643
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
3604
3644
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3605
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3645
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.WalletIcon, {}), title: "Review deposit" }),
|
|
3606
3646
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
|
|
3607
3647
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
3608
3648
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
@@ -3650,13 +3690,13 @@ function SolanaConfirmStep({
|
|
|
3650
3690
|
children: "$0.04"
|
|
3651
3691
|
}
|
|
3652
3692
|
),
|
|
3653
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3693
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.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, _chunkZDYV536Qcjs.InfoIcon, {}) }) })
|
|
3654
3694
|
] })
|
|
3655
3695
|
] })
|
|
3656
3696
|
] }),
|
|
3657
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3697
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Callout, { variant: "error", children: error }),
|
|
3658
3698
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3659
|
-
|
|
3699
|
+
_chunkZDYV536Qcjs.Button,
|
|
3660
3700
|
{
|
|
3661
3701
|
onClick: handleConfirm,
|
|
3662
3702
|
loading: isSubmitting,
|
|
@@ -3667,7 +3707,7 @@ function SolanaConfirmStep({
|
|
|
3667
3707
|
}
|
|
3668
3708
|
)
|
|
3669
3709
|
] }),
|
|
3670
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3710
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PoweredBy, {})
|
|
3671
3711
|
] });
|
|
3672
3712
|
}
|
|
3673
3713
|
|
|
@@ -3681,18 +3721,18 @@ function DappImportAssetSelectStep({
|
|
|
3681
3721
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
3682
3722
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3683
3723
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3684
|
-
|
|
3724
|
+
_chunkZDYV536Qcjs.BodyHeader,
|
|
3685
3725
|
{
|
|
3686
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3726
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.WalletIcon, {}),
|
|
3687
3727
|
title: `Transfer from ${sourceLabel}`,
|
|
3688
3728
|
subtitle: "Pick the balance to import"
|
|
3689
3729
|
}
|
|
3690
3730
|
),
|
|
3691
3731
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: assets.map((asset) => {
|
|
3692
|
-
const tokenAmount = asset.balance ?
|
|
3732
|
+
const tokenAmount = asset.balance ? _chunkZDYV536Qcjs.tokenFormatter.format(
|
|
3693
3733
|
Number(asset.balance) / 10 ** asset.decimals
|
|
3694
3734
|
) : "0";
|
|
3695
|
-
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ?
|
|
3735
|
+
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ? _chunkZDYV536Qcjs.currencyFormatter.format(asset.balanceUsd) : `${tokenAmount} ${asset.symbol}`;
|
|
3696
3736
|
const tokenIcon = _nullishCoalesce(asset.icon, () => ( _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, asset.symbol)));
|
|
3697
3737
|
const chainIcon = _chunkABVRVW3Pcjs.getChainIcon.call(void 0, asset.chainId);
|
|
3698
3738
|
const badge = _chunkABVRVW3Pcjs.getChainBadge.call(void 0, asset.chainId);
|
|
@@ -3743,7 +3783,7 @@ function DappImportAssetSelectStep({
|
|
|
3743
3783
|
);
|
|
3744
3784
|
}) })
|
|
3745
3785
|
] }),
|
|
3746
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3786
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PoweredBy, {})
|
|
3747
3787
|
] });
|
|
3748
3788
|
}
|
|
3749
3789
|
DappImportAssetSelectStep.displayName = "DappImportAssetSelectStep";
|
|
@@ -3760,9 +3800,9 @@ function DappImportAssetSelectSkeleton({
|
|
|
3760
3800
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: error ? "Couldn't load balances" : "Loading balances\u2026" }),
|
|
3761
3801
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3762
3802
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3763
|
-
|
|
3803
|
+
_chunkZDYV536Qcjs.BodyHeader,
|
|
3764
3804
|
{
|
|
3765
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3805
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.WalletIcon, {}),
|
|
3766
3806
|
title: `Transfer from ${sourceLabel}`,
|
|
3767
3807
|
subtitle: "Pick the balance to import"
|
|
3768
3808
|
}
|
|
@@ -3800,7 +3840,7 @@ function DappImportAssetSelectSkeleton({
|
|
|
3800
3840
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Try again" })
|
|
3801
3841
|
}
|
|
3802
3842
|
) }),
|
|
3803
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3843
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PoweredBy, {})
|
|
3804
3844
|
] });
|
|
3805
3845
|
}
|
|
3806
3846
|
DappImportAssetSelectSkeleton.displayName = "DappImportAssetSelectSkeleton";
|
|
@@ -3990,21 +4030,21 @@ var polymarketProvider = {
|
|
|
3990
4030
|
async fetchAvailability({ eoa, getPublicClient: getPublicClient2, signal }) {
|
|
3991
4031
|
const proxyWallet = await _chunkNRNJAQUAcjs.fetchPolymarketProxyWallet.call(void 0, eoa, signal);
|
|
3992
4032
|
if (!proxyWallet) return null;
|
|
3993
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
4033
|
+
if (_optionalChain([signal, 'optionalAccess', _115 => _115.aborted])) return null;
|
|
3994
4034
|
const polygonClient = getPublicClient2(_chunkNRNJAQUAcjs.POLYMARKET_POLYGON_CHAIN_ID);
|
|
3995
4035
|
if (!polygonClient) return null;
|
|
3996
4036
|
const balances = await _chunkNRNJAQUAcjs.readPolymarketBalances.call(void 0, {
|
|
3997
4037
|
publicClient: polygonClient,
|
|
3998
4038
|
proxyWallet
|
|
3999
4039
|
});
|
|
4000
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
4040
|
+
if (_optionalChain([signal, 'optionalAccess', _116 => _116.aborted])) return null;
|
|
4001
4041
|
if (balances.pusd === 0n && balances.usdce === 0n) return null;
|
|
4002
4042
|
const walletKind = await detectPolymarketWalletKind({
|
|
4003
4043
|
publicClient: polygonClient,
|
|
4004
4044
|
proxyWallet,
|
|
4005
4045
|
eoa
|
|
4006
4046
|
});
|
|
4007
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
4047
|
+
if (_optionalChain([signal, 'optionalAccess', _117 => _117.aborted])) return null;
|
|
4008
4048
|
if (!walletKind) return null;
|
|
4009
4049
|
const assets = [];
|
|
4010
4050
|
if (balances.pusd > 0n) {
|
|
@@ -4105,6 +4145,67 @@ function getEnabledProviders(config) {
|
|
|
4105
4145
|
);
|
|
4106
4146
|
}
|
|
4107
4147
|
|
|
4148
|
+
// src/store/state.ts
|
|
4149
|
+
function portfolioKey(network, address) {
|
|
4150
|
+
return network === "evm" ? `evm:${address.toLowerCase()}` : `solana:${address}`;
|
|
4151
|
+
}
|
|
4152
|
+
function createInitialState(overrides) {
|
|
4153
|
+
return {
|
|
4154
|
+
flow: {
|
|
4155
|
+
step: "connect",
|
|
4156
|
+
mode: null,
|
|
4157
|
+
isConnectSelectionConfirmed: false,
|
|
4158
|
+
hasNavigatedBack: false
|
|
4159
|
+
},
|
|
4160
|
+
wallet: {
|
|
4161
|
+
selectedWalletId: null
|
|
4162
|
+
},
|
|
4163
|
+
deposit: {
|
|
4164
|
+
targetChain: overrides.targetChain,
|
|
4165
|
+
targetToken: overrides.targetToken,
|
|
4166
|
+
sourceChain: null,
|
|
4167
|
+
sourceToken: null,
|
|
4168
|
+
sourceSymbol: null,
|
|
4169
|
+
sourceDecimals: null,
|
|
4170
|
+
selectedAsset: null,
|
|
4171
|
+
selectedSolanaToken: null,
|
|
4172
|
+
amount: null,
|
|
4173
|
+
targetAmount: null,
|
|
4174
|
+
targetTokenPriceUsd: null,
|
|
4175
|
+
balance: null,
|
|
4176
|
+
balanceUsd: null,
|
|
4177
|
+
inputAmountUsd: null,
|
|
4178
|
+
liquidityWarning: null
|
|
4179
|
+
},
|
|
4180
|
+
processing: {
|
|
4181
|
+
txHash: null,
|
|
4182
|
+
directTransfer: false,
|
|
4183
|
+
swappedContext: null
|
|
4184
|
+
},
|
|
4185
|
+
dappImport: {
|
|
4186
|
+
activeProviderId: null,
|
|
4187
|
+
availabilityOwner: null,
|
|
4188
|
+
availability: {},
|
|
4189
|
+
selectedAsset: null,
|
|
4190
|
+
bootError: false,
|
|
4191
|
+
attemptNonce: 0
|
|
4192
|
+
},
|
|
4193
|
+
setup: {
|
|
4194
|
+
byOwner: {}
|
|
4195
|
+
},
|
|
4196
|
+
portfolio: {
|
|
4197
|
+
byKey: {},
|
|
4198
|
+
nextRequestId: 0
|
|
4199
|
+
},
|
|
4200
|
+
fiat: {
|
|
4201
|
+
selectedMethod: null
|
|
4202
|
+
},
|
|
4203
|
+
exchange: {
|
|
4204
|
+
selectedConnection: null
|
|
4205
|
+
}
|
|
4206
|
+
};
|
|
4207
|
+
}
|
|
4208
|
+
|
|
4108
4209
|
// src/store/selectors.ts
|
|
4109
4210
|
var selectedWalletIdSelector = (state) => state.wallet.selectedWalletId;
|
|
4110
4211
|
var IDLE_SETUP_ENTRY = {
|
|
@@ -4124,12 +4225,16 @@ function readSetupForOwner(setup, owner) {
|
|
|
4124
4225
|
const entry = setup.byOwner[owner.toLowerCase()];
|
|
4125
4226
|
return _nullishCoalesce(entry, () => ( { ...IDLE_SETUP_ENTRY, owner }));
|
|
4126
4227
|
}
|
|
4228
|
+
function readPortfolioEntry(portfolio, network, address) {
|
|
4229
|
+
if (!address) return void 0;
|
|
4230
|
+
return portfolio.byKey[portfolioKey(network, address)];
|
|
4231
|
+
}
|
|
4127
4232
|
|
|
4128
4233
|
// src/core/dapp-imports/status.ts
|
|
4129
4234
|
function computeDappImportStatus(providerId, inputs) {
|
|
4130
4235
|
const { owner, availability, availabilityOwner, setup } = inputs;
|
|
4131
4236
|
if (!owner) return "needs-connect";
|
|
4132
|
-
const entry = _optionalChain([availabilityOwner, 'optionalAccess',
|
|
4237
|
+
const entry = _optionalChain([availabilityOwner, 'optionalAccess', _118 => _118.toLowerCase, 'call', _119 => _119()]) === owner.toLowerCase() ? availability[providerId] : void 0;
|
|
4133
4238
|
if (entry === "loading" || entry === void 0) return "loading";
|
|
4134
4239
|
if (entry === "error") {
|
|
4135
4240
|
return {
|
|
@@ -4483,12 +4588,12 @@ function applyAction(state, action) {
|
|
|
4483
4588
|
requestKey: action.requestKey,
|
|
4484
4589
|
cacheKey: action.cacheKey,
|
|
4485
4590
|
status: "loading",
|
|
4486
|
-
smartAccount: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
4487
|
-
sessionOwnerAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
4488
|
-
solanaDepositAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
4591
|
+
smartAccount: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _120 => _120.smartAccount]), () => ( null)),
|
|
4592
|
+
sessionOwnerAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _121 => _121.sessionOwnerAddress]), () => ( null)),
|
|
4593
|
+
solanaDepositAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _122 => _122.solanaDepositAddress]), () => ( null)),
|
|
4489
4594
|
message: null,
|
|
4490
4595
|
cacheable: action.cacheable,
|
|
4491
|
-
attemptNonce: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
4596
|
+
attemptNonce: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _123 => _123.attemptNonce]), () => ( 0))
|
|
4492
4597
|
}));
|
|
4493
4598
|
}
|
|
4494
4599
|
case "setup/ready": {
|
|
@@ -4531,6 +4636,79 @@ function applyAction(state, action) {
|
|
|
4531
4636
|
message: null,
|
|
4532
4637
|
attemptNonce: entry.attemptNonce + 1
|
|
4533
4638
|
}));
|
|
4639
|
+
case "portfolio/loading": {
|
|
4640
|
+
const key = portfolioKey(action.network, action.address);
|
|
4641
|
+
const requestId = state.portfolio.nextRequestId + 1;
|
|
4642
|
+
return {
|
|
4643
|
+
...state,
|
|
4644
|
+
portfolio: {
|
|
4645
|
+
nextRequestId: requestId,
|
|
4646
|
+
byKey: {
|
|
4647
|
+
...state.portfolio.byKey,
|
|
4648
|
+
[key]: { status: "loading", requestId, totalUsd: null }
|
|
4649
|
+
}
|
|
4650
|
+
}
|
|
4651
|
+
};
|
|
4652
|
+
}
|
|
4653
|
+
case "portfolio/reconciled": {
|
|
4654
|
+
const retainedKeys = new Set(
|
|
4655
|
+
action.wallets.map(
|
|
4656
|
+
({ network, address }) => portfolioKey(network, address)
|
|
4657
|
+
)
|
|
4658
|
+
);
|
|
4659
|
+
const entries = Object.entries(state.portfolio.byKey);
|
|
4660
|
+
const retainedEntries = entries.filter(([key]) => retainedKeys.has(key));
|
|
4661
|
+
if (retainedEntries.length === entries.length) return state;
|
|
4662
|
+
return {
|
|
4663
|
+
...state,
|
|
4664
|
+
portfolio: {
|
|
4665
|
+
...state.portfolio,
|
|
4666
|
+
byKey: Object.fromEntries(retainedEntries)
|
|
4667
|
+
}
|
|
4668
|
+
};
|
|
4669
|
+
}
|
|
4670
|
+
case "portfolio/loaded": {
|
|
4671
|
+
const key = portfolioKey(action.network, action.address);
|
|
4672
|
+
const existing = state.portfolio.byKey[key];
|
|
4673
|
+
if (!existing || existing.status !== "loading" || existing.requestId !== action.requestId) {
|
|
4674
|
+
return state;
|
|
4675
|
+
}
|
|
4676
|
+
return {
|
|
4677
|
+
...state,
|
|
4678
|
+
portfolio: {
|
|
4679
|
+
...state.portfolio,
|
|
4680
|
+
byKey: {
|
|
4681
|
+
...state.portfolio.byKey,
|
|
4682
|
+
[key]: {
|
|
4683
|
+
status: "ready",
|
|
4684
|
+
requestId: action.requestId,
|
|
4685
|
+
totalUsd: action.totalUsd
|
|
4686
|
+
}
|
|
4687
|
+
}
|
|
4688
|
+
}
|
|
4689
|
+
};
|
|
4690
|
+
}
|
|
4691
|
+
case "portfolio/failed": {
|
|
4692
|
+
const key = portfolioKey(action.network, action.address);
|
|
4693
|
+
const existing = state.portfolio.byKey[key];
|
|
4694
|
+
if (!existing || existing.status !== "loading" || existing.requestId !== action.requestId) {
|
|
4695
|
+
return state;
|
|
4696
|
+
}
|
|
4697
|
+
return {
|
|
4698
|
+
...state,
|
|
4699
|
+
portfolio: {
|
|
4700
|
+
...state.portfolio,
|
|
4701
|
+
byKey: {
|
|
4702
|
+
...state.portfolio.byKey,
|
|
4703
|
+
[key]: {
|
|
4704
|
+
status: "error",
|
|
4705
|
+
requestId: action.requestId,
|
|
4706
|
+
totalUsd: existing.totalUsd
|
|
4707
|
+
}
|
|
4708
|
+
}
|
|
4709
|
+
}
|
|
4710
|
+
};
|
|
4711
|
+
}
|
|
4534
4712
|
case "asset/selected":
|
|
4535
4713
|
return {
|
|
4536
4714
|
...state,
|
|
@@ -4797,6 +4975,13 @@ function applyAction(state, action) {
|
|
|
4797
4975
|
attemptNonce: 0
|
|
4798
4976
|
},
|
|
4799
4977
|
setup: { byOwner: preservedByOwner },
|
|
4978
|
+
// Ephemeral fetched balances — drop wholesale on close so a reopen
|
|
4979
|
+
// refetches rather than surfacing a stale balance (same hazard the
|
|
4980
|
+
// dappImport drop above guards against).
|
|
4981
|
+
portfolio: {
|
|
4982
|
+
byKey: {},
|
|
4983
|
+
nextRequestId: state.portfolio.nextRequestId
|
|
4984
|
+
},
|
|
4800
4985
|
fiat: { selectedMethod: null },
|
|
4801
4986
|
exchange: { selectedConnection: null }
|
|
4802
4987
|
};
|
|
@@ -4831,60 +5016,6 @@ function applyAction(state, action) {
|
|
|
4831
5016
|
}
|
|
4832
5017
|
}
|
|
4833
5018
|
|
|
4834
|
-
// src/store/state.ts
|
|
4835
|
-
function createInitialState(overrides) {
|
|
4836
|
-
return {
|
|
4837
|
-
flow: {
|
|
4838
|
-
step: "connect",
|
|
4839
|
-
mode: null,
|
|
4840
|
-
isConnectSelectionConfirmed: false,
|
|
4841
|
-
hasNavigatedBack: false
|
|
4842
|
-
},
|
|
4843
|
-
wallet: {
|
|
4844
|
-
selectedWalletId: null
|
|
4845
|
-
},
|
|
4846
|
-
deposit: {
|
|
4847
|
-
targetChain: overrides.targetChain,
|
|
4848
|
-
targetToken: overrides.targetToken,
|
|
4849
|
-
sourceChain: null,
|
|
4850
|
-
sourceToken: null,
|
|
4851
|
-
sourceSymbol: null,
|
|
4852
|
-
sourceDecimals: null,
|
|
4853
|
-
selectedAsset: null,
|
|
4854
|
-
selectedSolanaToken: null,
|
|
4855
|
-
amount: null,
|
|
4856
|
-
targetAmount: null,
|
|
4857
|
-
targetTokenPriceUsd: null,
|
|
4858
|
-
balance: null,
|
|
4859
|
-
balanceUsd: null,
|
|
4860
|
-
inputAmountUsd: null,
|
|
4861
|
-
liquidityWarning: null
|
|
4862
|
-
},
|
|
4863
|
-
processing: {
|
|
4864
|
-
txHash: null,
|
|
4865
|
-
directTransfer: false,
|
|
4866
|
-
swappedContext: null
|
|
4867
|
-
},
|
|
4868
|
-
dappImport: {
|
|
4869
|
-
activeProviderId: null,
|
|
4870
|
-
availabilityOwner: null,
|
|
4871
|
-
availability: {},
|
|
4872
|
-
selectedAsset: null,
|
|
4873
|
-
bootError: false,
|
|
4874
|
-
attemptNonce: 0
|
|
4875
|
-
},
|
|
4876
|
-
setup: {
|
|
4877
|
-
byOwner: {}
|
|
4878
|
-
},
|
|
4879
|
-
fiat: {
|
|
4880
|
-
selectedMethod: null
|
|
4881
|
-
},
|
|
4882
|
-
exchange: {
|
|
4883
|
-
selectedConnection: null
|
|
4884
|
-
}
|
|
4885
|
-
};
|
|
4886
|
-
}
|
|
4887
|
-
|
|
4888
5019
|
// src/store/index.ts
|
|
4889
5020
|
function createDepositStore(overrides) {
|
|
4890
5021
|
const store = _vanilla.createStore.call(void 0, () => createInitialState(overrides));
|
|
@@ -4929,15 +5060,15 @@ var SetupError = class extends Error {
|
|
|
4929
5060
|
}
|
|
4930
5061
|
};
|
|
4931
5062
|
async function resolveSessionOwner(eoaAddress) {
|
|
4932
|
-
const local =
|
|
5063
|
+
const local = _chunkZDYV536Qcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
4933
5064
|
if (local) {
|
|
4934
5065
|
return {
|
|
4935
|
-
account:
|
|
5066
|
+
account: _chunkZDYV536Qcjs.accountFromPrivateKey.call(void 0, local.privateKey),
|
|
4936
5067
|
address: local.address
|
|
4937
5068
|
};
|
|
4938
5069
|
}
|
|
4939
|
-
const created =
|
|
4940
|
-
|
|
5070
|
+
const created = _chunkZDYV536Qcjs.createSessionOwnerKey.call(void 0, );
|
|
5071
|
+
_chunkZDYV536Qcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
4941
5072
|
return { account: created.account, address: created.address };
|
|
4942
5073
|
}
|
|
4943
5074
|
function stableStringify(value) {
|
|
@@ -4968,8 +5099,7 @@ function computeRequestKey(input, sessionOwnerAddress) {
|
|
|
4968
5099
|
signerAddress: input.signerAddress.toLowerCase(),
|
|
4969
5100
|
sessionChainIds: _nullishCoalesce(input.sessionChainIds, () => ( null)),
|
|
4970
5101
|
enableSolana: _nullishCoalesce(input.enableSolana, () => ( true)),
|
|
4971
|
-
forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
|
|
4972
|
-
postBridgeActions: _nullishCoalesce(input.postBridgeActions, () => ( null))
|
|
5102
|
+
forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
|
|
4973
5103
|
});
|
|
4974
5104
|
}
|
|
4975
5105
|
function computeCacheKey(input, sessionOwnerAddress) {
|
|
@@ -4987,14 +5117,14 @@ function computeCacheKey(input, sessionOwnerAddress) {
|
|
|
4987
5117
|
});
|
|
4988
5118
|
}
|
|
4989
5119
|
function computeIsCacheable(input) {
|
|
4990
|
-
return !input.forceRegister
|
|
5120
|
+
return !input.forceRegister;
|
|
4991
5121
|
}
|
|
4992
5122
|
var SETUP_REQUEST_DEDUPE_TTL_MS = 3e4;
|
|
4993
5123
|
var setupRequestDedupe = /* @__PURE__ */ new Map();
|
|
4994
5124
|
function readDedupedAccountSetupResult(requestKey) {
|
|
4995
5125
|
const now = Date.now();
|
|
4996
5126
|
const existing = setupRequestDedupe.get(requestKey);
|
|
4997
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
5127
|
+
if (_optionalChain([existing, 'optionalAccess', _124 => _124.settled]) && existing.expiresAt > now && existing.result) {
|
|
4998
5128
|
return existing.result;
|
|
4999
5129
|
}
|
|
5000
5130
|
return null;
|
|
@@ -5005,10 +5135,9 @@ async function runAccountSetup(input, deps) {
|
|
|
5005
5135
|
try {
|
|
5006
5136
|
const sessionOwner = await resolveSessionOwner(input.ownerAddress);
|
|
5007
5137
|
const cacheKey = computeCacheKey(input, sessionOwner.address);
|
|
5008
|
-
|
|
5138
|
+
_chunkZDYV536Qcjs.debugLog.call(void 0, debug, "account-setup", "setup:start", {
|
|
5009
5139
|
owner: input.ownerAddress,
|
|
5010
5140
|
sessionOwner: sessionOwner.address,
|
|
5011
|
-
hasPostBridgeActions: Boolean(_optionalChain([input, 'access', _131 => _131.postBridgeActions, 'optionalAccess', _132 => _132.length])),
|
|
5012
5141
|
forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
|
|
5013
5142
|
});
|
|
5014
5143
|
const setup = await service.setupAccount({
|
|
@@ -5017,7 +5146,6 @@ async function runAccountSetup(input, deps) {
|
|
|
5017
5146
|
targetChain: _chunkABVRVW3Pcjs.targetChainToCaip2.call(void 0, input.targetChain),
|
|
5018
5147
|
targetToken: input.targetToken,
|
|
5019
5148
|
recipient: input.recipient,
|
|
5020
|
-
postBridgeActions: input.postBridgeActions,
|
|
5021
5149
|
outputTokenRules: input.outputTokenRules,
|
|
5022
5150
|
rejectUnmapped: input.rejectUnmapped,
|
|
5023
5151
|
signerAddress: input.signerAddress,
|
|
@@ -5053,7 +5181,7 @@ async function runAccountSetup(input, deps) {
|
|
|
5053
5181
|
primaryType: typedData.primaryType,
|
|
5054
5182
|
message: typedData.message
|
|
5055
5183
|
});
|
|
5056
|
-
const sessionDetails =
|
|
5184
|
+
const sessionDetails = _chunkZDYV536Qcjs.buildSessionDetails.call(void 0,
|
|
5057
5185
|
setup.sessionDetailsUnsigned,
|
|
5058
5186
|
signature
|
|
5059
5187
|
);
|
|
@@ -5070,10 +5198,7 @@ async function runAccountSetup(input, deps) {
|
|
|
5070
5198
|
chain: _chunkABVRVW3Pcjs.targetChainToCaip2.call(void 0, input.targetChain),
|
|
5071
5199
|
token: input.targetToken,
|
|
5072
5200
|
...input.recipient && { recipient: input.recipient },
|
|
5073
|
-
..._optionalChain([input, 'access',
|
|
5074
|
-
postBridgeActions: input.postBridgeActions
|
|
5075
|
-
},
|
|
5076
|
-
..._optionalChain([input, 'access', _135 => _135.outputTokenRules, 'optionalAccess', _136 => _136.length]) && {
|
|
5201
|
+
..._optionalChain([input, 'access', _125 => _125.outputTokenRules, 'optionalAccess', _126 => _126.length]) && {
|
|
5077
5202
|
outputTokenRules: input.outputTokenRules
|
|
5078
5203
|
},
|
|
5079
5204
|
...input.rejectUnmapped != null && {
|
|
@@ -5089,7 +5214,7 @@ async function runAccountSetup(input, deps) {
|
|
|
5089
5214
|
isRegistered: true
|
|
5090
5215
|
};
|
|
5091
5216
|
} catch (error) {
|
|
5092
|
-
|
|
5217
|
+
_chunkZDYV536Qcjs.debugError.call(void 0, debug, "account-setup", "setup:failed", error, {
|
|
5093
5218
|
owner: input.ownerAddress
|
|
5094
5219
|
});
|
|
5095
5220
|
if (error instanceof SetupError) throw error;
|
|
@@ -5100,7 +5225,7 @@ function runAccountSetupDeduped(input, deps, requestKey) {
|
|
|
5100
5225
|
const now = Date.now();
|
|
5101
5226
|
const existing = setupRequestDedupe.get(requestKey);
|
|
5102
5227
|
if (existing && (!existing.settled || existing.expiresAt > now)) {
|
|
5103
|
-
|
|
5228
|
+
_chunkZDYV536Qcjs.debugLog.call(void 0, deps.debug, "account-setup", "setup:dedupe-hit", {
|
|
5104
5229
|
owner: input.ownerAddress,
|
|
5105
5230
|
forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
|
|
5106
5231
|
});
|
|
@@ -5362,7 +5487,6 @@ function DepositFlow({
|
|
|
5362
5487
|
amount: defaultAmount,
|
|
5363
5488
|
recipient,
|
|
5364
5489
|
appBalanceUsd,
|
|
5365
|
-
postBridgeActions,
|
|
5366
5490
|
outputTokenRules,
|
|
5367
5491
|
rejectUnmapped,
|
|
5368
5492
|
signerAddress = _chunkABVRVW3Pcjs.DEFAULT_SIGNER_ADDRESS,
|
|
@@ -5388,16 +5512,17 @@ function DepositFlow({
|
|
|
5388
5512
|
onError,
|
|
5389
5513
|
debug
|
|
5390
5514
|
}) {
|
|
5391
|
-
const rpcUrls =
|
|
5392
|
-
const onStepChangeRef =
|
|
5393
|
-
const onEventRef =
|
|
5394
|
-
const onLifecycleRef =
|
|
5395
|
-
const onErrorRef =
|
|
5515
|
+
const rpcUrls = _chunkZDYV536Qcjs.useRpcUrls.call(void 0, );
|
|
5516
|
+
const onStepChangeRef = _chunkZDYV536Qcjs.useLatestRef.call(void 0, onStepChange);
|
|
5517
|
+
const onEventRef = _chunkZDYV536Qcjs.useLatestRef.call(void 0, onEvent);
|
|
5518
|
+
const onLifecycleRef = _chunkZDYV536Qcjs.useLatestRef.call(void 0, onLifecycle);
|
|
5519
|
+
const onErrorRef = _chunkZDYV536Qcjs.useLatestRef.call(void 0, onError);
|
|
5396
5520
|
const storeApi = useDepositStoreApi();
|
|
5397
5521
|
const flowSlice = useDepositStore((s) => s.flow);
|
|
5398
5522
|
const depositSlice = useDepositStore((s) => s.deposit);
|
|
5399
5523
|
const processingSlice = useDepositStore((s) => s.processing);
|
|
5400
5524
|
const setupSlice = useDepositStore((s) => s.setup);
|
|
5525
|
+
const portfolioSlice = useDepositStore((s) => s.portfolio);
|
|
5401
5526
|
const fiatSlice = useDepositStore((s) => s.fiat);
|
|
5402
5527
|
const exchangeSlice = useDepositStore((s) => s.exchange);
|
|
5403
5528
|
const flowMode = flowSlice.mode;
|
|
@@ -5408,23 +5533,42 @@ function DepositFlow({
|
|
|
5408
5533
|
const stableWalletSelectionKeyRef = _react.useRef.call(void 0, null);
|
|
5409
5534
|
const logFlow = _react.useCallback.call(void 0,
|
|
5410
5535
|
(message, data) => {
|
|
5411
|
-
|
|
5536
|
+
_chunkZDYV536Qcjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
|
|
5412
5537
|
},
|
|
5413
5538
|
[debug]
|
|
5414
5539
|
);
|
|
5415
5540
|
const logFlowError = _react.useCallback.call(void 0,
|
|
5416
5541
|
(message, error, data) => {
|
|
5417
|
-
|
|
5542
|
+
_chunkZDYV536Qcjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
|
|
5418
5543
|
},
|
|
5419
5544
|
[debug]
|
|
5420
5545
|
);
|
|
5546
|
+
const enableSwappedPreconnect = enableFiatOnramp || enableExchangeConnect;
|
|
5547
|
+
_react.useEffect.call(void 0, () => {
|
|
5548
|
+
if (!enableSwappedPreconnect) return;
|
|
5549
|
+
if (typeof document === "undefined") return;
|
|
5550
|
+
const links = [];
|
|
5551
|
+
for (const origin of SWAPPED_ORIGINS) {
|
|
5552
|
+
for (const rel of ["preconnect", "dns-prefetch"]) {
|
|
5553
|
+
const link = document.createElement("link");
|
|
5554
|
+
link.rel = rel;
|
|
5555
|
+
link.href = origin;
|
|
5556
|
+
link.dataset.rsSwappedPreconnect = "";
|
|
5557
|
+
document.head.appendChild(link);
|
|
5558
|
+
links.push(link);
|
|
5559
|
+
}
|
|
5560
|
+
}
|
|
5561
|
+
return () => {
|
|
5562
|
+
for (const link of links) link.remove();
|
|
5563
|
+
};
|
|
5564
|
+
}, [enableSwappedPreconnect]);
|
|
5421
5565
|
const dappSwitchChain = _react.useMemo.call(void 0, () => {
|
|
5422
|
-
if (!_optionalChain([dappWalletClient, 'optionalAccess',
|
|
5566
|
+
if (!_optionalChain([dappWalletClient, 'optionalAccess', _127 => _127.switchChain])) return void 0;
|
|
5423
5567
|
return async (chainId) => {
|
|
5424
|
-
await _optionalChain([dappWalletClient, 'access',
|
|
5568
|
+
await _optionalChain([dappWalletClient, 'access', _128 => _128.switchChain, 'optionalCall', _129 => _129({ id: chainId })]);
|
|
5425
5569
|
};
|
|
5426
5570
|
}, [dappWalletClient]);
|
|
5427
|
-
const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
5571
|
+
const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _130 => _130.account, 'optionalAccess', _131 => _131.address]), () => ( null));
|
|
5428
5572
|
const walletOptions = _react.useMemo.call(void 0, () => {
|
|
5429
5573
|
const options = [];
|
|
5430
5574
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -5438,7 +5582,7 @@ function DepositFlow({
|
|
|
5438
5582
|
});
|
|
5439
5583
|
seen.add(id);
|
|
5440
5584
|
}
|
|
5441
|
-
if (enableSolana && _optionalChain([reownWallet, 'optionalAccess',
|
|
5585
|
+
if (enableSolana && _optionalChain([reownWallet, 'optionalAccess', _132 => _132.isConnected]) && reownWallet.isSolana && reownWallet.solanaAddress && dappAddress) {
|
|
5442
5586
|
const id = _nullishCoalesce(reownWallet.caipAddress, () => ( `solana:${reownWallet.solanaAddress}`));
|
|
5443
5587
|
if (!seen.has(id)) {
|
|
5444
5588
|
options.push({
|
|
@@ -5450,7 +5594,7 @@ function DepositFlow({
|
|
|
5450
5594
|
});
|
|
5451
5595
|
seen.add(id);
|
|
5452
5596
|
}
|
|
5453
|
-
} else if (_optionalChain([reownWallet, 'optionalAccess',
|
|
5597
|
+
} else if (_optionalChain([reownWallet, 'optionalAccess', _133 => _133.address]) && reownWallet.isConnected && reownWallet.walletClient && reownWallet.publicClient && !seen.has(`evm:${reownWallet.address.toLowerCase()}`)) {
|
|
5454
5598
|
const id = `evm:${reownWallet.address.toLowerCase()}`;
|
|
5455
5599
|
if (!seen.has(id)) {
|
|
5456
5600
|
options.push({
|
|
@@ -5467,20 +5611,20 @@ function DepositFlow({
|
|
|
5467
5611
|
}, [
|
|
5468
5612
|
connectedWalletAddress,
|
|
5469
5613
|
dappAddress,
|
|
5470
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5471
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5472
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5473
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5474
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5614
|
+
_optionalChain([reownWallet, 'optionalAccess', _134 => _134.address]),
|
|
5615
|
+
_optionalChain([reownWallet, 'optionalAccess', _135 => _135.isConnected]),
|
|
5616
|
+
_optionalChain([reownWallet, 'optionalAccess', _136 => _136.walletClient]),
|
|
5617
|
+
_optionalChain([reownWallet, 'optionalAccess', _137 => _137.publicClient]),
|
|
5618
|
+
_optionalChain([reownWallet, 'optionalAccess', _138 => _138.icon]),
|
|
5475
5619
|
enableSolana,
|
|
5476
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5477
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5478
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5620
|
+
_optionalChain([reownWallet, 'optionalAccess', _139 => _139.isSolana]),
|
|
5621
|
+
_optionalChain([reownWallet, 'optionalAccess', _140 => _140.solanaAddress]),
|
|
5622
|
+
_optionalChain([reownWallet, 'optionalAccess', _141 => _141.caipAddress])
|
|
5479
5623
|
]);
|
|
5480
|
-
const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess',
|
|
5624
|
+
const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess', _142 => _142.account]) && dappAddress && !reownWallet && !enableFiatOnramp && !enableExchangeConnect;
|
|
5481
5625
|
const hasWalletOptions = walletOptions.length > 0;
|
|
5482
5626
|
const hasReownSession = Boolean(
|
|
5483
|
-
enableSolana ? _optionalChain([reownWallet, 'optionalAccess',
|
|
5627
|
+
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _143 => _143.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _144 => _144.address]) : _optionalChain([reownWallet, 'optionalAccess', _145 => _145.address])
|
|
5484
5628
|
);
|
|
5485
5629
|
const isDappImportWalletHydrating = Boolean(
|
|
5486
5630
|
hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasReownSession && !reownWallet.isReady
|
|
@@ -5528,16 +5672,16 @@ function DepositFlow({
|
|
|
5528
5672
|
return {
|
|
5529
5673
|
ownerAddress: dappAddress,
|
|
5530
5674
|
walletClient: void 0,
|
|
5531
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
5675
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkZDYV536Qcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
|
|
5532
5676
|
switchChain: void 0
|
|
5533
5677
|
};
|
|
5534
5678
|
}
|
|
5535
5679
|
if (canAutoLock) {
|
|
5536
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
5680
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _146 => _146.chain, 'optionalAccess', _147 => _147.id]), () => ( setupChainId));
|
|
5537
5681
|
return {
|
|
5538
5682
|
ownerAddress: dappWalletClient.account.address,
|
|
5539
5683
|
walletClient: dappWalletClient,
|
|
5540
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
5684
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkZDYV536Qcjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
|
|
5541
5685
|
switchChain: dappSwitchChain
|
|
5542
5686
|
};
|
|
5543
5687
|
}
|
|
@@ -5551,24 +5695,24 @@ function DepositFlow({
|
|
|
5551
5695
|
return {
|
|
5552
5696
|
ownerAddress: dappAddress,
|
|
5553
5697
|
walletClient: void 0,
|
|
5554
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
5698
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkZDYV536Qcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
|
|
5555
5699
|
switchChain: void 0
|
|
5556
5700
|
};
|
|
5557
5701
|
}
|
|
5558
|
-
if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess',
|
|
5559
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
5702
|
+
if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess', _148 => _148.account]) && selectedOption.address && dappWalletClient.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
5703
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _149 => _149.chain, 'optionalAccess', _150 => _150.id]), () => ( setupChainId));
|
|
5560
5704
|
return {
|
|
5561
5705
|
ownerAddress: dappWalletClient.account.address,
|
|
5562
5706
|
walletClient: dappWalletClient,
|
|
5563
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
5707
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkZDYV536Qcjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
|
|
5564
5708
|
switchChain: dappSwitchChain
|
|
5565
5709
|
};
|
|
5566
5710
|
}
|
|
5567
|
-
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess',
|
|
5711
|
+
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess', _151 => _151.address]) && selectedOption.address && reownWallet.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
5568
5712
|
return {
|
|
5569
5713
|
ownerAddress: reownWallet.address,
|
|
5570
5714
|
walletClient: reownWallet.walletClient,
|
|
5571
|
-
publicClient: _nullishCoalesce(reownWallet.publicClient, () => (
|
|
5715
|
+
publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunkZDYV536Qcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
|
|
5572
5716
|
switchChain: reownWallet.switchChain
|
|
5573
5717
|
};
|
|
5574
5718
|
}
|
|
@@ -5607,7 +5751,7 @@ function DepositFlow({
|
|
|
5607
5751
|
return {
|
|
5608
5752
|
ownerAddress: dappAddress,
|
|
5609
5753
|
walletClient: void 0,
|
|
5610
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
5754
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkZDYV536Qcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
|
|
5611
5755
|
switchChain: void 0
|
|
5612
5756
|
};
|
|
5613
5757
|
}
|
|
@@ -5632,37 +5776,37 @@ function DepositFlow({
|
|
|
5632
5776
|
const selectedEvmWalletOwner = _react.useMemo.call(void 0, () => {
|
|
5633
5777
|
if (!selectedWalletId) return null;
|
|
5634
5778
|
const opt = walletOptions.find((o) => o.id === selectedWalletId);
|
|
5635
|
-
if (_optionalChain([opt, 'optionalAccess',
|
|
5779
|
+
if (_optionalChain([opt, 'optionalAccess', _152 => _152.kind]) === "external" && opt.address) {
|
|
5636
5780
|
return opt.address;
|
|
5637
5781
|
}
|
|
5638
|
-
if (_optionalChain([opt, 'optionalAccess',
|
|
5782
|
+
if (_optionalChain([opt, 'optionalAccess', _153 => _153.kind]) === "connected" && opt.address) {
|
|
5639
5783
|
return opt.address;
|
|
5640
5784
|
}
|
|
5641
5785
|
return null;
|
|
5642
5786
|
}, [selectedWalletId, walletOptions]);
|
|
5643
5787
|
const dappImportOwner = _react.useMemo.call(void 0, () => {
|
|
5644
5788
|
if (selectedEvmWalletOwner) return selectedEvmWalletOwner;
|
|
5645
|
-
if (_optionalChain([reownWallet, 'optionalAccess',
|
|
5789
|
+
if (_optionalChain([reownWallet, 'optionalAccess', _154 => _154.address]) && reownWallet.isConnected) {
|
|
5646
5790
|
return reownWallet.address;
|
|
5647
5791
|
}
|
|
5648
5792
|
if (connectedWalletAddress) return connectedWalletAddress;
|
|
5649
5793
|
return null;
|
|
5650
5794
|
}, [
|
|
5651
5795
|
selectedEvmWalletOwner,
|
|
5652
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5653
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5796
|
+
_optionalChain([reownWallet, 'optionalAccess', _155 => _155.address]),
|
|
5797
|
+
_optionalChain([reownWallet, 'optionalAccess', _156 => _156.isConnected]),
|
|
5654
5798
|
connectedWalletAddress
|
|
5655
5799
|
]);
|
|
5656
5800
|
const activeOwner = _react.useMemo.call(void 0,
|
|
5657
5801
|
() => resolveOwnerForMode(flowMode, {
|
|
5658
5802
|
dappAddress,
|
|
5659
|
-
walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess',
|
|
5803
|
+
walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _157 => _157.ownerAddress]), () => ( (canAutoLock ? connectedWalletAddress : selectedEvmWalletOwner))),
|
|
5660
5804
|
dappImportOwner
|
|
5661
5805
|
}),
|
|
5662
5806
|
[
|
|
5663
5807
|
flowMode,
|
|
5664
5808
|
dappAddress,
|
|
5665
|
-
_optionalChain([signerContext, 'optionalAccess',
|
|
5809
|
+
_optionalChain([signerContext, 'optionalAccess', _158 => _158.ownerAddress]),
|
|
5666
5810
|
canAutoLock,
|
|
5667
5811
|
connectedWalletAddress,
|
|
5668
5812
|
selectedEvmWalletOwner,
|
|
@@ -5691,12 +5835,12 @@ function DepositFlow({
|
|
|
5691
5835
|
return;
|
|
5692
5836
|
}
|
|
5693
5837
|
lastActiveSetupLifecycleKeyRef.current = lifecycleKey;
|
|
5694
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
5838
|
+
_optionalChain([onLifecycleRef, 'access', _159 => _159.current, 'optionalCall', _160 => _160({
|
|
5695
5839
|
type: "smart-account-changed",
|
|
5696
5840
|
evm: activeEntry.smartAccount,
|
|
5697
5841
|
solana: _nullishCoalesce(activeEntry.solanaDepositAddress, () => ( null))
|
|
5698
5842
|
})]);
|
|
5699
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
5843
|
+
_optionalChain([onLifecycleRef, 'access', _161 => _161.current, 'optionalCall', _162 => _162({
|
|
5700
5844
|
type: "connected",
|
|
5701
5845
|
address: activeOwner,
|
|
5702
5846
|
smartAccount: activeEntry.smartAccount
|
|
@@ -5742,7 +5886,7 @@ function DepositFlow({
|
|
|
5742
5886
|
const currentBackHandler = canGoBackFromHere ? handleBack : void 0;
|
|
5743
5887
|
const currentScreen = showConnectStep ? "connect" : effectiveStep.type;
|
|
5744
5888
|
_react.useEffect.call(void 0, () => {
|
|
5745
|
-
_optionalChain([onStepChangeRef, 'access',
|
|
5889
|
+
_optionalChain([onStepChangeRef, 'access', _163 => _163.current, 'optionalCall', _164 => _164(currentBackHandler, currentScreen)]);
|
|
5746
5890
|
}, [currentBackHandler, currentScreen, onStepChangeRef]);
|
|
5747
5891
|
const lastModalHeightRef = _react.useRef.call(void 0, 0);
|
|
5748
5892
|
const modalContentElRef = _react.useRef.call(void 0, null);
|
|
@@ -5752,7 +5896,7 @@ function DepositFlow({
|
|
|
5752
5896
|
modalContentElRef.current = mc;
|
|
5753
5897
|
const ro = new ResizeObserver((entries) => {
|
|
5754
5898
|
for (const entry of entries) {
|
|
5755
|
-
const border = _optionalChain([entry, 'access',
|
|
5899
|
+
const border = _optionalChain([entry, 'access', _165 => _165.borderBoxSize, 'optionalAccess', _166 => _166[0], 'optionalAccess', _167 => _167.blockSize]);
|
|
5756
5900
|
lastModalHeightRef.current = typeof border === "number" ? border : entry.contentRect.height;
|
|
5757
5901
|
}
|
|
5758
5902
|
});
|
|
@@ -5793,7 +5937,7 @@ function DepositFlow({
|
|
|
5793
5937
|
}
|
|
5794
5938
|
lastStepOpenEventKeyRef.current = stepOpenEventKey;
|
|
5795
5939
|
if (effectiveStep.type === "select-asset") {
|
|
5796
|
-
_optionalChain([onEventRef, 'access',
|
|
5940
|
+
_optionalChain([onEventRef, 'access', _168 => _168.current, 'optionalCall', _169 => _169({
|
|
5797
5941
|
type: "deposit_modal_connected_wallet_select_source_open",
|
|
5798
5942
|
total_balance_in_external_wallet: totalBalanceUsd,
|
|
5799
5943
|
pred_balance: totalBalanceUsd
|
|
@@ -5801,7 +5945,7 @@ function DepositFlow({
|
|
|
5801
5945
|
} else if (effectiveStep.type === "deposit-address") {
|
|
5802
5946
|
const chainName = _chunkABVRVW3Pcjs.getChainName.call(void 0, targetChain);
|
|
5803
5947
|
const tokenSymbol = _chunkABVRVW3Pcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
5804
|
-
_optionalChain([onEventRef, 'access',
|
|
5948
|
+
_optionalChain([onEventRef, 'access', _170 => _170.current, 'optionalCall', _171 => _171({
|
|
5805
5949
|
type: "deposit_modal_transfer_crypto_open",
|
|
5806
5950
|
default_chain: chainName,
|
|
5807
5951
|
default_token: tokenSymbol,
|
|
@@ -5809,7 +5953,7 @@ function DepositFlow({
|
|
|
5809
5953
|
})]);
|
|
5810
5954
|
} else if (effectiveStep.type === "amount" && stepSendToken) {
|
|
5811
5955
|
const receiveSymbol = _chunkABVRVW3Pcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
5812
|
-
_optionalChain([onEventRef, 'access',
|
|
5956
|
+
_optionalChain([onEventRef, 'access', _172 => _172.current, 'optionalCall', _173 => _173({
|
|
5813
5957
|
type: "deposit_modal_connected_wallet_enter_value_open",
|
|
5814
5958
|
send_token: stepSendToken,
|
|
5815
5959
|
receive_token: receiveSymbol,
|
|
@@ -5842,7 +5986,7 @@ function DepositFlow({
|
|
|
5842
5986
|
targetToken
|
|
5843
5987
|
]);
|
|
5844
5988
|
_react.useEffect.call(void 0, () => {
|
|
5845
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
5989
|
+
_optionalChain([onLifecycleRef, 'access', _174 => _174.current, 'optionalCall', _175 => _175({
|
|
5846
5990
|
type: "balance-changed",
|
|
5847
5991
|
totalUsd: totalBalanceUsd
|
|
5848
5992
|
})]);
|
|
@@ -5858,7 +6002,7 @@ function DepositFlow({
|
|
|
5858
6002
|
const handleConfirmWallet = _react.useCallback.call(void 0,
|
|
5859
6003
|
(walletId) => {
|
|
5860
6004
|
const selectedOption = walletOptions.find((o) => o.id === walletId);
|
|
5861
|
-
const mode = enableSolana && _optionalChain([selectedOption, 'optionalAccess',
|
|
6005
|
+
const mode = enableSolana && _optionalChain([selectedOption, 'optionalAccess', _176 => _176.kind]) === "solana" ? "solana-wallet" : "wallet";
|
|
5862
6006
|
storeApi.dispatch({
|
|
5863
6007
|
type: "connect/wallet-confirmed",
|
|
5864
6008
|
walletId,
|
|
@@ -5868,7 +6012,7 @@ function DepositFlow({
|
|
|
5868
6012
|
[walletOptions, enableSolana, storeApi]
|
|
5869
6013
|
);
|
|
5870
6014
|
const isSolanaWalletConnected = Boolean(
|
|
5871
|
-
enableSolana && _optionalChain([reownWallet, 'optionalAccess',
|
|
6015
|
+
enableSolana && _optionalChain([reownWallet, 'optionalAccess', _177 => _177.isConnected]) && _optionalChain([reownWallet, 'optionalAccess', _178 => _178.isSolana])
|
|
5872
6016
|
);
|
|
5873
6017
|
const dappImportsKey = dappImports ? Object.keys(dappImports).filter((k) => dappImports[k]).sort().join(",") : "";
|
|
5874
6018
|
const enabledDappImportProviders = _react.useMemo.call(void 0,
|
|
@@ -5885,7 +6029,7 @@ function DepositFlow({
|
|
|
5885
6029
|
const owner = dappImportOwner;
|
|
5886
6030
|
if (owner) {
|
|
5887
6031
|
const wallet = walletOptions.find(
|
|
5888
|
-
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess',
|
|
6032
|
+
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _179 => _179.toLowerCase, 'call', _180 => _180()]) === owner.toLowerCase()
|
|
5889
6033
|
);
|
|
5890
6034
|
if (wallet) {
|
|
5891
6035
|
storeApi.dispatch({
|
|
@@ -5926,8 +6070,8 @@ function DepositFlow({
|
|
|
5926
6070
|
eoa: dappImportOwner,
|
|
5927
6071
|
getPublicClient: (chainId) => {
|
|
5928
6072
|
try {
|
|
5929
|
-
return
|
|
5930
|
-
} catch (
|
|
6073
|
+
return _chunkZDYV536Qcjs.getPublicClient.call(void 0, chainId, rpcUrls);
|
|
6074
|
+
} catch (e30) {
|
|
5931
6075
|
return null;
|
|
5932
6076
|
}
|
|
5933
6077
|
},
|
|
@@ -6003,7 +6147,7 @@ function DepositFlow({
|
|
|
6003
6147
|
}, [activeDappImportProviderId, enabledDappImportProviders]);
|
|
6004
6148
|
const activeDappImportAvailability = _react.useMemo.call(void 0, () => {
|
|
6005
6149
|
if (!activeDappImportProviderId) return null;
|
|
6006
|
-
if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess',
|
|
6150
|
+
if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _181 => _181.toLowerCase, 'call', _182 => _182()]) !== dappImportOwner.toLowerCase()) {
|
|
6007
6151
|
return null;
|
|
6008
6152
|
}
|
|
6009
6153
|
const entry = dappImportAvailability[activeDappImportProviderId];
|
|
@@ -6044,7 +6188,7 @@ function DepositFlow({
|
|
|
6044
6188
|
setup: setupSlice
|
|
6045
6189
|
});
|
|
6046
6190
|
const pinnableWallet = dappImportOwner ? _nullishCoalesce(walletOptions.find(
|
|
6047
|
-
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess',
|
|
6191
|
+
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _183 => _183.toLowerCase, 'call', _184 => _184()]) === dappImportOwner.toLowerCase()
|
|
6048
6192
|
), () => ( null)) : null;
|
|
6049
6193
|
const outcome = resolveBootOutcome({
|
|
6050
6194
|
status,
|
|
@@ -6086,7 +6230,7 @@ function DepositFlow({
|
|
|
6086
6230
|
if (dappImportOwner) {
|
|
6087
6231
|
const plan = bootRetryPlan({
|
|
6088
6232
|
setupStatus: readSetupForOwner(snapshot.setup, dappImportOwner).status,
|
|
6089
|
-
availabilityEntry: _optionalChain([snapshot, 'access',
|
|
6233
|
+
availabilityEntry: _optionalChain([snapshot, 'access', _185 => _185.dappImport, 'access', _186 => _186.availabilityOwner, 'optionalAccess', _187 => _187.toLowerCase, 'call', _188 => _188()]) === dappImportOwner.toLowerCase() ? snapshot.dappImport.availability[providerId] : void 0
|
|
6090
6234
|
});
|
|
6091
6235
|
if (plan.restartSetup) {
|
|
6092
6236
|
storeApi.dispatch({
|
|
@@ -6126,8 +6270,48 @@ function DepositFlow({
|
|
|
6126
6270
|
},
|
|
6127
6271
|
[storeApi]
|
|
6128
6272
|
);
|
|
6273
|
+
const swappedUrlPrefetchRef = _react.useRef.call(void 0, /* @__PURE__ */ new Map());
|
|
6274
|
+
const prefetchSwappedWidgetUrl = _react.useCallback.call(void 0,
|
|
6275
|
+
(smartAccount, method) => {
|
|
6276
|
+
const cache = swappedUrlPrefetchRef.current;
|
|
6277
|
+
const key = _nullishCoalesce(method, () => ( ""));
|
|
6278
|
+
const owner = smartAccount.toLowerCase();
|
|
6279
|
+
const existing = cache.get(key);
|
|
6280
|
+
if (existing && existing.smartAccount === owner) return;
|
|
6281
|
+
const promise = service.getSwappedWidgetUrl({ smartAccount, method });
|
|
6282
|
+
promise.catch(() => {
|
|
6283
|
+
});
|
|
6284
|
+
cache.set(key, { smartAccount: owner, promise });
|
|
6285
|
+
logFlow("swapped:prefetch", { method: _nullishCoalesce(method, () => ( null)) });
|
|
6286
|
+
},
|
|
6287
|
+
[service, logFlow]
|
|
6288
|
+
);
|
|
6289
|
+
const consumeSwappedWidgetUrlPrefetch = _react.useCallback.call(void 0,
|
|
6290
|
+
(smartAccount, method) => {
|
|
6291
|
+
const cache = swappedUrlPrefetchRef.current;
|
|
6292
|
+
const key = _nullishCoalesce(method, () => ( ""));
|
|
6293
|
+
const entry = cache.get(key);
|
|
6294
|
+
if (!entry) return null;
|
|
6295
|
+
cache.delete(key);
|
|
6296
|
+
if (entry.smartAccount !== smartAccount.toLowerCase()) return null;
|
|
6297
|
+
return entry.promise;
|
|
6298
|
+
},
|
|
6299
|
+
[]
|
|
6300
|
+
);
|
|
6301
|
+
const handlePrefetchFiatMethod = _react.useCallback.call(void 0,
|
|
6302
|
+
(method) => {
|
|
6303
|
+
if (!enableFiatOnramp || !dappAddress) return;
|
|
6304
|
+
const entry = readSetupForOwner(setupSlice, dappAddress);
|
|
6305
|
+
if (entry.status !== "ready" || !entry.smartAccount) return;
|
|
6306
|
+
prefetchSwappedWidgetUrl(entry.smartAccount, method);
|
|
6307
|
+
},
|
|
6308
|
+
[enableFiatOnramp, dappAddress, setupSlice, prefetchSwappedWidgetUrl]
|
|
6309
|
+
);
|
|
6310
|
+
_react.useEffect.call(void 0, () => {
|
|
6311
|
+
swappedUrlPrefetchRef.current.clear();
|
|
6312
|
+
}, [dappAddress]);
|
|
6129
6313
|
const handleNewDeposit = _react.useCallback.call(void 0, () => {
|
|
6130
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6314
|
+
_optionalChain([onLifecycleRef, 'access', _189 => _189.current, 'optionalCall', _190 => _190({
|
|
6131
6315
|
type: "smart-account-changed",
|
|
6132
6316
|
evm: null,
|
|
6133
6317
|
solana: null
|
|
@@ -6135,6 +6319,7 @@ function DepositFlow({
|
|
|
6135
6319
|
storeApi.dispatch({ type: "flow/reset" });
|
|
6136
6320
|
stableWalletSignerRef.current = null;
|
|
6137
6321
|
stableWalletSelectionKeyRef.current = null;
|
|
6322
|
+
swappedUrlPrefetchRef.current.clear();
|
|
6138
6323
|
}, [onLifecycleRef, storeApi]);
|
|
6139
6324
|
const setupInputBase = _react.useMemo.call(void 0,
|
|
6140
6325
|
() => ({
|
|
@@ -6143,7 +6328,6 @@ function DepositFlow({
|
|
|
6143
6328
|
signerAddress,
|
|
6144
6329
|
sessionChainIds,
|
|
6145
6330
|
recipient,
|
|
6146
|
-
postBridgeActions,
|
|
6147
6331
|
outputTokenRules,
|
|
6148
6332
|
rejectUnmapped,
|
|
6149
6333
|
forceRegister,
|
|
@@ -6155,7 +6339,6 @@ function DepositFlow({
|
|
|
6155
6339
|
signerAddress,
|
|
6156
6340
|
sessionChainIds,
|
|
6157
6341
|
recipient,
|
|
6158
|
-
postBridgeActions,
|
|
6159
6342
|
outputTokenRules,
|
|
6160
6343
|
rejectUnmapped,
|
|
6161
6344
|
forceRegister,
|
|
@@ -6174,13 +6357,13 @@ function DepositFlow({
|
|
|
6174
6357
|
};
|
|
6175
6358
|
push(dappAddress);
|
|
6176
6359
|
push(connectedWalletAddress);
|
|
6177
|
-
push(_optionalChain([reownWallet, 'optionalAccess',
|
|
6360
|
+
push(_optionalChain([reownWallet, 'optionalAccess', _191 => _191.address]));
|
|
6178
6361
|
push(dappImportOwner);
|
|
6179
6362
|
return owners;
|
|
6180
6363
|
}, [
|
|
6181
6364
|
dappAddress,
|
|
6182
6365
|
connectedWalletAddress,
|
|
6183
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
6366
|
+
_optionalChain([reownWallet, 'optionalAccess', _192 => _192.address]),
|
|
6184
6367
|
dappImportOwner
|
|
6185
6368
|
]);
|
|
6186
6369
|
_react.useEffect.call(void 0, () => {
|
|
@@ -6194,7 +6377,7 @@ function DepositFlow({
|
|
|
6194
6377
|
try {
|
|
6195
6378
|
sessionOwner = await resolveSessionOwner(owner);
|
|
6196
6379
|
} catch (error) {
|
|
6197
|
-
|
|
6380
|
+
_chunkZDYV536Qcjs.debugError.call(void 0,
|
|
6198
6381
|
debug,
|
|
6199
6382
|
"deposit-flow",
|
|
6200
6383
|
"session-owner:resolve-failed",
|
|
@@ -6278,6 +6461,58 @@ function DepositFlow({
|
|
|
6278
6461
|
storeApi,
|
|
6279
6462
|
setupSlice.byOwner
|
|
6280
6463
|
]);
|
|
6464
|
+
const walletOptionsKey = _react.useMemo.call(void 0,
|
|
6465
|
+
() => walletOptions.map((option) => option.id).join(","),
|
|
6466
|
+
[walletOptions]
|
|
6467
|
+
);
|
|
6468
|
+
const desiredPortfolios = _react.useMemo.call(void 0,
|
|
6469
|
+
() => walletOptions.flatMap((option) => {
|
|
6470
|
+
const network = option.kind === "solana" ? "solana" : "evm";
|
|
6471
|
+
const address = option.kind === "solana" ? option.solanaAddress : option.address;
|
|
6472
|
+
return address ? [{ network, address }] : [];
|
|
6473
|
+
}),
|
|
6474
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- keyed on the stable id-join, not the walletOptions array identity
|
|
6475
|
+
[walletOptionsKey]
|
|
6476
|
+
);
|
|
6477
|
+
_react.useEffect.call(void 0, () => {
|
|
6478
|
+
storeApi.dispatch({
|
|
6479
|
+
type: "portfolio/reconciled",
|
|
6480
|
+
wallets: desiredPortfolios
|
|
6481
|
+
});
|
|
6482
|
+
desiredPortfolios.forEach(({ network, address }) => {
|
|
6483
|
+
if (readPortfolioEntry(storeApi.getState().portfolio, network, address)) {
|
|
6484
|
+
return;
|
|
6485
|
+
}
|
|
6486
|
+
storeApi.dispatch({ type: "portfolio/loading", network, address });
|
|
6487
|
+
const requestId = _optionalChain([readPortfolioEntry, 'call', _193 => _193(
|
|
6488
|
+
storeApi.getState().portfolio,
|
|
6489
|
+
network,
|
|
6490
|
+
address
|
|
6491
|
+
), 'optionalAccess', _194 => _194.requestId]);
|
|
6492
|
+
if (requestId === void 0) return;
|
|
6493
|
+
void (async () => {
|
|
6494
|
+
try {
|
|
6495
|
+
const portfolio = network === "solana" ? await service.fetchSolanaPortfolio(address, {
|
|
6496
|
+
forceRefresh: true
|
|
6497
|
+
}) : await service.fetchPortfolio(address, { forceRefresh: true });
|
|
6498
|
+
storeApi.dispatch({
|
|
6499
|
+
type: "portfolio/loaded",
|
|
6500
|
+
network,
|
|
6501
|
+
address,
|
|
6502
|
+
requestId,
|
|
6503
|
+
totalUsd: portfolio.totalUsd
|
|
6504
|
+
});
|
|
6505
|
+
} catch (e31) {
|
|
6506
|
+
storeApi.dispatch({
|
|
6507
|
+
type: "portfolio/failed",
|
|
6508
|
+
network,
|
|
6509
|
+
address,
|
|
6510
|
+
requestId
|
|
6511
|
+
});
|
|
6512
|
+
}
|
|
6513
|
+
})();
|
|
6514
|
+
});
|
|
6515
|
+
}, [desiredPortfolios, service, storeApi, portfolioSlice.byKey]);
|
|
6281
6516
|
const handleDepositAddressSubmitted = _react.useCallback.call(void 0,
|
|
6282
6517
|
(data) => {
|
|
6283
6518
|
logFlow("deposit-address:detected", {
|
|
@@ -6285,7 +6520,7 @@ function DepositFlow({
|
|
|
6285
6520
|
sourceChain: data.sourceChain,
|
|
6286
6521
|
amount: data.amount
|
|
6287
6522
|
});
|
|
6288
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6523
|
+
_optionalChain([onLifecycleRef, 'access', _195 => _195.current, 'optionalCall', _196 => _196({ type: "submitted", ...data })]);
|
|
6289
6524
|
},
|
|
6290
6525
|
[logFlow, onLifecycleRef]
|
|
6291
6526
|
);
|
|
@@ -6345,7 +6580,7 @@ function DepositFlow({
|
|
|
6345
6580
|
sourceDecimals: tokenAtSubmit.decimals,
|
|
6346
6581
|
inputAmountUsd: amountUsd
|
|
6347
6582
|
});
|
|
6348
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6583
|
+
_optionalChain([onLifecycleRef, 'access', _197 => _197.current, 'optionalCall', _198 => _198({
|
|
6349
6584
|
type: "submitted",
|
|
6350
6585
|
txHash,
|
|
6351
6586
|
sourceChain: "solana",
|
|
@@ -6358,7 +6593,7 @@ function DepositFlow({
|
|
|
6358
6593
|
);
|
|
6359
6594
|
const handleAssetContinue = _react.useCallback.call(void 0,
|
|
6360
6595
|
(asset) => {
|
|
6361
|
-
_optionalChain([onEventRef, 'access',
|
|
6596
|
+
_optionalChain([onEventRef, 'access', _199 => _199.current, 'optionalCall', _200 => _200({
|
|
6362
6597
|
type: "deposit_modal_connected_wallet_select_source_cta_click",
|
|
6363
6598
|
total_balance_in_external_wallet: totalBalanceUsd,
|
|
6364
6599
|
pred_balance: totalBalanceUsd,
|
|
@@ -6412,8 +6647,8 @@ function DepositFlow({
|
|
|
6412
6647
|
sourceChain: chainId,
|
|
6413
6648
|
sourceToken: token,
|
|
6414
6649
|
amount,
|
|
6415
|
-
sourceSymbol: _optionalChain([asset, 'optionalAccess',
|
|
6416
|
-
sourceDecimals: _optionalChain([asset, 'optionalAccess',
|
|
6650
|
+
sourceSymbol: _optionalChain([asset, 'optionalAccess', _201 => _201.symbol]),
|
|
6651
|
+
sourceDecimals: _optionalChain([asset, 'optionalAccess', _202 => _202.decimals]),
|
|
6417
6652
|
inputAmountUsd: _nullishCoalesce(depositAtSubmit.inputAmountUsd, () => ( void 0)),
|
|
6418
6653
|
directTransfer: !dappImport && isSameRoute2(chainId, token, targetChain, targetToken)
|
|
6419
6654
|
});
|
|
@@ -6445,7 +6680,7 @@ function DepositFlow({
|
|
|
6445
6680
|
sourceDecimals: SWAPPED_SOURCE_DECIMALS,
|
|
6446
6681
|
swappedContext
|
|
6447
6682
|
});
|
|
6448
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6683
|
+
_optionalChain([onLifecycleRef, 'access', _203 => _203.current, 'optionalCall', _204 => _204({
|
|
6449
6684
|
type: "submitted",
|
|
6450
6685
|
txHash: info.txHash,
|
|
6451
6686
|
sourceChain: SWAPPED_SOURCE_CHAIN,
|
|
@@ -6458,12 +6693,12 @@ function DepositFlow({
|
|
|
6458
6693
|
const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
|
|
6459
6694
|
(txHash, sourceChain, amount) => {
|
|
6460
6695
|
const depositAtSubmit = storeApi.getState().deposit;
|
|
6461
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6696
|
+
_optionalChain([onLifecycleRef, 'access', _205 => _205.current, 'optionalCall', _206 => _206({
|
|
6462
6697
|
type: "submitted",
|
|
6463
6698
|
txHash,
|
|
6464
6699
|
sourceChain,
|
|
6465
6700
|
amount,
|
|
6466
|
-
sourceDecimals: _optionalChain([depositAtSubmit, 'access',
|
|
6701
|
+
sourceDecimals: _optionalChain([depositAtSubmit, 'access', _207 => _207.selectedAsset, 'optionalAccess', _208 => _208.decimals]),
|
|
6467
6702
|
amountUsd: _nullishCoalesce(depositAtSubmit.inputAmountUsd, () => ( void 0))
|
|
6468
6703
|
})]);
|
|
6469
6704
|
},
|
|
@@ -6472,7 +6707,7 @@ function DepositFlow({
|
|
|
6472
6707
|
const handleDepositComplete = _react.useCallback.call(void 0,
|
|
6473
6708
|
(txHash, destinationTxHash, context) => {
|
|
6474
6709
|
logFlow("deposit:complete", { txHash, destinationTxHash, ...context });
|
|
6475
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6710
|
+
_optionalChain([onLifecycleRef, 'access', _209 => _209.current, 'optionalCall', _210 => _210({
|
|
6476
6711
|
type: "complete",
|
|
6477
6712
|
txHash,
|
|
6478
6713
|
destinationTxHash,
|
|
@@ -6484,24 +6719,20 @@ function DepositFlow({
|
|
|
6484
6719
|
const handleDepositFailed = _react.useCallback.call(void 0,
|
|
6485
6720
|
(txHash, error) => {
|
|
6486
6721
|
logFlowError("deposit:failed", error, { txHash });
|
|
6487
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6722
|
+
_optionalChain([onLifecycleRef, 'access', _211 => _211.current, 'optionalCall', _212 => _212({ type: "failed", txHash, error })]);
|
|
6488
6723
|
},
|
|
6489
6724
|
[logFlowError, onLifecycleRef]
|
|
6490
6725
|
);
|
|
6491
6726
|
const handleError = _react.useCallback.call(void 0,
|
|
6492
6727
|
(message, code) => {
|
|
6493
6728
|
logFlowError("flow:error", message, { code });
|
|
6494
|
-
_optionalChain([onErrorRef, 'access',
|
|
6729
|
+
_optionalChain([onErrorRef, 'access', _213 => _213.current, 'optionalCall', _214 => _214({ message, code })]);
|
|
6495
6730
|
},
|
|
6496
6731
|
[logFlowError, onErrorRef]
|
|
6497
6732
|
);
|
|
6498
6733
|
const handleTotalBalanceComputed = _react.useCallback.call(void 0, (total) => {
|
|
6499
6734
|
setTotalBalanceUsd(total);
|
|
6500
6735
|
}, []);
|
|
6501
|
-
const walletOptionsKey = _react.useMemo.call(void 0,
|
|
6502
|
-
() => walletOptions.map((option) => option.id).join(","),
|
|
6503
|
-
[walletOptions]
|
|
6504
|
-
);
|
|
6505
6736
|
_react.useEffect.call(void 0, () => {
|
|
6506
6737
|
if (storeApi.getState().flow.mode) {
|
|
6507
6738
|
return;
|
|
@@ -6538,6 +6769,13 @@ function DepositFlow({
|
|
|
6538
6769
|
const ownerForRow = option.kind === "solana" ? dappAddress : _nullishCoalesce(option.address, () => ( null));
|
|
6539
6770
|
const entry = readSetupForOwner(setupSlice, _nullishCoalesce(ownerForRow, () => ( null)));
|
|
6540
6771
|
const state = entry.status === "ready" ? "ready" : entry.status === "error" ? "error" : "loading";
|
|
6772
|
+
const network = option.kind === "solana" ? "solana" : "evm";
|
|
6773
|
+
const balanceAddress = option.kind === "solana" ? option.solanaAddress : option.address;
|
|
6774
|
+
const portfolioEntry = readPortfolioEntry(
|
|
6775
|
+
portfolioSlice,
|
|
6776
|
+
network,
|
|
6777
|
+
balanceAddress
|
|
6778
|
+
);
|
|
6541
6779
|
return {
|
|
6542
6780
|
id: option.id,
|
|
6543
6781
|
kind: option.kind,
|
|
@@ -6545,10 +6783,12 @@ function DepositFlow({
|
|
|
6545
6783
|
icon: option.icon,
|
|
6546
6784
|
address: _nullishCoalesce(_nullishCoalesce(option.address, () => ( option.solanaAddress)), () => ( option.id)),
|
|
6547
6785
|
state,
|
|
6548
|
-
errorReason: _nullishCoalesce(entry.message, () => ( void 0))
|
|
6786
|
+
errorReason: _nullishCoalesce(entry.message, () => ( void 0)),
|
|
6787
|
+
balanceStatus: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess', _215 => _215.status]), () => ( "loading")),
|
|
6788
|
+
balanceUsd: _optionalChain([portfolioEntry, 'optionalAccess', _216 => _216.status]) === "ready" ? portfolioEntry.totalUsd : null
|
|
6549
6789
|
};
|
|
6550
6790
|
});
|
|
6551
|
-
}, [walletOptions, setupSlice, dappAddress]);
|
|
6791
|
+
}, [walletOptions, setupSlice, dappAddress, portfolioSlice]);
|
|
6552
6792
|
const transferCryptoEntry = _react.useMemo.call(void 0,
|
|
6553
6793
|
() => readSetupForOwner(setupSlice, dappAddress),
|
|
6554
6794
|
[setupSlice, dappAddress]
|
|
@@ -6562,7 +6802,7 @@ function DepositFlow({
|
|
|
6562
6802
|
);
|
|
6563
6803
|
if (showConnectStep) {
|
|
6564
6804
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6565
|
-
|
|
6805
|
+
_chunkZDYV536Qcjs.ConnectStep,
|
|
6566
6806
|
{
|
|
6567
6807
|
walletRows,
|
|
6568
6808
|
transferCryptoState: dappAddress ? transferCryptoState : void 0,
|
|
@@ -6576,6 +6816,7 @@ function DepositFlow({
|
|
|
6576
6816
|
} : void 0,
|
|
6577
6817
|
fiatPaymentMethods: enableFiatOnramp && dappAddress ? fiatOnrampMethods && fiatOnrampMethods.length > 0 ? fiatOnrampMethods : DEFAULT_FIAT_ONRAMP_METHODS : void 0,
|
|
6578
6818
|
onSelectFiatMethod: enableFiatOnramp && dappAddress ? (method) => handleSelectFiatMethod(method) : void 0,
|
|
6819
|
+
onPrefetchFiatMethod: enableFiatOnramp && dappAddress ? handlePrefetchFiatMethod : void 0,
|
|
6579
6820
|
onSelectFundFromExchange: enableExchangeConnect && dappAddress ? () => handleSelectExchange() : void 0,
|
|
6580
6821
|
onRequestConnect,
|
|
6581
6822
|
onConnect,
|
|
@@ -6594,7 +6835,7 @@ function DepositFlow({
|
|
|
6594
6835
|
},
|
|
6595
6836
|
dappImports: connectStepDappImports,
|
|
6596
6837
|
onSelectDappImport: (providerId) => {
|
|
6597
|
-
const availabilityEntry = dappImportOwner && _optionalChain([dappImportAvailabilityOwner, 'optionalAccess',
|
|
6838
|
+
const availabilityEntry = dappImportOwner && _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _217 => _217.toLowerCase, 'call', _218 => _218()]) === dappImportOwner.toLowerCase() ? dappImportAvailability[providerId] : void 0;
|
|
6598
6839
|
if (availabilityEntry === "error") {
|
|
6599
6840
|
storeApi.dispatch({
|
|
6600
6841
|
type: "dapp-import/availability-retry-requested"
|
|
@@ -6640,7 +6881,6 @@ function DepositFlow({
|
|
|
6640
6881
|
allowedRoutes,
|
|
6641
6882
|
targetChain,
|
|
6642
6883
|
targetToken,
|
|
6643
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _225 => _225.length])),
|
|
6644
6884
|
uiConfig,
|
|
6645
6885
|
onDepositSubmitted: handleDepositAddressSubmitted,
|
|
6646
6886
|
onDepositComplete: handleDepositComplete,
|
|
@@ -6648,7 +6888,7 @@ function DepositFlow({
|
|
|
6648
6888
|
onCopyAddress: () => {
|
|
6649
6889
|
const chainName = _chunkABVRVW3Pcjs.getChainName.call(void 0, targetChain);
|
|
6650
6890
|
const tokenSymbol = _chunkABVRVW3Pcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
6651
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
6891
|
+
_optionalChain([onEvent, 'optionalCall', _219 => _219({
|
|
6652
6892
|
type: "deposit_modal_transfer_crypto_cta_click",
|
|
6653
6893
|
default_chain: chainName,
|
|
6654
6894
|
default_token: tokenSymbol,
|
|
@@ -6684,15 +6924,17 @@ function DepositFlow({
|
|
|
6684
6924
|
smartAccount: step.smartAccount,
|
|
6685
6925
|
service,
|
|
6686
6926
|
paymentMethod: step.paymentMethod,
|
|
6927
|
+
consumePrefetchedUrl: consumeSwappedWidgetUrlPrefetch,
|
|
6687
6928
|
onSwappedComplete: handleSwappedComplete,
|
|
6688
6929
|
onSwappedFailed: handleDepositFailed,
|
|
6689
6930
|
onClose: _nullishCoalesce(onClose, () => ( (() => {
|
|
6690
6931
|
}))),
|
|
6932
|
+
onGoBack: handleBack,
|
|
6691
6933
|
onError: handleError
|
|
6692
6934
|
}
|
|
6693
6935
|
),
|
|
6694
6936
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6695
|
-
|
|
6937
|
+
_chunkZDYV536Qcjs.ProcessingStep,
|
|
6696
6938
|
{
|
|
6697
6939
|
smartAccount: step.smartAccount,
|
|
6698
6940
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
@@ -6706,7 +6948,6 @@ function DepositFlow({
|
|
|
6706
6948
|
sourceDecimals: step.sourceDecimals,
|
|
6707
6949
|
amountUsd: step.inputAmountUsd,
|
|
6708
6950
|
swappedContext: step.swappedContext,
|
|
6709
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _227 => _227.length])),
|
|
6710
6951
|
service,
|
|
6711
6952
|
directTransfer: step.directTransfer,
|
|
6712
6953
|
isSwappedOrder: true,
|
|
@@ -6756,11 +6997,12 @@ function DepositFlow({
|
|
|
6756
6997
|
onSwappedFailed: handleDepositFailed,
|
|
6757
6998
|
onClose: _nullishCoalesce(onClose, () => ( (() => {
|
|
6758
6999
|
}))),
|
|
7000
|
+
onGoBack: handleBack,
|
|
6759
7001
|
onError: handleError
|
|
6760
7002
|
}
|
|
6761
7003
|
),
|
|
6762
7004
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6763
|
-
|
|
7005
|
+
_chunkZDYV536Qcjs.ProcessingStep,
|
|
6764
7006
|
{
|
|
6765
7007
|
smartAccount: step.smartAccount,
|
|
6766
7008
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
@@ -6774,7 +7016,6 @@ function DepositFlow({
|
|
|
6774
7016
|
sourceDecimals: step.sourceDecimals,
|
|
6775
7017
|
amountUsd: step.inputAmountUsd,
|
|
6776
7018
|
swappedContext: step.swappedContext,
|
|
6777
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _228 => _228.length])),
|
|
6778
7019
|
service,
|
|
6779
7020
|
directTransfer: step.directTransfer,
|
|
6780
7021
|
isSwappedOrder: true,
|
|
@@ -6792,8 +7033,8 @@ function DepositFlow({
|
|
|
6792
7033
|
}
|
|
6793
7034
|
if (isSolanaWalletMode) {
|
|
6794
7035
|
if (!dappAddress) return null;
|
|
6795
|
-
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess',
|
|
6796
|
-
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess',
|
|
7036
|
+
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess', _220 => _220.solanaAddress]);
|
|
7037
|
+
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess', _221 => _221.solanaProvider]);
|
|
6797
7038
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
6798
7039
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6799
7040
|
AccountPreparingSkeleton,
|
|
@@ -6850,7 +7091,7 @@ function DepositFlow({
|
|
|
6850
7091
|
targetToken,
|
|
6851
7092
|
service,
|
|
6852
7093
|
solanaProvider,
|
|
6853
|
-
solanaConnection: _optionalChain([reownWallet, 'optionalAccess',
|
|
7094
|
+
solanaConnection: _optionalChain([reownWallet, 'optionalAccess', _222 => _222.solanaConnection]),
|
|
6854
7095
|
uiConfig,
|
|
6855
7096
|
onConfirm: handleSolanaConfirmed,
|
|
6856
7097
|
onError: handleError,
|
|
@@ -6891,7 +7132,7 @@ function DepositFlow({
|
|
|
6891
7132
|
) })
|
|
6892
7133
|
] }) : null,
|
|
6893
7134
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6894
|
-
|
|
7135
|
+
_chunkZDYV536Qcjs.ProcessingStep,
|
|
6895
7136
|
{
|
|
6896
7137
|
smartAccount: effectiveStep.smartAccount,
|
|
6897
7138
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
@@ -6904,7 +7145,6 @@ function DepositFlow({
|
|
|
6904
7145
|
sourceSymbol: effectiveStep.sourceSymbol,
|
|
6905
7146
|
sourceDecimals: effectiveStep.sourceDecimals,
|
|
6906
7147
|
amountUsd: effectiveStep.inputAmountUsd,
|
|
6907
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _232 => _232.length])),
|
|
6908
7148
|
service,
|
|
6909
7149
|
directTransfer: effectiveStep.directTransfer,
|
|
6910
7150
|
onClose,
|
|
@@ -6927,7 +7167,7 @@ function DepositFlow({
|
|
|
6927
7167
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6928
7168
|
DappImportAssetSelectSkeleton,
|
|
6929
7169
|
{
|
|
6930
|
-
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportProvider, 'optionalAccess',
|
|
7170
|
+
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportProvider, 'optionalAccess', _223 => _223.sourceLabel]), () => ( "")),
|
|
6931
7171
|
error: dappImportBootError,
|
|
6932
7172
|
onRetry: handleBootRetry
|
|
6933
7173
|
}
|
|
@@ -6935,16 +7175,16 @@ function DepositFlow({
|
|
|
6935
7175
|
}
|
|
6936
7176
|
);
|
|
6937
7177
|
}
|
|
6938
|
-
if (!_optionalChain([signerContext, 'optionalAccess',
|
|
7178
|
+
if (!_optionalChain([signerContext, 'optionalAccess', _224 => _224.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _225 => _225.publicClient])) {
|
|
6939
7179
|
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\u2026" }) }) }) }) });
|
|
6940
7180
|
}
|
|
6941
7181
|
const ownerAddress = signerContext.ownerAddress;
|
|
6942
|
-
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access',
|
|
7182
|
+
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _226 => _226.walletClient, 'optionalAccess', _227 => _227.chain, 'optionalAccess', _228 => _228.id]), () => ( _optionalChain([signerContext, 'access', _229 => _229.publicClient, 'access', _230 => _230.chain, 'optionalAccess', _231 => _231.id]))), () => ( setupChainId));
|
|
6943
7183
|
const getReadClientForChain = (chainId) => {
|
|
6944
|
-
if (_optionalChain([signerContext, 'access',
|
|
7184
|
+
if (_optionalChain([signerContext, 'access', _232 => _232.publicClient, 'access', _233 => _233.chain, 'optionalAccess', _234 => _234.id]) === chainId) {
|
|
6945
7185
|
return signerContext.publicClient;
|
|
6946
7186
|
}
|
|
6947
|
-
return
|
|
7187
|
+
return _chunkZDYV536Qcjs.getPublicClient.call(void 0, chainId, rpcUrls);
|
|
6948
7188
|
};
|
|
6949
7189
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
6950
7190
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -6974,7 +7214,7 @@ function DepositFlow({
|
|
|
6974
7214
|
effectiveStep.type === "dapp-import-asset-select" && activeDappImportProvider && activeDappImportAvailability && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6975
7215
|
DappImportAssetSelectStep,
|
|
6976
7216
|
{
|
|
6977
|
-
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access',
|
|
7217
|
+
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access', _235 => _235.assets, 'access', _236 => _236[0], 'optionalAccess', _237 => _237.sourceLabel]), () => ( activeDappImportProvider.sourceLabel)),
|
|
6978
7218
|
assets: activeDappImportAvailability.assets,
|
|
6979
7219
|
onSelect: handleDappImportAssetSelected
|
|
6980
7220
|
}
|
|
@@ -7001,7 +7241,7 @@ function DepositFlow({
|
|
|
7001
7241
|
onContinue: handleAmountContinue,
|
|
7002
7242
|
onCtaClick: (ctaName) => {
|
|
7003
7243
|
const receiveSymbol = _chunkABVRVW3Pcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
7004
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
7244
|
+
_optionalChain([onEvent, 'optionalCall', _238 => _238({
|
|
7005
7245
|
type: "deposit_modal_connected_wallet_enter_value_cta_click",
|
|
7006
7246
|
send_token: effectiveStep.asset.symbol,
|
|
7007
7247
|
receive_token: receiveSymbol,
|
|
@@ -7053,7 +7293,7 @@ function DepositFlow({
|
|
|
7053
7293
|
}
|
|
7054
7294
|
),
|
|
7055
7295
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7056
|
-
|
|
7296
|
+
_chunkZDYV536Qcjs.ProcessingStep,
|
|
7057
7297
|
{
|
|
7058
7298
|
smartAccount: effectiveStep.smartAccount,
|
|
7059
7299
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
@@ -7066,7 +7306,6 @@ function DepositFlow({
|
|
|
7066
7306
|
sourceSymbol: effectiveStep.sourceSymbol,
|
|
7067
7307
|
sourceDecimals: effectiveStep.sourceDecimals,
|
|
7068
7308
|
amountUsd: effectiveStep.inputAmountUsd,
|
|
7069
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _249 => _249.length])),
|
|
7070
7309
|
service,
|
|
7071
7310
|
directTransfer: effectiveStep.directTransfer,
|
|
7072
7311
|
uiConfig,
|
|
@@ -7098,7 +7337,7 @@ function formatDate(iso) {
|
|
|
7098
7337
|
month: "short",
|
|
7099
7338
|
year: "numeric"
|
|
7100
7339
|
});
|
|
7101
|
-
} catch (
|
|
7340
|
+
} catch (e32) {
|
|
7102
7341
|
return iso;
|
|
7103
7342
|
}
|
|
7104
7343
|
}
|
|
@@ -7156,7 +7395,7 @@ function formatAmount(rawAmount, token, chainId) {
|
|
|
7156
7395
|
let frac = fracStr.slice(0, 5).replace(/0+$/, "");
|
|
7157
7396
|
if (frac.length < 2) frac = frac.padEnd(2, "0");
|
|
7158
7397
|
return `${whole}.${frac}`;
|
|
7159
|
-
} catch (
|
|
7398
|
+
} catch (e33) {
|
|
7160
7399
|
return rawAmount;
|
|
7161
7400
|
}
|
|
7162
7401
|
}
|
|
@@ -7205,7 +7444,7 @@ function DepositHistoryPanel({
|
|
|
7205
7444
|
);
|
|
7206
7445
|
const visibleDeposits = _react.useMemo.call(void 0, () => {
|
|
7207
7446
|
const sourceHashes = new Set(
|
|
7208
|
-
deposits.map((d) => _optionalChain([d, 'access',
|
|
7447
|
+
deposits.map((d) => _optionalChain([d, 'access', _239 => _239.sourceTxHash, 'optionalAccess', _240 => _240.toLowerCase, 'call', _241 => _241()])).filter((h) => Boolean(h))
|
|
7209
7448
|
);
|
|
7210
7449
|
return deposits.filter(
|
|
7211
7450
|
(d) => !(d.txHash && sourceHashes.has(d.txHash.toLowerCase()))
|
|
@@ -7227,7 +7466,7 @@ function DepositHistoryPanel({
|
|
|
7227
7466
|
className: "rs-modal-header-back",
|
|
7228
7467
|
"aria-label": "Back",
|
|
7229
7468
|
onClick: onClose,
|
|
7230
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7469
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.ChevronLeftIcon, {})
|
|
7231
7470
|
}
|
|
7232
7471
|
) }),
|
|
7233
7472
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: onCloseModal && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -7237,29 +7476,29 @@ function DepositHistoryPanel({
|
|
|
7237
7476
|
className: "rs-modal-close",
|
|
7238
7477
|
"aria-label": "Close",
|
|
7239
7478
|
onClick: onCloseModal,
|
|
7240
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7479
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.CloseIcon, {})
|
|
7241
7480
|
}
|
|
7242
7481
|
) })
|
|
7243
7482
|
] }),
|
|
7244
7483
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen", children: [
|
|
7245
7484
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen-body", children: [
|
|
7246
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7485
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.HistoryIcon, {}), title: "History" }),
|
|
7247
7486
|
isLoading && deposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
7248
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7487
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.HistoryIcon, {}) }),
|
|
7249
7488
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
7250
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7489
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Spinner, { className: "rs-spinner--sm" }),
|
|
7251
7490
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Loading history\u2026" })
|
|
7252
7491
|
] })
|
|
7253
7492
|
] }),
|
|
7254
7493
|
error && !isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
7255
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7494
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.AlertTriangleIcon, {}) }),
|
|
7256
7495
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
7257
7496
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "Couldn't load history" }),
|
|
7258
7497
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: error })
|
|
7259
7498
|
] })
|
|
7260
7499
|
] }),
|
|
7261
7500
|
!isLoading && !error && visibleDeposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
7262
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7501
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.HistoryIcon, {}) }),
|
|
7263
7502
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
7264
7503
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "No deposits yet" }),
|
|
7265
7504
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Your deposit history will appear here" })
|
|
@@ -7279,7 +7518,7 @@ function DepositHistoryPanel({
|
|
|
7279
7518
|
)
|
|
7280
7519
|
] })
|
|
7281
7520
|
] }),
|
|
7282
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7521
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.PoweredBy, {})
|
|
7283
7522
|
] })
|
|
7284
7523
|
]
|
|
7285
7524
|
}
|
|
@@ -7354,7 +7593,7 @@ function HistoryCard({ deposit }) {
|
|
|
7354
7593
|
onClick: (e) => e.stopPropagation(),
|
|
7355
7594
|
children: [
|
|
7356
7595
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: shortenHash(deposit.sourceTxHash) }),
|
|
7357
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7596
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.ArrowUpRightIcon, {})
|
|
7358
7597
|
]
|
|
7359
7598
|
}
|
|
7360
7599
|
)
|
|
@@ -7369,7 +7608,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
|
7369
7608
|
// src/DepositModal.tsx
|
|
7370
7609
|
|
|
7371
7610
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
7372
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
7611
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-J3KYAOD3.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
7373
7612
|
);
|
|
7374
7613
|
function sortByCreatedAtDesc(items) {
|
|
7375
7614
|
return [...items].sort((a, b) => {
|
|
@@ -7430,7 +7669,6 @@ function DepositModalInner({
|
|
|
7430
7669
|
enableQrTransfer = true,
|
|
7431
7670
|
fiatOnrampMethods,
|
|
7432
7671
|
enableExchangeConnect = false,
|
|
7433
|
-
postBridgeActions,
|
|
7434
7672
|
outputTokenRules,
|
|
7435
7673
|
rejectUnmapped,
|
|
7436
7674
|
reownWallet,
|
|
@@ -7448,12 +7686,12 @@ function DepositModalInner({
|
|
|
7448
7686
|
debug
|
|
7449
7687
|
}) {
|
|
7450
7688
|
const modalRef = _react.useRef.call(void 0, null);
|
|
7451
|
-
const onReadyRef =
|
|
7689
|
+
const onReadyRef = _chunkZDYV536Qcjs.useLatestRef.call(void 0, onReady);
|
|
7452
7690
|
const [currentScreen, setCurrentScreen] = _react.useState.call(void 0, "connect");
|
|
7453
7691
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
7454
7692
|
void 0
|
|
7455
7693
|
);
|
|
7456
|
-
const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
7694
|
+
const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _242 => _242.showHistoryButton]), () => ( false));
|
|
7457
7695
|
const historyButtonVisible = showHistoryButton && (currentScreen === "select-asset" || currentScreen === "deposit-address");
|
|
7458
7696
|
const [historyOpen, setHistoryOpen] = _react.useState.call(void 0, false);
|
|
7459
7697
|
const [historyDeposits, setHistoryDeposits] = _react.useState.call(void 0, []);
|
|
@@ -7466,21 +7704,21 @@ function DepositModalInner({
|
|
|
7466
7704
|
const historyLoadedRef = _react.useRef.call(void 0, false);
|
|
7467
7705
|
const targetChain = targetChainProp === "solana" ? "solana" : _chunkABVRVW3Pcjs.getChainId.call(void 0, targetChainProp);
|
|
7468
7706
|
const sourceChain = sourceChainProp ? _chunkABVRVW3Pcjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
7469
|
-
const rpcUrls =
|
|
7707
|
+
const rpcUrls = _chunkZDYV536Qcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
|
|
7470
7708
|
const [recipientIsContract, setRecipientIsContract] = _react.useState.call(void 0, false);
|
|
7471
|
-
const onErrorRef =
|
|
7709
|
+
const onErrorRef = _chunkZDYV536Qcjs.useLatestRef.call(void 0, onError);
|
|
7472
7710
|
_react.useEffect.call(void 0, () => {
|
|
7473
7711
|
if (targetChain !== _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID || !_viem.isAddress.call(void 0, recipient, { strict: false })) {
|
|
7474
7712
|
setRecipientIsContract(false);
|
|
7475
7713
|
return;
|
|
7476
7714
|
}
|
|
7477
7715
|
let cancelled = false;
|
|
7478
|
-
|
|
7716
|
+
_chunkZDYV536Qcjs.getHyperEvmReadClient.call(void 0, rpcUrls).getCode({ address: recipient }).then((code) => {
|
|
7479
7717
|
if (cancelled) return;
|
|
7480
7718
|
const isContract = _chunkABVRVW3Pcjs.isContractBytecode.call(void 0, code);
|
|
7481
7719
|
setRecipientIsContract(isContract);
|
|
7482
7720
|
if (isContract) {
|
|
7483
|
-
_optionalChain([onErrorRef, 'access',
|
|
7721
|
+
_optionalChain([onErrorRef, 'access', _243 => _243.current, 'optionalCall', _244 => _244({
|
|
7484
7722
|
message: "HyperCore deposits require an EOA recipient; the configured recipient is a smart contract.",
|
|
7485
7723
|
code: "HYPERCORE_RECIPIENT_NOT_EOA"
|
|
7486
7724
|
})]);
|
|
@@ -7493,7 +7731,7 @@ function DepositModalInner({
|
|
|
7493
7731
|
};
|
|
7494
7732
|
}, [targetChain, recipient, onErrorRef, rpcUrls]);
|
|
7495
7733
|
const service = _react.useMemo.call(void 0,
|
|
7496
|
-
() =>
|
|
7734
|
+
() => _chunkZDYV536Qcjs.createDepositService.call(void 0, backendUrl, {
|
|
7497
7735
|
debug,
|
|
7498
7736
|
debugScope: "service:deposit"
|
|
7499
7737
|
}),
|
|
@@ -7509,12 +7747,12 @@ function DepositModalInner({
|
|
|
7509
7747
|
}, [store, targetChain, targetToken]);
|
|
7510
7748
|
_react.useEffect.call(void 0, () => {
|
|
7511
7749
|
if (isOpen && modalRef.current) {
|
|
7512
|
-
|
|
7750
|
+
_chunkZDYV536Qcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
7513
7751
|
}
|
|
7514
7752
|
}, [isOpen, theme]);
|
|
7515
7753
|
_react.useEffect.call(void 0, () => {
|
|
7516
7754
|
if (isOpen) {
|
|
7517
|
-
_optionalChain([onReadyRef, 'access',
|
|
7755
|
+
_optionalChain([onReadyRef, 'access', _245 => _245.current, 'optionalCall', _246 => _246()]);
|
|
7518
7756
|
}
|
|
7519
7757
|
}, [isOpen, onReadyRef]);
|
|
7520
7758
|
const handleStepChange = _react.useCallback.call(void 0,
|
|
@@ -7590,10 +7828,10 @@ function DepositModalInner({
|
|
|
7590
7828
|
fetchHistory("initial");
|
|
7591
7829
|
}
|
|
7592
7830
|
}, [historyOpen, fetchHistory]);
|
|
7593
|
-
const onLifecycleRef =
|
|
7831
|
+
const onLifecycleRef = _chunkZDYV536Qcjs.useLatestRef.call(void 0, onLifecycle);
|
|
7594
7832
|
const handleLifecycle = _react.useCallback.call(void 0,
|
|
7595
7833
|
(event) => {
|
|
7596
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7834
|
+
_optionalChain([onLifecycleRef, 'access', _247 => _247.current, 'optionalCall', _248 => _248(event)]);
|
|
7597
7835
|
if (event.type === "smart-account-changed" && !event.evm && !event.solana) {
|
|
7598
7836
|
historyStaleRef.current = true;
|
|
7599
7837
|
}
|
|
@@ -7619,10 +7857,10 @@ function DepositModalInner({
|
|
|
7619
7857
|
store.dispatch({ type: "flow/reset" });
|
|
7620
7858
|
}
|
|
7621
7859
|
}, [isOpen, store]);
|
|
7622
|
-
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
7860
|
+
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _249 => _249.showBackButton]), () => ( true));
|
|
7623
7861
|
const canGoBack = backHandler !== void 0;
|
|
7624
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7625
|
-
|
|
7862
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7863
|
+
_chunkZDYV536Qcjs.Modal,
|
|
7626
7864
|
{
|
|
7627
7865
|
isOpen,
|
|
7628
7866
|
onClose,
|
|
@@ -7638,7 +7876,7 @@ function DepositModalInner({
|
|
|
7638
7876
|
className: "rs-modal-header-back",
|
|
7639
7877
|
"aria-label": "Go back",
|
|
7640
7878
|
onClick: backHandler,
|
|
7641
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7879
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.ChevronLeftIcon, {})
|
|
7642
7880
|
}
|
|
7643
7881
|
) }),
|
|
7644
7882
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
|
|
@@ -7650,7 +7888,7 @@ function DepositModalInner({
|
|
|
7650
7888
|
"aria-label": "Deposit history",
|
|
7651
7889
|
onClick: handleHistoryOpen,
|
|
7652
7890
|
disabled: !recipient,
|
|
7653
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7891
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.HistoryIcon, {})
|
|
7654
7892
|
}
|
|
7655
7893
|
),
|
|
7656
7894
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -7660,12 +7898,12 @@ function DepositModalInner({
|
|
|
7660
7898
|
onClick: onClose,
|
|
7661
7899
|
className: "rs-modal-close",
|
|
7662
7900
|
"aria-label": "Close",
|
|
7663
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7901
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.CloseIcon, {})
|
|
7664
7902
|
}
|
|
7665
7903
|
)
|
|
7666
7904
|
] })
|
|
7667
7905
|
] }),
|
|
7668
|
-
recipientIsContract ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7906
|
+
recipientIsContract ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZDYV536Qcjs.Callout, { variant: "error", children: "HyperCore deposits require an EOA recipient. The configured recipient is a smart contract, which is not supported." }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7669
7907
|
DepositFlow,
|
|
7670
7908
|
{
|
|
7671
7909
|
dappWalletClient,
|
|
@@ -7680,7 +7918,6 @@ function DepositModalInner({
|
|
|
7680
7918
|
amount: defaultAmount,
|
|
7681
7919
|
recipient,
|
|
7682
7920
|
appBalanceUsd,
|
|
7683
|
-
postBridgeActions,
|
|
7684
7921
|
outputTokenRules,
|
|
7685
7922
|
rejectUnmapped,
|
|
7686
7923
|
signerAddress,
|