@rhinestone/deposit-modal 0.6.0 → 0.6.1
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-J3KYAOD3.cjs → DepositModalReown-ICBGUVAA.cjs} +6 -6
- package/dist/{DepositModalReown-YD7TLEAA.mjs → DepositModalReown-IVRDXQAA.mjs} +3 -3
- package/dist/{WithdrawModalReown-QSQUV6HX.cjs → WithdrawModalReown-6XWURPFZ.cjs} +6 -6
- package/dist/{WithdrawModalReown-ZPDMX47Z.mjs → WithdrawModalReown-O7PR343Z.mjs} +3 -3
- package/dist/{chunk-DXGM6YET.mjs → chunk-7Q26RR6J.mjs} +1 -1
- package/dist/{chunk-GQDVHMOT.mjs → chunk-GBOCV2LQ.mjs} +112 -9
- package/dist/{chunk-7LVI3VAL.cjs → chunk-IZPUHIIN.cjs} +214 -204
- package/dist/{chunk-3JVGI7FC.mjs → chunk-N73D3WN4.mjs} +2 -2
- package/dist/{chunk-DASS33PJ.cjs → chunk-SITLCMTI.cjs} +57 -57
- package/dist/{chunk-NSAODZSS.mjs → chunk-TCLBFO3S.mjs} +20 -10
- package/dist/{chunk-ZDYV536Q.cjs → chunk-VPWWFWZT.cjs} +136 -33
- package/dist/{chunk-YYIE5U5K.cjs → chunk-VVKJRGX3.cjs} +4 -4
- 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 +20 -22
- package/dist/withdraw.cjs +3 -3
- package/dist/withdraw.mjs +2 -2
- package/package.json +1 -1
|
@@ -68,7 +68,7 @@ var _chunkNRNJAQUAcjs = require('./chunk-NRNJAQUA.cjs');
|
|
|
68
68
|
|
|
69
69
|
|
|
70
70
|
|
|
71
|
-
var
|
|
71
|
+
var _chunkVPWWFWZTcjs = require('./chunk-VPWWFWZT.cjs');
|
|
72
72
|
|
|
73
73
|
|
|
74
74
|
var _chunkUEKPBRBYcjs = require('./chunk-UEKPBRBY.cjs');
|
|
@@ -146,12 +146,12 @@ function AssetSelectStep({
|
|
|
146
146
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
147
147
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
148
148
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
149
|
-
return
|
|
149
|
+
return _chunkVPWWFWZTcjs.getAssetId.call(void 0, {
|
|
150
150
|
chainId: defaultSourceChain,
|
|
151
151
|
token: defaultSourceToken
|
|
152
152
|
});
|
|
153
153
|
}, [defaultSourceChain, defaultSourceToken]);
|
|
154
|
-
const onTotalBalanceComputedRef =
|
|
154
|
+
const onTotalBalanceComputedRef = _chunkVPWWFWZTcjs.useLatestRef.call(void 0, onTotalBalanceComputed);
|
|
155
155
|
_react.useEffect.call(void 0, () => {
|
|
156
156
|
let active = true;
|
|
157
157
|
function emitAssetsUpdate(currentAssets) {
|
|
@@ -171,7 +171,7 @@ function AssetSelectStep({
|
|
|
171
171
|
try {
|
|
172
172
|
const portfolio = await service.fetchPortfolio(address);
|
|
173
173
|
if (!active) return;
|
|
174
|
-
const portfolioAssets =
|
|
174
|
+
const portfolioAssets = _chunkVPWWFWZTcjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
175
175
|
setAssets(portfolioAssets);
|
|
176
176
|
emitAssetsUpdate(portfolioAssets);
|
|
177
177
|
const hasNative = portfolioAssets.some(
|
|
@@ -247,7 +247,7 @@ function AssetSelectStep({
|
|
|
247
247
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
248
248
|
const numeric = Number(raw);
|
|
249
249
|
if (!Number.isFinite(numeric)) return raw;
|
|
250
|
-
return
|
|
250
|
+
return _chunkVPWWFWZTcjs.tokenFormatter.format(numeric);
|
|
251
251
|
} catch (e3) {
|
|
252
252
|
return asset.balance;
|
|
253
253
|
}
|
|
@@ -255,20 +255,20 @@ function AssetSelectStep({
|
|
|
255
255
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
256
256
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
257
257
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
258
|
-
|
|
258
|
+
_chunkVPWWFWZTcjs.BodyHeader,
|
|
259
259
|
{
|
|
260
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
260
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.WalletIcon, {}),
|
|
261
261
|
title: "Your assets",
|
|
262
262
|
subtitle: "Select source assets to transfer"
|
|
263
263
|
}
|
|
264
264
|
),
|
|
265
265
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
266
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
266
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
267
267
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
268
268
|
] }),
|
|
269
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
269
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Callout, { variant: "error", children: error }),
|
|
270
270
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
271
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
271
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
272
272
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
273
273
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
274
274
|
address.slice(0, 6),
|
|
@@ -335,14 +335,14 @@ function AssetSelectStep({
|
|
|
335
335
|
] })
|
|
336
336
|
] })
|
|
337
337
|
] }),
|
|
338
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ?
|
|
338
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunkVPWWFWZTcjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
339
339
|
]
|
|
340
340
|
},
|
|
341
341
|
asset.id
|
|
342
342
|
);
|
|
343
343
|
}) }),
|
|
344
344
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
345
|
-
|
|
345
|
+
_chunkVPWWFWZTcjs.Button,
|
|
346
346
|
{
|
|
347
347
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
348
348
|
disabled: !selectedAsset,
|
|
@@ -351,7 +351,7 @@ function AssetSelectStep({
|
|
|
351
351
|
}
|
|
352
352
|
)
|
|
353
353
|
] }),
|
|
354
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
354
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
|
|
355
355
|
] });
|
|
356
356
|
}
|
|
357
357
|
async function fetchNativeAssets(address, publicClient, existing) {
|
|
@@ -359,7 +359,7 @@ async function fetchNativeAssets(address, publicClient, existing) {
|
|
|
359
359
|
const connectedChainId = _optionalChain([publicClient, 'access', _8 => _8.chain, 'optionalAccess', _9 => _9.id]);
|
|
360
360
|
if (!connectedChainId) return [];
|
|
361
361
|
if (!_chunkABVRVW3Pcjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
|
|
362
|
-
const id =
|
|
362
|
+
const id = _chunkVPWWFWZTcjs.getAssetId.call(void 0, {
|
|
363
363
|
chainId: connectedChainId,
|
|
364
364
|
token: _chunkABVRVW3Pcjs.NATIVE_TOKEN_ADDRESS
|
|
365
365
|
});
|
|
@@ -556,7 +556,7 @@ function AmountStep({
|
|
|
556
556
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
557
557
|
if (!balanceTarget || !publicClient) return;
|
|
558
558
|
try {
|
|
559
|
-
const bal =
|
|
559
|
+
const bal = _chunkVPWWFWZTcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
560
560
|
address: asset.token,
|
|
561
561
|
abi: _viem.erc20Abi,
|
|
562
562
|
functionName: "balanceOf",
|
|
@@ -577,7 +577,7 @@ function AmountStep({
|
|
|
577
577
|
hasAttemptedSwitch.current = true;
|
|
578
578
|
switchChain(asset.chainId).catch((err) => {
|
|
579
579
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
580
|
-
setError(
|
|
580
|
+
setError(_chunkVPWWFWZTcjs.formatUserError.call(void 0, raw));
|
|
581
581
|
});
|
|
582
582
|
}
|
|
583
583
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -630,7 +630,7 @@ function AmountStep({
|
|
|
630
630
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
631
631
|
const numeric = Number(raw);
|
|
632
632
|
if (!Number.isFinite(numeric)) return raw;
|
|
633
|
-
return
|
|
633
|
+
return _chunkVPWWFWZTcjs.tokenFormatter.format(numeric);
|
|
634
634
|
} catch (e8) {
|
|
635
635
|
return "\u2026";
|
|
636
636
|
}
|
|
@@ -751,7 +751,7 @@ function AmountStep({
|
|
|
751
751
|
const targetTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, targetSymbol);
|
|
752
752
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
753
753
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
754
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
754
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.WalletIcon, {}), title: "Wallet deposit" }),
|
|
755
755
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
756
756
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
757
757
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -771,13 +771,13 @@ function AmountStep({
|
|
|
771
771
|
" available",
|
|
772
772
|
balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
773
773
|
" (~",
|
|
774
|
-
|
|
774
|
+
_chunkVPWWFWZTcjs.currencyFormatter.format(balanceUsd),
|
|
775
775
|
")"
|
|
776
776
|
] })
|
|
777
777
|
] }),
|
|
778
778
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
779
779
|
"Min. deposit ",
|
|
780
|
-
|
|
780
|
+
_chunkVPWWFWZTcjs.currencyFormatter.format(minDepositUsd)
|
|
781
781
|
] })
|
|
782
782
|
] })
|
|
783
783
|
] }),
|
|
@@ -818,13 +818,13 @@ function AmountStep({
|
|
|
818
818
|
] }),
|
|
819
819
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
820
820
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
821
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
821
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkVPWWFWZTcjs.currencyFormatter.format(balanceAfterUsd) })
|
|
822
822
|
] })
|
|
823
823
|
] }),
|
|
824
|
-
targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
825
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
824
|
+
targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
|
|
825
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Callout, { variant: "error", children: error }),
|
|
826
826
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
827
|
-
|
|
827
|
+
_chunkVPWWFWZTcjs.Button,
|
|
828
828
|
{
|
|
829
829
|
onClick: handleContinue,
|
|
830
830
|
fullWidth: true,
|
|
@@ -835,7 +835,7 @@ function AmountStep({
|
|
|
835
835
|
}
|
|
836
836
|
)
|
|
837
837
|
] }),
|
|
838
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
838
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
|
|
839
839
|
] });
|
|
840
840
|
}
|
|
841
841
|
|
|
@@ -882,16 +882,16 @@ function ConfirmStep({
|
|
|
882
882
|
const targetChainIcon = _chunkABVRVW3Pcjs.getChainIcon.call(void 0, targetChain);
|
|
883
883
|
const sourceTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, asset.symbol);
|
|
884
884
|
const targetTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, targetSymbol);
|
|
885
|
-
const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? _nullishCoalesce(
|
|
885
|
+
const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? _nullishCoalesce(_chunkVPWWFWZTcjs.formatTokenAmount.call(void 0, Number(amount), asset.symbol), () => ( "0")) : "0";
|
|
886
886
|
const receiveDisplay = (() => {
|
|
887
887
|
if (sameRoute) return `${formattedSendAmount} ${asset.symbol}`;
|
|
888
888
|
if (quote) {
|
|
889
|
-
const quoted =
|
|
889
|
+
const quoted = _chunkVPWWFWZTcjs.formatQuotedReceive.call(void 0, quote.output, targetSymbol);
|
|
890
890
|
if (quoted !== void 0) return quoted;
|
|
891
891
|
}
|
|
892
892
|
const usdValue = Number(targetAmount);
|
|
893
893
|
const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
|
|
894
|
-
const estimate =
|
|
894
|
+
const estimate = _chunkVPWWFWZTcjs.formatReceiveEstimate.call(void 0, {
|
|
895
895
|
sourceAmount: Number.isFinite(Number(amount)) ? Number(amount) : void 0,
|
|
896
896
|
sourceSymbol: asset.symbol,
|
|
897
897
|
targetSymbol,
|
|
@@ -910,7 +910,7 @@ function ConfirmStep({
|
|
|
910
910
|
hasAttemptedSwitch.current = true;
|
|
911
911
|
switchChain(asset.chainId).catch((err) => {
|
|
912
912
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
913
|
-
setError(
|
|
913
|
+
setError(_chunkVPWWFWZTcjs.formatUserError.call(void 0, raw));
|
|
914
914
|
});
|
|
915
915
|
}
|
|
916
916
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -990,7 +990,7 @@ function ConfirmStep({
|
|
|
990
990
|
const result = await executeTransfer(amountUnits);
|
|
991
991
|
hash = result.txHash;
|
|
992
992
|
resolvedSourceToken = result.sourceToken;
|
|
993
|
-
} else if (
|
|
993
|
+
} else if (_chunkVPWWFWZTcjs.isNativeAsset.call(void 0, asset)) {
|
|
994
994
|
hash = await walletClient.sendTransaction({
|
|
995
995
|
account,
|
|
996
996
|
chain,
|
|
@@ -1011,7 +1011,7 @@ function ConfirmStep({
|
|
|
1011
1011
|
onConfirm(hash, asset.chainId, amountUnits.toString(), resolvedSourceToken);
|
|
1012
1012
|
} catch (err) {
|
|
1013
1013
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
1014
|
-
const message =
|
|
1014
|
+
const message = _chunkVPWWFWZTcjs.formatUserError.call(void 0, raw);
|
|
1015
1015
|
setError(message);
|
|
1016
1016
|
_optionalChain([onError, 'optionalCall', _29 => _29(message, "TRANSFER_ERROR")]);
|
|
1017
1017
|
} finally {
|
|
@@ -1020,7 +1020,7 @@ function ConfirmStep({
|
|
|
1020
1020
|
};
|
|
1021
1021
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
1022
1022
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
1023
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1023
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.WalletIcon, {}), title: "Review deposit" }),
|
|
1024
1024
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
|
|
1025
1025
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1026
1026
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
@@ -1074,14 +1074,14 @@ function ConfirmStep({
|
|
|
1074
1074
|
children: feeDisplay
|
|
1075
1075
|
}
|
|
1076
1076
|
),
|
|
1077
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1077
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.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, _chunkVPWWFWZTcjs.InfoIcon, {}) }) })
|
|
1078
1078
|
] })
|
|
1079
1079
|
] })
|
|
1080
1080
|
] }),
|
|
1081
|
-
targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1082
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1081
|
+
targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
|
|
1082
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Callout, { variant: "error", children: error }),
|
|
1083
1083
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1084
|
-
|
|
1084
|
+
_chunkVPWWFWZTcjs.Button,
|
|
1085
1085
|
{
|
|
1086
1086
|
onClick: handleConfirm,
|
|
1087
1087
|
loading: isSubmitting,
|
|
@@ -1092,7 +1092,7 @@ function ConfirmStep({
|
|
|
1092
1092
|
}
|
|
1093
1093
|
)
|
|
1094
1094
|
] }),
|
|
1095
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1095
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
|
|
1096
1096
|
] });
|
|
1097
1097
|
}
|
|
1098
1098
|
|
|
@@ -1115,9 +1115,9 @@ var INITIAL_POLL_INTERVAL = 3e3;
|
|
|
1115
1115
|
var MAX_POLL_INTERVAL = 3e4;
|
|
1116
1116
|
var BACKOFF_MULTIPLIER = 1.5;
|
|
1117
1117
|
function isEventForTx(event, txHash) {
|
|
1118
|
-
const eventTxHash =
|
|
1118
|
+
const eventTxHash = _chunkVPWWFWZTcjs.getEventTxHash.call(void 0, event);
|
|
1119
1119
|
if (!eventTxHash) return false;
|
|
1120
|
-
return
|
|
1120
|
+
return _chunkVPWWFWZTcjs.txRefsMatch.call(void 0, eventTxHash, txHash);
|
|
1121
1121
|
}
|
|
1122
1122
|
function truncateHash(hash) {
|
|
1123
1123
|
return `${hash.slice(0, 4)}\u2026${hash.slice(-4)}`;
|
|
@@ -1167,7 +1167,7 @@ function formatBridgeFailedMessage(event) {
|
|
|
1167
1167
|
}
|
|
1168
1168
|
return "Bridge failed";
|
|
1169
1169
|
}
|
|
1170
|
-
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1170
|
+
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.ExternalLinkIcon, { className: "rs-deposit-notification-link-icon" });
|
|
1171
1171
|
function DepositNotification({
|
|
1172
1172
|
deposit,
|
|
1173
1173
|
smartAccount,
|
|
@@ -1201,7 +1201,7 @@ function DepositNotification({
|
|
|
1201
1201
|
const pollIntervalRef = _react.useRef.call(void 0, INITIAL_POLL_INTERVAL);
|
|
1202
1202
|
const pollTimeoutRef = _react.useRef.call(void 0, null);
|
|
1203
1203
|
const completedRef = _react.useRef.call(void 0, _nullishCoalesce(directTransfer, () => ( false)));
|
|
1204
|
-
const depositContextRef =
|
|
1204
|
+
const depositContextRef = _chunkVPWWFWZTcjs.useLatestRef.call(void 0, {
|
|
1205
1205
|
amount,
|
|
1206
1206
|
sourceChain,
|
|
1207
1207
|
sourceToken: token,
|
|
@@ -1209,8 +1209,8 @@ function DepositNotification({
|
|
|
1209
1209
|
targetChain,
|
|
1210
1210
|
targetToken
|
|
1211
1211
|
});
|
|
1212
|
-
const onCompleteRef =
|
|
1213
|
-
const onFailedRef =
|
|
1212
|
+
const onCompleteRef = _chunkVPWWFWZTcjs.useLatestRef.call(void 0, onComplete);
|
|
1213
|
+
const onFailedRef = _chunkVPWWFWZTcjs.useLatestRef.call(void 0, onFailed);
|
|
1214
1214
|
const handleComplete = _react.useCallback.call(void 0,
|
|
1215
1215
|
(destTxHash) => {
|
|
1216
1216
|
if (completedRef.current) return;
|
|
@@ -1305,7 +1305,7 @@ function DepositNotification({
|
|
|
1305
1305
|
const destExplorerUrl = destinationTxHash ? _chunkABVRVW3Pcjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
|
|
1306
1306
|
const title = status === "complete" ? "Deposit completed" : status === "failed" ? "Deposit failed" : "Deposit received and processing\u2026";
|
|
1307
1307
|
const subtitle = status === "complete" ? "Your deposit has been credited to your account." : status === "failed" ? "Your deposit could not be processed." : "Your deposit will be credited to your account shortly.";
|
|
1308
|
-
const statusIcon = status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--complete", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1308
|
+
const statusIcon = status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--complete", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.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, _chunkVPWWFWZTcjs.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,
|
|
1309
1309
|
"svg",
|
|
1310
1310
|
{
|
|
1311
1311
|
className: "rs-deposit-notification-spinner",
|
|
@@ -1355,7 +1355,7 @@ function DepositNotification({
|
|
|
1355
1355
|
className: "rs-deposit-notification-close",
|
|
1356
1356
|
onClick: () => onDismiss(deposit.id),
|
|
1357
1357
|
"aria-label": "Dismiss",
|
|
1358
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1358
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.CloseIcon, {})
|
|
1359
1359
|
}
|
|
1360
1360
|
)
|
|
1361
1361
|
] }),
|
|
@@ -1371,7 +1371,7 @@ function DepositNotification({
|
|
|
1371
1371
|
"aria-expanded": expanded,
|
|
1372
1372
|
children: [
|
|
1373
1373
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: expanded ? "See less details" : "See more details" }),
|
|
1374
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1374
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.ChevronDownIcon, { className: "rs-deposit-notification-toggle-chevron" })
|
|
1375
1375
|
]
|
|
1376
1376
|
}
|
|
1377
1377
|
),
|
|
@@ -1717,10 +1717,10 @@ function DepositAddressStep({
|
|
|
1717
1717
|
return;
|
|
1718
1718
|
}
|
|
1719
1719
|
const event = status.lastEvent;
|
|
1720
|
-
const eventTxHash =
|
|
1720
|
+
const eventTxHash = _chunkVPWWFWZTcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkVPWWFWZTcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
1721
1721
|
if (baselineTxHashRef.current === void 0) {
|
|
1722
1722
|
baselineTxHashRef.current = eventTxHash;
|
|
1723
|
-
} else if (eventTxHash && (!baselineTxHashRef.current || !
|
|
1723
|
+
} else if (eventTxHash && (!baselineTxHashRef.current || !_chunkVPWWFWZTcjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
|
|
1724
1724
|
const details = getDepositEventDetails(event);
|
|
1725
1725
|
const chainId = _nullishCoalesce(details.chainId, () => ( "unknown"));
|
|
1726
1726
|
const amount = _nullishCoalesce(details.amount, () => ( "0"));
|
|
@@ -1797,7 +1797,7 @@ function DepositAddressStep({
|
|
|
1797
1797
|
const qrIconSrc = _chunkABVRVW3Pcjs.getChainIcon.call(void 0, sourceChainId);
|
|
1798
1798
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-step--with-notifications", children: [
|
|
1799
1799
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
1800
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1800
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
1801
1801
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", children: [
|
|
1802
1802
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", ref: chainDropdownRef, children: [
|
|
1803
1803
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
@@ -1821,7 +1821,7 @@ function DepositAddressStep({
|
|
|
1821
1821
|
}
|
|
1822
1822
|
),
|
|
1823
1823
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunkABVRVW3Pcjs.getChainName.call(void 0, sourceChainId) }),
|
|
1824
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1824
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
1825
1825
|
]
|
|
1826
1826
|
}
|
|
1827
1827
|
),
|
|
@@ -1852,8 +1852,8 @@ function DepositAddressStep({
|
|
|
1852
1852
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
1853
1853
|
"Min.$",
|
|
1854
1854
|
(targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID ? Math.max(_chunkABVRVW3Pcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _70 => _70.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _71 => _71.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
1855
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1856
|
-
|
|
1855
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1856
|
+
_chunkVPWWFWZTcjs.InfoIcon,
|
|
1857
1857
|
{
|
|
1858
1858
|
className: "rs-deposit-address-min-icon",
|
|
1859
1859
|
"aria-hidden": "true"
|
|
@@ -1881,7 +1881,7 @@ function DepositAddressStep({
|
|
|
1881
1881
|
}
|
|
1882
1882
|
),
|
|
1883
1883
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceTokenSymbol }),
|
|
1884
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1884
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
1885
1885
|
]
|
|
1886
1886
|
}
|
|
1887
1887
|
),
|
|
@@ -1932,7 +1932,7 @@ function DepositAddressStep({
|
|
|
1932
1932
|
className: "rs-deposit-address-copy",
|
|
1933
1933
|
onClick: handleCopy,
|
|
1934
1934
|
children: [
|
|
1935
|
-
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1935
|
+
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.CopyIcon, {}),
|
|
1936
1936
|
copied ? "Copied!" : "Copy address"
|
|
1937
1937
|
]
|
|
1938
1938
|
}
|
|
@@ -1940,7 +1940,7 @@ function DepositAddressStep({
|
|
|
1940
1940
|
]
|
|
1941
1941
|
}
|
|
1942
1942
|
),
|
|
1943
|
-
targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1943
|
+
targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.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." }),
|
|
1944
1944
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1945
1945
|
"div",
|
|
1946
1946
|
{
|
|
@@ -1958,16 +1958,16 @@ function DepositAddressStep({
|
|
|
1958
1958
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
|
|
1959
1959
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
|
|
1960
1960
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1961
|
-
|
|
1961
|
+
_chunkVPWWFWZTcjs.Tooltip,
|
|
1962
1962
|
{
|
|
1963
1963
|
className: "rs-price-impact-info",
|
|
1964
1964
|
content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
|
|
1965
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1965
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.InfoIcon, { "aria-hidden": "true" })
|
|
1966
1966
|
}
|
|
1967
1967
|
)
|
|
1968
1968
|
] }),
|
|
1969
1969
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1970
|
-
|
|
1970
|
+
_chunkVPWWFWZTcjs.ChevronDownIcon,
|
|
1971
1971
|
{
|
|
1972
1972
|
className: "rs-price-impact-chevron",
|
|
1973
1973
|
"aria-hidden": "true"
|
|
@@ -1978,29 +1978,29 @@ function DepositAddressStep({
|
|
|
1978
1978
|
),
|
|
1979
1979
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-price-impact-panel", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-panel-inner", children: [
|
|
1980
1980
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
1981
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1981
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PercentIcon, {}) }),
|
|
1982
1982
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
1983
1983
|
"Max slippage: ",
|
|
1984
1984
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.2%" })
|
|
1985
1985
|
] }),
|
|
1986
1986
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1987
|
-
|
|
1987
|
+
_chunkVPWWFWZTcjs.Tooltip,
|
|
1988
1988
|
{
|
|
1989
1989
|
className: "rs-price-impact-info",
|
|
1990
1990
|
content: "Slippage accounts for price changes during execution. Slippage is adjusted per pair to ensure reliable execution.",
|
|
1991
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1991
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.InfoIcon, { "aria-hidden": "true" })
|
|
1992
1992
|
}
|
|
1993
1993
|
)
|
|
1994
1994
|
] }),
|
|
1995
1995
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
1996
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1996
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.ClockIcon, {}) }),
|
|
1997
1997
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
1998
1998
|
"Processing time: ",
|
|
1999
1999
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "< 1 min" })
|
|
2000
2000
|
] })
|
|
2001
2001
|
] }),
|
|
2002
2002
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
2003
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2003
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PlusCircleIcon, {}) }),
|
|
2004
2004
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
2005
2005
|
"Max deposit:",
|
|
2006
2006
|
" ",
|
|
@@ -2031,7 +2031,7 @@ function DepositAddressStep({
|
|
|
2031
2031
|
},
|
|
2032
2032
|
deposit.id
|
|
2033
2033
|
)) }),
|
|
2034
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2034
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
|
|
2035
2035
|
] });
|
|
2036
2036
|
}
|
|
2037
2037
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -2079,7 +2079,7 @@ function FinalisingDepositStep() {
|
|
|
2079
2079
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "rs-finalising-subtitle", children: "We are depositing your funds to the application." })
|
|
2080
2080
|
] })
|
|
2081
2081
|
] }),
|
|
2082
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2082
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
|
|
2083
2083
|
] });
|
|
2084
2084
|
}
|
|
2085
2085
|
FinalisingDepositStep.displayName = "FinalisingDepositStep";
|
|
@@ -2109,7 +2109,7 @@ function SwappedOrderTracker({
|
|
|
2109
2109
|
];
|
|
2110
2110
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-swapped-tracker", children: [
|
|
2111
2111
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2112
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2112
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.HandCoinsIcon, {}), title }),
|
|
2113
2113
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ol", { className: "rs-swapped-tracker-steps", children: labels.map((label, idx) => {
|
|
2114
2114
|
const status = stepStates[idx];
|
|
2115
2115
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
@@ -2123,7 +2123,7 @@ function SwappedOrderTracker({
|
|
|
2123
2123
|
{
|
|
2124
2124
|
className: "rs-swapped-tracker-step-marker",
|
|
2125
2125
|
"aria-hidden": "true",
|
|
2126
|
-
children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2126
|
+
children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.CheckIcon, {}) : status === "failed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.CloseIcon, {}) : status === "active" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Spinner, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2127
2127
|
"svg",
|
|
2128
2128
|
{
|
|
2129
2129
|
className: "rs-swapped-tracker-step-ring",
|
|
@@ -2158,7 +2158,7 @@ function SwappedOrderTracker({
|
|
|
2158
2158
|
}
|
|
2159
2159
|
)
|
|
2160
2160
|
] }),
|
|
2161
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2161
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
|
|
2162
2162
|
] });
|
|
2163
2163
|
}
|
|
2164
2164
|
function formatTrackerAmount(amount) {
|
|
@@ -2345,10 +2345,10 @@ function SwappedIframeStep({
|
|
|
2345
2345
|
const status = await service.fetchLatestStatus(smartAccount);
|
|
2346
2346
|
if (cancelled) return;
|
|
2347
2347
|
const event = status.lastEvent;
|
|
2348
|
-
const eventTxHash =
|
|
2348
|
+
const eventTxHash = _chunkVPWWFWZTcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkVPWWFWZTcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
2349
2349
|
if (baselineDepositTxHashRef.current === void 0) {
|
|
2350
2350
|
baselineDepositTxHashRef.current = eventTxHash;
|
|
2351
|
-
} else if (eventTxHash && (!baselineDepositTxHashRef.current || !
|
|
2351
|
+
} else if (eventTxHash && (!baselineDepositTxHashRef.current || !_chunkVPWWFWZTcjs.txRefsMatch.call(void 0, eventTxHash, baselineDepositTxHashRef.current))) {
|
|
2352
2352
|
currentDepositTxHashRef.current = eventTxHash;
|
|
2353
2353
|
setLatestEvent(_nullishCoalesce(event, () => ( null)));
|
|
2354
2354
|
}
|
|
@@ -2412,19 +2412,19 @@ function SwappedIframeStep({
|
|
|
2412
2412
|
return () => window.removeEventListener("message", onMessage);
|
|
2413
2413
|
}, []);
|
|
2414
2414
|
_react.useEffect.call(void 0, () => {
|
|
2415
|
-
if (phase === "iframe" && orderState !== null) {
|
|
2415
|
+
if (phase === "iframe" && (orderState !== null || latestEvent !== null)) {
|
|
2416
2416
|
setPhase("tracker");
|
|
2417
2417
|
}
|
|
2418
|
-
}, [phase, orderState]);
|
|
2418
|
+
}, [phase, orderState, latestEvent]);
|
|
2419
2419
|
const stepStates = _react.useMemo.call(void 0,
|
|
2420
2420
|
() => deriveStepStates(_nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _87 => _87.status]), () => ( null)), latestEvent),
|
|
2421
2421
|
[orderState, latestEvent]
|
|
2422
2422
|
);
|
|
2423
2423
|
const terminalState = _react.useMemo.call(void 0, () => {
|
|
2424
|
-
if (
|
|
2424
|
+
if (_chunkVPWWFWZTcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
|
|
2425
2425
|
return {
|
|
2426
2426
|
kind: "failed",
|
|
2427
|
-
message:
|
|
2427
|
+
message: _chunkVPWWFWZTcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
|
|
2428
2428
|
};
|
|
2429
2429
|
}
|
|
2430
2430
|
if (_optionalChain([orderState, 'optionalAccess', _88 => _88.status]) === "order_cancelled") {
|
|
@@ -2446,19 +2446,20 @@ function SwappedIframeStep({
|
|
|
2446
2446
|
orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _90 => _90.orderCrypto]), () => ( null)),
|
|
2447
2447
|
// Base-unit source amount from the deposit row/event, consistent with the
|
|
2448
2448
|
// wallet/QR path. ProcessingStep + onLifecycle expect base units.
|
|
2449
|
-
amount: _nullishCoalesce(
|
|
2449
|
+
amount: _nullishCoalesce(_chunkVPWWFWZTcjs.getEventSourceDetails.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0))).amount, () => ( null)),
|
|
2450
|
+
initialEvent: _nullishCoalesce(latestEvent, () => ( void 0))
|
|
2450
2451
|
});
|
|
2451
2452
|
}, [latestEvent, orderState]);
|
|
2452
2453
|
_react.useEffect.call(void 0, () => {
|
|
2453
2454
|
if (failedFiredRef.current || completeFiredRef.current) return;
|
|
2454
|
-
if (!
|
|
2455
|
+
if (!_chunkVPWWFWZTcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) return;
|
|
2455
2456
|
const txHash = currentDepositTxHashRef.current;
|
|
2456
2457
|
if (!txHash) return;
|
|
2457
2458
|
failedFiredRef.current = true;
|
|
2458
2459
|
setPhase("tracker");
|
|
2459
2460
|
_optionalChain([onSwappedFailedRef, 'access', _91 => _91.current, 'optionalCall', _92 => _92(
|
|
2460
2461
|
txHash,
|
|
2461
|
-
|
|
2462
|
+
_chunkVPWWFWZTcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
|
|
2462
2463
|
)]);
|
|
2463
2464
|
}, [latestEvent]);
|
|
2464
2465
|
if (phase === "tracker") {
|
|
@@ -2492,7 +2493,7 @@ function SwappedIframeStep({
|
|
|
2492
2493
|
}
|
|
2493
2494
|
)
|
|
2494
2495
|
] }),
|
|
2495
|
-
!loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2496
|
+
!loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Spinner, {}) }),
|
|
2496
2497
|
widgetUrl && !loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2497
2498
|
"iframe",
|
|
2498
2499
|
{
|
|
@@ -2507,11 +2508,11 @@ function SwappedIframeStep({
|
|
|
2507
2508
|
retryToken
|
|
2508
2509
|
)
|
|
2509
2510
|
] }) }),
|
|
2510
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2511
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
|
|
2511
2512
|
] });
|
|
2512
2513
|
}
|
|
2513
2514
|
function deriveStepStates(swappedStatus, latestEvent) {
|
|
2514
|
-
if (
|
|
2515
|
+
if (_chunkVPWWFWZTcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
|
|
2515
2516
|
return ["complete", "complete", "failed", "pending"];
|
|
2516
2517
|
}
|
|
2517
2518
|
if (swappedStatus === "order_cancelled") {
|
|
@@ -2683,7 +2684,7 @@ ExchangeConnectStep.displayName = "ExchangeConnectStep";
|
|
|
2683
2684
|
function ExchangeLogo({ exchange }) {
|
|
2684
2685
|
const [failed, setFailed] = _react.useState.call(void 0, false);
|
|
2685
2686
|
if (!exchange.logoUrl || failed) {
|
|
2686
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2687
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.BankIcon, {});
|
|
2687
2688
|
}
|
|
2688
2689
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2689
2690
|
"img",
|
|
@@ -2729,14 +2730,14 @@ function ExchangeSelectStep({
|
|
|
2729
2730
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-exchange-select", children: [
|
|
2730
2731
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2731
2732
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2732
|
-
|
|
2733
|
+
_chunkVPWWFWZTcjs.BodyHeader,
|
|
2733
2734
|
{
|
|
2734
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2735
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.UnplugIcon, {}),
|
|
2735
2736
|
title: "Connect exchange",
|
|
2736
2737
|
subtitle: "Select an exchange to connect"
|
|
2737
2738
|
}
|
|
2738
2739
|
),
|
|
2739
|
-
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2740
|
+
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Spinner, {}) }),
|
|
2740
2741
|
!loading && error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: [
|
|
2741
2742
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state-title", children: "Couldn\u2019t load exchanges" }),
|
|
2742
2743
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2762,7 +2763,7 @@ function ExchangeSelectStep({
|
|
|
2762
2763
|
)
|
|
2763
2764
|
] }),
|
|
2764
2765
|
!loading && !error && exchanges.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-grid", children: exchanges.map((exchange) => {
|
|
2765
|
-
const brand =
|
|
2766
|
+
const brand = _chunkVPWWFWZTcjs.getExchangeLogo.call(void 0, exchange.name, exchange.connection);
|
|
2766
2767
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2767
2768
|
"button",
|
|
2768
2769
|
{
|
|
@@ -2785,7 +2786,7 @@ function ExchangeSelectStep({
|
|
|
2785
2786
|
);
|
|
2786
2787
|
}) })
|
|
2787
2788
|
] }),
|
|
2788
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2789
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
|
|
2789
2790
|
] });
|
|
2790
2791
|
}
|
|
2791
2792
|
ExchangeSelectStep.displayName = "ExchangeSelectStep";
|
|
@@ -2815,7 +2816,7 @@ function DepositAddressSkeleton({
|
|
|
2815
2816
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", "aria-busy": "true", children: [
|
|
2816
2817
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: "Preparing deposit details\u2026" }),
|
|
2817
2818
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
2818
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2819
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
2819
2820
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", "aria-hidden": "true", children: [
|
|
2820
2821
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
2821
2822
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
@@ -2829,7 +2830,7 @@ function DepositAddressSkeleton({
|
|
|
2829
2830
|
}
|
|
2830
2831
|
),
|
|
2831
2832
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainName }),
|
|
2832
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2833
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2833
2834
|
] })
|
|
2834
2835
|
] }),
|
|
2835
2836
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
@@ -2838,8 +2839,8 @@ function DepositAddressSkeleton({
|
|
|
2838
2839
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
2839
2840
|
"Min.$",
|
|
2840
2841
|
(_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _100 => _100.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
2841
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2842
|
-
|
|
2842
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2843
|
+
_chunkVPWWFWZTcjs.InfoIcon,
|
|
2843
2844
|
{
|
|
2844
2845
|
className: "rs-deposit-address-min-icon",
|
|
2845
2846
|
"aria-hidden": "true"
|
|
@@ -2857,7 +2858,7 @@ function DepositAddressSkeleton({
|
|
|
2857
2858
|
}
|
|
2858
2859
|
),
|
|
2859
2860
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: defaultToken }),
|
|
2860
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2861
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2861
2862
|
] })
|
|
2862
2863
|
] })
|
|
2863
2864
|
] }),
|
|
@@ -2878,7 +2879,7 @@ function DepositAddressSkeleton({
|
|
|
2878
2879
|
disabled: true,
|
|
2879
2880
|
"aria-hidden": "true",
|
|
2880
2881
|
children: [
|
|
2881
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2882
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.CopyIcon, {}),
|
|
2882
2883
|
"Copy address"
|
|
2883
2884
|
]
|
|
2884
2885
|
}
|
|
@@ -2891,16 +2892,16 @@ function DepositAddressSkeleton({
|
|
|
2891
2892
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
|
|
2892
2893
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
|
|
2893
2894
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2894
|
-
|
|
2895
|
+
_chunkVPWWFWZTcjs.Tooltip,
|
|
2895
2896
|
{
|
|
2896
2897
|
className: "rs-price-impact-info",
|
|
2897
2898
|
content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
|
|
2898
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2899
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.InfoIcon, { "aria-hidden": "true" })
|
|
2899
2900
|
}
|
|
2900
2901
|
)
|
|
2901
2902
|
] }),
|
|
2902
2903
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2903
|
-
|
|
2904
|
+
_chunkVPWWFWZTcjs.ChevronDownIcon,
|
|
2904
2905
|
{
|
|
2905
2906
|
className: "rs-price-impact-chevron",
|
|
2906
2907
|
"aria-hidden": "true"
|
|
@@ -2908,7 +2909,7 @@ function DepositAddressSkeleton({
|
|
|
2908
2909
|
)
|
|
2909
2910
|
] }) })
|
|
2910
2911
|
] }),
|
|
2911
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2912
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
|
|
2912
2913
|
] });
|
|
2913
2914
|
}
|
|
2914
2915
|
DepositAddressSkeleton.displayName = "DepositAddressSkeleton";
|
|
@@ -2940,7 +2941,7 @@ function SolanaTokenSelectStep({
|
|
|
2940
2941
|
setError(null);
|
|
2941
2942
|
const portfolioBySymbol = {};
|
|
2942
2943
|
try {
|
|
2943
|
-
|
|
2944
|
+
_chunkVPWWFWZTcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
|
|
2944
2945
|
solanaAddress
|
|
2945
2946
|
});
|
|
2946
2947
|
const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
|
|
@@ -2963,12 +2964,12 @@ function SolanaTokenSelectStep({
|
|
|
2963
2964
|
};
|
|
2964
2965
|
}
|
|
2965
2966
|
}
|
|
2966
|
-
|
|
2967
|
+
_chunkVPWWFWZTcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
|
|
2967
2968
|
symbols: Object.keys(portfolioBySymbol)
|
|
2968
2969
|
});
|
|
2969
2970
|
} catch (err) {
|
|
2970
2971
|
if (!active) return;
|
|
2971
|
-
|
|
2972
|
+
_chunkVPWWFWZTcjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
|
|
2972
2973
|
solanaAddress
|
|
2973
2974
|
});
|
|
2974
2975
|
setError(
|
|
@@ -3015,7 +3016,7 @@ function SolanaTokenSelectStep({
|
|
|
3015
3016
|
const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
|
|
3016
3017
|
const numeric = Number(raw);
|
|
3017
3018
|
if (!Number.isFinite(numeric)) return raw;
|
|
3018
|
-
return
|
|
3019
|
+
return _chunkVPWWFWZTcjs.tokenFormatter.format(numeric);
|
|
3019
3020
|
} catch (e22) {
|
|
3020
3021
|
return "--";
|
|
3021
3022
|
}
|
|
@@ -3025,20 +3026,20 @@ function SolanaTokenSelectStep({
|
|
|
3025
3026
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
3026
3027
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
3027
3028
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3028
|
-
|
|
3029
|
+
_chunkVPWWFWZTcjs.BodyHeader,
|
|
3029
3030
|
{
|
|
3030
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3031
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.WalletIcon, {}),
|
|
3031
3032
|
title: "Your assets",
|
|
3032
3033
|
subtitle: "Select source assets to transfer"
|
|
3033
3034
|
}
|
|
3034
3035
|
),
|
|
3035
3036
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
3036
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3037
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
3037
3038
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
3038
3039
|
] }),
|
|
3039
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3040
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Callout, { variant: "error", children: error }),
|
|
3040
3041
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
3041
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3042
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
3042
3043
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
3043
3044
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
3044
3045
|
solanaAddress.slice(0, 6),
|
|
@@ -3087,14 +3088,14 @@ function SolanaTokenSelectStep({
|
|
|
3087
3088
|
] })
|
|
3088
3089
|
] })
|
|
3089
3090
|
] }),
|
|
3090
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ?
|
|
3091
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunkVPWWFWZTcjs.currencyFormatter.format(entry.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${entry.token.symbol}` : "--" })
|
|
3091
3092
|
]
|
|
3092
3093
|
},
|
|
3093
3094
|
entry.token.symbol
|
|
3094
3095
|
);
|
|
3095
3096
|
}) }),
|
|
3096
3097
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3097
|
-
|
|
3098
|
+
_chunkVPWWFWZTcjs.Button,
|
|
3098
3099
|
{
|
|
3099
3100
|
onClick: () => selectedEntry && onContinue(
|
|
3100
3101
|
selectedEntry.token,
|
|
@@ -3107,7 +3108,7 @@ function SolanaTokenSelectStep({
|
|
|
3107
3108
|
}
|
|
3108
3109
|
)
|
|
3109
3110
|
] }),
|
|
3110
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3111
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
|
|
3111
3112
|
] });
|
|
3112
3113
|
}
|
|
3113
3114
|
|
|
@@ -3160,7 +3161,7 @@ function SolanaAmountStep({
|
|
|
3160
3161
|
const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
|
|
3161
3162
|
const numeric = Number(raw);
|
|
3162
3163
|
if (!Number.isFinite(numeric)) return raw;
|
|
3163
|
-
return
|
|
3164
|
+
return _chunkVPWWFWZTcjs.tokenFormatter.format(numeric);
|
|
3164
3165
|
} catch (e24) {
|
|
3165
3166
|
return "\u2026";
|
|
3166
3167
|
}
|
|
@@ -3253,7 +3254,7 @@ function SolanaAmountStep({
|
|
|
3253
3254
|
const handlePresetClick = (percentage) => {
|
|
3254
3255
|
const formatted = computePresetAmount(percentage);
|
|
3255
3256
|
if (!formatted) return;
|
|
3256
|
-
|
|
3257
|
+
_chunkVPWWFWZTcjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
|
|
3257
3258
|
percentage,
|
|
3258
3259
|
symbol: token.symbol,
|
|
3259
3260
|
formatted
|
|
@@ -3288,7 +3289,7 @@ function SolanaAmountStep({
|
|
|
3288
3289
|
try {
|
|
3289
3290
|
amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
|
|
3290
3291
|
} catch (e29) {
|
|
3291
|
-
|
|
3292
|
+
_chunkVPWWFWZTcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
3292
3293
|
amount,
|
|
3293
3294
|
sourceAmount: sourceAmountStr,
|
|
3294
3295
|
reason: "parse-units-failed"
|
|
@@ -3303,7 +3304,7 @@ function SolanaAmountStep({
|
|
|
3303
3304
|
);
|
|
3304
3305
|
return;
|
|
3305
3306
|
}
|
|
3306
|
-
|
|
3307
|
+
_chunkVPWWFWZTcjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
|
|
3307
3308
|
symbol: token.symbol,
|
|
3308
3309
|
inputAmountUsd: amount,
|
|
3309
3310
|
sourceAmount: sourceAmountStr,
|
|
@@ -3317,7 +3318,7 @@ function SolanaAmountStep({
|
|
|
3317
3318
|
const sourceTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, token.symbol);
|
|
3318
3319
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
3319
3320
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3320
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3321
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.WalletIcon, {}), title: "Wallet deposit" }),
|
|
3321
3322
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
3322
3323
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
3323
3324
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3337,13 +3338,13 @@ function SolanaAmountStep({
|
|
|
3337
3338
|
" available",
|
|
3338
3339
|
computedBalanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
3339
3340
|
" (~",
|
|
3340
|
-
|
|
3341
|
+
_chunkVPWWFWZTcjs.currencyFormatter.format(computedBalanceUsd),
|
|
3341
3342
|
")"
|
|
3342
3343
|
] })
|
|
3343
3344
|
] }),
|
|
3344
3345
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
3345
3346
|
"Min. deposit ",
|
|
3346
|
-
|
|
3347
|
+
_chunkVPWWFWZTcjs.currencyFormatter.format(minDepositUsd)
|
|
3347
3348
|
] })
|
|
3348
3349
|
] })
|
|
3349
3350
|
] }),
|
|
@@ -3382,13 +3383,13 @@ function SolanaAmountStep({
|
|
|
3382
3383
|
] }),
|
|
3383
3384
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
3384
3385
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
3385
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
3386
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkVPWWFWZTcjs.currencyFormatter.format(balanceAfterUsd) })
|
|
3386
3387
|
] })
|
|
3387
3388
|
] }),
|
|
3388
|
-
targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3389
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3389
|
+
targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
|
|
3390
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Callout, { variant: "error", children: error }),
|
|
3390
3391
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3391
|
-
|
|
3392
|
+
_chunkVPWWFWZTcjs.Button,
|
|
3392
3393
|
{
|
|
3393
3394
|
onClick: handleContinue,
|
|
3394
3395
|
fullWidth: true,
|
|
@@ -3397,7 +3398,7 @@ function SolanaAmountStep({
|
|
|
3397
3398
|
}
|
|
3398
3399
|
)
|
|
3399
3400
|
] }),
|
|
3400
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3401
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
|
|
3401
3402
|
] });
|
|
3402
3403
|
}
|
|
3403
3404
|
|
|
@@ -3420,10 +3421,10 @@ var _spltoken = require('@solana/spl-token');
|
|
|
3420
3421
|
var DEFAULT_SOLANA_RPC_URL = "https://api.mainnet.solana.com";
|
|
3421
3422
|
var cachedConnections = /* @__PURE__ */ new Map();
|
|
3422
3423
|
function getSolanaRpcUrl(rpcUrls) {
|
|
3423
|
-
return _nullishCoalesce(
|
|
3424
|
+
return _nullishCoalesce(_chunkVPWWFWZTcjs.rpcUrlFor.call(void 0, rpcUrls, "solana"), () => ( DEFAULT_SOLANA_RPC_URL));
|
|
3424
3425
|
}
|
|
3425
3426
|
function hasConfiguredSolanaRpcUrl(rpcUrls) {
|
|
3426
|
-
return
|
|
3427
|
+
return _chunkVPWWFWZTcjs.rpcUrlFor.call(void 0, rpcUrls, "solana") !== void 0;
|
|
3427
3428
|
}
|
|
3428
3429
|
function getSolanaConnection(rpcUrls) {
|
|
3429
3430
|
const rpcUrl = getSolanaRpcUrl(rpcUrls);
|
|
@@ -3525,7 +3526,7 @@ function SolanaConfirmStep({
|
|
|
3525
3526
|
onError,
|
|
3526
3527
|
debug
|
|
3527
3528
|
}) {
|
|
3528
|
-
const rpcUrls =
|
|
3529
|
+
const rpcUrls = _chunkVPWWFWZTcjs.useRpcUrls.call(void 0, );
|
|
3529
3530
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
3530
3531
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
3531
3532
|
const targetSymbol = _chunkABVRVW3Pcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
@@ -3537,11 +3538,11 @@ function SolanaConfirmStep({
|
|
|
3537
3538
|
const targetTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, targetSymbol);
|
|
3538
3539
|
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _109 => _109.feeSponsored]), () => ( false));
|
|
3539
3540
|
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _110 => _110.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
3540
|
-
const formattedAmount = sourceAmount && Number.isFinite(Number(sourceAmount)) ? _nullishCoalesce(
|
|
3541
|
+
const formattedAmount = sourceAmount && Number.isFinite(Number(sourceAmount)) ? _nullishCoalesce(_chunkVPWWFWZTcjs.formatTokenAmount.call(void 0, Number(sourceAmount), token.symbol), () => ( "0")) : "0";
|
|
3541
3542
|
const receiveDisplay = (() => {
|
|
3542
3543
|
const usdValue = Number(targetAmount);
|
|
3543
3544
|
const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
|
|
3544
|
-
const estimate =
|
|
3545
|
+
const estimate = _chunkVPWWFWZTcjs.formatReceiveEstimate.call(void 0, {
|
|
3545
3546
|
sourceAmount: Number.isFinite(Number(sourceAmount)) ? Number(sourceAmount) : void 0,
|
|
3546
3547
|
sourceSymbol: token.symbol,
|
|
3547
3548
|
targetSymbol,
|
|
@@ -3553,7 +3554,7 @@ function SolanaConfirmStep({
|
|
|
3553
3554
|
})();
|
|
3554
3555
|
const handleConfirm = async () => {
|
|
3555
3556
|
if (!solanaProvider) {
|
|
3556
|
-
|
|
3557
|
+
_chunkVPWWFWZTcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
3557
3558
|
reason: "missing-provider"
|
|
3558
3559
|
});
|
|
3559
3560
|
setError("Solana wallet not connected");
|
|
@@ -3561,7 +3562,7 @@ function SolanaConfirmStep({
|
|
|
3561
3562
|
}
|
|
3562
3563
|
const parsedAmount = parseFloat(sourceAmount);
|
|
3563
3564
|
if (isNaN(parsedAmount) || parsedAmount <= 0) {
|
|
3564
|
-
|
|
3565
|
+
_chunkVPWWFWZTcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
3565
3566
|
reason: "invalid-amount",
|
|
3566
3567
|
sourceAmount
|
|
3567
3568
|
});
|
|
@@ -3570,7 +3571,7 @@ function SolanaConfirmStep({
|
|
|
3570
3571
|
}
|
|
3571
3572
|
setError(null);
|
|
3572
3573
|
setIsSubmitting(true);
|
|
3573
|
-
|
|
3574
|
+
_chunkVPWWFWZTcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
|
|
3574
3575
|
smartAccount,
|
|
3575
3576
|
solanaAddress,
|
|
3576
3577
|
solanaDepositAddress,
|
|
@@ -3580,7 +3581,7 @@ function SolanaConfirmStep({
|
|
|
3580
3581
|
});
|
|
3581
3582
|
try {
|
|
3582
3583
|
const check = await service.checkAccount(smartAccount);
|
|
3583
|
-
|
|
3584
|
+
_chunkVPWWFWZTcjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
|
|
3584
3585
|
smartAccount,
|
|
3585
3586
|
isRegistered: check.isRegistered,
|
|
3586
3587
|
targetChain: check.targetChain,
|
|
@@ -3593,7 +3594,7 @@ function SolanaConfirmStep({
|
|
|
3593
3594
|
}
|
|
3594
3595
|
const connection = hasConfiguredSolanaRpcUrl(rpcUrls) ? getSolanaConnection(rpcUrls) : _nullishCoalesce(solanaConnection, () => ( getSolanaConnection(rpcUrls)));
|
|
3595
3596
|
const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
|
|
3596
|
-
|
|
3597
|
+
_chunkVPWWFWZTcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
|
|
3597
3598
|
token: token.symbol,
|
|
3598
3599
|
sourceAmount,
|
|
3599
3600
|
amountUnits: amountUnits.toString()
|
|
@@ -3610,7 +3611,7 @@ function SolanaConfirmStep({
|
|
|
3610
3611
|
token.mint,
|
|
3611
3612
|
amountUnits
|
|
3612
3613
|
);
|
|
3613
|
-
|
|
3614
|
+
_chunkVPWWFWZTcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
3614
3615
|
token: token.symbol,
|
|
3615
3616
|
instructionCount: transaction.instructions.length,
|
|
3616
3617
|
feePayer: _optionalChain([transaction, 'access', _111 => _111.feePayer, 'optionalAccess', _112 => _112.toBase58, 'call', _113 => _113()]),
|
|
@@ -3621,15 +3622,15 @@ function SolanaConfirmStep({
|
|
|
3621
3622
|
connection,
|
|
3622
3623
|
transaction
|
|
3623
3624
|
);
|
|
3624
|
-
|
|
3625
|
+
_chunkVPWWFWZTcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
|
|
3625
3626
|
txHash,
|
|
3626
3627
|
amountUnits: amountUnits.toString()
|
|
3627
3628
|
});
|
|
3628
3629
|
onConfirm(txHash, amountUnits.toString());
|
|
3629
3630
|
} catch (err) {
|
|
3630
3631
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
3631
|
-
const message =
|
|
3632
|
-
|
|
3632
|
+
const message = _chunkVPWWFWZTcjs.formatUserError.call(void 0, raw);
|
|
3633
|
+
_chunkVPWWFWZTcjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
|
|
3633
3634
|
smartAccount,
|
|
3634
3635
|
token: token.symbol,
|
|
3635
3636
|
sourceAmount
|
|
@@ -3642,7 +3643,7 @@ function SolanaConfirmStep({
|
|
|
3642
3643
|
};
|
|
3643
3644
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
3644
3645
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3645
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3646
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.WalletIcon, {}), title: "Review deposit" }),
|
|
3646
3647
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
|
|
3647
3648
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
3648
3649
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
@@ -3690,13 +3691,13 @@ function SolanaConfirmStep({
|
|
|
3690
3691
|
children: "$0.04"
|
|
3691
3692
|
}
|
|
3692
3693
|
),
|
|
3693
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3694
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.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, _chunkVPWWFWZTcjs.InfoIcon, {}) }) })
|
|
3694
3695
|
] })
|
|
3695
3696
|
] })
|
|
3696
3697
|
] }),
|
|
3697
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3698
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Callout, { variant: "error", children: error }),
|
|
3698
3699
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3699
|
-
|
|
3700
|
+
_chunkVPWWFWZTcjs.Button,
|
|
3700
3701
|
{
|
|
3701
3702
|
onClick: handleConfirm,
|
|
3702
3703
|
loading: isSubmitting,
|
|
@@ -3707,7 +3708,7 @@ function SolanaConfirmStep({
|
|
|
3707
3708
|
}
|
|
3708
3709
|
)
|
|
3709
3710
|
] }),
|
|
3710
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3711
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
|
|
3711
3712
|
] });
|
|
3712
3713
|
}
|
|
3713
3714
|
|
|
@@ -3721,18 +3722,18 @@ function DappImportAssetSelectStep({
|
|
|
3721
3722
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
3722
3723
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3723
3724
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3724
|
-
|
|
3725
|
+
_chunkVPWWFWZTcjs.BodyHeader,
|
|
3725
3726
|
{
|
|
3726
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3727
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.WalletIcon, {}),
|
|
3727
3728
|
title: `Transfer from ${sourceLabel}`,
|
|
3728
3729
|
subtitle: "Pick the balance to import"
|
|
3729
3730
|
}
|
|
3730
3731
|
),
|
|
3731
3732
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: assets.map((asset) => {
|
|
3732
|
-
const tokenAmount = asset.balance ?
|
|
3733
|
+
const tokenAmount = asset.balance ? _chunkVPWWFWZTcjs.tokenFormatter.format(
|
|
3733
3734
|
Number(asset.balance) / 10 ** asset.decimals
|
|
3734
3735
|
) : "0";
|
|
3735
|
-
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ?
|
|
3736
|
+
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ? _chunkVPWWFWZTcjs.currencyFormatter.format(asset.balanceUsd) : `${tokenAmount} ${asset.symbol}`;
|
|
3736
3737
|
const tokenIcon = _nullishCoalesce(asset.icon, () => ( _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, asset.symbol)));
|
|
3737
3738
|
const chainIcon = _chunkABVRVW3Pcjs.getChainIcon.call(void 0, asset.chainId);
|
|
3738
3739
|
const badge = _chunkABVRVW3Pcjs.getChainBadge.call(void 0, asset.chainId);
|
|
@@ -3783,7 +3784,7 @@ function DappImportAssetSelectStep({
|
|
|
3783
3784
|
);
|
|
3784
3785
|
}) })
|
|
3785
3786
|
] }),
|
|
3786
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3787
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
|
|
3787
3788
|
] });
|
|
3788
3789
|
}
|
|
3789
3790
|
DappImportAssetSelectStep.displayName = "DappImportAssetSelectStep";
|
|
@@ -3800,9 +3801,9 @@ function DappImportAssetSelectSkeleton({
|
|
|
3800
3801
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: error ? "Couldn't load balances" : "Loading balances\u2026" }),
|
|
3801
3802
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3802
3803
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3803
|
-
|
|
3804
|
+
_chunkVPWWFWZTcjs.BodyHeader,
|
|
3804
3805
|
{
|
|
3805
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3806
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.WalletIcon, {}),
|
|
3806
3807
|
title: `Transfer from ${sourceLabel}`,
|
|
3807
3808
|
subtitle: "Pick the balance to import"
|
|
3808
3809
|
}
|
|
@@ -3840,7 +3841,7 @@ function DappImportAssetSelectSkeleton({
|
|
|
3840
3841
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Try again" })
|
|
3841
3842
|
}
|
|
3842
3843
|
) }),
|
|
3843
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3844
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
|
|
3844
3845
|
] });
|
|
3845
3846
|
}
|
|
3846
3847
|
DappImportAssetSelectSkeleton.displayName = "DappImportAssetSelectSkeleton";
|
|
@@ -4180,7 +4181,8 @@ function createInitialState(overrides) {
|
|
|
4180
4181
|
processing: {
|
|
4181
4182
|
txHash: null,
|
|
4182
4183
|
directTransfer: false,
|
|
4183
|
-
swappedContext: null
|
|
4184
|
+
swappedContext: null,
|
|
4185
|
+
initialEvent: null
|
|
4184
4186
|
},
|
|
4185
4187
|
dappImport: {
|
|
4186
4188
|
activeProviderId: null,
|
|
@@ -4789,7 +4791,8 @@ function applyAction(state, action) {
|
|
|
4789
4791
|
...state.processing,
|
|
4790
4792
|
txHash: action.txHash,
|
|
4791
4793
|
directTransfer: _nullishCoalesce(action.directTransfer, () => ( false)),
|
|
4792
|
-
swappedContext: _nullishCoalesce(action.swappedContext, () => ( null))
|
|
4794
|
+
swappedContext: _nullishCoalesce(action.swappedContext, () => ( null)),
|
|
4795
|
+
initialEvent: _nullishCoalesce(action.initialEvent, () => ( null))
|
|
4793
4796
|
},
|
|
4794
4797
|
flow: { ...state.flow, step: "processing" }
|
|
4795
4798
|
};
|
|
@@ -4959,7 +4962,8 @@ function applyAction(state, action) {
|
|
|
4959
4962
|
processing: {
|
|
4960
4963
|
txHash: null,
|
|
4961
4964
|
directTransfer: false,
|
|
4962
|
-
swappedContext: null
|
|
4965
|
+
swappedContext: null,
|
|
4966
|
+
initialEvent: null
|
|
4963
4967
|
},
|
|
4964
4968
|
// Drop fetched availability wholesale. The fetch effect refetches
|
|
4965
4969
|
// unconditionally on remount (so keeping the map saves nothing),
|
|
@@ -5060,15 +5064,15 @@ var SetupError = class extends Error {
|
|
|
5060
5064
|
}
|
|
5061
5065
|
};
|
|
5062
5066
|
async function resolveSessionOwner(eoaAddress) {
|
|
5063
|
-
const local =
|
|
5067
|
+
const local = _chunkVPWWFWZTcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
5064
5068
|
if (local) {
|
|
5065
5069
|
return {
|
|
5066
|
-
account:
|
|
5070
|
+
account: _chunkVPWWFWZTcjs.accountFromPrivateKey.call(void 0, local.privateKey),
|
|
5067
5071
|
address: local.address
|
|
5068
5072
|
};
|
|
5069
5073
|
}
|
|
5070
|
-
const created =
|
|
5071
|
-
|
|
5074
|
+
const created = _chunkVPWWFWZTcjs.createSessionOwnerKey.call(void 0, );
|
|
5075
|
+
_chunkVPWWFWZTcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
5072
5076
|
return { account: created.account, address: created.address };
|
|
5073
5077
|
}
|
|
5074
5078
|
function stableStringify(value) {
|
|
@@ -5135,7 +5139,7 @@ async function runAccountSetup(input, deps) {
|
|
|
5135
5139
|
try {
|
|
5136
5140
|
const sessionOwner = await resolveSessionOwner(input.ownerAddress);
|
|
5137
5141
|
const cacheKey = computeCacheKey(input, sessionOwner.address);
|
|
5138
|
-
|
|
5142
|
+
_chunkVPWWFWZTcjs.debugLog.call(void 0, debug, "account-setup", "setup:start", {
|
|
5139
5143
|
owner: input.ownerAddress,
|
|
5140
5144
|
sessionOwner: sessionOwner.address,
|
|
5141
5145
|
forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
|
|
@@ -5181,7 +5185,7 @@ async function runAccountSetup(input, deps) {
|
|
|
5181
5185
|
primaryType: typedData.primaryType,
|
|
5182
5186
|
message: typedData.message
|
|
5183
5187
|
});
|
|
5184
|
-
const sessionDetails =
|
|
5188
|
+
const sessionDetails = _chunkVPWWFWZTcjs.buildSessionDetails.call(void 0,
|
|
5185
5189
|
setup.sessionDetailsUnsigned,
|
|
5186
5190
|
signature
|
|
5187
5191
|
);
|
|
@@ -5214,7 +5218,7 @@ async function runAccountSetup(input, deps) {
|
|
|
5214
5218
|
isRegistered: true
|
|
5215
5219
|
};
|
|
5216
5220
|
} catch (error) {
|
|
5217
|
-
|
|
5221
|
+
_chunkVPWWFWZTcjs.debugError.call(void 0, debug, "account-setup", "setup:failed", error, {
|
|
5218
5222
|
owner: input.ownerAddress
|
|
5219
5223
|
});
|
|
5220
5224
|
if (error instanceof SetupError) throw error;
|
|
@@ -5225,7 +5229,7 @@ function runAccountSetupDeduped(input, deps, requestKey) {
|
|
|
5225
5229
|
const now = Date.now();
|
|
5226
5230
|
const existing = setupRequestDedupe.get(requestKey);
|
|
5227
5231
|
if (existing && (!existing.settled || existing.expiresAt > now)) {
|
|
5228
|
-
|
|
5232
|
+
_chunkVPWWFWZTcjs.debugLog.call(void 0, deps.debug, "account-setup", "setup:dedupe-hit", {
|
|
5229
5233
|
owner: input.ownerAddress,
|
|
5230
5234
|
forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
|
|
5231
5235
|
});
|
|
@@ -5455,7 +5459,8 @@ function deriveStep(flow, d, p, activeEntry, fiat, exchange) {
|
|
|
5455
5459
|
sourceDecimals: _nullishCoalesce(d.sourceDecimals, () => ( void 0)),
|
|
5456
5460
|
inputAmountUsd: _nullishCoalesce(d.inputAmountUsd, () => ( void 0)),
|
|
5457
5461
|
directTransfer: p.directTransfer,
|
|
5458
|
-
swappedContext: _nullishCoalesce(p.swappedContext, () => ( void 0))
|
|
5462
|
+
swappedContext: _nullishCoalesce(p.swappedContext, () => ( void 0)),
|
|
5463
|
+
initialEvent: _nullishCoalesce(p.initialEvent, () => ( void 0))
|
|
5459
5464
|
};
|
|
5460
5465
|
}
|
|
5461
5466
|
}
|
|
@@ -5512,11 +5517,11 @@ function DepositFlow({
|
|
|
5512
5517
|
onError,
|
|
5513
5518
|
debug
|
|
5514
5519
|
}) {
|
|
5515
|
-
const rpcUrls =
|
|
5516
|
-
const onStepChangeRef =
|
|
5517
|
-
const onEventRef =
|
|
5518
|
-
const onLifecycleRef =
|
|
5519
|
-
const onErrorRef =
|
|
5520
|
+
const rpcUrls = _chunkVPWWFWZTcjs.useRpcUrls.call(void 0, );
|
|
5521
|
+
const onStepChangeRef = _chunkVPWWFWZTcjs.useLatestRef.call(void 0, onStepChange);
|
|
5522
|
+
const onEventRef = _chunkVPWWFWZTcjs.useLatestRef.call(void 0, onEvent);
|
|
5523
|
+
const onLifecycleRef = _chunkVPWWFWZTcjs.useLatestRef.call(void 0, onLifecycle);
|
|
5524
|
+
const onErrorRef = _chunkVPWWFWZTcjs.useLatestRef.call(void 0, onError);
|
|
5520
5525
|
const storeApi = useDepositStoreApi();
|
|
5521
5526
|
const flowSlice = useDepositStore((s) => s.flow);
|
|
5522
5527
|
const depositSlice = useDepositStore((s) => s.deposit);
|
|
@@ -5533,13 +5538,13 @@ function DepositFlow({
|
|
|
5533
5538
|
const stableWalletSelectionKeyRef = _react.useRef.call(void 0, null);
|
|
5534
5539
|
const logFlow = _react.useCallback.call(void 0,
|
|
5535
5540
|
(message, data) => {
|
|
5536
|
-
|
|
5541
|
+
_chunkVPWWFWZTcjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
|
|
5537
5542
|
},
|
|
5538
5543
|
[debug]
|
|
5539
5544
|
);
|
|
5540
5545
|
const logFlowError = _react.useCallback.call(void 0,
|
|
5541
5546
|
(message, error, data) => {
|
|
5542
|
-
|
|
5547
|
+
_chunkVPWWFWZTcjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
|
|
5543
5548
|
},
|
|
5544
5549
|
[debug]
|
|
5545
5550
|
);
|
|
@@ -5672,7 +5677,7 @@ function DepositFlow({
|
|
|
5672
5677
|
return {
|
|
5673
5678
|
ownerAddress: dappAddress,
|
|
5674
5679
|
walletClient: void 0,
|
|
5675
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
5680
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkVPWWFWZTcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
|
|
5676
5681
|
switchChain: void 0
|
|
5677
5682
|
};
|
|
5678
5683
|
}
|
|
@@ -5681,7 +5686,7 @@ function DepositFlow({
|
|
|
5681
5686
|
return {
|
|
5682
5687
|
ownerAddress: dappWalletClient.account.address,
|
|
5683
5688
|
walletClient: dappWalletClient,
|
|
5684
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
5689
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkVPWWFWZTcjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
|
|
5685
5690
|
switchChain: dappSwitchChain
|
|
5686
5691
|
};
|
|
5687
5692
|
}
|
|
@@ -5695,7 +5700,7 @@ function DepositFlow({
|
|
|
5695
5700
|
return {
|
|
5696
5701
|
ownerAddress: dappAddress,
|
|
5697
5702
|
walletClient: void 0,
|
|
5698
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
5703
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkVPWWFWZTcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
|
|
5699
5704
|
switchChain: void 0
|
|
5700
5705
|
};
|
|
5701
5706
|
}
|
|
@@ -5704,7 +5709,7 @@ function DepositFlow({
|
|
|
5704
5709
|
return {
|
|
5705
5710
|
ownerAddress: dappWalletClient.account.address,
|
|
5706
5711
|
walletClient: dappWalletClient,
|
|
5707
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
5712
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkVPWWFWZTcjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
|
|
5708
5713
|
switchChain: dappSwitchChain
|
|
5709
5714
|
};
|
|
5710
5715
|
}
|
|
@@ -5712,7 +5717,7 @@ function DepositFlow({
|
|
|
5712
5717
|
return {
|
|
5713
5718
|
ownerAddress: reownWallet.address,
|
|
5714
5719
|
walletClient: reownWallet.walletClient,
|
|
5715
|
-
publicClient: _nullishCoalesce(reownWallet.publicClient, () => (
|
|
5720
|
+
publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunkVPWWFWZTcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
|
|
5716
5721
|
switchChain: reownWallet.switchChain
|
|
5717
5722
|
};
|
|
5718
5723
|
}
|
|
@@ -5751,7 +5756,7 @@ function DepositFlow({
|
|
|
5751
5756
|
return {
|
|
5752
5757
|
ownerAddress: dappAddress,
|
|
5753
5758
|
walletClient: void 0,
|
|
5754
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
5759
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkVPWWFWZTcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
|
|
5755
5760
|
switchChain: void 0
|
|
5756
5761
|
};
|
|
5757
5762
|
}
|
|
@@ -6070,7 +6075,7 @@ function DepositFlow({
|
|
|
6070
6075
|
eoa: dappImportOwner,
|
|
6071
6076
|
getPublicClient: (chainId) => {
|
|
6072
6077
|
try {
|
|
6073
|
-
return
|
|
6078
|
+
return _chunkVPWWFWZTcjs.getPublicClient.call(void 0, chainId, rpcUrls);
|
|
6074
6079
|
} catch (e30) {
|
|
6075
6080
|
return null;
|
|
6076
6081
|
}
|
|
@@ -6377,7 +6382,7 @@ function DepositFlow({
|
|
|
6377
6382
|
try {
|
|
6378
6383
|
sessionOwner = await resolveSessionOwner(owner);
|
|
6379
6384
|
} catch (error) {
|
|
6380
|
-
|
|
6385
|
+
_chunkVPWWFWZTcjs.debugError.call(void 0,
|
|
6381
6386
|
debug,
|
|
6382
6387
|
"deposit-flow",
|
|
6383
6388
|
"session-owner:resolve-failed",
|
|
@@ -6678,7 +6683,8 @@ function DepositFlow({
|
|
|
6678
6683
|
amount,
|
|
6679
6684
|
sourceSymbol: _nullishCoalesce(info.orderCrypto, () => ( "USDC")),
|
|
6680
6685
|
sourceDecimals: SWAPPED_SOURCE_DECIMALS,
|
|
6681
|
-
swappedContext
|
|
6686
|
+
swappedContext,
|
|
6687
|
+
initialEvent: info.initialEvent
|
|
6682
6688
|
});
|
|
6683
6689
|
_optionalChain([onLifecycleRef, 'access', _203 => _203.current, 'optionalCall', _204 => _204({
|
|
6684
6690
|
type: "submitted",
|
|
@@ -6802,7 +6808,7 @@ function DepositFlow({
|
|
|
6802
6808
|
);
|
|
6803
6809
|
if (showConnectStep) {
|
|
6804
6810
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6805
|
-
|
|
6811
|
+
_chunkVPWWFWZTcjs.ConnectStep,
|
|
6806
6812
|
{
|
|
6807
6813
|
walletRows,
|
|
6808
6814
|
transferCryptoState: dappAddress ? transferCryptoState : void 0,
|
|
@@ -6934,7 +6940,7 @@ function DepositFlow({
|
|
|
6934
6940
|
}
|
|
6935
6941
|
),
|
|
6936
6942
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6937
|
-
|
|
6943
|
+
_chunkVPWWFWZTcjs.ProcessingStep,
|
|
6938
6944
|
{
|
|
6939
6945
|
smartAccount: step.smartAccount,
|
|
6940
6946
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
@@ -6950,6 +6956,7 @@ function DepositFlow({
|
|
|
6950
6956
|
swappedContext: step.swappedContext,
|
|
6951
6957
|
service,
|
|
6952
6958
|
directTransfer: step.directTransfer,
|
|
6959
|
+
initialEvent: step.initialEvent,
|
|
6953
6960
|
isSwappedOrder: true,
|
|
6954
6961
|
onClose,
|
|
6955
6962
|
onNewDeposit: handleNewDeposit,
|
|
@@ -7002,7 +7009,7 @@ function DepositFlow({
|
|
|
7002
7009
|
}
|
|
7003
7010
|
),
|
|
7004
7011
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7005
|
-
|
|
7012
|
+
_chunkVPWWFWZTcjs.ProcessingStep,
|
|
7006
7013
|
{
|
|
7007
7014
|
smartAccount: step.smartAccount,
|
|
7008
7015
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
@@ -7018,6 +7025,7 @@ function DepositFlow({
|
|
|
7018
7025
|
swappedContext: step.swappedContext,
|
|
7019
7026
|
service,
|
|
7020
7027
|
directTransfer: step.directTransfer,
|
|
7028
|
+
initialEvent: step.initialEvent,
|
|
7021
7029
|
isSwappedOrder: true,
|
|
7022
7030
|
onClose,
|
|
7023
7031
|
onNewDeposit: handleNewDeposit,
|
|
@@ -7132,7 +7140,7 @@ function DepositFlow({
|
|
|
7132
7140
|
) })
|
|
7133
7141
|
] }) : null,
|
|
7134
7142
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7135
|
-
|
|
7143
|
+
_chunkVPWWFWZTcjs.ProcessingStep,
|
|
7136
7144
|
{
|
|
7137
7145
|
smartAccount: effectiveStep.smartAccount,
|
|
7138
7146
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
@@ -7147,6 +7155,7 @@ function DepositFlow({
|
|
|
7147
7155
|
amountUsd: effectiveStep.inputAmountUsd,
|
|
7148
7156
|
service,
|
|
7149
7157
|
directTransfer: effectiveStep.directTransfer,
|
|
7158
|
+
initialEvent: effectiveStep.initialEvent,
|
|
7150
7159
|
onClose,
|
|
7151
7160
|
onNewDeposit: handleNewDeposit,
|
|
7152
7161
|
onDepositComplete: handleDepositComplete,
|
|
@@ -7184,7 +7193,7 @@ function DepositFlow({
|
|
|
7184
7193
|
if (_optionalChain([signerContext, 'access', _232 => _232.publicClient, 'access', _233 => _233.chain, 'optionalAccess', _234 => _234.id]) === chainId) {
|
|
7185
7194
|
return signerContext.publicClient;
|
|
7186
7195
|
}
|
|
7187
|
-
return
|
|
7196
|
+
return _chunkVPWWFWZTcjs.getPublicClient.call(void 0, chainId, rpcUrls);
|
|
7188
7197
|
};
|
|
7189
7198
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
7190
7199
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -7293,7 +7302,7 @@ function DepositFlow({
|
|
|
7293
7302
|
}
|
|
7294
7303
|
),
|
|
7295
7304
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7296
|
-
|
|
7305
|
+
_chunkVPWWFWZTcjs.ProcessingStep,
|
|
7297
7306
|
{
|
|
7298
7307
|
smartAccount: effectiveStep.smartAccount,
|
|
7299
7308
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
@@ -7308,6 +7317,7 @@ function DepositFlow({
|
|
|
7308
7317
|
amountUsd: effectiveStep.inputAmountUsd,
|
|
7309
7318
|
service,
|
|
7310
7319
|
directTransfer: effectiveStep.directTransfer,
|
|
7320
|
+
initialEvent: effectiveStep.initialEvent,
|
|
7311
7321
|
uiConfig,
|
|
7312
7322
|
onClose,
|
|
7313
7323
|
onNewDeposit: handleNewDeposit,
|
|
@@ -7466,7 +7476,7 @@ function DepositHistoryPanel({
|
|
|
7466
7476
|
className: "rs-modal-header-back",
|
|
7467
7477
|
"aria-label": "Back",
|
|
7468
7478
|
onClick: onClose,
|
|
7469
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7479
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.ChevronLeftIcon, {})
|
|
7470
7480
|
}
|
|
7471
7481
|
) }),
|
|
7472
7482
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: onCloseModal && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -7476,29 +7486,29 @@ function DepositHistoryPanel({
|
|
|
7476
7486
|
className: "rs-modal-close",
|
|
7477
7487
|
"aria-label": "Close",
|
|
7478
7488
|
onClick: onCloseModal,
|
|
7479
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7489
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.CloseIcon, {})
|
|
7480
7490
|
}
|
|
7481
7491
|
) })
|
|
7482
7492
|
] }),
|
|
7483
7493
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen", children: [
|
|
7484
7494
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen-body", children: [
|
|
7485
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7495
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.HistoryIcon, {}), title: "History" }),
|
|
7486
7496
|
isLoading && deposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
7487
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7497
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.HistoryIcon, {}) }),
|
|
7488
7498
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
7489
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7499
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.Spinner, { className: "rs-spinner--sm" }),
|
|
7490
7500
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Loading history\u2026" })
|
|
7491
7501
|
] })
|
|
7492
7502
|
] }),
|
|
7493
7503
|
error && !isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
7494
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7504
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.AlertTriangleIcon, {}) }),
|
|
7495
7505
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
7496
7506
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "Couldn't load history" }),
|
|
7497
7507
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: error })
|
|
7498
7508
|
] })
|
|
7499
7509
|
] }),
|
|
7500
7510
|
!isLoading && !error && visibleDeposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
7501
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7511
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.HistoryIcon, {}) }),
|
|
7502
7512
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
7503
7513
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "No deposits yet" }),
|
|
7504
7514
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Your deposit history will appear here" })
|
|
@@ -7518,7 +7528,7 @@ function DepositHistoryPanel({
|
|
|
7518
7528
|
)
|
|
7519
7529
|
] })
|
|
7520
7530
|
] }),
|
|
7521
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7531
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.PoweredBy, {})
|
|
7522
7532
|
] })
|
|
7523
7533
|
]
|
|
7524
7534
|
}
|
|
@@ -7593,7 +7603,7 @@ function HistoryCard({ deposit }) {
|
|
|
7593
7603
|
onClick: (e) => e.stopPropagation(),
|
|
7594
7604
|
children: [
|
|
7595
7605
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: shortenHash(deposit.sourceTxHash) }),
|
|
7596
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7606
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.ArrowUpRightIcon, {})
|
|
7597
7607
|
]
|
|
7598
7608
|
}
|
|
7599
7609
|
)
|
|
@@ -7608,7 +7618,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
|
7608
7618
|
// src/DepositModal.tsx
|
|
7609
7619
|
|
|
7610
7620
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
7611
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
7621
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-ICBGUVAA.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
7612
7622
|
);
|
|
7613
7623
|
function sortByCreatedAtDesc(items) {
|
|
7614
7624
|
return [...items].sort((a, b) => {
|
|
@@ -7686,7 +7696,7 @@ function DepositModalInner({
|
|
|
7686
7696
|
debug
|
|
7687
7697
|
}) {
|
|
7688
7698
|
const modalRef = _react.useRef.call(void 0, null);
|
|
7689
|
-
const onReadyRef =
|
|
7699
|
+
const onReadyRef = _chunkVPWWFWZTcjs.useLatestRef.call(void 0, onReady);
|
|
7690
7700
|
const [currentScreen, setCurrentScreen] = _react.useState.call(void 0, "connect");
|
|
7691
7701
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
7692
7702
|
void 0
|
|
@@ -7704,16 +7714,16 @@ function DepositModalInner({
|
|
|
7704
7714
|
const historyLoadedRef = _react.useRef.call(void 0, false);
|
|
7705
7715
|
const targetChain = targetChainProp === "solana" ? "solana" : _chunkABVRVW3Pcjs.getChainId.call(void 0, targetChainProp);
|
|
7706
7716
|
const sourceChain = sourceChainProp ? _chunkABVRVW3Pcjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
7707
|
-
const rpcUrls =
|
|
7717
|
+
const rpcUrls = _chunkVPWWFWZTcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
|
|
7708
7718
|
const [recipientIsContract, setRecipientIsContract] = _react.useState.call(void 0, false);
|
|
7709
|
-
const onErrorRef =
|
|
7719
|
+
const onErrorRef = _chunkVPWWFWZTcjs.useLatestRef.call(void 0, onError);
|
|
7710
7720
|
_react.useEffect.call(void 0, () => {
|
|
7711
7721
|
if (targetChain !== _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID || !_viem.isAddress.call(void 0, recipient, { strict: false })) {
|
|
7712
7722
|
setRecipientIsContract(false);
|
|
7713
7723
|
return;
|
|
7714
7724
|
}
|
|
7715
7725
|
let cancelled = false;
|
|
7716
|
-
|
|
7726
|
+
_chunkVPWWFWZTcjs.getHyperEvmReadClient.call(void 0, rpcUrls).getCode({ address: recipient }).then((code) => {
|
|
7717
7727
|
if (cancelled) return;
|
|
7718
7728
|
const isContract = _chunkABVRVW3Pcjs.isContractBytecode.call(void 0, code);
|
|
7719
7729
|
setRecipientIsContract(isContract);
|
|
@@ -7731,7 +7741,7 @@ function DepositModalInner({
|
|
|
7731
7741
|
};
|
|
7732
7742
|
}, [targetChain, recipient, onErrorRef, rpcUrls]);
|
|
7733
7743
|
const service = _react.useMemo.call(void 0,
|
|
7734
|
-
() =>
|
|
7744
|
+
() => _chunkVPWWFWZTcjs.createDepositService.call(void 0, backendUrl, {
|
|
7735
7745
|
debug,
|
|
7736
7746
|
debugScope: "service:deposit"
|
|
7737
7747
|
}),
|
|
@@ -7747,7 +7757,7 @@ function DepositModalInner({
|
|
|
7747
7757
|
}, [store, targetChain, targetToken]);
|
|
7748
7758
|
_react.useEffect.call(void 0, () => {
|
|
7749
7759
|
if (isOpen && modalRef.current) {
|
|
7750
|
-
|
|
7760
|
+
_chunkVPWWFWZTcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
7751
7761
|
}
|
|
7752
7762
|
}, [isOpen, theme]);
|
|
7753
7763
|
_react.useEffect.call(void 0, () => {
|
|
@@ -7828,7 +7838,7 @@ function DepositModalInner({
|
|
|
7828
7838
|
fetchHistory("initial");
|
|
7829
7839
|
}
|
|
7830
7840
|
}, [historyOpen, fetchHistory]);
|
|
7831
|
-
const onLifecycleRef =
|
|
7841
|
+
const onLifecycleRef = _chunkVPWWFWZTcjs.useLatestRef.call(void 0, onLifecycle);
|
|
7832
7842
|
const handleLifecycle = _react.useCallback.call(void 0,
|
|
7833
7843
|
(event) => {
|
|
7834
7844
|
_optionalChain([onLifecycleRef, 'access', _247 => _247.current, 'optionalCall', _248 => _248(event)]);
|
|
@@ -7859,8 +7869,8 @@ function DepositModalInner({
|
|
|
7859
7869
|
}, [isOpen, store]);
|
|
7860
7870
|
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _249 => _249.showBackButton]), () => ( true));
|
|
7861
7871
|
const canGoBack = backHandler !== void 0;
|
|
7862
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7863
|
-
|
|
7872
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7873
|
+
_chunkVPWWFWZTcjs.Modal,
|
|
7864
7874
|
{
|
|
7865
7875
|
isOpen,
|
|
7866
7876
|
onClose,
|
|
@@ -7876,7 +7886,7 @@ function DepositModalInner({
|
|
|
7876
7886
|
className: "rs-modal-header-back",
|
|
7877
7887
|
"aria-label": "Go back",
|
|
7878
7888
|
onClick: backHandler,
|
|
7879
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7889
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.ChevronLeftIcon, {})
|
|
7880
7890
|
}
|
|
7881
7891
|
) }),
|
|
7882
7892
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
|
|
@@ -7888,7 +7898,7 @@ function DepositModalInner({
|
|
|
7888
7898
|
"aria-label": "Deposit history",
|
|
7889
7899
|
onClick: handleHistoryOpen,
|
|
7890
7900
|
disabled: !recipient,
|
|
7891
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7901
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.HistoryIcon, {})
|
|
7892
7902
|
}
|
|
7893
7903
|
),
|
|
7894
7904
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -7898,12 +7908,12 @@ function DepositModalInner({
|
|
|
7898
7908
|
onClick: onClose,
|
|
7899
7909
|
className: "rs-modal-close",
|
|
7900
7910
|
"aria-label": "Close",
|
|
7901
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7911
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.CloseIcon, {})
|
|
7902
7912
|
}
|
|
7903
7913
|
)
|
|
7904
7914
|
] })
|
|
7905
7915
|
] }),
|
|
7906
|
-
recipientIsContract ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7916
|
+
recipientIsContract ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVPWWFWZTcjs.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,
|
|
7907
7917
|
DepositFlow,
|
|
7908
7918
|
{
|
|
7909
7919
|
dappWalletClient,
|