@rhinestone/deposit-modal 0.3.0-alpha.13 → 0.3.0-alpha.15
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-HBAWSK6K.mjs → DepositModalReown-CAX35NN2.mjs} +4 -4
- package/dist/{DepositModalReown-CXPRZRXL.cjs → DepositModalReown-P4QGKQRZ.cjs} +7 -7
- package/dist/{QRCode-KG47KTGX.cjs → QRCode-5DXFNKI2.cjs} +1 -1
- package/dist/{QRCode-YJ3EGWQS.mjs → QRCode-WUC652SH.mjs} +1 -1
- package/dist/{WithdrawModalReown-EEWQRENY.mjs → WithdrawModalReown-V4YYPNBE.mjs} +4 -4
- package/dist/{WithdrawModalReown-T3TPJIME.cjs → WithdrawModalReown-ZSFALZOB.cjs} +7 -7
- package/dist/{chunk-PWV2UJP3.cjs → chunk-6O4NGY2N.cjs} +5 -5
- package/dist/{chunk-SZIYS42B.mjs → chunk-7C4SPVM5.mjs} +6 -2
- package/dist/{chunk-6RCOF3XU.cjs → chunk-7LJYEGZZ.cjs} +93 -93
- package/dist/{chunk-DZNXG5JK.cjs → chunk-7NO7WVJV.cjs} +35 -28
- package/dist/{chunk-SEOQ66FW.cjs → chunk-AAQPYKBA.cjs} +397 -355
- package/dist/{chunk-7JIDIX27.cjs → chunk-DZ2RPLBM.cjs} +7 -3
- package/dist/{chunk-YB3JPWJW.mjs → chunk-H2WSFD53.mjs} +2 -2
- package/dist/{chunk-6K4JHM2D.mjs → chunk-IZMF2WHM.mjs} +12 -5
- package/dist/{chunk-HZBO2SIZ.mjs → chunk-KDJS56TQ.mjs} +97 -55
- package/dist/{chunk-EC63ZHY4.mjs → chunk-LDMY67HP.mjs} +3 -3
- package/dist/constants.cjs +2 -2
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +4 -4
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +3 -3
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +4 -4
- package/dist/styles.css +60 -65
- package/dist/{types-C8i2ebY1.d.cts → types-cXr3j4NV.d.cts} +26 -0
- package/dist/{types-C8i2ebY1.d.ts → types-cXr3j4NV.d.ts} +26 -0
- package/dist/withdraw.cjs +4 -4
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +3 -3
- package/package.json +1 -1
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
|
|
55
|
-
var
|
|
55
|
+
var _chunk7NO7WVJVcjs = require('./chunk-7NO7WVJV.cjs');
|
|
56
56
|
|
|
57
57
|
|
|
58
58
|
|
|
@@ -74,7 +74,8 @@ var _chunkDZNXG5JKcjs = require('./chunk-DZNXG5JK.cjs');
|
|
|
74
74
|
|
|
75
75
|
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
|
|
78
|
+
var _chunkDZ2RPLBMcjs = require('./chunk-DZ2RPLBM.cjs');
|
|
78
79
|
|
|
79
80
|
// src/DepositModal.tsx
|
|
80
81
|
|
|
@@ -120,13 +121,13 @@ function AssetSelectStep({
|
|
|
120
121
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
121
122
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
122
123
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
123
|
-
return
|
|
124
|
+
return _chunk7NO7WVJVcjs.getAssetId.call(void 0, {
|
|
124
125
|
chainId: defaultSourceChain,
|
|
125
126
|
token: defaultSourceToken
|
|
126
127
|
});
|
|
127
128
|
}, [defaultSourceChain, defaultSourceToken]);
|
|
128
|
-
const onTotalBalanceComputedRef =
|
|
129
|
-
const onAssetsLoadedRef =
|
|
129
|
+
const onTotalBalanceComputedRef = _chunk7NO7WVJVcjs.useLatestRef.call(void 0, onTotalBalanceComputed);
|
|
130
|
+
const onAssetsLoadedRef = _chunk7NO7WVJVcjs.useLatestRef.call(void 0, onAssetsLoaded);
|
|
130
131
|
_react.useEffect.call(void 0, () => {
|
|
131
132
|
let active = true;
|
|
132
133
|
function emitAssetsUpdate(currentAssets) {
|
|
@@ -147,11 +148,11 @@ function AssetSelectStep({
|
|
|
147
148
|
try {
|
|
148
149
|
const portfolio = await service.fetchPortfolio(address);
|
|
149
150
|
if (!active) return;
|
|
150
|
-
const portfolioAssets =
|
|
151
|
+
const portfolioAssets = _chunk7NO7WVJVcjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
151
152
|
setAssets(portfolioAssets);
|
|
152
153
|
emitAssetsUpdate(portfolioAssets);
|
|
153
154
|
const hasNative = portfolioAssets.some(
|
|
154
|
-
(asset) => asset.token.toLowerCase() ===
|
|
155
|
+
(asset) => asset.token.toLowerCase() === _chunkDZ2RPLBMcjs.NATIVE_TOKEN_ADDRESS
|
|
155
156
|
);
|
|
156
157
|
if (!hasNative) {
|
|
157
158
|
const nativeAssets = await fetchNativeAssets(
|
|
@@ -223,7 +224,7 @@ function AssetSelectStep({
|
|
|
223
224
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
224
225
|
const numeric = Number(raw);
|
|
225
226
|
if (!Number.isFinite(numeric)) return raw;
|
|
226
|
-
return
|
|
227
|
+
return _chunk7NO7WVJVcjs.tokenFormatter.format(numeric);
|
|
227
228
|
} catch (e3) {
|
|
228
229
|
return asset.balance;
|
|
229
230
|
}
|
|
@@ -231,20 +232,20 @@ function AssetSelectStep({
|
|
|
231
232
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
232
233
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
233
234
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
234
|
-
|
|
235
|
+
_chunk7NO7WVJVcjs.BodyHeader,
|
|
235
236
|
{
|
|
236
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
237
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.WalletIcon, {}),
|
|
237
238
|
title: "Your assets",
|
|
238
239
|
subtitle: "Select source assets to transfer"
|
|
239
240
|
}
|
|
240
241
|
),
|
|
241
242
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
242
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
243
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
243
244
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
244
245
|
] }),
|
|
245
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
246
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.Callout, { variant: "error", children: error }),
|
|
246
247
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
247
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
248
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
248
249
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
249
250
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
250
251
|
address.slice(0, 6),
|
|
@@ -264,9 +265,9 @@ function AssetSelectStep({
|
|
|
264
265
|
!loading && !error && rows.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: rows.map((asset) => {
|
|
265
266
|
const isSelected = selectedAssetId === asset.id;
|
|
266
267
|
const tokenAmount = formatBalance(asset);
|
|
267
|
-
const badge =
|
|
268
|
-
const tokenIcon =
|
|
269
|
-
const chainIcon =
|
|
268
|
+
const badge = _chunkDZ2RPLBMcjs.getChainBadge.call(void 0, asset.chainId);
|
|
269
|
+
const tokenIcon = _chunkDZ2RPLBMcjs.getTokenIcon.call(void 0, asset.symbol);
|
|
270
|
+
const chainIcon = _chunkDZ2RPLBMcjs.getChainIcon.call(void 0, asset.chainId);
|
|
270
271
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
271
272
|
"button",
|
|
272
273
|
{
|
|
@@ -282,7 +283,7 @@ function AssetSelectStep({
|
|
|
282
283
|
"img",
|
|
283
284
|
{
|
|
284
285
|
src: chainIcon,
|
|
285
|
-
alt:
|
|
286
|
+
alt: _chunkDZ2RPLBMcjs.getChainName.call(void 0, asset.chainId)
|
|
286
287
|
}
|
|
287
288
|
) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
288
289
|
"span",
|
|
@@ -301,7 +302,7 @@ function AssetSelectStep({
|
|
|
301
302
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-name", children: asset.symbol }),
|
|
302
303
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-asset-chain", children: [
|
|
303
304
|
"on ",
|
|
304
|
-
|
|
305
|
+
_chunkDZ2RPLBMcjs.getChainName.call(void 0, asset.chainId)
|
|
305
306
|
] })
|
|
306
307
|
] }),
|
|
307
308
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-balance-small", children: [
|
|
@@ -311,14 +312,14 @@ function AssetSelectStep({
|
|
|
311
312
|
] })
|
|
312
313
|
] })
|
|
313
314
|
] }),
|
|
314
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ?
|
|
315
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunk7NO7WVJVcjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
315
316
|
]
|
|
316
317
|
},
|
|
317
318
|
asset.id
|
|
318
319
|
);
|
|
319
320
|
}) }),
|
|
320
321
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
321
|
-
|
|
322
|
+
_chunk7NO7WVJVcjs.Button,
|
|
322
323
|
{
|
|
323
324
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
324
325
|
disabled: !selectedAsset,
|
|
@@ -327,17 +328,17 @@ function AssetSelectStep({
|
|
|
327
328
|
}
|
|
328
329
|
)
|
|
329
330
|
] }),
|
|
330
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
331
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.PoweredBy, {})
|
|
331
332
|
] });
|
|
332
333
|
}
|
|
333
334
|
async function fetchNativeAssets(address, publicClient, existing) {
|
|
334
335
|
const existingIds = new Set(existing.map((asset) => asset.id));
|
|
335
336
|
const connectedChainId = _optionalChain([publicClient, 'access', _9 => _9.chain, 'optionalAccess', _10 => _10.id]);
|
|
336
337
|
if (!connectedChainId) return [];
|
|
337
|
-
if (!
|
|
338
|
-
const id =
|
|
338
|
+
if (!_chunkDZ2RPLBMcjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
|
|
339
|
+
const id = _chunk7NO7WVJVcjs.getAssetId.call(void 0, {
|
|
339
340
|
chainId: connectedChainId,
|
|
340
|
-
token:
|
|
341
|
+
token: _chunkDZ2RPLBMcjs.NATIVE_TOKEN_ADDRESS
|
|
341
342
|
});
|
|
342
343
|
if (existingIds.has(id)) return [];
|
|
343
344
|
try {
|
|
@@ -346,7 +347,7 @@ async function fetchNativeAssets(address, publicClient, existing) {
|
|
|
346
347
|
{
|
|
347
348
|
id,
|
|
348
349
|
chainId: connectedChainId,
|
|
349
|
-
token:
|
|
350
|
+
token: _chunkDZ2RPLBMcjs.NATIVE_TOKEN_ADDRESS,
|
|
350
351
|
symbol: "ETH",
|
|
351
352
|
name: "Ethereum",
|
|
352
353
|
decimals: 18,
|
|
@@ -507,8 +508,8 @@ function AmountStep({
|
|
|
507
508
|
const chainMismatch = Boolean(
|
|
508
509
|
_optionalChain([walletClient, 'optionalAccess', _15 => _15.chain, 'optionalAccess', _16 => _16.id]) && walletClient.chain.id !== asset.chainId
|
|
509
510
|
);
|
|
510
|
-
const targetSymbol =
|
|
511
|
-
const isSourceStablecoin =
|
|
511
|
+
const targetSymbol = _chunkDZ2RPLBMcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
512
|
+
const isSourceStablecoin = _chunkDZ2RPLBMcjs.isStablecoinSymbol.call(void 0, asset.symbol);
|
|
512
513
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
513
514
|
if (tokenPriceUsdOverride !== void 0 && tokenPriceUsdOverride > 0)
|
|
514
515
|
return tokenPriceUsdOverride;
|
|
@@ -532,7 +533,7 @@ function AmountStep({
|
|
|
532
533
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
533
534
|
if (!balanceTarget || !publicClient) return;
|
|
534
535
|
try {
|
|
535
|
-
const bal =
|
|
536
|
+
const bal = _chunk7NO7WVJVcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
536
537
|
address: asset.token,
|
|
537
538
|
abi: _viem.erc20Abi,
|
|
538
539
|
functionName: "balanceOf",
|
|
@@ -553,7 +554,7 @@ function AmountStep({
|
|
|
553
554
|
hasAttemptedSwitch.current = true;
|
|
554
555
|
switchChain(asset.chainId).catch((err) => {
|
|
555
556
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
556
|
-
setError(
|
|
557
|
+
setError(_chunk7NO7WVJVcjs.formatUserError.call(void 0, raw));
|
|
557
558
|
});
|
|
558
559
|
}
|
|
559
560
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -606,7 +607,7 @@ function AmountStep({
|
|
|
606
607
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
607
608
|
const numeric = Number(raw);
|
|
608
609
|
if (!Number.isFinite(numeric)) return raw;
|
|
609
|
-
return
|
|
610
|
+
return _chunk7NO7WVJVcjs.tokenFormatter.format(numeric);
|
|
610
611
|
} catch (e8) {
|
|
611
612
|
return "\u2026";
|
|
612
613
|
}
|
|
@@ -719,13 +720,13 @@ function AmountStep({
|
|
|
719
720
|
};
|
|
720
721
|
const continueLabel = exceedsBalance ? "Insufficient balance" : isAboveMax ? "Continue with max allowed deposit" : isBelowMin ? "Continue with minimum deposit" : "Continue";
|
|
721
722
|
const continueDisabled = chainMismatch || isCheckingLiquidity || exceedsBalance || numericAmount === 0 && !isBelowMin || balance === null;
|
|
722
|
-
const sourceChainName =
|
|
723
|
-
const targetChainName =
|
|
724
|
-
const sourceTokenIcon =
|
|
725
|
-
const targetTokenIcon =
|
|
723
|
+
const sourceChainName = _chunkDZ2RPLBMcjs.getChainName.call(void 0, asset.chainId);
|
|
724
|
+
const targetChainName = _chunkDZ2RPLBMcjs.getChainName.call(void 0, targetChain);
|
|
725
|
+
const sourceTokenIcon = _chunkDZ2RPLBMcjs.getTokenIcon.call(void 0, asset.symbol);
|
|
726
|
+
const targetTokenIcon = _chunkDZ2RPLBMcjs.getTokenIcon.call(void 0, targetSymbol);
|
|
726
727
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
727
728
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
728
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
729
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.WalletIcon, {}), title: "Wallet deposit" }),
|
|
729
730
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
730
731
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
731
732
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -745,13 +746,13 @@ function AmountStep({
|
|
|
745
746
|
" available",
|
|
746
747
|
balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
747
748
|
" (~",
|
|
748
|
-
|
|
749
|
+
_chunk7NO7WVJVcjs.currencyFormatter.format(balanceUsd),
|
|
749
750
|
")"
|
|
750
751
|
] })
|
|
751
752
|
] }),
|
|
752
753
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
753
754
|
"Min. deposit ",
|
|
754
|
-
|
|
755
|
+
_chunk7NO7WVJVcjs.currencyFormatter.format(minDepositUsd)
|
|
755
756
|
] })
|
|
756
757
|
] })
|
|
757
758
|
] }),
|
|
@@ -792,12 +793,12 @@ function AmountStep({
|
|
|
792
793
|
] }),
|
|
793
794
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
794
795
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
795
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
796
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunk7NO7WVJVcjs.currencyFormatter.format(balanceAfterUsd) })
|
|
796
797
|
] })
|
|
797
798
|
] }),
|
|
798
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
799
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.Callout, { variant: "error", children: error }),
|
|
799
800
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
800
|
-
|
|
801
|
+
_chunk7NO7WVJVcjs.Button,
|
|
801
802
|
{
|
|
802
803
|
onClick: handleContinue,
|
|
803
804
|
fullWidth: true,
|
|
@@ -808,7 +809,7 @@ function AmountStep({
|
|
|
808
809
|
}
|
|
809
810
|
)
|
|
810
811
|
] }),
|
|
811
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
812
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.PoweredBy, {})
|
|
812
813
|
] });
|
|
813
814
|
}
|
|
814
815
|
|
|
@@ -846,13 +847,13 @@ function ConfirmStep({
|
|
|
846
847
|
_optionalChain([walletClient, 'optionalAccess', _23 => _23.chain, 'optionalAccess', _24 => _24.id]) && walletClient.chain.id !== asset.chainId
|
|
847
848
|
);
|
|
848
849
|
const sameRoute = targetChain === asset.chainId && targetToken.toLowerCase() === asset.token.toLowerCase();
|
|
849
|
-
const targetSymbol = sameRoute ? asset.symbol :
|
|
850
|
-
const sourceChainName =
|
|
851
|
-
const targetChainName =
|
|
852
|
-
const sourceChainIcon =
|
|
853
|
-
const targetChainIcon =
|
|
854
|
-
const sourceTokenIcon =
|
|
855
|
-
const targetTokenIcon =
|
|
850
|
+
const targetSymbol = sameRoute ? asset.symbol : _chunkDZ2RPLBMcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
851
|
+
const sourceChainName = _chunkDZ2RPLBMcjs.getChainName.call(void 0, asset.chainId);
|
|
852
|
+
const targetChainName = _chunkDZ2RPLBMcjs.getChainName.call(void 0, targetChain);
|
|
853
|
+
const sourceChainIcon = _chunkDZ2RPLBMcjs.getChainIcon.call(void 0, asset.chainId);
|
|
854
|
+
const targetChainIcon = _chunkDZ2RPLBMcjs.getChainIcon.call(void 0, targetChain);
|
|
855
|
+
const sourceTokenIcon = _chunkDZ2RPLBMcjs.getTokenIcon.call(void 0, asset.symbol);
|
|
856
|
+
const targetTokenIcon = _chunkDZ2RPLBMcjs.getTokenIcon.call(void 0, targetSymbol);
|
|
856
857
|
const formattedSendAmount = amount && !Number.isNaN(Number(amount)) ? Number(amount).toLocaleString("en-US", {
|
|
857
858
|
minimumFractionDigits: 2,
|
|
858
859
|
maximumFractionDigits: 6
|
|
@@ -879,7 +880,7 @@ function ConfirmStep({
|
|
|
879
880
|
hasAttemptedSwitch.current = true;
|
|
880
881
|
switchChain(asset.chainId).catch((err) => {
|
|
881
882
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
882
|
-
setError(
|
|
883
|
+
setError(_chunk7NO7WVJVcjs.formatUserError.call(void 0, raw));
|
|
883
884
|
});
|
|
884
885
|
}
|
|
885
886
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -926,7 +927,7 @@ function ConfirmStep({
|
|
|
926
927
|
const result = await executeTransfer(amountUnits);
|
|
927
928
|
hash = result.txHash;
|
|
928
929
|
resolvedSourceToken = result.sourceToken;
|
|
929
|
-
} else if (
|
|
930
|
+
} else if (_chunk7NO7WVJVcjs.isNativeAsset.call(void 0, asset)) {
|
|
930
931
|
hash = await walletClient.sendTransaction({
|
|
931
932
|
account,
|
|
932
933
|
chain,
|
|
@@ -947,7 +948,7 @@ function ConfirmStep({
|
|
|
947
948
|
onConfirm(hash, asset.chainId, amountUnits.toString(), resolvedSourceToken);
|
|
948
949
|
} catch (err) {
|
|
949
950
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
950
|
-
const message =
|
|
951
|
+
const message = _chunk7NO7WVJVcjs.formatUserError.call(void 0, raw);
|
|
951
952
|
setError(message);
|
|
952
953
|
_optionalChain([onError, 'optionalCall', _28 => _28(message, "TRANSFER_ERROR")]);
|
|
953
954
|
} finally {
|
|
@@ -956,7 +957,7 @@ function ConfirmStep({
|
|
|
956
957
|
};
|
|
957
958
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
958
959
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
959
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
960
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.WalletIcon, {}), title: "Review deposit" }),
|
|
960
961
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
|
|
961
962
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
962
963
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
@@ -1008,13 +1009,13 @@ function ConfirmStep({
|
|
|
1008
1009
|
children: "$0.04"
|
|
1009
1010
|
}
|
|
1010
1011
|
),
|
|
1011
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1012
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.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, _chunk7NO7WVJVcjs.InfoIcon, {}) }) })
|
|
1012
1013
|
] })
|
|
1013
1014
|
] })
|
|
1014
1015
|
] }),
|
|
1015
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1016
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.Callout, { variant: "error", children: error }),
|
|
1016
1017
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1017
|
-
|
|
1018
|
+
_chunk7NO7WVJVcjs.Button,
|
|
1018
1019
|
{
|
|
1019
1020
|
onClick: handleConfirm,
|
|
1020
1021
|
loading: isSubmitting,
|
|
@@ -1025,7 +1026,7 @@ function ConfirmStep({
|
|
|
1025
1026
|
}
|
|
1026
1027
|
)
|
|
1027
1028
|
] }),
|
|
1028
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1029
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.PoweredBy, {})
|
|
1029
1030
|
] });
|
|
1030
1031
|
}
|
|
1031
1032
|
|
|
@@ -1048,9 +1049,9 @@ var INITIAL_POLL_INTERVAL = 3e3;
|
|
|
1048
1049
|
var MAX_POLL_INTERVAL = 3e4;
|
|
1049
1050
|
var BACKOFF_MULTIPLIER = 1.5;
|
|
1050
1051
|
function isEventForTx(event, txHash) {
|
|
1051
|
-
const eventTxHash =
|
|
1052
|
+
const eventTxHash = _chunk7NO7WVJVcjs.getEventTxHash.call(void 0, event);
|
|
1052
1053
|
if (!eventTxHash) return false;
|
|
1053
|
-
return
|
|
1054
|
+
return _chunk7NO7WVJVcjs.txRefsMatch.call(void 0, eventTxHash, txHash);
|
|
1054
1055
|
}
|
|
1055
1056
|
function truncateHash(hash) {
|
|
1056
1057
|
return `${hash.slice(0, 4)}\u2026${hash.slice(-4)}`;
|
|
@@ -1100,7 +1101,7 @@ function formatBridgeFailedMessage(event) {
|
|
|
1100
1101
|
}
|
|
1101
1102
|
return "Bridge failed";
|
|
1102
1103
|
}
|
|
1103
|
-
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1104
|
+
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.ExternalLinkIcon, { className: "rs-deposit-notification-link-icon" });
|
|
1104
1105
|
function DepositNotification({
|
|
1105
1106
|
deposit,
|
|
1106
1107
|
smartAccount,
|
|
@@ -1113,7 +1114,15 @@ function DepositNotification({
|
|
|
1113
1114
|
onFailed,
|
|
1114
1115
|
onDismiss
|
|
1115
1116
|
}) {
|
|
1116
|
-
const {
|
|
1117
|
+
const {
|
|
1118
|
+
txHash,
|
|
1119
|
+
sourceChain,
|
|
1120
|
+
amount,
|
|
1121
|
+
token,
|
|
1122
|
+
sourceDecimals,
|
|
1123
|
+
detectedAt,
|
|
1124
|
+
directTransfer
|
|
1125
|
+
} = deposit;
|
|
1117
1126
|
const [status, setStatus] = _react.useState.call(void 0,
|
|
1118
1127
|
directTransfer ? "complete" : "processing"
|
|
1119
1128
|
);
|
|
@@ -1127,16 +1136,17 @@ function DepositNotification({
|
|
|
1127
1136
|
const pollIntervalRef = _react.useRef.call(void 0, INITIAL_POLL_INTERVAL);
|
|
1128
1137
|
const pollTimeoutRef = _react.useRef.call(void 0, null);
|
|
1129
1138
|
const completedRef = _react.useRef.call(void 0, _nullishCoalesce(directTransfer, () => ( false)));
|
|
1130
|
-
const depositContextRef =
|
|
1139
|
+
const depositContextRef = _chunk7NO7WVJVcjs.useLatestRef.call(void 0, {
|
|
1131
1140
|
amount,
|
|
1132
1141
|
sourceChain,
|
|
1133
1142
|
sourceToken: token,
|
|
1143
|
+
sourceDecimals,
|
|
1134
1144
|
targetChain,
|
|
1135
1145
|
targetToken,
|
|
1136
1146
|
hasPostBridgeActions
|
|
1137
1147
|
});
|
|
1138
|
-
const onCompleteRef =
|
|
1139
|
-
const onFailedRef =
|
|
1148
|
+
const onCompleteRef = _chunk7NO7WVJVcjs.useLatestRef.call(void 0, onComplete);
|
|
1149
|
+
const onFailedRef = _chunk7NO7WVJVcjs.useLatestRef.call(void 0, onFailed);
|
|
1140
1150
|
const handleComplete = _react.useCallback.call(void 0,
|
|
1141
1151
|
(destTxHash) => {
|
|
1142
1152
|
if (completedRef.current) return;
|
|
@@ -1149,6 +1159,7 @@ function DepositNotification({
|
|
|
1149
1159
|
amount: context.amount,
|
|
1150
1160
|
sourceChain: context.sourceChain,
|
|
1151
1161
|
sourceToken: context.sourceToken,
|
|
1162
|
+
sourceDecimals: context.sourceDecimals,
|
|
1152
1163
|
targetChain: context.targetChain,
|
|
1153
1164
|
targetToken: context.targetToken
|
|
1154
1165
|
})]);
|
|
@@ -1236,11 +1247,42 @@ function DepositNotification({
|
|
|
1236
1247
|
status,
|
|
1237
1248
|
txHash
|
|
1238
1249
|
]);
|
|
1239
|
-
const sourceExplorerUrl = sourceChain === "unknown" ? void 0 :
|
|
1240
|
-
const destExplorerUrl = destinationTxHash ?
|
|
1250
|
+
const sourceExplorerUrl = sourceChain === "unknown" ? void 0 : _chunkDZ2RPLBMcjs.getExplorerTxUrl.call(void 0, sourceChain, txHash);
|
|
1251
|
+
const destExplorerUrl = destinationTxHash ? _chunkDZ2RPLBMcjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
|
|
1241
1252
|
const title = status === "complete" ? "Deposit completed" : status === "failed" ? "Deposit failed" : "Deposit received and processing\u2026";
|
|
1242
1253
|
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.";
|
|
1243
|
-
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,
|
|
1254
|
+
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, _chunk7NO7WVJVcjs.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, _chunk7NO7WVJVcjs.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,
|
|
1255
|
+
"svg",
|
|
1256
|
+
{
|
|
1257
|
+
className: "rs-deposit-notification-spinner",
|
|
1258
|
+
viewBox: "0 0 44 44",
|
|
1259
|
+
fill: "none",
|
|
1260
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1261
|
+
"aria-hidden": "true",
|
|
1262
|
+
children: [
|
|
1263
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1264
|
+
"path",
|
|
1265
|
+
{
|
|
1266
|
+
className: "rs-deposit-notification-spinner-track",
|
|
1267
|
+
d: "M21.5882 42.1765C32.9588 42.1765 42.1765 32.9588 42.1765 21.5882C42.1765 10.2177 32.9588 1 21.5882 1C10.2177 1 1 10.2177 1 21.5882C1 32.9588 10.2177 42.1765 21.5882 42.1765Z",
|
|
1268
|
+
stroke: "#D4D4D8",
|
|
1269
|
+
strokeWidth: "2",
|
|
1270
|
+
strokeLinecap: "round"
|
|
1271
|
+
}
|
|
1272
|
+
),
|
|
1273
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1274
|
+
"path",
|
|
1275
|
+
{
|
|
1276
|
+
className: "rs-deposit-notification-spinner-head",
|
|
1277
|
+
d: "M28.0422 2.03186C31.4239 3.1515 34.458 5.1279 36.8489 7.76854C39.2398 10.4092 40.906 13.624 41.6852 17.1",
|
|
1278
|
+
stroke: "#52525C",
|
|
1279
|
+
strokeWidth: "2",
|
|
1280
|
+
strokeLinecap: "round"
|
|
1281
|
+
}
|
|
1282
|
+
)
|
|
1283
|
+
]
|
|
1284
|
+
}
|
|
1285
|
+
) });
|
|
1244
1286
|
const showClose = status !== "processing";
|
|
1245
1287
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1246
1288
|
"div",
|
|
@@ -1259,7 +1301,7 @@ function DepositNotification({
|
|
|
1259
1301
|
className: "rs-deposit-notification-close",
|
|
1260
1302
|
onClick: () => onDismiss(deposit.id),
|
|
1261
1303
|
"aria-label": "Dismiss",
|
|
1262
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1304
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.CloseIcon, {})
|
|
1263
1305
|
}
|
|
1264
1306
|
)
|
|
1265
1307
|
] }),
|
|
@@ -1275,7 +1317,7 @@ function DepositNotification({
|
|
|
1275
1317
|
"aria-expanded": expanded,
|
|
1276
1318
|
children: [
|
|
1277
1319
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: expanded ? "See less details" : "See more details" }),
|
|
1278
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1320
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.ChevronDownIcon, { className: "rs-deposit-notification-toggle-chevron" })
|
|
1279
1321
|
]
|
|
1280
1322
|
}
|
|
1281
1323
|
),
|
|
@@ -1329,7 +1371,7 @@ function DepositNotification({
|
|
|
1329
1371
|
// src/components/steps/DepositAddressStep.tsx
|
|
1330
1372
|
|
|
1331
1373
|
var QRCode = _react.lazy.call(void 0,
|
|
1332
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./QRCode-
|
|
1374
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./QRCode-5DXFNKI2.cjs"))).then((m) => ({ default: m.QRCode }))
|
|
1333
1375
|
);
|
|
1334
1376
|
var POLL_INTERVAL_MS = 4e3;
|
|
1335
1377
|
function isRecord(value) {
|
|
@@ -1364,7 +1406,7 @@ function asString(value) {
|
|
|
1364
1406
|
function resolveSolanaTokenMeta(token) {
|
|
1365
1407
|
if (!token) return {};
|
|
1366
1408
|
const normalized = token.toLowerCase();
|
|
1367
|
-
const matched =
|
|
1409
|
+
const matched = _chunkDZ2RPLBMcjs.SOLANA_TOKENS.find(
|
|
1368
1410
|
(entry) => entry.mint.toLowerCase() === normalized
|
|
1369
1411
|
);
|
|
1370
1412
|
if (matched) {
|
|
@@ -1407,7 +1449,7 @@ function isSameRoute(sourceChain, sourceToken, targetChain, targetToken) {
|
|
|
1407
1449
|
return sourceChain === targetChain && sourceToken.toLowerCase() === targetToken.toLowerCase();
|
|
1408
1450
|
}
|
|
1409
1451
|
function computeTokensForChain(chainId, allowedTokenSet) {
|
|
1410
|
-
const all = chainId === "solana" ?
|
|
1452
|
+
const all = chainId === "solana" ? _chunkDZ2RPLBMcjs.SOLANA_TOKENS.map((t) => t.symbol) : _chunkDZ2RPLBMcjs.getTargetTokenSymbolsForChain.call(void 0, chainId);
|
|
1411
1453
|
return allowedTokenSet ? all.filter((s) => allowedTokenSet.has(s.toUpperCase())) : all;
|
|
1412
1454
|
}
|
|
1413
1455
|
function pickFallbackToken(tokens, current) {
|
|
@@ -1418,7 +1460,6 @@ function pickFallbackToken(tokens, current) {
|
|
|
1418
1460
|
function DepositAddressStep({
|
|
1419
1461
|
smartAccount,
|
|
1420
1462
|
solanaDepositAddress,
|
|
1421
|
-
isUpdating = false,
|
|
1422
1463
|
service,
|
|
1423
1464
|
allowedRoutes,
|
|
1424
1465
|
targetChain,
|
|
@@ -1441,7 +1482,7 @@ function DepositAddressStep({
|
|
|
1441
1482
|
[_optionalChain([allowedRoutes, 'optionalAccess', _58 => _58.sourceTokens])]
|
|
1442
1483
|
);
|
|
1443
1484
|
const evmChainIds = _react.useMemo.call(void 0, () => {
|
|
1444
|
-
const all =
|
|
1485
|
+
const all = _chunkDZ2RPLBMcjs.getSupportedChainIds.call(void 0, );
|
|
1445
1486
|
return allowedChainSet ? all.filter((id) => allowedChainSet.has(id)) : all;
|
|
1446
1487
|
}, [allowedChainSet]);
|
|
1447
1488
|
const chainOptions = _react.useMemo.call(void 0, () => {
|
|
@@ -1479,7 +1520,7 @@ function DepositAddressStep({
|
|
|
1479
1520
|
setLiquidityHelper({ kind: "idle" });
|
|
1480
1521
|
return;
|
|
1481
1522
|
}
|
|
1482
|
-
const sourceTokenAddress =
|
|
1523
|
+
const sourceTokenAddress = _chunkDZ2RPLBMcjs.getTokenAddress.call(void 0,
|
|
1483
1524
|
sourceTokenSymbol,
|
|
1484
1525
|
sourceChainId
|
|
1485
1526
|
);
|
|
@@ -1544,7 +1585,6 @@ function DepositAddressStep({
|
|
|
1544
1585
|
};
|
|
1545
1586
|
}, [chainDropdownOpen, tokenDropdownOpen]);
|
|
1546
1587
|
const handleCopy = _react.useCallback.call(void 0, async () => {
|
|
1547
|
-
if (isUpdating) return;
|
|
1548
1588
|
_optionalChain([onCopyAddress, 'optionalCall', _65 => _65()]);
|
|
1549
1589
|
try {
|
|
1550
1590
|
await navigator.clipboard.writeText(displayAddress);
|
|
@@ -1562,7 +1602,7 @@ function DepositAddressStep({
|
|
|
1562
1602
|
setCopied(true);
|
|
1563
1603
|
setTimeout(() => setCopied(false), 2e3);
|
|
1564
1604
|
}
|
|
1565
|
-
}, [displayAddress, onCopyAddress
|
|
1605
|
+
}, [displayAddress, onCopyAddress]);
|
|
1566
1606
|
const handleSelectChain = _react.useCallback.call(void 0,
|
|
1567
1607
|
(nextChain) => {
|
|
1568
1608
|
const nextTokens = computeTokensForChain(nextChain, allowedTokenSet);
|
|
@@ -1624,19 +1664,22 @@ function DepositAddressStep({
|
|
|
1624
1664
|
return;
|
|
1625
1665
|
}
|
|
1626
1666
|
const event = status.lastEvent;
|
|
1627
|
-
const eventTxHash =
|
|
1667
|
+
const eventTxHash = _chunk7NO7WVJVcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunk7NO7WVJVcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
1628
1668
|
if (baselineTxHashRef.current === void 0) {
|
|
1629
1669
|
baselineTxHashRef.current = eventTxHash;
|
|
1630
|
-
} else if (eventTxHash && (!baselineTxHashRef.current || !
|
|
1670
|
+
} else if (eventTxHash && (!baselineTxHashRef.current || !_chunk7NO7WVJVcjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
|
|
1631
1671
|
const details = getDepositEventDetails(event);
|
|
1632
1672
|
const chainId = _nullishCoalesce(details.chainId, () => ( "unknown"));
|
|
1633
1673
|
const amount = _nullishCoalesce(details.amount, () => ( "0"));
|
|
1634
1674
|
const token = details.token;
|
|
1635
1675
|
const sourceSymbol = details.sourceSymbol;
|
|
1636
|
-
const sourceDecimals = details.sourceDecimals;
|
|
1637
1676
|
baselineTxHashRef.current = eventTxHash;
|
|
1638
1677
|
isTrackingRef.current = true;
|
|
1639
1678
|
const isEvmToken = token ? /^0x[a-fA-F0-9]{40}$/.test(token) : false;
|
|
1679
|
+
const sourceDecimals = _nullishCoalesce(details.sourceDecimals, () => ( (isEvmToken ? _chunkDZ2RPLBMcjs.findTokenDecimals.call(void 0,
|
|
1680
|
+
token,
|
|
1681
|
+
typeof chainId === "number" ? chainId : void 0
|
|
1682
|
+
) : void 0)));
|
|
1640
1683
|
const directTransfer = typeof chainId === "number" && isEvmToken && isSameRoute(
|
|
1641
1684
|
chainId,
|
|
1642
1685
|
token,
|
|
@@ -1659,7 +1702,8 @@ function DepositAddressStep({
|
|
|
1659
1702
|
_optionalChain([onDepositSubmittedRef, 'access', _66 => _66.current, 'optionalCall', _67 => _67({
|
|
1660
1703
|
txHash: eventTxHash,
|
|
1661
1704
|
sourceChain: chainId,
|
|
1662
|
-
amount
|
|
1705
|
+
amount,
|
|
1706
|
+
sourceDecimals
|
|
1663
1707
|
})]);
|
|
1664
1708
|
}
|
|
1665
1709
|
setPollingError(null);
|
|
@@ -1697,10 +1741,10 @@ function DepositAddressStep({
|
|
|
1697
1741
|
const handleNotificationDismiss = _react.useCallback.call(void 0, (id) => {
|
|
1698
1742
|
setNotifications((prev) => prev.filter((n) => n.id !== id));
|
|
1699
1743
|
}, []);
|
|
1700
|
-
const qrIconSrc =
|
|
1744
|
+
const qrIconSrc = _chunkDZ2RPLBMcjs.getChainIcon.call(void 0, sourceChainId);
|
|
1701
1745
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-step--with-notifications", children: [
|
|
1702
1746
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
1703
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1747
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
1704
1748
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", children: [
|
|
1705
1749
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", ref: chainDropdownRef, children: [
|
|
1706
1750
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
@@ -1715,16 +1759,16 @@ function DepositAddressStep({
|
|
|
1715
1759
|
setTokenDropdownOpen(false);
|
|
1716
1760
|
},
|
|
1717
1761
|
children: [
|
|
1718
|
-
|
|
1762
|
+
_chunkDZ2RPLBMcjs.getChainIcon.call(void 0, sourceChainId) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1719
1763
|
"img",
|
|
1720
1764
|
{
|
|
1721
|
-
src:
|
|
1765
|
+
src: _chunkDZ2RPLBMcjs.getChainIcon.call(void 0, sourceChainId),
|
|
1722
1766
|
alt: "",
|
|
1723
1767
|
className: "rs-deposit-address-dropdown-icon"
|
|
1724
1768
|
}
|
|
1725
1769
|
),
|
|
1726
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children:
|
|
1727
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1770
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunkDZ2RPLBMcjs.getChainName.call(void 0, sourceChainId) }),
|
|
1771
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
1728
1772
|
]
|
|
1729
1773
|
}
|
|
1730
1774
|
),
|
|
@@ -1735,15 +1779,15 @@ function DepositAddressStep({
|
|
|
1735
1779
|
className: `rs-deposit-address-dropdown-item ${chainId === sourceChainId ? "rs-deposit-address-dropdown-item--active" : ""}`,
|
|
1736
1780
|
onClick: () => handleSelectChain(chainId),
|
|
1737
1781
|
children: [
|
|
1738
|
-
|
|
1782
|
+
_chunkDZ2RPLBMcjs.getChainIcon.call(void 0, chainId) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1739
1783
|
"img",
|
|
1740
1784
|
{
|
|
1741
|
-
src:
|
|
1785
|
+
src: _chunkDZ2RPLBMcjs.getChainIcon.call(void 0, chainId),
|
|
1742
1786
|
alt: "",
|
|
1743
1787
|
className: "rs-deposit-address-dropdown-icon"
|
|
1744
1788
|
}
|
|
1745
1789
|
),
|
|
1746
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children:
|
|
1790
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunkDZ2RPLBMcjs.getChainName.call(void 0, chainId) })
|
|
1747
1791
|
]
|
|
1748
1792
|
},
|
|
1749
1793
|
String(chainId)
|
|
@@ -1755,8 +1799,8 @@ function DepositAddressStep({
|
|
|
1755
1799
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
1756
1800
|
"Min.$",
|
|
1757
1801
|
(_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _74 => _74.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
1758
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1759
|
-
|
|
1802
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1803
|
+
_chunk7NO7WVJVcjs.InfoIcon,
|
|
1760
1804
|
{
|
|
1761
1805
|
className: "rs-deposit-address-min-icon",
|
|
1762
1806
|
"aria-hidden": "true"
|
|
@@ -1775,16 +1819,16 @@ function DepositAddressStep({
|
|
|
1775
1819
|
setChainDropdownOpen(false);
|
|
1776
1820
|
},
|
|
1777
1821
|
children: [
|
|
1778
|
-
|
|
1822
|
+
_chunkDZ2RPLBMcjs.getTokenIcon.call(void 0, sourceTokenSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1779
1823
|
"img",
|
|
1780
1824
|
{
|
|
1781
|
-
src:
|
|
1825
|
+
src: _chunkDZ2RPLBMcjs.getTokenIcon.call(void 0, sourceTokenSymbol),
|
|
1782
1826
|
alt: "",
|
|
1783
1827
|
className: "rs-deposit-address-dropdown-icon"
|
|
1784
1828
|
}
|
|
1785
1829
|
),
|
|
1786
1830
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceTokenSymbol }),
|
|
1787
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1831
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
1788
1832
|
]
|
|
1789
1833
|
}
|
|
1790
1834
|
),
|
|
@@ -1798,10 +1842,10 @@ function DepositAddressStep({
|
|
|
1798
1842
|
setTokenDropdownOpen(false);
|
|
1799
1843
|
},
|
|
1800
1844
|
children: [
|
|
1801
|
-
|
|
1845
|
+
_chunkDZ2RPLBMcjs.getTokenIcon.call(void 0, symbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1802
1846
|
"img",
|
|
1803
1847
|
{
|
|
1804
|
-
src:
|
|
1848
|
+
src: _chunkDZ2RPLBMcjs.getTokenIcon.call(void 0, symbol),
|
|
1805
1849
|
alt: "",
|
|
1806
1850
|
className: "rs-deposit-address-dropdown-icon"
|
|
1807
1851
|
}
|
|
@@ -1818,45 +1862,24 @@ function DepositAddressStep({
|
|
|
1818
1862
|
{
|
|
1819
1863
|
style: { display: "flex", flexDirection: "column", gap: 4, width: "100%" },
|
|
1820
1864
|
children: [
|
|
1865
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-well", children: [
|
|
1866
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-qr", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1867
|
+
_react.Suspense,
|
|
1868
|
+
{
|
|
1869
|
+
fallback: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-skeleton rs-skeleton-qr", "aria-hidden": "true" }),
|
|
1870
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, QRCode, { value: displayAddress, size: 190, iconSrc: qrIconSrc })
|
|
1871
|
+
}
|
|
1872
|
+
) }),
|
|
1873
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-value", children: displayAddress })
|
|
1874
|
+
] }),
|
|
1821
1875
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1822
|
-
"div",
|
|
1823
|
-
{
|
|
1824
|
-
className: `rs-deposit-address-well ${isUpdating ? "rs-deposit-address-well--updating" : ""}`,
|
|
1825
|
-
children: [
|
|
1826
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-qr", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1827
|
-
_react.Suspense,
|
|
1828
|
-
{
|
|
1829
|
-
fallback: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1830
|
-
"div",
|
|
1831
|
-
{
|
|
1832
|
-
style: {
|
|
1833
|
-
width: 200,
|
|
1834
|
-
height: 200,
|
|
1835
|
-
display: "flex",
|
|
1836
|
-
alignItems: "center",
|
|
1837
|
-
justifyContent: "center"
|
|
1838
|
-
},
|
|
1839
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.Spinner, {})
|
|
1840
|
-
}
|
|
1841
|
-
),
|
|
1842
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, QRCode, { value: displayAddress, size: 200, iconSrc: qrIconSrc })
|
|
1843
|
-
}
|
|
1844
|
-
) }),
|
|
1845
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-value", children: displayAddress })
|
|
1846
|
-
]
|
|
1847
|
-
}
|
|
1848
|
-
),
|
|
1849
|
-
isUpdating ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "output", { className: "rs-deposit-address-updating", children: [
|
|
1850
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDZNXG5JKcjs.Spinner, { className: "rs-spinner--sm" }),
|
|
1851
|
-
"Updating deposit details\u2026"
|
|
1852
|
-
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1853
1876
|
"button",
|
|
1854
1877
|
{
|
|
1855
1878
|
type: "button",
|
|
1856
1879
|
className: "rs-deposit-address-copy",
|
|
1857
1880
|
onClick: handleCopy,
|
|
1858
1881
|
children: [
|
|
1859
|
-
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1882
|
+
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.CopyIcon, {}),
|
|
1860
1883
|
copied ? "Copied!" : "Copy address"
|
|
1861
1884
|
]
|
|
1862
1885
|
}
|
|
@@ -1881,16 +1904,16 @@ function DepositAddressStep({
|
|
|
1881
1904
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
|
|
1882
1905
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
|
|
1883
1906
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1884
|
-
|
|
1907
|
+
_chunk7NO7WVJVcjs.Tooltip,
|
|
1885
1908
|
{
|
|
1886
1909
|
className: "rs-price-impact-info",
|
|
1887
1910
|
content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
|
|
1888
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1911
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.InfoIcon, { "aria-hidden": "true" })
|
|
1889
1912
|
}
|
|
1890
1913
|
)
|
|
1891
1914
|
] }),
|
|
1892
1915
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1893
|
-
|
|
1916
|
+
_chunk7NO7WVJVcjs.ChevronDownIcon,
|
|
1894
1917
|
{
|
|
1895
1918
|
className: "rs-price-impact-chevron",
|
|
1896
1919
|
"aria-hidden": "true"
|
|
@@ -1901,29 +1924,29 @@ function DepositAddressStep({
|
|
|
1901
1924
|
),
|
|
1902
1925
|
/* @__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: [
|
|
1903
1926
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
1904
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1927
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.PercentIcon, {}) }),
|
|
1905
1928
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
1906
1929
|
"Max slippage: ",
|
|
1907
1930
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.2%" })
|
|
1908
1931
|
] }),
|
|
1909
1932
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1910
|
-
|
|
1933
|
+
_chunk7NO7WVJVcjs.Tooltip,
|
|
1911
1934
|
{
|
|
1912
1935
|
className: "rs-price-impact-info",
|
|
1913
1936
|
content: "Slippage accounts for price changes during execution. Slippage is adjusted per pair to ensure reliable execution.",
|
|
1914
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1937
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.InfoIcon, { "aria-hidden": "true" })
|
|
1915
1938
|
}
|
|
1916
1939
|
)
|
|
1917
1940
|
] }),
|
|
1918
1941
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
1919
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1942
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.ClockIcon, {}) }),
|
|
1920
1943
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
1921
1944
|
"Processing time: ",
|
|
1922
1945
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "< 1 min" })
|
|
1923
1946
|
] })
|
|
1924
1947
|
] }),
|
|
1925
1948
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
1926
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1949
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.PlusCircleIcon, {}) }),
|
|
1927
1950
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
1928
1951
|
"Max deposit:",
|
|
1929
1952
|
" ",
|
|
@@ -1955,7 +1978,7 @@ function DepositAddressStep({
|
|
|
1955
1978
|
},
|
|
1956
1979
|
deposit.id
|
|
1957
1980
|
)) }),
|
|
1958
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1981
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.PoweredBy, {})
|
|
1959
1982
|
] });
|
|
1960
1983
|
}
|
|
1961
1984
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -1992,7 +2015,7 @@ function SwappedOrderTracker({
|
|
|
1992
2015
|
];
|
|
1993
2016
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-swapped-tracker", children: [
|
|
1994
2017
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
1995
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2018
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.HandCoinsIcon, {}), title }),
|
|
1996
2019
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ol", { className: "rs-swapped-tracker-steps", children: labels.map((label, idx) => {
|
|
1997
2020
|
const status = stepStates[idx];
|
|
1998
2021
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
@@ -2006,7 +2029,7 @@ function SwappedOrderTracker({
|
|
|
2006
2029
|
{
|
|
2007
2030
|
className: "rs-swapped-tracker-step-marker",
|
|
2008
2031
|
"aria-hidden": "true",
|
|
2009
|
-
children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2032
|
+
children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.CheckIcon, {}) : status === "failed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.CloseIcon, {}) : status === "active" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.Spinner, {}) : null
|
|
2010
2033
|
}
|
|
2011
2034
|
)
|
|
2012
2035
|
]
|
|
@@ -2033,7 +2056,7 @@ function SwappedOrderTracker({
|
|
|
2033
2056
|
}
|
|
2034
2057
|
)
|
|
2035
2058
|
] }),
|
|
2036
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2059
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.PoweredBy, {})
|
|
2037
2060
|
] });
|
|
2038
2061
|
}
|
|
2039
2062
|
function formatTrackerAmount(amount) {
|
|
@@ -2197,10 +2220,10 @@ function SwappedIframeStep({
|
|
|
2197
2220
|
const status = await service.fetchLatestStatus(smartAccount);
|
|
2198
2221
|
if (cancelled) return;
|
|
2199
2222
|
const event = status.lastEvent;
|
|
2200
|
-
const eventTxHash =
|
|
2223
|
+
const eventTxHash = _chunk7NO7WVJVcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunk7NO7WVJVcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
2201
2224
|
if (baselineDepositTxHashRef.current === void 0) {
|
|
2202
2225
|
baselineDepositTxHashRef.current = eventTxHash;
|
|
2203
|
-
} else if (eventTxHash && (!baselineDepositTxHashRef.current || !
|
|
2226
|
+
} else if (eventTxHash && (!baselineDepositTxHashRef.current || !_chunk7NO7WVJVcjs.txRefsMatch.call(void 0, eventTxHash, baselineDepositTxHashRef.current))) {
|
|
2204
2227
|
currentDepositTxHashRef.current = eventTxHash;
|
|
2205
2228
|
setLatestEvent(_nullishCoalesce(event, () => ( null)));
|
|
2206
2229
|
}
|
|
@@ -2261,10 +2284,10 @@ function SwappedIframeStep({
|
|
|
2261
2284
|
[orderState, latestEvent]
|
|
2262
2285
|
);
|
|
2263
2286
|
const terminalState = _react.useMemo.call(void 0, () => {
|
|
2264
|
-
if (
|
|
2287
|
+
if (_chunk7NO7WVJVcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
|
|
2265
2288
|
return {
|
|
2266
2289
|
kind: "failed",
|
|
2267
|
-
message:
|
|
2290
|
+
message: _chunk7NO7WVJVcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
|
|
2268
2291
|
};
|
|
2269
2292
|
}
|
|
2270
2293
|
if (_optionalChain([orderState, 'optionalAccess', _89 => _89.status]) === "order_cancelled") {
|
|
@@ -2286,19 +2309,19 @@ function SwappedIframeStep({
|
|
|
2286
2309
|
orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _91 => _91.orderCrypto]), () => ( null)),
|
|
2287
2310
|
// Base-unit source amount from the deposit row/event, consistent with the
|
|
2288
2311
|
// wallet/QR path. ProcessingStep + onLifecycle expect base units.
|
|
2289
|
-
amount: _nullishCoalesce(
|
|
2312
|
+
amount: _nullishCoalesce(_chunk7NO7WVJVcjs.getEventSourceDetails.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0))).amount, () => ( null))
|
|
2290
2313
|
});
|
|
2291
2314
|
}, [latestEvent, orderState]);
|
|
2292
2315
|
_react.useEffect.call(void 0, () => {
|
|
2293
2316
|
if (failedFiredRef.current || completeFiredRef.current) return;
|
|
2294
|
-
if (!
|
|
2317
|
+
if (!_chunk7NO7WVJVcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) return;
|
|
2295
2318
|
const txHash = currentDepositTxHashRef.current;
|
|
2296
2319
|
if (!txHash) return;
|
|
2297
2320
|
failedFiredRef.current = true;
|
|
2298
2321
|
setPhase("tracker");
|
|
2299
2322
|
_optionalChain([onSwappedFailedRef, 'access', _92 => _92.current, 'optionalCall', _93 => _93(
|
|
2300
2323
|
txHash,
|
|
2301
|
-
|
|
2324
|
+
_chunk7NO7WVJVcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
|
|
2302
2325
|
)]);
|
|
2303
2326
|
}, [latestEvent]);
|
|
2304
2327
|
if (phase === "tracker") {
|
|
@@ -2317,9 +2340,9 @@ function SwappedIframeStep({
|
|
|
2317
2340
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-fiat-onramp", "data-variant": variant, children: [
|
|
2318
2341
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2319
2342
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2320
|
-
|
|
2343
|
+
_chunk7NO7WVJVcjs.BodyHeader,
|
|
2321
2344
|
{
|
|
2322
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2345
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.HandCoinsIcon, {}),
|
|
2323
2346
|
title: "Deposit",
|
|
2324
2347
|
subtitle: "Add money to your balance"
|
|
2325
2348
|
}
|
|
@@ -2337,7 +2360,7 @@ function SwappedIframeStep({
|
|
|
2337
2360
|
}
|
|
2338
2361
|
)
|
|
2339
2362
|
] }),
|
|
2340
|
-
!loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2363
|
+
!loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.Spinner, {}) }),
|
|
2341
2364
|
widgetUrl && !loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2342
2365
|
"iframe",
|
|
2343
2366
|
{
|
|
@@ -2352,11 +2375,11 @@ function SwappedIframeStep({
|
|
|
2352
2375
|
)
|
|
2353
2376
|
] })
|
|
2354
2377
|
] }),
|
|
2355
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2378
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.PoweredBy, {})
|
|
2356
2379
|
] });
|
|
2357
2380
|
}
|
|
2358
2381
|
function deriveStepStates(swappedStatus, latestEvent) {
|
|
2359
|
-
if (
|
|
2382
|
+
if (_chunk7NO7WVJVcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
|
|
2360
2383
|
return ["complete", "complete", "failed", "pending"];
|
|
2361
2384
|
}
|
|
2362
2385
|
if (swappedStatus === "order_cancelled") {
|
|
@@ -2526,7 +2549,7 @@ ExchangeConnectStep.displayName = "ExchangeConnectStep";
|
|
|
2526
2549
|
function ExchangeLogo({ exchange }) {
|
|
2527
2550
|
const [failed, setFailed] = _react.useState.call(void 0, false);
|
|
2528
2551
|
if (!exchange.logoUrl || failed) {
|
|
2529
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2552
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.BankIcon, {});
|
|
2530
2553
|
}
|
|
2531
2554
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2532
2555
|
"img",
|
|
@@ -2572,14 +2595,14 @@ function ExchangeSelectStep({
|
|
|
2572
2595
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-exchange-select", children: [
|
|
2573
2596
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2574
2597
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2575
|
-
|
|
2598
|
+
_chunk7NO7WVJVcjs.BodyHeader,
|
|
2576
2599
|
{
|
|
2577
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2600
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.BankIcon, {}),
|
|
2578
2601
|
title: "Fund from Exchange",
|
|
2579
2602
|
subtitle: "Choose your exchange"
|
|
2580
2603
|
}
|
|
2581
2604
|
),
|
|
2582
|
-
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2605
|
+
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.Spinner, {}) }),
|
|
2583
2606
|
!loading && error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: [
|
|
2584
2607
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state-title", children: "Couldn\u2019t load exchanges" }),
|
|
2585
2608
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2619,7 +2642,7 @@ function ExchangeSelectStep({
|
|
|
2619
2642
|
exchange.connection
|
|
2620
2643
|
)) })
|
|
2621
2644
|
] }),
|
|
2622
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2645
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.PoweredBy, {})
|
|
2623
2646
|
] });
|
|
2624
2647
|
}
|
|
2625
2648
|
ExchangeSelectStep.displayName = "ExchangeSelectStep";
|
|
@@ -2634,22 +2657,22 @@ function DepositAddressSkeleton({
|
|
|
2634
2657
|
const allowedChainSet = _optionalChain([allowedRoutes, 'optionalAccess', _99 => _99.sourceChains]) ? new Set(allowedRoutes.sourceChains) : null;
|
|
2635
2658
|
const allowedTokenSet = _optionalChain([allowedRoutes, 'optionalAccess', _100 => _100.sourceTokens]) ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null;
|
|
2636
2659
|
const evmChainIds = (() => {
|
|
2637
|
-
const all =
|
|
2660
|
+
const all = _chunkDZ2RPLBMcjs.getSupportedChainIds.call(void 0, );
|
|
2638
2661
|
return allowedChainSet ? all.filter((id) => allowedChainSet.has(id)) : all;
|
|
2639
2662
|
})();
|
|
2640
2663
|
const defaultChainId = evmChainIds.includes(BASE_CHAIN_ID) ? BASE_CHAIN_ID : evmChainIds[0];
|
|
2641
2664
|
const tokensForChain = (() => {
|
|
2642
|
-
const all =
|
|
2665
|
+
const all = _chunkDZ2RPLBMcjs.getTargetTokenSymbolsForChain.call(void 0, defaultChainId);
|
|
2643
2666
|
return allowedTokenSet ? all.filter((s) => allowedTokenSet.has(s.toUpperCase())) : all;
|
|
2644
2667
|
})();
|
|
2645
2668
|
const defaultToken = tokensForChain.includes("USDC") ? "USDC" : _nullishCoalesce(tokensForChain[0], () => ( "USDC"));
|
|
2646
|
-
const chainName =
|
|
2647
|
-
const chainIcon =
|
|
2648
|
-
const tokenIcon =
|
|
2669
|
+
const chainName = _chunkDZ2RPLBMcjs.getChainName.call(void 0, defaultChainId);
|
|
2670
|
+
const chainIcon = _chunkDZ2RPLBMcjs.getChainIcon.call(void 0, defaultChainId);
|
|
2671
|
+
const tokenIcon = _chunkDZ2RPLBMcjs.getTokenIcon.call(void 0, defaultToken);
|
|
2649
2672
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", "aria-busy": "true", children: [
|
|
2650
2673
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: "Preparing deposit details\u2026" }),
|
|
2651
2674
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
2652
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2675
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
2653
2676
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", "aria-hidden": "true", children: [
|
|
2654
2677
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
2655
2678
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
@@ -2663,7 +2686,7 @@ function DepositAddressSkeleton({
|
|
|
2663
2686
|
}
|
|
2664
2687
|
),
|
|
2665
2688
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainName }),
|
|
2666
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2689
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2667
2690
|
] })
|
|
2668
2691
|
] }),
|
|
2669
2692
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
@@ -2672,8 +2695,8 @@ function DepositAddressSkeleton({
|
|
|
2672
2695
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
2673
2696
|
"Min.$",
|
|
2674
2697
|
(_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _101 => _101.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
2675
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2676
|
-
|
|
2698
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2699
|
+
_chunk7NO7WVJVcjs.InfoIcon,
|
|
2677
2700
|
{
|
|
2678
2701
|
className: "rs-deposit-address-min-icon",
|
|
2679
2702
|
"aria-hidden": "true"
|
|
@@ -2691,7 +2714,7 @@ function DepositAddressSkeleton({
|
|
|
2691
2714
|
}
|
|
2692
2715
|
),
|
|
2693
2716
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: defaultToken }),
|
|
2694
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2717
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2695
2718
|
] })
|
|
2696
2719
|
] })
|
|
2697
2720
|
] }),
|
|
@@ -2712,7 +2735,7 @@ function DepositAddressSkeleton({
|
|
|
2712
2735
|
disabled: true,
|
|
2713
2736
|
"aria-hidden": "true",
|
|
2714
2737
|
children: [
|
|
2715
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2738
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.CopyIcon, {}),
|
|
2716
2739
|
"Copy address"
|
|
2717
2740
|
]
|
|
2718
2741
|
}
|
|
@@ -2725,16 +2748,16 @@ function DepositAddressSkeleton({
|
|
|
2725
2748
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
|
|
2726
2749
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
|
|
2727
2750
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2728
|
-
|
|
2751
|
+
_chunk7NO7WVJVcjs.Tooltip,
|
|
2729
2752
|
{
|
|
2730
2753
|
className: "rs-price-impact-info",
|
|
2731
2754
|
content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
|
|
2732
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2755
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.InfoIcon, { "aria-hidden": "true" })
|
|
2733
2756
|
}
|
|
2734
2757
|
)
|
|
2735
2758
|
] }),
|
|
2736
2759
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2737
|
-
|
|
2760
|
+
_chunk7NO7WVJVcjs.ChevronDownIcon,
|
|
2738
2761
|
{
|
|
2739
2762
|
className: "rs-price-impact-chevron",
|
|
2740
2763
|
"aria-hidden": "true"
|
|
@@ -2742,7 +2765,7 @@ function DepositAddressSkeleton({
|
|
|
2742
2765
|
)
|
|
2743
2766
|
] }) })
|
|
2744
2767
|
] }),
|
|
2745
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2768
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.PoweredBy, {})
|
|
2746
2769
|
] });
|
|
2747
2770
|
}
|
|
2748
2771
|
DepositAddressSkeleton.displayName = "DepositAddressSkeleton";
|
|
@@ -2774,14 +2797,14 @@ function SolanaTokenSelectStep({
|
|
|
2774
2797
|
setError(null);
|
|
2775
2798
|
const portfolioBySymbol = {};
|
|
2776
2799
|
try {
|
|
2777
|
-
|
|
2800
|
+
_chunk7NO7WVJVcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
|
|
2778
2801
|
solanaAddress
|
|
2779
2802
|
});
|
|
2780
2803
|
const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
|
|
2781
2804
|
if (!active) return;
|
|
2782
2805
|
for (const t of portfolio.tokens) {
|
|
2783
2806
|
const symbol = t.symbol.toUpperCase();
|
|
2784
|
-
if (!
|
|
2807
|
+
if (!_chunkDZ2RPLBMcjs.SOLANA_TOKENS.some((st) => st.symbol === symbol)) continue;
|
|
2785
2808
|
let parsed = 0n;
|
|
2786
2809
|
try {
|
|
2787
2810
|
parsed = BigInt(t.balance || "0");
|
|
@@ -2797,12 +2820,12 @@ function SolanaTokenSelectStep({
|
|
|
2797
2820
|
};
|
|
2798
2821
|
}
|
|
2799
2822
|
}
|
|
2800
|
-
|
|
2823
|
+
_chunk7NO7WVJVcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
|
|
2801
2824
|
symbols: Object.keys(portfolioBySymbol)
|
|
2802
2825
|
});
|
|
2803
2826
|
} catch (err) {
|
|
2804
2827
|
if (!active) return;
|
|
2805
|
-
|
|
2828
|
+
_chunk7NO7WVJVcjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
|
|
2806
2829
|
solanaAddress
|
|
2807
2830
|
});
|
|
2808
2831
|
setError(
|
|
@@ -2813,7 +2836,7 @@ function SolanaTokenSelectStep({
|
|
|
2813
2836
|
return;
|
|
2814
2837
|
}
|
|
2815
2838
|
const results = [];
|
|
2816
|
-
for (const token of
|
|
2839
|
+
for (const token of _chunkDZ2RPLBMcjs.SOLANA_TOKENS) {
|
|
2817
2840
|
const fromPortfolio = portfolioBySymbol[token.symbol];
|
|
2818
2841
|
if (fromPortfolio && fromPortfolio.balance > 0n) {
|
|
2819
2842
|
results.push({
|
|
@@ -2849,30 +2872,30 @@ function SolanaTokenSelectStep({
|
|
|
2849
2872
|
const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
|
|
2850
2873
|
const numeric = Number(raw);
|
|
2851
2874
|
if (!Number.isFinite(numeric)) return raw;
|
|
2852
|
-
return
|
|
2875
|
+
return _chunk7NO7WVJVcjs.tokenFormatter.format(numeric);
|
|
2853
2876
|
} catch (e19) {
|
|
2854
2877
|
return "--";
|
|
2855
2878
|
}
|
|
2856
2879
|
};
|
|
2857
|
-
const chainIcon =
|
|
2858
|
-
const chainName =
|
|
2880
|
+
const chainIcon = _chunkDZ2RPLBMcjs.getChainIcon.call(void 0, "solana");
|
|
2881
|
+
const chainName = _chunkDZ2RPLBMcjs.getChainName.call(void 0, "solana");
|
|
2859
2882
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
2860
2883
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
2861
2884
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2862
|
-
|
|
2885
|
+
_chunk7NO7WVJVcjs.BodyHeader,
|
|
2863
2886
|
{
|
|
2864
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2887
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.WalletIcon, {}),
|
|
2865
2888
|
title: "Your assets",
|
|
2866
2889
|
subtitle: "Select source assets to transfer"
|
|
2867
2890
|
}
|
|
2868
2891
|
),
|
|
2869
2892
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
2870
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2893
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
2871
2894
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
2872
2895
|
] }),
|
|
2873
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2896
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.Callout, { variant: "error", children: error }),
|
|
2874
2897
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
2875
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2898
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
2876
2899
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
2877
2900
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
2878
2901
|
solanaAddress.slice(0, 6),
|
|
@@ -2892,7 +2915,7 @@ function SolanaTokenSelectStep({
|
|
|
2892
2915
|
!loading && !error && rows.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: rows.map((entry) => {
|
|
2893
2916
|
const isSelected = selectedSymbol === entry.token.symbol;
|
|
2894
2917
|
const tokenAmount = formatBalance(entry);
|
|
2895
|
-
const tokenIcon =
|
|
2918
|
+
const tokenIcon = _chunkDZ2RPLBMcjs.getTokenIcon.call(void 0, entry.token.symbol);
|
|
2896
2919
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2897
2920
|
"button",
|
|
2898
2921
|
{
|
|
@@ -2921,14 +2944,14 @@ function SolanaTokenSelectStep({
|
|
|
2921
2944
|
] })
|
|
2922
2945
|
] })
|
|
2923
2946
|
] }),
|
|
2924
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ?
|
|
2947
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunk7NO7WVJVcjs.currencyFormatter.format(entry.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${entry.token.symbol}` : "--" })
|
|
2925
2948
|
]
|
|
2926
2949
|
},
|
|
2927
2950
|
entry.token.symbol
|
|
2928
2951
|
);
|
|
2929
2952
|
}) }),
|
|
2930
2953
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2931
|
-
|
|
2954
|
+
_chunk7NO7WVJVcjs.Button,
|
|
2932
2955
|
{
|
|
2933
2956
|
onClick: () => selectedEntry && onContinue(
|
|
2934
2957
|
selectedEntry.token,
|
|
@@ -2941,7 +2964,7 @@ function SolanaTokenSelectStep({
|
|
|
2941
2964
|
}
|
|
2942
2965
|
)
|
|
2943
2966
|
] }),
|
|
2944
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2967
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.PoweredBy, {})
|
|
2945
2968
|
] });
|
|
2946
2969
|
}
|
|
2947
2970
|
|
|
@@ -2972,7 +2995,7 @@ function SolanaAmountStep({
|
|
|
2972
2995
|
const [amount, setAmount] = _react.useState.call(void 0, "");
|
|
2973
2996
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
2974
2997
|
const hasAppliedDefaultRef = _react.useRef.call(void 0, false);
|
|
2975
|
-
const isSourceStablecoin =
|
|
2998
|
+
const isSourceStablecoin = _chunkDZ2RPLBMcjs.isStablecoinSymbol.call(void 0, token.symbol);
|
|
2976
2999
|
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess', _103 => _103.trim, 'call', _104 => _104(), 'access', _105 => _105.toLowerCase, 'call', _106 => _106()]) === "max";
|
|
2977
3000
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
2978
3001
|
if (isSourceStablecoin) return 1;
|
|
@@ -2993,7 +3016,7 @@ function SolanaAmountStep({
|
|
|
2993
3016
|
const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
|
|
2994
3017
|
const numeric = Number(raw);
|
|
2995
3018
|
if (!Number.isFinite(numeric)) return raw;
|
|
2996
|
-
return
|
|
3019
|
+
return _chunk7NO7WVJVcjs.tokenFormatter.format(numeric);
|
|
2997
3020
|
} catch (e21) {
|
|
2998
3021
|
return "\u2026";
|
|
2999
3022
|
}
|
|
@@ -3010,7 +3033,7 @@ function SolanaAmountStep({
|
|
|
3010
3033
|
}
|
|
3011
3034
|
}, [balance, token.decimals, tokenPriceUsd, balanceUsd]);
|
|
3012
3035
|
const spendableBalance = _react.useMemo.call(void 0, () => {
|
|
3013
|
-
if (!
|
|
3036
|
+
if (!_chunkDZ2RPLBMcjs.isNativeSol.call(void 0, token)) return balance;
|
|
3014
3037
|
return balance > SOL_FEE_RESERVE_LAMPORTS ? balance - SOL_FEE_RESERVE_LAMPORTS : 0n;
|
|
3015
3038
|
}, [balance, token]);
|
|
3016
3039
|
const spendableBalanceUsd = _react.useMemo.call(void 0, () => {
|
|
@@ -3086,7 +3109,7 @@ function SolanaAmountStep({
|
|
|
3086
3109
|
const handlePresetClick = (percentage) => {
|
|
3087
3110
|
const formatted = computePresetAmount(percentage);
|
|
3088
3111
|
if (!formatted) return;
|
|
3089
|
-
|
|
3112
|
+
_chunk7NO7WVJVcjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
|
|
3090
3113
|
percentage,
|
|
3091
3114
|
symbol: token.symbol,
|
|
3092
3115
|
formatted
|
|
@@ -3121,7 +3144,7 @@ function SolanaAmountStep({
|
|
|
3121
3144
|
try {
|
|
3122
3145
|
amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
|
|
3123
3146
|
} catch (e26) {
|
|
3124
|
-
|
|
3147
|
+
_chunk7NO7WVJVcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
3125
3148
|
amount,
|
|
3126
3149
|
sourceAmount: sourceAmountStr,
|
|
3127
3150
|
reason: "parse-units-failed"
|
|
@@ -3130,13 +3153,13 @@ function SolanaAmountStep({
|
|
|
3130
3153
|
return;
|
|
3131
3154
|
}
|
|
3132
3155
|
if (amountInUnits > spendableBalance) {
|
|
3133
|
-
const isReserveIssue =
|
|
3156
|
+
const isReserveIssue = _chunkDZ2RPLBMcjs.isNativeSol.call(void 0, token) && amountInUnits <= balance;
|
|
3134
3157
|
setError(
|
|
3135
3158
|
isReserveIssue ? "Use a bit less than your full SOL balance" : "Insufficient balance"
|
|
3136
3159
|
);
|
|
3137
3160
|
return;
|
|
3138
3161
|
}
|
|
3139
|
-
|
|
3162
|
+
_chunk7NO7WVJVcjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
|
|
3140
3163
|
symbol: token.symbol,
|
|
3141
3164
|
inputAmountUsd: amount,
|
|
3142
3165
|
sourceAmount: sourceAmountStr,
|
|
@@ -3147,10 +3170,10 @@ function SolanaAmountStep({
|
|
|
3147
3170
|
};
|
|
3148
3171
|
const continueLabel = exceedsBalance ? "Insufficient balance" : isAboveMax ? "Continue with max allowed deposit" : isBelowMin ? "Continue with minimum deposit" : "Continue";
|
|
3149
3172
|
const continueDisabled = exceedsBalance || numericAmount === 0 && !isBelowMin;
|
|
3150
|
-
const sourceTokenIcon =
|
|
3173
|
+
const sourceTokenIcon = _chunkDZ2RPLBMcjs.getTokenIcon.call(void 0, token.symbol);
|
|
3151
3174
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
3152
3175
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3153
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3176
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.WalletIcon, {}), title: "Wallet deposit" }),
|
|
3154
3177
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
3155
3178
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
3156
3179
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3170,13 +3193,13 @@ function SolanaAmountStep({
|
|
|
3170
3193
|
" available",
|
|
3171
3194
|
computedBalanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
3172
3195
|
" (~",
|
|
3173
|
-
|
|
3196
|
+
_chunk7NO7WVJVcjs.currencyFormatter.format(computedBalanceUsd),
|
|
3174
3197
|
")"
|
|
3175
3198
|
] })
|
|
3176
3199
|
] }),
|
|
3177
3200
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
3178
3201
|
"Min. deposit ",
|
|
3179
|
-
|
|
3202
|
+
_chunk7NO7WVJVcjs.currencyFormatter.format(minDepositUsd)
|
|
3180
3203
|
] })
|
|
3181
3204
|
] })
|
|
3182
3205
|
] }),
|
|
@@ -3215,12 +3238,12 @@ function SolanaAmountStep({
|
|
|
3215
3238
|
] }),
|
|
3216
3239
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
3217
3240
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
3218
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
3241
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunk7NO7WVJVcjs.currencyFormatter.format(balanceAfterUsd) })
|
|
3219
3242
|
] })
|
|
3220
3243
|
] }),
|
|
3221
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3244
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.Callout, { variant: "error", children: error }),
|
|
3222
3245
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3223
|
-
|
|
3246
|
+
_chunk7NO7WVJVcjs.Button,
|
|
3224
3247
|
{
|
|
3225
3248
|
onClick: handleContinue,
|
|
3226
3249
|
fullWidth: true,
|
|
@@ -3229,7 +3252,7 @@ function SolanaAmountStep({
|
|
|
3229
3252
|
}
|
|
3230
3253
|
)
|
|
3231
3254
|
] }),
|
|
3232
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3255
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.PoweredBy, {})
|
|
3233
3256
|
] });
|
|
3234
3257
|
}
|
|
3235
3258
|
|
|
@@ -3365,14 +3388,14 @@ function SolanaConfirmStep({
|
|
|
3365
3388
|
}) {
|
|
3366
3389
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
3367
3390
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
3368
|
-
const targetSymbol =
|
|
3391
|
+
const targetSymbol = _chunkDZ2RPLBMcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3369
3392
|
const isSameToken = token.symbol.toUpperCase() === targetSymbol.toUpperCase();
|
|
3370
|
-
const sourceChainName =
|
|
3371
|
-
const targetChainName =
|
|
3372
|
-
const sourceChainIcon =
|
|
3373
|
-
const targetChainIcon =
|
|
3374
|
-
const sourceTokenIcon =
|
|
3375
|
-
const targetTokenIcon =
|
|
3393
|
+
const sourceChainName = _chunkDZ2RPLBMcjs.getChainName.call(void 0, "solana");
|
|
3394
|
+
const targetChainName = _chunkDZ2RPLBMcjs.getChainName.call(void 0, targetChain);
|
|
3395
|
+
const sourceChainIcon = _chunkDZ2RPLBMcjs.getChainIcon.call(void 0, "solana");
|
|
3396
|
+
const targetChainIcon = _chunkDZ2RPLBMcjs.getChainIcon.call(void 0, targetChain);
|
|
3397
|
+
const sourceTokenIcon = _chunkDZ2RPLBMcjs.getTokenIcon.call(void 0, token.symbol);
|
|
3398
|
+
const targetTokenIcon = _chunkDZ2RPLBMcjs.getTokenIcon.call(void 0, targetSymbol);
|
|
3376
3399
|
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _111 => _111.feeSponsored]), () => ( false));
|
|
3377
3400
|
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _112 => _112.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
3378
3401
|
const formattedAmount = sourceAmount && !Number.isNaN(Number(sourceAmount)) ? Number(sourceAmount).toLocaleString("en-US", {
|
|
@@ -3396,7 +3419,7 @@ function SolanaConfirmStep({
|
|
|
3396
3419
|
const receiveAmount = isSameToken ? formattedReceiveAmount : `~${formattedReceiveAmount}`;
|
|
3397
3420
|
const handleConfirm = async () => {
|
|
3398
3421
|
if (!solanaProvider) {
|
|
3399
|
-
|
|
3422
|
+
_chunk7NO7WVJVcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
3400
3423
|
reason: "missing-provider"
|
|
3401
3424
|
});
|
|
3402
3425
|
setError("Solana wallet not connected");
|
|
@@ -3404,7 +3427,7 @@ function SolanaConfirmStep({
|
|
|
3404
3427
|
}
|
|
3405
3428
|
const parsedAmount = parseFloat(sourceAmount);
|
|
3406
3429
|
if (isNaN(parsedAmount) || parsedAmount <= 0) {
|
|
3407
|
-
|
|
3430
|
+
_chunk7NO7WVJVcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
3408
3431
|
reason: "invalid-amount",
|
|
3409
3432
|
sourceAmount
|
|
3410
3433
|
});
|
|
@@ -3413,7 +3436,7 @@ function SolanaConfirmStep({
|
|
|
3413
3436
|
}
|
|
3414
3437
|
setError(null);
|
|
3415
3438
|
setIsSubmitting(true);
|
|
3416
|
-
|
|
3439
|
+
_chunk7NO7WVJVcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
|
|
3417
3440
|
smartAccount,
|
|
3418
3441
|
solanaAddress,
|
|
3419
3442
|
solanaDepositAddress,
|
|
@@ -3423,7 +3446,7 @@ function SolanaConfirmStep({
|
|
|
3423
3446
|
});
|
|
3424
3447
|
try {
|
|
3425
3448
|
const check = await service.checkAccount(smartAccount);
|
|
3426
|
-
|
|
3449
|
+
_chunk7NO7WVJVcjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
|
|
3427
3450
|
smartAccount,
|
|
3428
3451
|
isRegistered: check.isRegistered,
|
|
3429
3452
|
targetChain: check.targetChain,
|
|
@@ -3436,12 +3459,12 @@ function SolanaConfirmStep({
|
|
|
3436
3459
|
}
|
|
3437
3460
|
const connection = hasConfiguredSolanaRpcUrl() ? getSolanaConnection() : _nullishCoalesce(solanaConnection, () => ( getSolanaConnection()));
|
|
3438
3461
|
const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
|
|
3439
|
-
|
|
3462
|
+
_chunk7NO7WVJVcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
|
|
3440
3463
|
token: token.symbol,
|
|
3441
3464
|
sourceAmount,
|
|
3442
3465
|
amountUnits: amountUnits.toString()
|
|
3443
3466
|
});
|
|
3444
|
-
const transaction =
|
|
3467
|
+
const transaction = _chunkDZ2RPLBMcjs.isNativeSol.call(void 0, token) ? await buildSolTransferTransaction(
|
|
3445
3468
|
connection,
|
|
3446
3469
|
solanaAddress,
|
|
3447
3470
|
solanaDepositAddress,
|
|
@@ -3453,7 +3476,7 @@ function SolanaConfirmStep({
|
|
|
3453
3476
|
token.mint,
|
|
3454
3477
|
amountUnits
|
|
3455
3478
|
);
|
|
3456
|
-
|
|
3479
|
+
_chunk7NO7WVJVcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
3457
3480
|
token: token.symbol,
|
|
3458
3481
|
instructionCount: transaction.instructions.length,
|
|
3459
3482
|
feePayer: _optionalChain([transaction, 'access', _113 => _113.feePayer, 'optionalAccess', _114 => _114.toBase58, 'call', _115 => _115()]),
|
|
@@ -3464,15 +3487,15 @@ function SolanaConfirmStep({
|
|
|
3464
3487
|
connection,
|
|
3465
3488
|
transaction
|
|
3466
3489
|
);
|
|
3467
|
-
|
|
3490
|
+
_chunk7NO7WVJVcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
|
|
3468
3491
|
txHash,
|
|
3469
3492
|
amountUnits: amountUnits.toString()
|
|
3470
3493
|
});
|
|
3471
3494
|
onConfirm(txHash, amountUnits.toString());
|
|
3472
3495
|
} catch (err) {
|
|
3473
3496
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
3474
|
-
const message =
|
|
3475
|
-
|
|
3497
|
+
const message = _chunk7NO7WVJVcjs.formatUserError.call(void 0, raw);
|
|
3498
|
+
_chunk7NO7WVJVcjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
|
|
3476
3499
|
smartAccount,
|
|
3477
3500
|
token: token.symbol,
|
|
3478
3501
|
sourceAmount
|
|
@@ -3485,7 +3508,7 @@ function SolanaConfirmStep({
|
|
|
3485
3508
|
};
|
|
3486
3509
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
3487
3510
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3488
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3511
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.WalletIcon, {}), title: "Review deposit" }),
|
|
3489
3512
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
|
|
3490
3513
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
3491
3514
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
@@ -3537,13 +3560,13 @@ function SolanaConfirmStep({
|
|
|
3537
3560
|
children: "$0.04"
|
|
3538
3561
|
}
|
|
3539
3562
|
),
|
|
3540
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3563
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.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, _chunk7NO7WVJVcjs.InfoIcon, {}) }) })
|
|
3541
3564
|
] })
|
|
3542
3565
|
] })
|
|
3543
3566
|
] }),
|
|
3544
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3567
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.Callout, { variant: "error", children: error }),
|
|
3545
3568
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3546
|
-
|
|
3569
|
+
_chunk7NO7WVJVcjs.Button,
|
|
3547
3570
|
{
|
|
3548
3571
|
onClick: handleConfirm,
|
|
3549
3572
|
loading: isSubmitting,
|
|
@@ -3554,7 +3577,7 @@ function SolanaConfirmStep({
|
|
|
3554
3577
|
}
|
|
3555
3578
|
)
|
|
3556
3579
|
] }),
|
|
3557
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3580
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.PoweredBy, {})
|
|
3558
3581
|
] });
|
|
3559
3582
|
}
|
|
3560
3583
|
|
|
@@ -3568,21 +3591,21 @@ function DappImportAssetSelectStep({
|
|
|
3568
3591
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
3569
3592
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3570
3593
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3571
|
-
|
|
3594
|
+
_chunk7NO7WVJVcjs.BodyHeader,
|
|
3572
3595
|
{
|
|
3573
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3596
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.WalletIcon, {}),
|
|
3574
3597
|
title: `Transfer from ${sourceLabel}`,
|
|
3575
3598
|
subtitle: "Pick the balance to import"
|
|
3576
3599
|
}
|
|
3577
3600
|
),
|
|
3578
3601
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: assets.map((asset) => {
|
|
3579
|
-
const tokenAmount = asset.balance ?
|
|
3602
|
+
const tokenAmount = asset.balance ? _chunk7NO7WVJVcjs.tokenFormatter.format(
|
|
3580
3603
|
Number(asset.balance) / 10 ** asset.decimals
|
|
3581
3604
|
) : "0";
|
|
3582
|
-
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ?
|
|
3583
|
-
const tokenIcon = _nullishCoalesce(asset.icon, () => (
|
|
3584
|
-
const chainIcon =
|
|
3585
|
-
const badge =
|
|
3605
|
+
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ? _chunk7NO7WVJVcjs.currencyFormatter.format(asset.balanceUsd) : `${tokenAmount} ${asset.symbol}`;
|
|
3606
|
+
const tokenIcon = _nullishCoalesce(asset.icon, () => ( _chunkDZ2RPLBMcjs.getTokenIcon.call(void 0, asset.symbol)));
|
|
3607
|
+
const chainIcon = _chunkDZ2RPLBMcjs.getChainIcon.call(void 0, asset.chainId);
|
|
3608
|
+
const badge = _chunkDZ2RPLBMcjs.getChainBadge.call(void 0, asset.chainId);
|
|
3586
3609
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3587
3610
|
"button",
|
|
3588
3611
|
{
|
|
@@ -3597,7 +3620,7 @@ function DappImportAssetSelectStep({
|
|
|
3597
3620
|
"img",
|
|
3598
3621
|
{
|
|
3599
3622
|
src: chainIcon,
|
|
3600
|
-
alt:
|
|
3623
|
+
alt: _chunkDZ2RPLBMcjs.getChainName.call(void 0, asset.chainId)
|
|
3601
3624
|
}
|
|
3602
3625
|
) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3603
3626
|
"span",
|
|
@@ -3630,7 +3653,7 @@ function DappImportAssetSelectStep({
|
|
|
3630
3653
|
);
|
|
3631
3654
|
}) })
|
|
3632
3655
|
] }),
|
|
3633
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3656
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.PoweredBy, {})
|
|
3634
3657
|
] });
|
|
3635
3658
|
}
|
|
3636
3659
|
DappImportAssetSelectStep.displayName = "DappImportAssetSelectStep";
|
|
@@ -3696,7 +3719,7 @@ async function detectPolymarketWalletKind(params) {
|
|
|
3696
3719
|
contracts: [
|
|
3697
3720
|
{
|
|
3698
3721
|
address: proxyWallet,
|
|
3699
|
-
abi:
|
|
3722
|
+
abi: _chunk7NO7WVJVcjs.SAFE_ABI,
|
|
3700
3723
|
functionName: "isOwner",
|
|
3701
3724
|
args: [eoa]
|
|
3702
3725
|
},
|
|
@@ -3907,7 +3930,7 @@ async function executePolymarketSafeTransfer(params) {
|
|
|
3907
3930
|
}
|
|
3908
3931
|
const isOwner = await publicClient.readContract({
|
|
3909
3932
|
address: safeAddress,
|
|
3910
|
-
abi:
|
|
3933
|
+
abi: _chunk7NO7WVJVcjs.SAFE_ABI,
|
|
3911
3934
|
functionName: "isOwner",
|
|
3912
3935
|
args: [account.address]
|
|
3913
3936
|
});
|
|
@@ -3924,7 +3947,7 @@ async function executePolymarketSafeTransfer(params) {
|
|
|
3924
3947
|
account,
|
|
3925
3948
|
chain,
|
|
3926
3949
|
address: safeAddress,
|
|
3927
|
-
abi:
|
|
3950
|
+
abi: _chunk7NO7WVJVcjs.SAFE_ABI,
|
|
3928
3951
|
functionName: "execTransaction",
|
|
3929
3952
|
args: [
|
|
3930
3953
|
safeTx.to,
|
|
@@ -3943,7 +3966,7 @@ async function executePolymarketSafeTransfer(params) {
|
|
|
3943
3966
|
hash: txHash
|
|
3944
3967
|
});
|
|
3945
3968
|
const parsed = _viem.parseEventLogs.call(void 0, {
|
|
3946
|
-
abi:
|
|
3969
|
+
abi: _chunk7NO7WVJVcjs.SAFE_ABI,
|
|
3947
3970
|
logs: receipt.logs.filter(
|
|
3948
3971
|
(log) => log.address.toLowerCase() === safeAddress.toLowerCase()
|
|
3949
3972
|
),
|
|
@@ -4569,7 +4592,11 @@ function applyAction(state, action) {
|
|
|
4569
4592
|
sourceChain: action.sourceChain,
|
|
4570
4593
|
sourceToken: _nullishCoalesce(action.sourceToken, () => ( null)),
|
|
4571
4594
|
sourceSymbol: _nullishCoalesce(action.sourceSymbol, () => ( null)),
|
|
4572
|
-
sourceDecimals: _nullishCoalesce(action.sourceDecimals, () => ( null))
|
|
4595
|
+
sourceDecimals: _nullishCoalesce(action.sourceDecimals, () => ( null)),
|
|
4596
|
+
// The submit site's declared USD value, not the lingering typed
|
|
4597
|
+
// input — a submit that doesn't know it (fiat onramp) must not
|
|
4598
|
+
// inherit one from an abandoned wallet attempt.
|
|
4599
|
+
inputAmountUsd: _nullishCoalesce(action.inputAmountUsd, () => ( null))
|
|
4573
4600
|
},
|
|
4574
4601
|
processing: {
|
|
4575
4602
|
...state.processing,
|
|
@@ -4827,15 +4854,15 @@ var SetupError = class extends Error {
|
|
|
4827
4854
|
}
|
|
4828
4855
|
};
|
|
4829
4856
|
async function resolveSessionOwner(eoaAddress) {
|
|
4830
|
-
const local =
|
|
4857
|
+
const local = _chunk7NO7WVJVcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
4831
4858
|
if (local) {
|
|
4832
4859
|
return {
|
|
4833
|
-
account:
|
|
4860
|
+
account: _chunk7NO7WVJVcjs.accountFromPrivateKey.call(void 0, local.privateKey),
|
|
4834
4861
|
address: local.address
|
|
4835
4862
|
};
|
|
4836
4863
|
}
|
|
4837
|
-
const created =
|
|
4838
|
-
|
|
4864
|
+
const created = _chunk7NO7WVJVcjs.createSessionOwnerKey.call(void 0, );
|
|
4865
|
+
_chunk7NO7WVJVcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
4839
4866
|
return { account: created.account, address: created.address };
|
|
4840
4867
|
}
|
|
4841
4868
|
function stableStringify(value) {
|
|
@@ -4903,7 +4930,7 @@ async function runAccountSetup(input, deps) {
|
|
|
4903
4930
|
try {
|
|
4904
4931
|
const sessionOwner = await resolveSessionOwner(input.ownerAddress);
|
|
4905
4932
|
const cacheKey = computeCacheKey(input, sessionOwner.address);
|
|
4906
|
-
|
|
4933
|
+
_chunk7NO7WVJVcjs.debugLog.call(void 0, debug, "account-setup", "setup:start", {
|
|
4907
4934
|
owner: input.ownerAddress,
|
|
4908
4935
|
sessionOwner: sessionOwner.address,
|
|
4909
4936
|
hasPostBridgeActions: Boolean(_optionalChain([input, 'access', _127 => _127.postBridgeActions, 'optionalAccess', _128 => _128.length])),
|
|
@@ -4912,7 +4939,7 @@ async function runAccountSetup(input, deps) {
|
|
|
4912
4939
|
const setup = await service.setupAccount({
|
|
4913
4940
|
ownerAddress: input.ownerAddress,
|
|
4914
4941
|
sessionOwnerAddress: sessionOwner.address,
|
|
4915
|
-
targetChain:
|
|
4942
|
+
targetChain: _chunk7NO7WVJVcjs.targetChainToCaip2.call(void 0, input.targetChain),
|
|
4916
4943
|
targetToken: input.targetToken,
|
|
4917
4944
|
recipient: input.recipient,
|
|
4918
4945
|
postBridgeActions: input.postBridgeActions,
|
|
@@ -4951,7 +4978,7 @@ async function runAccountSetup(input, deps) {
|
|
|
4951
4978
|
primaryType: typedData.primaryType,
|
|
4952
4979
|
message: typedData.message
|
|
4953
4980
|
});
|
|
4954
|
-
const sessionDetails =
|
|
4981
|
+
const sessionDetails = _chunk7NO7WVJVcjs.buildSessionDetails.call(void 0,
|
|
4955
4982
|
setup.sessionDetailsUnsigned,
|
|
4956
4983
|
signature
|
|
4957
4984
|
);
|
|
@@ -4965,7 +4992,7 @@ async function runAccountSetup(input, deps) {
|
|
|
4965
4992
|
eoaAddress: input.ownerAddress,
|
|
4966
4993
|
sessionOwner: sessionOwner.address,
|
|
4967
4994
|
target: {
|
|
4968
|
-
chain:
|
|
4995
|
+
chain: _chunk7NO7WVJVcjs.targetChainToCaip2.call(void 0, input.targetChain),
|
|
4969
4996
|
token: input.targetToken,
|
|
4970
4997
|
...input.recipient && { recipient: input.recipient },
|
|
4971
4998
|
..._optionalChain([input, 'access', _129 => _129.postBridgeActions, 'optionalAccess', _130 => _130.length]) && {
|
|
@@ -4987,7 +5014,7 @@ async function runAccountSetup(input, deps) {
|
|
|
4987
5014
|
isRegistered: true
|
|
4988
5015
|
};
|
|
4989
5016
|
} catch (error) {
|
|
4990
|
-
|
|
5017
|
+
_chunk7NO7WVJVcjs.debugError.call(void 0, debug, "account-setup", "setup:failed", error, {
|
|
4991
5018
|
owner: input.ownerAddress
|
|
4992
5019
|
});
|
|
4993
5020
|
if (error instanceof SetupError) throw error;
|
|
@@ -4998,7 +5025,7 @@ function runAccountSetupDeduped(input, deps, requestKey) {
|
|
|
4998
5025
|
const now = Date.now();
|
|
4999
5026
|
const existing = setupRequestDedupe.get(requestKey);
|
|
5000
5027
|
if (existing && (!existing.settled || existing.expiresAt > now)) {
|
|
5001
|
-
|
|
5028
|
+
_chunk7NO7WVJVcjs.debugLog.call(void 0, deps.debug, "account-setup", "setup:dedupe-hit", {
|
|
5002
5029
|
owner: input.ownerAddress,
|
|
5003
5030
|
forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
|
|
5004
5031
|
});
|
|
@@ -5088,6 +5115,7 @@ function isSameRoute2(sourceChain, sourceToken, targetChain, targetToken) {
|
|
|
5088
5115
|
}
|
|
5089
5116
|
var SWAPPED_SOURCE_CHAIN = 8453;
|
|
5090
5117
|
var SWAPPED_SOURCE_TOKEN = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
|
|
5118
|
+
var SWAPPED_SOURCE_DECIMALS = 6;
|
|
5091
5119
|
function getAddressKey(address) {
|
|
5092
5120
|
return address ? address.toLowerCase() : null;
|
|
5093
5121
|
}
|
|
@@ -5203,6 +5231,7 @@ function deriveStep(flow, d, p, activeEntry, fiat, exchange) {
|
|
|
5203
5231
|
amount: d.amount,
|
|
5204
5232
|
sourceSymbol: _nullishCoalesce(d.sourceSymbol, () => ( void 0)),
|
|
5205
5233
|
sourceDecimals: _nullishCoalesce(d.sourceDecimals, () => ( void 0)),
|
|
5234
|
+
inputAmountUsd: _nullishCoalesce(d.inputAmountUsd, () => ( void 0)),
|
|
5206
5235
|
directTransfer: p.directTransfer
|
|
5207
5236
|
};
|
|
5208
5237
|
}
|
|
@@ -5238,7 +5267,7 @@ function DepositFlow({
|
|
|
5238
5267
|
postBridgeActions,
|
|
5239
5268
|
outputTokenRules,
|
|
5240
5269
|
rejectUnmapped,
|
|
5241
|
-
signerAddress =
|
|
5270
|
+
signerAddress = _chunkDZ2RPLBMcjs.DEFAULT_SIGNER_ADDRESS,
|
|
5242
5271
|
sessionChainIds,
|
|
5243
5272
|
forceRegister = false,
|
|
5244
5273
|
enableSolana = true,
|
|
@@ -5260,10 +5289,10 @@ function DepositFlow({
|
|
|
5260
5289
|
onError,
|
|
5261
5290
|
debug
|
|
5262
5291
|
}) {
|
|
5263
|
-
const onStepChangeRef =
|
|
5264
|
-
const onEventRef =
|
|
5265
|
-
const onLifecycleRef =
|
|
5266
|
-
const onErrorRef =
|
|
5292
|
+
const onStepChangeRef = _chunk7NO7WVJVcjs.useLatestRef.call(void 0, onStepChange);
|
|
5293
|
+
const onEventRef = _chunk7NO7WVJVcjs.useLatestRef.call(void 0, onEvent);
|
|
5294
|
+
const onLifecycleRef = _chunk7NO7WVJVcjs.useLatestRef.call(void 0, onLifecycle);
|
|
5295
|
+
const onErrorRef = _chunk7NO7WVJVcjs.useLatestRef.call(void 0, onError);
|
|
5267
5296
|
const hasInitialReownSession = Boolean(
|
|
5268
5297
|
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _133 => _133.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _134 => _134.address]) : _optionalChain([reownWallet, 'optionalAccess', _135 => _135.address])
|
|
5269
5298
|
);
|
|
@@ -5288,13 +5317,13 @@ function DepositFlow({
|
|
|
5288
5317
|
const stableWalletSelectionKeyRef = _react.useRef.call(void 0, null);
|
|
5289
5318
|
const logFlow = _react.useCallback.call(void 0,
|
|
5290
5319
|
(message, data) => {
|
|
5291
|
-
|
|
5320
|
+
_chunk7NO7WVJVcjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
|
|
5292
5321
|
},
|
|
5293
5322
|
[debug]
|
|
5294
5323
|
);
|
|
5295
5324
|
const logFlowError = _react.useCallback.call(void 0,
|
|
5296
5325
|
(message, error, data) => {
|
|
5297
|
-
|
|
5326
|
+
_chunk7NO7WVJVcjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
|
|
5298
5327
|
},
|
|
5299
5328
|
[debug]
|
|
5300
5329
|
);
|
|
@@ -5410,8 +5439,8 @@ function DepositFlow({
|
|
|
5410
5439
|
selectedWalletId
|
|
5411
5440
|
]);
|
|
5412
5441
|
const setupChainId = typeof targetChain === "number" ? targetChain : typeof defaultSourceChain === "number" ? defaultSourceChain : _chains.base.id;
|
|
5413
|
-
const targetSymbol =
|
|
5414
|
-
const isTargetStablecoin =
|
|
5442
|
+
const targetSymbol = _chunkDZ2RPLBMcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
5443
|
+
const isTargetStablecoin = _chunkDZ2RPLBMcjs.isStablecoinSymbol.call(void 0, targetSymbol);
|
|
5415
5444
|
const targetMarketPriceRef = _react.useRef.call(void 0, null);
|
|
5416
5445
|
_react.useEffect.call(void 0, () => {
|
|
5417
5446
|
targetMarketPriceRef.current = null;
|
|
@@ -5437,7 +5466,7 @@ function DepositFlow({
|
|
|
5437
5466
|
return {
|
|
5438
5467
|
ownerAddress: dappAddress,
|
|
5439
5468
|
walletClient: void 0,
|
|
5440
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
5469
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk7NO7WVJVcjs.getPublicClient.call(void 0, setupChainId))),
|
|
5441
5470
|
switchChain: void 0
|
|
5442
5471
|
};
|
|
5443
5472
|
}
|
|
@@ -5446,7 +5475,7 @@ function DepositFlow({
|
|
|
5446
5475
|
return {
|
|
5447
5476
|
ownerAddress: dappWalletClient.account.address,
|
|
5448
5477
|
walletClient: dappWalletClient,
|
|
5449
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
5478
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk7NO7WVJVcjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
5450
5479
|
switchChain: dappSwitchChain
|
|
5451
5480
|
};
|
|
5452
5481
|
}
|
|
@@ -5460,7 +5489,7 @@ function DepositFlow({
|
|
|
5460
5489
|
return {
|
|
5461
5490
|
ownerAddress: dappAddress,
|
|
5462
5491
|
walletClient: void 0,
|
|
5463
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
5492
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk7NO7WVJVcjs.getPublicClient.call(void 0, setupChainId))),
|
|
5464
5493
|
switchChain: void 0
|
|
5465
5494
|
};
|
|
5466
5495
|
}
|
|
@@ -5469,7 +5498,7 @@ function DepositFlow({
|
|
|
5469
5498
|
return {
|
|
5470
5499
|
ownerAddress: dappWalletClient.account.address,
|
|
5471
5500
|
walletClient: dappWalletClient,
|
|
5472
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
5501
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk7NO7WVJVcjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
5473
5502
|
switchChain: dappSwitchChain
|
|
5474
5503
|
};
|
|
5475
5504
|
}
|
|
@@ -5477,7 +5506,7 @@ function DepositFlow({
|
|
|
5477
5506
|
return {
|
|
5478
5507
|
ownerAddress: reownWallet.address,
|
|
5479
5508
|
walletClient: reownWallet.walletClient,
|
|
5480
|
-
publicClient: _nullishCoalesce(reownWallet.publicClient, () => (
|
|
5509
|
+
publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunk7NO7WVJVcjs.getPublicClient.call(void 0, setupChainId))),
|
|
5481
5510
|
switchChain: reownWallet.switchChain
|
|
5482
5511
|
};
|
|
5483
5512
|
}
|
|
@@ -5515,7 +5544,7 @@ function DepositFlow({
|
|
|
5515
5544
|
return {
|
|
5516
5545
|
ownerAddress: dappAddress,
|
|
5517
5546
|
walletClient: void 0,
|
|
5518
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
5547
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk7NO7WVJVcjs.getPublicClient.call(void 0, setupChainId))),
|
|
5519
5548
|
switchChain: void 0
|
|
5520
5549
|
};
|
|
5521
5550
|
}
|
|
@@ -5708,8 +5737,8 @@ function DepositFlow({
|
|
|
5708
5737
|
pred_balance: totalBalanceUsd
|
|
5709
5738
|
})]);
|
|
5710
5739
|
} else if (effectiveStep.type === "deposit-address") {
|
|
5711
|
-
const chainName =
|
|
5712
|
-
const tokenSymbol =
|
|
5740
|
+
const chainName = _chunkDZ2RPLBMcjs.getChainName.call(void 0, targetChain);
|
|
5741
|
+
const tokenSymbol = _chunkDZ2RPLBMcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
5713
5742
|
_optionalChain([onEventRef, 'access', _179 => _179.current, 'optionalCall', _180 => _180({
|
|
5714
5743
|
type: "deposit_modal_transfer_crypto_open",
|
|
5715
5744
|
default_chain: chainName,
|
|
@@ -5717,7 +5746,7 @@ function DepositFlow({
|
|
|
5717
5746
|
pred_balance: totalBalanceUsd
|
|
5718
5747
|
})]);
|
|
5719
5748
|
} else if (effectiveStep.type === "amount" && stepSendToken) {
|
|
5720
|
-
const receiveSymbol =
|
|
5749
|
+
const receiveSymbol = _chunkDZ2RPLBMcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
5721
5750
|
_optionalChain([onEventRef, 'access', _181 => _181.current, 'optionalCall', _182 => _182({
|
|
5722
5751
|
type: "deposit_modal_connected_wallet_enter_value_open",
|
|
5723
5752
|
send_token: stepSendToken,
|
|
@@ -5828,7 +5857,7 @@ function DepositFlow({
|
|
|
5828
5857
|
eoa: dappImportOwner,
|
|
5829
5858
|
getPublicClient: (chainId) => {
|
|
5830
5859
|
try {
|
|
5831
|
-
return
|
|
5860
|
+
return _chunk7NO7WVJVcjs.getPublicClient.call(void 0, chainId);
|
|
5832
5861
|
} catch (e31) {
|
|
5833
5862
|
return null;
|
|
5834
5863
|
}
|
|
@@ -6021,7 +6050,7 @@ function DepositFlow({
|
|
|
6021
6050
|
try {
|
|
6022
6051
|
sessionOwner = await resolveSessionOwner(owner);
|
|
6023
6052
|
} catch (error) {
|
|
6024
|
-
|
|
6053
|
+
_chunk7NO7WVJVcjs.debugError.call(void 0,
|
|
6025
6054
|
debug,
|
|
6026
6055
|
"deposit-flow",
|
|
6027
6056
|
"session-owner:resolve-failed",
|
|
@@ -6131,8 +6160,8 @@ function DepositFlow({
|
|
|
6131
6160
|
);
|
|
6132
6161
|
const handleSolanaAmountContinue = _react.useCallback.call(void 0,
|
|
6133
6162
|
(token, sourceAmount, inputAmountUsd) => {
|
|
6134
|
-
const targetSym =
|
|
6135
|
-
const isTargetStable =
|
|
6163
|
+
const targetSym = _chunkDZ2RPLBMcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
6164
|
+
const isTargetStable = _chunkDZ2RPLBMcjs.isStablecoinSymbol.call(void 0, targetSym);
|
|
6136
6165
|
const targetTokenPriceUsd = isTargetStable ? 1 : _nullishCoalesce(getTokenPriceUsd(targetSym), () => ( targetMarketPriceRef.current));
|
|
6137
6166
|
logFlow("solana:amount:continue", {
|
|
6138
6167
|
token: token.symbol,
|
|
@@ -6153,8 +6182,10 @@ function DepositFlow({
|
|
|
6153
6182
|
);
|
|
6154
6183
|
const handleSolanaConfirmed = _react.useCallback.call(void 0,
|
|
6155
6184
|
(txHash, amountUnits) => {
|
|
6156
|
-
const
|
|
6185
|
+
const depositAtSubmit = storeApi.getState().deposit;
|
|
6186
|
+
const tokenAtSubmit = depositAtSubmit.selectedSolanaToken;
|
|
6157
6187
|
if (!tokenAtSubmit) return;
|
|
6188
|
+
const amountUsd = _nullishCoalesce(depositAtSubmit.inputAmountUsd, () => ( void 0));
|
|
6158
6189
|
logFlow("solana:submitted", {
|
|
6159
6190
|
txHash,
|
|
6160
6191
|
amountUnits,
|
|
@@ -6167,13 +6198,16 @@ function DepositFlow({
|
|
|
6167
6198
|
sourceToken: tokenAtSubmit.mint,
|
|
6168
6199
|
amount: amountUnits,
|
|
6169
6200
|
sourceSymbol: tokenAtSubmit.symbol,
|
|
6170
|
-
sourceDecimals: tokenAtSubmit.decimals
|
|
6201
|
+
sourceDecimals: tokenAtSubmit.decimals,
|
|
6202
|
+
inputAmountUsd: amountUsd
|
|
6171
6203
|
});
|
|
6172
6204
|
_optionalChain([onLifecycleRef, 'access', _200 => _200.current, 'optionalCall', _201 => _201({
|
|
6173
6205
|
type: "submitted",
|
|
6174
6206
|
txHash,
|
|
6175
6207
|
sourceChain: "solana",
|
|
6176
|
-
amount: amountUnits
|
|
6208
|
+
amount: amountUnits,
|
|
6209
|
+
sourceDecimals: tokenAtSubmit.decimals,
|
|
6210
|
+
amountUsd
|
|
6177
6211
|
})]);
|
|
6178
6212
|
},
|
|
6179
6213
|
[logFlow, onLifecycleRef, storeApi]
|
|
@@ -6203,8 +6237,8 @@ function DepositFlow({
|
|
|
6203
6237
|
activeOwner
|
|
6204
6238
|
);
|
|
6205
6239
|
if (entry.status !== "ready") return;
|
|
6206
|
-
const targetSym =
|
|
6207
|
-
const isTargetStable =
|
|
6240
|
+
const targetSym = _chunkDZ2RPLBMcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
6241
|
+
const isTargetStable = _chunkDZ2RPLBMcjs.isStablecoinSymbol.call(void 0, targetSym);
|
|
6208
6242
|
const targetTokenPriceUsd = isTargetStable ? 1 : _nullishCoalesce(getTokenPriceUsd(targetSym), () => ( targetMarketPriceRef.current));
|
|
6209
6243
|
storeApi.dispatch({
|
|
6210
6244
|
type: "amount/entered",
|
|
@@ -6225,7 +6259,8 @@ function DepositFlow({
|
|
|
6225
6259
|
sourceToken: token,
|
|
6226
6260
|
amount
|
|
6227
6261
|
});
|
|
6228
|
-
const
|
|
6262
|
+
const depositAtSubmit = storeApi.getState().deposit;
|
|
6263
|
+
const asset = depositAtSubmit.selectedAsset;
|
|
6229
6264
|
const dappImport = asset && isDappImportAsset(asset) ? asset : null;
|
|
6230
6265
|
storeApi.dispatch({
|
|
6231
6266
|
type: "deposit/submitted",
|
|
@@ -6233,8 +6268,9 @@ function DepositFlow({
|
|
|
6233
6268
|
sourceChain: chainId,
|
|
6234
6269
|
sourceToken: token,
|
|
6235
6270
|
amount,
|
|
6236
|
-
sourceSymbol: _optionalChain([
|
|
6237
|
-
sourceDecimals: _optionalChain([
|
|
6271
|
+
sourceSymbol: _optionalChain([asset, 'optionalAccess', _204 => _204.symbol]),
|
|
6272
|
+
sourceDecimals: _optionalChain([asset, 'optionalAccess', _205 => _205.decimals]),
|
|
6273
|
+
inputAmountUsd: _nullishCoalesce(depositAtSubmit.inputAmountUsd, () => ( void 0)),
|
|
6238
6274
|
directTransfer: !dappImport && isSameRoute2(chainId, token, targetChain, targetToken)
|
|
6239
6275
|
});
|
|
6240
6276
|
},
|
|
@@ -6254,32 +6290,36 @@ function DepositFlow({
|
|
|
6254
6290
|
sourceToken: SWAPPED_SOURCE_TOKEN,
|
|
6255
6291
|
amount,
|
|
6256
6292
|
sourceSymbol: _nullishCoalesce(info.orderCrypto, () => ( "USDC")),
|
|
6257
|
-
sourceDecimals:
|
|
6293
|
+
sourceDecimals: SWAPPED_SOURCE_DECIMALS
|
|
6258
6294
|
});
|
|
6259
6295
|
_optionalChain([onLifecycleRef, 'access', _206 => _206.current, 'optionalCall', _207 => _207({
|
|
6260
6296
|
type: "submitted",
|
|
6261
6297
|
txHash: info.txHash,
|
|
6262
6298
|
sourceChain: SWAPPED_SOURCE_CHAIN,
|
|
6263
|
-
amount
|
|
6299
|
+
amount,
|
|
6300
|
+
sourceDecimals: SWAPPED_SOURCE_DECIMALS
|
|
6264
6301
|
})]);
|
|
6265
6302
|
},
|
|
6266
6303
|
[logFlow, storeApi, onLifecycleRef]
|
|
6267
6304
|
);
|
|
6268
6305
|
const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
|
|
6269
6306
|
(txHash, sourceChain, amount) => {
|
|
6307
|
+
const depositAtSubmit = storeApi.getState().deposit;
|
|
6270
6308
|
_optionalChain([onLifecycleRef, 'access', _208 => _208.current, 'optionalCall', _209 => _209({
|
|
6271
6309
|
type: "submitted",
|
|
6272
6310
|
txHash,
|
|
6273
6311
|
sourceChain,
|
|
6274
|
-
amount
|
|
6312
|
+
amount,
|
|
6313
|
+
sourceDecimals: _optionalChain([depositAtSubmit, 'access', _210 => _210.selectedAsset, 'optionalAccess', _211 => _211.decimals]),
|
|
6314
|
+
amountUsd: _nullishCoalesce(depositAtSubmit.inputAmountUsd, () => ( void 0))
|
|
6275
6315
|
})]);
|
|
6276
6316
|
},
|
|
6277
|
-
[onLifecycleRef]
|
|
6317
|
+
[onLifecycleRef, storeApi]
|
|
6278
6318
|
);
|
|
6279
6319
|
const handleDepositComplete = _react.useCallback.call(void 0,
|
|
6280
6320
|
(txHash, destinationTxHash, context) => {
|
|
6281
6321
|
logFlow("deposit:complete", { txHash, destinationTxHash, ...context });
|
|
6282
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6322
|
+
_optionalChain([onLifecycleRef, 'access', _212 => _212.current, 'optionalCall', _213 => _213({
|
|
6283
6323
|
type: "complete",
|
|
6284
6324
|
txHash,
|
|
6285
6325
|
destinationTxHash,
|
|
@@ -6291,14 +6331,14 @@ function DepositFlow({
|
|
|
6291
6331
|
const handleDepositFailed = _react.useCallback.call(void 0,
|
|
6292
6332
|
(txHash, error) => {
|
|
6293
6333
|
logFlowError("deposit:failed", error, { txHash });
|
|
6294
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6334
|
+
_optionalChain([onLifecycleRef, 'access', _214 => _214.current, 'optionalCall', _215 => _215({ type: "failed", txHash, error })]);
|
|
6295
6335
|
},
|
|
6296
6336
|
[logFlowError, onLifecycleRef]
|
|
6297
6337
|
);
|
|
6298
6338
|
const handleError = _react.useCallback.call(void 0,
|
|
6299
6339
|
(message, code) => {
|
|
6300
6340
|
logFlowError("flow:error", message, { code });
|
|
6301
|
-
_optionalChain([onErrorRef, 'access',
|
|
6341
|
+
_optionalChain([onErrorRef, 'access', _216 => _216.current, 'optionalCall', _217 => _217({ message, code })]);
|
|
6302
6342
|
},
|
|
6303
6343
|
[logFlowError, onErrorRef]
|
|
6304
6344
|
);
|
|
@@ -6381,7 +6421,7 @@ function DepositFlow({
|
|
|
6381
6421
|
);
|
|
6382
6422
|
if (showConnectStep) {
|
|
6383
6423
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6384
|
-
|
|
6424
|
+
_chunk7NO7WVJVcjs.ConnectStep,
|
|
6385
6425
|
{
|
|
6386
6426
|
walletRows,
|
|
6387
6427
|
transferCryptoState: dappAddress ? transferCryptoState : void 0,
|
|
@@ -6391,7 +6431,6 @@ function DepositFlow({
|
|
|
6391
6431
|
handleRetrySetup(dappAddress);
|
|
6392
6432
|
return;
|
|
6393
6433
|
}
|
|
6394
|
-
if (transferCryptoState !== "ready") return;
|
|
6395
6434
|
handleSelectTransferCrypto();
|
|
6396
6435
|
} : void 0,
|
|
6397
6436
|
onSelectPayWithCard: enableFiatOnramp && dappAddress && (!fiatOnrampMethods || fiatOnrampMethods.length === 0) ? () => handleSelectFiatMethod() : void 0,
|
|
@@ -6450,20 +6489,19 @@ function DepositFlow({
|
|
|
6450
6489
|
{
|
|
6451
6490
|
smartAccount: effectiveStep.smartAccount,
|
|
6452
6491
|
solanaDepositAddress: enableSolana ? effectiveStep.solanaDepositAddress : void 0,
|
|
6453
|
-
isUpdating: activeEntry.status !== "ready",
|
|
6454
6492
|
service,
|
|
6455
6493
|
allowedRoutes,
|
|
6456
6494
|
targetChain,
|
|
6457
6495
|
targetToken,
|
|
6458
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
6496
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _218 => _218.length])),
|
|
6459
6497
|
uiConfig,
|
|
6460
6498
|
onDepositSubmitted: handleDepositAddressSubmitted,
|
|
6461
6499
|
onDepositComplete: handleDepositComplete,
|
|
6462
6500
|
onDepositFailed: handleDepositFailed,
|
|
6463
6501
|
onCopyAddress: () => {
|
|
6464
|
-
const chainName =
|
|
6465
|
-
const tokenSymbol =
|
|
6466
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
6502
|
+
const chainName = _chunkDZ2RPLBMcjs.getChainName.call(void 0, targetChain);
|
|
6503
|
+
const tokenSymbol = _chunkDZ2RPLBMcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
6504
|
+
_optionalChain([onEvent, 'optionalCall', _219 => _219({
|
|
6467
6505
|
type: "deposit_modal_transfer_crypto_cta_click",
|
|
6468
6506
|
default_chain: chainName,
|
|
6469
6507
|
default_token: tokenSymbol,
|
|
@@ -6507,7 +6545,7 @@ function DepositFlow({
|
|
|
6507
6545
|
}
|
|
6508
6546
|
),
|
|
6509
6547
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6510
|
-
|
|
6548
|
+
_chunk7NO7WVJVcjs.ProcessingStep,
|
|
6511
6549
|
{
|
|
6512
6550
|
smartAccount: step.smartAccount,
|
|
6513
6551
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
@@ -6519,7 +6557,8 @@ function DepositFlow({
|
|
|
6519
6557
|
amount: step.amount,
|
|
6520
6558
|
sourceSymbol: step.sourceSymbol,
|
|
6521
6559
|
sourceDecimals: step.sourceDecimals,
|
|
6522
|
-
|
|
6560
|
+
amountUsd: step.inputAmountUsd,
|
|
6561
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _220 => _220.length])),
|
|
6523
6562
|
service,
|
|
6524
6563
|
directTransfer: step.directTransfer,
|
|
6525
6564
|
onClose,
|
|
@@ -6572,7 +6611,7 @@ function DepositFlow({
|
|
|
6572
6611
|
}
|
|
6573
6612
|
),
|
|
6574
6613
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6575
|
-
|
|
6614
|
+
_chunk7NO7WVJVcjs.ProcessingStep,
|
|
6576
6615
|
{
|
|
6577
6616
|
smartAccount: step.smartAccount,
|
|
6578
6617
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
@@ -6584,7 +6623,8 @@ function DepositFlow({
|
|
|
6584
6623
|
amount: step.amount,
|
|
6585
6624
|
sourceSymbol: step.sourceSymbol,
|
|
6586
6625
|
sourceDecimals: step.sourceDecimals,
|
|
6587
|
-
|
|
6626
|
+
amountUsd: step.inputAmountUsd,
|
|
6627
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _221 => _221.length])),
|
|
6588
6628
|
service,
|
|
6589
6629
|
directTransfer: step.directTransfer,
|
|
6590
6630
|
onClose,
|
|
@@ -6601,8 +6641,8 @@ function DepositFlow({
|
|
|
6601
6641
|
}
|
|
6602
6642
|
if (isSolanaWalletMode) {
|
|
6603
6643
|
if (!dappAddress) return null;
|
|
6604
|
-
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess',
|
|
6605
|
-
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess',
|
|
6644
|
+
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess', _222 => _222.solanaAddress]);
|
|
6645
|
+
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess', _223 => _223.solanaProvider]);
|
|
6606
6646
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
6607
6647
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6608
6648
|
AccountPreparingSkeleton,
|
|
@@ -6633,10 +6673,10 @@ function DepositFlow({
|
|
|
6633
6673
|
balanceUsd: effectiveStep.balanceUsd,
|
|
6634
6674
|
defaultAmount: effectiveStep.inputAmountUsd,
|
|
6635
6675
|
uiConfig,
|
|
6636
|
-
targetChainName:
|
|
6637
|
-
targetTokenSymbol:
|
|
6638
|
-
targetTokenIcon:
|
|
6639
|
-
|
|
6676
|
+
targetChainName: _chunkDZ2RPLBMcjs.getChainName.call(void 0, targetChain),
|
|
6677
|
+
targetTokenSymbol: _chunkDZ2RPLBMcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain),
|
|
6678
|
+
targetTokenIcon: _chunkDZ2RPLBMcjs.getTokenIcon.call(void 0,
|
|
6679
|
+
_chunkDZ2RPLBMcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain)
|
|
6640
6680
|
),
|
|
6641
6681
|
appBalanceUsd,
|
|
6642
6682
|
onContinue: handleSolanaAmountContinue,
|
|
@@ -6658,7 +6698,7 @@ function DepositFlow({
|
|
|
6658
6698
|
targetToken,
|
|
6659
6699
|
service,
|
|
6660
6700
|
solanaProvider,
|
|
6661
|
-
solanaConnection: _optionalChain([reownWallet, 'optionalAccess',
|
|
6701
|
+
solanaConnection: _optionalChain([reownWallet, 'optionalAccess', _224 => _224.solanaConnection]),
|
|
6662
6702
|
uiConfig,
|
|
6663
6703
|
onConfirm: handleSolanaConfirmed,
|
|
6664
6704
|
onError: handleError,
|
|
@@ -6699,7 +6739,7 @@ function DepositFlow({
|
|
|
6699
6739
|
) })
|
|
6700
6740
|
] }) : null,
|
|
6701
6741
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6702
|
-
|
|
6742
|
+
_chunk7NO7WVJVcjs.ProcessingStep,
|
|
6703
6743
|
{
|
|
6704
6744
|
smartAccount: effectiveStep.smartAccount,
|
|
6705
6745
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
@@ -6711,7 +6751,8 @@ function DepositFlow({
|
|
|
6711
6751
|
amount: effectiveStep.amount,
|
|
6712
6752
|
sourceSymbol: effectiveStep.sourceSymbol,
|
|
6713
6753
|
sourceDecimals: effectiveStep.sourceDecimals,
|
|
6714
|
-
|
|
6754
|
+
amountUsd: effectiveStep.inputAmountUsd,
|
|
6755
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _225 => _225.length])),
|
|
6715
6756
|
service,
|
|
6716
6757
|
directTransfer: effectiveStep.directTransfer,
|
|
6717
6758
|
onClose,
|
|
@@ -6724,16 +6765,16 @@ function DepositFlow({
|
|
|
6724
6765
|
)
|
|
6725
6766
|
] });
|
|
6726
6767
|
}
|
|
6727
|
-
if (!_optionalChain([signerContext, 'optionalAccess',
|
|
6768
|
+
if (!_optionalChain([signerContext, 'optionalAccess', _226 => _226.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _227 => _227.publicClient])) {
|
|
6728
6769
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-state", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-text", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-title", children: "Connecting wallet\u2026" }) }) }) }) });
|
|
6729
6770
|
}
|
|
6730
6771
|
const ownerAddress = signerContext.ownerAddress;
|
|
6731
|
-
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access',
|
|
6772
|
+
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _228 => _228.walletClient, 'optionalAccess', _229 => _229.chain, 'optionalAccess', _230 => _230.id]), () => ( _optionalChain([signerContext, 'access', _231 => _231.publicClient, 'access', _232 => _232.chain, 'optionalAccess', _233 => _233.id]))), () => ( setupChainId));
|
|
6732
6773
|
const getReadClientForChain = (chainId) => {
|
|
6733
|
-
if (_optionalChain([signerContext, 'access',
|
|
6774
|
+
if (_optionalChain([signerContext, 'access', _234 => _234.publicClient, 'access', _235 => _235.chain, 'optionalAccess', _236 => _236.id]) === chainId) {
|
|
6734
6775
|
return signerContext.publicClient;
|
|
6735
6776
|
}
|
|
6736
|
-
return
|
|
6777
|
+
return _chunk7NO7WVJVcjs.getPublicClient.call(void 0, chainId);
|
|
6737
6778
|
};
|
|
6738
6779
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
6739
6780
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -6764,7 +6805,7 @@ function DepositFlow({
|
|
|
6764
6805
|
effectiveStep.type === "dapp-import-asset-select" && activeDappImportProvider && activeDappImportAvailability && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6765
6806
|
DappImportAssetSelectStep,
|
|
6766
6807
|
{
|
|
6767
|
-
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access',
|
|
6808
|
+
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access', _237 => _237.assets, 'access', _238 => _238[0], 'optionalAccess', _239 => _239.sourceLabel]), () => ( activeDappImportProvider.label)),
|
|
6768
6809
|
assets: activeDappImportAvailability.assets,
|
|
6769
6810
|
onSelect: handleDappImportAssetSelected
|
|
6770
6811
|
}
|
|
@@ -6790,8 +6831,8 @@ function DepositFlow({
|
|
|
6790
6831
|
service,
|
|
6791
6832
|
onContinue: handleAmountContinue,
|
|
6792
6833
|
onCtaClick: (ctaName) => {
|
|
6793
|
-
const receiveSymbol =
|
|
6794
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
6834
|
+
const receiveSymbol = _chunkDZ2RPLBMcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
6835
|
+
_optionalChain([onEvent, 'optionalCall', _240 => _240({
|
|
6795
6836
|
type: "deposit_modal_connected_wallet_enter_value_cta_click",
|
|
6796
6837
|
send_token: effectiveStep.asset.symbol,
|
|
6797
6838
|
receive_token: receiveSymbol,
|
|
@@ -6842,7 +6883,7 @@ function DepositFlow({
|
|
|
6842
6883
|
}
|
|
6843
6884
|
),
|
|
6844
6885
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6845
|
-
|
|
6886
|
+
_chunk7NO7WVJVcjs.ProcessingStep,
|
|
6846
6887
|
{
|
|
6847
6888
|
smartAccount: effectiveStep.smartAccount,
|
|
6848
6889
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
@@ -6854,7 +6895,8 @@ function DepositFlow({
|
|
|
6854
6895
|
amount: effectiveStep.amount,
|
|
6855
6896
|
sourceSymbol: effectiveStep.sourceSymbol,
|
|
6856
6897
|
sourceDecimals: effectiveStep.sourceDecimals,
|
|
6857
|
-
|
|
6898
|
+
amountUsd: effectiveStep.inputAmountUsd,
|
|
6899
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _241 => _241.length])),
|
|
6858
6900
|
service,
|
|
6859
6901
|
directTransfer: effectiveStep.directTransfer,
|
|
6860
6902
|
uiConfig,
|
|
@@ -6893,8 +6935,8 @@ function formatDate(iso) {
|
|
|
6893
6935
|
function resolveChainId(value) {
|
|
6894
6936
|
if (value === void 0 || value === null) return null;
|
|
6895
6937
|
if (typeof value === "number") return value;
|
|
6896
|
-
if (
|
|
6897
|
-
const parsed =
|
|
6938
|
+
if (_chunk7NO7WVJVcjs.isSolanaCaip2.call(void 0, value) || value === "solana") return "solana";
|
|
6939
|
+
const parsed = _chunk7NO7WVJVcjs.parseEvmChainId.call(void 0, value);
|
|
6898
6940
|
if (parsed !== null) return parsed;
|
|
6899
6941
|
const num = Number(value);
|
|
6900
6942
|
return Number.isFinite(num) ? num : null;
|
|
@@ -6903,7 +6945,7 @@ function resolveTokenSymbol(token, chainId) {
|
|
|
6903
6945
|
if (!token) return "";
|
|
6904
6946
|
if (chainId === "solana") {
|
|
6905
6947
|
const normalized = token.toLowerCase();
|
|
6906
|
-
const matched =
|
|
6948
|
+
const matched = _chunkDZ2RPLBMcjs.SOLANA_TOKENS.find(
|
|
6907
6949
|
(entry) => entry.mint.toLowerCase() === normalized
|
|
6908
6950
|
);
|
|
6909
6951
|
if (matched) return matched.symbol;
|
|
@@ -6912,7 +6954,7 @@ function resolveTokenSymbol(token, chainId) {
|
|
|
6912
6954
|
}
|
|
6913
6955
|
}
|
|
6914
6956
|
if (chainId !== null && chainId !== void 0 && chainId !== "solana" && /^0x[a-fA-F0-9]{40}$/.test(token)) {
|
|
6915
|
-
const sym =
|
|
6957
|
+
const sym = _chunkDZ2RPLBMcjs.getTokenSymbol.call(void 0, token, chainId);
|
|
6916
6958
|
if (sym !== "Token") return sym;
|
|
6917
6959
|
}
|
|
6918
6960
|
return shortenHash(token);
|
|
@@ -6923,7 +6965,7 @@ function formatAmount(rawAmount, token, chainId) {
|
|
|
6923
6965
|
if (token && chainId !== null && chainId !== void 0) {
|
|
6924
6966
|
if (chainId === "solana") {
|
|
6925
6967
|
const normalized = token.toLowerCase();
|
|
6926
|
-
const matched =
|
|
6968
|
+
const matched = _chunkDZ2RPLBMcjs.SOLANA_TOKENS.find(
|
|
6927
6969
|
(entry) => entry.mint.toLowerCase() === normalized
|
|
6928
6970
|
);
|
|
6929
6971
|
if (matched) {
|
|
@@ -6932,7 +6974,7 @@ function formatAmount(rawAmount, token, chainId) {
|
|
|
6932
6974
|
decimals = 9;
|
|
6933
6975
|
}
|
|
6934
6976
|
} else if (/^0x[a-fA-F0-9]{40}$/.test(token)) {
|
|
6935
|
-
decimals =
|
|
6977
|
+
decimals = _chunkDZ2RPLBMcjs.getTokenDecimalsByAddress.call(void 0, token, chainId);
|
|
6936
6978
|
}
|
|
6937
6979
|
}
|
|
6938
6980
|
try {
|
|
@@ -6950,7 +6992,7 @@ function formatAmount(rawAmount, token, chainId) {
|
|
|
6950
6992
|
}
|
|
6951
6993
|
function getTxExplorerUrl(txHash, chainId) {
|
|
6952
6994
|
if (!chainId) return null;
|
|
6953
|
-
const base2 =
|
|
6995
|
+
const base2 = _chunkDZ2RPLBMcjs.getExplorerUrl.call(void 0, chainId);
|
|
6954
6996
|
if (!base2) return null;
|
|
6955
6997
|
return `${base2}/tx/${txHash}`;
|
|
6956
6998
|
}
|
|
@@ -6993,7 +7035,7 @@ function DepositHistoryPanel({
|
|
|
6993
7035
|
);
|
|
6994
7036
|
const visibleDeposits = _react.useMemo.call(void 0, () => {
|
|
6995
7037
|
const sourceHashes = new Set(
|
|
6996
|
-
deposits.map((d) => _optionalChain([d, 'access',
|
|
7038
|
+
deposits.map((d) => _optionalChain([d, 'access', _242 => _242.sourceTxHash, 'optionalAccess', _243 => _243.toLowerCase, 'call', _244 => _244()])).filter((h) => Boolean(h))
|
|
6997
7039
|
);
|
|
6998
7040
|
return deposits.filter(
|
|
6999
7041
|
(d) => !(d.txHash && sourceHashes.has(d.txHash.toLowerCase()))
|
|
@@ -7015,7 +7057,7 @@ function DepositHistoryPanel({
|
|
|
7015
7057
|
className: "rs-modal-header-back",
|
|
7016
7058
|
"aria-label": "Back",
|
|
7017
7059
|
onClick: onClose,
|
|
7018
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7060
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.ChevronLeftIcon, {})
|
|
7019
7061
|
}
|
|
7020
7062
|
) }),
|
|
7021
7063
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: onCloseModal && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -7025,29 +7067,29 @@ function DepositHistoryPanel({
|
|
|
7025
7067
|
className: "rs-modal-close",
|
|
7026
7068
|
"aria-label": "Close",
|
|
7027
7069
|
onClick: onCloseModal,
|
|
7028
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7070
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.CloseIcon, {})
|
|
7029
7071
|
}
|
|
7030
7072
|
) })
|
|
7031
7073
|
] }),
|
|
7032
7074
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen", children: [
|
|
7033
7075
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen-body", children: [
|
|
7034
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7076
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.HistoryIcon, {}), title: "History" }),
|
|
7035
7077
|
isLoading && deposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
7036
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7078
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.HistoryIcon, {}) }),
|
|
7037
7079
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
7038
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7080
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.Spinner, { className: "rs-spinner--sm" }),
|
|
7039
7081
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Loading history\u2026" })
|
|
7040
7082
|
] })
|
|
7041
7083
|
] }),
|
|
7042
7084
|
error && !isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
7043
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7085
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.AlertTriangleIcon, {}) }),
|
|
7044
7086
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
7045
7087
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "Couldn't load history" }),
|
|
7046
7088
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: error })
|
|
7047
7089
|
] })
|
|
7048
7090
|
] }),
|
|
7049
7091
|
!isLoading && !error && visibleDeposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
7050
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7092
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.HistoryIcon, {}) }),
|
|
7051
7093
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
7052
7094
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "No deposits yet" }),
|
|
7053
7095
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Your deposit history will appear here" })
|
|
@@ -7067,7 +7109,7 @@ function DepositHistoryPanel({
|
|
|
7067
7109
|
)
|
|
7068
7110
|
] })
|
|
7069
7111
|
] }),
|
|
7070
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7112
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.PoweredBy, {})
|
|
7071
7113
|
] })
|
|
7072
7114
|
]
|
|
7073
7115
|
}
|
|
@@ -7078,12 +7120,12 @@ function HistoryCard({ deposit }) {
|
|
|
7078
7120
|
const status = normalizeStatus(deposit.status, deposit.isSpam);
|
|
7079
7121
|
const sourceChainId = resolveChainId(deposit.chain);
|
|
7080
7122
|
const targetChainId = resolveChainId(deposit.targetChain);
|
|
7081
|
-
const sourceChainName = sourceChainId ?
|
|
7082
|
-
const targetChainName = targetChainId ?
|
|
7083
|
-
const sourceChainIcon = sourceChainId ?
|
|
7084
|
-
const targetChainIcon = targetChainId ?
|
|
7123
|
+
const sourceChainName = sourceChainId ? _chunkDZ2RPLBMcjs.getChainName.call(void 0, sourceChainId) : null;
|
|
7124
|
+
const targetChainName = targetChainId ? _chunkDZ2RPLBMcjs.getChainName.call(void 0, targetChainId) : null;
|
|
7125
|
+
const sourceChainIcon = sourceChainId ? _chunkDZ2RPLBMcjs.getChainIcon.call(void 0, sourceChainId) : void 0;
|
|
7126
|
+
const targetChainIcon = targetChainId ? _chunkDZ2RPLBMcjs.getChainIcon.call(void 0, targetChainId) : void 0;
|
|
7085
7127
|
const sourceSymbol = resolveTokenSymbol(deposit.token, sourceChainId);
|
|
7086
|
-
const sourceTokenIcon = sourceSymbol ?
|
|
7128
|
+
const sourceTokenIcon = sourceSymbol ? _chunkDZ2RPLBMcjs.getTokenIcon.call(void 0, sourceSymbol) : void 0;
|
|
7087
7129
|
const rawAmount = deposit.sourceAmount && deposit.sourceAmount !== "0" ? deposit.sourceAmount : deposit.amount;
|
|
7088
7130
|
const formattedAmount = rawAmount ? formatAmount(rawAmount, deposit.token, sourceChainId) : null;
|
|
7089
7131
|
const displayAmount = formattedAmount ? sourceSymbol && /^USD/.test(sourceSymbol) ? `$${Number(formattedAmount).toLocaleString("en-US", {
|
|
@@ -7142,7 +7184,7 @@ function HistoryCard({ deposit }) {
|
|
|
7142
7184
|
onClick: (e) => e.stopPropagation(),
|
|
7143
7185
|
children: [
|
|
7144
7186
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: shortenHash(deposit.sourceTxHash) }),
|
|
7145
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7187
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.ArrowUpRightIcon, {})
|
|
7146
7188
|
]
|
|
7147
7189
|
}
|
|
7148
7190
|
)
|
|
@@ -7157,7 +7199,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
|
7157
7199
|
// src/DepositModal.tsx
|
|
7158
7200
|
|
|
7159
7201
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
7160
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
7202
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-P4QGKQRZ.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
7161
7203
|
);
|
|
7162
7204
|
function sortByCreatedAtDesc(items) {
|
|
7163
7205
|
return [...items].sort((a, b) => {
|
|
@@ -7206,9 +7248,9 @@ function DepositModalInner({
|
|
|
7206
7248
|
defaultAmount,
|
|
7207
7249
|
recipient,
|
|
7208
7250
|
appBalanceUsd,
|
|
7209
|
-
backendUrl =
|
|
7251
|
+
backendUrl = _chunkDZ2RPLBMcjs.DEFAULT_BACKEND_URL,
|
|
7210
7252
|
solanaRpcUrl,
|
|
7211
|
-
signerAddress =
|
|
7253
|
+
signerAddress = _chunkDZ2RPLBMcjs.DEFAULT_SIGNER_ADDRESS,
|
|
7212
7254
|
sessionChainIds,
|
|
7213
7255
|
forceRegister = false,
|
|
7214
7256
|
enableSolana = true,
|
|
@@ -7235,12 +7277,12 @@ function DepositModalInner({
|
|
|
7235
7277
|
debug
|
|
7236
7278
|
}) {
|
|
7237
7279
|
const modalRef = _react.useRef.call(void 0, null);
|
|
7238
|
-
const onReadyRef =
|
|
7280
|
+
const onReadyRef = _chunk7NO7WVJVcjs.useLatestRef.call(void 0, onReady);
|
|
7239
7281
|
const [currentScreen, setCurrentScreen] = _react.useState.call(void 0, "connect");
|
|
7240
7282
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
7241
7283
|
void 0
|
|
7242
7284
|
);
|
|
7243
|
-
const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
7285
|
+
const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _245 => _245.showHistoryButton]), () => ( false));
|
|
7244
7286
|
const historyButtonVisible = showHistoryButton && (currentScreen === "select-asset" || currentScreen === "deposit-address");
|
|
7245
7287
|
const [historyOpen, setHistoryOpen] = _react.useState.call(void 0, false);
|
|
7246
7288
|
const [historyDeposits, setHistoryDeposits] = _react.useState.call(void 0, []);
|
|
@@ -7251,10 +7293,10 @@ function DepositModalInner({
|
|
|
7251
7293
|
const cursorRef = _react.useRef.call(void 0, null);
|
|
7252
7294
|
const historyStaleRef = _react.useRef.call(void 0, false);
|
|
7253
7295
|
const historyLoadedRef = _react.useRef.call(void 0, false);
|
|
7254
|
-
const targetChain = targetChainProp === "solana" ? "solana" :
|
|
7255
|
-
const sourceChain = sourceChainProp ?
|
|
7296
|
+
const targetChain = targetChainProp === "solana" ? "solana" : _chunkDZ2RPLBMcjs.getChainId.call(void 0, targetChainProp);
|
|
7297
|
+
const sourceChain = sourceChainProp ? _chunkDZ2RPLBMcjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
7256
7298
|
const service = _react.useMemo.call(void 0,
|
|
7257
|
-
() =>
|
|
7299
|
+
() => _chunk7NO7WVJVcjs.createDepositService.call(void 0, backendUrl, {
|
|
7258
7300
|
debug,
|
|
7259
7301
|
debugScope: "service:deposit"
|
|
7260
7302
|
}),
|
|
@@ -7270,7 +7312,7 @@ function DepositModalInner({
|
|
|
7270
7312
|
}, [store, targetChain, targetToken]);
|
|
7271
7313
|
_react.useEffect.call(void 0, () => {
|
|
7272
7314
|
if (isOpen && modalRef.current) {
|
|
7273
|
-
|
|
7315
|
+
_chunk7NO7WVJVcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
7274
7316
|
}
|
|
7275
7317
|
}, [isOpen, theme]);
|
|
7276
7318
|
_react.useEffect.call(void 0, () => {
|
|
@@ -7278,7 +7320,7 @@ function DepositModalInner({
|
|
|
7278
7320
|
}, [solanaRpcUrl]);
|
|
7279
7321
|
_react.useEffect.call(void 0, () => {
|
|
7280
7322
|
if (isOpen) {
|
|
7281
|
-
_optionalChain([onReadyRef, 'access',
|
|
7323
|
+
_optionalChain([onReadyRef, 'access', _246 => _246.current, 'optionalCall', _247 => _247()]);
|
|
7282
7324
|
}
|
|
7283
7325
|
}, [isOpen, onReadyRef]);
|
|
7284
7326
|
const handleStepChange = _react.useCallback.call(void 0,
|
|
@@ -7354,10 +7396,10 @@ function DepositModalInner({
|
|
|
7354
7396
|
fetchHistory("initial");
|
|
7355
7397
|
}
|
|
7356
7398
|
}, [historyOpen, fetchHistory]);
|
|
7357
|
-
const onLifecycleRef =
|
|
7399
|
+
const onLifecycleRef = _chunk7NO7WVJVcjs.useLatestRef.call(void 0, onLifecycle);
|
|
7358
7400
|
const handleLifecycle = _react.useCallback.call(void 0,
|
|
7359
7401
|
(event) => {
|
|
7360
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7402
|
+
_optionalChain([onLifecycleRef, 'access', _248 => _248.current, 'optionalCall', _249 => _249(event)]);
|
|
7361
7403
|
if (event.type === "smart-account-changed" && !event.evm && !event.solana) {
|
|
7362
7404
|
historyStaleRef.current = true;
|
|
7363
7405
|
}
|
|
@@ -7383,10 +7425,10 @@ function DepositModalInner({
|
|
|
7383
7425
|
store.dispatch({ type: "flow/reset" });
|
|
7384
7426
|
}
|
|
7385
7427
|
}, [isOpen, store]);
|
|
7386
|
-
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
7428
|
+
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _250 => _250.showBackButton]), () => ( true));
|
|
7387
7429
|
const canGoBack = backHandler !== void 0;
|
|
7388
7430
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7389
|
-
|
|
7431
|
+
_chunk7NO7WVJVcjs.Modal,
|
|
7390
7432
|
{
|
|
7391
7433
|
isOpen,
|
|
7392
7434
|
onClose,
|
|
@@ -7402,7 +7444,7 @@ function DepositModalInner({
|
|
|
7402
7444
|
className: "rs-modal-header-back",
|
|
7403
7445
|
"aria-label": "Go back",
|
|
7404
7446
|
onClick: backHandler,
|
|
7405
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7447
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.ChevronLeftIcon, {})
|
|
7406
7448
|
}
|
|
7407
7449
|
) }),
|
|
7408
7450
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
|
|
@@ -7414,7 +7456,7 @@ function DepositModalInner({
|
|
|
7414
7456
|
"aria-label": "Deposit history",
|
|
7415
7457
|
onClick: handleHistoryOpen,
|
|
7416
7458
|
disabled: !recipient,
|
|
7417
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7459
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.HistoryIcon, {})
|
|
7418
7460
|
}
|
|
7419
7461
|
),
|
|
7420
7462
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -7424,7 +7466,7 @@ function DepositModalInner({
|
|
|
7424
7466
|
onClick: onClose,
|
|
7425
7467
|
className: "rs-modal-close",
|
|
7426
7468
|
"aria-label": "Close",
|
|
7427
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7469
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7NO7WVJVcjs.CloseIcon, {})
|
|
7428
7470
|
}
|
|
7429
7471
|
)
|
|
7430
7472
|
] })
|