@rhinestone/deposit-modal 0.1.30 → 0.1.31
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-ZD3ROLZG.cjs → DepositModalReown-N7GCYZF7.cjs} +7 -7
- package/dist/{DepositModalReown-OHTRNISJ.mjs → DepositModalReown-S7HER5HU.mjs} +4 -4
- package/dist/{WithdrawModalReown-SVZQKH2X.cjs → WithdrawModalReown-DJCJ5U7E.cjs} +7 -7
- package/dist/{WithdrawModalReown-IJAMIPSY.mjs → WithdrawModalReown-DMDRLYTE.mjs} +4 -4
- package/dist/{chunk-VL47TLTE.mjs → chunk-3ICS43XC.mjs} +9 -8
- package/dist/{chunk-BOKLFGNS.mjs → chunk-AWFJFSPH.mjs} +76 -36
- package/dist/{chunk-LBEP3A2Z.mjs → chunk-CS6UIMCF.mjs} +3 -1
- package/dist/{chunk-CIAKCO7G.mjs → chunk-EVU7M7A6.mjs} +55 -23
- package/dist/{chunk-KIRDZLOS.cjs → chunk-G2RDCQHL.cjs} +80 -48
- package/dist/{chunk-WDDONQLV.cjs → chunk-MU2BOEDN.cjs} +204 -164
- package/dist/{chunk-WB3ZJJBH.cjs → chunk-PE6OK3FH.cjs} +9 -8
- package/dist/{chunk-S76PY7GZ.mjs → chunk-SLI5FHTT.mjs} +9 -9
- package/dist/{chunk-K4YSUWIT.cjs → chunk-SZ35G2DT.cjs} +59 -59
- package/dist/{chunk-6VJ2ZTNQ.cjs → chunk-VKQA3FO3.cjs} +2 -0
- package/dist/constants.cjs +2 -2
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +4 -4
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +3 -3
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +4 -4
- package/dist/reown.cjs +5 -5
- package/dist/reown.d.cts +1 -1
- package/dist/reown.d.ts +1 -1
- package/dist/reown.mjs +4 -4
- package/dist/styles.css +8 -5
- package/dist/{types-BwaQ7jK5.d.cts → types-DELv717e.d.cts} +5 -1
- package/dist/{types-CgXyx46m.d.ts → types-DTBfMH0p.d.ts} +5 -1
- package/dist/withdraw.cjs +4 -4
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +3 -3
- package/package.json +1 -1
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _chunkG2RDCQHLcjs = require('./chunk-G2RDCQHL.cjs');
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
@@ -36,7 +36,7 @@ var _chunkKIRDZLOScjs = require('./chunk-KIRDZLOS.cjs');
|
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
|
|
39
|
-
var
|
|
39
|
+
var _chunkPE6OK3FHcjs = require('./chunk-PE6OK3FH.cjs');
|
|
40
40
|
|
|
41
41
|
// src/DepositModal.tsx
|
|
42
42
|
|
|
@@ -56,15 +56,15 @@ var _react = require('react');
|
|
|
56
56
|
|
|
57
57
|
var _jsxruntime = require('react/jsx-runtime');
|
|
58
58
|
async function resolveSessionOwner(eoaAddress) {
|
|
59
|
-
const localOwner =
|
|
59
|
+
const localOwner = _chunkG2RDCQHLcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
60
60
|
if (localOwner) {
|
|
61
61
|
return {
|
|
62
|
-
account:
|
|
62
|
+
account: _chunkG2RDCQHLcjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
63
63
|
address: localOwner.address
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
const created =
|
|
67
|
-
|
|
66
|
+
const created = _chunkG2RDCQHLcjs.createSessionOwnerKey.call(void 0, );
|
|
67
|
+
_chunkG2RDCQHLcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
68
68
|
return {
|
|
69
69
|
account: created.account,
|
|
70
70
|
address: created.address
|
|
@@ -126,7 +126,7 @@ function SetupStep({
|
|
|
126
126
|
primaryType: typedData.primaryType,
|
|
127
127
|
message: typedData.message
|
|
128
128
|
});
|
|
129
|
-
const sessionDetails =
|
|
129
|
+
const sessionDetails = _chunkG2RDCQHLcjs.buildSessionDetails.call(void 0, setup.sessionDetailsUnsigned, signature);
|
|
130
130
|
setState({ type: "registering" });
|
|
131
131
|
await service.registerAccount({
|
|
132
132
|
address: smartAccount,
|
|
@@ -197,7 +197,7 @@ function SetupStep({
|
|
|
197
197
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
198
198
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", children: [
|
|
199
199
|
isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
200
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
200
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkG2RDCQHLcjs.Spinner, { className: "rs-spinner--lg rs-text-accent" }),
|
|
201
201
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-text", children: [
|
|
202
202
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-title", children: renderStateMessage() }),
|
|
203
203
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-subtitle", children: "This may take a moment" })
|
|
@@ -234,7 +234,7 @@ function SetupStep({
|
|
|
234
234
|
] })
|
|
235
235
|
] })
|
|
236
236
|
] }),
|
|
237
|
-
isError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
237
|
+
isError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkG2RDCQHLcjs.Button, { onClick: handleRetry, variant: "default", fullWidth: true, children: "Try Again" }) })
|
|
238
238
|
] });
|
|
239
239
|
}
|
|
240
240
|
|
|
@@ -257,7 +257,7 @@ function AssetSelectStep({
|
|
|
257
257
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
258
258
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
259
259
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
260
|
-
return
|
|
260
|
+
return _chunkG2RDCQHLcjs.getAssetId.call(void 0, {
|
|
261
261
|
chainId: defaultSourceChain,
|
|
262
262
|
token: defaultSourceToken
|
|
263
263
|
});
|
|
@@ -274,10 +274,10 @@ function AssetSelectStep({
|
|
|
274
274
|
try {
|
|
275
275
|
const portfolio = await service.fetchPortfolio(address);
|
|
276
276
|
if (!active) return;
|
|
277
|
-
const portfolioAssets =
|
|
277
|
+
const portfolioAssets = _chunkG2RDCQHLcjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
278
278
|
setAssets(portfolioAssets);
|
|
279
279
|
const hasNative = portfolioAssets.some(
|
|
280
|
-
(asset) => asset.token.toLowerCase() ===
|
|
280
|
+
(asset) => asset.token.toLowerCase() === _chunkPE6OK3FHcjs.NATIVE_TOKEN_ADDRESS
|
|
281
281
|
);
|
|
282
282
|
if (!hasNative) {
|
|
283
283
|
const nativeAssets = await fetchNativeAssets(
|
|
@@ -342,7 +342,7 @@ function AssetSelectStep({
|
|
|
342
342
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
343
343
|
const numeric = Number(raw);
|
|
344
344
|
if (!Number.isFinite(numeric)) return raw;
|
|
345
|
-
return
|
|
345
|
+
return _chunkG2RDCQHLcjs.tokenFormatter.format(numeric);
|
|
346
346
|
} catch (e3) {
|
|
347
347
|
return asset.balance;
|
|
348
348
|
}
|
|
@@ -356,7 +356,7 @@ function AssetSelectStep({
|
|
|
356
356
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
357
357
|
children: [
|
|
358
358
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
359
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
359
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkG2RDCQHLcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
360
360
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
361
361
|
] }),
|
|
362
362
|
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 }) }),
|
|
@@ -389,9 +389,9 @@ function AssetSelectStep({
|
|
|
389
389
|
!loading && !error && rows.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: rows.map((asset) => {
|
|
390
390
|
const isSelected = selectedAssetId === asset.id;
|
|
391
391
|
const tokenAmount = formatBalance(asset);
|
|
392
|
-
const badge =
|
|
393
|
-
const tokenIcon =
|
|
394
|
-
const chainIcon =
|
|
392
|
+
const badge = _chunkPE6OK3FHcjs.getChainBadge.call(void 0, asset.chainId);
|
|
393
|
+
const tokenIcon = _chunkPE6OK3FHcjs.getTokenIcon.call(void 0, asset.symbol);
|
|
394
|
+
const chainIcon = _chunkPE6OK3FHcjs.getChainIcon.call(void 0, asset.chainId);
|
|
395
395
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
396
396
|
"button",
|
|
397
397
|
{
|
|
@@ -415,7 +415,7 @@ function AssetSelectStep({
|
|
|
415
415
|
"img",
|
|
416
416
|
{
|
|
417
417
|
src: chainIcon,
|
|
418
|
-
alt:
|
|
418
|
+
alt: _chunkPE6OK3FHcjs.getChainName.call(void 0, asset.chainId),
|
|
419
419
|
className: "rs-asset-chain-badge"
|
|
420
420
|
}
|
|
421
421
|
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -436,7 +436,7 @@ function AssetSelectStep({
|
|
|
436
436
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-asset-chain", children: [
|
|
437
437
|
" ",
|
|
438
438
|
"on ",
|
|
439
|
-
|
|
439
|
+
_chunkPE6OK3FHcjs.getChainName.call(void 0, asset.chainId)
|
|
440
440
|
] })
|
|
441
441
|
] }),
|
|
442
442
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-balance-small", children: [
|
|
@@ -446,7 +446,7 @@ function AssetSelectStep({
|
|
|
446
446
|
] })
|
|
447
447
|
] })
|
|
448
448
|
] }),
|
|
449
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ?
|
|
449
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunkG2RDCQHLcjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
450
450
|
]
|
|
451
451
|
},
|
|
452
452
|
asset.id
|
|
@@ -456,7 +456,7 @@ function AssetSelectStep({
|
|
|
456
456
|
}
|
|
457
457
|
),
|
|
458
458
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
459
|
-
|
|
459
|
+
_chunkG2RDCQHLcjs.Button,
|
|
460
460
|
{
|
|
461
461
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
462
462
|
disabled: !selectedAsset,
|
|
@@ -464,17 +464,17 @@ function AssetSelectStep({
|
|
|
464
464
|
children: "Continue"
|
|
465
465
|
}
|
|
466
466
|
) }),
|
|
467
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
467
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkG2RDCQHLcjs.PoweredBy, {})
|
|
468
468
|
] });
|
|
469
469
|
}
|
|
470
470
|
async function fetchNativeAssets(address, publicClient, existing) {
|
|
471
471
|
const existingIds = new Set(existing.map((asset) => asset.id));
|
|
472
472
|
const connectedChainId = _optionalChain([publicClient, 'access', _5 => _5.chain, 'optionalAccess', _6 => _6.id]);
|
|
473
473
|
if (!connectedChainId) return [];
|
|
474
|
-
if (!
|
|
475
|
-
const id =
|
|
474
|
+
if (!_chunkPE6OK3FHcjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
|
|
475
|
+
const id = _chunkG2RDCQHLcjs.getAssetId.call(void 0, {
|
|
476
476
|
chainId: connectedChainId,
|
|
477
|
-
token:
|
|
477
|
+
token: _chunkPE6OK3FHcjs.NATIVE_TOKEN_ADDRESS
|
|
478
478
|
});
|
|
479
479
|
if (existingIds.has(id)) return [];
|
|
480
480
|
try {
|
|
@@ -483,7 +483,7 @@ async function fetchNativeAssets(address, publicClient, existing) {
|
|
|
483
483
|
{
|
|
484
484
|
id,
|
|
485
485
|
chainId: connectedChainId,
|
|
486
|
-
token:
|
|
486
|
+
token: _chunkPE6OK3FHcjs.NATIVE_TOKEN_ADDRESS,
|
|
487
487
|
symbol: "ETH",
|
|
488
488
|
name: "Ethereum",
|
|
489
489
|
decimals: 18,
|
|
@@ -556,7 +556,7 @@ function AmountStep({
|
|
|
556
556
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
557
557
|
if (!balanceTarget || !publicClient) return;
|
|
558
558
|
try {
|
|
559
|
-
const bal =
|
|
559
|
+
const bal = _chunkG2RDCQHLcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
560
560
|
address: asset.token,
|
|
561
561
|
abi: _viem.erc20Abi,
|
|
562
562
|
functionName: "balanceOf",
|
|
@@ -620,7 +620,7 @@ function AmountStep({
|
|
|
620
620
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
621
621
|
const numeric = Number(raw);
|
|
622
622
|
if (!Number.isFinite(numeric)) return raw;
|
|
623
|
-
return
|
|
623
|
+
return _chunkG2RDCQHLcjs.tokenFormatter.format(numeric);
|
|
624
624
|
} catch (e8) {
|
|
625
625
|
return "...";
|
|
626
626
|
}
|
|
@@ -637,9 +637,9 @@ function AmountStep({
|
|
|
637
637
|
}, [amount, tokenPriceUsd, hasPricing]);
|
|
638
638
|
const formattedTokenAmount = _react.useMemo.call(void 0, () => {
|
|
639
639
|
if (tokenAmount === null) return "0.00";
|
|
640
|
-
return
|
|
640
|
+
return _chunkG2RDCQHLcjs.tokenFormatter.format(tokenAmount);
|
|
641
641
|
}, [tokenAmount]);
|
|
642
|
-
const targetSymbol =
|
|
642
|
+
const targetSymbol = _chunkPE6OK3FHcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
643
643
|
const handlePresetClick = (percentage) => {
|
|
644
644
|
if (balance === null) return;
|
|
645
645
|
if (hasPricing && balanceUsd !== null) {
|
|
@@ -668,13 +668,13 @@ function AmountStep({
|
|
|
668
668
|
if (hasPricing) {
|
|
669
669
|
if (_optionalChain([uiConfig, 'optionalAccess', _10 => _10.maxDepositUsd]) && numericAmount > uiConfig.maxDepositUsd) {
|
|
670
670
|
setError(
|
|
671
|
-
`Maximum deposit is ${
|
|
671
|
+
`Maximum deposit is ${_chunkG2RDCQHLcjs.currencyFormatter.format(uiConfig.maxDepositUsd)}`
|
|
672
672
|
);
|
|
673
673
|
return;
|
|
674
674
|
}
|
|
675
675
|
if (_optionalChain([uiConfig, 'optionalAccess', _11 => _11.minDepositUsd]) && numericAmount < uiConfig.minDepositUsd) {
|
|
676
676
|
setError(
|
|
677
|
-
`Minimum deposit is ${
|
|
677
|
+
`Minimum deposit is ${_chunkG2RDCQHLcjs.currencyFormatter.format(uiConfig.minDepositUsd)}`
|
|
678
678
|
);
|
|
679
679
|
return;
|
|
680
680
|
}
|
|
@@ -690,8 +690,8 @@ function AmountStep({
|
|
|
690
690
|
return;
|
|
691
691
|
}
|
|
692
692
|
if (balance !== null && amountInUnits > balance) {
|
|
693
|
-
|
|
694
|
-
|
|
693
|
+
setError("Insufficient balance");
|
|
694
|
+
return;
|
|
695
695
|
}
|
|
696
696
|
setError(null);
|
|
697
697
|
onContinue(tokenAmountStr, _nullishCoalesce(balance, () => ( void 0)));
|
|
@@ -746,23 +746,32 @@ function AmountStep({
|
|
|
746
746
|
autoFocus: true
|
|
747
747
|
}
|
|
748
748
|
) }),
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
asset.symbol
|
|
753
|
-
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-amount-token-value", style: { color: "var(--rs-muted-foreground)" }, children: "Price unavailable" }),
|
|
754
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-amount-available", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-available-value", children: [
|
|
755
|
-
formattedBalance,
|
|
756
|
-
" ",
|
|
757
|
-
asset.symbol,
|
|
758
|
-
" available",
|
|
759
|
-
hasPricing && balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { style: { color: "var(--rs-muted-foreground)" }, children: [
|
|
749
|
+
(_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _12 => _12.showTokenBalance]), () => ( false))) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
750
|
+
hasPricing ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-token-value", children: [
|
|
751
|
+
formattedTokenAmount,
|
|
760
752
|
" ",
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
"
|
|
764
|
-
|
|
765
|
-
|
|
753
|
+
asset.symbol
|
|
754
|
+
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
755
|
+
"div",
|
|
756
|
+
{
|
|
757
|
+
className: "rs-amount-token-value",
|
|
758
|
+
style: { color: "var(--rs-muted-foreground)" },
|
|
759
|
+
children: "Price unavailable"
|
|
760
|
+
}
|
|
761
|
+
),
|
|
762
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-amount-available", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-available-value", children: [
|
|
763
|
+
formattedBalance,
|
|
764
|
+
" ",
|
|
765
|
+
asset.symbol,
|
|
766
|
+
" available",
|
|
767
|
+
hasPricing && balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { style: { color: "var(--rs-muted-foreground)" }, children: [
|
|
768
|
+
" ",
|
|
769
|
+
"(",
|
|
770
|
+
_chunkG2RDCQHLcjs.currencyFormatter.format(balanceUsd),
|
|
771
|
+
")"
|
|
772
|
+
] })
|
|
773
|
+
] }) })
|
|
774
|
+
] })
|
|
766
775
|
] }),
|
|
767
776
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
768
777
|
"div",
|
|
@@ -773,26 +782,26 @@ function AmountStep({
|
|
|
773
782
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-flow-pill-label", children: "You send" }),
|
|
774
783
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-flow-pill-token", children: [
|
|
775
784
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-flow-pill-token-icon-wrapper", children: [
|
|
776
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-flow-pill-token-icon", children:
|
|
785
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-flow-pill-token-icon", children: _chunkPE6OK3FHcjs.getTokenIcon.call(void 0, asset.symbol) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
777
786
|
"img",
|
|
778
787
|
{
|
|
779
|
-
src:
|
|
788
|
+
src: _chunkPE6OK3FHcjs.getTokenIcon.call(void 0, asset.symbol),
|
|
780
789
|
alt: asset.symbol
|
|
781
790
|
}
|
|
782
791
|
) : asset.symbol.slice(0, 2) }),
|
|
783
792
|
(() => {
|
|
784
|
-
const chainIcon =
|
|
793
|
+
const chainIcon = _chunkPE6OK3FHcjs.getChainIcon.call(void 0, asset.chainId);
|
|
785
794
|
if (chainIcon) {
|
|
786
795
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
787
796
|
"img",
|
|
788
797
|
{
|
|
789
798
|
src: chainIcon,
|
|
790
|
-
alt:
|
|
799
|
+
alt: _chunkPE6OK3FHcjs.getChainName.call(void 0, asset.chainId),
|
|
791
800
|
className: "rs-flow-pill-chain-badge"
|
|
792
801
|
}
|
|
793
802
|
);
|
|
794
803
|
}
|
|
795
|
-
const badge =
|
|
804
|
+
const badge = _chunkPE6OK3FHcjs.getChainBadge.call(void 0, asset.chainId);
|
|
796
805
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
797
806
|
"div",
|
|
798
807
|
{
|
|
@@ -830,26 +839,26 @@ function AmountStep({
|
|
|
830
839
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-flow-pill-label", children: "You receive" }),
|
|
831
840
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-flow-pill-token", children: [
|
|
832
841
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-flow-pill-token-icon-wrapper", children: [
|
|
833
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-flow-pill-token-icon", children:
|
|
842
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-flow-pill-token-icon", children: _chunkPE6OK3FHcjs.getTokenIcon.call(void 0, targetSymbol) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
834
843
|
"img",
|
|
835
844
|
{
|
|
836
|
-
src:
|
|
845
|
+
src: _chunkPE6OK3FHcjs.getTokenIcon.call(void 0, targetSymbol),
|
|
837
846
|
alt: targetSymbol
|
|
838
847
|
}
|
|
839
848
|
) : targetSymbol.slice(0, 2) }),
|
|
840
849
|
(() => {
|
|
841
|
-
const chainIcon =
|
|
850
|
+
const chainIcon = _chunkPE6OK3FHcjs.getChainIcon.call(void 0, targetChain);
|
|
842
851
|
if (chainIcon) {
|
|
843
852
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
844
853
|
"img",
|
|
845
854
|
{
|
|
846
855
|
src: chainIcon,
|
|
847
|
-
alt:
|
|
856
|
+
alt: _chunkPE6OK3FHcjs.getChainName.call(void 0, targetChain),
|
|
848
857
|
className: "rs-flow-pill-chain-badge"
|
|
849
858
|
}
|
|
850
859
|
);
|
|
851
860
|
}
|
|
852
|
-
const badge =
|
|
861
|
+
const badge = _chunkPE6OK3FHcjs.getChainBadge.call(void 0, targetChain);
|
|
853
862
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
854
863
|
"div",
|
|
855
864
|
{
|
|
@@ -898,11 +907,11 @@ function AmountStep({
|
|
|
898
907
|
chainMismatch && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-chain-switch", style: { marginTop: 16 }, children: [
|
|
899
908
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-chain-switch-text", children: [
|
|
900
909
|
"Switch your wallet to ",
|
|
901
|
-
|
|
910
|
+
_chunkPE6OK3FHcjs.getChainName.call(void 0, asset.chainId),
|
|
902
911
|
" to continue."
|
|
903
912
|
] }),
|
|
904
913
|
switchChain && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
905
|
-
|
|
914
|
+
_chunkG2RDCQHLcjs.Button,
|
|
906
915
|
{
|
|
907
916
|
variant: "outline",
|
|
908
917
|
size: "small",
|
|
@@ -935,7 +944,7 @@ function AmountStep({
|
|
|
935
944
|
] })
|
|
936
945
|
] }),
|
|
937
946
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
938
|
-
|
|
947
|
+
_chunkG2RDCQHLcjs.Button,
|
|
939
948
|
{
|
|
940
949
|
onClick: handleContinue,
|
|
941
950
|
fullWidth: true,
|
|
@@ -943,7 +952,7 @@ function AmountStep({
|
|
|
943
952
|
children: "Continue"
|
|
944
953
|
}
|
|
945
954
|
) }),
|
|
946
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
955
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkG2RDCQHLcjs.PoweredBy, {})
|
|
947
956
|
] });
|
|
948
957
|
}
|
|
949
958
|
|
|
@@ -970,9 +979,9 @@ function ConfirmStep({
|
|
|
970
979
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
971
980
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
972
981
|
const [isSwitching, setIsSwitching] = _react.useState.call(void 0, false);
|
|
973
|
-
const chainMismatch = _optionalChain([walletClient, 'optionalAccess',
|
|
982
|
+
const chainMismatch = _optionalChain([walletClient, 'optionalAccess', _13 => _13.chain, 'optionalAccess', _14 => _14.id]) && walletClient.chain.id !== asset.chainId;
|
|
974
983
|
const sameRoute = targetChain === asset.chainId && targetToken.toLowerCase() === asset.token.toLowerCase();
|
|
975
|
-
const targetSymbol = sameRoute ? asset.symbol :
|
|
984
|
+
const targetSymbol = sameRoute ? asset.symbol : _chunkPE6OK3FHcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
976
985
|
const formattedAmount = amount && !Number.isNaN(Number(amount)) ? Number(amount).toLocaleString("en-US", { maximumFractionDigits: 6 }) : "0";
|
|
977
986
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
978
987
|
if (asset.balanceUsd === void 0 || !asset.balance) return null;
|
|
@@ -1013,7 +1022,7 @@ function ConfirmStep({
|
|
|
1013
1022
|
return receiveAmountUsd / targetTokenPriceUsd;
|
|
1014
1023
|
}, [sameRoute, amount, receiveAmountUsd, targetTokenPriceUsd]);
|
|
1015
1024
|
const formattedReceiveAmount = _react.useMemo.call(void 0, () => {
|
|
1016
|
-
if (receiveTokenAmount === null) return
|
|
1025
|
+
if (receiveTokenAmount === null) return formattedAmount;
|
|
1017
1026
|
return receiveTokenAmount.toLocaleString("en-US", {
|
|
1018
1027
|
maximumFractionDigits: 6
|
|
1019
1028
|
});
|
|
@@ -1025,7 +1034,7 @@ function ConfirmStep({
|
|
|
1025
1034
|
return;
|
|
1026
1035
|
}
|
|
1027
1036
|
if (chainMismatch) {
|
|
1028
|
-
setError(`Switch to ${
|
|
1037
|
+
setError(`Switch to ${_chunkPE6OK3FHcjs.getChainName.call(void 0, asset.chainId)} to sign`);
|
|
1029
1038
|
return;
|
|
1030
1039
|
}
|
|
1031
1040
|
const parsedAmount = parseFloat(amount);
|
|
@@ -1053,7 +1062,7 @@ function ConfirmStep({
|
|
|
1053
1062
|
throw new Error("Wallet not properly connected");
|
|
1054
1063
|
}
|
|
1055
1064
|
const transferTo = sameRoute ? recipient : smartAccount;
|
|
1056
|
-
const hash =
|
|
1065
|
+
const hash = _chunkG2RDCQHLcjs.isNativeAsset.call(void 0, asset) ? await walletClient.sendTransaction({
|
|
1057
1066
|
account,
|
|
1058
1067
|
chain,
|
|
1059
1068
|
to: transferTo,
|
|
@@ -1066,13 +1075,13 @@ function ConfirmStep({
|
|
|
1066
1075
|
functionName: "transfer",
|
|
1067
1076
|
args: [transferTo, amountUnits]
|
|
1068
1077
|
});
|
|
1069
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
1078
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _15 => _15(hash, asset.chainId, amountUnits.toString())]);
|
|
1070
1079
|
onConfirm(hash, asset.chainId, amountUnits.toString(), asset.token);
|
|
1071
1080
|
} catch (err) {
|
|
1072
1081
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
1073
|
-
const message =
|
|
1082
|
+
const message = _chunkG2RDCQHLcjs.formatUserError.call(void 0, raw);
|
|
1074
1083
|
setError(message);
|
|
1075
|
-
_optionalChain([onError, 'optionalCall',
|
|
1084
|
+
_optionalChain([onError, 'optionalCall', _16 => _16(message, "TRANSFER_ERROR")]);
|
|
1076
1085
|
} finally {
|
|
1077
1086
|
setIsSubmitting(false);
|
|
1078
1087
|
}
|
|
@@ -1084,7 +1093,7 @@ function ConfirmStep({
|
|
|
1084
1093
|
await switchChain(asset.chainId);
|
|
1085
1094
|
} catch (err) {
|
|
1086
1095
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
1087
|
-
setError(
|
|
1096
|
+
setError(_chunkG2RDCQHLcjs.formatUserError.call(void 0, raw));
|
|
1088
1097
|
} finally {
|
|
1089
1098
|
setIsSwitching(false);
|
|
1090
1099
|
}
|
|
@@ -1101,15 +1110,15 @@ function ConfirmStep({
|
|
|
1101
1110
|
className: "rs-card-value",
|
|
1102
1111
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
1103
1112
|
children: [
|
|
1104
|
-
|
|
1113
|
+
_chunkPE6OK3FHcjs.getChainIcon.call(void 0, asset.chainId) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1105
1114
|
"img",
|
|
1106
1115
|
{
|
|
1107
|
-
src:
|
|
1116
|
+
src: _chunkPE6OK3FHcjs.getChainIcon.call(void 0, asset.chainId),
|
|
1108
1117
|
alt: "",
|
|
1109
|
-
style: { width: 16, height: 16, borderRadius:
|
|
1118
|
+
style: { width: 16, height: 16, borderRadius: 3 }
|
|
1110
1119
|
}
|
|
1111
1120
|
),
|
|
1112
|
-
|
|
1121
|
+
_chunkPE6OK3FHcjs.getChainName.call(void 0, asset.chainId)
|
|
1113
1122
|
]
|
|
1114
1123
|
}
|
|
1115
1124
|
)
|
|
@@ -1122,15 +1131,15 @@ function ConfirmStep({
|
|
|
1122
1131
|
className: "rs-card-value",
|
|
1123
1132
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
1124
1133
|
children: [
|
|
1125
|
-
|
|
1134
|
+
_chunkPE6OK3FHcjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1126
1135
|
"img",
|
|
1127
1136
|
{
|
|
1128
|
-
src:
|
|
1137
|
+
src: _chunkPE6OK3FHcjs.getChainIcon.call(void 0, targetChain),
|
|
1129
1138
|
alt: "",
|
|
1130
|
-
style: { width: 16, height: 16, borderRadius:
|
|
1139
|
+
style: { width: 16, height: 16, borderRadius: 3 }
|
|
1131
1140
|
}
|
|
1132
1141
|
),
|
|
1133
|
-
|
|
1142
|
+
_chunkPE6OK3FHcjs.getChainName.call(void 0, targetChain)
|
|
1134
1143
|
]
|
|
1135
1144
|
}
|
|
1136
1145
|
)
|
|
@@ -1149,10 +1158,10 @@ function ConfirmStep({
|
|
|
1149
1158
|
className: "rs-card-value",
|
|
1150
1159
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
1151
1160
|
children: [
|
|
1152
|
-
|
|
1161
|
+
_chunkPE6OK3FHcjs.getTokenIcon.call(void 0, asset.symbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1153
1162
|
"img",
|
|
1154
1163
|
{
|
|
1155
|
-
src:
|
|
1164
|
+
src: _chunkPE6OK3FHcjs.getTokenIcon.call(void 0, asset.symbol),
|
|
1156
1165
|
alt: "",
|
|
1157
1166
|
style: { width: 16, height: 16, borderRadius: "50%" }
|
|
1158
1167
|
}
|
|
@@ -1172,10 +1181,10 @@ function ConfirmStep({
|
|
|
1172
1181
|
className: "rs-card-value",
|
|
1173
1182
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
1174
1183
|
children: [
|
|
1175
|
-
|
|
1184
|
+
_chunkPE6OK3FHcjs.getTokenIcon.call(void 0, targetSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1176
1185
|
"img",
|
|
1177
1186
|
{
|
|
1178
|
-
src:
|
|
1187
|
+
src: _chunkPE6OK3FHcjs.getTokenIcon.call(void 0, targetSymbol),
|
|
1179
1188
|
alt: "",
|
|
1180
1189
|
style: { width: 16, height: 16, borderRadius: "50%" }
|
|
1181
1190
|
}
|
|
@@ -1189,17 +1198,17 @@ function ConfirmStep({
|
|
|
1189
1198
|
] }),
|
|
1190
1199
|
receiveAmountUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-card-row", children: [
|
|
1191
1200
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-card-label", children: "Value" }),
|
|
1192
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-card-value", children:
|
|
1201
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-card-value", children: _chunkG2RDCQHLcjs.currencyFormatter.format(receiveAmountUsd) })
|
|
1193
1202
|
] })
|
|
1194
1203
|
] }),
|
|
1195
1204
|
chainMismatch && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-chain-switch", children: [
|
|
1196
1205
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-chain-switch-text", children: [
|
|
1197
1206
|
"Switch your wallet to ",
|
|
1198
|
-
|
|
1207
|
+
_chunkPE6OK3FHcjs.getChainName.call(void 0, asset.chainId),
|
|
1199
1208
|
" to sign."
|
|
1200
1209
|
] }),
|
|
1201
1210
|
switchChain && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1202
|
-
|
|
1211
|
+
_chunkG2RDCQHLcjs.Button,
|
|
1203
1212
|
{
|
|
1204
1213
|
variant: "outline",
|
|
1205
1214
|
size: "small",
|
|
@@ -1232,7 +1241,7 @@ function ConfirmStep({
|
|
|
1232
1241
|
] })
|
|
1233
1242
|
] }),
|
|
1234
1243
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1235
|
-
|
|
1244
|
+
_chunkG2RDCQHLcjs.Button,
|
|
1236
1245
|
{
|
|
1237
1246
|
onClick: handleConfirm,
|
|
1238
1247
|
loading: isSubmitting,
|
|
@@ -1241,7 +1250,7 @@ function ConfirmStep({
|
|
|
1241
1250
|
children: "Confirm Order"
|
|
1242
1251
|
}
|
|
1243
1252
|
) }),
|
|
1244
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1253
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkG2RDCQHLcjs.PoweredBy, {})
|
|
1245
1254
|
] });
|
|
1246
1255
|
}
|
|
1247
1256
|
|
|
@@ -1363,7 +1372,7 @@ function asAddress(value) {
|
|
|
1363
1372
|
return /^0x[a-fA-F0-9]{40}$/.test(value) ? value : void 0;
|
|
1364
1373
|
}
|
|
1365
1374
|
function getDepositEventDetails(event) {
|
|
1366
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
1375
|
+
if (!_optionalChain([event, 'optionalAccess', _17 => _17.type]) || !isRecord(event.data)) return {};
|
|
1367
1376
|
if (event.type === "deposit-received") {
|
|
1368
1377
|
return {
|
|
1369
1378
|
chainId: asNumber(event.data.chain),
|
|
@@ -1374,8 +1383,8 @@ function getDepositEventDetails(event) {
|
|
|
1374
1383
|
if (event.type === "bridge-started") {
|
|
1375
1384
|
const source = isRecord(event.data.source) ? event.data.source : void 0;
|
|
1376
1385
|
return {
|
|
1377
|
-
chainId: asNumber(_optionalChain([source, 'optionalAccess',
|
|
1378
|
-
token: asAddress(_optionalChain([source, 'optionalAccess',
|
|
1386
|
+
chainId: asNumber(_optionalChain([source, 'optionalAccess', _18 => _18.chain])),
|
|
1387
|
+
token: asAddress(_optionalChain([source, 'optionalAccess', _19 => _19.asset]))
|
|
1379
1388
|
};
|
|
1380
1389
|
}
|
|
1381
1390
|
return {};
|
|
@@ -1386,12 +1395,12 @@ function DepositAddressStep({
|
|
|
1386
1395
|
onDepositDetected,
|
|
1387
1396
|
onError
|
|
1388
1397
|
}) {
|
|
1389
|
-
const supportedChainIds = _react.useMemo.call(void 0, () =>
|
|
1398
|
+
const supportedChainIds = _react.useMemo.call(void 0, () => _chunkPE6OK3FHcjs.getSupportedChainIds.call(void 0, ), []);
|
|
1390
1399
|
const BASE_CHAIN_ID = 8453;
|
|
1391
1400
|
const defaultChainId = supportedChainIds.includes(BASE_CHAIN_ID) ? BASE_CHAIN_ID : supportedChainIds[0];
|
|
1392
1401
|
const [sourceChainId, setSourceChainId] = _react.useState.call(void 0, defaultChainId);
|
|
1393
1402
|
const tokensForChain = _react.useMemo.call(void 0,
|
|
1394
|
-
() =>
|
|
1403
|
+
() => _chunkPE6OK3FHcjs.getTargetTokenSymbolsForChain.call(void 0, sourceChainId),
|
|
1395
1404
|
[sourceChainId]
|
|
1396
1405
|
);
|
|
1397
1406
|
const defaultToken = tokensForChain.includes("USDC") ? "USDC" : _nullishCoalesce(tokensForChain[0], () => ( "USDC"));
|
|
@@ -1446,7 +1455,7 @@ function DepositAddressStep({
|
|
|
1446
1455
|
const status = await service.fetchLatestStatus(smartAccount);
|
|
1447
1456
|
if (cancelled || depositHandledRef.current) return;
|
|
1448
1457
|
const event = status.lastEvent;
|
|
1449
|
-
const eventTxHash =
|
|
1458
|
+
const eventTxHash = _chunkG2RDCQHLcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_optionalChain([_chunkG2RDCQHLcjs.getEventTxHash.call(void 0, event), 'optionalAccess', _20 => _20.toLowerCase, 'call', _21 => _21()]), () => ( null)) : null;
|
|
1450
1459
|
if (baselineTxHash === void 0) {
|
|
1451
1460
|
baselineTxHash = eventTxHash;
|
|
1452
1461
|
} else if (eventTxHash && eventTxHash !== baselineTxHash) {
|
|
@@ -1454,7 +1463,7 @@ function DepositAddressStep({
|
|
|
1454
1463
|
const fallback = sourceSelectionRef.current;
|
|
1455
1464
|
const chainId = _nullishCoalesce(details.chainId, () => ( fallback.chainId));
|
|
1456
1465
|
const amount = _nullishCoalesce(details.amount, () => ( "0"));
|
|
1457
|
-
const token = _nullishCoalesce(details.token, () => (
|
|
1466
|
+
const token = _nullishCoalesce(details.token, () => ( _chunkPE6OK3FHcjs.getTokenAddress.call(void 0, fallback.tokenSymbol, fallback.chainId)));
|
|
1458
1467
|
if (token) {
|
|
1459
1468
|
depositHandledRef.current = true;
|
|
1460
1469
|
onDepositDetected(eventTxHash, chainId, amount, token);
|
|
@@ -1466,7 +1475,7 @@ function DepositAddressStep({
|
|
|
1466
1475
|
if (!cancelled) {
|
|
1467
1476
|
const msg = err instanceof Error ? err.message : "Failed to check status";
|
|
1468
1477
|
setPollingError(msg);
|
|
1469
|
-
_optionalChain([onError, 'optionalCall',
|
|
1478
|
+
_optionalChain([onError, 'optionalCall', _22 => _22(msg, "STATUS_POLL_ERROR")]);
|
|
1470
1479
|
}
|
|
1471
1480
|
}
|
|
1472
1481
|
if (!cancelled && !depositHandledRef.current) {
|
|
@@ -1479,7 +1488,7 @@ function DepositAddressStep({
|
|
|
1479
1488
|
clearTimeout(timeoutId);
|
|
1480
1489
|
};
|
|
1481
1490
|
}, [smartAccount, service, onDepositDetected, onError]);
|
|
1482
|
-
const chainIconSrc =
|
|
1491
|
+
const chainIconSrc = _chunkPE6OK3FHcjs.getChainIcon.call(void 0, sourceChainId);
|
|
1483
1492
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
1484
1493
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-body", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address", children: [
|
|
1485
1494
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", children: [
|
|
@@ -1495,10 +1504,10 @@ function DepositAddressStep({
|
|
|
1495
1504
|
setChainDropdownOpen(false);
|
|
1496
1505
|
},
|
|
1497
1506
|
children: [
|
|
1498
|
-
|
|
1507
|
+
_chunkPE6OK3FHcjs.getTokenIcon.call(void 0, sourceTokenSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1499
1508
|
"img",
|
|
1500
1509
|
{
|
|
1501
|
-
src:
|
|
1510
|
+
src: _chunkPE6OK3FHcjs.getTokenIcon.call(void 0, sourceTokenSymbol),
|
|
1502
1511
|
alt: "",
|
|
1503
1512
|
className: "rs-deposit-address-dropdown-icon"
|
|
1504
1513
|
}
|
|
@@ -1535,10 +1544,10 @@ function DepositAddressStep({
|
|
|
1535
1544
|
setTokenDropdownOpen(false);
|
|
1536
1545
|
},
|
|
1537
1546
|
children: [
|
|
1538
|
-
|
|
1547
|
+
_chunkPE6OK3FHcjs.getTokenIcon.call(void 0, symbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1539
1548
|
"img",
|
|
1540
1549
|
{
|
|
1541
|
-
src:
|
|
1550
|
+
src: _chunkPE6OK3FHcjs.getTokenIcon.call(void 0, symbol),
|
|
1542
1551
|
alt: "",
|
|
1543
1552
|
className: "rs-deposit-address-dropdown-icon"
|
|
1544
1553
|
}
|
|
@@ -1561,15 +1570,15 @@ function DepositAddressStep({
|
|
|
1561
1570
|
setTokenDropdownOpen(false);
|
|
1562
1571
|
},
|
|
1563
1572
|
children: [
|
|
1564
|
-
|
|
1573
|
+
_chunkPE6OK3FHcjs.getChainIcon.call(void 0, sourceChainId) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1565
1574
|
"img",
|
|
1566
1575
|
{
|
|
1567
|
-
src:
|
|
1576
|
+
src: _chunkPE6OK3FHcjs.getChainIcon.call(void 0, sourceChainId),
|
|
1568
1577
|
alt: "",
|
|
1569
1578
|
className: "rs-deposit-address-dropdown-icon"
|
|
1570
1579
|
}
|
|
1571
1580
|
),
|
|
1572
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children:
|
|
1581
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunkPE6OK3FHcjs.getChainName.call(void 0, sourceChainId) }),
|
|
1573
1582
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1574
1583
|
"svg",
|
|
1575
1584
|
{
|
|
@@ -1601,15 +1610,15 @@ function DepositAddressStep({
|
|
|
1601
1610
|
setChainDropdownOpen(false);
|
|
1602
1611
|
},
|
|
1603
1612
|
children: [
|
|
1604
|
-
|
|
1613
|
+
_chunkPE6OK3FHcjs.getChainIcon.call(void 0, chainId) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1605
1614
|
"img",
|
|
1606
1615
|
{
|
|
1607
|
-
src:
|
|
1616
|
+
src: _chunkPE6OK3FHcjs.getChainIcon.call(void 0, chainId),
|
|
1608
1617
|
alt: "",
|
|
1609
1618
|
className: "rs-deposit-address-dropdown-icon"
|
|
1610
1619
|
}
|
|
1611
1620
|
),
|
|
1612
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children:
|
|
1621
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunkPE6OK3FHcjs.getChainName.call(void 0, chainId) })
|
|
1613
1622
|
]
|
|
1614
1623
|
},
|
|
1615
1624
|
chainId
|
|
@@ -1659,7 +1668,7 @@ function DepositAddressStep({
|
|
|
1659
1668
|
] }),
|
|
1660
1669
|
pollingError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-error", children: pollingError })
|
|
1661
1670
|
] }) }),
|
|
1662
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1671
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkG2RDCQHLcjs.PoweredBy, {})
|
|
1663
1672
|
] });
|
|
1664
1673
|
}
|
|
1665
1674
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -1680,7 +1689,7 @@ function DepositFlow({
|
|
|
1680
1689
|
sourceToken: defaultSourceToken,
|
|
1681
1690
|
amount: defaultAmount,
|
|
1682
1691
|
recipient,
|
|
1683
|
-
signerAddress =
|
|
1692
|
+
signerAddress = _chunkPE6OK3FHcjs.DEFAULT_SIGNER_ADDRESS,
|
|
1684
1693
|
sessionChainIds,
|
|
1685
1694
|
forceRegister = false,
|
|
1686
1695
|
waitForFinalTx = true,
|
|
@@ -1705,15 +1714,15 @@ function DepositFlow({
|
|
|
1705
1714
|
const [isConnectSelectionConfirmed, setIsConnectSelectionConfirmed] = _react.useState.call(void 0, false);
|
|
1706
1715
|
const [selectedConnectAddress, setSelectedConnectAddress] = _react.useState.call(void 0, null);
|
|
1707
1716
|
const dappSwitchChain = _react.useMemo.call(void 0, () => {
|
|
1708
|
-
if (!_optionalChain([dappWalletClient, 'optionalAccess',
|
|
1717
|
+
if (!_optionalChain([dappWalletClient, 'optionalAccess', _23 => _23.switchChain])) return void 0;
|
|
1709
1718
|
return async (chainId) => {
|
|
1710
|
-
await _optionalChain([dappWalletClient, 'access',
|
|
1719
|
+
await _optionalChain([dappWalletClient, 'access', _24 => _24.switchChain, 'optionalCall', _25 => _25({ id: chainId })]);
|
|
1711
1720
|
};
|
|
1712
1721
|
}, [dappWalletClient]);
|
|
1713
1722
|
const walletOptions = _react.useMemo.call(void 0, () => {
|
|
1714
1723
|
const options = [];
|
|
1715
1724
|
const seen = /* @__PURE__ */ new Set();
|
|
1716
|
-
if (_optionalChain([dappWalletClient, 'optionalAccess',
|
|
1725
|
+
if (_optionalChain([dappWalletClient, 'optionalAccess', _26 => _26.account]) && dappAddress) {
|
|
1717
1726
|
options.push({
|
|
1718
1727
|
address: dappWalletClient.account.address,
|
|
1719
1728
|
label: "Connected Wallet",
|
|
@@ -1721,21 +1730,23 @@ function DepositFlow({
|
|
|
1721
1730
|
});
|
|
1722
1731
|
seen.add(dappWalletClient.account.address.toLowerCase());
|
|
1723
1732
|
}
|
|
1724
|
-
if (_optionalChain([reownWallet, 'optionalAccess',
|
|
1733
|
+
if (_optionalChain([reownWallet, 'optionalAccess', _27 => _27.address]) && reownWallet.isConnected && !seen.has(reownWallet.address.toLowerCase())) {
|
|
1725
1734
|
options.push({
|
|
1726
1735
|
address: reownWallet.address,
|
|
1727
1736
|
label: "External Wallet",
|
|
1728
|
-
kind: "external"
|
|
1737
|
+
kind: "external",
|
|
1738
|
+
icon: reownWallet.icon
|
|
1729
1739
|
});
|
|
1730
1740
|
}
|
|
1731
1741
|
return options;
|
|
1732
1742
|
}, [
|
|
1733
1743
|
dappWalletClient,
|
|
1734
1744
|
dappAddress,
|
|
1735
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
1736
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
1745
|
+
_optionalChain([reownWallet, 'optionalAccess', _28 => _28.address]),
|
|
1746
|
+
_optionalChain([reownWallet, 'optionalAccess', _29 => _29.isConnected]),
|
|
1747
|
+
_optionalChain([reownWallet, 'optionalAccess', _30 => _30.icon])
|
|
1737
1748
|
]);
|
|
1738
|
-
const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess',
|
|
1749
|
+
const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess', _31 => _31.account]) && dappAddress && !reownWallet;
|
|
1739
1750
|
const hasWalletOptions = walletOptions.length > 0;
|
|
1740
1751
|
const showConnectStep = !canAutoLock && !isConnectSelectionConfirmed;
|
|
1741
1752
|
const signerContext = _react.useMemo.call(void 0, () => {
|
|
@@ -1744,30 +1755,30 @@ function DepositFlow({
|
|
|
1744
1755
|
return {
|
|
1745
1756
|
ownerAddress: dappAddress,
|
|
1746
1757
|
walletClient: void 0,
|
|
1747
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
1758
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkG2RDCQHLcjs.getPublicClient.call(void 0, targetChain))),
|
|
1748
1759
|
switchChain: void 0
|
|
1749
1760
|
};
|
|
1750
1761
|
}
|
|
1751
1762
|
if (canAutoLock) {
|
|
1752
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
1763
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _32 => _32.chain, 'optionalAccess', _33 => _33.id]), () => ( targetChain));
|
|
1753
1764
|
return {
|
|
1754
1765
|
ownerAddress: dappWalletClient.account.address,
|
|
1755
1766
|
walletClient: dappWalletClient,
|
|
1756
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
1767
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkG2RDCQHLcjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
1757
1768
|
switchChain: dappSwitchChain
|
|
1758
1769
|
};
|
|
1759
1770
|
}
|
|
1760
1771
|
if (!isConnectSelectionConfirmed || !selectedConnectAddress) return null;
|
|
1761
|
-
if (_optionalChain([dappWalletClient, 'optionalAccess',
|
|
1762
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
1772
|
+
if (_optionalChain([dappWalletClient, 'optionalAccess', _34 => _34.account]) && dappWalletClient.account.address.toLowerCase() === selectedConnectAddress.toLowerCase()) {
|
|
1773
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _35 => _35.chain, 'optionalAccess', _36 => _36.id]), () => ( targetChain));
|
|
1763
1774
|
return {
|
|
1764
1775
|
ownerAddress: dappWalletClient.account.address,
|
|
1765
1776
|
walletClient: dappWalletClient,
|
|
1766
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
1777
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkG2RDCQHLcjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
1767
1778
|
switchChain: dappSwitchChain
|
|
1768
1779
|
};
|
|
1769
1780
|
}
|
|
1770
|
-
if (_optionalChain([reownWallet, 'optionalAccess',
|
|
1781
|
+
if (_optionalChain([reownWallet, 'optionalAccess', _37 => _37.address, 'optionalAccess', _38 => _38.toLowerCase, 'call', _39 => _39()]) === selectedConnectAddress.toLowerCase() && reownWallet.walletClient && reownWallet.publicClient) {
|
|
1771
1782
|
return {
|
|
1772
1783
|
ownerAddress: reownWallet.address,
|
|
1773
1784
|
walletClient: reownWallet.walletClient,
|
|
@@ -1788,7 +1799,7 @@ function DepositFlow({
|
|
|
1788
1799
|
reownWallet,
|
|
1789
1800
|
targetChain
|
|
1790
1801
|
]);
|
|
1791
|
-
const sessionKeyAddress = _nullishCoalesce(_nullishCoalesce(dappAddress, () => ( _optionalChain([signerContext, 'optionalAccess',
|
|
1802
|
+
const sessionKeyAddress = _nullishCoalesce(_nullishCoalesce(dappAddress, () => ( _optionalChain([signerContext, 'optionalAccess', _40 => _40.ownerAddress]))), () => ( null));
|
|
1792
1803
|
const lastTargetRef = _react.useRef.call(void 0, null);
|
|
1793
1804
|
_react.useEffect.call(void 0, () => {
|
|
1794
1805
|
const prev = lastTargetRef.current;
|
|
@@ -1807,6 +1818,7 @@ function DepositFlow({
|
|
|
1807
1818
|
}, []);
|
|
1808
1819
|
const handleBackFromSelectAsset = _react.useCallback.call(void 0, () => {
|
|
1809
1820
|
if (hasWalletOptions || reownWallet) {
|
|
1821
|
+
hasNavigatedBackRef.current = true;
|
|
1810
1822
|
setIsConnectSelectionConfirmed(false);
|
|
1811
1823
|
}
|
|
1812
1824
|
}, [hasWalletOptions, reownWallet]);
|
|
@@ -1814,6 +1826,7 @@ function DepositFlow({
|
|
|
1814
1826
|
setFlowMode(null);
|
|
1815
1827
|
setStep({ type: "setup" });
|
|
1816
1828
|
if (hasWalletOptions || reownWallet) {
|
|
1829
|
+
hasNavigatedBackRef.current = true;
|
|
1817
1830
|
setIsConnectSelectionConfirmed(false);
|
|
1818
1831
|
}
|
|
1819
1832
|
}, [hasWalletOptions, reownWallet]);
|
|
@@ -1831,10 +1844,10 @@ function DepositFlow({
|
|
|
1831
1844
|
const stepIndex = step.type === "setup" ? 0 : step.type === "deposit-address" ? 1 : step.type === "select-asset" ? 1 : step.type === "amount" ? 2 : step.type === "confirm" ? 3 : 4;
|
|
1832
1845
|
const currentBackHandler = step.type === "deposit-address" ? handleBackFromDepositAddress : step.type === "select-asset" && signerContext && !canAutoLock ? handleBackFromSelectAsset : step.type === "amount" ? handleBackFromAmount : step.type === "confirm" ? handleBackFromConfirm : void 0;
|
|
1833
1846
|
_react.useEffect.call(void 0, () => {
|
|
1834
|
-
_optionalChain([onStepChange, 'optionalCall',
|
|
1847
|
+
_optionalChain([onStepChange, 'optionalCall', _41 => _41(stepIndex, currentBackHandler)]);
|
|
1835
1848
|
}, [stepIndex, currentBackHandler, onStepChange]);
|
|
1836
1849
|
_react.useEffect.call(void 0, () => {
|
|
1837
|
-
_optionalChain([onTotalBalanceChange, 'optionalCall',
|
|
1850
|
+
_optionalChain([onTotalBalanceChange, 'optionalCall', _42 => _42(totalBalanceUsd)]);
|
|
1838
1851
|
}, [totalBalanceUsd, onTotalBalanceChange]);
|
|
1839
1852
|
const isDepositAddressMode = flowMode === "deposit-address";
|
|
1840
1853
|
const handleSelectProvider = _react.useCallback.call(void 0, () => {
|
|
@@ -1872,13 +1885,13 @@ function DepositFlow({
|
|
|
1872
1885
|
directTransfer: isSameRoute(chainId, token, targetChain, targetToken)
|
|
1873
1886
|
};
|
|
1874
1887
|
});
|
|
1875
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
1888
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _43 => _43({ txHash, sourceChain: chainId, amount })]);
|
|
1876
1889
|
},
|
|
1877
1890
|
[onDepositSubmitted, targetChain, targetToken]
|
|
1878
1891
|
);
|
|
1879
1892
|
const handleConnected = _react.useCallback.call(void 0,
|
|
1880
1893
|
(addr, smartAccount) => {
|
|
1881
|
-
_optionalChain([onConnected, 'optionalCall',
|
|
1894
|
+
_optionalChain([onConnected, 'optionalCall', _44 => _44({ address: addr, smartAccount })]);
|
|
1882
1895
|
},
|
|
1883
1896
|
[onConnected]
|
|
1884
1897
|
);
|
|
@@ -1930,25 +1943,25 @@ function DepositFlow({
|
|
|
1930
1943
|
);
|
|
1931
1944
|
const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
|
|
1932
1945
|
(txHash, sourceChain, amount) => {
|
|
1933
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
1946
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _45 => _45({ txHash, sourceChain, amount })]);
|
|
1934
1947
|
},
|
|
1935
1948
|
[onDepositSubmitted]
|
|
1936
1949
|
);
|
|
1937
1950
|
const handleDepositComplete = _react.useCallback.call(void 0,
|
|
1938
1951
|
(txHash, destinationTxHash) => {
|
|
1939
|
-
_optionalChain([onDepositComplete, 'optionalCall',
|
|
1952
|
+
_optionalChain([onDepositComplete, 'optionalCall', _46 => _46({ txHash, destinationTxHash })]);
|
|
1940
1953
|
},
|
|
1941
1954
|
[onDepositComplete]
|
|
1942
1955
|
);
|
|
1943
1956
|
const handleDepositFailed = _react.useCallback.call(void 0,
|
|
1944
1957
|
(txHash, error) => {
|
|
1945
|
-
_optionalChain([onDepositFailed, 'optionalCall',
|
|
1958
|
+
_optionalChain([onDepositFailed, 'optionalCall', _47 => _47({ txHash, error })]);
|
|
1946
1959
|
},
|
|
1947
1960
|
[onDepositFailed]
|
|
1948
1961
|
);
|
|
1949
1962
|
const handleError = _react.useCallback.call(void 0,
|
|
1950
1963
|
(message, code) => {
|
|
1951
|
-
_optionalChain([onError, 'optionalCall',
|
|
1964
|
+
_optionalChain([onError, 'optionalCall', _48 => _48({ message, code })]);
|
|
1952
1965
|
},
|
|
1953
1966
|
[onError]
|
|
1954
1967
|
);
|
|
@@ -1966,12 +1979,39 @@ function DepositFlow({
|
|
|
1966
1979
|
() => walletOptions.map((option) => option.address.toLowerCase()).join(","),
|
|
1967
1980
|
[walletOptions]
|
|
1968
1981
|
);
|
|
1982
|
+
const hasNavigatedBackRef = _react.useRef.call(void 0, false);
|
|
1969
1983
|
_react.useEffect.call(void 0, () => {
|
|
1970
1984
|
setIsConnectSelectionConfirmed(false);
|
|
1971
|
-
}, [walletOptionsKey
|
|
1985
|
+
}, [walletOptionsKey]);
|
|
1986
|
+
_react.useEffect.call(void 0, () => {
|
|
1987
|
+
if (hasNavigatedBackRef.current || isConnectSelectionConfirmed || flowMode) {
|
|
1988
|
+
return;
|
|
1989
|
+
}
|
|
1990
|
+
if (hasWalletOptions) {
|
|
1991
|
+
const address = selectedConnectAddressEffective;
|
|
1992
|
+
if (address) {
|
|
1993
|
+
setSelectedConnectAddress(address);
|
|
1994
|
+
handleSelectProvider();
|
|
1995
|
+
setIsConnectSelectionConfirmed(true);
|
|
1996
|
+
return;
|
|
1997
|
+
}
|
|
1998
|
+
}
|
|
1999
|
+
if (!hasWalletOptions && dappAddress) {
|
|
2000
|
+
handleSelectTransferCrypto();
|
|
2001
|
+
setIsConnectSelectionConfirmed(true);
|
|
2002
|
+
}
|
|
2003
|
+
}, [
|
|
2004
|
+
hasWalletOptions,
|
|
2005
|
+
isConnectSelectionConfirmed,
|
|
2006
|
+
flowMode,
|
|
2007
|
+
selectedConnectAddressEffective,
|
|
2008
|
+
dappAddress,
|
|
2009
|
+
handleSelectProvider,
|
|
2010
|
+
handleSelectTransferCrypto
|
|
2011
|
+
]);
|
|
1972
2012
|
if (showConnectStep) {
|
|
1973
2013
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1974
|
-
|
|
2014
|
+
_chunkG2RDCQHLcjs.ConnectStep,
|
|
1975
2015
|
{
|
|
1976
2016
|
walletOptions,
|
|
1977
2017
|
selectedAddress: selectedConnectAddressEffective,
|
|
@@ -2022,7 +2062,7 @@ function DepositFlow({
|
|
|
2022
2062
|
}
|
|
2023
2063
|
),
|
|
2024
2064
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2025
|
-
|
|
2065
|
+
_chunkG2RDCQHLcjs.ProcessingStep,
|
|
2026
2066
|
{
|
|
2027
2067
|
smartAccount: step.smartAccount,
|
|
2028
2068
|
txHash: step.txHash,
|
|
@@ -2044,16 +2084,16 @@ function DepositFlow({
|
|
|
2044
2084
|
)
|
|
2045
2085
|
] });
|
|
2046
2086
|
}
|
|
2047
|
-
if (!_optionalChain([signerContext, 'optionalAccess',
|
|
2087
|
+
if (!_optionalChain([signerContext, 'optionalAccess', _49 => _49.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _50 => _50.publicClient])) {
|
|
2048
2088
|
return null;
|
|
2049
2089
|
}
|
|
2050
2090
|
const ownerAddress = signerContext.ownerAddress;
|
|
2051
|
-
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access',
|
|
2091
|
+
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _51 => _51.walletClient, 'optionalAccess', _52 => _52.chain, 'optionalAccess', _53 => _53.id]), () => ( _optionalChain([signerContext, 'access', _54 => _54.publicClient, 'access', _55 => _55.chain, 'optionalAccess', _56 => _56.id]))), () => ( targetChain));
|
|
2052
2092
|
const getReadClientForChain = (chainId) => {
|
|
2053
|
-
if (_optionalChain([signerContext, 'access',
|
|
2093
|
+
if (_optionalChain([signerContext, 'access', _57 => _57.publicClient, 'access', _58 => _58.chain, 'optionalAccess', _59 => _59.id]) === chainId) {
|
|
2054
2094
|
return signerContext.publicClient;
|
|
2055
2095
|
}
|
|
2056
|
-
return
|
|
2096
|
+
return _chunkG2RDCQHLcjs.getPublicClient.call(void 0, chainId);
|
|
2057
2097
|
};
|
|
2058
2098
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
2059
2099
|
step.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2119,7 +2159,7 @@ function DepositFlow({
|
|
|
2119
2159
|
}
|
|
2120
2160
|
),
|
|
2121
2161
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2122
|
-
|
|
2162
|
+
_chunkG2RDCQHLcjs.ProcessingStep,
|
|
2123
2163
|
{
|
|
2124
2164
|
smartAccount: step.smartAccount,
|
|
2125
2165
|
txHash: step.txHash,
|
|
@@ -2144,7 +2184,7 @@ function DepositFlow({
|
|
|
2144
2184
|
// src/DepositModal.tsx
|
|
2145
2185
|
|
|
2146
2186
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
2147
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
2187
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-N7GCYZF7.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
2148
2188
|
);
|
|
2149
2189
|
function DepositModal(props) {
|
|
2150
2190
|
const needsReown = !!props.reownAppId;
|
|
@@ -2167,8 +2207,8 @@ function DepositModalInner({
|
|
|
2167
2207
|
sourceToken,
|
|
2168
2208
|
defaultAmount,
|
|
2169
2209
|
recipient,
|
|
2170
|
-
backendUrl =
|
|
2171
|
-
signerAddress =
|
|
2210
|
+
backendUrl = _chunkPE6OK3FHcjs.DEFAULT_BACKEND_URL,
|
|
2211
|
+
signerAddress = _chunkPE6OK3FHcjs.DEFAULT_SIGNER_ADDRESS,
|
|
2172
2212
|
sessionChainIds,
|
|
2173
2213
|
forceRegister = false,
|
|
2174
2214
|
waitForFinalTx = true,
|
|
@@ -2192,19 +2232,19 @@ function DepositModalInner({
|
|
|
2192
2232
|
const [currentStepIndex, setCurrentStepIndex] = _react.useState.call(void 0, 0);
|
|
2193
2233
|
const [totalBalanceUsd, setTotalBalanceUsd] = _react.useState.call(void 0, null);
|
|
2194
2234
|
const backHandlerRef = _react.useRef.call(void 0, void 0);
|
|
2195
|
-
const targetChain =
|
|
2196
|
-
const sourceChain = sourceChainProp ?
|
|
2197
|
-
const service = _react.useMemo.call(void 0, () =>
|
|
2235
|
+
const targetChain = _chunkPE6OK3FHcjs.getChainId.call(void 0, targetChainProp);
|
|
2236
|
+
const sourceChain = sourceChainProp ? _chunkPE6OK3FHcjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
2237
|
+
const service = _react.useMemo.call(void 0, () => _chunkG2RDCQHLcjs.createDepositService.call(void 0, backendUrl), [backendUrl]);
|
|
2198
2238
|
_react.useEffect.call(void 0, () => {
|
|
2199
2239
|
if (isOpen && modalRef.current) {
|
|
2200
|
-
|
|
2240
|
+
_chunkG2RDCQHLcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
2201
2241
|
}
|
|
2202
2242
|
}, [isOpen, theme]);
|
|
2203
2243
|
const hasCalledReady = _react.useRef.call(void 0, false);
|
|
2204
2244
|
_react.useEffect.call(void 0, () => {
|
|
2205
2245
|
if (isOpen && !hasCalledReady.current) {
|
|
2206
2246
|
hasCalledReady.current = true;
|
|
2207
|
-
_optionalChain([onReady, 'optionalCall',
|
|
2247
|
+
_optionalChain([onReady, 'optionalCall', _60 => _60()]);
|
|
2208
2248
|
}
|
|
2209
2249
|
}, [isOpen, onReady]);
|
|
2210
2250
|
_react.useEffect.call(void 0, () => {
|
|
@@ -2219,21 +2259,21 @@ function DepositModalInner({
|
|
|
2219
2259
|
},
|
|
2220
2260
|
[]
|
|
2221
2261
|
);
|
|
2222
|
-
const handleTotalBalanceChange = _react.useCallback.call(void 0, (
|
|
2223
|
-
setTotalBalanceUsd(
|
|
2262
|
+
const handleTotalBalanceChange = _react.useCallback.call(void 0, (balance2) => {
|
|
2263
|
+
setTotalBalanceUsd(balance2);
|
|
2224
2264
|
}, []);
|
|
2225
2265
|
const handleBack = _react.useCallback.call(void 0, () => {
|
|
2226
|
-
_optionalChain([backHandlerRef, 'access',
|
|
2266
|
+
_optionalChain([backHandlerRef, 'access', _61 => _61.current, 'optionalCall', _62 => _62()]);
|
|
2227
2267
|
}, []);
|
|
2228
|
-
const showLogo = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
2229
|
-
const showStepper = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
2230
|
-
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
2231
|
-
const
|
|
2232
|
-
const logoUrl = _nullishCoalesce(_optionalChain([branding, 'optionalAccess',
|
|
2233
|
-
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess',
|
|
2268
|
+
const showLogo = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _63 => _63.showLogo]), () => ( false));
|
|
2269
|
+
const showStepper = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _64 => _64.showStepper]), () => ( false));
|
|
2270
|
+
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _65 => _65.showBackButton]), () => ( true));
|
|
2271
|
+
const balance = _optionalChain([uiConfig, 'optionalAccess', _66 => _66.balance]);
|
|
2272
|
+
const logoUrl = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _67 => _67.logoUrl]), () => ( "https://github.com/rhinestonewtf.png"));
|
|
2273
|
+
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _68 => _68.title]), () => ( "Deposit"));
|
|
2234
2274
|
const canGoBack = currentStepIndex > 0 && currentStepIndex < 4 && backHandlerRef.current !== void 0;
|
|
2235
2275
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2236
|
-
|
|
2276
|
+
_chunkG2RDCQHLcjs.Modal,
|
|
2237
2277
|
{
|
|
2238
2278
|
isOpen,
|
|
2239
2279
|
onClose,
|
|
@@ -2289,12 +2329,12 @@ function DepositModalInner({
|
|
|
2289
2329
|
i
|
|
2290
2330
|
)) })
|
|
2291
2331
|
] }),
|
|
2292
|
-
|
|
2332
|
+
balance && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-balance", children: [
|
|
2293
2333
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { children: [
|
|
2294
|
-
|
|
2334
|
+
balance.title,
|
|
2295
2335
|
":"
|
|
2296
2336
|
] }),
|
|
2297
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children:
|
|
2337
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ? _chunkG2RDCQHLcjs.currencyFormatter.format(totalBalanceUsd) : null))) })
|
|
2298
2338
|
] })
|
|
2299
2339
|
] }),
|
|
2300
2340
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|