@rhinestone/deposit-modal 0.3.0-alpha.16 → 0.3.0-alpha.17
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-THU2QG76.mjs → DepositModalReown-ADTQMSTI.mjs} +3 -3
- package/dist/{DepositModalReown-QRLLANTS.cjs → DepositModalReown-XYQNNZAC.cjs} +6 -6
- package/dist/{WithdrawModalReown-SSRJNUGZ.mjs → WithdrawModalReown-EAST32BT.mjs} +3 -3
- package/dist/{WithdrawModalReown-PHWLYDZQ.cjs → WithdrawModalReown-FJ4MPMFA.cjs} +6 -6
- package/dist/{chunk-UD6QUZJS.cjs → chunk-5H72PM2N.cjs} +2 -2
- package/dist/{chunk-G5YDICEN.cjs → chunk-AX4OHTFC.cjs} +54 -54
- package/dist/{chunk-PAK3NUGY.mjs → chunk-BDMPIDTR.mjs} +2 -2
- package/dist/{chunk-YX3I7C2R.mjs → chunk-DHCJGPT3.mjs} +49 -5
- package/dist/{chunk-E2K7XWMN.mjs → chunk-DQ4SKF37.mjs} +1 -1
- package/dist/{chunk-Z7OJPEV2.mjs → chunk-H2FI4RN7.mjs} +38 -0
- package/dist/{chunk-7W5M6WEE.cjs → chunk-LJLTLPHL.cjs} +109 -71
- package/dist/{chunk-PXQBJMNF.cjs → chunk-PSFPXDKE.cjs} +257 -213
- package/dist/deposit.cjs +3 -3
- package/dist/deposit.mjs +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.mjs +3 -3
- package/dist/styles.css +10 -0
- package/dist/withdraw.cjs +3 -3
- package/dist/withdraw.mjs +2 -2
- package/package.json +1 -1
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
|
|
53
|
-
var
|
|
53
|
+
var _chunkLJLTLPHLcjs = require('./chunk-LJLTLPHL.cjs');
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
|
|
@@ -127,13 +127,13 @@ function AssetSelectStep({
|
|
|
127
127
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
128
128
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
129
129
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
130
|
-
return
|
|
130
|
+
return _chunkLJLTLPHLcjs.getAssetId.call(void 0, {
|
|
131
131
|
chainId: defaultSourceChain,
|
|
132
132
|
token: defaultSourceToken
|
|
133
133
|
});
|
|
134
134
|
}, [defaultSourceChain, defaultSourceToken]);
|
|
135
|
-
const onTotalBalanceComputedRef =
|
|
136
|
-
const onAssetsLoadedRef =
|
|
135
|
+
const onTotalBalanceComputedRef = _chunkLJLTLPHLcjs.useLatestRef.call(void 0, onTotalBalanceComputed);
|
|
136
|
+
const onAssetsLoadedRef = _chunkLJLTLPHLcjs.useLatestRef.call(void 0, onAssetsLoaded);
|
|
137
137
|
_react.useEffect.call(void 0, () => {
|
|
138
138
|
let active = true;
|
|
139
139
|
function emitAssetsUpdate(currentAssets) {
|
|
@@ -154,7 +154,7 @@ function AssetSelectStep({
|
|
|
154
154
|
try {
|
|
155
155
|
const portfolio = await service.fetchPortfolio(address);
|
|
156
156
|
if (!active) return;
|
|
157
|
-
const portfolioAssets =
|
|
157
|
+
const portfolioAssets = _chunkLJLTLPHLcjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
158
158
|
setAssets(portfolioAssets);
|
|
159
159
|
emitAssetsUpdate(portfolioAssets);
|
|
160
160
|
const hasNative = portfolioAssets.some(
|
|
@@ -230,7 +230,7 @@ function AssetSelectStep({
|
|
|
230
230
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
231
231
|
const numeric = Number(raw);
|
|
232
232
|
if (!Number.isFinite(numeric)) return raw;
|
|
233
|
-
return
|
|
233
|
+
return _chunkLJLTLPHLcjs.tokenFormatter.format(numeric);
|
|
234
234
|
} catch (e3) {
|
|
235
235
|
return asset.balance;
|
|
236
236
|
}
|
|
@@ -238,20 +238,20 @@ function AssetSelectStep({
|
|
|
238
238
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
239
239
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
240
240
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
241
|
-
|
|
241
|
+
_chunkLJLTLPHLcjs.BodyHeader,
|
|
242
242
|
{
|
|
243
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
243
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.WalletIcon, {}),
|
|
244
244
|
title: "Your assets",
|
|
245
245
|
subtitle: "Select source assets to transfer"
|
|
246
246
|
}
|
|
247
247
|
),
|
|
248
248
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
249
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
249
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
250
250
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
251
251
|
] }),
|
|
252
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
252
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.Callout, { variant: "error", children: error }),
|
|
253
253
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
254
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
254
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
255
255
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
256
256
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
257
257
|
address.slice(0, 6),
|
|
@@ -318,14 +318,14 @@ function AssetSelectStep({
|
|
|
318
318
|
] })
|
|
319
319
|
] })
|
|
320
320
|
] }),
|
|
321
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ?
|
|
321
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunkLJLTLPHLcjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
322
322
|
]
|
|
323
323
|
},
|
|
324
324
|
asset.id
|
|
325
325
|
);
|
|
326
326
|
}) }),
|
|
327
327
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
328
|
-
|
|
328
|
+
_chunkLJLTLPHLcjs.Button,
|
|
329
329
|
{
|
|
330
330
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
331
331
|
disabled: !selectedAsset,
|
|
@@ -334,7 +334,7 @@ function AssetSelectStep({
|
|
|
334
334
|
}
|
|
335
335
|
)
|
|
336
336
|
] }),
|
|
337
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
337
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.PoweredBy, {})
|
|
338
338
|
] });
|
|
339
339
|
}
|
|
340
340
|
async function fetchNativeAssets(address, publicClient, existing) {
|
|
@@ -342,7 +342,7 @@ async function fetchNativeAssets(address, publicClient, existing) {
|
|
|
342
342
|
const connectedChainId = _optionalChain([publicClient, 'access', _9 => _9.chain, 'optionalAccess', _10 => _10.id]);
|
|
343
343
|
if (!connectedChainId) return [];
|
|
344
344
|
if (!_chunkMILJQWPTcjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
|
|
345
|
-
const id =
|
|
345
|
+
const id = _chunkLJLTLPHLcjs.getAssetId.call(void 0, {
|
|
346
346
|
chainId: connectedChainId,
|
|
347
347
|
token: _chunkMILJQWPTcjs.NATIVE_TOKEN_ADDRESS
|
|
348
348
|
});
|
|
@@ -539,7 +539,7 @@ function AmountStep({
|
|
|
539
539
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
540
540
|
if (!balanceTarget || !publicClient) return;
|
|
541
541
|
try {
|
|
542
|
-
const bal =
|
|
542
|
+
const bal = _chunkLJLTLPHLcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
543
543
|
address: asset.token,
|
|
544
544
|
abi: _viem.erc20Abi,
|
|
545
545
|
functionName: "balanceOf",
|
|
@@ -560,7 +560,7 @@ function AmountStep({
|
|
|
560
560
|
hasAttemptedSwitch.current = true;
|
|
561
561
|
switchChain(asset.chainId).catch((err) => {
|
|
562
562
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
563
|
-
setError(
|
|
563
|
+
setError(_chunkLJLTLPHLcjs.formatUserError.call(void 0, raw));
|
|
564
564
|
});
|
|
565
565
|
}
|
|
566
566
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -613,7 +613,7 @@ function AmountStep({
|
|
|
613
613
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
614
614
|
const numeric = Number(raw);
|
|
615
615
|
if (!Number.isFinite(numeric)) return raw;
|
|
616
|
-
return
|
|
616
|
+
return _chunkLJLTLPHLcjs.tokenFormatter.format(numeric);
|
|
617
617
|
} catch (e8) {
|
|
618
618
|
return "\u2026";
|
|
619
619
|
}
|
|
@@ -732,7 +732,7 @@ function AmountStep({
|
|
|
732
732
|
const targetTokenIcon = _chunkMILJQWPTcjs.getTokenIcon.call(void 0, targetSymbol);
|
|
733
733
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
734
734
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
735
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
735
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.WalletIcon, {}), title: "Wallet deposit" }),
|
|
736
736
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
737
737
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
738
738
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -752,13 +752,13 @@ function AmountStep({
|
|
|
752
752
|
" available",
|
|
753
753
|
balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
754
754
|
" (~",
|
|
755
|
-
|
|
755
|
+
_chunkLJLTLPHLcjs.currencyFormatter.format(balanceUsd),
|
|
756
756
|
")"
|
|
757
757
|
] })
|
|
758
758
|
] }),
|
|
759
759
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
760
760
|
"Min. deposit ",
|
|
761
|
-
|
|
761
|
+
_chunkLJLTLPHLcjs.currencyFormatter.format(minDepositUsd)
|
|
762
762
|
] })
|
|
763
763
|
] })
|
|
764
764
|
] }),
|
|
@@ -799,13 +799,13 @@ function AmountStep({
|
|
|
799
799
|
] }),
|
|
800
800
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
801
801
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
802
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
802
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkLJLTLPHLcjs.currencyFormatter.format(balanceAfterUsd) })
|
|
803
803
|
] })
|
|
804
804
|
] }),
|
|
805
|
-
targetChain === _chunkMILJQWPTcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
806
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
805
|
+
targetChain === _chunkMILJQWPTcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
|
|
806
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.Callout, { variant: "error", children: error }),
|
|
807
807
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
808
|
-
|
|
808
|
+
_chunkLJLTLPHLcjs.Button,
|
|
809
809
|
{
|
|
810
810
|
onClick: handleContinue,
|
|
811
811
|
fullWidth: true,
|
|
@@ -816,7 +816,7 @@ function AmountStep({
|
|
|
816
816
|
}
|
|
817
817
|
)
|
|
818
818
|
] }),
|
|
819
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
819
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.PoweredBy, {})
|
|
820
820
|
] });
|
|
821
821
|
}
|
|
822
822
|
|
|
@@ -842,6 +842,7 @@ function ConfirmStep({
|
|
|
842
842
|
estimatedTime = "< 1 min",
|
|
843
843
|
quotedFeeAmount = "0.1",
|
|
844
844
|
quotedFeeSymbol,
|
|
845
|
+
service,
|
|
845
846
|
onConfirm,
|
|
846
847
|
onError,
|
|
847
848
|
onDepositSubmitted,
|
|
@@ -849,6 +850,7 @@ function ConfirmStep({
|
|
|
849
850
|
}) {
|
|
850
851
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
851
852
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
853
|
+
const [quote, setQuote] = _react.useState.call(void 0, null);
|
|
852
854
|
const hasAttemptedSwitch = _react.useRef.call(void 0, false);
|
|
853
855
|
const chainMismatch = Boolean(
|
|
854
856
|
_optionalChain([walletClient, 'optionalAccess', _24 => _24.chain, 'optionalAccess', _25 => _25.id]) && walletClient.chain.id !== asset.chainId
|
|
@@ -882,18 +884,53 @@ function ConfirmStep({
|
|
|
882
884
|
const receiveAmount = sameRoute ? formattedReceiveAmount : `~${formattedReceiveAmount}`;
|
|
883
885
|
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _26 => _26.feeSponsored]), () => ( false));
|
|
884
886
|
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _27 => _27.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
887
|
+
const feeDisplay = quote ? `$${quote.fees.totalUsd.toFixed(2)}` : null;
|
|
888
|
+
const estimatedTimeDisplay = quote ? quote.estimatedFillTimeSeconds < 60 ? "< 1 min" : `~${Math.round(quote.estimatedFillTimeSeconds / 60)} min` : estimatedTime;
|
|
885
889
|
_react.useEffect.call(void 0, () => {
|
|
886
890
|
if (chainMismatch && switchChain && !hasAttemptedSwitch.current) {
|
|
887
891
|
hasAttemptedSwitch.current = true;
|
|
888
892
|
switchChain(asset.chainId).catch((err) => {
|
|
889
893
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
890
|
-
setError(
|
|
894
|
+
setError(_chunkLJLTLPHLcjs.formatUserError.call(void 0, raw));
|
|
891
895
|
});
|
|
892
896
|
}
|
|
893
897
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
894
898
|
_react.useEffect.call(void 0, () => {
|
|
895
899
|
hasAttemptedSwitch.current = false;
|
|
896
900
|
}, [asset.chainId]);
|
|
901
|
+
_react.useEffect.call(void 0, () => {
|
|
902
|
+
if (targetChain === "solana" && asset.chainId === void 0) return;
|
|
903
|
+
let cancelled = false;
|
|
904
|
+
let units;
|
|
905
|
+
try {
|
|
906
|
+
units = _viem.parseUnits.call(void 0, amount, asset.decimals);
|
|
907
|
+
} catch (e12) {
|
|
908
|
+
return;
|
|
909
|
+
}
|
|
910
|
+
if (units <= 0n) return;
|
|
911
|
+
setQuote(null);
|
|
912
|
+
service.getQuotePreview({
|
|
913
|
+
account: smartAccount,
|
|
914
|
+
sourceChainId: asset.chainId,
|
|
915
|
+
sourceToken: asset.token,
|
|
916
|
+
amount: units.toString()
|
|
917
|
+
}).then((result) => {
|
|
918
|
+
if (!cancelled) setQuote(result);
|
|
919
|
+
}).catch(() => {
|
|
920
|
+
if (!cancelled) setQuote(null);
|
|
921
|
+
});
|
|
922
|
+
return () => {
|
|
923
|
+
cancelled = true;
|
|
924
|
+
};
|
|
925
|
+
}, [
|
|
926
|
+
service,
|
|
927
|
+
smartAccount,
|
|
928
|
+
asset.chainId,
|
|
929
|
+
asset.token,
|
|
930
|
+
asset.decimals,
|
|
931
|
+
amount,
|
|
932
|
+
targetChain
|
|
933
|
+
]);
|
|
897
934
|
const handleConfirm = async () => {
|
|
898
935
|
if (!address || !walletClient) {
|
|
899
936
|
setError("Wallet not connected");
|
|
@@ -911,7 +948,7 @@ function ConfirmStep({
|
|
|
911
948
|
let amountUnits;
|
|
912
949
|
try {
|
|
913
950
|
amountUnits = _viem.parseUnits.call(void 0, amount, asset.decimals);
|
|
914
|
-
} catch (
|
|
951
|
+
} catch (e13) {
|
|
915
952
|
setError("Please enter a valid amount");
|
|
916
953
|
return;
|
|
917
954
|
}
|
|
@@ -934,7 +971,7 @@ function ConfirmStep({
|
|
|
934
971
|
const result = await executeTransfer(amountUnits);
|
|
935
972
|
hash = result.txHash;
|
|
936
973
|
resolvedSourceToken = result.sourceToken;
|
|
937
|
-
} else if (
|
|
974
|
+
} else if (_chunkLJLTLPHLcjs.isNativeAsset.call(void 0, asset)) {
|
|
938
975
|
hash = await walletClient.sendTransaction({
|
|
939
976
|
account,
|
|
940
977
|
chain,
|
|
@@ -955,7 +992,7 @@ function ConfirmStep({
|
|
|
955
992
|
onConfirm(hash, asset.chainId, amountUnits.toString(), resolvedSourceToken);
|
|
956
993
|
} catch (err) {
|
|
957
994
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
958
|
-
const message =
|
|
995
|
+
const message = _chunkLJLTLPHLcjs.formatUserError.call(void 0, raw);
|
|
959
996
|
setError(message);
|
|
960
997
|
_optionalChain([onError, 'optionalCall', _29 => _29(message, "TRANSFER_ERROR")]);
|
|
961
998
|
} finally {
|
|
@@ -964,7 +1001,7 @@ function ConfirmStep({
|
|
|
964
1001
|
};
|
|
965
1002
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
966
1003
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
967
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1004
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.WalletIcon, {}), title: "Review deposit" }),
|
|
968
1005
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
|
|
969
1006
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
970
1007
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
@@ -982,7 +1019,7 @@ function ConfirmStep({
|
|
|
982
1019
|
] }),
|
|
983
1020
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
984
1021
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Estimated time" }),
|
|
985
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children:
|
|
1022
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: estimatedTimeDisplay })
|
|
986
1023
|
] }),
|
|
987
1024
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
988
1025
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "You send" }),
|
|
@@ -1009,21 +1046,27 @@ function ConfirmStep({
|
|
|
1009
1046
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1010
1047
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Fees" }),
|
|
1011
1048
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1012
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1049
|
+
feeDisplay === null ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1050
|
+
"span",
|
|
1051
|
+
{
|
|
1052
|
+
className: "rs-skeleton rs-skeleton-fee",
|
|
1053
|
+
"aria-hidden": "true"
|
|
1054
|
+
}
|
|
1055
|
+
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1013
1056
|
"span",
|
|
1014
1057
|
{
|
|
1015
1058
|
style: feeSponsored ? { textDecoration: "line-through" } : void 0,
|
|
1016
|
-
children:
|
|
1059
|
+
children: feeDisplay
|
|
1017
1060
|
}
|
|
1018
1061
|
),
|
|
1019
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1062
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.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, _chunkLJLTLPHLcjs.InfoIcon, {}) }) })
|
|
1020
1063
|
] })
|
|
1021
1064
|
] })
|
|
1022
1065
|
] }),
|
|
1023
|
-
targetChain === _chunkMILJQWPTcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1024
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1066
|
+
targetChain === _chunkMILJQWPTcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
|
|
1067
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.Callout, { variant: "error", children: error }),
|
|
1025
1068
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1026
|
-
|
|
1069
|
+
_chunkLJLTLPHLcjs.Button,
|
|
1027
1070
|
{
|
|
1028
1071
|
onClick: handleConfirm,
|
|
1029
1072
|
loading: isSubmitting,
|
|
@@ -1034,7 +1077,7 @@ function ConfirmStep({
|
|
|
1034
1077
|
}
|
|
1035
1078
|
)
|
|
1036
1079
|
] }),
|
|
1037
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1080
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.PoweredBy, {})
|
|
1038
1081
|
] });
|
|
1039
1082
|
}
|
|
1040
1083
|
|
|
@@ -1057,9 +1100,9 @@ var INITIAL_POLL_INTERVAL = 3e3;
|
|
|
1057
1100
|
var MAX_POLL_INTERVAL = 3e4;
|
|
1058
1101
|
var BACKOFF_MULTIPLIER = 1.5;
|
|
1059
1102
|
function isEventForTx(event, txHash) {
|
|
1060
|
-
const eventTxHash =
|
|
1103
|
+
const eventTxHash = _chunkLJLTLPHLcjs.getEventTxHash.call(void 0, event);
|
|
1061
1104
|
if (!eventTxHash) return false;
|
|
1062
|
-
return
|
|
1105
|
+
return _chunkLJLTLPHLcjs.txRefsMatch.call(void 0, eventTxHash, txHash);
|
|
1063
1106
|
}
|
|
1064
1107
|
function truncateHash(hash) {
|
|
1065
1108
|
return `${hash.slice(0, 4)}\u2026${hash.slice(-4)}`;
|
|
@@ -1109,7 +1152,7 @@ function formatBridgeFailedMessage(event) {
|
|
|
1109
1152
|
}
|
|
1110
1153
|
return "Bridge failed";
|
|
1111
1154
|
}
|
|
1112
|
-
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1155
|
+
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.ExternalLinkIcon, { className: "rs-deposit-notification-link-icon" });
|
|
1113
1156
|
function DepositNotification({
|
|
1114
1157
|
deposit,
|
|
1115
1158
|
smartAccount,
|
|
@@ -1144,7 +1187,7 @@ function DepositNotification({
|
|
|
1144
1187
|
const pollIntervalRef = _react.useRef.call(void 0, INITIAL_POLL_INTERVAL);
|
|
1145
1188
|
const pollTimeoutRef = _react.useRef.call(void 0, null);
|
|
1146
1189
|
const completedRef = _react.useRef.call(void 0, _nullishCoalesce(directTransfer, () => ( false)));
|
|
1147
|
-
const depositContextRef =
|
|
1190
|
+
const depositContextRef = _chunkLJLTLPHLcjs.useLatestRef.call(void 0, {
|
|
1148
1191
|
amount,
|
|
1149
1192
|
sourceChain,
|
|
1150
1193
|
sourceToken: token,
|
|
@@ -1153,8 +1196,8 @@ function DepositNotification({
|
|
|
1153
1196
|
targetToken,
|
|
1154
1197
|
hasPostBridgeActions
|
|
1155
1198
|
});
|
|
1156
|
-
const onCompleteRef =
|
|
1157
|
-
const onFailedRef =
|
|
1199
|
+
const onCompleteRef = _chunkLJLTLPHLcjs.useLatestRef.call(void 0, onComplete);
|
|
1200
|
+
const onFailedRef = _chunkLJLTLPHLcjs.useLatestRef.call(void 0, onFailed);
|
|
1158
1201
|
const handleComplete = _react.useCallback.call(void 0,
|
|
1159
1202
|
(destTxHash) => {
|
|
1160
1203
|
if (completedRef.current) return;
|
|
@@ -1222,7 +1265,7 @@ function DepositNotification({
|
|
|
1222
1265
|
return;
|
|
1223
1266
|
}
|
|
1224
1267
|
scheduleNextPoll();
|
|
1225
|
-
} catch (
|
|
1268
|
+
} catch (e14) {
|
|
1226
1269
|
scheduleNextPoll();
|
|
1227
1270
|
}
|
|
1228
1271
|
}
|
|
@@ -1259,7 +1302,7 @@ function DepositNotification({
|
|
|
1259
1302
|
const destExplorerUrl = destinationTxHash ? _chunkMILJQWPTcjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
|
|
1260
1303
|
const title = status === "complete" ? "Deposit completed" : status === "failed" ? "Deposit failed" : "Deposit received and processing\u2026";
|
|
1261
1304
|
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.";
|
|
1262
|
-
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,
|
|
1305
|
+
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, _chunkLJLTLPHLcjs.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, _chunkLJLTLPHLcjs.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,
|
|
1263
1306
|
"svg",
|
|
1264
1307
|
{
|
|
1265
1308
|
className: "rs-deposit-notification-spinner",
|
|
@@ -1309,7 +1352,7 @@ function DepositNotification({
|
|
|
1309
1352
|
className: "rs-deposit-notification-close",
|
|
1310
1353
|
onClick: () => onDismiss(deposit.id),
|
|
1311
1354
|
"aria-label": "Dismiss",
|
|
1312
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1355
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.CloseIcon, {})
|
|
1313
1356
|
}
|
|
1314
1357
|
)
|
|
1315
1358
|
] }),
|
|
@@ -1325,7 +1368,7 @@ function DepositNotification({
|
|
|
1325
1368
|
"aria-expanded": expanded,
|
|
1326
1369
|
children: [
|
|
1327
1370
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: expanded ? "See less details" : "See more details" }),
|
|
1328
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1371
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.ChevronDownIcon, { className: "rs-deposit-notification-toggle-chevron" })
|
|
1329
1372
|
]
|
|
1330
1373
|
}
|
|
1331
1374
|
),
|
|
@@ -1598,7 +1641,7 @@ function DepositAddressStep({
|
|
|
1598
1641
|
await navigator.clipboard.writeText(displayAddress);
|
|
1599
1642
|
setCopied(true);
|
|
1600
1643
|
setTimeout(() => setCopied(false), 2e3);
|
|
1601
|
-
} catch (
|
|
1644
|
+
} catch (e15) {
|
|
1602
1645
|
const textarea = document.createElement("textarea");
|
|
1603
1646
|
textarea.value = displayAddress;
|
|
1604
1647
|
textarea.style.position = "fixed";
|
|
@@ -1672,10 +1715,10 @@ function DepositAddressStep({
|
|
|
1672
1715
|
return;
|
|
1673
1716
|
}
|
|
1674
1717
|
const event = status.lastEvent;
|
|
1675
|
-
const eventTxHash =
|
|
1718
|
+
const eventTxHash = _chunkLJLTLPHLcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkLJLTLPHLcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
1676
1719
|
if (baselineTxHashRef.current === void 0) {
|
|
1677
1720
|
baselineTxHashRef.current = eventTxHash;
|
|
1678
|
-
} else if (eventTxHash && (!baselineTxHashRef.current || !
|
|
1721
|
+
} else if (eventTxHash && (!baselineTxHashRef.current || !_chunkLJLTLPHLcjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
|
|
1679
1722
|
const details = getDepositEventDetails(event);
|
|
1680
1723
|
const chainId = _nullishCoalesce(details.chainId, () => ( "unknown"));
|
|
1681
1724
|
const amount = _nullishCoalesce(details.amount, () => ( "0"));
|
|
@@ -1752,7 +1795,7 @@ function DepositAddressStep({
|
|
|
1752
1795
|
const qrIconSrc = _chunkMILJQWPTcjs.getChainIcon.call(void 0, sourceChainId);
|
|
1753
1796
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-step--with-notifications", children: [
|
|
1754
1797
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
1755
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1798
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
1756
1799
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", children: [
|
|
1757
1800
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", ref: chainDropdownRef, children: [
|
|
1758
1801
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
@@ -1776,7 +1819,7 @@ function DepositAddressStep({
|
|
|
1776
1819
|
}
|
|
1777
1820
|
),
|
|
1778
1821
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunkMILJQWPTcjs.getChainName.call(void 0, sourceChainId) }),
|
|
1779
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1822
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
1780
1823
|
]
|
|
1781
1824
|
}
|
|
1782
1825
|
),
|
|
@@ -1807,8 +1850,8 @@ function DepositAddressStep({
|
|
|
1807
1850
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
1808
1851
|
"Min.$",
|
|
1809
1852
|
(targetChain === _chunkMILJQWPTcjs.HYPERCORE_CHAIN_ID ? Math.max(_chunkMILJQWPTcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _75 => _75.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _76 => _76.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
1810
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1811
|
-
|
|
1853
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1854
|
+
_chunkLJLTLPHLcjs.InfoIcon,
|
|
1812
1855
|
{
|
|
1813
1856
|
className: "rs-deposit-address-min-icon",
|
|
1814
1857
|
"aria-hidden": "true"
|
|
@@ -1836,7 +1879,7 @@ function DepositAddressStep({
|
|
|
1836
1879
|
}
|
|
1837
1880
|
),
|
|
1838
1881
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceTokenSymbol }),
|
|
1839
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1882
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
1840
1883
|
]
|
|
1841
1884
|
}
|
|
1842
1885
|
),
|
|
@@ -1887,7 +1930,7 @@ function DepositAddressStep({
|
|
|
1887
1930
|
className: "rs-deposit-address-copy",
|
|
1888
1931
|
onClick: handleCopy,
|
|
1889
1932
|
children: [
|
|
1890
|
-
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1933
|
+
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.CopyIcon, {}),
|
|
1891
1934
|
copied ? "Copied!" : "Copy address"
|
|
1892
1935
|
]
|
|
1893
1936
|
}
|
|
@@ -1895,7 +1938,7 @@ function DepositAddressStep({
|
|
|
1895
1938
|
]
|
|
1896
1939
|
}
|
|
1897
1940
|
),
|
|
1898
|
-
targetChain === _chunkMILJQWPTcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1941
|
+
targetChain === _chunkMILJQWPTcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.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." }),
|
|
1899
1942
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1900
1943
|
"div",
|
|
1901
1944
|
{
|
|
@@ -1913,16 +1956,16 @@ function DepositAddressStep({
|
|
|
1913
1956
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
|
|
1914
1957
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
|
|
1915
1958
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1916
|
-
|
|
1959
|
+
_chunkLJLTLPHLcjs.Tooltip,
|
|
1917
1960
|
{
|
|
1918
1961
|
className: "rs-price-impact-info",
|
|
1919
1962
|
content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
|
|
1920
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1963
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.InfoIcon, { "aria-hidden": "true" })
|
|
1921
1964
|
}
|
|
1922
1965
|
)
|
|
1923
1966
|
] }),
|
|
1924
1967
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1925
|
-
|
|
1968
|
+
_chunkLJLTLPHLcjs.ChevronDownIcon,
|
|
1926
1969
|
{
|
|
1927
1970
|
className: "rs-price-impact-chevron",
|
|
1928
1971
|
"aria-hidden": "true"
|
|
@@ -1933,29 +1976,29 @@ function DepositAddressStep({
|
|
|
1933
1976
|
),
|
|
1934
1977
|
/* @__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: [
|
|
1935
1978
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
1936
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1979
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.PercentIcon, {}) }),
|
|
1937
1980
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
1938
1981
|
"Max slippage: ",
|
|
1939
1982
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.2%" })
|
|
1940
1983
|
] }),
|
|
1941
1984
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1942
|
-
|
|
1985
|
+
_chunkLJLTLPHLcjs.Tooltip,
|
|
1943
1986
|
{
|
|
1944
1987
|
className: "rs-price-impact-info",
|
|
1945
1988
|
content: "Slippage accounts for price changes during execution. Slippage is adjusted per pair to ensure reliable execution.",
|
|
1946
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1989
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.InfoIcon, { "aria-hidden": "true" })
|
|
1947
1990
|
}
|
|
1948
1991
|
)
|
|
1949
1992
|
] }),
|
|
1950
1993
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
1951
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1994
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.ClockIcon, {}) }),
|
|
1952
1995
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
1953
1996
|
"Processing time: ",
|
|
1954
1997
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "< 1 min" })
|
|
1955
1998
|
] })
|
|
1956
1999
|
] }),
|
|
1957
2000
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
1958
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2001
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.PlusCircleIcon, {}) }),
|
|
1959
2002
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
1960
2003
|
"Max deposit:",
|
|
1961
2004
|
" ",
|
|
@@ -1987,7 +2030,7 @@ function DepositAddressStep({
|
|
|
1987
2030
|
},
|
|
1988
2031
|
deposit.id
|
|
1989
2032
|
)) }),
|
|
1990
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2033
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.PoweredBy, {})
|
|
1991
2034
|
] });
|
|
1992
2035
|
}
|
|
1993
2036
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -2024,7 +2067,7 @@ function SwappedOrderTracker({
|
|
|
2024
2067
|
];
|
|
2025
2068
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-swapped-tracker", children: [
|
|
2026
2069
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2027
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2070
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.HandCoinsIcon, {}), title }),
|
|
2028
2071
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ol", { className: "rs-swapped-tracker-steps", children: labels.map((label, idx) => {
|
|
2029
2072
|
const status = stepStates[idx];
|
|
2030
2073
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
@@ -2038,7 +2081,7 @@ function SwappedOrderTracker({
|
|
|
2038
2081
|
{
|
|
2039
2082
|
className: "rs-swapped-tracker-step-marker",
|
|
2040
2083
|
"aria-hidden": "true",
|
|
2041
|
-
children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2084
|
+
children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.CheckIcon, {}) : status === "failed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.CloseIcon, {}) : status === "active" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.Spinner, {}) : null
|
|
2042
2085
|
}
|
|
2043
2086
|
)
|
|
2044
2087
|
]
|
|
@@ -2065,7 +2108,7 @@ function SwappedOrderTracker({
|
|
|
2065
2108
|
}
|
|
2066
2109
|
)
|
|
2067
2110
|
] }),
|
|
2068
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2111
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.PoweredBy, {})
|
|
2069
2112
|
] });
|
|
2070
2113
|
}
|
|
2071
2114
|
function formatTrackerAmount(amount) {
|
|
@@ -2102,7 +2145,7 @@ function parseSwappedIframeMessage(raw) {
|
|
|
2102
2145
|
if (typeof data === "string") {
|
|
2103
2146
|
try {
|
|
2104
2147
|
data = JSON.parse(data);
|
|
2105
|
-
} catch (
|
|
2148
|
+
} catch (e16) {
|
|
2106
2149
|
return null;
|
|
2107
2150
|
}
|
|
2108
2151
|
}
|
|
@@ -2208,7 +2251,7 @@ function SwappedIframeStep({
|
|
|
2208
2251
|
if (isCurrentOrder) {
|
|
2209
2252
|
setOrderState(res);
|
|
2210
2253
|
}
|
|
2211
|
-
} catch (
|
|
2254
|
+
} catch (e17) {
|
|
2212
2255
|
}
|
|
2213
2256
|
if (!cancelled) {
|
|
2214
2257
|
timeoutId = setTimeout(poll, STATUS_POLL_INTERVAL_MS);
|
|
@@ -2229,14 +2272,14 @@ function SwappedIframeStep({
|
|
|
2229
2272
|
const status = await service.fetchLatestStatus(smartAccount);
|
|
2230
2273
|
if (cancelled) return;
|
|
2231
2274
|
const event = status.lastEvent;
|
|
2232
|
-
const eventTxHash =
|
|
2275
|
+
const eventTxHash = _chunkLJLTLPHLcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkLJLTLPHLcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
2233
2276
|
if (baselineDepositTxHashRef.current === void 0) {
|
|
2234
2277
|
baselineDepositTxHashRef.current = eventTxHash;
|
|
2235
|
-
} else if (eventTxHash && (!baselineDepositTxHashRef.current || !
|
|
2278
|
+
} else if (eventTxHash && (!baselineDepositTxHashRef.current || !_chunkLJLTLPHLcjs.txRefsMatch.call(void 0, eventTxHash, baselineDepositTxHashRef.current))) {
|
|
2236
2279
|
currentDepositTxHashRef.current = eventTxHash;
|
|
2237
2280
|
setLatestEvent(_nullishCoalesce(event, () => ( null)));
|
|
2238
2281
|
}
|
|
2239
|
-
} catch (
|
|
2282
|
+
} catch (e18) {
|
|
2240
2283
|
}
|
|
2241
2284
|
if (!cancelled) {
|
|
2242
2285
|
const nextInterval = fastDepositPollEnabledRef.current ? DEPOSIT_POLL_FAST_INTERVAL_MS : DEPOSIT_POLL_INTERVAL_MS;
|
|
@@ -2293,10 +2336,10 @@ function SwappedIframeStep({
|
|
|
2293
2336
|
[orderState, latestEvent]
|
|
2294
2337
|
);
|
|
2295
2338
|
const terminalState = _react.useMemo.call(void 0, () => {
|
|
2296
|
-
if (
|
|
2339
|
+
if (_chunkLJLTLPHLcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
|
|
2297
2340
|
return {
|
|
2298
2341
|
kind: "failed",
|
|
2299
|
-
message:
|
|
2342
|
+
message: _chunkLJLTLPHLcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
|
|
2300
2343
|
};
|
|
2301
2344
|
}
|
|
2302
2345
|
if (_optionalChain([orderState, 'optionalAccess', _91 => _91.status]) === "order_cancelled") {
|
|
@@ -2318,19 +2361,19 @@ function SwappedIframeStep({
|
|
|
2318
2361
|
orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _93 => _93.orderCrypto]), () => ( null)),
|
|
2319
2362
|
// Base-unit source amount from the deposit row/event, consistent with the
|
|
2320
2363
|
// wallet/QR path. ProcessingStep + onLifecycle expect base units.
|
|
2321
|
-
amount: _nullishCoalesce(
|
|
2364
|
+
amount: _nullishCoalesce(_chunkLJLTLPHLcjs.getEventSourceDetails.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0))).amount, () => ( null))
|
|
2322
2365
|
});
|
|
2323
2366
|
}, [latestEvent, orderState]);
|
|
2324
2367
|
_react.useEffect.call(void 0, () => {
|
|
2325
2368
|
if (failedFiredRef.current || completeFiredRef.current) return;
|
|
2326
|
-
if (!
|
|
2369
|
+
if (!_chunkLJLTLPHLcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) return;
|
|
2327
2370
|
const txHash = currentDepositTxHashRef.current;
|
|
2328
2371
|
if (!txHash) return;
|
|
2329
2372
|
failedFiredRef.current = true;
|
|
2330
2373
|
setPhase("tracker");
|
|
2331
2374
|
_optionalChain([onSwappedFailedRef, 'access', _94 => _94.current, 'optionalCall', _95 => _95(
|
|
2332
2375
|
txHash,
|
|
2333
|
-
|
|
2376
|
+
_chunkLJLTLPHLcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
|
|
2334
2377
|
)]);
|
|
2335
2378
|
}, [latestEvent]);
|
|
2336
2379
|
if (phase === "tracker") {
|
|
@@ -2349,9 +2392,9 @@ function SwappedIframeStep({
|
|
|
2349
2392
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-fiat-onramp", "data-variant": variant, children: [
|
|
2350
2393
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2351
2394
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2352
|
-
|
|
2395
|
+
_chunkLJLTLPHLcjs.BodyHeader,
|
|
2353
2396
|
{
|
|
2354
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2397
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.HandCoinsIcon, {}),
|
|
2355
2398
|
title: "Deposit",
|
|
2356
2399
|
subtitle: "Add money to your balance"
|
|
2357
2400
|
}
|
|
@@ -2369,7 +2412,7 @@ function SwappedIframeStep({
|
|
|
2369
2412
|
}
|
|
2370
2413
|
)
|
|
2371
2414
|
] }),
|
|
2372
|
-
!loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2415
|
+
!loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.Spinner, {}) }),
|
|
2373
2416
|
widgetUrl && !loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2374
2417
|
"iframe",
|
|
2375
2418
|
{
|
|
@@ -2384,11 +2427,11 @@ function SwappedIframeStep({
|
|
|
2384
2427
|
)
|
|
2385
2428
|
] })
|
|
2386
2429
|
] }),
|
|
2387
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2430
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.PoweredBy, {})
|
|
2388
2431
|
] });
|
|
2389
2432
|
}
|
|
2390
2433
|
function deriveStepStates(swappedStatus, latestEvent) {
|
|
2391
|
-
if (
|
|
2434
|
+
if (_chunkLJLTLPHLcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
|
|
2392
2435
|
return ["complete", "complete", "failed", "pending"];
|
|
2393
2436
|
}
|
|
2394
2437
|
if (swappedStatus === "order_cancelled") {
|
|
@@ -2558,7 +2601,7 @@ ExchangeConnectStep.displayName = "ExchangeConnectStep";
|
|
|
2558
2601
|
function ExchangeLogo({ exchange }) {
|
|
2559
2602
|
const [failed, setFailed] = _react.useState.call(void 0, false);
|
|
2560
2603
|
if (!exchange.logoUrl || failed) {
|
|
2561
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2604
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.BankIcon, {});
|
|
2562
2605
|
}
|
|
2563
2606
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2564
2607
|
"img",
|
|
@@ -2604,14 +2647,14 @@ function ExchangeSelectStep({
|
|
|
2604
2647
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-exchange-select", children: [
|
|
2605
2648
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2606
2649
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2607
|
-
|
|
2650
|
+
_chunkLJLTLPHLcjs.BodyHeader,
|
|
2608
2651
|
{
|
|
2609
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2652
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.BankIcon, {}),
|
|
2610
2653
|
title: "Fund from Exchange",
|
|
2611
2654
|
subtitle: "Choose your exchange"
|
|
2612
2655
|
}
|
|
2613
2656
|
),
|
|
2614
|
-
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2657
|
+
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.Spinner, {}) }),
|
|
2615
2658
|
!loading && error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: [
|
|
2616
2659
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state-title", children: "Couldn\u2019t load exchanges" }),
|
|
2617
2660
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2651,7 +2694,7 @@ function ExchangeSelectStep({
|
|
|
2651
2694
|
exchange.connection
|
|
2652
2695
|
)) })
|
|
2653
2696
|
] }),
|
|
2654
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2697
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.PoweredBy, {})
|
|
2655
2698
|
] });
|
|
2656
2699
|
}
|
|
2657
2700
|
ExchangeSelectStep.displayName = "ExchangeSelectStep";
|
|
@@ -2681,7 +2724,7 @@ function DepositAddressSkeleton({
|
|
|
2681
2724
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", "aria-busy": "true", children: [
|
|
2682
2725
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: "Preparing deposit details\u2026" }),
|
|
2683
2726
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
2684
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2727
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
2685
2728
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", "aria-hidden": "true", children: [
|
|
2686
2729
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
2687
2730
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
@@ -2695,7 +2738,7 @@ function DepositAddressSkeleton({
|
|
|
2695
2738
|
}
|
|
2696
2739
|
),
|
|
2697
2740
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainName }),
|
|
2698
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2741
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2699
2742
|
] })
|
|
2700
2743
|
] }),
|
|
2701
2744
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
@@ -2704,8 +2747,8 @@ function DepositAddressSkeleton({
|
|
|
2704
2747
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
2705
2748
|
"Min.$",
|
|
2706
2749
|
(_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _103 => _103.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
2707
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2708
|
-
|
|
2750
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2751
|
+
_chunkLJLTLPHLcjs.InfoIcon,
|
|
2709
2752
|
{
|
|
2710
2753
|
className: "rs-deposit-address-min-icon",
|
|
2711
2754
|
"aria-hidden": "true"
|
|
@@ -2723,7 +2766,7 @@ function DepositAddressSkeleton({
|
|
|
2723
2766
|
}
|
|
2724
2767
|
),
|
|
2725
2768
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: defaultToken }),
|
|
2726
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2769
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2727
2770
|
] })
|
|
2728
2771
|
] })
|
|
2729
2772
|
] }),
|
|
@@ -2744,7 +2787,7 @@ function DepositAddressSkeleton({
|
|
|
2744
2787
|
disabled: true,
|
|
2745
2788
|
"aria-hidden": "true",
|
|
2746
2789
|
children: [
|
|
2747
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2790
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.CopyIcon, {}),
|
|
2748
2791
|
"Copy address"
|
|
2749
2792
|
]
|
|
2750
2793
|
}
|
|
@@ -2757,16 +2800,16 @@ function DepositAddressSkeleton({
|
|
|
2757
2800
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
|
|
2758
2801
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
|
|
2759
2802
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2760
|
-
|
|
2803
|
+
_chunkLJLTLPHLcjs.Tooltip,
|
|
2761
2804
|
{
|
|
2762
2805
|
className: "rs-price-impact-info",
|
|
2763
2806
|
content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
|
|
2764
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2807
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.InfoIcon, { "aria-hidden": "true" })
|
|
2765
2808
|
}
|
|
2766
2809
|
)
|
|
2767
2810
|
] }),
|
|
2768
2811
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2769
|
-
|
|
2812
|
+
_chunkLJLTLPHLcjs.ChevronDownIcon,
|
|
2770
2813
|
{
|
|
2771
2814
|
className: "rs-price-impact-chevron",
|
|
2772
2815
|
"aria-hidden": "true"
|
|
@@ -2774,7 +2817,7 @@ function DepositAddressSkeleton({
|
|
|
2774
2817
|
)
|
|
2775
2818
|
] }) })
|
|
2776
2819
|
] }),
|
|
2777
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2820
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.PoweredBy, {})
|
|
2778
2821
|
] });
|
|
2779
2822
|
}
|
|
2780
2823
|
DepositAddressSkeleton.displayName = "DepositAddressSkeleton";
|
|
@@ -2806,7 +2849,7 @@ function SolanaTokenSelectStep({
|
|
|
2806
2849
|
setError(null);
|
|
2807
2850
|
const portfolioBySymbol = {};
|
|
2808
2851
|
try {
|
|
2809
|
-
|
|
2852
|
+
_chunkLJLTLPHLcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
|
|
2810
2853
|
solanaAddress
|
|
2811
2854
|
});
|
|
2812
2855
|
const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
|
|
@@ -2817,7 +2860,7 @@ function SolanaTokenSelectStep({
|
|
|
2817
2860
|
let parsed = 0n;
|
|
2818
2861
|
try {
|
|
2819
2862
|
parsed = BigInt(t.balance || "0");
|
|
2820
|
-
} catch (
|
|
2863
|
+
} catch (e19) {
|
|
2821
2864
|
parsed = 0n;
|
|
2822
2865
|
}
|
|
2823
2866
|
if (parsed <= 0n) continue;
|
|
@@ -2829,12 +2872,12 @@ function SolanaTokenSelectStep({
|
|
|
2829
2872
|
};
|
|
2830
2873
|
}
|
|
2831
2874
|
}
|
|
2832
|
-
|
|
2875
|
+
_chunkLJLTLPHLcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
|
|
2833
2876
|
symbols: Object.keys(portfolioBySymbol)
|
|
2834
2877
|
});
|
|
2835
2878
|
} catch (err) {
|
|
2836
2879
|
if (!active) return;
|
|
2837
|
-
|
|
2880
|
+
_chunkLJLTLPHLcjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
|
|
2838
2881
|
solanaAddress
|
|
2839
2882
|
});
|
|
2840
2883
|
setError(
|
|
@@ -2881,8 +2924,8 @@ function SolanaTokenSelectStep({
|
|
|
2881
2924
|
const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
|
|
2882
2925
|
const numeric = Number(raw);
|
|
2883
2926
|
if (!Number.isFinite(numeric)) return raw;
|
|
2884
|
-
return
|
|
2885
|
-
} catch (
|
|
2927
|
+
return _chunkLJLTLPHLcjs.tokenFormatter.format(numeric);
|
|
2928
|
+
} catch (e20) {
|
|
2886
2929
|
return "--";
|
|
2887
2930
|
}
|
|
2888
2931
|
};
|
|
@@ -2891,20 +2934,20 @@ function SolanaTokenSelectStep({
|
|
|
2891
2934
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
2892
2935
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
2893
2936
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2894
|
-
|
|
2937
|
+
_chunkLJLTLPHLcjs.BodyHeader,
|
|
2895
2938
|
{
|
|
2896
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2939
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.WalletIcon, {}),
|
|
2897
2940
|
title: "Your assets",
|
|
2898
2941
|
subtitle: "Select source assets to transfer"
|
|
2899
2942
|
}
|
|
2900
2943
|
),
|
|
2901
2944
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
2902
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2945
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
2903
2946
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
2904
2947
|
] }),
|
|
2905
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2948
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.Callout, { variant: "error", children: error }),
|
|
2906
2949
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
2907
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2950
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
2908
2951
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
2909
2952
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
2910
2953
|
solanaAddress.slice(0, 6),
|
|
@@ -2953,14 +2996,14 @@ function SolanaTokenSelectStep({
|
|
|
2953
2996
|
] })
|
|
2954
2997
|
] })
|
|
2955
2998
|
] }),
|
|
2956
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ?
|
|
2999
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunkLJLTLPHLcjs.currencyFormatter.format(entry.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${entry.token.symbol}` : "--" })
|
|
2957
3000
|
]
|
|
2958
3001
|
},
|
|
2959
3002
|
entry.token.symbol
|
|
2960
3003
|
);
|
|
2961
3004
|
}) }),
|
|
2962
3005
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2963
|
-
|
|
3006
|
+
_chunkLJLTLPHLcjs.Button,
|
|
2964
3007
|
{
|
|
2965
3008
|
onClick: () => selectedEntry && onContinue(
|
|
2966
3009
|
selectedEntry.token,
|
|
@@ -2973,7 +3016,7 @@ function SolanaTokenSelectStep({
|
|
|
2973
3016
|
}
|
|
2974
3017
|
)
|
|
2975
3018
|
] }),
|
|
2976
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3019
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.PoweredBy, {})
|
|
2977
3020
|
] });
|
|
2978
3021
|
}
|
|
2979
3022
|
|
|
@@ -3016,7 +3059,7 @@ function SolanaAmountStep({
|
|
|
3016
3059
|
}
|
|
3017
3060
|
const price = balanceUsd / balanceUnits;
|
|
3018
3061
|
return price > 0 ? price : null;
|
|
3019
|
-
} catch (
|
|
3062
|
+
} catch (e21) {
|
|
3020
3063
|
return null;
|
|
3021
3064
|
}
|
|
3022
3065
|
}, [isSourceStablecoin, balance, token.decimals, balanceUsd]);
|
|
@@ -3026,8 +3069,8 @@ function SolanaAmountStep({
|
|
|
3026
3069
|
const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
|
|
3027
3070
|
const numeric = Number(raw);
|
|
3028
3071
|
if (!Number.isFinite(numeric)) return raw;
|
|
3029
|
-
return
|
|
3030
|
-
} catch (
|
|
3072
|
+
return _chunkLJLTLPHLcjs.tokenFormatter.format(numeric);
|
|
3073
|
+
} catch (e22) {
|
|
3031
3074
|
return "\u2026";
|
|
3032
3075
|
}
|
|
3033
3076
|
}, [balance, token.decimals]);
|
|
@@ -3038,7 +3081,7 @@ function SolanaAmountStep({
|
|
|
3038
3081
|
if (tokenPriceUsd !== null) return balanceUnits * tokenPriceUsd;
|
|
3039
3082
|
if (Number.isFinite(balanceUsd) && balanceUsd > 0) return balanceUsd;
|
|
3040
3083
|
return null;
|
|
3041
|
-
} catch (
|
|
3084
|
+
} catch (e23) {
|
|
3042
3085
|
return null;
|
|
3043
3086
|
}
|
|
3044
3087
|
}, [balance, token.decimals, tokenPriceUsd, balanceUsd]);
|
|
@@ -3052,7 +3095,7 @@ function SolanaAmountStep({
|
|
|
3052
3095
|
if (!Number.isFinite(spendableUnits) || spendableUnits < 0) return null;
|
|
3053
3096
|
if (tokenPriceUsd !== null) return spendableUnits * tokenPriceUsd;
|
|
3054
3097
|
return null;
|
|
3055
|
-
} catch (
|
|
3098
|
+
} catch (e24) {
|
|
3056
3099
|
return null;
|
|
3057
3100
|
}
|
|
3058
3101
|
}, [spendableBalance, token.decimals, tokenPriceUsd]);
|
|
@@ -3067,7 +3110,7 @@ function SolanaAmountStep({
|
|
|
3067
3110
|
const factor = 1e3;
|
|
3068
3111
|
const truncated = Math.floor(value * factor) / factor;
|
|
3069
3112
|
return truncated.toFixed(3).replace(/\.?0+$/, "");
|
|
3070
|
-
} catch (
|
|
3113
|
+
} catch (e25) {
|
|
3071
3114
|
return "";
|
|
3072
3115
|
}
|
|
3073
3116
|
},
|
|
@@ -3104,7 +3147,7 @@ function SolanaAmountStep({
|
|
|
3104
3147
|
const raw = isSourceStablecoin || !hasPricing ? numericAmount : numericAmount / (_nullishCoalesce(tokenPriceUsd, () => ( 1)));
|
|
3105
3148
|
try {
|
|
3106
3149
|
return _viem.parseUnits.call(void 0, raw.toString(), token.decimals);
|
|
3107
|
-
} catch (
|
|
3150
|
+
} catch (e26) {
|
|
3108
3151
|
return null;
|
|
3109
3152
|
}
|
|
3110
3153
|
}, [numericAmount, isSourceStablecoin, hasPricing, tokenPriceUsd, token.decimals]);
|
|
@@ -3119,7 +3162,7 @@ function SolanaAmountStep({
|
|
|
3119
3162
|
const handlePresetClick = (percentage) => {
|
|
3120
3163
|
const formatted = computePresetAmount(percentage);
|
|
3121
3164
|
if (!formatted) return;
|
|
3122
|
-
|
|
3165
|
+
_chunkLJLTLPHLcjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
|
|
3123
3166
|
percentage,
|
|
3124
3167
|
symbol: token.symbol,
|
|
3125
3168
|
formatted
|
|
@@ -3153,8 +3196,8 @@ function SolanaAmountStep({
|
|
|
3153
3196
|
let amountInUnits;
|
|
3154
3197
|
try {
|
|
3155
3198
|
amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
|
|
3156
|
-
} catch (
|
|
3157
|
-
|
|
3199
|
+
} catch (e27) {
|
|
3200
|
+
_chunkLJLTLPHLcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
3158
3201
|
amount,
|
|
3159
3202
|
sourceAmount: sourceAmountStr,
|
|
3160
3203
|
reason: "parse-units-failed"
|
|
@@ -3169,7 +3212,7 @@ function SolanaAmountStep({
|
|
|
3169
3212
|
);
|
|
3170
3213
|
return;
|
|
3171
3214
|
}
|
|
3172
|
-
|
|
3215
|
+
_chunkLJLTLPHLcjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
|
|
3173
3216
|
symbol: token.symbol,
|
|
3174
3217
|
inputAmountUsd: amount,
|
|
3175
3218
|
sourceAmount: sourceAmountStr,
|
|
@@ -3183,7 +3226,7 @@ function SolanaAmountStep({
|
|
|
3183
3226
|
const sourceTokenIcon = _chunkMILJQWPTcjs.getTokenIcon.call(void 0, token.symbol);
|
|
3184
3227
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
3185
3228
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3186
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3229
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.WalletIcon, {}), title: "Wallet deposit" }),
|
|
3187
3230
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
3188
3231
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
3189
3232
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3203,13 +3246,13 @@ function SolanaAmountStep({
|
|
|
3203
3246
|
" available",
|
|
3204
3247
|
computedBalanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
3205
3248
|
" (~",
|
|
3206
|
-
|
|
3249
|
+
_chunkLJLTLPHLcjs.currencyFormatter.format(computedBalanceUsd),
|
|
3207
3250
|
")"
|
|
3208
3251
|
] })
|
|
3209
3252
|
] }),
|
|
3210
3253
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
3211
3254
|
"Min. deposit ",
|
|
3212
|
-
|
|
3255
|
+
_chunkLJLTLPHLcjs.currencyFormatter.format(minDepositUsd)
|
|
3213
3256
|
] })
|
|
3214
3257
|
] })
|
|
3215
3258
|
] }),
|
|
@@ -3248,13 +3291,13 @@ function SolanaAmountStep({
|
|
|
3248
3291
|
] }),
|
|
3249
3292
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
3250
3293
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
3251
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
3294
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkLJLTLPHLcjs.currencyFormatter.format(balanceAfterUsd) })
|
|
3252
3295
|
] })
|
|
3253
3296
|
] }),
|
|
3254
|
-
targetChain === _chunkMILJQWPTcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3255
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3297
|
+
targetChain === _chunkMILJQWPTcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
|
|
3298
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.Callout, { variant: "error", children: error }),
|
|
3256
3299
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3257
|
-
|
|
3300
|
+
_chunkLJLTLPHLcjs.Button,
|
|
3258
3301
|
{
|
|
3259
3302
|
onClick: handleContinue,
|
|
3260
3303
|
fullWidth: true,
|
|
@@ -3263,7 +3306,7 @@ function SolanaAmountStep({
|
|
|
3263
3306
|
}
|
|
3264
3307
|
)
|
|
3265
3308
|
] }),
|
|
3266
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3309
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.PoweredBy, {})
|
|
3267
3310
|
] });
|
|
3268
3311
|
}
|
|
3269
3312
|
|
|
@@ -3430,7 +3473,7 @@ function SolanaConfirmStep({
|
|
|
3430
3473
|
const receiveAmount = isSameToken ? formattedReceiveAmount : `~${formattedReceiveAmount}`;
|
|
3431
3474
|
const handleConfirm = async () => {
|
|
3432
3475
|
if (!solanaProvider) {
|
|
3433
|
-
|
|
3476
|
+
_chunkLJLTLPHLcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
3434
3477
|
reason: "missing-provider"
|
|
3435
3478
|
});
|
|
3436
3479
|
setError("Solana wallet not connected");
|
|
@@ -3438,7 +3481,7 @@ function SolanaConfirmStep({
|
|
|
3438
3481
|
}
|
|
3439
3482
|
const parsedAmount = parseFloat(sourceAmount);
|
|
3440
3483
|
if (isNaN(parsedAmount) || parsedAmount <= 0) {
|
|
3441
|
-
|
|
3484
|
+
_chunkLJLTLPHLcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
3442
3485
|
reason: "invalid-amount",
|
|
3443
3486
|
sourceAmount
|
|
3444
3487
|
});
|
|
@@ -3447,7 +3490,7 @@ function SolanaConfirmStep({
|
|
|
3447
3490
|
}
|
|
3448
3491
|
setError(null);
|
|
3449
3492
|
setIsSubmitting(true);
|
|
3450
|
-
|
|
3493
|
+
_chunkLJLTLPHLcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
|
|
3451
3494
|
smartAccount,
|
|
3452
3495
|
solanaAddress,
|
|
3453
3496
|
solanaDepositAddress,
|
|
@@ -3457,7 +3500,7 @@ function SolanaConfirmStep({
|
|
|
3457
3500
|
});
|
|
3458
3501
|
try {
|
|
3459
3502
|
const check = await service.checkAccount(smartAccount);
|
|
3460
|
-
|
|
3503
|
+
_chunkLJLTLPHLcjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
|
|
3461
3504
|
smartAccount,
|
|
3462
3505
|
isRegistered: check.isRegistered,
|
|
3463
3506
|
targetChain: check.targetChain,
|
|
@@ -3470,7 +3513,7 @@ function SolanaConfirmStep({
|
|
|
3470
3513
|
}
|
|
3471
3514
|
const connection = hasConfiguredSolanaRpcUrl() ? getSolanaConnection() : _nullishCoalesce(solanaConnection, () => ( getSolanaConnection()));
|
|
3472
3515
|
const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
|
|
3473
|
-
|
|
3516
|
+
_chunkLJLTLPHLcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
|
|
3474
3517
|
token: token.symbol,
|
|
3475
3518
|
sourceAmount,
|
|
3476
3519
|
amountUnits: amountUnits.toString()
|
|
@@ -3487,7 +3530,7 @@ function SolanaConfirmStep({
|
|
|
3487
3530
|
token.mint,
|
|
3488
3531
|
amountUnits
|
|
3489
3532
|
);
|
|
3490
|
-
|
|
3533
|
+
_chunkLJLTLPHLcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
3491
3534
|
token: token.symbol,
|
|
3492
3535
|
instructionCount: transaction.instructions.length,
|
|
3493
3536
|
feePayer: _optionalChain([transaction, 'access', _116 => _116.feePayer, 'optionalAccess', _117 => _117.toBase58, 'call', _118 => _118()]),
|
|
@@ -3498,15 +3541,15 @@ function SolanaConfirmStep({
|
|
|
3498
3541
|
connection,
|
|
3499
3542
|
transaction
|
|
3500
3543
|
);
|
|
3501
|
-
|
|
3544
|
+
_chunkLJLTLPHLcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
|
|
3502
3545
|
txHash,
|
|
3503
3546
|
amountUnits: amountUnits.toString()
|
|
3504
3547
|
});
|
|
3505
3548
|
onConfirm(txHash, amountUnits.toString());
|
|
3506
3549
|
} catch (err) {
|
|
3507
3550
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
3508
|
-
const message =
|
|
3509
|
-
|
|
3551
|
+
const message = _chunkLJLTLPHLcjs.formatUserError.call(void 0, raw);
|
|
3552
|
+
_chunkLJLTLPHLcjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
|
|
3510
3553
|
smartAccount,
|
|
3511
3554
|
token: token.symbol,
|
|
3512
3555
|
sourceAmount
|
|
@@ -3519,7 +3562,7 @@ function SolanaConfirmStep({
|
|
|
3519
3562
|
};
|
|
3520
3563
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
3521
3564
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3522
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3565
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.WalletIcon, {}), title: "Review deposit" }),
|
|
3523
3566
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
|
|
3524
3567
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
3525
3568
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
@@ -3571,13 +3614,13 @@ function SolanaConfirmStep({
|
|
|
3571
3614
|
children: "$0.04"
|
|
3572
3615
|
}
|
|
3573
3616
|
),
|
|
3574
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3617
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.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, _chunkLJLTLPHLcjs.InfoIcon, {}) }) })
|
|
3575
3618
|
] })
|
|
3576
3619
|
] })
|
|
3577
3620
|
] }),
|
|
3578
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3621
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.Callout, { variant: "error", children: error }),
|
|
3579
3622
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3580
|
-
|
|
3623
|
+
_chunkLJLTLPHLcjs.Button,
|
|
3581
3624
|
{
|
|
3582
3625
|
onClick: handleConfirm,
|
|
3583
3626
|
loading: isSubmitting,
|
|
@@ -3588,7 +3631,7 @@ function SolanaConfirmStep({
|
|
|
3588
3631
|
}
|
|
3589
3632
|
)
|
|
3590
3633
|
] }),
|
|
3591
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3634
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.PoweredBy, {})
|
|
3592
3635
|
] });
|
|
3593
3636
|
}
|
|
3594
3637
|
|
|
@@ -3602,18 +3645,18 @@ function DappImportAssetSelectStep({
|
|
|
3602
3645
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
3603
3646
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3604
3647
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3605
|
-
|
|
3648
|
+
_chunkLJLTLPHLcjs.BodyHeader,
|
|
3606
3649
|
{
|
|
3607
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3650
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.WalletIcon, {}),
|
|
3608
3651
|
title: `Transfer from ${sourceLabel}`,
|
|
3609
3652
|
subtitle: "Pick the balance to import"
|
|
3610
3653
|
}
|
|
3611
3654
|
),
|
|
3612
3655
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: assets.map((asset) => {
|
|
3613
|
-
const tokenAmount = asset.balance ?
|
|
3656
|
+
const tokenAmount = asset.balance ? _chunkLJLTLPHLcjs.tokenFormatter.format(
|
|
3614
3657
|
Number(asset.balance) / 10 ** asset.decimals
|
|
3615
3658
|
) : "0";
|
|
3616
|
-
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ?
|
|
3659
|
+
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ? _chunkLJLTLPHLcjs.currencyFormatter.format(asset.balanceUsd) : `${tokenAmount} ${asset.symbol}`;
|
|
3617
3660
|
const tokenIcon = _nullishCoalesce(asset.icon, () => ( _chunkMILJQWPTcjs.getTokenIcon.call(void 0, asset.symbol)));
|
|
3618
3661
|
const chainIcon = _chunkMILJQWPTcjs.getChainIcon.call(void 0, asset.chainId);
|
|
3619
3662
|
const badge = _chunkMILJQWPTcjs.getChainBadge.call(void 0, asset.chainId);
|
|
@@ -3664,7 +3707,7 @@ function DappImportAssetSelectStep({
|
|
|
3664
3707
|
);
|
|
3665
3708
|
}) })
|
|
3666
3709
|
] }),
|
|
3667
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3710
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.PoweredBy, {})
|
|
3668
3711
|
] });
|
|
3669
3712
|
}
|
|
3670
3713
|
DappImportAssetSelectStep.displayName = "DappImportAssetSelectStep";
|
|
@@ -3730,7 +3773,7 @@ async function detectPolymarketWalletKind(params) {
|
|
|
3730
3773
|
contracts: [
|
|
3731
3774
|
{
|
|
3732
3775
|
address: proxyWallet,
|
|
3733
|
-
abi:
|
|
3776
|
+
abi: _chunkLJLTLPHLcjs.SAFE_ABI,
|
|
3734
3777
|
functionName: "isOwner",
|
|
3735
3778
|
args: [eoa]
|
|
3736
3779
|
},
|
|
@@ -3855,7 +3898,7 @@ async function fetchPolymarketProxyWallet(eoa, signal) {
|
|
|
3855
3898
|
let response;
|
|
3856
3899
|
try {
|
|
3857
3900
|
response = await fetch(url, { signal });
|
|
3858
|
-
} catch (
|
|
3901
|
+
} catch (e28) {
|
|
3859
3902
|
return null;
|
|
3860
3903
|
}
|
|
3861
3904
|
if (!response.ok) {
|
|
@@ -3864,7 +3907,7 @@ async function fetchPolymarketProxyWallet(eoa, signal) {
|
|
|
3864
3907
|
let payload;
|
|
3865
3908
|
try {
|
|
3866
3909
|
payload = await response.json();
|
|
3867
|
-
} catch (
|
|
3910
|
+
} catch (e29) {
|
|
3868
3911
|
return null;
|
|
3869
3912
|
}
|
|
3870
3913
|
const raw = payload.proxyWallet;
|
|
@@ -3918,7 +3961,7 @@ async function readPolymarketBalances(params) {
|
|
|
3918
3961
|
pusd: results[0].status === "success" ? results[0].result : 0n,
|
|
3919
3962
|
usdce: results[1].status === "success" ? results[1].result : 0n
|
|
3920
3963
|
};
|
|
3921
|
-
} catch (
|
|
3964
|
+
} catch (e30) {
|
|
3922
3965
|
return { pusd: 0n, usdce: 0n };
|
|
3923
3966
|
}
|
|
3924
3967
|
}
|
|
@@ -3941,7 +3984,7 @@ async function executePolymarketSafeTransfer(params) {
|
|
|
3941
3984
|
}
|
|
3942
3985
|
const isOwner = await publicClient.readContract({
|
|
3943
3986
|
address: safeAddress,
|
|
3944
|
-
abi:
|
|
3987
|
+
abi: _chunkLJLTLPHLcjs.SAFE_ABI,
|
|
3945
3988
|
functionName: "isOwner",
|
|
3946
3989
|
args: [account.address]
|
|
3947
3990
|
});
|
|
@@ -3958,7 +4001,7 @@ async function executePolymarketSafeTransfer(params) {
|
|
|
3958
4001
|
account,
|
|
3959
4002
|
chain,
|
|
3960
4003
|
address: safeAddress,
|
|
3961
|
-
abi:
|
|
4004
|
+
abi: _chunkLJLTLPHLcjs.SAFE_ABI,
|
|
3962
4005
|
functionName: "execTransaction",
|
|
3963
4006
|
args: [
|
|
3964
4007
|
safeTx.to,
|
|
@@ -3977,7 +4020,7 @@ async function executePolymarketSafeTransfer(params) {
|
|
|
3977
4020
|
hash: txHash
|
|
3978
4021
|
});
|
|
3979
4022
|
const parsed = _viem.parseEventLogs.call(void 0, {
|
|
3980
|
-
abi:
|
|
4023
|
+
abi: _chunkLJLTLPHLcjs.SAFE_ABI,
|
|
3981
4024
|
logs: receipt.logs.filter(
|
|
3982
4025
|
(log) => log.address.toLowerCase() === safeAddress.toLowerCase()
|
|
3983
4026
|
),
|
|
@@ -4865,15 +4908,15 @@ var SetupError = class extends Error {
|
|
|
4865
4908
|
}
|
|
4866
4909
|
};
|
|
4867
4910
|
async function resolveSessionOwner(eoaAddress) {
|
|
4868
|
-
const local =
|
|
4911
|
+
const local = _chunkLJLTLPHLcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
4869
4912
|
if (local) {
|
|
4870
4913
|
return {
|
|
4871
|
-
account:
|
|
4914
|
+
account: _chunkLJLTLPHLcjs.accountFromPrivateKey.call(void 0, local.privateKey),
|
|
4872
4915
|
address: local.address
|
|
4873
4916
|
};
|
|
4874
4917
|
}
|
|
4875
|
-
const created =
|
|
4876
|
-
|
|
4918
|
+
const created = _chunkLJLTLPHLcjs.createSessionOwnerKey.call(void 0, );
|
|
4919
|
+
_chunkLJLTLPHLcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
4877
4920
|
return { account: created.account, address: created.address };
|
|
4878
4921
|
}
|
|
4879
4922
|
function stableStringify(value) {
|
|
@@ -4941,7 +4984,7 @@ async function runAccountSetup(input, deps) {
|
|
|
4941
4984
|
try {
|
|
4942
4985
|
const sessionOwner = await resolveSessionOwner(input.ownerAddress);
|
|
4943
4986
|
const cacheKey = computeCacheKey(input, sessionOwner.address);
|
|
4944
|
-
|
|
4987
|
+
_chunkLJLTLPHLcjs.debugLog.call(void 0, debug, "account-setup", "setup:start", {
|
|
4945
4988
|
owner: input.ownerAddress,
|
|
4946
4989
|
sessionOwner: sessionOwner.address,
|
|
4947
4990
|
hasPostBridgeActions: Boolean(_optionalChain([input, 'access', _130 => _130.postBridgeActions, 'optionalAccess', _131 => _131.length])),
|
|
@@ -4989,7 +5032,7 @@ async function runAccountSetup(input, deps) {
|
|
|
4989
5032
|
primaryType: typedData.primaryType,
|
|
4990
5033
|
message: typedData.message
|
|
4991
5034
|
});
|
|
4992
|
-
const sessionDetails =
|
|
5035
|
+
const sessionDetails = _chunkLJLTLPHLcjs.buildSessionDetails.call(void 0,
|
|
4993
5036
|
setup.sessionDetailsUnsigned,
|
|
4994
5037
|
signature
|
|
4995
5038
|
);
|
|
@@ -5025,7 +5068,7 @@ async function runAccountSetup(input, deps) {
|
|
|
5025
5068
|
isRegistered: true
|
|
5026
5069
|
};
|
|
5027
5070
|
} catch (error) {
|
|
5028
|
-
|
|
5071
|
+
_chunkLJLTLPHLcjs.debugError.call(void 0, debug, "account-setup", "setup:failed", error, {
|
|
5029
5072
|
owner: input.ownerAddress
|
|
5030
5073
|
});
|
|
5031
5074
|
if (error instanceof SetupError) throw error;
|
|
@@ -5036,7 +5079,7 @@ function runAccountSetupDeduped(input, deps, requestKey) {
|
|
|
5036
5079
|
const now = Date.now();
|
|
5037
5080
|
const existing = setupRequestDedupe.get(requestKey);
|
|
5038
5081
|
if (existing && (!existing.settled || existing.expiresAt > now)) {
|
|
5039
|
-
|
|
5082
|
+
_chunkLJLTLPHLcjs.debugLog.call(void 0, deps.debug, "account-setup", "setup:dedupe-hit", {
|
|
5040
5083
|
owner: input.ownerAddress,
|
|
5041
5084
|
forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
|
|
5042
5085
|
});
|
|
@@ -5300,10 +5343,10 @@ function DepositFlow({
|
|
|
5300
5343
|
onError,
|
|
5301
5344
|
debug
|
|
5302
5345
|
}) {
|
|
5303
|
-
const onStepChangeRef =
|
|
5304
|
-
const onEventRef =
|
|
5305
|
-
const onLifecycleRef =
|
|
5306
|
-
const onErrorRef =
|
|
5346
|
+
const onStepChangeRef = _chunkLJLTLPHLcjs.useLatestRef.call(void 0, onStepChange);
|
|
5347
|
+
const onEventRef = _chunkLJLTLPHLcjs.useLatestRef.call(void 0, onEvent);
|
|
5348
|
+
const onLifecycleRef = _chunkLJLTLPHLcjs.useLatestRef.call(void 0, onLifecycle);
|
|
5349
|
+
const onErrorRef = _chunkLJLTLPHLcjs.useLatestRef.call(void 0, onError);
|
|
5307
5350
|
const hasInitialReownSession = Boolean(
|
|
5308
5351
|
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _136 => _136.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _137 => _137.address]) : _optionalChain([reownWallet, 'optionalAccess', _138 => _138.address])
|
|
5309
5352
|
);
|
|
@@ -5328,13 +5371,13 @@ function DepositFlow({
|
|
|
5328
5371
|
const stableWalletSelectionKeyRef = _react.useRef.call(void 0, null);
|
|
5329
5372
|
const logFlow = _react.useCallback.call(void 0,
|
|
5330
5373
|
(message, data) => {
|
|
5331
|
-
|
|
5374
|
+
_chunkLJLTLPHLcjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
|
|
5332
5375
|
},
|
|
5333
5376
|
[debug]
|
|
5334
5377
|
);
|
|
5335
5378
|
const logFlowError = _react.useCallback.call(void 0,
|
|
5336
5379
|
(message, error, data) => {
|
|
5337
|
-
|
|
5380
|
+
_chunkLJLTLPHLcjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
|
|
5338
5381
|
},
|
|
5339
5382
|
[debug]
|
|
5340
5383
|
);
|
|
@@ -5350,7 +5393,7 @@ function DepositFlow({
|
|
|
5350
5393
|
_viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals)
|
|
5351
5394
|
);
|
|
5352
5395
|
if (balanceUnits > 0) return asset.balanceUsd / balanceUnits;
|
|
5353
|
-
} catch (
|
|
5396
|
+
} catch (e31) {
|
|
5354
5397
|
}
|
|
5355
5398
|
}
|
|
5356
5399
|
}
|
|
@@ -5477,7 +5520,7 @@ function DepositFlow({
|
|
|
5477
5520
|
return {
|
|
5478
5521
|
ownerAddress: dappAddress,
|
|
5479
5522
|
walletClient: void 0,
|
|
5480
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
5523
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkLJLTLPHLcjs.getPublicClient.call(void 0, setupChainId))),
|
|
5481
5524
|
switchChain: void 0
|
|
5482
5525
|
};
|
|
5483
5526
|
}
|
|
@@ -5486,7 +5529,7 @@ function DepositFlow({
|
|
|
5486
5529
|
return {
|
|
5487
5530
|
ownerAddress: dappWalletClient.account.address,
|
|
5488
5531
|
walletClient: dappWalletClient,
|
|
5489
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
5532
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkLJLTLPHLcjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
5490
5533
|
switchChain: dappSwitchChain
|
|
5491
5534
|
};
|
|
5492
5535
|
}
|
|
@@ -5500,7 +5543,7 @@ function DepositFlow({
|
|
|
5500
5543
|
return {
|
|
5501
5544
|
ownerAddress: dappAddress,
|
|
5502
5545
|
walletClient: void 0,
|
|
5503
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
5546
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkLJLTLPHLcjs.getPublicClient.call(void 0, setupChainId))),
|
|
5504
5547
|
switchChain: void 0
|
|
5505
5548
|
};
|
|
5506
5549
|
}
|
|
@@ -5509,7 +5552,7 @@ function DepositFlow({
|
|
|
5509
5552
|
return {
|
|
5510
5553
|
ownerAddress: dappWalletClient.account.address,
|
|
5511
5554
|
walletClient: dappWalletClient,
|
|
5512
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
5555
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkLJLTLPHLcjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
5513
5556
|
switchChain: dappSwitchChain
|
|
5514
5557
|
};
|
|
5515
5558
|
}
|
|
@@ -5517,7 +5560,7 @@ function DepositFlow({
|
|
|
5517
5560
|
return {
|
|
5518
5561
|
ownerAddress: reownWallet.address,
|
|
5519
5562
|
walletClient: reownWallet.walletClient,
|
|
5520
|
-
publicClient: _nullishCoalesce(reownWallet.publicClient, () => (
|
|
5563
|
+
publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunkLJLTLPHLcjs.getPublicClient.call(void 0, setupChainId))),
|
|
5521
5564
|
switchChain: reownWallet.switchChain
|
|
5522
5565
|
};
|
|
5523
5566
|
}
|
|
@@ -5555,7 +5598,7 @@ function DepositFlow({
|
|
|
5555
5598
|
return {
|
|
5556
5599
|
ownerAddress: dappAddress,
|
|
5557
5600
|
walletClient: void 0,
|
|
5558
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
5601
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkLJLTLPHLcjs.getPublicClient.call(void 0, setupChainId))),
|
|
5559
5602
|
switchChain: void 0
|
|
5560
5603
|
};
|
|
5561
5604
|
}
|
|
@@ -5868,8 +5911,8 @@ function DepositFlow({
|
|
|
5868
5911
|
eoa: dappImportOwner,
|
|
5869
5912
|
getPublicClient: (chainId) => {
|
|
5870
5913
|
try {
|
|
5871
|
-
return
|
|
5872
|
-
} catch (
|
|
5914
|
+
return _chunkLJLTLPHLcjs.getPublicClient.call(void 0, chainId);
|
|
5915
|
+
} catch (e32) {
|
|
5873
5916
|
return null;
|
|
5874
5917
|
}
|
|
5875
5918
|
},
|
|
@@ -6061,7 +6104,7 @@ function DepositFlow({
|
|
|
6061
6104
|
try {
|
|
6062
6105
|
sessionOwner = await resolveSessionOwner(owner);
|
|
6063
6106
|
} catch (error) {
|
|
6064
|
-
|
|
6107
|
+
_chunkLJLTLPHLcjs.debugError.call(void 0,
|
|
6065
6108
|
debug,
|
|
6066
6109
|
"deposit-flow",
|
|
6067
6110
|
"session-owner:resolve-failed",
|
|
@@ -6432,7 +6475,7 @@ function DepositFlow({
|
|
|
6432
6475
|
);
|
|
6433
6476
|
if (showConnectStep) {
|
|
6434
6477
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6435
|
-
|
|
6478
|
+
_chunkLJLTLPHLcjs.ConnectStep,
|
|
6436
6479
|
{
|
|
6437
6480
|
walletRows,
|
|
6438
6481
|
transferCryptoState: dappAddress ? transferCryptoState : void 0,
|
|
@@ -6556,7 +6599,7 @@ function DepositFlow({
|
|
|
6556
6599
|
}
|
|
6557
6600
|
),
|
|
6558
6601
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6559
|
-
|
|
6602
|
+
_chunkLJLTLPHLcjs.ProcessingStep,
|
|
6560
6603
|
{
|
|
6561
6604
|
smartAccount: step.smartAccount,
|
|
6562
6605
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
@@ -6623,7 +6666,7 @@ function DepositFlow({
|
|
|
6623
6666
|
}
|
|
6624
6667
|
),
|
|
6625
6668
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6626
|
-
|
|
6669
|
+
_chunkLJLTLPHLcjs.ProcessingStep,
|
|
6627
6670
|
{
|
|
6628
6671
|
smartAccount: step.smartAccount,
|
|
6629
6672
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
@@ -6753,7 +6796,7 @@ function DepositFlow({
|
|
|
6753
6796
|
) })
|
|
6754
6797
|
] }) : null,
|
|
6755
6798
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6756
|
-
|
|
6799
|
+
_chunkLJLTLPHLcjs.ProcessingStep,
|
|
6757
6800
|
{
|
|
6758
6801
|
smartAccount: effectiveStep.smartAccount,
|
|
6759
6802
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
@@ -6788,7 +6831,7 @@ function DepositFlow({
|
|
|
6788
6831
|
if (_optionalChain([signerContext, 'access', _237 => _237.publicClient, 'access', _238 => _238.chain, 'optionalAccess', _239 => _239.id]) === chainId) {
|
|
6789
6832
|
return signerContext.publicClient;
|
|
6790
6833
|
}
|
|
6791
|
-
return
|
|
6834
|
+
return _chunkLJLTLPHLcjs.getPublicClient.call(void 0, chainId);
|
|
6792
6835
|
};
|
|
6793
6836
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
6794
6837
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -6873,6 +6916,7 @@ function DepositFlow({
|
|
|
6873
6916
|
switchChain: signerContext.switchChain,
|
|
6874
6917
|
liquidityWarning: effectiveStep.liquidityWarning,
|
|
6875
6918
|
uiConfig,
|
|
6919
|
+
service,
|
|
6876
6920
|
executeTransfer: isDappImportMode && activeDappImportProvider && isDappImportAsset(effectiveStep.asset) ? async (amountUnits) => {
|
|
6877
6921
|
const result = await activeDappImportProvider.executeTransfer(
|
|
6878
6922
|
{
|
|
@@ -6897,7 +6941,7 @@ function DepositFlow({
|
|
|
6897
6941
|
}
|
|
6898
6942
|
),
|
|
6899
6943
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6900
|
-
|
|
6944
|
+
_chunkLJLTLPHLcjs.ProcessingStep,
|
|
6901
6945
|
{
|
|
6902
6946
|
smartAccount: effectiveStep.smartAccount,
|
|
6903
6947
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
@@ -6942,7 +6986,7 @@ function formatDate(iso) {
|
|
|
6942
6986
|
month: "short",
|
|
6943
6987
|
year: "numeric"
|
|
6944
6988
|
});
|
|
6945
|
-
} catch (
|
|
6989
|
+
} catch (e33) {
|
|
6946
6990
|
return iso;
|
|
6947
6991
|
}
|
|
6948
6992
|
}
|
|
@@ -7000,7 +7044,7 @@ function formatAmount(rawAmount, token, chainId) {
|
|
|
7000
7044
|
let frac = fracStr.slice(0, 5).replace(/0+$/, "");
|
|
7001
7045
|
if (frac.length < 2) frac = frac.padEnd(2, "0");
|
|
7002
7046
|
return `${whole}.${frac}`;
|
|
7003
|
-
} catch (
|
|
7047
|
+
} catch (e34) {
|
|
7004
7048
|
return rawAmount;
|
|
7005
7049
|
}
|
|
7006
7050
|
}
|
|
@@ -7071,7 +7115,7 @@ function DepositHistoryPanel({
|
|
|
7071
7115
|
className: "rs-modal-header-back",
|
|
7072
7116
|
"aria-label": "Back",
|
|
7073
7117
|
onClick: onClose,
|
|
7074
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7118
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.ChevronLeftIcon, {})
|
|
7075
7119
|
}
|
|
7076
7120
|
) }),
|
|
7077
7121
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: onCloseModal && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -7081,29 +7125,29 @@ function DepositHistoryPanel({
|
|
|
7081
7125
|
className: "rs-modal-close",
|
|
7082
7126
|
"aria-label": "Close",
|
|
7083
7127
|
onClick: onCloseModal,
|
|
7084
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7128
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.CloseIcon, {})
|
|
7085
7129
|
}
|
|
7086
7130
|
) })
|
|
7087
7131
|
] }),
|
|
7088
7132
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen", children: [
|
|
7089
7133
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen-body", children: [
|
|
7090
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7134
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.HistoryIcon, {}), title: "History" }),
|
|
7091
7135
|
isLoading && deposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
7092
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7136
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.HistoryIcon, {}) }),
|
|
7093
7137
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
7094
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7138
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.Spinner, { className: "rs-spinner--sm" }),
|
|
7095
7139
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Loading history\u2026" })
|
|
7096
7140
|
] })
|
|
7097
7141
|
] }),
|
|
7098
7142
|
error && !isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
7099
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7143
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.AlertTriangleIcon, {}) }),
|
|
7100
7144
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
7101
7145
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "Couldn't load history" }),
|
|
7102
7146
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: error })
|
|
7103
7147
|
] })
|
|
7104
7148
|
] }),
|
|
7105
7149
|
!isLoading && !error && visibleDeposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
7106
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7150
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.HistoryIcon, {}) }),
|
|
7107
7151
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
7108
7152
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "No deposits yet" }),
|
|
7109
7153
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Your deposit history will appear here" })
|
|
@@ -7123,7 +7167,7 @@ function DepositHistoryPanel({
|
|
|
7123
7167
|
)
|
|
7124
7168
|
] })
|
|
7125
7169
|
] }),
|
|
7126
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7170
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.PoweredBy, {})
|
|
7127
7171
|
] })
|
|
7128
7172
|
]
|
|
7129
7173
|
}
|
|
@@ -7198,7 +7242,7 @@ function HistoryCard({ deposit }) {
|
|
|
7198
7242
|
onClick: (e) => e.stopPropagation(),
|
|
7199
7243
|
children: [
|
|
7200
7244
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: shortenHash(deposit.sourceTxHash) }),
|
|
7201
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7245
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.ArrowUpRightIcon, {})
|
|
7202
7246
|
]
|
|
7203
7247
|
}
|
|
7204
7248
|
)
|
|
@@ -7213,7 +7257,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
|
7213
7257
|
// src/DepositModal.tsx
|
|
7214
7258
|
|
|
7215
7259
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
7216
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
7260
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-XYQNNZAC.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
7217
7261
|
);
|
|
7218
7262
|
function sortByCreatedAtDesc(items) {
|
|
7219
7263
|
return [...items].sort((a, b) => {
|
|
@@ -7291,7 +7335,7 @@ function DepositModalInner({
|
|
|
7291
7335
|
debug
|
|
7292
7336
|
}) {
|
|
7293
7337
|
const modalRef = _react.useRef.call(void 0, null);
|
|
7294
|
-
const onReadyRef =
|
|
7338
|
+
const onReadyRef = _chunkLJLTLPHLcjs.useLatestRef.call(void 0, onReady);
|
|
7295
7339
|
const [currentScreen, setCurrentScreen] = _react.useState.call(void 0, "connect");
|
|
7296
7340
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
7297
7341
|
void 0
|
|
@@ -7310,14 +7354,14 @@ function DepositModalInner({
|
|
|
7310
7354
|
const targetChain = targetChainProp === "solana" ? "solana" : _chunkMILJQWPTcjs.getChainId.call(void 0, targetChainProp);
|
|
7311
7355
|
const sourceChain = sourceChainProp ? _chunkMILJQWPTcjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
7312
7356
|
const [recipientIsContract, setRecipientIsContract] = _react.useState.call(void 0, false);
|
|
7313
|
-
const onErrorRef =
|
|
7357
|
+
const onErrorRef = _chunkLJLTLPHLcjs.useLatestRef.call(void 0, onError);
|
|
7314
7358
|
_react.useEffect.call(void 0, () => {
|
|
7315
7359
|
if (targetChain !== _chunkMILJQWPTcjs.HYPERCORE_CHAIN_ID || !_viem.isAddress.call(void 0, recipient, { strict: false })) {
|
|
7316
7360
|
setRecipientIsContract(false);
|
|
7317
7361
|
return;
|
|
7318
7362
|
}
|
|
7319
7363
|
let cancelled = false;
|
|
7320
|
-
|
|
7364
|
+
_chunkLJLTLPHLcjs.getHyperEvmReadClient.call(void 0, ).getCode({ address: recipient }).then((code) => {
|
|
7321
7365
|
if (cancelled) return;
|
|
7322
7366
|
const isContract = _chunkMILJQWPTcjs.isContractBytecode.call(void 0, code);
|
|
7323
7367
|
setRecipientIsContract(isContract);
|
|
@@ -7335,7 +7379,7 @@ function DepositModalInner({
|
|
|
7335
7379
|
};
|
|
7336
7380
|
}, [targetChain, recipient, onErrorRef]);
|
|
7337
7381
|
const service = _react.useMemo.call(void 0,
|
|
7338
|
-
() =>
|
|
7382
|
+
() => _chunkLJLTLPHLcjs.createDepositService.call(void 0, backendUrl, {
|
|
7339
7383
|
debug,
|
|
7340
7384
|
debugScope: "service:deposit"
|
|
7341
7385
|
}),
|
|
@@ -7351,7 +7395,7 @@ function DepositModalInner({
|
|
|
7351
7395
|
}, [store, targetChain, targetToken]);
|
|
7352
7396
|
_react.useEffect.call(void 0, () => {
|
|
7353
7397
|
if (isOpen && modalRef.current) {
|
|
7354
|
-
|
|
7398
|
+
_chunkLJLTLPHLcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
7355
7399
|
}
|
|
7356
7400
|
}, [isOpen, theme]);
|
|
7357
7401
|
_react.useEffect.call(void 0, () => {
|
|
@@ -7435,7 +7479,7 @@ function DepositModalInner({
|
|
|
7435
7479
|
fetchHistory("initial");
|
|
7436
7480
|
}
|
|
7437
7481
|
}, [historyOpen, fetchHistory]);
|
|
7438
|
-
const onLifecycleRef =
|
|
7482
|
+
const onLifecycleRef = _chunkLJLTLPHLcjs.useLatestRef.call(void 0, onLifecycle);
|
|
7439
7483
|
const handleLifecycle = _react.useCallback.call(void 0,
|
|
7440
7484
|
(event) => {
|
|
7441
7485
|
_optionalChain([onLifecycleRef, 'access', _253 => _253.current, 'optionalCall', _254 => _254(event)]);
|
|
@@ -7467,7 +7511,7 @@ function DepositModalInner({
|
|
|
7467
7511
|
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _255 => _255.showBackButton]), () => ( true));
|
|
7468
7512
|
const canGoBack = backHandler !== void 0;
|
|
7469
7513
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7470
|
-
|
|
7514
|
+
_chunkLJLTLPHLcjs.Modal,
|
|
7471
7515
|
{
|
|
7472
7516
|
isOpen,
|
|
7473
7517
|
onClose,
|
|
@@ -7483,7 +7527,7 @@ function DepositModalInner({
|
|
|
7483
7527
|
className: "rs-modal-header-back",
|
|
7484
7528
|
"aria-label": "Go back",
|
|
7485
7529
|
onClick: backHandler,
|
|
7486
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7530
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.ChevronLeftIcon, {})
|
|
7487
7531
|
}
|
|
7488
7532
|
) }),
|
|
7489
7533
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
|
|
@@ -7495,7 +7539,7 @@ function DepositModalInner({
|
|
|
7495
7539
|
"aria-label": "Deposit history",
|
|
7496
7540
|
onClick: handleHistoryOpen,
|
|
7497
7541
|
disabled: !recipient,
|
|
7498
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7542
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.HistoryIcon, {})
|
|
7499
7543
|
}
|
|
7500
7544
|
),
|
|
7501
7545
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -7505,12 +7549,12 @@ function DepositModalInner({
|
|
|
7505
7549
|
onClick: onClose,
|
|
7506
7550
|
className: "rs-modal-close",
|
|
7507
7551
|
"aria-label": "Close",
|
|
7508
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7552
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.CloseIcon, {})
|
|
7509
7553
|
}
|
|
7510
7554
|
)
|
|
7511
7555
|
] })
|
|
7512
7556
|
] }),
|
|
7513
|
-
recipientIsContract ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7557
|
+
recipientIsContract ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLJLTLPHLcjs.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,
|
|
7514
7558
|
DepositFlow,
|
|
7515
7559
|
{
|
|
7516
7560
|
dappWalletClient,
|