@rhinestone/deposit-modal 0.1.53 → 0.1.54
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-LNZ46L4O.mjs → DepositModalReown-5QKEE7R3.mjs} +3 -3
- package/dist/{DepositModalReown-OXAW4Y7O.cjs → DepositModalReown-XKP2Z55X.cjs} +4 -4
- package/dist/{WithdrawModalReown-EE74V66X.mjs → WithdrawModalReown-DN6OKFGR.mjs} +3 -3
- package/dist/{WithdrawModalReown-V3ZJESQ5.cjs → WithdrawModalReown-ZQCNJLSP.cjs} +4 -4
- package/dist/{chunk-ZB5Y2ACC.mjs → chunk-AJUR6FAP.mjs} +23 -8
- package/dist/{chunk-ZJQZEIHA.mjs → chunk-CIXHTOO3.mjs} +1 -1
- package/dist/{chunk-DBBSH7HP.cjs → chunk-EAEDK474.cjs} +58 -32
- package/dist/{chunk-K57KO3SW.cjs → chunk-GOMHX544.cjs} +80 -74
- package/dist/{chunk-REDAO3MS.mjs → chunk-JQTV5JTB.mjs} +37 -11
- package/dist/{chunk-47WDWD6Z.cjs → chunk-QJVXCBUI.cjs} +231 -216
- package/dist/{chunk-NELAYNA3.cjs → chunk-R6U6BHCV.cjs} +1 -1
- package/dist/{chunk-4BL7RCZB.mjs → chunk-XXB2LVUB.mjs} +23 -17
- 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 +45 -55
- package/dist/{types-D1nvo2dK.d.ts → types-BPE95RUG.d.ts} +2 -0
- package/dist/{types-DgiqazTb.d.cts → types-Cm5vGVK2.d.cts} +2 -0
- package/dist/withdraw.cjs +4 -4
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +3 -3
- package/package.json +1 -1
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _chunkEAEDK474cjs = require('./chunk-EAEDK474.cjs');
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
@@ -41,7 +41,7 @@ var _chunkDBBSH7HPcjs = require('./chunk-DBBSH7HP.cjs');
|
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
var
|
|
44
|
+
var _chunkR6U6BHCVcjs = require('./chunk-R6U6BHCV.cjs');
|
|
45
45
|
|
|
46
46
|
// src/DepositModal.tsx
|
|
47
47
|
|
|
@@ -61,15 +61,15 @@ var _react = require('react');
|
|
|
61
61
|
|
|
62
62
|
var _jsxruntime = require('react/jsx-runtime');
|
|
63
63
|
async function resolveSessionOwner(eoaAddress) {
|
|
64
|
-
const localOwner =
|
|
64
|
+
const localOwner = _chunkEAEDK474cjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
65
65
|
if (localOwner) {
|
|
66
66
|
return {
|
|
67
|
-
account:
|
|
67
|
+
account: _chunkEAEDK474cjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
68
68
|
address: localOwner.address
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
-
const created =
|
|
72
|
-
|
|
71
|
+
const created = _chunkEAEDK474cjs.createSessionOwnerKey.call(void 0, );
|
|
72
|
+
_chunkEAEDK474cjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
73
73
|
return {
|
|
74
74
|
account: created.account,
|
|
75
75
|
address: created.address
|
|
@@ -105,7 +105,7 @@ function SetupStep({
|
|
|
105
105
|
const setup = await service.setupAccount({
|
|
106
106
|
ownerAddress: address,
|
|
107
107
|
sessionOwnerAddress: sessionOwner.address,
|
|
108
|
-
targetChain:
|
|
108
|
+
targetChain: _chunkEAEDK474cjs.toEvmCaip2.call(void 0, targetChain),
|
|
109
109
|
targetToken,
|
|
110
110
|
signerAddress,
|
|
111
111
|
sessionChainIds,
|
|
@@ -135,7 +135,7 @@ function SetupStep({
|
|
|
135
135
|
primaryType: typedData.primaryType,
|
|
136
136
|
message: typedData.message
|
|
137
137
|
});
|
|
138
|
-
const sessionDetails =
|
|
138
|
+
const sessionDetails = _chunkEAEDK474cjs.buildSessionDetails.call(void 0, setup.sessionDetailsUnsigned, signature);
|
|
139
139
|
setState({ type: "registering" });
|
|
140
140
|
const registerResult = await service.registerAccount({
|
|
141
141
|
address: smartAccount,
|
|
@@ -147,7 +147,7 @@ function SetupStep({
|
|
|
147
147
|
eoaAddress: address,
|
|
148
148
|
sessionOwner: sessionOwner.address,
|
|
149
149
|
target: {
|
|
150
|
-
chain:
|
|
150
|
+
chain: _chunkEAEDK474cjs.toEvmCaip2.call(void 0, targetChain),
|
|
151
151
|
token: targetToken,
|
|
152
152
|
...recipient && { recipient }
|
|
153
153
|
}
|
|
@@ -210,7 +210,7 @@ function SetupStep({
|
|
|
210
210
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
211
211
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", children: [
|
|
212
212
|
isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
213
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
213
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEAEDK474cjs.Spinner, { className: "rs-spinner--lg rs-text-accent" }),
|
|
214
214
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-text", children: [
|
|
215
215
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-title", children: renderStateMessage() }),
|
|
216
216
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-subtitle", children: "This may take a moment" })
|
|
@@ -247,7 +247,7 @@ function SetupStep({
|
|
|
247
247
|
] })
|
|
248
248
|
] })
|
|
249
249
|
] }),
|
|
250
|
-
isError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
250
|
+
isError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEAEDK474cjs.Button, { onClick: handleRetry, variant: "default", fullWidth: true, children: "Try Again" }) })
|
|
251
251
|
] });
|
|
252
252
|
}
|
|
253
253
|
|
|
@@ -272,7 +272,7 @@ function AssetSelectStep({
|
|
|
272
272
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
273
273
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
274
274
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
275
|
-
return
|
|
275
|
+
return _chunkEAEDK474cjs.getAssetId.call(void 0, {
|
|
276
276
|
chainId: defaultSourceChain,
|
|
277
277
|
token: defaultSourceToken
|
|
278
278
|
});
|
|
@@ -289,10 +289,10 @@ function AssetSelectStep({
|
|
|
289
289
|
try {
|
|
290
290
|
const portfolio = await service.fetchPortfolio(address);
|
|
291
291
|
if (!active) return;
|
|
292
|
-
const portfolioAssets =
|
|
292
|
+
const portfolioAssets = _chunkEAEDK474cjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
293
293
|
setAssets(portfolioAssets);
|
|
294
294
|
const hasNative = portfolioAssets.some(
|
|
295
|
-
(asset) => asset.token.toLowerCase() ===
|
|
295
|
+
(asset) => asset.token.toLowerCase() === _chunkR6U6BHCVcjs.NATIVE_TOKEN_ADDRESS
|
|
296
296
|
);
|
|
297
297
|
if (!hasNative) {
|
|
298
298
|
const nativeAssets = await fetchNativeAssets(
|
|
@@ -370,7 +370,7 @@ function AssetSelectStep({
|
|
|
370
370
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
371
371
|
const numeric = Number(raw);
|
|
372
372
|
if (!Number.isFinite(numeric)) return raw;
|
|
373
|
-
return
|
|
373
|
+
return _chunkEAEDK474cjs.tokenFormatter.format(numeric);
|
|
374
374
|
} catch (e3) {
|
|
375
375
|
return asset.balance;
|
|
376
376
|
}
|
|
@@ -384,7 +384,7 @@ function AssetSelectStep({
|
|
|
384
384
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
385
385
|
children: [
|
|
386
386
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
387
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
387
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEAEDK474cjs.Spinner, { className: "rs-text-tertiary" }),
|
|
388
388
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
389
389
|
] }),
|
|
390
390
|
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 }) }),
|
|
@@ -417,9 +417,9 @@ function AssetSelectStep({
|
|
|
417
417
|
!loading && !error && rows.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: rows.map((asset) => {
|
|
418
418
|
const isSelected = selectedAssetId === asset.id;
|
|
419
419
|
const tokenAmount = formatBalance(asset);
|
|
420
|
-
const badge =
|
|
421
|
-
const tokenIcon =
|
|
422
|
-
const chainIcon =
|
|
420
|
+
const badge = _chunkR6U6BHCVcjs.getChainBadge.call(void 0, asset.chainId);
|
|
421
|
+
const tokenIcon = _chunkR6U6BHCVcjs.getTokenIcon.call(void 0, asset.symbol);
|
|
422
|
+
const chainIcon = _chunkR6U6BHCVcjs.getChainIcon.call(void 0, asset.chainId);
|
|
423
423
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
424
424
|
"button",
|
|
425
425
|
{
|
|
@@ -443,7 +443,7 @@ function AssetSelectStep({
|
|
|
443
443
|
"img",
|
|
444
444
|
{
|
|
445
445
|
src: chainIcon,
|
|
446
|
-
alt:
|
|
446
|
+
alt: _chunkR6U6BHCVcjs.getChainName.call(void 0, asset.chainId),
|
|
447
447
|
className: "rs-asset-chain-badge"
|
|
448
448
|
}
|
|
449
449
|
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -464,7 +464,7 @@ function AssetSelectStep({
|
|
|
464
464
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-asset-chain", children: [
|
|
465
465
|
" ",
|
|
466
466
|
"on ",
|
|
467
|
-
|
|
467
|
+
_chunkR6U6BHCVcjs.getChainName.call(void 0, asset.chainId)
|
|
468
468
|
] })
|
|
469
469
|
] }),
|
|
470
470
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-balance-small", children: [
|
|
@@ -474,7 +474,7 @@ function AssetSelectStep({
|
|
|
474
474
|
] })
|
|
475
475
|
] })
|
|
476
476
|
] }),
|
|
477
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ?
|
|
477
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunkEAEDK474cjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
478
478
|
]
|
|
479
479
|
},
|
|
480
480
|
asset.id
|
|
@@ -484,7 +484,7 @@ function AssetSelectStep({
|
|
|
484
484
|
}
|
|
485
485
|
),
|
|
486
486
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
487
|
-
|
|
487
|
+
_chunkEAEDK474cjs.Button,
|
|
488
488
|
{
|
|
489
489
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
490
490
|
disabled: !selectedAsset,
|
|
@@ -492,17 +492,17 @@ function AssetSelectStep({
|
|
|
492
492
|
children: "Continue"
|
|
493
493
|
}
|
|
494
494
|
) }),
|
|
495
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
495
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEAEDK474cjs.PoweredBy, {})
|
|
496
496
|
] });
|
|
497
497
|
}
|
|
498
498
|
async function fetchNativeAssets(address, publicClient, existing) {
|
|
499
499
|
const existingIds = new Set(existing.map((asset) => asset.id));
|
|
500
500
|
const connectedChainId = _optionalChain([publicClient, 'access', _10 => _10.chain, 'optionalAccess', _11 => _11.id]);
|
|
501
501
|
if (!connectedChainId) return [];
|
|
502
|
-
if (!
|
|
503
|
-
const id =
|
|
502
|
+
if (!_chunkR6U6BHCVcjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
|
|
503
|
+
const id = _chunkEAEDK474cjs.getAssetId.call(void 0, {
|
|
504
504
|
chainId: connectedChainId,
|
|
505
|
-
token:
|
|
505
|
+
token: _chunkR6U6BHCVcjs.NATIVE_TOKEN_ADDRESS
|
|
506
506
|
});
|
|
507
507
|
if (existingIds.has(id)) return [];
|
|
508
508
|
try {
|
|
@@ -511,7 +511,7 @@ async function fetchNativeAssets(address, publicClient, existing) {
|
|
|
511
511
|
{
|
|
512
512
|
id,
|
|
513
513
|
chainId: connectedChainId,
|
|
514
|
-
token:
|
|
514
|
+
token: _chunkR6U6BHCVcjs.NATIVE_TOKEN_ADDRESS,
|
|
515
515
|
symbol: "ETH",
|
|
516
516
|
name: "Ethereum",
|
|
517
517
|
decimals: 18,
|
|
@@ -561,8 +561,8 @@ function AmountStep({
|
|
|
561
561
|
const chainMismatch = Boolean(
|
|
562
562
|
_optionalChain([walletClient, 'optionalAccess', _12 => _12.chain, 'optionalAccess', _13 => _13.id]) && walletClient.chain.id !== asset.chainId
|
|
563
563
|
);
|
|
564
|
-
const targetSymbol =
|
|
565
|
-
const isSourceStablecoin =
|
|
564
|
+
const targetSymbol = _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
565
|
+
const isSourceStablecoin = _chunkR6U6BHCVcjs.isStablecoinSymbol.call(void 0, asset.symbol);
|
|
566
566
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
567
567
|
if (tokenPriceUsdOverride !== void 0 && tokenPriceUsdOverride > 0)
|
|
568
568
|
return tokenPriceUsdOverride;
|
|
@@ -586,7 +586,7 @@ function AmountStep({
|
|
|
586
586
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
587
587
|
if (!balanceTarget || !publicClient) return;
|
|
588
588
|
try {
|
|
589
|
-
const bal =
|
|
589
|
+
const bal = _chunkEAEDK474cjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
590
590
|
address: asset.token,
|
|
591
591
|
abi: _viem.erc20Abi,
|
|
592
592
|
functionName: "balanceOf",
|
|
@@ -612,7 +612,7 @@ function AmountStep({
|
|
|
612
612
|
setIsSwitching(true);
|
|
613
613
|
switchChain(asset.chainId).catch((err) => {
|
|
614
614
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
615
|
-
setError(
|
|
615
|
+
setError(_chunkEAEDK474cjs.formatUserError.call(void 0, raw));
|
|
616
616
|
}).finally(() => {
|
|
617
617
|
setIsSwitching(false);
|
|
618
618
|
});
|
|
@@ -648,7 +648,7 @@ function AmountStep({
|
|
|
648
648
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
649
649
|
const numeric = Number(raw);
|
|
650
650
|
if (!Number.isFinite(numeric)) return raw;
|
|
651
|
-
return
|
|
651
|
+
return _chunkEAEDK474cjs.tokenFormatter.format(numeric);
|
|
652
652
|
} catch (e8) {
|
|
653
653
|
return "...";
|
|
654
654
|
}
|
|
@@ -690,7 +690,7 @@ function AmountStep({
|
|
|
690
690
|
const usdValue = numericAmount;
|
|
691
691
|
if (_optionalChain([uiConfig, 'optionalAccess', _15 => _15.maxDepositUsd]) && usdValue > uiConfig.maxDepositUsd) {
|
|
692
692
|
setError(
|
|
693
|
-
`Maximum deposit is ${
|
|
693
|
+
`Maximum deposit is ${_chunkEAEDK474cjs.currencyFormatter.format(uiConfig.maxDepositUsd)}`
|
|
694
694
|
);
|
|
695
695
|
return;
|
|
696
696
|
}
|
|
@@ -744,7 +744,7 @@ function AmountStep({
|
|
|
744
744
|
hasPricing && balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { style: { color: "var(--rs-muted-foreground)" }, children: [
|
|
745
745
|
" ",
|
|
746
746
|
"(",
|
|
747
|
-
|
|
747
|
+
_chunkEAEDK474cjs.currencyFormatter.format(balanceUsd),
|
|
748
748
|
")"
|
|
749
749
|
] })
|
|
750
750
|
] }) })
|
|
@@ -758,26 +758,26 @@ function AmountStep({
|
|
|
758
758
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-flow-pill-label", children: "You send" }),
|
|
759
759
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-flow-pill-token", children: [
|
|
760
760
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-flow-pill-token-icon-wrapper", children: [
|
|
761
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-flow-pill-token-icon", children:
|
|
761
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-flow-pill-token-icon", children: _chunkR6U6BHCVcjs.getTokenIcon.call(void 0, asset.symbol) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
762
762
|
"img",
|
|
763
763
|
{
|
|
764
|
-
src:
|
|
764
|
+
src: _chunkR6U6BHCVcjs.getTokenIcon.call(void 0, asset.symbol),
|
|
765
765
|
alt: asset.symbol
|
|
766
766
|
}
|
|
767
767
|
) : asset.symbol.slice(0, 2) }),
|
|
768
768
|
(() => {
|
|
769
|
-
const chainIcon =
|
|
769
|
+
const chainIcon = _chunkR6U6BHCVcjs.getChainIcon.call(void 0, asset.chainId);
|
|
770
770
|
if (chainIcon) {
|
|
771
771
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
772
772
|
"img",
|
|
773
773
|
{
|
|
774
774
|
src: chainIcon,
|
|
775
|
-
alt:
|
|
775
|
+
alt: _chunkR6U6BHCVcjs.getChainName.call(void 0, asset.chainId),
|
|
776
776
|
className: "rs-flow-pill-chain-badge"
|
|
777
777
|
}
|
|
778
778
|
);
|
|
779
779
|
}
|
|
780
|
-
const badge =
|
|
780
|
+
const badge = _chunkR6U6BHCVcjs.getChainBadge.call(void 0, asset.chainId);
|
|
781
781
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
782
782
|
"div",
|
|
783
783
|
{
|
|
@@ -815,26 +815,26 @@ function AmountStep({
|
|
|
815
815
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-flow-pill-label", children: "You receive" }),
|
|
816
816
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-flow-pill-token", children: [
|
|
817
817
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-flow-pill-token-icon-wrapper", children: [
|
|
818
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-flow-pill-token-icon", children:
|
|
818
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-flow-pill-token-icon", children: _chunkR6U6BHCVcjs.getTokenIcon.call(void 0, targetSymbol) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
819
819
|
"img",
|
|
820
820
|
{
|
|
821
|
-
src:
|
|
821
|
+
src: _chunkR6U6BHCVcjs.getTokenIcon.call(void 0, targetSymbol),
|
|
822
822
|
alt: targetSymbol
|
|
823
823
|
}
|
|
824
824
|
) : targetSymbol.slice(0, 2) }),
|
|
825
825
|
(() => {
|
|
826
|
-
const chainIcon =
|
|
826
|
+
const chainIcon = _chunkR6U6BHCVcjs.getChainIcon.call(void 0, targetChain);
|
|
827
827
|
if (chainIcon) {
|
|
828
828
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
829
829
|
"img",
|
|
830
830
|
{
|
|
831
831
|
src: chainIcon,
|
|
832
|
-
alt:
|
|
832
|
+
alt: _chunkR6U6BHCVcjs.getChainName.call(void 0, targetChain),
|
|
833
833
|
className: "rs-flow-pill-chain-badge"
|
|
834
834
|
}
|
|
835
835
|
);
|
|
836
836
|
}
|
|
837
|
-
const badge =
|
|
837
|
+
const badge = _chunkR6U6BHCVcjs.getChainBadge.call(void 0, targetChain);
|
|
838
838
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
839
839
|
"div",
|
|
840
840
|
{
|
|
@@ -881,7 +881,7 @@ function AmountStep({
|
|
|
881
881
|
)
|
|
882
882
|
] }),
|
|
883
883
|
_optionalChain([uiConfig, 'optionalAccess', _17 => _17.minDepositUsd]) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-minimum", children: [
|
|
884
|
-
|
|
884
|
+
_chunkEAEDK474cjs.currencyFormatter.format(uiConfig.minDepositUsd),
|
|
885
885
|
" minimum deposit"
|
|
886
886
|
] }),
|
|
887
887
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", children: [
|
|
@@ -907,7 +907,7 @@ function AmountStep({
|
|
|
907
907
|
] })
|
|
908
908
|
] }),
|
|
909
909
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
910
|
-
|
|
910
|
+
_chunkEAEDK474cjs.Button,
|
|
911
911
|
{
|
|
912
912
|
onClick: handleContinue,
|
|
913
913
|
fullWidth: true,
|
|
@@ -915,7 +915,7 @@ function AmountStep({
|
|
|
915
915
|
children: _optionalChain([uiConfig, 'optionalAccess', _18 => _18.minDepositUsd]) && parseFloat(amount) > 0 && parseFloat(amount) < uiConfig.minDepositUsd ? "Update order" : "Continue"
|
|
916
916
|
}
|
|
917
917
|
) }),
|
|
918
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
918
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEAEDK474cjs.PoweredBy, {})
|
|
919
919
|
] });
|
|
920
920
|
}
|
|
921
921
|
|
|
@@ -946,7 +946,7 @@ function ConfirmStep({
|
|
|
946
946
|
const hasAttemptedSwitch = _react.useRef.call(void 0, false);
|
|
947
947
|
const chainMismatch = _optionalChain([walletClient, 'optionalAccess', _19 => _19.chain, 'optionalAccess', _20 => _20.id]) && walletClient.chain.id !== asset.chainId;
|
|
948
948
|
const sameRoute = targetChain === asset.chainId && targetToken.toLowerCase() === asset.token.toLowerCase();
|
|
949
|
-
const targetSymbol = sameRoute ? asset.symbol :
|
|
949
|
+
const targetSymbol = sameRoute ? asset.symbol : _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
950
950
|
const formattedSendAmount = amount && !Number.isNaN(Number(amount)) ? Number(amount).toLocaleString("en-US", { maximumFractionDigits: 6 }) : "0";
|
|
951
951
|
const formattedReceiveAmount = (() => {
|
|
952
952
|
if (sameRoute) return formattedSendAmount;
|
|
@@ -965,7 +965,7 @@ function ConfirmStep({
|
|
|
965
965
|
setIsSwitching(true);
|
|
966
966
|
switchChain(asset.chainId).catch((err) => {
|
|
967
967
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
968
|
-
setError(
|
|
968
|
+
setError(_chunkEAEDK474cjs.formatUserError.call(void 0, raw));
|
|
969
969
|
}).finally(() => {
|
|
970
970
|
setIsSwitching(false);
|
|
971
971
|
});
|
|
@@ -980,7 +980,7 @@ function ConfirmStep({
|
|
|
980
980
|
return;
|
|
981
981
|
}
|
|
982
982
|
if (chainMismatch) {
|
|
983
|
-
setError(`Switch to ${
|
|
983
|
+
setError(`Switch to ${_chunkR6U6BHCVcjs.getChainName.call(void 0, asset.chainId)} to sign`);
|
|
984
984
|
return;
|
|
985
985
|
}
|
|
986
986
|
const parsedAmount = parseFloat(amount);
|
|
@@ -1008,7 +1008,7 @@ function ConfirmStep({
|
|
|
1008
1008
|
throw new Error("Wallet not properly connected");
|
|
1009
1009
|
}
|
|
1010
1010
|
const transferTo = sameRoute ? recipient : smartAccount;
|
|
1011
|
-
const hash =
|
|
1011
|
+
const hash = _chunkEAEDK474cjs.isNativeAsset.call(void 0, asset) ? await walletClient.sendTransaction({
|
|
1012
1012
|
account,
|
|
1013
1013
|
chain,
|
|
1014
1014
|
to: transferTo,
|
|
@@ -1025,7 +1025,7 @@ function ConfirmStep({
|
|
|
1025
1025
|
onConfirm(hash, asset.chainId, amountUnits.toString(), asset.token);
|
|
1026
1026
|
} catch (err) {
|
|
1027
1027
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
1028
|
-
const message =
|
|
1028
|
+
const message = _chunkEAEDK474cjs.formatUserError.call(void 0, raw);
|
|
1029
1029
|
setError(message);
|
|
1030
1030
|
_optionalChain([onError, 'optionalCall', _22 => _22(message, "TRANSFER_ERROR")]);
|
|
1031
1031
|
} finally {
|
|
@@ -1044,15 +1044,15 @@ function ConfirmStep({
|
|
|
1044
1044
|
className: "rs-card-value",
|
|
1045
1045
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
1046
1046
|
children: [
|
|
1047
|
-
|
|
1047
|
+
_chunkR6U6BHCVcjs.getChainIcon.call(void 0, asset.chainId) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1048
1048
|
"img",
|
|
1049
1049
|
{
|
|
1050
|
-
src:
|
|
1050
|
+
src: _chunkR6U6BHCVcjs.getChainIcon.call(void 0, asset.chainId),
|
|
1051
1051
|
alt: "",
|
|
1052
1052
|
style: { width: 16, height: 16, borderRadius: 3 }
|
|
1053
1053
|
}
|
|
1054
1054
|
),
|
|
1055
|
-
|
|
1055
|
+
_chunkR6U6BHCVcjs.getChainName.call(void 0, asset.chainId)
|
|
1056
1056
|
]
|
|
1057
1057
|
}
|
|
1058
1058
|
)
|
|
@@ -1065,15 +1065,15 @@ function ConfirmStep({
|
|
|
1065
1065
|
className: "rs-card-value",
|
|
1066
1066
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
1067
1067
|
children: [
|
|
1068
|
-
|
|
1068
|
+
_chunkR6U6BHCVcjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1069
1069
|
"img",
|
|
1070
1070
|
{
|
|
1071
|
-
src:
|
|
1071
|
+
src: _chunkR6U6BHCVcjs.getChainIcon.call(void 0, targetChain),
|
|
1072
1072
|
alt: "",
|
|
1073
1073
|
style: { width: 16, height: 16, borderRadius: 3 }
|
|
1074
1074
|
}
|
|
1075
1075
|
),
|
|
1076
|
-
|
|
1076
|
+
_chunkR6U6BHCVcjs.getChainName.call(void 0, targetChain)
|
|
1077
1077
|
]
|
|
1078
1078
|
}
|
|
1079
1079
|
)
|
|
@@ -1092,10 +1092,10 @@ function ConfirmStep({
|
|
|
1092
1092
|
className: "rs-card-value",
|
|
1093
1093
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
1094
1094
|
children: [
|
|
1095
|
-
|
|
1095
|
+
_chunkR6U6BHCVcjs.getTokenIcon.call(void 0, asset.symbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1096
1096
|
"img",
|
|
1097
1097
|
{
|
|
1098
|
-
src:
|
|
1098
|
+
src: _chunkR6U6BHCVcjs.getTokenIcon.call(void 0, asset.symbol),
|
|
1099
1099
|
alt: "",
|
|
1100
1100
|
style: { width: 16, height: 16, borderRadius: "50%" }
|
|
1101
1101
|
}
|
|
@@ -1115,10 +1115,10 @@ function ConfirmStep({
|
|
|
1115
1115
|
className: "rs-card-value",
|
|
1116
1116
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
1117
1117
|
children: [
|
|
1118
|
-
|
|
1118
|
+
_chunkR6U6BHCVcjs.getTokenIcon.call(void 0, targetSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1119
1119
|
"img",
|
|
1120
1120
|
{
|
|
1121
|
-
src:
|
|
1121
|
+
src: _chunkR6U6BHCVcjs.getTokenIcon.call(void 0, targetSymbol),
|
|
1122
1122
|
alt: "",
|
|
1123
1123
|
style: { width: 16, height: 16, borderRadius: "50%" }
|
|
1124
1124
|
}
|
|
@@ -1154,7 +1154,7 @@ function ConfirmStep({
|
|
|
1154
1154
|
] })
|
|
1155
1155
|
] }),
|
|
1156
1156
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1157
|
-
|
|
1157
|
+
_chunkEAEDK474cjs.Button,
|
|
1158
1158
|
{
|
|
1159
1159
|
onClick: handleConfirm,
|
|
1160
1160
|
loading: isSubmitting,
|
|
@@ -1163,7 +1163,7 @@ function ConfirmStep({
|
|
|
1163
1163
|
children: "Confirm Order"
|
|
1164
1164
|
}
|
|
1165
1165
|
) }),
|
|
1166
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1166
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEAEDK474cjs.PoweredBy, {})
|
|
1167
1167
|
] });
|
|
1168
1168
|
}
|
|
1169
1169
|
|
|
@@ -1453,11 +1453,23 @@ function DepositAddressStep({
|
|
|
1453
1453
|
smartAccount,
|
|
1454
1454
|
solanaDepositAddress,
|
|
1455
1455
|
service,
|
|
1456
|
+
allowedRoutes,
|
|
1456
1457
|
onDepositDetected,
|
|
1457
1458
|
onError
|
|
1458
1459
|
}) {
|
|
1459
1460
|
const hasSolana = Boolean(solanaDepositAddress);
|
|
1460
|
-
const
|
|
1461
|
+
const allowedChainSet = _react.useMemo.call(void 0,
|
|
1462
|
+
() => _optionalChain([allowedRoutes, 'optionalAccess', _29 => _29.sourceChains]) ? new Set(allowedRoutes.sourceChains) : null,
|
|
1463
|
+
[_optionalChain([allowedRoutes, 'optionalAccess', _30 => _30.sourceChains])]
|
|
1464
|
+
);
|
|
1465
|
+
const allowedTokenSet = _react.useMemo.call(void 0,
|
|
1466
|
+
() => _optionalChain([allowedRoutes, 'optionalAccess', _31 => _31.sourceTokens]) ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null,
|
|
1467
|
+
[_optionalChain([allowedRoutes, 'optionalAccess', _32 => _32.sourceTokens])]
|
|
1468
|
+
);
|
|
1469
|
+
const evmChainIds = _react.useMemo.call(void 0, () => {
|
|
1470
|
+
const all = _chunkR6U6BHCVcjs.getSupportedChainIds.call(void 0, );
|
|
1471
|
+
return allowedChainSet ? all.filter((id) => allowedChainSet.has(id)) : all;
|
|
1472
|
+
}, [allowedChainSet]);
|
|
1461
1473
|
const chainOptions = _react.useMemo.call(void 0,
|
|
1462
1474
|
() => hasSolana ? [...evmChainIds, "solana"] : evmChainIds,
|
|
1463
1475
|
[evmChainIds, hasSolana]
|
|
@@ -1466,10 +1478,10 @@ function DepositAddressStep({
|
|
|
1466
1478
|
const defaultChainId = evmChainIds.includes(BASE_CHAIN_ID) ? BASE_CHAIN_ID : evmChainIds[0];
|
|
1467
1479
|
const [sourceChainId, setSourceChainId] = _react.useState.call(void 0, defaultChainId);
|
|
1468
1480
|
const isSolana = sourceChainId === "solana";
|
|
1469
|
-
const tokensForChain = _react.useMemo.call(void 0,
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
);
|
|
1481
|
+
const tokensForChain = _react.useMemo.call(void 0, () => {
|
|
1482
|
+
const all = isSolana ? SOLANA_TOKENS.map((t) => t.symbol) : _chunkR6U6BHCVcjs.getTargetTokenSymbolsForChain.call(void 0, sourceChainId);
|
|
1483
|
+
return allowedTokenSet ? all.filter((s) => allowedTokenSet.has(s.toUpperCase())) : all;
|
|
1484
|
+
}, [sourceChainId, isSolana, allowedTokenSet]);
|
|
1473
1485
|
const defaultToken = tokensForChain.includes("USDC") ? "USDC" : _nullishCoalesce(tokensForChain[0], () => ( "USDC"));
|
|
1474
1486
|
const [sourceTokenSymbol, setSourceTokenSymbol] = _react.useState.call(void 0, defaultToken);
|
|
1475
1487
|
_react.useEffect.call(void 0, () => {
|
|
@@ -1487,7 +1499,7 @@ function DepositAddressStep({
|
|
|
1487
1499
|
const depositHandledRef = _react.useRef.call(void 0, false);
|
|
1488
1500
|
const sourceSelectionRef = _react.useRef.call(void 0, {
|
|
1489
1501
|
chainId: defaultChainId,
|
|
1490
|
-
token: typeof defaultChainId === "number" ?
|
|
1502
|
+
token: typeof defaultChainId === "number" ? _chunkR6U6BHCVcjs.getTokenAddress.call(void 0, defaultToken, defaultChainId) : void 0,
|
|
1491
1503
|
sourceSymbol: defaultToken
|
|
1492
1504
|
});
|
|
1493
1505
|
_react.useEffect.call(void 0, () => {
|
|
@@ -1495,15 +1507,15 @@ function DepositAddressStep({
|
|
|
1495
1507
|
const matched = _nullishCoalesce(SOLANA_TOKENS.find((t) => t.symbol === sourceTokenSymbol), () => ( SOLANA_TOKENS[0]));
|
|
1496
1508
|
sourceSelectionRef.current = {
|
|
1497
1509
|
chainId: "solana",
|
|
1498
|
-
token: _optionalChain([matched, 'optionalAccess',
|
|
1499
|
-
sourceSymbol: _optionalChain([matched, 'optionalAccess',
|
|
1500
|
-
sourceDecimals: _optionalChain([matched, 'optionalAccess',
|
|
1510
|
+
token: _optionalChain([matched, 'optionalAccess', _33 => _33.mint]),
|
|
1511
|
+
sourceSymbol: _optionalChain([matched, 'optionalAccess', _34 => _34.symbol]),
|
|
1512
|
+
sourceDecimals: _optionalChain([matched, 'optionalAccess', _35 => _35.decimals])
|
|
1501
1513
|
};
|
|
1502
1514
|
return;
|
|
1503
1515
|
}
|
|
1504
1516
|
sourceSelectionRef.current = {
|
|
1505
1517
|
chainId: sourceChainId,
|
|
1506
|
-
token:
|
|
1518
|
+
token: _chunkR6U6BHCVcjs.getTokenAddress.call(void 0, sourceTokenSymbol, sourceChainId),
|
|
1507
1519
|
sourceSymbol: sourceTokenSymbol
|
|
1508
1520
|
};
|
|
1509
1521
|
}, [sourceChainId, sourceTokenSymbol, isSolana]);
|
|
@@ -1513,8 +1525,8 @@ function DepositAddressStep({
|
|
|
1513
1525
|
function handlePointerDown(event) {
|
|
1514
1526
|
const target = event.target;
|
|
1515
1527
|
if (!target) return;
|
|
1516
|
-
const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access',
|
|
1517
|
-
const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access',
|
|
1528
|
+
const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access', _36 => _36.current, 'optionalAccess', _37 => _37.contains, 'call', _38 => _38(target)]);
|
|
1529
|
+
const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access', _39 => _39.current, 'optionalAccess', _40 => _40.contains, 'call', _41 => _41(target)]);
|
|
1518
1530
|
if (clickedChainDropdown || clickedTokenDropdown) return;
|
|
1519
1531
|
setChainDropdownOpen(false);
|
|
1520
1532
|
setTokenDropdownOpen(false);
|
|
@@ -1561,10 +1573,10 @@ function DepositAddressStep({
|
|
|
1561
1573
|
const status = await service.fetchLatestStatus(smartAccount);
|
|
1562
1574
|
if (cancelled || depositHandledRef.current) return;
|
|
1563
1575
|
const event = status.lastEvent;
|
|
1564
|
-
const eventTxHash =
|
|
1576
|
+
const eventTxHash = _chunkEAEDK474cjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkEAEDK474cjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
1565
1577
|
if (baselineTxHash === void 0) {
|
|
1566
1578
|
baselineTxHash = eventTxHash;
|
|
1567
|
-
} else if (eventTxHash && (!baselineTxHash || !
|
|
1579
|
+
} else if (eventTxHash && (!baselineTxHash || !_chunkEAEDK474cjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHash))) {
|
|
1568
1580
|
const details = getDepositEventDetails(event);
|
|
1569
1581
|
const fallback = sourceSelectionRef.current;
|
|
1570
1582
|
const chainId = _nullishCoalesce(details.chainId, () => ( fallback.chainId));
|
|
@@ -1590,7 +1602,7 @@ function DepositAddressStep({
|
|
|
1590
1602
|
if (!cancelled) {
|
|
1591
1603
|
const msg = err instanceof Error ? err.message : "Failed to check status";
|
|
1592
1604
|
setPollingError(msg);
|
|
1593
|
-
_optionalChain([onError, 'optionalCall',
|
|
1605
|
+
_optionalChain([onError, 'optionalCall', _42 => _42(msg, "STATUS_POLL_ERROR")]);
|
|
1594
1606
|
}
|
|
1595
1607
|
}
|
|
1596
1608
|
if (!cancelled && !depositHandledRef.current) {
|
|
@@ -1603,7 +1615,7 @@ function DepositAddressStep({
|
|
|
1603
1615
|
clearTimeout(timeoutId);
|
|
1604
1616
|
};
|
|
1605
1617
|
}, [smartAccount, service, onDepositDetected, onError]);
|
|
1606
|
-
const qrIconSrc =
|
|
1618
|
+
const qrIconSrc = _chunkR6U6BHCVcjs.getChainIcon.call(void 0, sourceChainId);
|
|
1607
1619
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
1608
1620
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-body", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address", children: [
|
|
1609
1621
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", children: [
|
|
@@ -1619,15 +1631,15 @@ function DepositAddressStep({
|
|
|
1619
1631
|
setTokenDropdownOpen(false);
|
|
1620
1632
|
},
|
|
1621
1633
|
children: [
|
|
1622
|
-
|
|
1634
|
+
_chunkR6U6BHCVcjs.getChainIcon.call(void 0, sourceChainId) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1623
1635
|
"img",
|
|
1624
1636
|
{
|
|
1625
|
-
src:
|
|
1637
|
+
src: _chunkR6U6BHCVcjs.getChainIcon.call(void 0, sourceChainId),
|
|
1626
1638
|
alt: "",
|
|
1627
1639
|
className: "rs-deposit-address-dropdown-icon"
|
|
1628
1640
|
}
|
|
1629
1641
|
),
|
|
1630
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children:
|
|
1642
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunkR6U6BHCVcjs.getChainName.call(void 0, sourceChainId) }),
|
|
1631
1643
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1632
1644
|
"svg",
|
|
1633
1645
|
{
|
|
@@ -1659,15 +1671,15 @@ function DepositAddressStep({
|
|
|
1659
1671
|
setChainDropdownOpen(false);
|
|
1660
1672
|
},
|
|
1661
1673
|
children: [
|
|
1662
|
-
|
|
1674
|
+
_chunkR6U6BHCVcjs.getChainIcon.call(void 0, chainId) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1663
1675
|
"img",
|
|
1664
1676
|
{
|
|
1665
|
-
src:
|
|
1677
|
+
src: _chunkR6U6BHCVcjs.getChainIcon.call(void 0, chainId),
|
|
1666
1678
|
alt: "",
|
|
1667
1679
|
className: "rs-deposit-address-dropdown-icon"
|
|
1668
1680
|
}
|
|
1669
1681
|
),
|
|
1670
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children:
|
|
1682
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunkR6U6BHCVcjs.getChainName.call(void 0, chainId) })
|
|
1671
1683
|
]
|
|
1672
1684
|
},
|
|
1673
1685
|
String(chainId)
|
|
@@ -1685,10 +1697,10 @@ function DepositAddressStep({
|
|
|
1685
1697
|
setChainDropdownOpen(false);
|
|
1686
1698
|
},
|
|
1687
1699
|
children: [
|
|
1688
|
-
|
|
1700
|
+
_chunkR6U6BHCVcjs.getTokenIcon.call(void 0, sourceTokenSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1689
1701
|
"img",
|
|
1690
1702
|
{
|
|
1691
|
-
src:
|
|
1703
|
+
src: _chunkR6U6BHCVcjs.getTokenIcon.call(void 0, sourceTokenSymbol),
|
|
1692
1704
|
alt: "",
|
|
1693
1705
|
className: "rs-deposit-address-dropdown-icon"
|
|
1694
1706
|
}
|
|
@@ -1725,10 +1737,10 @@ function DepositAddressStep({
|
|
|
1725
1737
|
setTokenDropdownOpen(false);
|
|
1726
1738
|
},
|
|
1727
1739
|
children: [
|
|
1728
|
-
|
|
1740
|
+
_chunkR6U6BHCVcjs.getTokenIcon.call(void 0, symbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1729
1741
|
"img",
|
|
1730
1742
|
{
|
|
1731
|
-
src:
|
|
1743
|
+
src: _chunkR6U6BHCVcjs.getTokenIcon.call(void 0, symbol),
|
|
1732
1744
|
alt: "",
|
|
1733
1745
|
className: "rs-deposit-address-dropdown-icon"
|
|
1734
1746
|
}
|
|
@@ -1787,7 +1799,7 @@ function DepositAddressStep({
|
|
|
1787
1799
|
] }),
|
|
1788
1800
|
pollingError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-error", children: pollingError })
|
|
1789
1801
|
] }) }),
|
|
1790
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1802
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEAEDK474cjs.PoweredBy, {})
|
|
1791
1803
|
] });
|
|
1792
1804
|
}
|
|
1793
1805
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -1818,7 +1830,7 @@ function SolanaTokenSelectStep({
|
|
|
1818
1830
|
setError(null);
|
|
1819
1831
|
const portfolioBySymbol = {};
|
|
1820
1832
|
try {
|
|
1821
|
-
|
|
1833
|
+
_chunkEAEDK474cjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
|
|
1822
1834
|
solanaAddress
|
|
1823
1835
|
});
|
|
1824
1836
|
const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
|
|
@@ -1841,12 +1853,12 @@ function SolanaTokenSelectStep({
|
|
|
1841
1853
|
};
|
|
1842
1854
|
}
|
|
1843
1855
|
}
|
|
1844
|
-
|
|
1856
|
+
_chunkEAEDK474cjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
|
|
1845
1857
|
symbols: Object.keys(portfolioBySymbol)
|
|
1846
1858
|
});
|
|
1847
1859
|
} catch (err) {
|
|
1848
1860
|
if (!active) return;
|
|
1849
|
-
|
|
1861
|
+
_chunkEAEDK474cjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
|
|
1850
1862
|
solanaAddress
|
|
1851
1863
|
});
|
|
1852
1864
|
setError(
|
|
@@ -1871,7 +1883,7 @@ function SolanaTokenSelectStep({
|
|
|
1871
1883
|
setTokenBalances(results);
|
|
1872
1884
|
setLoading(false);
|
|
1873
1885
|
const totalUsd = results.reduce((sum, r) => sum + r.balanceUsd, 0);
|
|
1874
|
-
_optionalChain([onTotalBalanceComputed, 'optionalCall',
|
|
1886
|
+
_optionalChain([onTotalBalanceComputed, 'optionalCall', _43 => _43(totalUsd)]);
|
|
1875
1887
|
}
|
|
1876
1888
|
void loadBalances();
|
|
1877
1889
|
return () => {
|
|
@@ -1900,7 +1912,7 @@ function SolanaTokenSelectStep({
|
|
|
1900
1912
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
1901
1913
|
children: [
|
|
1902
1914
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
1903
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1915
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEAEDK474cjs.Spinner, { className: "rs-text-tertiary" }),
|
|
1904
1916
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
1905
1917
|
] }),
|
|
1906
1918
|
!loading && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
@@ -1931,13 +1943,13 @@ function SolanaTokenSelectStep({
|
|
|
1931
1943
|
] }),
|
|
1932
1944
|
!loading && rows.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: rows.map((entry) => {
|
|
1933
1945
|
const isSelected = selectedSymbol === entry.token.symbol;
|
|
1934
|
-
const tokenIcon =
|
|
1935
|
-
const chainIcon =
|
|
1946
|
+
const tokenIcon = _chunkR6U6BHCVcjs.getTokenIcon.call(void 0, entry.token.symbol);
|
|
1947
|
+
const chainIcon = _chunkR6U6BHCVcjs.getChainIcon.call(void 0, "solana");
|
|
1936
1948
|
let formattedBalance;
|
|
1937
1949
|
try {
|
|
1938
1950
|
const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
|
|
1939
1951
|
const numeric = Number(raw);
|
|
1940
|
-
formattedBalance = Number.isFinite(numeric) ?
|
|
1952
|
+
formattedBalance = Number.isFinite(numeric) ? _chunkEAEDK474cjs.tokenFormatter.format(numeric) : raw;
|
|
1941
1953
|
} catch (e14) {
|
|
1942
1954
|
formattedBalance = "...";
|
|
1943
1955
|
}
|
|
@@ -1981,7 +1993,7 @@ function SolanaTokenSelectStep({
|
|
|
1981
1993
|
] })
|
|
1982
1994
|
] })
|
|
1983
1995
|
] }),
|
|
1984
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ?
|
|
1996
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunkEAEDK474cjs.currencyFormatter.format(entry.balanceUsd) : `${formattedBalance} ${entry.token.symbol}` })
|
|
1985
1997
|
]
|
|
1986
1998
|
},
|
|
1987
1999
|
entry.token.symbol
|
|
@@ -1991,7 +2003,7 @@ function SolanaTokenSelectStep({
|
|
|
1991
2003
|
}
|
|
1992
2004
|
),
|
|
1993
2005
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1994
|
-
|
|
2006
|
+
_chunkEAEDK474cjs.Button,
|
|
1995
2007
|
{
|
|
1996
2008
|
onClick: () => selectedEntry && onContinue(
|
|
1997
2009
|
selectedEntry.token,
|
|
@@ -2003,7 +2015,7 @@ function SolanaTokenSelectStep({
|
|
|
2003
2015
|
children: "Continue"
|
|
2004
2016
|
}
|
|
2005
2017
|
) }),
|
|
2006
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2018
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEAEDK474cjs.PoweredBy, {})
|
|
2007
2019
|
] });
|
|
2008
2020
|
}
|
|
2009
2021
|
|
|
@@ -2023,7 +2035,7 @@ function SolanaAmountStep({
|
|
|
2023
2035
|
}) {
|
|
2024
2036
|
const [amount, setAmount] = _react.useState.call(void 0, "");
|
|
2025
2037
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
2026
|
-
const isSourceStablecoin =
|
|
2038
|
+
const isSourceStablecoin = _chunkR6U6BHCVcjs.isStablecoinSymbol.call(void 0, token.symbol);
|
|
2027
2039
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
2028
2040
|
if (isSourceStablecoin) return 1;
|
|
2029
2041
|
try {
|
|
@@ -2051,7 +2063,7 @@ function SolanaAmountStep({
|
|
|
2051
2063
|
const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
|
|
2052
2064
|
const numeric = Number(raw);
|
|
2053
2065
|
if (!Number.isFinite(numeric)) return raw;
|
|
2054
|
-
return
|
|
2066
|
+
return _chunkEAEDK474cjs.tokenFormatter.format(numeric);
|
|
2055
2067
|
} catch (e16) {
|
|
2056
2068
|
return "...";
|
|
2057
2069
|
}
|
|
@@ -2069,7 +2081,7 @@ function SolanaAmountStep({
|
|
|
2069
2081
|
}, [balance, token.decimals, tokenPriceUsd, balanceUsd]);
|
|
2070
2082
|
const formattedBalanceUsd = _react.useMemo.call(void 0, () => {
|
|
2071
2083
|
if (computedBalanceUsd === null || computedBalanceUsd <= 0) return null;
|
|
2072
|
-
return
|
|
2084
|
+
return _chunkEAEDK474cjs.currencyFormatter.format(computedBalanceUsd);
|
|
2073
2085
|
}, [computedBalanceUsd]);
|
|
2074
2086
|
const spendableBalance = _react.useMemo.call(void 0, () => {
|
|
2075
2087
|
if (!isNativeSol(token)) return balance;
|
|
@@ -2094,7 +2106,7 @@ function SolanaAmountStep({
|
|
|
2094
2106
|
const factor = 10 ** maxDecimals;
|
|
2095
2107
|
const truncated = Math.floor(value * factor) / factor;
|
|
2096
2108
|
const formatted = truncated.toFixed(maxDecimals).replace(/\.?0+$/, "");
|
|
2097
|
-
|
|
2109
|
+
_chunkEAEDK474cjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
|
|
2098
2110
|
percentage,
|
|
2099
2111
|
symbol: token.symbol,
|
|
2100
2112
|
formatted
|
|
@@ -2108,7 +2120,7 @@ function SolanaAmountStep({
|
|
|
2108
2120
|
const handleContinue = () => {
|
|
2109
2121
|
const numericAmount = parseFloat(amount);
|
|
2110
2122
|
if (isNaN(numericAmount) || numericAmount <= 0) {
|
|
2111
|
-
|
|
2123
|
+
_chunkEAEDK474cjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2112
2124
|
amount,
|
|
2113
2125
|
reason: "nan-or-non-positive"
|
|
2114
2126
|
});
|
|
@@ -2118,13 +2130,13 @@ function SolanaAmountStep({
|
|
|
2118
2130
|
const sourceAmount = isSourceStablecoin || !hasPricing ? numericAmount : numericAmount / tokenPriceUsd;
|
|
2119
2131
|
if (hasPricing) {
|
|
2120
2132
|
const usdValue = numericAmount;
|
|
2121
|
-
if (_optionalChain([uiConfig, 'optionalAccess',
|
|
2133
|
+
if (_optionalChain([uiConfig, 'optionalAccess', _44 => _44.maxDepositUsd]) && usdValue > uiConfig.maxDepositUsd) {
|
|
2122
2134
|
setError(
|
|
2123
|
-
`Maximum deposit is ${
|
|
2135
|
+
`Maximum deposit is ${_chunkEAEDK474cjs.currencyFormatter.format(uiConfig.maxDepositUsd)}`
|
|
2124
2136
|
);
|
|
2125
2137
|
return;
|
|
2126
2138
|
}
|
|
2127
|
-
if (_optionalChain([uiConfig, 'optionalAccess',
|
|
2139
|
+
if (_optionalChain([uiConfig, 'optionalAccess', _45 => _45.minDepositUsd]) && usdValue < uiConfig.minDepositUsd) {
|
|
2128
2140
|
setAmount(uiConfig.minDepositUsd.toString());
|
|
2129
2141
|
setError(null);
|
|
2130
2142
|
return;
|
|
@@ -2135,7 +2147,7 @@ function SolanaAmountStep({
|
|
|
2135
2147
|
try {
|
|
2136
2148
|
amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
|
|
2137
2149
|
} catch (e20) {
|
|
2138
|
-
|
|
2150
|
+
_chunkEAEDK474cjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2139
2151
|
amount,
|
|
2140
2152
|
sourceAmount: sourceAmountStr,
|
|
2141
2153
|
reason: "parse-units-failed"
|
|
@@ -2145,7 +2157,7 @@ function SolanaAmountStep({
|
|
|
2145
2157
|
}
|
|
2146
2158
|
if (amountInUnits > spendableBalance) {
|
|
2147
2159
|
const isReserveIssue = isNativeSol(token) && amountInUnits <= balance;
|
|
2148
|
-
|
|
2160
|
+
_chunkEAEDK474cjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2149
2161
|
amount,
|
|
2150
2162
|
balance: balance.toString(),
|
|
2151
2163
|
spendableBalance: spendableBalance.toString(),
|
|
@@ -2157,7 +2169,7 @@ function SolanaAmountStep({
|
|
|
2157
2169
|
);
|
|
2158
2170
|
return;
|
|
2159
2171
|
}
|
|
2160
|
-
|
|
2172
|
+
_chunkEAEDK474cjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
|
|
2161
2173
|
symbol: token.symbol,
|
|
2162
2174
|
inputAmountUsd: amount,
|
|
2163
2175
|
sourceAmount: sourceAmountStr,
|
|
@@ -2225,8 +2237,8 @@ function SolanaAmountStep({
|
|
|
2225
2237
|
}
|
|
2226
2238
|
)
|
|
2227
2239
|
] }),
|
|
2228
|
-
_optionalChain([uiConfig, 'optionalAccess',
|
|
2229
|
-
|
|
2240
|
+
_optionalChain([uiConfig, 'optionalAccess', _46 => _46.minDepositUsd]) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-minimum", children: [
|
|
2241
|
+
_chunkEAEDK474cjs.currencyFormatter.format(uiConfig.minDepositUsd),
|
|
2230
2242
|
" minimum deposit"
|
|
2231
2243
|
] }),
|
|
2232
2244
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", children: [
|
|
@@ -2252,15 +2264,15 @@ function SolanaAmountStep({
|
|
|
2252
2264
|
] })
|
|
2253
2265
|
] }),
|
|
2254
2266
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2255
|
-
|
|
2267
|
+
_chunkEAEDK474cjs.Button,
|
|
2256
2268
|
{
|
|
2257
2269
|
onClick: handleContinue,
|
|
2258
2270
|
fullWidth: true,
|
|
2259
2271
|
disabled: !amount,
|
|
2260
|
-
children: _optionalChain([uiConfig, 'optionalAccess',
|
|
2272
|
+
children: _optionalChain([uiConfig, 'optionalAccess', _47 => _47.minDepositUsd]) && parseFloat(amount) > 0 && parseFloat(amount) < uiConfig.minDepositUsd ? "Update order" : "Continue"
|
|
2261
2273
|
}
|
|
2262
2274
|
) }),
|
|
2263
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2275
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEAEDK474cjs.PoweredBy, {})
|
|
2264
2276
|
] });
|
|
2265
2277
|
}
|
|
2266
2278
|
|
|
@@ -2287,7 +2299,7 @@ function SolanaConfirmStep({
|
|
|
2287
2299
|
}) {
|
|
2288
2300
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
2289
2301
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
2290
|
-
const targetSymbol =
|
|
2302
|
+
const targetSymbol = _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
2291
2303
|
const isSameToken = token.symbol.toUpperCase() === targetSymbol.toUpperCase();
|
|
2292
2304
|
const formattedAmount = sourceAmount && !Number.isNaN(Number(sourceAmount)) ? Number(sourceAmount).toLocaleString("en-US", { maximumFractionDigits: 6 }) : "0";
|
|
2293
2305
|
const formattedReceiveAmount = (() => {
|
|
@@ -2304,7 +2316,7 @@ function SolanaConfirmStep({
|
|
|
2304
2316
|
const receiveAmount = isSameToken ? formattedReceiveAmount : `~ ${formattedReceiveAmount}`;
|
|
2305
2317
|
const handleConfirm = async () => {
|
|
2306
2318
|
if (!solanaProvider) {
|
|
2307
|
-
|
|
2319
|
+
_chunkEAEDK474cjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
2308
2320
|
reason: "missing-provider"
|
|
2309
2321
|
});
|
|
2310
2322
|
setError("Solana wallet not connected");
|
|
@@ -2312,7 +2324,7 @@ function SolanaConfirmStep({
|
|
|
2312
2324
|
}
|
|
2313
2325
|
const parsedAmount = parseFloat(sourceAmount);
|
|
2314
2326
|
if (isNaN(parsedAmount) || parsedAmount <= 0) {
|
|
2315
|
-
|
|
2327
|
+
_chunkEAEDK474cjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
2316
2328
|
reason: "invalid-amount",
|
|
2317
2329
|
sourceAmount
|
|
2318
2330
|
});
|
|
@@ -2321,7 +2333,7 @@ function SolanaConfirmStep({
|
|
|
2321
2333
|
}
|
|
2322
2334
|
setError(null);
|
|
2323
2335
|
setIsSubmitting(true);
|
|
2324
|
-
|
|
2336
|
+
_chunkEAEDK474cjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
|
|
2325
2337
|
smartAccount,
|
|
2326
2338
|
solanaAddress,
|
|
2327
2339
|
solanaDepositAddress,
|
|
@@ -2331,7 +2343,7 @@ function SolanaConfirmStep({
|
|
|
2331
2343
|
});
|
|
2332
2344
|
try {
|
|
2333
2345
|
const check = await service.checkAccount(smartAccount);
|
|
2334
|
-
|
|
2346
|
+
_chunkEAEDK474cjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
|
|
2335
2347
|
smartAccount,
|
|
2336
2348
|
isRegistered: check.isRegistered,
|
|
2337
2349
|
targetChain: check.targetChain,
|
|
@@ -2344,7 +2356,7 @@ function SolanaConfirmStep({
|
|
|
2344
2356
|
}
|
|
2345
2357
|
const connection = getSolanaConnection();
|
|
2346
2358
|
const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
|
|
2347
|
-
|
|
2359
|
+
_chunkEAEDK474cjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
|
|
2348
2360
|
token: token.symbol,
|
|
2349
2361
|
sourceAmount,
|
|
2350
2362
|
amountUnits: amountUnits.toString()
|
|
@@ -2361,10 +2373,10 @@ function SolanaConfirmStep({
|
|
|
2361
2373
|
token.mint,
|
|
2362
2374
|
amountUnits
|
|
2363
2375
|
);
|
|
2364
|
-
|
|
2376
|
+
_chunkEAEDK474cjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
2365
2377
|
token: token.symbol,
|
|
2366
2378
|
instructionCount: transaction.instructions.length,
|
|
2367
|
-
feePayer: _optionalChain([transaction, 'access',
|
|
2379
|
+
feePayer: _optionalChain([transaction, 'access', _48 => _48.feePayer, 'optionalAccess', _49 => _49.toBase58, 'call', _50 => _50()]),
|
|
2368
2380
|
recentBlockhash: transaction.recentBlockhash
|
|
2369
2381
|
});
|
|
2370
2382
|
const txHash = await sendSolanaTransaction(
|
|
@@ -2372,21 +2384,21 @@ function SolanaConfirmStep({
|
|
|
2372
2384
|
connection,
|
|
2373
2385
|
transaction
|
|
2374
2386
|
);
|
|
2375
|
-
|
|
2387
|
+
_chunkEAEDK474cjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
|
|
2376
2388
|
txHash,
|
|
2377
2389
|
amountUnits: amountUnits.toString()
|
|
2378
2390
|
});
|
|
2379
2391
|
onConfirm(txHash, amountUnits.toString());
|
|
2380
2392
|
} catch (err) {
|
|
2381
2393
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
2382
|
-
const message =
|
|
2383
|
-
|
|
2394
|
+
const message = _chunkEAEDK474cjs.formatUserError.call(void 0, raw);
|
|
2395
|
+
_chunkEAEDK474cjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
|
|
2384
2396
|
smartAccount,
|
|
2385
2397
|
token: token.symbol,
|
|
2386
2398
|
sourceAmount
|
|
2387
2399
|
});
|
|
2388
2400
|
setError(message);
|
|
2389
|
-
_optionalChain([onError, 'optionalCall',
|
|
2401
|
+
_optionalChain([onError, 'optionalCall', _51 => _51(message, "SOLANA_TRANSFER_ERROR")]);
|
|
2390
2402
|
} finally {
|
|
2391
2403
|
setIsSubmitting(false);
|
|
2392
2404
|
}
|
|
@@ -2403,15 +2415,15 @@ function SolanaConfirmStep({
|
|
|
2403
2415
|
className: "rs-card-value",
|
|
2404
2416
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
2405
2417
|
children: [
|
|
2406
|
-
|
|
2418
|
+
_chunkR6U6BHCVcjs.getChainIcon.call(void 0, "solana") && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2407
2419
|
"img",
|
|
2408
2420
|
{
|
|
2409
|
-
src:
|
|
2421
|
+
src: _chunkR6U6BHCVcjs.getChainIcon.call(void 0, "solana"),
|
|
2410
2422
|
alt: "",
|
|
2411
2423
|
style: { width: 16, height: 16, borderRadius: 3 }
|
|
2412
2424
|
}
|
|
2413
2425
|
),
|
|
2414
|
-
|
|
2426
|
+
_chunkR6U6BHCVcjs.getChainName.call(void 0, "solana")
|
|
2415
2427
|
]
|
|
2416
2428
|
}
|
|
2417
2429
|
)
|
|
@@ -2424,15 +2436,15 @@ function SolanaConfirmStep({
|
|
|
2424
2436
|
className: "rs-card-value",
|
|
2425
2437
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
2426
2438
|
children: [
|
|
2427
|
-
|
|
2439
|
+
_chunkR6U6BHCVcjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2428
2440
|
"img",
|
|
2429
2441
|
{
|
|
2430
|
-
src:
|
|
2442
|
+
src: _chunkR6U6BHCVcjs.getChainIcon.call(void 0, targetChain),
|
|
2431
2443
|
alt: "",
|
|
2432
2444
|
style: { width: 16, height: 16, borderRadius: 3 }
|
|
2433
2445
|
}
|
|
2434
2446
|
),
|
|
2435
|
-
|
|
2447
|
+
_chunkR6U6BHCVcjs.getChainName.call(void 0, targetChain)
|
|
2436
2448
|
]
|
|
2437
2449
|
}
|
|
2438
2450
|
)
|
|
@@ -2451,10 +2463,10 @@ function SolanaConfirmStep({
|
|
|
2451
2463
|
className: "rs-card-value",
|
|
2452
2464
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
2453
2465
|
children: [
|
|
2454
|
-
|
|
2466
|
+
_chunkR6U6BHCVcjs.getTokenIcon.call(void 0, token.symbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2455
2467
|
"img",
|
|
2456
2468
|
{
|
|
2457
|
-
src:
|
|
2469
|
+
src: _chunkR6U6BHCVcjs.getTokenIcon.call(void 0, token.symbol),
|
|
2458
2470
|
alt: "",
|
|
2459
2471
|
style: { width: 16, height: 16, borderRadius: "50%" }
|
|
2460
2472
|
}
|
|
@@ -2474,10 +2486,10 @@ function SolanaConfirmStep({
|
|
|
2474
2486
|
className: "rs-card-value",
|
|
2475
2487
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
2476
2488
|
children: [
|
|
2477
|
-
|
|
2489
|
+
_chunkR6U6BHCVcjs.getTokenIcon.call(void 0, targetSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2478
2490
|
"img",
|
|
2479
2491
|
{
|
|
2480
|
-
src:
|
|
2492
|
+
src: _chunkR6U6BHCVcjs.getTokenIcon.call(void 0, targetSymbol),
|
|
2481
2493
|
alt: "",
|
|
2482
2494
|
style: { width: 16, height: 16, borderRadius: "50%" }
|
|
2483
2495
|
}
|
|
@@ -2513,7 +2525,7 @@ function SolanaConfirmStep({
|
|
|
2513
2525
|
] })
|
|
2514
2526
|
] }),
|
|
2515
2527
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2516
|
-
|
|
2528
|
+
_chunkEAEDK474cjs.Button,
|
|
2517
2529
|
{
|
|
2518
2530
|
onClick: handleConfirm,
|
|
2519
2531
|
loading: isSubmitting,
|
|
@@ -2522,7 +2534,7 @@ function SolanaConfirmStep({
|
|
|
2522
2534
|
children: "Confirm Order"
|
|
2523
2535
|
}
|
|
2524
2536
|
) }),
|
|
2525
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2537
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkEAEDK474cjs.PoweredBy, {})
|
|
2526
2538
|
] });
|
|
2527
2539
|
}
|
|
2528
2540
|
|
|
@@ -2547,7 +2559,7 @@ function DepositFlow({
|
|
|
2547
2559
|
sourceToken: defaultSourceToken,
|
|
2548
2560
|
amount: defaultAmount,
|
|
2549
2561
|
recipient,
|
|
2550
|
-
signerAddress =
|
|
2562
|
+
signerAddress = _chunkR6U6BHCVcjs.DEFAULT_SIGNER_ADDRESS,
|
|
2551
2563
|
sessionChainIds,
|
|
2552
2564
|
forceRegister = false,
|
|
2553
2565
|
waitForFinalTx = true,
|
|
@@ -2570,7 +2582,7 @@ function DepositFlow({
|
|
|
2570
2582
|
debug
|
|
2571
2583
|
}) {
|
|
2572
2584
|
const hasInitialReownSession = Boolean(
|
|
2573
|
-
enableSolana ? _optionalChain([reownWallet, 'optionalAccess',
|
|
2585
|
+
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _52 => _52.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _53 => _53.address]) : _optionalChain([reownWallet, 'optionalAccess', _54 => _54.address])
|
|
2574
2586
|
);
|
|
2575
2587
|
const hasInitialWalletHydrationPending = Boolean(
|
|
2576
2588
|
dappAddress && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasInitialReownSession && !reownWallet.isReady)
|
|
@@ -2588,13 +2600,13 @@ function DepositFlow({
|
|
|
2588
2600
|
flowModeRef.current = flowMode;
|
|
2589
2601
|
const logFlow = _react.useCallback.call(void 0,
|
|
2590
2602
|
(message, data) => {
|
|
2591
|
-
|
|
2603
|
+
_chunkEAEDK474cjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
|
|
2592
2604
|
},
|
|
2593
2605
|
[debug]
|
|
2594
2606
|
);
|
|
2595
2607
|
const logFlowError = _react.useCallback.call(void 0,
|
|
2596
2608
|
(message, error, data) => {
|
|
2597
|
-
|
|
2609
|
+
_chunkEAEDK474cjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
|
|
2598
2610
|
},
|
|
2599
2611
|
[debug]
|
|
2600
2612
|
);
|
|
@@ -2615,12 +2627,12 @@ function DepositFlow({
|
|
|
2615
2627
|
return null;
|
|
2616
2628
|
}, []);
|
|
2617
2629
|
const dappSwitchChain = _react.useMemo.call(void 0, () => {
|
|
2618
|
-
if (!_optionalChain([dappWalletClient, 'optionalAccess',
|
|
2630
|
+
if (!_optionalChain([dappWalletClient, 'optionalAccess', _55 => _55.switchChain])) return void 0;
|
|
2619
2631
|
return async (chainId) => {
|
|
2620
|
-
await _optionalChain([dappWalletClient, 'access',
|
|
2632
|
+
await _optionalChain([dappWalletClient, 'access', _56 => _56.switchChain, 'optionalCall', _57 => _57({ id: chainId })]);
|
|
2621
2633
|
};
|
|
2622
2634
|
}, [dappWalletClient]);
|
|
2623
|
-
const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
2635
|
+
const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _58 => _58.account, 'optionalAccess', _59 => _59.address]), () => ( null));
|
|
2624
2636
|
const walletOptions = _react.useMemo.call(void 0, () => {
|
|
2625
2637
|
const options = [];
|
|
2626
2638
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -2634,7 +2646,7 @@ function DepositFlow({
|
|
|
2634
2646
|
});
|
|
2635
2647
|
seen.add(id);
|
|
2636
2648
|
}
|
|
2637
|
-
if (enableSolana && _optionalChain([reownWallet, 'optionalAccess',
|
|
2649
|
+
if (enableSolana && _optionalChain([reownWallet, 'optionalAccess', _60 => _60.isConnected]) && reownWallet.isSolana && reownWallet.solanaAddress && dappAddress) {
|
|
2638
2650
|
const id = _nullishCoalesce(reownWallet.caipAddress, () => ( `solana:${reownWallet.solanaAddress}`));
|
|
2639
2651
|
if (!seen.has(id)) {
|
|
2640
2652
|
options.push({
|
|
@@ -2646,7 +2658,7 @@ function DepositFlow({
|
|
|
2646
2658
|
});
|
|
2647
2659
|
seen.add(id);
|
|
2648
2660
|
}
|
|
2649
|
-
} else if (_optionalChain([reownWallet, 'optionalAccess',
|
|
2661
|
+
} else if (_optionalChain([reownWallet, 'optionalAccess', _61 => _61.address]) && reownWallet.isConnected && reownWallet.walletClient && reownWallet.publicClient && !seen.has(`evm:${reownWallet.address.toLowerCase()}`)) {
|
|
2650
2662
|
const id = `evm:${reownWallet.address.toLowerCase()}`;
|
|
2651
2663
|
if (!seen.has(id)) {
|
|
2652
2664
|
options.push({
|
|
@@ -2663,20 +2675,20 @@ function DepositFlow({
|
|
|
2663
2675
|
}, [
|
|
2664
2676
|
connectedWalletAddress,
|
|
2665
2677
|
dappAddress,
|
|
2666
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2667
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2668
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2669
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2670
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2678
|
+
_optionalChain([reownWallet, 'optionalAccess', _62 => _62.address]),
|
|
2679
|
+
_optionalChain([reownWallet, 'optionalAccess', _63 => _63.isConnected]),
|
|
2680
|
+
_optionalChain([reownWallet, 'optionalAccess', _64 => _64.walletClient]),
|
|
2681
|
+
_optionalChain([reownWallet, 'optionalAccess', _65 => _65.publicClient]),
|
|
2682
|
+
_optionalChain([reownWallet, 'optionalAccess', _66 => _66.icon]),
|
|
2671
2683
|
enableSolana,
|
|
2672
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2673
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2674
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2684
|
+
_optionalChain([reownWallet, 'optionalAccess', _67 => _67.isSolana]),
|
|
2685
|
+
_optionalChain([reownWallet, 'optionalAccess', _68 => _68.solanaAddress]),
|
|
2686
|
+
_optionalChain([reownWallet, 'optionalAccess', _69 => _69.caipAddress])
|
|
2675
2687
|
]);
|
|
2676
|
-
const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess',
|
|
2688
|
+
const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess', _70 => _70.account]) && dappAddress && !reownWallet;
|
|
2677
2689
|
const hasWalletOptions = walletOptions.length > 0;
|
|
2678
2690
|
const hasReownSession = Boolean(
|
|
2679
|
-
enableSolana ? _optionalChain([reownWallet, 'optionalAccess',
|
|
2691
|
+
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _71 => _71.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _72 => _72.address]) : _optionalChain([reownWallet, 'optionalAccess', _73 => _73.address])
|
|
2680
2692
|
);
|
|
2681
2693
|
const isWalletHydrationPending = Boolean(
|
|
2682
2694
|
dappAddress && !hasWalletOptions && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasReownSession && !reownWallet.isReady)
|
|
@@ -2716,16 +2728,16 @@ function DepositFlow({
|
|
|
2716
2728
|
return {
|
|
2717
2729
|
ownerAddress: dappAddress,
|
|
2718
2730
|
walletClient: void 0,
|
|
2719
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
2731
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkEAEDK474cjs.getPublicClient.call(void 0, targetChain))),
|
|
2720
2732
|
switchChain: void 0
|
|
2721
2733
|
};
|
|
2722
2734
|
}
|
|
2723
2735
|
if (canAutoLock) {
|
|
2724
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
2736
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _74 => _74.chain, 'optionalAccess', _75 => _75.id]), () => ( targetChain));
|
|
2725
2737
|
return {
|
|
2726
2738
|
ownerAddress: dappWalletClient.account.address,
|
|
2727
2739
|
walletClient: dappWalletClient,
|
|
2728
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
2740
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkEAEDK474cjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
2729
2741
|
switchChain: dappSwitchChain
|
|
2730
2742
|
};
|
|
2731
2743
|
}
|
|
@@ -2739,24 +2751,24 @@ function DepositFlow({
|
|
|
2739
2751
|
return {
|
|
2740
2752
|
ownerAddress: dappAddress,
|
|
2741
2753
|
walletClient: void 0,
|
|
2742
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
2754
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkEAEDK474cjs.getPublicClient.call(void 0, targetChain))),
|
|
2743
2755
|
switchChain: void 0
|
|
2744
2756
|
};
|
|
2745
2757
|
}
|
|
2746
|
-
if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess',
|
|
2747
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
2758
|
+
if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess', _76 => _76.account]) && selectedOption.address && dappWalletClient.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
2759
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _77 => _77.chain, 'optionalAccess', _78 => _78.id]), () => ( targetChain));
|
|
2748
2760
|
return {
|
|
2749
2761
|
ownerAddress: dappWalletClient.account.address,
|
|
2750
2762
|
walletClient: dappWalletClient,
|
|
2751
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
2763
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkEAEDK474cjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
2752
2764
|
switchChain: dappSwitchChain
|
|
2753
2765
|
};
|
|
2754
2766
|
}
|
|
2755
|
-
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess',
|
|
2767
|
+
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess', _79 => _79.address]) && selectedOption.address && reownWallet.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
2756
2768
|
return {
|
|
2757
2769
|
ownerAddress: reownWallet.address,
|
|
2758
2770
|
walletClient: reownWallet.walletClient,
|
|
2759
|
-
publicClient: _nullishCoalesce(reownWallet.publicClient, () => (
|
|
2771
|
+
publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunkEAEDK474cjs.getPublicClient.call(void 0, targetChain))),
|
|
2760
2772
|
switchChain: reownWallet.switchChain
|
|
2761
2773
|
};
|
|
2762
2774
|
}
|
|
@@ -2794,7 +2806,7 @@ function DepositFlow({
|
|
|
2794
2806
|
return {
|
|
2795
2807
|
ownerAddress: dappAddress,
|
|
2796
2808
|
walletClient: void 0,
|
|
2797
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
2809
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkEAEDK474cjs.getPublicClient.call(void 0, targetChain))),
|
|
2798
2810
|
switchChain: void 0
|
|
2799
2811
|
};
|
|
2800
2812
|
}
|
|
@@ -2816,7 +2828,7 @@ function DepositFlow({
|
|
|
2816
2828
|
walletSignerContext,
|
|
2817
2829
|
walletSelectionKey
|
|
2818
2830
|
]);
|
|
2819
|
-
const sessionKeyAddress = _nullishCoalesce(_nullishCoalesce(dappAddress, () => ( _optionalChain([signerContext, 'optionalAccess',
|
|
2831
|
+
const sessionKeyAddress = _nullishCoalesce(_nullishCoalesce(dappAddress, () => ( _optionalChain([signerContext, 'optionalAccess', _80 => _80.ownerAddress]))), () => ( null));
|
|
2820
2832
|
const lastTargetRef = _react.useRef.call(void 0, null);
|
|
2821
2833
|
_react.useEffect.call(void 0, () => {
|
|
2822
2834
|
const prev = lastTargetRef.current;
|
|
@@ -2893,7 +2905,7 @@ function DepositFlow({
|
|
|
2893
2905
|
const stepIndex = step.type === "setup" ? 0 : step.type === "deposit-address" ? 1 : step.type === "select-asset" ? 1 : step.type === "solana-token-select" ? 1 : step.type === "solana-amount" ? 2 : step.type === "amount" ? 2 : step.type === "confirm" ? 3 : step.type === "solana-confirm" ? 3 : 4;
|
|
2894
2906
|
const currentBackHandler = step.type === "deposit-address" ? handleBackFromDepositAddress : step.type === "select-asset" && signerContext && !canAutoLock ? handleBackFromSelectAsset : step.type === "solana-token-select" ? handleBackFromSolanaTokenSelect : step.type === "solana-amount" ? handleBackFromSolanaAmount : step.type === "solana-confirm" ? handleBackFromSolanaConfirm : step.type === "amount" ? handleBackFromAmount : step.type === "confirm" ? handleBackFromConfirm : void 0;
|
|
2895
2907
|
_react.useEffect.call(void 0, () => {
|
|
2896
|
-
_optionalChain([onStepChange, 'optionalCall',
|
|
2908
|
+
_optionalChain([onStepChange, 'optionalCall', _81 => _81(stepIndex, currentBackHandler)]);
|
|
2897
2909
|
}, [stepIndex, currentBackHandler, onStepChange]);
|
|
2898
2910
|
_react.useEffect.call(void 0, () => {
|
|
2899
2911
|
logFlow("state:changed", {
|
|
@@ -2912,7 +2924,7 @@ function DepositFlow({
|
|
|
2912
2924
|
targetToken
|
|
2913
2925
|
]);
|
|
2914
2926
|
_react.useEffect.call(void 0, () => {
|
|
2915
|
-
_optionalChain([onTotalBalanceChange, 'optionalCall',
|
|
2927
|
+
_optionalChain([onTotalBalanceChange, 'optionalCall', _82 => _82(totalBalanceUsd)]);
|
|
2916
2928
|
}, [totalBalanceUsd, onTotalBalanceChange]);
|
|
2917
2929
|
const isDepositAddressMode = flowMode === "deposit-address";
|
|
2918
2930
|
const isSolanaWalletMode = flowMode === "solana-wallet";
|
|
@@ -2954,7 +2966,7 @@ function DepositFlow({
|
|
|
2954
2966
|
solanaDepositAddress
|
|
2955
2967
|
});
|
|
2956
2968
|
} else {
|
|
2957
|
-
_optionalChain([onError, 'optionalCall',
|
|
2969
|
+
_optionalChain([onError, 'optionalCall', _83 => _83({
|
|
2958
2970
|
message: "Solana deposit address not available. Please try again.",
|
|
2959
2971
|
code: "SOLANA_SETUP_FAILED"
|
|
2960
2972
|
})]);
|
|
@@ -2989,7 +3001,7 @@ function DepositFlow({
|
|
|
2989
3001
|
directTransfer
|
|
2990
3002
|
};
|
|
2991
3003
|
});
|
|
2992
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
3004
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _84 => _84({ txHash, sourceChain: chainId, amount })]);
|
|
2993
3005
|
},
|
|
2994
3006
|
[onDepositSubmitted, targetChain, targetToken]
|
|
2995
3007
|
);
|
|
@@ -3013,8 +3025,8 @@ function DepositFlow({
|
|
|
3013
3025
|
);
|
|
3014
3026
|
const handleSolanaAmountContinue = _react.useCallback.call(void 0,
|
|
3015
3027
|
(token, sourceAmount, inputAmountUsd) => {
|
|
3016
|
-
const targetSym =
|
|
3017
|
-
const isTargetStable =
|
|
3028
|
+
const targetSym = _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3029
|
+
const isTargetStable = _chunkR6U6BHCVcjs.isStablecoinSymbol.call(void 0, targetSym);
|
|
3018
3030
|
const targetTokenPriceUsd = isTargetStable ? 1 : getTokenPriceUsd(targetSym);
|
|
3019
3031
|
logFlow("solana:amount:continue", {
|
|
3020
3032
|
token: token.symbol,
|
|
@@ -3061,7 +3073,7 @@ function DepositFlow({
|
|
|
3061
3073
|
sourceDecimals: prev.token.decimals
|
|
3062
3074
|
};
|
|
3063
3075
|
});
|
|
3064
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
3076
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _85 => _85({
|
|
3065
3077
|
txHash,
|
|
3066
3078
|
sourceChain: "solana",
|
|
3067
3079
|
amount: amountUnits
|
|
@@ -3071,7 +3083,7 @@ function DepositFlow({
|
|
|
3071
3083
|
);
|
|
3072
3084
|
const handleConnected = _react.useCallback.call(void 0,
|
|
3073
3085
|
(addr, smartAccount) => {
|
|
3074
|
-
_optionalChain([onConnected, 'optionalCall',
|
|
3086
|
+
_optionalChain([onConnected, 'optionalCall', _86 => _86({ address: addr, smartAccount })]);
|
|
3075
3087
|
},
|
|
3076
3088
|
[onConnected]
|
|
3077
3089
|
);
|
|
@@ -3091,8 +3103,8 @@ function DepositFlow({
|
|
|
3091
3103
|
);
|
|
3092
3104
|
const handleAmountContinue = _react.useCallback.call(void 0,
|
|
3093
3105
|
(amount, targetAmount, balance) => {
|
|
3094
|
-
const targetSym =
|
|
3095
|
-
const isTargetStable =
|
|
3106
|
+
const targetSym = _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3107
|
+
const isTargetStable = _chunkR6U6BHCVcjs.isStablecoinSymbol.call(void 0, targetSym);
|
|
3096
3108
|
const targetTokenPriceUsd = isTargetStable ? 1 : getTokenPriceUsd(targetSym);
|
|
3097
3109
|
setStep((prev) => {
|
|
3098
3110
|
if (prev.type !== "amount") return prev;
|
|
@@ -3134,28 +3146,28 @@ function DepositFlow({
|
|
|
3134
3146
|
);
|
|
3135
3147
|
const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
|
|
3136
3148
|
(txHash, sourceChain, amount) => {
|
|
3137
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
3149
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _87 => _87({ txHash, sourceChain, amount })]);
|
|
3138
3150
|
},
|
|
3139
3151
|
[onDepositSubmitted]
|
|
3140
3152
|
);
|
|
3141
3153
|
const handleDepositComplete = _react.useCallback.call(void 0,
|
|
3142
3154
|
(txHash, destinationTxHash, context) => {
|
|
3143
3155
|
logFlow("deposit:complete", { txHash, destinationTxHash, ...context });
|
|
3144
|
-
_optionalChain([onDepositComplete, 'optionalCall',
|
|
3156
|
+
_optionalChain([onDepositComplete, 'optionalCall', _88 => _88({ txHash, destinationTxHash, ...context })]);
|
|
3145
3157
|
},
|
|
3146
3158
|
[logFlow, onDepositComplete]
|
|
3147
3159
|
);
|
|
3148
3160
|
const handleDepositFailed = _react.useCallback.call(void 0,
|
|
3149
3161
|
(txHash, error) => {
|
|
3150
3162
|
logFlowError("deposit:failed", error, { txHash });
|
|
3151
|
-
_optionalChain([onDepositFailed, 'optionalCall',
|
|
3163
|
+
_optionalChain([onDepositFailed, 'optionalCall', _89 => _89({ txHash, error })]);
|
|
3152
3164
|
},
|
|
3153
3165
|
[logFlowError, onDepositFailed]
|
|
3154
3166
|
);
|
|
3155
3167
|
const handleError = _react.useCallback.call(void 0,
|
|
3156
3168
|
(message, code) => {
|
|
3157
3169
|
logFlowError("flow:error", message, { code });
|
|
3158
|
-
_optionalChain([onError, 'optionalCall',
|
|
3170
|
+
_optionalChain([onError, 'optionalCall', _90 => _90({ message, code })]);
|
|
3159
3171
|
},
|
|
3160
3172
|
[logFlowError, onError]
|
|
3161
3173
|
);
|
|
@@ -3212,7 +3224,7 @@ function DepositFlow({
|
|
|
3212
3224
|
if (walletId) {
|
|
3213
3225
|
const selectedOption = walletOptions.find((o) => o.id === walletId);
|
|
3214
3226
|
setSelectedWalletId(walletId);
|
|
3215
|
-
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess',
|
|
3227
|
+
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess', _91 => _91.kind]) === "solana") {
|
|
3216
3228
|
handleSelectSolanaWallet();
|
|
3217
3229
|
} else {
|
|
3218
3230
|
handleSelectProvider();
|
|
@@ -3242,7 +3254,7 @@ function DepositFlow({
|
|
|
3242
3254
|
]);
|
|
3243
3255
|
if (showConnectStep) {
|
|
3244
3256
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3245
|
-
|
|
3257
|
+
_chunkEAEDK474cjs.ConnectStep,
|
|
3246
3258
|
{
|
|
3247
3259
|
walletOptions,
|
|
3248
3260
|
selectedWalletId: selectedWalletIdEffective,
|
|
@@ -3261,7 +3273,7 @@ function DepositFlow({
|
|
|
3261
3273
|
const selectedOption = walletOptions.find(
|
|
3262
3274
|
(o) => o.id === selectedWalletIdEffective
|
|
3263
3275
|
);
|
|
3264
|
-
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess',
|
|
3276
|
+
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess', _92 => _92.kind]) === "solana") {
|
|
3265
3277
|
handleSelectSolanaWallet();
|
|
3266
3278
|
} else {
|
|
3267
3279
|
handleSelectProvider();
|
|
@@ -3298,12 +3310,13 @@ function DepositFlow({
|
|
|
3298
3310
|
smartAccount: step.smartAccount,
|
|
3299
3311
|
solanaDepositAddress: enableSolana ? step.solanaDepositAddress : void 0,
|
|
3300
3312
|
service,
|
|
3313
|
+
allowedRoutes,
|
|
3301
3314
|
onDepositDetected: handleDepositAddressDetected,
|
|
3302
3315
|
onError: handleError
|
|
3303
3316
|
}
|
|
3304
3317
|
),
|
|
3305
3318
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3306
|
-
|
|
3319
|
+
_chunkEAEDK474cjs.ProcessingStep,
|
|
3307
3320
|
{
|
|
3308
3321
|
smartAccount: step.smartAccount,
|
|
3309
3322
|
txHash: step.txHash,
|
|
@@ -3329,8 +3342,8 @@ function DepositFlow({
|
|
|
3329
3342
|
}
|
|
3330
3343
|
if (isSolanaWalletMode) {
|
|
3331
3344
|
if (!sessionKeyAddress) return null;
|
|
3332
|
-
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess',
|
|
3333
|
-
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess',
|
|
3345
|
+
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess', _93 => _93.solanaAddress]);
|
|
3346
|
+
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess', _94 => _94.solanaProvider]);
|
|
3334
3347
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
3335
3348
|
step.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3336
3349
|
SetupStep,
|
|
@@ -3425,7 +3438,7 @@ function DepositFlow({
|
|
|
3425
3438
|
) })
|
|
3426
3439
|
] }) : null,
|
|
3427
3440
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3428
|
-
|
|
3441
|
+
_chunkEAEDK474cjs.ProcessingStep,
|
|
3429
3442
|
{
|
|
3430
3443
|
smartAccount: step.smartAccount,
|
|
3431
3444
|
txHash: step.txHash,
|
|
@@ -3449,16 +3462,16 @@ function DepositFlow({
|
|
|
3449
3462
|
)
|
|
3450
3463
|
] });
|
|
3451
3464
|
}
|
|
3452
|
-
if (!_optionalChain([signerContext, 'optionalAccess',
|
|
3465
|
+
if (!_optionalChain([signerContext, 'optionalAccess', _95 => _95.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _96 => _96.publicClient])) {
|
|
3453
3466
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-state", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-text", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-title", children: "Connecting wallet..." }) }) }) }) });
|
|
3454
3467
|
}
|
|
3455
3468
|
const ownerAddress = signerContext.ownerAddress;
|
|
3456
|
-
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access',
|
|
3469
|
+
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _97 => _97.walletClient, 'optionalAccess', _98 => _98.chain, 'optionalAccess', _99 => _99.id]), () => ( _optionalChain([signerContext, 'access', _100 => _100.publicClient, 'access', _101 => _101.chain, 'optionalAccess', _102 => _102.id]))), () => ( targetChain));
|
|
3457
3470
|
const getReadClientForChain = (chainId) => {
|
|
3458
|
-
if (_optionalChain([signerContext, 'access',
|
|
3471
|
+
if (_optionalChain([signerContext, 'access', _103 => _103.publicClient, 'access', _104 => _104.chain, 'optionalAccess', _105 => _105.id]) === chainId) {
|
|
3459
3472
|
return signerContext.publicClient;
|
|
3460
3473
|
}
|
|
3461
|
-
return
|
|
3474
|
+
return _chunkEAEDK474cjs.getPublicClient.call(void 0, chainId);
|
|
3462
3475
|
};
|
|
3463
3476
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
3464
3477
|
step.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3529,7 +3542,7 @@ function DepositFlow({
|
|
|
3529
3542
|
}
|
|
3530
3543
|
),
|
|
3531
3544
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3532
|
-
|
|
3545
|
+
_chunkEAEDK474cjs.ProcessingStep,
|
|
3533
3546
|
{
|
|
3534
3547
|
smartAccount: step.smartAccount,
|
|
3535
3548
|
txHash: step.txHash,
|
|
@@ -3557,7 +3570,7 @@ function DepositFlow({
|
|
|
3557
3570
|
// src/DepositModal.tsx
|
|
3558
3571
|
|
|
3559
3572
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
3560
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
3573
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-XKP2Z55X.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
3561
3574
|
);
|
|
3562
3575
|
function DepositModal(props) {
|
|
3563
3576
|
const needsReown = !!props.reownAppId;
|
|
@@ -3593,13 +3606,14 @@ function DepositModalInner({
|
|
|
3593
3606
|
isOpen,
|
|
3594
3607
|
onClose,
|
|
3595
3608
|
inline,
|
|
3609
|
+
closeOnOverlayClick,
|
|
3596
3610
|
sourceChain: sourceChainProp,
|
|
3597
3611
|
sourceToken,
|
|
3598
3612
|
defaultAmount,
|
|
3599
3613
|
recipient,
|
|
3600
|
-
backendUrl =
|
|
3614
|
+
backendUrl = _chunkR6U6BHCVcjs.DEFAULT_BACKEND_URL,
|
|
3601
3615
|
solanaRpcUrl,
|
|
3602
|
-
signerAddress =
|
|
3616
|
+
signerAddress = _chunkR6U6BHCVcjs.DEFAULT_SIGNER_ADDRESS,
|
|
3603
3617
|
sessionChainIds,
|
|
3604
3618
|
forceRegister = false,
|
|
3605
3619
|
waitForFinalTx = true,
|
|
@@ -3626,10 +3640,10 @@ function DepositModalInner({
|
|
|
3626
3640
|
const [currentStepIndex, setCurrentStepIndex] = _react.useState.call(void 0, 0);
|
|
3627
3641
|
const [totalBalanceUsd, setTotalBalanceUsd] = _react.useState.call(void 0, null);
|
|
3628
3642
|
const backHandlerRef = _react.useRef.call(void 0, void 0);
|
|
3629
|
-
const targetChain =
|
|
3630
|
-
const sourceChain = sourceChainProp ?
|
|
3643
|
+
const targetChain = _chunkR6U6BHCVcjs.getChainId.call(void 0, targetChainProp);
|
|
3644
|
+
const sourceChain = sourceChainProp ? _chunkR6U6BHCVcjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
3631
3645
|
const service = _react.useMemo.call(void 0,
|
|
3632
|
-
() =>
|
|
3646
|
+
() => _chunkEAEDK474cjs.createDepositService.call(void 0, backendUrl, {
|
|
3633
3647
|
debug,
|
|
3634
3648
|
debugScope: "service:deposit"
|
|
3635
3649
|
}),
|
|
@@ -3637,7 +3651,7 @@ function DepositModalInner({
|
|
|
3637
3651
|
);
|
|
3638
3652
|
_react.useEffect.call(void 0, () => {
|
|
3639
3653
|
if (isOpen && modalRef.current) {
|
|
3640
|
-
|
|
3654
|
+
_chunkEAEDK474cjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
3641
3655
|
}
|
|
3642
3656
|
}, [isOpen, theme]);
|
|
3643
3657
|
_react.useEffect.call(void 0, () => {
|
|
@@ -3647,7 +3661,7 @@ function DepositModalInner({
|
|
|
3647
3661
|
_react.useEffect.call(void 0, () => {
|
|
3648
3662
|
if (isOpen && !hasCalledReady.current) {
|
|
3649
3663
|
hasCalledReady.current = true;
|
|
3650
|
-
_optionalChain([onReady, 'optionalCall',
|
|
3664
|
+
_optionalChain([onReady, 'optionalCall', _106 => _106()]);
|
|
3651
3665
|
}
|
|
3652
3666
|
}, [isOpen, onReady]);
|
|
3653
3667
|
_react.useEffect.call(void 0, () => {
|
|
@@ -3666,22 +3680,23 @@ function DepositModalInner({
|
|
|
3666
3680
|
setTotalBalanceUsd(balance2);
|
|
3667
3681
|
}, []);
|
|
3668
3682
|
const handleBack = _react.useCallback.call(void 0, () => {
|
|
3669
|
-
_optionalChain([backHandlerRef, 'access',
|
|
3683
|
+
_optionalChain([backHandlerRef, 'access', _107 => _107.current, 'optionalCall', _108 => _108()]);
|
|
3670
3684
|
}, []);
|
|
3671
|
-
const showLogo = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3672
|
-
const showStepper = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3673
|
-
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3674
|
-
const balance = _optionalChain([uiConfig, 'optionalAccess',
|
|
3675
|
-
const logoUrl = _nullishCoalesce(_optionalChain([branding, 'optionalAccess',
|
|
3676
|
-
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess',
|
|
3685
|
+
const showLogo = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _109 => _109.showLogo]), () => ( false));
|
|
3686
|
+
const showStepper = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _110 => _110.showStepper]), () => ( false));
|
|
3687
|
+
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _111 => _111.showBackButton]), () => ( true));
|
|
3688
|
+
const balance = _optionalChain([uiConfig, 'optionalAccess', _112 => _112.balance]);
|
|
3689
|
+
const logoUrl = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _113 => _113.logoUrl]), () => ( "https://github.com/rhinestonewtf.png"));
|
|
3690
|
+
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _114 => _114.title]), () => ( "Deposit"));
|
|
3677
3691
|
const canGoBack = currentStepIndex > 0 && currentStepIndex < 4 && backHandlerRef.current !== void 0;
|
|
3678
3692
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3679
|
-
|
|
3693
|
+
_chunkEAEDK474cjs.Modal,
|
|
3680
3694
|
{
|
|
3681
3695
|
isOpen,
|
|
3682
3696
|
onClose,
|
|
3683
3697
|
className,
|
|
3684
3698
|
inline,
|
|
3699
|
+
closeOnOverlayClick,
|
|
3685
3700
|
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { ref: modalRef, className: "rs-modal", children: [
|
|
3686
3701
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header--redesigned", children: [
|
|
3687
3702
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-left", children: showBackButton && canGoBack && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3768,7 +3783,7 @@ function DepositModalInner({
|
|
|
3768
3783
|
balance.title,
|
|
3769
3784
|
":"
|
|
3770
3785
|
] }),
|
|
3771
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ?
|
|
3786
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ? _chunkEAEDK474cjs.currencyFormatter.format(totalBalanceUsd) : null))) })
|
|
3772
3787
|
] })
|
|
3773
3788
|
] }),
|
|
3774
3789
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|