@rhinestone/deposit-modal 0.3.0-alpha.0 → 0.3.0-alpha.2
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-HVIEA6YA.cjs → DepositModalReown-B2XLFH4Z.cjs} +4 -4
- package/dist/{DepositModalReown-GXY65HZP.mjs → DepositModalReown-VFTXYG2B.mjs} +3 -3
- package/dist/{WithdrawModalReown-O6V6KRH6.mjs → WithdrawModalReown-BDJFCWWM.mjs} +3 -3
- package/dist/{WithdrawModalReown-4M3PBY2T.cjs → WithdrawModalReown-K52AK53K.cjs} +4 -4
- package/dist/{chunk-U5QIFNG4.mjs → chunk-AHSVY7AE.mjs} +24 -63
- package/dist/{chunk-7SYZG47X.cjs → chunk-BLAGBBMP.cjs} +245 -284
- package/dist/{chunk-Y3RA3YGA.cjs → chunk-FTMCKJM4.cjs} +25 -25
- package/dist/{chunk-XCAF6B3D.cjs → chunk-IVTXEYB2.cjs} +17 -34
- package/dist/{chunk-FKPTIHU7.mjs → chunk-TWA3SXVV.mjs} +5 -5
- package/dist/{chunk-EEHUOFIW.mjs → chunk-VA3ANS7D.mjs} +17 -34
- package/dist/{chunk-UIHAYD7J.mjs → chunk-XKDZEIB7.mjs} +5 -5
- package/dist/{chunk-Z2SIC2TH.cjs → chunk-ZMNFBFIR.cjs} +94 -94
- package/dist/constants.cjs +2 -2
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +4 -4
- package/dist/deposit.mjs +3 -3
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +4 -4
- package/dist/withdraw.cjs +4 -4
- package/dist/withdraw.mjs +3 -3
- package/package.json +1 -1
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
var
|
|
48
|
+
var _chunkFTMCKJM4cjs = require('./chunk-FTMCKJM4.cjs');
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
|
|
@@ -64,7 +64,7 @@ var _chunkY3RA3YGAcjs = require('./chunk-Y3RA3YGA.cjs');
|
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
|
|
67
|
-
var
|
|
67
|
+
var _chunkIVTXEYB2cjs = require('./chunk-IVTXEYB2.cjs');
|
|
68
68
|
|
|
69
69
|
// src/DepositModal.tsx
|
|
70
70
|
|
|
@@ -85,15 +85,15 @@ var _viem = require('viem');
|
|
|
85
85
|
|
|
86
86
|
var _jsxruntime = require('react/jsx-runtime');
|
|
87
87
|
async function resolveSessionOwner(eoaAddress) {
|
|
88
|
-
const localOwner =
|
|
88
|
+
const localOwner = _chunkFTMCKJM4cjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
89
89
|
if (localOwner) {
|
|
90
90
|
return {
|
|
91
|
-
account:
|
|
91
|
+
account: _chunkFTMCKJM4cjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
92
92
|
address: localOwner.address
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
|
-
const created =
|
|
96
|
-
|
|
95
|
+
const created = _chunkFTMCKJM4cjs.createSessionOwnerKey.call(void 0, );
|
|
96
|
+
_chunkFTMCKJM4cjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
97
97
|
return {
|
|
98
98
|
account: created.account,
|
|
99
99
|
address: created.address
|
|
@@ -132,7 +132,7 @@ function SetupStep({
|
|
|
132
132
|
const setup = await service.setupAccount({
|
|
133
133
|
ownerAddress: address,
|
|
134
134
|
sessionOwnerAddress: sessionOwner.address,
|
|
135
|
-
targetChain:
|
|
135
|
+
targetChain: _chunkFTMCKJM4cjs.toEvmCaip2.call(void 0, targetChain),
|
|
136
136
|
targetToken,
|
|
137
137
|
recipient,
|
|
138
138
|
postBridgeActions,
|
|
@@ -166,7 +166,7 @@ function SetupStep({
|
|
|
166
166
|
primaryType: typedData.primaryType,
|
|
167
167
|
message: typedData.message
|
|
168
168
|
});
|
|
169
|
-
const sessionDetails =
|
|
169
|
+
const sessionDetails = _chunkFTMCKJM4cjs.buildSessionDetails.call(void 0, setup.sessionDetailsUnsigned, signature);
|
|
170
170
|
setState({ type: "registering" });
|
|
171
171
|
const registerResult = await service.registerAccount({
|
|
172
172
|
address: smartAccount,
|
|
@@ -178,7 +178,7 @@ function SetupStep({
|
|
|
178
178
|
eoaAddress: address,
|
|
179
179
|
sessionOwner: sessionOwner.address,
|
|
180
180
|
target: {
|
|
181
|
-
chain:
|
|
181
|
+
chain: _chunkFTMCKJM4cjs.toEvmCaip2.call(void 0, targetChain),
|
|
182
182
|
token: targetToken,
|
|
183
183
|
...recipient && { recipient },
|
|
184
184
|
..._optionalChain([postBridgeActions, 'optionalAccess', _2 => _2.length]) && { postBridgeActions },
|
|
@@ -247,25 +247,25 @@ function SetupStep({
|
|
|
247
247
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
248
248
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step-body", style: { paddingTop: 0 }, children: [
|
|
249
249
|
isLoading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
250
|
-
|
|
250
|
+
_chunkFTMCKJM4cjs.BodyHeader,
|
|
251
251
|
{
|
|
252
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
252
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.Spinner, { className: "rs-spinner--sm" }),
|
|
253
253
|
title: renderStateMessage(),
|
|
254
254
|
subtitle: "This may take a moment"
|
|
255
255
|
}
|
|
256
256
|
),
|
|
257
257
|
isError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
258
|
-
|
|
258
|
+
_chunkFTMCKJM4cjs.BodyHeader,
|
|
259
259
|
{
|
|
260
260
|
variant: "error",
|
|
261
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
261
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.AlertTriangleIcon, {}),
|
|
262
262
|
title: "Setup failed",
|
|
263
263
|
subtitle: state.message
|
|
264
264
|
}
|
|
265
265
|
)
|
|
266
266
|
] }),
|
|
267
|
-
isError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
268
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
267
|
+
isError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.Button, { onClick: handleRetry, variant: "default", fullWidth: true, children: "Try Again" }) }),
|
|
268
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.PoweredBy, {})
|
|
269
269
|
] });
|
|
270
270
|
}
|
|
271
271
|
|
|
@@ -291,7 +291,7 @@ function AssetSelectStep({
|
|
|
291
291
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
292
292
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
293
293
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
294
|
-
return
|
|
294
|
+
return _chunkFTMCKJM4cjs.getAssetId.call(void 0, {
|
|
295
295
|
chainId: defaultSourceChain,
|
|
296
296
|
token: defaultSourceToken
|
|
297
297
|
});
|
|
@@ -308,10 +308,10 @@ function AssetSelectStep({
|
|
|
308
308
|
try {
|
|
309
309
|
const portfolio = await service.fetchPortfolio(address);
|
|
310
310
|
if (!active) return;
|
|
311
|
-
const portfolioAssets =
|
|
311
|
+
const portfolioAssets = _chunkFTMCKJM4cjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
312
312
|
setAssets(portfolioAssets);
|
|
313
313
|
const hasNative = portfolioAssets.some(
|
|
314
|
-
(asset) => asset.token.toLowerCase() ===
|
|
314
|
+
(asset) => asset.token.toLowerCase() === _chunkIVTXEYB2cjs.NATIVE_TOKEN_ADDRESS
|
|
315
315
|
);
|
|
316
316
|
if (!hasNative) {
|
|
317
317
|
const nativeAssets = await fetchNativeAssets(
|
|
@@ -389,7 +389,7 @@ function AssetSelectStep({
|
|
|
389
389
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
390
390
|
const numeric = Number(raw);
|
|
391
391
|
if (!Number.isFinite(numeric)) return raw;
|
|
392
|
-
return
|
|
392
|
+
return _chunkFTMCKJM4cjs.tokenFormatter.format(numeric);
|
|
393
393
|
} catch (e3) {
|
|
394
394
|
return asset.balance;
|
|
395
395
|
}
|
|
@@ -397,20 +397,20 @@ function AssetSelectStep({
|
|
|
397
397
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
398
398
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
399
399
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
400
|
-
|
|
400
|
+
_chunkFTMCKJM4cjs.BodyHeader,
|
|
401
401
|
{
|
|
402
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
402
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.WalletIcon, {}),
|
|
403
403
|
title: "Your assets",
|
|
404
404
|
subtitle: "Select source assets to transfer"
|
|
405
405
|
}
|
|
406
406
|
),
|
|
407
407
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
408
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
408
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.Spinner, { className: "rs-text-tertiary" }),
|
|
409
409
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
410
410
|
] }),
|
|
411
411
|
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-alert rs-alert--error", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-alert-text", children: error }) }),
|
|
412
412
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
413
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
413
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
414
414
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
415
415
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
416
416
|
address.slice(0, 6),
|
|
@@ -430,9 +430,9 @@ function AssetSelectStep({
|
|
|
430
430
|
!loading && !error && rows.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: rows.map((asset) => {
|
|
431
431
|
const isSelected = selectedAssetId === asset.id;
|
|
432
432
|
const tokenAmount = formatBalance(asset);
|
|
433
|
-
const badge =
|
|
434
|
-
const tokenIcon =
|
|
435
|
-
const chainIcon =
|
|
433
|
+
const badge = _chunkIVTXEYB2cjs.getChainBadge.call(void 0, asset.chainId);
|
|
434
|
+
const tokenIcon = _chunkIVTXEYB2cjs.getTokenIcon.call(void 0, asset.symbol);
|
|
435
|
+
const chainIcon = _chunkIVTXEYB2cjs.getChainIcon.call(void 0, asset.chainId);
|
|
436
436
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
437
437
|
"button",
|
|
438
438
|
{
|
|
@@ -448,7 +448,7 @@ function AssetSelectStep({
|
|
|
448
448
|
"img",
|
|
449
449
|
{
|
|
450
450
|
src: chainIcon,
|
|
451
|
-
alt:
|
|
451
|
+
alt: _chunkIVTXEYB2cjs.getChainName.call(void 0, asset.chainId)
|
|
452
452
|
}
|
|
453
453
|
) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
454
454
|
"span",
|
|
@@ -467,7 +467,7 @@ function AssetSelectStep({
|
|
|
467
467
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-name", children: asset.symbol }),
|
|
468
468
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-asset-chain", children: [
|
|
469
469
|
"on ",
|
|
470
|
-
|
|
470
|
+
_chunkIVTXEYB2cjs.getChainName.call(void 0, asset.chainId)
|
|
471
471
|
] })
|
|
472
472
|
] }),
|
|
473
473
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-balance-small", children: [
|
|
@@ -477,14 +477,14 @@ function AssetSelectStep({
|
|
|
477
477
|
] })
|
|
478
478
|
] })
|
|
479
479
|
] }),
|
|
480
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ?
|
|
480
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunkFTMCKJM4cjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
481
481
|
]
|
|
482
482
|
},
|
|
483
483
|
asset.id
|
|
484
484
|
);
|
|
485
485
|
}) }),
|
|
486
486
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
487
|
-
|
|
487
|
+
_chunkFTMCKJM4cjs.Button,
|
|
488
488
|
{
|
|
489
489
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
490
490
|
disabled: !selectedAsset,
|
|
@@ -493,17 +493,17 @@ function AssetSelectStep({
|
|
|
493
493
|
}
|
|
494
494
|
)
|
|
495
495
|
] }),
|
|
496
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
496
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.PoweredBy, {})
|
|
497
497
|
] });
|
|
498
498
|
}
|
|
499
499
|
async function fetchNativeAssets(address, publicClient, existing) {
|
|
500
500
|
const existingIds = new Set(existing.map((asset) => asset.id));
|
|
501
501
|
const connectedChainId = _optionalChain([publicClient, 'access', _12 => _12.chain, 'optionalAccess', _13 => _13.id]);
|
|
502
502
|
if (!connectedChainId) return [];
|
|
503
|
-
if (!
|
|
504
|
-
const id =
|
|
503
|
+
if (!_chunkIVTXEYB2cjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
|
|
504
|
+
const id = _chunkFTMCKJM4cjs.getAssetId.call(void 0, {
|
|
505
505
|
chainId: connectedChainId,
|
|
506
|
-
token:
|
|
506
|
+
token: _chunkIVTXEYB2cjs.NATIVE_TOKEN_ADDRESS
|
|
507
507
|
});
|
|
508
508
|
if (existingIds.has(id)) return [];
|
|
509
509
|
try {
|
|
@@ -512,7 +512,7 @@ async function fetchNativeAssets(address, publicClient, existing) {
|
|
|
512
512
|
{
|
|
513
513
|
id,
|
|
514
514
|
chainId: connectedChainId,
|
|
515
|
-
token:
|
|
515
|
+
token: _chunkIVTXEYB2cjs.NATIVE_TOKEN_ADDRESS,
|
|
516
516
|
symbol: "ETH",
|
|
517
517
|
name: "Ethereum",
|
|
518
518
|
decimals: 18,
|
|
@@ -579,8 +579,8 @@ function AmountStep({
|
|
|
579
579
|
const chainMismatch = Boolean(
|
|
580
580
|
_optionalChain([walletClient, 'optionalAccess', _14 => _14.chain, 'optionalAccess', _15 => _15.id]) && walletClient.chain.id !== asset.chainId
|
|
581
581
|
);
|
|
582
|
-
const targetSymbol =
|
|
583
|
-
const isSourceStablecoin =
|
|
582
|
+
const targetSymbol = _chunkIVTXEYB2cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
583
|
+
const isSourceStablecoin = _chunkIVTXEYB2cjs.isStablecoinSymbol.call(void 0, asset.symbol);
|
|
584
584
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
585
585
|
if (tokenPriceUsdOverride !== void 0 && tokenPriceUsdOverride > 0)
|
|
586
586
|
return tokenPriceUsdOverride;
|
|
@@ -604,7 +604,7 @@ function AmountStep({
|
|
|
604
604
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
605
605
|
if (!balanceTarget || !publicClient) return;
|
|
606
606
|
try {
|
|
607
|
-
const bal =
|
|
607
|
+
const bal = _chunkFTMCKJM4cjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
608
608
|
address: asset.token,
|
|
609
609
|
abi: _viem.erc20Abi,
|
|
610
610
|
functionName: "balanceOf",
|
|
@@ -625,7 +625,7 @@ function AmountStep({
|
|
|
625
625
|
hasAttemptedSwitch.current = true;
|
|
626
626
|
switchChain(asset.chainId).catch((err) => {
|
|
627
627
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
628
|
-
setError(
|
|
628
|
+
setError(_chunkFTMCKJM4cjs.formatUserError.call(void 0, raw));
|
|
629
629
|
});
|
|
630
630
|
}
|
|
631
631
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -659,7 +659,7 @@ function AmountStep({
|
|
|
659
659
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
660
660
|
const numeric = Number(raw);
|
|
661
661
|
if (!Number.isFinite(numeric)) return raw;
|
|
662
|
-
return
|
|
662
|
+
return _chunkFTMCKJM4cjs.tokenFormatter.format(numeric);
|
|
663
663
|
} catch (e8) {
|
|
664
664
|
return "\u2026";
|
|
665
665
|
}
|
|
@@ -772,13 +772,13 @@ function AmountStep({
|
|
|
772
772
|
};
|
|
773
773
|
const continueLabel = isCheckingLiquidity ? "Checking liquidity\u2026" : exceedsBalance ? "Insufficient balance" : isAboveMax ? "Continue with max allowed deposit" : isBelowMin ? "Continue with minimum deposit" : "Continue";
|
|
774
774
|
const continueDisabled = chainMismatch || isCheckingLiquidity || exceedsBalance || numericAmount === 0 && !isBelowMin || balance === null;
|
|
775
|
-
const sourceChainName =
|
|
776
|
-
const targetChainName =
|
|
777
|
-
const sourceTokenIcon =
|
|
778
|
-
const targetTokenIcon =
|
|
775
|
+
const sourceChainName = _chunkIVTXEYB2cjs.getChainName.call(void 0, asset.chainId);
|
|
776
|
+
const targetChainName = _chunkIVTXEYB2cjs.getChainName.call(void 0, targetChain);
|
|
777
|
+
const sourceTokenIcon = _chunkIVTXEYB2cjs.getTokenIcon.call(void 0, asset.symbol);
|
|
778
|
+
const targetTokenIcon = _chunkIVTXEYB2cjs.getTokenIcon.call(void 0, targetSymbol);
|
|
779
779
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
780
780
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
781
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
781
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.WalletIcon, {}), title: "Wallet deposit" }),
|
|
782
782
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
783
783
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
784
784
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-input-row", children: [
|
|
@@ -804,13 +804,13 @@ function AmountStep({
|
|
|
804
804
|
" available",
|
|
805
805
|
balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
806
806
|
" (~",
|
|
807
|
-
|
|
807
|
+
_chunkFTMCKJM4cjs.currencyFormatter.format(balanceUsd),
|
|
808
808
|
")"
|
|
809
809
|
] })
|
|
810
810
|
] }),
|
|
811
811
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
812
812
|
"Min. deposit ",
|
|
813
|
-
|
|
813
|
+
_chunkFTMCKJM4cjs.currencyFormatter.format(minDepositUsd)
|
|
814
814
|
] })
|
|
815
815
|
] })
|
|
816
816
|
] }),
|
|
@@ -851,15 +851,15 @@ function AmountStep({
|
|
|
851
851
|
] }),
|
|
852
852
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
853
853
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
854
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
854
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkFTMCKJM4cjs.currencyFormatter.format(balanceAfterUsd) })
|
|
855
855
|
] })
|
|
856
856
|
] }),
|
|
857
857
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", role: "alert", children: [
|
|
858
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
858
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.AlertTriangleIcon, { style: { width: 16, height: 16, flexShrink: 0 } }),
|
|
859
859
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: error })
|
|
860
860
|
] }),
|
|
861
861
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
862
|
-
|
|
862
|
+
_chunkFTMCKJM4cjs.Button,
|
|
863
863
|
{
|
|
864
864
|
onClick: handleContinue,
|
|
865
865
|
fullWidth: true,
|
|
@@ -868,7 +868,7 @@ function AmountStep({
|
|
|
868
868
|
}
|
|
869
869
|
)
|
|
870
870
|
] }),
|
|
871
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
871
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.PoweredBy, {})
|
|
872
872
|
] });
|
|
873
873
|
}
|
|
874
874
|
|
|
@@ -905,13 +905,13 @@ function ConfirmStep({
|
|
|
905
905
|
_optionalChain([walletClient, 'optionalAccess', _21 => _21.chain, 'optionalAccess', _22 => _22.id]) && walletClient.chain.id !== asset.chainId
|
|
906
906
|
);
|
|
907
907
|
const sameRoute = targetChain === asset.chainId && targetToken.toLowerCase() === asset.token.toLowerCase();
|
|
908
|
-
const targetSymbol = sameRoute ? asset.symbol :
|
|
909
|
-
const sourceChainName =
|
|
910
|
-
const targetChainName =
|
|
911
|
-
const sourceChainIcon =
|
|
912
|
-
const targetChainIcon =
|
|
913
|
-
const sourceTokenIcon =
|
|
914
|
-
const targetTokenIcon =
|
|
908
|
+
const targetSymbol = sameRoute ? asset.symbol : _chunkIVTXEYB2cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
909
|
+
const sourceChainName = _chunkIVTXEYB2cjs.getChainName.call(void 0, asset.chainId);
|
|
910
|
+
const targetChainName = _chunkIVTXEYB2cjs.getChainName.call(void 0, targetChain);
|
|
911
|
+
const sourceChainIcon = _chunkIVTXEYB2cjs.getChainIcon.call(void 0, asset.chainId);
|
|
912
|
+
const targetChainIcon = _chunkIVTXEYB2cjs.getChainIcon.call(void 0, targetChain);
|
|
913
|
+
const sourceTokenIcon = _chunkIVTXEYB2cjs.getTokenIcon.call(void 0, asset.symbol);
|
|
914
|
+
const targetTokenIcon = _chunkIVTXEYB2cjs.getTokenIcon.call(void 0, targetSymbol);
|
|
915
915
|
const formattedSendAmount = amount && !Number.isNaN(Number(amount)) ? Number(amount).toLocaleString("en-US", { maximumFractionDigits: 6 }) : "0";
|
|
916
916
|
const formattedReceiveAmount = (() => {
|
|
917
917
|
if (sameRoute) return formattedSendAmount;
|
|
@@ -933,7 +933,7 @@ function ConfirmStep({
|
|
|
933
933
|
hasAttemptedSwitch.current = true;
|
|
934
934
|
switchChain(asset.chainId).catch((err) => {
|
|
935
935
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
936
|
-
setError(
|
|
936
|
+
setError(_chunkFTMCKJM4cjs.formatUserError.call(void 0, raw));
|
|
937
937
|
});
|
|
938
938
|
}
|
|
939
939
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -974,7 +974,7 @@ function ConfirmStep({
|
|
|
974
974
|
throw new Error("Wallet not properly connected");
|
|
975
975
|
}
|
|
976
976
|
const transferTo = sameRoute ? recipient : smartAccount;
|
|
977
|
-
const hash =
|
|
977
|
+
const hash = _chunkFTMCKJM4cjs.isNativeAsset.call(void 0, asset) ? await walletClient.sendTransaction({
|
|
978
978
|
account,
|
|
979
979
|
chain,
|
|
980
980
|
to: transferTo,
|
|
@@ -991,7 +991,7 @@ function ConfirmStep({
|
|
|
991
991
|
onConfirm(hash, asset.chainId, amountUnits.toString(), asset.token);
|
|
992
992
|
} catch (err) {
|
|
993
993
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
994
|
-
const message =
|
|
994
|
+
const message = _chunkFTMCKJM4cjs.formatUserError.call(void 0, raw);
|
|
995
995
|
setError(message);
|
|
996
996
|
_optionalChain([onError, 'optionalCall', _26 => _26(message, "TRANSFER_ERROR")]);
|
|
997
997
|
} finally {
|
|
@@ -1000,7 +1000,7 @@ function ConfirmStep({
|
|
|
1000
1000
|
};
|
|
1001
1001
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
1002
1002
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
1003
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1003
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.WalletIcon, {}), title: "Review deposit" }),
|
|
1004
1004
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-details", children: [
|
|
1005
1005
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
1006
1006
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
@@ -1056,20 +1056,20 @@ function ConfirmStep({
|
|
|
1056
1056
|
]
|
|
1057
1057
|
}
|
|
1058
1058
|
),
|
|
1059
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1059
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.Tooltip, { content: feeTooltip, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-info", "aria-label": "Fee info", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.InfoIcon, {}) }) })
|
|
1060
1060
|
] })
|
|
1061
1061
|
] })
|
|
1062
1062
|
] }),
|
|
1063
1063
|
liquidityWarning && (liquidityWarning.kind === "unavailable" || liquidityWarning.kind === "check-failed") && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", role: "status", children: [
|
|
1064
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1064
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.AlertTriangleIcon, { style: { width: 16, height: 16, flexShrink: 0 } }),
|
|
1065
1065
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: liquidityWarning.kind === "unavailable" ? "Route may be unavailable" : "Liquidity check failed" })
|
|
1066
1066
|
] }),
|
|
1067
1067
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", role: "alert", children: [
|
|
1068
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1068
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.AlertTriangleIcon, { style: { width: 16, height: 16, flexShrink: 0 } }),
|
|
1069
1069
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: error })
|
|
1070
1070
|
] }),
|
|
1071
1071
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1072
|
-
|
|
1072
|
+
_chunkFTMCKJM4cjs.Button,
|
|
1073
1073
|
{
|
|
1074
1074
|
onClick: handleConfirm,
|
|
1075
1075
|
loading: isSubmitting,
|
|
@@ -1080,7 +1080,7 @@ function ConfirmStep({
|
|
|
1080
1080
|
}
|
|
1081
1081
|
)
|
|
1082
1082
|
] }),
|
|
1083
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1083
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.PoweredBy, {})
|
|
1084
1084
|
] });
|
|
1085
1085
|
}
|
|
1086
1086
|
|
|
@@ -1103,9 +1103,9 @@ var INITIAL_POLL_INTERVAL = 3e3;
|
|
|
1103
1103
|
var MAX_POLL_INTERVAL = 3e4;
|
|
1104
1104
|
var BACKOFF_MULTIPLIER = 1.5;
|
|
1105
1105
|
function isEventForTx(event, txHash) {
|
|
1106
|
-
const eventTxHash =
|
|
1106
|
+
const eventTxHash = _chunkFTMCKJM4cjs.getEventTxHash.call(void 0, event);
|
|
1107
1107
|
if (!eventTxHash) return false;
|
|
1108
|
-
return
|
|
1108
|
+
return _chunkFTMCKJM4cjs.txRefsMatch.call(void 0, eventTxHash, txHash);
|
|
1109
1109
|
}
|
|
1110
1110
|
function truncateHash(hash) {
|
|
1111
1111
|
return `${hash.slice(0, 4)}\u2026${hash.slice(-4)}`;
|
|
@@ -1155,7 +1155,7 @@ function formatBridgeFailedMessage(event) {
|
|
|
1155
1155
|
}
|
|
1156
1156
|
return "Bridge failed";
|
|
1157
1157
|
}
|
|
1158
|
-
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1158
|
+
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.ExternalLinkIcon, { className: "rs-deposit-notification-link-icon" });
|
|
1159
1159
|
function DepositNotification({
|
|
1160
1160
|
deposit,
|
|
1161
1161
|
smartAccount,
|
|
@@ -1183,7 +1183,7 @@ function DepositNotification({
|
|
|
1183
1183
|
const pollIntervalRef = _react.useRef.call(void 0, INITIAL_POLL_INTERVAL);
|
|
1184
1184
|
const pollTimeoutRef = _react.useRef.call(void 0, null);
|
|
1185
1185
|
const completedRef = _react.useRef.call(void 0, _nullishCoalesce(directTransfer, () => ( false)));
|
|
1186
|
-
const depositContextRef =
|
|
1186
|
+
const depositContextRef = _chunkFTMCKJM4cjs.useLatestRef.call(void 0, {
|
|
1187
1187
|
amount,
|
|
1188
1188
|
sourceChain,
|
|
1189
1189
|
sourceToken: token,
|
|
@@ -1192,8 +1192,8 @@ function DepositNotification({
|
|
|
1192
1192
|
waitForFinalTx,
|
|
1193
1193
|
hasPostBridgeActions
|
|
1194
1194
|
});
|
|
1195
|
-
const onCompleteRef =
|
|
1196
|
-
const onFailedRef =
|
|
1195
|
+
const onCompleteRef = _chunkFTMCKJM4cjs.useLatestRef.call(void 0, onComplete);
|
|
1196
|
+
const onFailedRef = _chunkFTMCKJM4cjs.useLatestRef.call(void 0, onFailed);
|
|
1197
1197
|
const handleComplete = _react.useCallback.call(void 0,
|
|
1198
1198
|
(destTxHash) => {
|
|
1199
1199
|
if (completedRef.current) return;
|
|
@@ -1297,11 +1297,11 @@ function DepositNotification({
|
|
|
1297
1297
|
status,
|
|
1298
1298
|
txHash
|
|
1299
1299
|
]);
|
|
1300
|
-
const sourceExplorerUrl = sourceChain === "unknown" ? void 0 :
|
|
1301
|
-
const destExplorerUrl = destinationTxHash ?
|
|
1300
|
+
const sourceExplorerUrl = sourceChain === "unknown" ? void 0 : _chunkIVTXEYB2cjs.getExplorerTxUrl.call(void 0, sourceChain, txHash);
|
|
1301
|
+
const destExplorerUrl = destinationTxHash ? _chunkIVTXEYB2cjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
|
|
1302
1302
|
const title = status === "complete" ? "Deposit completed" : status === "failed" ? "Deposit failed" : "Deposit received and processing\u2026";
|
|
1303
1303
|
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.";
|
|
1304
|
-
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,
|
|
1304
|
+
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, _chunkFTMCKJM4cjs.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, _chunkFTMCKJM4cjs.CloseIcon, {}) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--processing", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.Spinner, {}) });
|
|
1305
1305
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1306
1306
|
"div",
|
|
1307
1307
|
{
|
|
@@ -1320,7 +1320,7 @@ function DepositNotification({
|
|
|
1320
1320
|
className: "rs-deposit-notification-close",
|
|
1321
1321
|
onClick: () => onDismiss(deposit.id),
|
|
1322
1322
|
"aria-label": "Dismiss",
|
|
1323
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1323
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.CloseIcon, {})
|
|
1324
1324
|
}
|
|
1325
1325
|
)
|
|
1326
1326
|
] }),
|
|
@@ -1602,7 +1602,7 @@ function DepositAddressStep({
|
|
|
1602
1602
|
[_optionalChain([allowedRoutes, 'optionalAccess', _55 => _55.sourceTokens])]
|
|
1603
1603
|
);
|
|
1604
1604
|
const evmChainIds = _react.useMemo.call(void 0, () => {
|
|
1605
|
-
const all =
|
|
1605
|
+
const all = _chunkIVTXEYB2cjs.getSupportedChainIds.call(void 0, );
|
|
1606
1606
|
return allowedChainSet ? all.filter((id) => allowedChainSet.has(id)) : all;
|
|
1607
1607
|
}, [allowedChainSet]);
|
|
1608
1608
|
const chainOptions = _react.useMemo.call(void 0, () => {
|
|
@@ -1616,7 +1616,7 @@ function DepositAddressStep({
|
|
|
1616
1616
|
const [sourceChainId, setSourceChainId] = _react.useState.call(void 0, defaultChainId);
|
|
1617
1617
|
const isSolana = sourceChainId === "solana";
|
|
1618
1618
|
const tokensForChain = _react.useMemo.call(void 0, () => {
|
|
1619
|
-
const all = isSolana ? SOLANA_TOKENS.map((t) => t.symbol) :
|
|
1619
|
+
const all = isSolana ? SOLANA_TOKENS.map((t) => t.symbol) : _chunkIVTXEYB2cjs.getTargetTokenSymbolsForChain.call(void 0, sourceChainId);
|
|
1620
1620
|
return allowedTokenSet ? all.filter((s) => allowedTokenSet.has(s.toUpperCase())) : all;
|
|
1621
1621
|
}, [sourceChainId, isSolana, allowedTokenSet]);
|
|
1622
1622
|
const defaultToken = tokensForChain.includes("USDC") ? "USDC" : _nullishCoalesce(tokensForChain[0], () => ( "USDC"));
|
|
@@ -1640,7 +1640,7 @@ function DepositAddressStep({
|
|
|
1640
1640
|
const notificationIdRef = _react.useRef.call(void 0, 0);
|
|
1641
1641
|
const sourceSelectionRef = _react.useRef.call(void 0, {
|
|
1642
1642
|
chainId: defaultChainId,
|
|
1643
|
-
token: typeof defaultChainId === "number" ?
|
|
1643
|
+
token: typeof defaultChainId === "number" ? _chunkIVTXEYB2cjs.getTokenAddress.call(void 0, defaultToken, defaultChainId) : void 0,
|
|
1644
1644
|
sourceSymbol: defaultToken
|
|
1645
1645
|
});
|
|
1646
1646
|
_react.useEffect.call(void 0, () => {
|
|
@@ -1656,7 +1656,7 @@ function DepositAddressStep({
|
|
|
1656
1656
|
}
|
|
1657
1657
|
sourceSelectionRef.current = {
|
|
1658
1658
|
chainId: sourceChainId,
|
|
1659
|
-
token:
|
|
1659
|
+
token: _chunkIVTXEYB2cjs.getTokenAddress.call(void 0, sourceTokenSymbol, sourceChainId),
|
|
1660
1660
|
sourceSymbol: sourceTokenSymbol
|
|
1661
1661
|
};
|
|
1662
1662
|
}, [sourceChainId, sourceTokenSymbol, isSolana]);
|
|
@@ -1668,7 +1668,7 @@ function DepositAddressStep({
|
|
|
1668
1668
|
setLiquidityHelper({ kind: "idle" });
|
|
1669
1669
|
return;
|
|
1670
1670
|
}
|
|
1671
|
-
const sourceTokenAddress =
|
|
1671
|
+
const sourceTokenAddress = _chunkIVTXEYB2cjs.getTokenAddress.call(void 0,
|
|
1672
1672
|
sourceTokenSymbol,
|
|
1673
1673
|
sourceChainId
|
|
1674
1674
|
);
|
|
@@ -1807,10 +1807,10 @@ function DepositAddressStep({
|
|
|
1807
1807
|
return;
|
|
1808
1808
|
}
|
|
1809
1809
|
const event = status.lastEvent;
|
|
1810
|
-
const eventTxHash =
|
|
1810
|
+
const eventTxHash = _chunkFTMCKJM4cjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkFTMCKJM4cjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
1811
1811
|
if (baselineTxHashRef.current === void 0) {
|
|
1812
1812
|
baselineTxHashRef.current = eventTxHash;
|
|
1813
|
-
} else if (eventTxHash && (!baselineTxHashRef.current || !
|
|
1813
|
+
} else if (eventTxHash && (!baselineTxHashRef.current || !_chunkFTMCKJM4cjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
|
|
1814
1814
|
const details = getDepositEventDetails(event);
|
|
1815
1815
|
const chainId = _nullishCoalesce(details.chainId, () => ( "unknown"));
|
|
1816
1816
|
const amount = _nullishCoalesce(details.amount, () => ( "0"));
|
|
@@ -1880,10 +1880,10 @@ function DepositAddressStep({
|
|
|
1880
1880
|
const handleNotificationDismiss = _react.useCallback.call(void 0, (id) => {
|
|
1881
1881
|
setNotifications((prev) => prev.filter((n) => n.id !== id));
|
|
1882
1882
|
}, []);
|
|
1883
|
-
const qrIconSrc =
|
|
1883
|
+
const qrIconSrc = _chunkIVTXEYB2cjs.getChainIcon.call(void 0, sourceChainId);
|
|
1884
1884
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-step--with-notifications", children: [
|
|
1885
1885
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
1886
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1886
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.CoinsIcon, {}), title: "Transfer crypto" }),
|
|
1887
1887
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", children: [
|
|
1888
1888
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", ref: chainDropdownRef, children: [
|
|
1889
1889
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
@@ -1897,16 +1897,16 @@ function DepositAddressStep({
|
|
|
1897
1897
|
setTokenDropdownOpen(false);
|
|
1898
1898
|
},
|
|
1899
1899
|
children: [
|
|
1900
|
-
|
|
1900
|
+
_chunkIVTXEYB2cjs.getChainIcon.call(void 0, sourceChainId) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1901
1901
|
"img",
|
|
1902
1902
|
{
|
|
1903
|
-
src:
|
|
1903
|
+
src: _chunkIVTXEYB2cjs.getChainIcon.call(void 0, sourceChainId),
|
|
1904
1904
|
alt: "",
|
|
1905
1905
|
className: "rs-deposit-address-dropdown-icon"
|
|
1906
1906
|
}
|
|
1907
1907
|
),
|
|
1908
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children:
|
|
1909
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1908
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunkIVTXEYB2cjs.getChainName.call(void 0, sourceChainId) }),
|
|
1909
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
1910
1910
|
]
|
|
1911
1911
|
}
|
|
1912
1912
|
),
|
|
@@ -1920,15 +1920,15 @@ function DepositAddressStep({
|
|
|
1920
1920
|
setChainDropdownOpen(false);
|
|
1921
1921
|
},
|
|
1922
1922
|
children: [
|
|
1923
|
-
|
|
1923
|
+
_chunkIVTXEYB2cjs.getChainIcon.call(void 0, chainId) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1924
1924
|
"img",
|
|
1925
1925
|
{
|
|
1926
|
-
src:
|
|
1926
|
+
src: _chunkIVTXEYB2cjs.getChainIcon.call(void 0, chainId),
|
|
1927
1927
|
alt: "",
|
|
1928
1928
|
className: "rs-deposit-address-dropdown-icon"
|
|
1929
1929
|
}
|
|
1930
1930
|
),
|
|
1931
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children:
|
|
1931
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunkIVTXEYB2cjs.getChainName.call(void 0, chainId) })
|
|
1932
1932
|
]
|
|
1933
1933
|
},
|
|
1934
1934
|
String(chainId)
|
|
@@ -1940,8 +1940,8 @@ function DepositAddressStep({
|
|
|
1940
1940
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
1941
1941
|
"Min.$",
|
|
1942
1942
|
_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _74 => _74.minDepositUsd]), () => ( 0.1)),
|
|
1943
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1944
|
-
|
|
1943
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1944
|
+
_chunkFTMCKJM4cjs.InfoIcon,
|
|
1945
1945
|
{
|
|
1946
1946
|
className: "rs-deposit-address-min-icon",
|
|
1947
1947
|
"aria-hidden": "true"
|
|
@@ -1959,16 +1959,16 @@ function DepositAddressStep({
|
|
|
1959
1959
|
setChainDropdownOpen(false);
|
|
1960
1960
|
},
|
|
1961
1961
|
children: [
|
|
1962
|
-
|
|
1962
|
+
_chunkIVTXEYB2cjs.getTokenIcon.call(void 0, sourceTokenSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1963
1963
|
"img",
|
|
1964
1964
|
{
|
|
1965
|
-
src:
|
|
1965
|
+
src: _chunkIVTXEYB2cjs.getTokenIcon.call(void 0, sourceTokenSymbol),
|
|
1966
1966
|
alt: "",
|
|
1967
1967
|
className: "rs-deposit-address-dropdown-icon"
|
|
1968
1968
|
}
|
|
1969
1969
|
),
|
|
1970
1970
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceTokenSymbol }),
|
|
1971
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1971
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
1972
1972
|
]
|
|
1973
1973
|
}
|
|
1974
1974
|
),
|
|
@@ -1982,10 +1982,10 @@ function DepositAddressStep({
|
|
|
1982
1982
|
setTokenDropdownOpen(false);
|
|
1983
1983
|
},
|
|
1984
1984
|
children: [
|
|
1985
|
-
|
|
1985
|
+
_chunkIVTXEYB2cjs.getTokenIcon.call(void 0, symbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1986
1986
|
"img",
|
|
1987
1987
|
{
|
|
1988
|
-
src:
|
|
1988
|
+
src: _chunkIVTXEYB2cjs.getTokenIcon.call(void 0, symbol),
|
|
1989
1989
|
alt: "",
|
|
1990
1990
|
className: "rs-deposit-address-dropdown-icon"
|
|
1991
1991
|
}
|
|
@@ -2016,7 +2016,7 @@ function DepositAddressStep({
|
|
|
2016
2016
|
alignItems: "center",
|
|
2017
2017
|
justifyContent: "center"
|
|
2018
2018
|
},
|
|
2019
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2019
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.Spinner, {})
|
|
2020
2020
|
}
|
|
2021
2021
|
),
|
|
2022
2022
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, QRCode, { value: displayAddress, size: 220, iconSrc: qrIconSrc })
|
|
@@ -2031,7 +2031,7 @@ function DepositAddressStep({
|
|
|
2031
2031
|
className: "rs-deposit-address-copy",
|
|
2032
2032
|
onClick: handleCopy,
|
|
2033
2033
|
children: [
|
|
2034
|
-
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2034
|
+
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.CopyIcon, {}),
|
|
2035
2035
|
copied ? "Copied!" : "Copy address"
|
|
2036
2036
|
]
|
|
2037
2037
|
}
|
|
@@ -2056,16 +2056,16 @@ function DepositAddressStep({
|
|
|
2056
2056
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
|
|
2057
2057
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
|
|
2058
2058
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2059
|
-
|
|
2059
|
+
_chunkFTMCKJM4cjs.Tooltip,
|
|
2060
2060
|
{
|
|
2061
2061
|
className: "rs-price-impact-info",
|
|
2062
2062
|
content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
|
|
2063
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2063
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.InfoIcon, { "aria-hidden": "true" })
|
|
2064
2064
|
}
|
|
2065
2065
|
)
|
|
2066
2066
|
] }),
|
|
2067
2067
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2068
|
-
|
|
2068
|
+
_chunkFTMCKJM4cjs.ChevronDownIcon,
|
|
2069
2069
|
{
|
|
2070
2070
|
className: "rs-price-impact-chevron",
|
|
2071
2071
|
"aria-hidden": "true"
|
|
@@ -2076,29 +2076,29 @@ function DepositAddressStep({
|
|
|
2076
2076
|
),
|
|
2077
2077
|
/* @__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: [
|
|
2078
2078
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
2079
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2079
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.PercentIcon, {}) }),
|
|
2080
2080
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
2081
2081
|
"Max slippage: ",
|
|
2082
2082
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.2%" })
|
|
2083
2083
|
] }),
|
|
2084
2084
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2085
|
-
|
|
2085
|
+
_chunkFTMCKJM4cjs.Tooltip,
|
|
2086
2086
|
{
|
|
2087
2087
|
className: "rs-price-impact-info",
|
|
2088
2088
|
content: "Slippage accounts for price changes during execution. Slippage is adjusted per pair to ensure reliable execution.",
|
|
2089
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2089
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.InfoIcon, { "aria-hidden": "true" })
|
|
2090
2090
|
}
|
|
2091
2091
|
)
|
|
2092
2092
|
] }),
|
|
2093
2093
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
2094
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2094
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.ClockIcon, {}) }),
|
|
2095
2095
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
2096
2096
|
"Processing time: ",
|
|
2097
2097
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "< 1 min" })
|
|
2098
2098
|
] })
|
|
2099
2099
|
] }),
|
|
2100
2100
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
2101
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2101
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.PlusCircleIcon, {}) }),
|
|
2102
2102
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
2103
2103
|
"Max deposit:",
|
|
2104
2104
|
" ",
|
|
@@ -2131,7 +2131,7 @@ function DepositAddressStep({
|
|
|
2131
2131
|
},
|
|
2132
2132
|
deposit.id
|
|
2133
2133
|
)) }),
|
|
2134
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2134
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.PoweredBy, {})
|
|
2135
2135
|
] });
|
|
2136
2136
|
}
|
|
2137
2137
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -2162,7 +2162,7 @@ function SolanaTokenSelectStep({
|
|
|
2162
2162
|
setError(null);
|
|
2163
2163
|
const portfolioBySymbol = {};
|
|
2164
2164
|
try {
|
|
2165
|
-
|
|
2165
|
+
_chunkFTMCKJM4cjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
|
|
2166
2166
|
solanaAddress
|
|
2167
2167
|
});
|
|
2168
2168
|
const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
|
|
@@ -2185,12 +2185,12 @@ function SolanaTokenSelectStep({
|
|
|
2185
2185
|
};
|
|
2186
2186
|
}
|
|
2187
2187
|
}
|
|
2188
|
-
|
|
2188
|
+
_chunkFTMCKJM4cjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
|
|
2189
2189
|
symbols: Object.keys(portfolioBySymbol)
|
|
2190
2190
|
});
|
|
2191
2191
|
} catch (err) {
|
|
2192
2192
|
if (!active) return;
|
|
2193
|
-
|
|
2193
|
+
_chunkFTMCKJM4cjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
|
|
2194
2194
|
solanaAddress
|
|
2195
2195
|
});
|
|
2196
2196
|
setError(
|
|
@@ -2237,9 +2237,9 @@ function SolanaTokenSelectStep({
|
|
|
2237
2237
|
}
|
|
2238
2238
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
2239
2239
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: { padding: "0 12px 12px" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2240
|
-
|
|
2240
|
+
_chunkFTMCKJM4cjs.BodyHeader,
|
|
2241
2241
|
{
|
|
2242
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2242
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.CoinsIcon, {}),
|
|
2243
2243
|
title: "Select asset",
|
|
2244
2244
|
subtitle: "Pick a Solana token to deposit"
|
|
2245
2245
|
}
|
|
@@ -2251,11 +2251,11 @@ function SolanaTokenSelectStep({
|
|
|
2251
2251
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
2252
2252
|
children: [
|
|
2253
2253
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
2254
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2254
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.Spinner, { className: "rs-text-tertiary" }),
|
|
2255
2255
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
2256
2256
|
] }),
|
|
2257
2257
|
!loading && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
2258
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2258
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
2259
2259
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
2260
2260
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
2261
2261
|
solanaAddress.slice(0, 6),
|
|
@@ -2265,13 +2265,13 @@ function SolanaTokenSelectStep({
|
|
|
2265
2265
|
] }),
|
|
2266
2266
|
!loading && rows.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: rows.map((entry) => {
|
|
2267
2267
|
const isSelected = selectedSymbol === entry.token.symbol;
|
|
2268
|
-
const tokenIcon =
|
|
2269
|
-
const chainIcon =
|
|
2268
|
+
const tokenIcon = _chunkIVTXEYB2cjs.getTokenIcon.call(void 0, entry.token.symbol);
|
|
2269
|
+
const chainIcon = _chunkIVTXEYB2cjs.getChainIcon.call(void 0, "solana");
|
|
2270
2270
|
let formattedBalance;
|
|
2271
2271
|
try {
|
|
2272
2272
|
const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
|
|
2273
2273
|
const numeric = Number(raw);
|
|
2274
|
-
formattedBalance = Number.isFinite(numeric) ?
|
|
2274
|
+
formattedBalance = Number.isFinite(numeric) ? _chunkFTMCKJM4cjs.tokenFormatter.format(numeric) : raw;
|
|
2275
2275
|
} catch (e16) {
|
|
2276
2276
|
formattedBalance = "...";
|
|
2277
2277
|
}
|
|
@@ -2315,7 +2315,7 @@ function SolanaTokenSelectStep({
|
|
|
2315
2315
|
] })
|
|
2316
2316
|
] })
|
|
2317
2317
|
] }),
|
|
2318
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ?
|
|
2318
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunkFTMCKJM4cjs.currencyFormatter.format(entry.balanceUsd) : `${formattedBalance} ${entry.token.symbol}` })
|
|
2319
2319
|
]
|
|
2320
2320
|
},
|
|
2321
2321
|
entry.token.symbol
|
|
@@ -2325,7 +2325,7 @@ function SolanaTokenSelectStep({
|
|
|
2325
2325
|
}
|
|
2326
2326
|
),
|
|
2327
2327
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2328
|
-
|
|
2328
|
+
_chunkFTMCKJM4cjs.Button,
|
|
2329
2329
|
{
|
|
2330
2330
|
onClick: () => selectedEntry && onContinue(
|
|
2331
2331
|
selectedEntry.token,
|
|
@@ -2337,7 +2337,7 @@ function SolanaTokenSelectStep({
|
|
|
2337
2337
|
children: "Continue"
|
|
2338
2338
|
}
|
|
2339
2339
|
) }),
|
|
2340
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2340
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.PoweredBy, {})
|
|
2341
2341
|
] });
|
|
2342
2342
|
}
|
|
2343
2343
|
|
|
@@ -2367,7 +2367,7 @@ function SolanaAmountStep({
|
|
|
2367
2367
|
}) {
|
|
2368
2368
|
const [amount, setAmount] = _react.useState.call(void 0, "");
|
|
2369
2369
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
2370
|
-
const isSourceStablecoin =
|
|
2370
|
+
const isSourceStablecoin = _chunkIVTXEYB2cjs.isStablecoinSymbol.call(void 0, token.symbol);
|
|
2371
2371
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
2372
2372
|
if (isSourceStablecoin) return 1;
|
|
2373
2373
|
try {
|
|
@@ -2395,7 +2395,7 @@ function SolanaAmountStep({
|
|
|
2395
2395
|
const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
|
|
2396
2396
|
const numeric = Number(raw);
|
|
2397
2397
|
if (!Number.isFinite(numeric)) return raw;
|
|
2398
|
-
return
|
|
2398
|
+
return _chunkFTMCKJM4cjs.tokenFormatter.format(numeric);
|
|
2399
2399
|
} catch (e18) {
|
|
2400
2400
|
return "\u2026";
|
|
2401
2401
|
}
|
|
@@ -2454,7 +2454,7 @@ function SolanaAmountStep({
|
|
|
2454
2454
|
const factor = 1e3;
|
|
2455
2455
|
const truncated = Math.floor(value * factor) / factor;
|
|
2456
2456
|
const formatted = truncated.toFixed(3).replace(/\.?0+$/, "");
|
|
2457
|
-
|
|
2457
|
+
_chunkFTMCKJM4cjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
|
|
2458
2458
|
percentage,
|
|
2459
2459
|
symbol: token.symbol,
|
|
2460
2460
|
formatted
|
|
@@ -2492,7 +2492,7 @@ function SolanaAmountStep({
|
|
|
2492
2492
|
try {
|
|
2493
2493
|
amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
|
|
2494
2494
|
} catch (e23) {
|
|
2495
|
-
|
|
2495
|
+
_chunkFTMCKJM4cjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2496
2496
|
amount,
|
|
2497
2497
|
sourceAmount: sourceAmountStr,
|
|
2498
2498
|
reason: "parse-units-failed"
|
|
@@ -2507,7 +2507,7 @@ function SolanaAmountStep({
|
|
|
2507
2507
|
);
|
|
2508
2508
|
return;
|
|
2509
2509
|
}
|
|
2510
|
-
|
|
2510
|
+
_chunkFTMCKJM4cjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
|
|
2511
2511
|
symbol: token.symbol,
|
|
2512
2512
|
inputAmountUsd: amount,
|
|
2513
2513
|
sourceAmount: sourceAmountStr,
|
|
@@ -2518,10 +2518,10 @@ function SolanaAmountStep({
|
|
|
2518
2518
|
};
|
|
2519
2519
|
const continueLabel = exceedsBalance ? "Insufficient balance" : isAboveMax ? "Continue with max allowed deposit" : isBelowMin ? "Continue with minimum deposit" : "Continue";
|
|
2520
2520
|
const continueDisabled = exceedsBalance || numericAmount === 0 && !isBelowMin;
|
|
2521
|
-
const sourceTokenIcon =
|
|
2521
|
+
const sourceTokenIcon = _chunkIVTXEYB2cjs.getTokenIcon.call(void 0, token.symbol);
|
|
2522
2522
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
2523
2523
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2524
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2524
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.WalletIcon, {}), title: "Wallet deposit" }),
|
|
2525
2525
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
2526
2526
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
2527
2527
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-input-row", children: [
|
|
@@ -2547,13 +2547,13 @@ function SolanaAmountStep({
|
|
|
2547
2547
|
" available",
|
|
2548
2548
|
computedBalanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2549
2549
|
" (~",
|
|
2550
|
-
|
|
2550
|
+
_chunkFTMCKJM4cjs.currencyFormatter.format(computedBalanceUsd),
|
|
2551
2551
|
")"
|
|
2552
2552
|
] })
|
|
2553
2553
|
] }),
|
|
2554
2554
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
2555
2555
|
"Min. deposit ",
|
|
2556
|
-
|
|
2556
|
+
_chunkFTMCKJM4cjs.currencyFormatter.format(minDepositUsd)
|
|
2557
2557
|
] })
|
|
2558
2558
|
] })
|
|
2559
2559
|
] }),
|
|
@@ -2592,15 +2592,15 @@ function SolanaAmountStep({
|
|
|
2592
2592
|
] }),
|
|
2593
2593
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
2594
2594
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
2595
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
2595
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkFTMCKJM4cjs.currencyFormatter.format(balanceAfterUsd) })
|
|
2596
2596
|
] })
|
|
2597
2597
|
] }),
|
|
2598
2598
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", role: "alert", children: [
|
|
2599
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2599
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.AlertTriangleIcon, { style: { width: 16, height: 16, flexShrink: 0 } }),
|
|
2600
2600
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: error })
|
|
2601
2601
|
] }),
|
|
2602
2602
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2603
|
-
|
|
2603
|
+
_chunkFTMCKJM4cjs.Button,
|
|
2604
2604
|
{
|
|
2605
2605
|
onClick: handleContinue,
|
|
2606
2606
|
fullWidth: true,
|
|
@@ -2609,7 +2609,7 @@ function SolanaAmountStep({
|
|
|
2609
2609
|
}
|
|
2610
2610
|
)
|
|
2611
2611
|
] }),
|
|
2612
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2612
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.PoweredBy, {})
|
|
2613
2613
|
] });
|
|
2614
2614
|
}
|
|
2615
2615
|
|
|
@@ -2636,7 +2636,7 @@ function SolanaConfirmStep({
|
|
|
2636
2636
|
}) {
|
|
2637
2637
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
2638
2638
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
2639
|
-
const targetSymbol =
|
|
2639
|
+
const targetSymbol = _chunkIVTXEYB2cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
2640
2640
|
const isSameToken = token.symbol.toUpperCase() === targetSymbol.toUpperCase();
|
|
2641
2641
|
const formattedAmount = sourceAmount && !Number.isNaN(Number(sourceAmount)) ? Number(sourceAmount).toLocaleString("en-US", { maximumFractionDigits: 6 }) : "0";
|
|
2642
2642
|
const formattedReceiveAmount = (() => {
|
|
@@ -2653,7 +2653,7 @@ function SolanaConfirmStep({
|
|
|
2653
2653
|
const receiveAmount = isSameToken ? formattedReceiveAmount : `~ ${formattedReceiveAmount}`;
|
|
2654
2654
|
const handleConfirm = async () => {
|
|
2655
2655
|
if (!solanaProvider) {
|
|
2656
|
-
|
|
2656
|
+
_chunkFTMCKJM4cjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
2657
2657
|
reason: "missing-provider"
|
|
2658
2658
|
});
|
|
2659
2659
|
setError("Solana wallet not connected");
|
|
@@ -2661,7 +2661,7 @@ function SolanaConfirmStep({
|
|
|
2661
2661
|
}
|
|
2662
2662
|
const parsedAmount = parseFloat(sourceAmount);
|
|
2663
2663
|
if (isNaN(parsedAmount) || parsedAmount <= 0) {
|
|
2664
|
-
|
|
2664
|
+
_chunkFTMCKJM4cjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
2665
2665
|
reason: "invalid-amount",
|
|
2666
2666
|
sourceAmount
|
|
2667
2667
|
});
|
|
@@ -2670,7 +2670,7 @@ function SolanaConfirmStep({
|
|
|
2670
2670
|
}
|
|
2671
2671
|
setError(null);
|
|
2672
2672
|
setIsSubmitting(true);
|
|
2673
|
-
|
|
2673
|
+
_chunkFTMCKJM4cjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
|
|
2674
2674
|
smartAccount,
|
|
2675
2675
|
solanaAddress,
|
|
2676
2676
|
solanaDepositAddress,
|
|
@@ -2680,7 +2680,7 @@ function SolanaConfirmStep({
|
|
|
2680
2680
|
});
|
|
2681
2681
|
try {
|
|
2682
2682
|
const check = await service.checkAccount(smartAccount);
|
|
2683
|
-
|
|
2683
|
+
_chunkFTMCKJM4cjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
|
|
2684
2684
|
smartAccount,
|
|
2685
2685
|
isRegistered: check.isRegistered,
|
|
2686
2686
|
targetChain: check.targetChain,
|
|
@@ -2693,7 +2693,7 @@ function SolanaConfirmStep({
|
|
|
2693
2693
|
}
|
|
2694
2694
|
const connection = getSolanaConnection();
|
|
2695
2695
|
const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
|
|
2696
|
-
|
|
2696
|
+
_chunkFTMCKJM4cjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
|
|
2697
2697
|
token: token.symbol,
|
|
2698
2698
|
sourceAmount,
|
|
2699
2699
|
amountUnits: amountUnits.toString()
|
|
@@ -2710,7 +2710,7 @@ function SolanaConfirmStep({
|
|
|
2710
2710
|
token.mint,
|
|
2711
2711
|
amountUnits
|
|
2712
2712
|
);
|
|
2713
|
-
|
|
2713
|
+
_chunkFTMCKJM4cjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
2714
2714
|
token: token.symbol,
|
|
2715
2715
|
instructionCount: transaction.instructions.length,
|
|
2716
2716
|
feePayer: _optionalChain([transaction, 'access', _78 => _78.feePayer, 'optionalAccess', _79 => _79.toBase58, 'call', _80 => _80()]),
|
|
@@ -2721,15 +2721,15 @@ function SolanaConfirmStep({
|
|
|
2721
2721
|
connection,
|
|
2722
2722
|
transaction
|
|
2723
2723
|
);
|
|
2724
|
-
|
|
2724
|
+
_chunkFTMCKJM4cjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
|
|
2725
2725
|
txHash,
|
|
2726
2726
|
amountUnits: amountUnits.toString()
|
|
2727
2727
|
});
|
|
2728
2728
|
onConfirm(txHash, amountUnits.toString());
|
|
2729
2729
|
} catch (err) {
|
|
2730
2730
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
2731
|
-
const message =
|
|
2732
|
-
|
|
2731
|
+
const message = _chunkFTMCKJM4cjs.formatUserError.call(void 0, raw);
|
|
2732
|
+
_chunkFTMCKJM4cjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
|
|
2733
2733
|
smartAccount,
|
|
2734
2734
|
token: token.symbol,
|
|
2735
2735
|
sourceAmount
|
|
@@ -2741,7 +2741,7 @@ function SolanaConfirmStep({
|
|
|
2741
2741
|
}
|
|
2742
2742
|
};
|
|
2743
2743
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
2744
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: { padding: "0 12px 12px" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2744
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { style: { padding: "0 12px 12px" }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.WalletIcon, {}), title: "Review deposit" }) }),
|
|
2745
2745
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step-body rs-space-y-3", style: { paddingTop: 0 }, children: [
|
|
2746
2746
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-card", children: [
|
|
2747
2747
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-card-row", children: [
|
|
@@ -2752,15 +2752,15 @@ function SolanaConfirmStep({
|
|
|
2752
2752
|
className: "rs-card-value",
|
|
2753
2753
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
2754
2754
|
children: [
|
|
2755
|
-
|
|
2755
|
+
_chunkIVTXEYB2cjs.getChainIcon.call(void 0, "solana") && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2756
2756
|
"img",
|
|
2757
2757
|
{
|
|
2758
|
-
src:
|
|
2758
|
+
src: _chunkIVTXEYB2cjs.getChainIcon.call(void 0, "solana"),
|
|
2759
2759
|
alt: "",
|
|
2760
2760
|
style: { width: 16, height: 16, borderRadius: 3 }
|
|
2761
2761
|
}
|
|
2762
2762
|
),
|
|
2763
|
-
|
|
2763
|
+
_chunkIVTXEYB2cjs.getChainName.call(void 0, "solana")
|
|
2764
2764
|
]
|
|
2765
2765
|
}
|
|
2766
2766
|
)
|
|
@@ -2773,15 +2773,15 @@ function SolanaConfirmStep({
|
|
|
2773
2773
|
className: "rs-card-value",
|
|
2774
2774
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
2775
2775
|
children: [
|
|
2776
|
-
|
|
2776
|
+
_chunkIVTXEYB2cjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2777
2777
|
"img",
|
|
2778
2778
|
{
|
|
2779
|
-
src:
|
|
2779
|
+
src: _chunkIVTXEYB2cjs.getChainIcon.call(void 0, targetChain),
|
|
2780
2780
|
alt: "",
|
|
2781
2781
|
style: { width: 16, height: 16, borderRadius: 3 }
|
|
2782
2782
|
}
|
|
2783
2783
|
),
|
|
2784
|
-
|
|
2784
|
+
_chunkIVTXEYB2cjs.getChainName.call(void 0, targetChain)
|
|
2785
2785
|
]
|
|
2786
2786
|
}
|
|
2787
2787
|
)
|
|
@@ -2800,10 +2800,10 @@ function SolanaConfirmStep({
|
|
|
2800
2800
|
className: "rs-card-value",
|
|
2801
2801
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
2802
2802
|
children: [
|
|
2803
|
-
|
|
2803
|
+
_chunkIVTXEYB2cjs.getTokenIcon.call(void 0, token.symbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2804
2804
|
"img",
|
|
2805
2805
|
{
|
|
2806
|
-
src:
|
|
2806
|
+
src: _chunkIVTXEYB2cjs.getTokenIcon.call(void 0, token.symbol),
|
|
2807
2807
|
alt: "",
|
|
2808
2808
|
style: { width: 16, height: 16, borderRadius: "50%" }
|
|
2809
2809
|
}
|
|
@@ -2823,10 +2823,10 @@ function SolanaConfirmStep({
|
|
|
2823
2823
|
className: "rs-card-value",
|
|
2824
2824
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
2825
2825
|
children: [
|
|
2826
|
-
|
|
2826
|
+
_chunkIVTXEYB2cjs.getTokenIcon.call(void 0, targetSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2827
2827
|
"img",
|
|
2828
2828
|
{
|
|
2829
|
-
src:
|
|
2829
|
+
src: _chunkIVTXEYB2cjs.getTokenIcon.call(void 0, targetSymbol),
|
|
2830
2830
|
alt: "",
|
|
2831
2831
|
style: { width: 16, height: 16, borderRadius: "50%" }
|
|
2832
2832
|
}
|
|
@@ -2840,12 +2840,12 @@ function SolanaConfirmStep({
|
|
|
2840
2840
|
] })
|
|
2841
2841
|
] }),
|
|
2842
2842
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-alert rs-alert--error", children: [
|
|
2843
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2843
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.AlertTriangleIcon, { className: "rs-alert-icon" }),
|
|
2844
2844
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-alert-text", children: error })
|
|
2845
2845
|
] })
|
|
2846
2846
|
] }),
|
|
2847
2847
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2848
|
-
|
|
2848
|
+
_chunkFTMCKJM4cjs.Button,
|
|
2849
2849
|
{
|
|
2850
2850
|
onClick: handleConfirm,
|
|
2851
2851
|
loading: isSubmitting,
|
|
@@ -2854,7 +2854,7 @@ function SolanaConfirmStep({
|
|
|
2854
2854
|
children: "Continue"
|
|
2855
2855
|
}
|
|
2856
2856
|
) }),
|
|
2857
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2857
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.PoweredBy, {})
|
|
2858
2858
|
] });
|
|
2859
2859
|
}
|
|
2860
2860
|
|
|
@@ -3353,7 +3353,7 @@ function DepositFlow({
|
|
|
3353
3353
|
postBridgeActions,
|
|
3354
3354
|
outputTokenRules,
|
|
3355
3355
|
rejectUnmapped,
|
|
3356
|
-
signerAddress =
|
|
3356
|
+
signerAddress = _chunkIVTXEYB2cjs.DEFAULT_SIGNER_ADDRESS,
|
|
3357
3357
|
sessionChainIds,
|
|
3358
3358
|
forceRegister = false,
|
|
3359
3359
|
waitForFinalTx = true,
|
|
@@ -3371,10 +3371,10 @@ function DepositFlow({
|
|
|
3371
3371
|
onError,
|
|
3372
3372
|
debug
|
|
3373
3373
|
}) {
|
|
3374
|
-
const onStepChangeRef =
|
|
3375
|
-
const onEventRef =
|
|
3376
|
-
const onLifecycleRef =
|
|
3377
|
-
const onErrorRef =
|
|
3374
|
+
const onStepChangeRef = _chunkFTMCKJM4cjs.useLatestRef.call(void 0, onStepChange);
|
|
3375
|
+
const onEventRef = _chunkFTMCKJM4cjs.useLatestRef.call(void 0, onEvent);
|
|
3376
|
+
const onLifecycleRef = _chunkFTMCKJM4cjs.useLatestRef.call(void 0, onLifecycle);
|
|
3377
|
+
const onErrorRef = _chunkFTMCKJM4cjs.useLatestRef.call(void 0, onError);
|
|
3378
3378
|
const hasInitialReownSession = Boolean(
|
|
3379
3379
|
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _82 => _82.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _83 => _83.address]) : _optionalChain([reownWallet, 'optionalAccess', _84 => _84.address])
|
|
3380
3380
|
);
|
|
@@ -3412,13 +3412,13 @@ function DepositFlow({
|
|
|
3412
3412
|
const stableWalletSelectionKeyRef = _react.useRef.call(void 0, null);
|
|
3413
3413
|
const logFlow = _react.useCallback.call(void 0,
|
|
3414
3414
|
(message, data) => {
|
|
3415
|
-
|
|
3415
|
+
_chunkFTMCKJM4cjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
|
|
3416
3416
|
},
|
|
3417
3417
|
[debug]
|
|
3418
3418
|
);
|
|
3419
3419
|
const logFlowError = _react.useCallback.call(void 0,
|
|
3420
3420
|
(message, error, data) => {
|
|
3421
|
-
|
|
3421
|
+
_chunkFTMCKJM4cjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
|
|
3422
3422
|
},
|
|
3423
3423
|
[debug]
|
|
3424
3424
|
);
|
|
@@ -3542,7 +3542,7 @@ function DepositFlow({
|
|
|
3542
3542
|
return {
|
|
3543
3543
|
ownerAddress: dappAddress,
|
|
3544
3544
|
walletClient: void 0,
|
|
3545
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
3545
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkFTMCKJM4cjs.getPublicClient.call(void 0, targetChain))),
|
|
3546
3546
|
switchChain: void 0
|
|
3547
3547
|
};
|
|
3548
3548
|
}
|
|
@@ -3551,7 +3551,7 @@ function DepositFlow({
|
|
|
3551
3551
|
return {
|
|
3552
3552
|
ownerAddress: dappWalletClient.account.address,
|
|
3553
3553
|
walletClient: dappWalletClient,
|
|
3554
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
3554
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkFTMCKJM4cjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
3555
3555
|
switchChain: dappSwitchChain
|
|
3556
3556
|
};
|
|
3557
3557
|
}
|
|
@@ -3565,7 +3565,7 @@ function DepositFlow({
|
|
|
3565
3565
|
return {
|
|
3566
3566
|
ownerAddress: dappAddress,
|
|
3567
3567
|
walletClient: void 0,
|
|
3568
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
3568
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkFTMCKJM4cjs.getPublicClient.call(void 0, targetChain))),
|
|
3569
3569
|
switchChain: void 0
|
|
3570
3570
|
};
|
|
3571
3571
|
}
|
|
@@ -3574,7 +3574,7 @@ function DepositFlow({
|
|
|
3574
3574
|
return {
|
|
3575
3575
|
ownerAddress: dappWalletClient.account.address,
|
|
3576
3576
|
walletClient: dappWalletClient,
|
|
3577
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
3577
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkFTMCKJM4cjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
3578
3578
|
switchChain: dappSwitchChain
|
|
3579
3579
|
};
|
|
3580
3580
|
}
|
|
@@ -3582,7 +3582,7 @@ function DepositFlow({
|
|
|
3582
3582
|
return {
|
|
3583
3583
|
ownerAddress: reownWallet.address,
|
|
3584
3584
|
walletClient: reownWallet.walletClient,
|
|
3585
|
-
publicClient: _nullishCoalesce(reownWallet.publicClient, () => (
|
|
3585
|
+
publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunkFTMCKJM4cjs.getPublicClient.call(void 0, targetChain))),
|
|
3586
3586
|
switchChain: reownWallet.switchChain
|
|
3587
3587
|
};
|
|
3588
3588
|
}
|
|
@@ -3620,7 +3620,7 @@ function DepositFlow({
|
|
|
3620
3620
|
return {
|
|
3621
3621
|
ownerAddress: dappAddress,
|
|
3622
3622
|
walletClient: void 0,
|
|
3623
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
3623
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkFTMCKJM4cjs.getPublicClient.call(void 0, targetChain))),
|
|
3624
3624
|
switchChain: void 0
|
|
3625
3625
|
};
|
|
3626
3626
|
}
|
|
@@ -3678,8 +3678,8 @@ function DepositFlow({
|
|
|
3678
3678
|
pred_balance: totalBalanceUsd
|
|
3679
3679
|
})]);
|
|
3680
3680
|
} else if (step.type === "deposit-address") {
|
|
3681
|
-
const chainName =
|
|
3682
|
-
const tokenSymbol =
|
|
3681
|
+
const chainName = _chunkIVTXEYB2cjs.getChainName.call(void 0, targetChain);
|
|
3682
|
+
const tokenSymbol = _chunkIVTXEYB2cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3683
3683
|
_optionalChain([onEventRef, 'access', _115 => _115.current, 'optionalCall', _116 => _116({
|
|
3684
3684
|
type: "deposit_modal_transfer_crypto_open",
|
|
3685
3685
|
default_chain: chainName,
|
|
@@ -3687,7 +3687,7 @@ function DepositFlow({
|
|
|
3687
3687
|
pred_balance: totalBalanceUsd
|
|
3688
3688
|
})]);
|
|
3689
3689
|
} else if (step.type === "amount" && stepSendToken) {
|
|
3690
|
-
const receiveSymbol =
|
|
3690
|
+
const receiveSymbol = _chunkIVTXEYB2cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3691
3691
|
_optionalChain([onEventRef, 'access', _117 => _117.current, 'optionalCall', _118 => _118({
|
|
3692
3692
|
type: "deposit_modal_connected_wallet_enter_value_open",
|
|
3693
3693
|
send_token: stepSendToken,
|
|
@@ -3831,8 +3831,8 @@ function DepositFlow({
|
|
|
3831
3831
|
);
|
|
3832
3832
|
const handleSolanaAmountContinue = _react.useCallback.call(void 0,
|
|
3833
3833
|
(token, sourceAmount, inputAmountUsd) => {
|
|
3834
|
-
const targetSym =
|
|
3835
|
-
const isTargetStable =
|
|
3834
|
+
const targetSym = _chunkIVTXEYB2cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3835
|
+
const isTargetStable = _chunkIVTXEYB2cjs.isStablecoinSymbol.call(void 0, targetSym);
|
|
3836
3836
|
const targetTokenPriceUsd = isTargetStable ? 1 : getTokenPriceUsd(targetSym);
|
|
3837
3837
|
logFlow("solana:amount:continue", {
|
|
3838
3838
|
token: token.symbol,
|
|
@@ -3908,8 +3908,8 @@ function DepositFlow({
|
|
|
3908
3908
|
);
|
|
3909
3909
|
const handleAmountContinue = _react.useCallback.call(void 0,
|
|
3910
3910
|
(amount, targetAmount, balance, liquidityWarning) => {
|
|
3911
|
-
const targetSym =
|
|
3912
|
-
const isTargetStable =
|
|
3911
|
+
const targetSym = _chunkIVTXEYB2cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3912
|
+
const isTargetStable = _chunkIVTXEYB2cjs.isStablecoinSymbol.call(void 0, targetSym);
|
|
3913
3913
|
const targetTokenPriceUsd = isTargetStable ? 1 : getTokenPriceUsd(targetSym);
|
|
3914
3914
|
storeApi.dispatch({
|
|
3915
3915
|
type: "amount/entered",
|
|
@@ -4058,7 +4058,7 @@ function DepositFlow({
|
|
|
4058
4058
|
]);
|
|
4059
4059
|
if (showConnectStep) {
|
|
4060
4060
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4061
|
-
|
|
4061
|
+
_chunkFTMCKJM4cjs.ConnectStep,
|
|
4062
4062
|
{
|
|
4063
4063
|
walletOptions,
|
|
4064
4064
|
onSelectTransferCrypto: dappAddress ? () => {
|
|
@@ -4122,8 +4122,8 @@ function DepositFlow({
|
|
|
4122
4122
|
onDepositComplete: handleDepositComplete,
|
|
4123
4123
|
onDepositFailed: handleDepositFailed,
|
|
4124
4124
|
onCopyAddress: () => {
|
|
4125
|
-
const chainName =
|
|
4126
|
-
const tokenSymbol =
|
|
4125
|
+
const chainName = _chunkIVTXEYB2cjs.getChainName.call(void 0, targetChain);
|
|
4126
|
+
const tokenSymbol = _chunkIVTXEYB2cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
4127
4127
|
_optionalChain([onEvent, 'optionalCall', _146 => _146({
|
|
4128
4128
|
type: "deposit_modal_transfer_crypto_cta_click",
|
|
4129
4129
|
default_chain: chainName,
|
|
@@ -4181,10 +4181,10 @@ function DepositFlow({
|
|
|
4181
4181
|
balanceUsd: step.balanceUsd,
|
|
4182
4182
|
defaultAmount: step.inputAmountUsd,
|
|
4183
4183
|
uiConfig,
|
|
4184
|
-
targetChainName:
|
|
4185
|
-
targetTokenSymbol:
|
|
4186
|
-
targetTokenIcon:
|
|
4187
|
-
|
|
4184
|
+
targetChainName: _chunkIVTXEYB2cjs.getChainName.call(void 0, targetChain),
|
|
4185
|
+
targetTokenSymbol: _chunkIVTXEYB2cjs.getTokenSymbol.call(void 0, targetToken, targetChain),
|
|
4186
|
+
targetTokenIcon: _chunkIVTXEYB2cjs.getTokenIcon.call(void 0,
|
|
4187
|
+
_chunkIVTXEYB2cjs.getTokenSymbol.call(void 0, targetToken, targetChain)
|
|
4188
4188
|
),
|
|
4189
4189
|
onContinue: handleSolanaAmountContinue,
|
|
4190
4190
|
debug
|
|
@@ -4244,7 +4244,7 @@ function DepositFlow({
|
|
|
4244
4244
|
) })
|
|
4245
4245
|
] }) : null,
|
|
4246
4246
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4247
|
-
|
|
4247
|
+
_chunkFTMCKJM4cjs.ProcessingStep,
|
|
4248
4248
|
{
|
|
4249
4249
|
smartAccount: step.smartAccount,
|
|
4250
4250
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
@@ -4279,7 +4279,7 @@ function DepositFlow({
|
|
|
4279
4279
|
if (_optionalChain([signerContext, 'access', _158 => _158.publicClient, 'access', _159 => _159.chain, 'optionalAccess', _160 => _160.id]) === chainId) {
|
|
4280
4280
|
return signerContext.publicClient;
|
|
4281
4281
|
}
|
|
4282
|
-
return
|
|
4282
|
+
return _chunkFTMCKJM4cjs.getPublicClient.call(void 0, chainId);
|
|
4283
4283
|
};
|
|
4284
4284
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
4285
4285
|
step.type === "setup" && !cachedSetupCompatible && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -4336,7 +4336,7 @@ function DepositFlow({
|
|
|
4336
4336
|
service,
|
|
4337
4337
|
onContinue: handleAmountContinue,
|
|
4338
4338
|
onCtaClick: (ctaName) => {
|
|
4339
|
-
const receiveSymbol =
|
|
4339
|
+
const receiveSymbol = _chunkIVTXEYB2cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
4340
4340
|
_optionalChain([onEvent, 'optionalCall', _161 => _161({
|
|
4341
4341
|
type: "deposit_modal_connected_wallet_enter_value_cta_click",
|
|
4342
4342
|
send_token: step.asset.symbol,
|
|
@@ -4370,7 +4370,7 @@ function DepositFlow({
|
|
|
4370
4370
|
}
|
|
4371
4371
|
),
|
|
4372
4372
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4373
|
-
|
|
4373
|
+
_chunkFTMCKJM4cjs.ProcessingStep,
|
|
4374
4374
|
{
|
|
4375
4375
|
smartAccount: step.smartAccount,
|
|
4376
4376
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
@@ -4422,8 +4422,8 @@ function formatDate(iso) {
|
|
|
4422
4422
|
function resolveChainId(value) {
|
|
4423
4423
|
if (value === void 0 || value === null) return null;
|
|
4424
4424
|
if (typeof value === "number") return value;
|
|
4425
|
-
if (
|
|
4426
|
-
const parsed =
|
|
4425
|
+
if (_chunkFTMCKJM4cjs.isSolanaCaip2.call(void 0, value) || value === "solana") return "solana";
|
|
4426
|
+
const parsed = _chunkFTMCKJM4cjs.parseEvmChainId.call(void 0, value);
|
|
4427
4427
|
if (parsed !== null) return parsed;
|
|
4428
4428
|
const num = Number(value);
|
|
4429
4429
|
return Number.isFinite(num) ? num : null;
|
|
@@ -4441,7 +4441,7 @@ function resolveTokenSymbol(token, chainId) {
|
|
|
4441
4441
|
}
|
|
4442
4442
|
}
|
|
4443
4443
|
if (chainId !== null && chainId !== void 0 && chainId !== "solana" && /^0x[a-fA-F0-9]{40}$/.test(token)) {
|
|
4444
|
-
const sym =
|
|
4444
|
+
const sym = _chunkIVTXEYB2cjs.getTokenSymbol.call(void 0, token, chainId);
|
|
4445
4445
|
if (sym !== "Token") return sym;
|
|
4446
4446
|
}
|
|
4447
4447
|
return shortenHash(token);
|
|
@@ -4461,7 +4461,7 @@ function formatAmount(rawAmount, token, chainId) {
|
|
|
4461
4461
|
decimals = 9;
|
|
4462
4462
|
}
|
|
4463
4463
|
} else if (/^0x[a-fA-F0-9]{40}$/.test(token)) {
|
|
4464
|
-
decimals =
|
|
4464
|
+
decimals = _chunkIVTXEYB2cjs.getTokenDecimalsByAddress.call(void 0, token, chainId);
|
|
4465
4465
|
}
|
|
4466
4466
|
}
|
|
4467
4467
|
try {
|
|
@@ -4480,7 +4480,7 @@ function formatAmount(rawAmount, token, chainId) {
|
|
|
4480
4480
|
}
|
|
4481
4481
|
function getTxExplorerUrl(txHash, chainId) {
|
|
4482
4482
|
if (!chainId) return null;
|
|
4483
|
-
const base =
|
|
4483
|
+
const base = _chunkIVTXEYB2cjs.getExplorerUrl.call(void 0, chainId);
|
|
4484
4484
|
if (!base) return null;
|
|
4485
4485
|
return `${base}/tx/${txHash}`;
|
|
4486
4486
|
}
|
|
@@ -4537,7 +4537,7 @@ function DepositHistoryPanel({
|
|
|
4537
4537
|
className: "rs-modal-header-back",
|
|
4538
4538
|
"aria-label": "Back",
|
|
4539
4539
|
onClick: onClose,
|
|
4540
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4540
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.ChevronLeftIcon, {})
|
|
4541
4541
|
}
|
|
4542
4542
|
) }),
|
|
4543
4543
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-center" }),
|
|
@@ -4548,29 +4548,29 @@ function DepositHistoryPanel({
|
|
|
4548
4548
|
className: "rs-modal-close",
|
|
4549
4549
|
"aria-label": "Close",
|
|
4550
4550
|
onClick: onCloseModal,
|
|
4551
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4551
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.CloseIcon, {})
|
|
4552
4552
|
}
|
|
4553
4553
|
) })
|
|
4554
4554
|
] }),
|
|
4555
4555
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen", children: [
|
|
4556
4556
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen-body", children: [
|
|
4557
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4557
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.HistoryIcon, {}), title: "History" }),
|
|
4558
4558
|
isLoading && deposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
4559
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4559
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.HistoryIcon, {}) }),
|
|
4560
4560
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
4561
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4561
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.Spinner, { className: "rs-spinner--sm" }),
|
|
4562
4562
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Loading history\u2026" })
|
|
4563
4563
|
] })
|
|
4564
4564
|
] }),
|
|
4565
4565
|
error && !isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
4566
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4566
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.AlertTriangleIcon, {}) }),
|
|
4567
4567
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
4568
4568
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "Couldn't load history" }),
|
|
4569
4569
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: error })
|
|
4570
4570
|
] })
|
|
4571
4571
|
] }),
|
|
4572
4572
|
!isLoading && !error && deposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
4573
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4573
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.HistoryIcon, {}) }),
|
|
4574
4574
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
4575
4575
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "No deposits yet" }),
|
|
4576
4576
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Your deposit history will appear here" })
|
|
@@ -4590,7 +4590,7 @@ function DepositHistoryPanel({
|
|
|
4590
4590
|
)
|
|
4591
4591
|
] })
|
|
4592
4592
|
] }),
|
|
4593
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4593
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.PoweredBy, {})
|
|
4594
4594
|
] })
|
|
4595
4595
|
]
|
|
4596
4596
|
}
|
|
@@ -4601,12 +4601,12 @@ function HistoryCard({ deposit }) {
|
|
|
4601
4601
|
const status = normalizeStatus(deposit.status, deposit.isSpam);
|
|
4602
4602
|
const sourceChainId = resolveChainId(deposit.chain);
|
|
4603
4603
|
const targetChainId = resolveChainId(deposit.targetChain);
|
|
4604
|
-
const sourceChainName = sourceChainId ?
|
|
4605
|
-
const targetChainName = targetChainId ?
|
|
4606
|
-
const sourceChainIcon = sourceChainId ?
|
|
4607
|
-
const targetChainIcon = targetChainId ?
|
|
4604
|
+
const sourceChainName = sourceChainId ? _chunkIVTXEYB2cjs.getChainName.call(void 0, sourceChainId) : null;
|
|
4605
|
+
const targetChainName = targetChainId ? _chunkIVTXEYB2cjs.getChainName.call(void 0, targetChainId) : null;
|
|
4606
|
+
const sourceChainIcon = sourceChainId ? _chunkIVTXEYB2cjs.getChainIcon.call(void 0, sourceChainId) : void 0;
|
|
4607
|
+
const targetChainIcon = targetChainId ? _chunkIVTXEYB2cjs.getChainIcon.call(void 0, targetChainId) : void 0;
|
|
4608
4608
|
const sourceSymbol = resolveTokenSymbol(deposit.token, sourceChainId);
|
|
4609
|
-
const sourceTokenIcon = sourceSymbol ?
|
|
4609
|
+
const sourceTokenIcon = sourceSymbol ? _chunkIVTXEYB2cjs.getTokenIcon.call(void 0, sourceSymbol) : void 0;
|
|
4610
4610
|
const rawAmount = _nullishCoalesce(deposit.sourceAmount, () => ( deposit.amount));
|
|
4611
4611
|
const formattedAmount = rawAmount ? formatAmount(rawAmount, deposit.token, sourceChainId) : null;
|
|
4612
4612
|
const displayAmount = formattedAmount ? sourceSymbol && /^USD/.test(sourceSymbol) ? `$${Number(formattedAmount).toLocaleString("en-US", {
|
|
@@ -4664,7 +4664,7 @@ function HistoryCard({ deposit }) {
|
|
|
4664
4664
|
onClick: (e) => e.stopPropagation(),
|
|
4665
4665
|
children: [
|
|
4666
4666
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: shortenHash(deposit.sourceTxHash) }),
|
|
4667
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4667
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.ArrowRightIcon, {})
|
|
4668
4668
|
]
|
|
4669
4669
|
}
|
|
4670
4670
|
)
|
|
@@ -4679,7 +4679,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
|
4679
4679
|
// src/DepositModal.tsx
|
|
4680
4680
|
|
|
4681
4681
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
4682
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
4682
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-B2XLFH4Z.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
4683
4683
|
);
|
|
4684
4684
|
function sortByCreatedAtDesc(items) {
|
|
4685
4685
|
return [...items].sort((a, b) => {
|
|
@@ -4727,9 +4727,9 @@ function DepositModalInner({
|
|
|
4727
4727
|
sourceToken,
|
|
4728
4728
|
defaultAmount,
|
|
4729
4729
|
recipient,
|
|
4730
|
-
backendUrl =
|
|
4730
|
+
backendUrl = _chunkIVTXEYB2cjs.DEFAULT_BACKEND_URL,
|
|
4731
4731
|
solanaRpcUrl,
|
|
4732
|
-
signerAddress =
|
|
4732
|
+
signerAddress = _chunkIVTXEYB2cjs.DEFAULT_SIGNER_ADDRESS,
|
|
4733
4733
|
sessionChainIds,
|
|
4734
4734
|
forceRegister = false,
|
|
4735
4735
|
waitForFinalTx = true,
|
|
@@ -4752,31 +4752,26 @@ function DepositModalInner({
|
|
|
4752
4752
|
debug
|
|
4753
4753
|
}) {
|
|
4754
4754
|
const modalRef = _react.useRef.call(void 0, null);
|
|
4755
|
-
const onReadyRef =
|
|
4755
|
+
const onReadyRef = _chunkFTMCKJM4cjs.useLatestRef.call(void 0, onReady);
|
|
4756
4756
|
const [currentScreen, setCurrentScreen] = _react.useState.call(void 0, "connect");
|
|
4757
4757
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
4758
4758
|
void 0
|
|
4759
4759
|
);
|
|
4760
4760
|
const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _163 => _163.showHistoryButton]), () => ( false));
|
|
4761
|
-
const historyButtonVisible = showHistoryButton && (currentScreen === "
|
|
4762
|
-
const [activeEvmAccount, setActiveEvmAccount] = _react.useState.call(void 0, null);
|
|
4763
|
-
const [activeSolanaAccount, setActiveSolanaAccount] = _react.useState.call(void 0,
|
|
4764
|
-
null
|
|
4765
|
-
);
|
|
4761
|
+
const historyButtonVisible = showHistoryButton && (currentScreen === "select-asset" || currentScreen === "deposit-address");
|
|
4766
4762
|
const [historyOpen, setHistoryOpen] = _react.useState.call(void 0, false);
|
|
4767
4763
|
const [historyDeposits, setHistoryDeposits] = _react.useState.call(void 0, []);
|
|
4768
4764
|
const [hasMoreHistory, setHasMoreHistory] = _react.useState.call(void 0, false);
|
|
4769
4765
|
const [historyLoading, setHistoryLoading] = _react.useState.call(void 0, false);
|
|
4770
4766
|
const [historyLoadingMore, setHistoryLoadingMore] = _react.useState.call(void 0, false);
|
|
4771
4767
|
const [historyError, setHistoryError] = _react.useState.call(void 0, null);
|
|
4772
|
-
const
|
|
4773
|
-
const solanaCursorRef = _react.useRef.call(void 0, null);
|
|
4768
|
+
const cursorRef = _react.useRef.call(void 0, null);
|
|
4774
4769
|
const historyStaleRef = _react.useRef.call(void 0, false);
|
|
4775
4770
|
const historyLoadedRef = _react.useRef.call(void 0, false);
|
|
4776
|
-
const targetChain =
|
|
4777
|
-
const sourceChain = sourceChainProp ?
|
|
4771
|
+
const targetChain = _chunkIVTXEYB2cjs.getChainId.call(void 0, targetChainProp);
|
|
4772
|
+
const sourceChain = sourceChainProp ? _chunkIVTXEYB2cjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
4778
4773
|
const service = _react.useMemo.call(void 0,
|
|
4779
|
-
() =>
|
|
4774
|
+
() => _chunkFTMCKJM4cjs.createDepositService.call(void 0, backendUrl, {
|
|
4780
4775
|
debug,
|
|
4781
4776
|
debugScope: "service:deposit"
|
|
4782
4777
|
}),
|
|
@@ -4792,7 +4787,7 @@ function DepositModalInner({
|
|
|
4792
4787
|
}, [store, targetChain, targetToken]);
|
|
4793
4788
|
_react.useEffect.call(void 0, () => {
|
|
4794
4789
|
if (isOpen && modalRef.current) {
|
|
4795
|
-
|
|
4790
|
+
_chunkFTMCKJM4cjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
4796
4791
|
}
|
|
4797
4792
|
}, [isOpen, theme]);
|
|
4798
4793
|
_react.useEffect.call(void 0, () => {
|
|
@@ -4812,7 +4807,7 @@ function DepositModalInner({
|
|
|
4812
4807
|
);
|
|
4813
4808
|
const fetchHistory = _react.useCallback.call(void 0,
|
|
4814
4809
|
async (mode = "initial") => {
|
|
4815
|
-
if (!
|
|
4810
|
+
if (!recipient) return;
|
|
4816
4811
|
const isInitial = mode === "initial";
|
|
4817
4812
|
if (isInitial) {
|
|
4818
4813
|
setHistoryLoading(true);
|
|
@@ -4821,44 +4816,18 @@ function DepositModalInner({
|
|
|
4821
4816
|
}
|
|
4822
4817
|
setHistoryError(null);
|
|
4823
4818
|
try {
|
|
4824
|
-
const
|
|
4825
|
-
|
|
4826
|
-
|
|
4827
|
-
|
|
4828
|
-
requests.push(
|
|
4829
|
-
service.fetchDepositHistory({
|
|
4830
|
-
account: activeEvmAccount,
|
|
4831
|
-
limit: 20,
|
|
4832
|
-
cursor: _nullishCoalesce(evmCursor, () => ( void 0))
|
|
4833
|
-
}).then((r) => ({
|
|
4834
|
-
deposits: r.deposits,
|
|
4835
|
-
nextCursor: _nullishCoalesce(r.nextCursor, () => ( null)),
|
|
4836
|
-
source: "evm"
|
|
4837
|
-
}))
|
|
4838
|
-
);
|
|
4839
|
-
}
|
|
4840
|
-
if (activeSolanaAccount && (isInitial || solanaCursor)) {
|
|
4841
|
-
requests.push(
|
|
4842
|
-
service.fetchDepositHistory({
|
|
4843
|
-
account: activeSolanaAccount,
|
|
4844
|
-
limit: 20,
|
|
4845
|
-
cursor: _nullishCoalesce(solanaCursor, () => ( void 0))
|
|
4846
|
-
}).then((r) => ({
|
|
4847
|
-
deposits: r.deposits,
|
|
4848
|
-
nextCursor: _nullishCoalesce(r.nextCursor, () => ( null)),
|
|
4849
|
-
source: "solana"
|
|
4850
|
-
}))
|
|
4851
|
-
);
|
|
4852
|
-
}
|
|
4853
|
-
const results = await Promise.all(requests);
|
|
4854
|
-
let nextEvm = isInitial ? null : evmCursor;
|
|
4855
|
-
let nextSolana = isInitial ? null : solanaCursor;
|
|
4856
|
-
const incoming = [];
|
|
4857
|
-
for (const r of results) {
|
|
4858
|
-
incoming.push(...r.deposits);
|
|
4859
|
-
if (r.source === "evm") nextEvm = r.nextCursor;
|
|
4860
|
-
else nextSolana = r.nextCursor;
|
|
4819
|
+
const cursor = isInitial ? null : cursorRef.current;
|
|
4820
|
+
if (!isInitial && !cursor) {
|
|
4821
|
+
setHasMoreHistory(false);
|
|
4822
|
+
return;
|
|
4861
4823
|
}
|
|
4824
|
+
const result = await service.fetchDepositHistory({
|
|
4825
|
+
recipient,
|
|
4826
|
+
limit: 20,
|
|
4827
|
+
cursor: _nullishCoalesce(cursor, () => ( void 0))
|
|
4828
|
+
});
|
|
4829
|
+
const incoming = result.deposits;
|
|
4830
|
+
const nextCursor = _nullishCoalesce(result.nextCursor, () => ( null));
|
|
4862
4831
|
if (isInitial) {
|
|
4863
4832
|
setHistoryDeposits(sortByCreatedAtDesc(incoming));
|
|
4864
4833
|
} else {
|
|
@@ -4866,9 +4835,8 @@ function DepositModalInner({
|
|
|
4866
4835
|
(prev) => sortByCreatedAtDesc([...prev, ...incoming])
|
|
4867
4836
|
);
|
|
4868
4837
|
}
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
setHasMoreHistory(Boolean(nextEvm || nextSolana));
|
|
4838
|
+
cursorRef.current = nextCursor;
|
|
4839
|
+
setHasMoreHistory(Boolean(nextCursor));
|
|
4872
4840
|
historyStaleRef.current = false;
|
|
4873
4841
|
historyLoadedRef.current = true;
|
|
4874
4842
|
} catch (err) {
|
|
@@ -4883,7 +4851,7 @@ function DepositModalInner({
|
|
|
4883
4851
|
}
|
|
4884
4852
|
}
|
|
4885
4853
|
},
|
|
4886
|
-
[
|
|
4854
|
+
[recipient, service]
|
|
4887
4855
|
);
|
|
4888
4856
|
const handleHistoryOpen = _react.useCallback.call(void 0, () => {
|
|
4889
4857
|
setHistoryOpen(true);
|
|
@@ -4903,16 +4871,12 @@ function DepositModalInner({
|
|
|
4903
4871
|
fetchHistory("initial");
|
|
4904
4872
|
}
|
|
4905
4873
|
}, [historyOpen, fetchHistory]);
|
|
4906
|
-
const onLifecycleRef =
|
|
4874
|
+
const onLifecycleRef = _chunkFTMCKJM4cjs.useLatestRef.call(void 0, onLifecycle);
|
|
4907
4875
|
const handleLifecycle = _react.useCallback.call(void 0,
|
|
4908
4876
|
(event) => {
|
|
4909
4877
|
_optionalChain([onLifecycleRef, 'access', _166 => _166.current, 'optionalCall', _167 => _167(event)]);
|
|
4910
|
-
if (event.type === "smart-account-changed") {
|
|
4911
|
-
|
|
4912
|
-
setActiveSolanaAccount(event.solana);
|
|
4913
|
-
if (!event.evm && !event.solana) {
|
|
4914
|
-
historyStaleRef.current = true;
|
|
4915
|
-
}
|
|
4878
|
+
if (event.type === "smart-account-changed" && !event.evm && !event.solana) {
|
|
4879
|
+
historyStaleRef.current = true;
|
|
4916
4880
|
}
|
|
4917
4881
|
if (showHistoryButton && (event.type === "submitted" || event.type === "complete" || event.type === "failed")) {
|
|
4918
4882
|
markHistoryStale();
|
|
@@ -4926,10 +4890,7 @@ function DepositModalInner({
|
|
|
4926
4890
|
setHistoryDeposits([]);
|
|
4927
4891
|
setHasMoreHistory(false);
|
|
4928
4892
|
setHistoryError(null);
|
|
4929
|
-
|
|
4930
|
-
setActiveSolanaAccount(null);
|
|
4931
|
-
evmCursorRef.current = null;
|
|
4932
|
-
solanaCursorRef.current = null;
|
|
4893
|
+
cursorRef.current = null;
|
|
4933
4894
|
historyStaleRef.current = false;
|
|
4934
4895
|
historyLoadedRef.current = false;
|
|
4935
4896
|
}
|
|
@@ -4942,7 +4903,7 @@ function DepositModalInner({
|
|
|
4942
4903
|
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _168 => _168.showBackButton]), () => ( true));
|
|
4943
4904
|
const canGoBack = backHandler !== void 0;
|
|
4944
4905
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4945
|
-
|
|
4906
|
+
_chunkFTMCKJM4cjs.Modal,
|
|
4946
4907
|
{
|
|
4947
4908
|
isOpen,
|
|
4948
4909
|
onClose,
|
|
@@ -4958,7 +4919,7 @@ function DepositModalInner({
|
|
|
4958
4919
|
className: "rs-modal-header-back",
|
|
4959
4920
|
"aria-label": "Go back",
|
|
4960
4921
|
onClick: backHandler,
|
|
4961
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4922
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.ChevronLeftIcon, {})
|
|
4962
4923
|
}
|
|
4963
4924
|
) }),
|
|
4964
4925
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
|
|
@@ -4969,8 +4930,8 @@ function DepositModalInner({
|
|
|
4969
4930
|
className: "rs-modal-header-history",
|
|
4970
4931
|
"aria-label": "Deposit history",
|
|
4971
4932
|
onClick: handleHistoryOpen,
|
|
4972
|
-
disabled: !
|
|
4973
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4933
|
+
disabled: !recipient,
|
|
4934
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.HistoryIcon, {})
|
|
4974
4935
|
}
|
|
4975
4936
|
),
|
|
4976
4937
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -4980,7 +4941,7 @@ function DepositModalInner({
|
|
|
4980
4941
|
onClick: onClose,
|
|
4981
4942
|
className: "rs-modal-close",
|
|
4982
4943
|
"aria-label": "Close",
|
|
4983
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4944
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFTMCKJM4cjs.CloseIcon, {})
|
|
4984
4945
|
}
|
|
4985
4946
|
)
|
|
4986
4947
|
] })
|