@rhinestone/deposit-modal 0.1.45 → 0.1.47
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-DXQJUYVY.mjs → DepositModalReown-DKLN3IE3.mjs} +3 -3
- package/dist/{DepositModalReown-2QKLWRRU.cjs → DepositModalReown-IUZNTZ3Y.cjs} +4 -4
- package/dist/{WithdrawModalReown-CT6E2F2J.cjs → WithdrawModalReown-FGUHFUVN.cjs} +4 -4
- package/dist/{WithdrawModalReown-FM2TJFOV.mjs → WithdrawModalReown-XOFREB4D.mjs} +3 -3
- package/dist/{chunk-RVN4K6C7.mjs → chunk-7U5TNZZB.mjs} +5 -6
- package/dist/{chunk-B5H3CVAN.cjs → chunk-LOOU3NCI.cjs} +153 -154
- package/dist/{chunk-55QIUUIS.cjs → chunk-LT3QKJI2.cjs} +26 -26
- package/dist/{chunk-2EGNK737.cjs → chunk-MS2J6M5C.cjs} +60 -60
- package/dist/{chunk-ZNHU72LI.cjs → chunk-NELAYNA3.cjs} +7 -5
- package/dist/{chunk-4MKJ5R6Q.mjs → chunk-O3VFAUSL.mjs} +3 -3
- package/dist/{chunk-U6KOKXWY.mjs → chunk-QIK6ONMQ.mjs} +1 -1
- package/dist/{chunk-AVASFOLP.mjs → chunk-ZJQZEIHA.mjs} +7 -5
- package/dist/constants.cjs +2 -2
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +4 -4
- package/dist/deposit.mjs +3 -3
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +4 -4
- package/dist/reown.cjs +5 -5
- package/dist/reown.mjs +4 -4
- package/dist/withdraw.cjs +4 -4
- 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 _chunkLT3QKJI2cjs = require('./chunk-LT3QKJI2.cjs');
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
@@ -41,7 +41,7 @@ var _chunk55QIUUIScjs = require('./chunk-55QIUUIS.cjs');
|
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
var
|
|
44
|
+
var _chunkNELAYNA3cjs = require('./chunk-NELAYNA3.cjs');
|
|
45
45
|
|
|
46
46
|
// src/DepositModal.tsx
|
|
47
47
|
|
|
@@ -62,15 +62,15 @@ var _viem = require('viem');
|
|
|
62
62
|
|
|
63
63
|
var _jsxruntime = require('react/jsx-runtime');
|
|
64
64
|
async function resolveSessionOwner(eoaAddress) {
|
|
65
|
-
const localOwner =
|
|
65
|
+
const localOwner = _chunkLT3QKJI2cjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
66
66
|
if (localOwner) {
|
|
67
67
|
return {
|
|
68
|
-
account:
|
|
68
|
+
account: _chunkLT3QKJI2cjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
69
69
|
address: localOwner.address
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
|
-
const created =
|
|
73
|
-
|
|
72
|
+
const created = _chunkLT3QKJI2cjs.createSessionOwnerKey.call(void 0, );
|
|
73
|
+
_chunkLT3QKJI2cjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
74
74
|
return {
|
|
75
75
|
account: created.account,
|
|
76
76
|
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: _chunkLT3QKJI2cjs.toEvmCaip2.call(void 0, targetChain),
|
|
109
109
|
targetToken,
|
|
110
110
|
signerAddress,
|
|
111
111
|
sessionChainIds,
|
|
@@ -132,7 +132,7 @@ function SetupStep({
|
|
|
132
132
|
primaryType: typedData.primaryType,
|
|
133
133
|
message: typedData.message
|
|
134
134
|
});
|
|
135
|
-
const sessionDetails =
|
|
135
|
+
const sessionDetails = _chunkLT3QKJI2cjs.buildSessionDetails.call(void 0, setup.sessionDetailsUnsigned, signature);
|
|
136
136
|
setState({ type: "registering" });
|
|
137
137
|
const registerResult = await service.registerAccount({
|
|
138
138
|
address: smartAccount,
|
|
@@ -144,7 +144,7 @@ function SetupStep({
|
|
|
144
144
|
eoaAddress: address,
|
|
145
145
|
sessionOwner: sessionOwner.address,
|
|
146
146
|
target: {
|
|
147
|
-
chain:
|
|
147
|
+
chain: _chunkLT3QKJI2cjs.toEvmCaip2.call(void 0, targetChain),
|
|
148
148
|
token: targetToken,
|
|
149
149
|
...recipient && { recipient }
|
|
150
150
|
}
|
|
@@ -203,7 +203,7 @@ function SetupStep({
|
|
|
203
203
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
204
204
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", children: [
|
|
205
205
|
isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
206
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
206
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLT3QKJI2cjs.Spinner, { className: "rs-spinner--lg rs-text-accent" }),
|
|
207
207
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-text", children: [
|
|
208
208
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-title", children: renderStateMessage() }),
|
|
209
209
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-subtitle", children: "This may take a moment" })
|
|
@@ -240,7 +240,7 @@ function SetupStep({
|
|
|
240
240
|
] })
|
|
241
241
|
] })
|
|
242
242
|
] }),
|
|
243
|
-
isError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
243
|
+
isError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLT3QKJI2cjs.Button, { onClick: handleRetry, variant: "default", fullWidth: true, children: "Try Again" }) })
|
|
244
244
|
] });
|
|
245
245
|
}
|
|
246
246
|
|
|
@@ -264,7 +264,7 @@ function AssetSelectStep({
|
|
|
264
264
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
265
265
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
266
266
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
267
|
-
return
|
|
267
|
+
return _chunkLT3QKJI2cjs.getAssetId.call(void 0, {
|
|
268
268
|
chainId: defaultSourceChain,
|
|
269
269
|
token: defaultSourceToken
|
|
270
270
|
});
|
|
@@ -281,10 +281,10 @@ function AssetSelectStep({
|
|
|
281
281
|
try {
|
|
282
282
|
const portfolio = await service.fetchPortfolio(address);
|
|
283
283
|
if (!active) return;
|
|
284
|
-
const portfolioAssets =
|
|
284
|
+
const portfolioAssets = _chunkLT3QKJI2cjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
285
285
|
setAssets(portfolioAssets);
|
|
286
286
|
const hasNative = portfolioAssets.some(
|
|
287
|
-
(asset) => asset.token.toLowerCase() ===
|
|
287
|
+
(asset) => asset.token.toLowerCase() === _chunkNELAYNA3cjs.NATIVE_TOKEN_ADDRESS
|
|
288
288
|
);
|
|
289
289
|
if (!hasNative) {
|
|
290
290
|
const nativeAssets = await fetchNativeAssets(
|
|
@@ -350,7 +350,7 @@ function AssetSelectStep({
|
|
|
350
350
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
351
351
|
const numeric = Number(raw);
|
|
352
352
|
if (!Number.isFinite(numeric)) return raw;
|
|
353
|
-
return
|
|
353
|
+
return _chunkLT3QKJI2cjs.tokenFormatter.format(numeric);
|
|
354
354
|
} catch (e3) {
|
|
355
355
|
return asset.balance;
|
|
356
356
|
}
|
|
@@ -364,7 +364,7 @@ function AssetSelectStep({
|
|
|
364
364
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
365
365
|
children: [
|
|
366
366
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
367
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
367
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLT3QKJI2cjs.Spinner, { className: "rs-text-tertiary" }),
|
|
368
368
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
369
369
|
] }),
|
|
370
370
|
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 }) }),
|
|
@@ -397,9 +397,9 @@ function AssetSelectStep({
|
|
|
397
397
|
!loading && !error && rows.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: rows.map((asset) => {
|
|
398
398
|
const isSelected = selectedAssetId === asset.id;
|
|
399
399
|
const tokenAmount = formatBalance(asset);
|
|
400
|
-
const badge =
|
|
401
|
-
const tokenIcon =
|
|
402
|
-
const chainIcon =
|
|
400
|
+
const badge = _chunkNELAYNA3cjs.getChainBadge.call(void 0, asset.chainId);
|
|
401
|
+
const tokenIcon = _chunkNELAYNA3cjs.getTokenIcon.call(void 0, asset.symbol);
|
|
402
|
+
const chainIcon = _chunkNELAYNA3cjs.getChainIcon.call(void 0, asset.chainId);
|
|
403
403
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
404
404
|
"button",
|
|
405
405
|
{
|
|
@@ -423,7 +423,7 @@ function AssetSelectStep({
|
|
|
423
423
|
"img",
|
|
424
424
|
{
|
|
425
425
|
src: chainIcon,
|
|
426
|
-
alt:
|
|
426
|
+
alt: _chunkNELAYNA3cjs.getChainName.call(void 0, asset.chainId),
|
|
427
427
|
className: "rs-asset-chain-badge"
|
|
428
428
|
}
|
|
429
429
|
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -444,7 +444,7 @@ function AssetSelectStep({
|
|
|
444
444
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-asset-chain", children: [
|
|
445
445
|
" ",
|
|
446
446
|
"on ",
|
|
447
|
-
|
|
447
|
+
_chunkNELAYNA3cjs.getChainName.call(void 0, asset.chainId)
|
|
448
448
|
] })
|
|
449
449
|
] }),
|
|
450
450
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-balance-small", children: [
|
|
@@ -454,7 +454,7 @@ function AssetSelectStep({
|
|
|
454
454
|
] })
|
|
455
455
|
] })
|
|
456
456
|
] }),
|
|
457
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ?
|
|
457
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunkLT3QKJI2cjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
458
458
|
]
|
|
459
459
|
},
|
|
460
460
|
asset.id
|
|
@@ -464,7 +464,7 @@ function AssetSelectStep({
|
|
|
464
464
|
}
|
|
465
465
|
),
|
|
466
466
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
467
|
-
|
|
467
|
+
_chunkLT3QKJI2cjs.Button,
|
|
468
468
|
{
|
|
469
469
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
470
470
|
disabled: !selectedAsset,
|
|
@@ -472,17 +472,17 @@ function AssetSelectStep({
|
|
|
472
472
|
children: "Continue"
|
|
473
473
|
}
|
|
474
474
|
) }),
|
|
475
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
475
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLT3QKJI2cjs.PoweredBy, {})
|
|
476
476
|
] });
|
|
477
477
|
}
|
|
478
478
|
async function fetchNativeAssets(address, publicClient, existing) {
|
|
479
479
|
const existingIds = new Set(existing.map((asset) => asset.id));
|
|
480
480
|
const connectedChainId = _optionalChain([publicClient, 'access', _6 => _6.chain, 'optionalAccess', _7 => _7.id]);
|
|
481
481
|
if (!connectedChainId) return [];
|
|
482
|
-
if (!
|
|
483
|
-
const id =
|
|
482
|
+
if (!_chunkNELAYNA3cjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
|
|
483
|
+
const id = _chunkLT3QKJI2cjs.getAssetId.call(void 0, {
|
|
484
484
|
chainId: connectedChainId,
|
|
485
|
-
token:
|
|
485
|
+
token: _chunkNELAYNA3cjs.NATIVE_TOKEN_ADDRESS
|
|
486
486
|
});
|
|
487
487
|
if (existingIds.has(id)) return [];
|
|
488
488
|
try {
|
|
@@ -491,7 +491,7 @@ async function fetchNativeAssets(address, publicClient, existing) {
|
|
|
491
491
|
{
|
|
492
492
|
id,
|
|
493
493
|
chainId: connectedChainId,
|
|
494
|
-
token:
|
|
494
|
+
token: _chunkNELAYNA3cjs.NATIVE_TOKEN_ADDRESS,
|
|
495
495
|
symbol: "ETH",
|
|
496
496
|
name: "Ethereum",
|
|
497
497
|
decimals: 18,
|
|
@@ -541,8 +541,8 @@ function AmountStep({
|
|
|
541
541
|
const chainMismatch = Boolean(
|
|
542
542
|
_optionalChain([walletClient, 'optionalAccess', _8 => _8.chain, 'optionalAccess', _9 => _9.id]) && walletClient.chain.id !== asset.chainId
|
|
543
543
|
);
|
|
544
|
-
const targetSymbol =
|
|
545
|
-
const isSourceStablecoin =
|
|
544
|
+
const targetSymbol = _chunkNELAYNA3cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
545
|
+
const isSourceStablecoin = _chunkNELAYNA3cjs.isStablecoinSymbol.call(void 0, asset.symbol);
|
|
546
546
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
547
547
|
if (tokenPriceUsdOverride !== void 0 && tokenPriceUsdOverride > 0)
|
|
548
548
|
return tokenPriceUsdOverride;
|
|
@@ -566,7 +566,7 @@ function AmountStep({
|
|
|
566
566
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
567
567
|
if (!balanceTarget || !publicClient) return;
|
|
568
568
|
try {
|
|
569
|
-
const bal =
|
|
569
|
+
const bal = _chunkLT3QKJI2cjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
570
570
|
address: asset.token,
|
|
571
571
|
abi: _viem.erc20Abi,
|
|
572
572
|
functionName: "balanceOf",
|
|
@@ -592,7 +592,7 @@ function AmountStep({
|
|
|
592
592
|
setIsSwitching(true);
|
|
593
593
|
switchChain(asset.chainId).catch((err) => {
|
|
594
594
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
595
|
-
setError(
|
|
595
|
+
setError(_chunkLT3QKJI2cjs.formatUserError.call(void 0, raw));
|
|
596
596
|
}).finally(() => {
|
|
597
597
|
setIsSwitching(false);
|
|
598
598
|
});
|
|
@@ -628,7 +628,7 @@ function AmountStep({
|
|
|
628
628
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
629
629
|
const numeric = Number(raw);
|
|
630
630
|
if (!Number.isFinite(numeric)) return raw;
|
|
631
|
-
return
|
|
631
|
+
return _chunkLT3QKJI2cjs.tokenFormatter.format(numeric);
|
|
632
632
|
} catch (e8) {
|
|
633
633
|
return "...";
|
|
634
634
|
}
|
|
@@ -670,13 +670,13 @@ function AmountStep({
|
|
|
670
670
|
const usdValue = numericAmount;
|
|
671
671
|
if (_optionalChain([uiConfig, 'optionalAccess', _11 => _11.maxDepositUsd]) && usdValue > uiConfig.maxDepositUsd) {
|
|
672
672
|
setError(
|
|
673
|
-
`Maximum deposit is ${
|
|
673
|
+
`Maximum deposit is ${_chunkLT3QKJI2cjs.currencyFormatter.format(uiConfig.maxDepositUsd)}`
|
|
674
674
|
);
|
|
675
675
|
return;
|
|
676
676
|
}
|
|
677
677
|
if (_optionalChain([uiConfig, 'optionalAccess', _12 => _12.minDepositUsd]) && usdValue < uiConfig.minDepositUsd) {
|
|
678
678
|
setError(
|
|
679
|
-
`Minimum deposit is ${
|
|
679
|
+
`Minimum deposit is ${_chunkLT3QKJI2cjs.currencyFormatter.format(uiConfig.minDepositUsd)}`
|
|
680
680
|
);
|
|
681
681
|
return;
|
|
682
682
|
}
|
|
@@ -725,7 +725,7 @@ function AmountStep({
|
|
|
725
725
|
hasPricing && balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { style: { color: "var(--rs-muted-foreground)" }, children: [
|
|
726
726
|
" ",
|
|
727
727
|
"(",
|
|
728
|
-
|
|
728
|
+
_chunkLT3QKJI2cjs.currencyFormatter.format(balanceUsd),
|
|
729
729
|
")"
|
|
730
730
|
] })
|
|
731
731
|
] }) })
|
|
@@ -739,26 +739,26 @@ function AmountStep({
|
|
|
739
739
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-flow-pill-label", children: "You send" }),
|
|
740
740
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-flow-pill-token", children: [
|
|
741
741
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-flow-pill-token-icon-wrapper", children: [
|
|
742
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-flow-pill-token-icon", children:
|
|
742
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-flow-pill-token-icon", children: _chunkNELAYNA3cjs.getTokenIcon.call(void 0, asset.symbol) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
743
743
|
"img",
|
|
744
744
|
{
|
|
745
|
-
src:
|
|
745
|
+
src: _chunkNELAYNA3cjs.getTokenIcon.call(void 0, asset.symbol),
|
|
746
746
|
alt: asset.symbol
|
|
747
747
|
}
|
|
748
748
|
) : asset.symbol.slice(0, 2) }),
|
|
749
749
|
(() => {
|
|
750
|
-
const chainIcon =
|
|
750
|
+
const chainIcon = _chunkNELAYNA3cjs.getChainIcon.call(void 0, asset.chainId);
|
|
751
751
|
if (chainIcon) {
|
|
752
752
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
753
753
|
"img",
|
|
754
754
|
{
|
|
755
755
|
src: chainIcon,
|
|
756
|
-
alt:
|
|
756
|
+
alt: _chunkNELAYNA3cjs.getChainName.call(void 0, asset.chainId),
|
|
757
757
|
className: "rs-flow-pill-chain-badge"
|
|
758
758
|
}
|
|
759
759
|
);
|
|
760
760
|
}
|
|
761
|
-
const badge =
|
|
761
|
+
const badge = _chunkNELAYNA3cjs.getChainBadge.call(void 0, asset.chainId);
|
|
762
762
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
763
763
|
"div",
|
|
764
764
|
{
|
|
@@ -796,26 +796,26 @@ function AmountStep({
|
|
|
796
796
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-flow-pill-label", children: "You receive" }),
|
|
797
797
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-flow-pill-token", children: [
|
|
798
798
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-flow-pill-token-icon-wrapper", children: [
|
|
799
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-flow-pill-token-icon", children:
|
|
799
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-flow-pill-token-icon", children: _chunkNELAYNA3cjs.getTokenIcon.call(void 0, targetSymbol) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
800
800
|
"img",
|
|
801
801
|
{
|
|
802
|
-
src:
|
|
802
|
+
src: _chunkNELAYNA3cjs.getTokenIcon.call(void 0, targetSymbol),
|
|
803
803
|
alt: targetSymbol
|
|
804
804
|
}
|
|
805
805
|
) : targetSymbol.slice(0, 2) }),
|
|
806
806
|
(() => {
|
|
807
|
-
const chainIcon =
|
|
807
|
+
const chainIcon = _chunkNELAYNA3cjs.getChainIcon.call(void 0, targetChain);
|
|
808
808
|
if (chainIcon) {
|
|
809
809
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
810
810
|
"img",
|
|
811
811
|
{
|
|
812
812
|
src: chainIcon,
|
|
813
|
-
alt:
|
|
813
|
+
alt: _chunkNELAYNA3cjs.getChainName.call(void 0, targetChain),
|
|
814
814
|
className: "rs-flow-pill-chain-badge"
|
|
815
815
|
}
|
|
816
816
|
);
|
|
817
817
|
}
|
|
818
|
-
const badge =
|
|
818
|
+
const badge = _chunkNELAYNA3cjs.getChainBadge.call(void 0, targetChain);
|
|
819
819
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
820
820
|
"div",
|
|
821
821
|
{
|
|
@@ -861,7 +861,6 @@ function AmountStep({
|
|
|
861
861
|
}
|
|
862
862
|
)
|
|
863
863
|
] }),
|
|
864
|
-
chainMismatch && !isSwitching && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-chain-switch", style: { marginTop: 16 }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-chain-switch-text", children: `Switch your wallet to ${_chunkZNHU72LIcjs.getChainName.call(void 0, asset.chainId)} to continue.` }) }),
|
|
865
864
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", children: [
|
|
866
865
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
867
866
|
"svg",
|
|
@@ -885,7 +884,7 @@ function AmountStep({
|
|
|
885
884
|
] })
|
|
886
885
|
] }),
|
|
887
886
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
888
|
-
|
|
887
|
+
_chunkLT3QKJI2cjs.Button,
|
|
889
888
|
{
|
|
890
889
|
onClick: handleContinue,
|
|
891
890
|
fullWidth: true,
|
|
@@ -893,7 +892,7 @@ function AmountStep({
|
|
|
893
892
|
children: "Continue"
|
|
894
893
|
}
|
|
895
894
|
) }),
|
|
896
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
895
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLT3QKJI2cjs.PoweredBy, {})
|
|
897
896
|
] });
|
|
898
897
|
}
|
|
899
898
|
|
|
@@ -924,7 +923,7 @@ function ConfirmStep({
|
|
|
924
923
|
const hasAttemptedSwitch = _react.useRef.call(void 0, false);
|
|
925
924
|
const chainMismatch = _optionalChain([walletClient, 'optionalAccess', _13 => _13.chain, 'optionalAccess', _14 => _14.id]) && walletClient.chain.id !== asset.chainId;
|
|
926
925
|
const sameRoute = targetChain === asset.chainId && targetToken.toLowerCase() === asset.token.toLowerCase();
|
|
927
|
-
const targetSymbol = sameRoute ? asset.symbol :
|
|
926
|
+
const targetSymbol = sameRoute ? asset.symbol : _chunkNELAYNA3cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
928
927
|
const formattedSendAmount = amount && !Number.isNaN(Number(amount)) ? Number(amount).toLocaleString("en-US", { maximumFractionDigits: 6 }) : "0";
|
|
929
928
|
const formattedReceiveAmount = (() => {
|
|
930
929
|
if (sameRoute) return formattedSendAmount;
|
|
@@ -943,7 +942,7 @@ function ConfirmStep({
|
|
|
943
942
|
setIsSwitching(true);
|
|
944
943
|
switchChain(asset.chainId).catch((err) => {
|
|
945
944
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
946
|
-
setError(
|
|
945
|
+
setError(_chunkLT3QKJI2cjs.formatUserError.call(void 0, raw));
|
|
947
946
|
}).finally(() => {
|
|
948
947
|
setIsSwitching(false);
|
|
949
948
|
});
|
|
@@ -958,7 +957,7 @@ function ConfirmStep({
|
|
|
958
957
|
return;
|
|
959
958
|
}
|
|
960
959
|
if (chainMismatch) {
|
|
961
|
-
setError(`Switch to ${
|
|
960
|
+
setError(`Switch to ${_chunkNELAYNA3cjs.getChainName.call(void 0, asset.chainId)} to sign`);
|
|
962
961
|
return;
|
|
963
962
|
}
|
|
964
963
|
const parsedAmount = parseFloat(amount);
|
|
@@ -986,7 +985,7 @@ function ConfirmStep({
|
|
|
986
985
|
throw new Error("Wallet not properly connected");
|
|
987
986
|
}
|
|
988
987
|
const transferTo = sameRoute ? recipient : smartAccount;
|
|
989
|
-
const hash =
|
|
988
|
+
const hash = _chunkLT3QKJI2cjs.isNativeAsset.call(void 0, asset) ? await walletClient.sendTransaction({
|
|
990
989
|
account,
|
|
991
990
|
chain,
|
|
992
991
|
to: transferTo,
|
|
@@ -1003,7 +1002,7 @@ function ConfirmStep({
|
|
|
1003
1002
|
onConfirm(hash, asset.chainId, amountUnits.toString(), asset.token);
|
|
1004
1003
|
} catch (err) {
|
|
1005
1004
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
1006
|
-
const message =
|
|
1005
|
+
const message = _chunkLT3QKJI2cjs.formatUserError.call(void 0, raw);
|
|
1007
1006
|
setError(message);
|
|
1008
1007
|
_optionalChain([onError, 'optionalCall', _16 => _16(message, "TRANSFER_ERROR")]);
|
|
1009
1008
|
} finally {
|
|
@@ -1022,15 +1021,15 @@ function ConfirmStep({
|
|
|
1022
1021
|
className: "rs-card-value",
|
|
1023
1022
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
1024
1023
|
children: [
|
|
1025
|
-
|
|
1024
|
+
_chunkNELAYNA3cjs.getChainIcon.call(void 0, asset.chainId) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1026
1025
|
"img",
|
|
1027
1026
|
{
|
|
1028
|
-
src:
|
|
1027
|
+
src: _chunkNELAYNA3cjs.getChainIcon.call(void 0, asset.chainId),
|
|
1029
1028
|
alt: "",
|
|
1030
1029
|
style: { width: 16, height: 16, borderRadius: 3 }
|
|
1031
1030
|
}
|
|
1032
1031
|
),
|
|
1033
|
-
|
|
1032
|
+
_chunkNELAYNA3cjs.getChainName.call(void 0, asset.chainId)
|
|
1034
1033
|
]
|
|
1035
1034
|
}
|
|
1036
1035
|
)
|
|
@@ -1043,15 +1042,15 @@ function ConfirmStep({
|
|
|
1043
1042
|
className: "rs-card-value",
|
|
1044
1043
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
1045
1044
|
children: [
|
|
1046
|
-
|
|
1045
|
+
_chunkNELAYNA3cjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1047
1046
|
"img",
|
|
1048
1047
|
{
|
|
1049
|
-
src:
|
|
1048
|
+
src: _chunkNELAYNA3cjs.getChainIcon.call(void 0, targetChain),
|
|
1050
1049
|
alt: "",
|
|
1051
1050
|
style: { width: 16, height: 16, borderRadius: 3 }
|
|
1052
1051
|
}
|
|
1053
1052
|
),
|
|
1054
|
-
|
|
1053
|
+
_chunkNELAYNA3cjs.getChainName.call(void 0, targetChain)
|
|
1055
1054
|
]
|
|
1056
1055
|
}
|
|
1057
1056
|
)
|
|
@@ -1070,10 +1069,10 @@ function ConfirmStep({
|
|
|
1070
1069
|
className: "rs-card-value",
|
|
1071
1070
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
1072
1071
|
children: [
|
|
1073
|
-
|
|
1072
|
+
_chunkNELAYNA3cjs.getTokenIcon.call(void 0, asset.symbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1074
1073
|
"img",
|
|
1075
1074
|
{
|
|
1076
|
-
src:
|
|
1075
|
+
src: _chunkNELAYNA3cjs.getTokenIcon.call(void 0, asset.symbol),
|
|
1077
1076
|
alt: "",
|
|
1078
1077
|
style: { width: 16, height: 16, borderRadius: "50%" }
|
|
1079
1078
|
}
|
|
@@ -1093,10 +1092,10 @@ function ConfirmStep({
|
|
|
1093
1092
|
className: "rs-card-value",
|
|
1094
1093
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
1095
1094
|
children: [
|
|
1096
|
-
|
|
1095
|
+
_chunkNELAYNA3cjs.getTokenIcon.call(void 0, targetSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1097
1096
|
"img",
|
|
1098
1097
|
{
|
|
1099
|
-
src:
|
|
1098
|
+
src: _chunkNELAYNA3cjs.getTokenIcon.call(void 0, targetSymbol),
|
|
1100
1099
|
alt: "",
|
|
1101
1100
|
style: { width: 16, height: 16, borderRadius: "50%" }
|
|
1102
1101
|
}
|
|
@@ -1109,7 +1108,6 @@ function ConfirmStep({
|
|
|
1109
1108
|
)
|
|
1110
1109
|
] })
|
|
1111
1110
|
] }),
|
|
1112
|
-
chainMismatch && !isSwitching && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-chain-switch", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-chain-switch-text", children: `Switch your wallet to ${_chunkZNHU72LIcjs.getChainName.call(void 0, asset.chainId)} to sign.` }) }),
|
|
1113
1111
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-alert rs-alert--error", children: [
|
|
1114
1112
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1115
1113
|
"svg",
|
|
@@ -1133,7 +1131,7 @@ function ConfirmStep({
|
|
|
1133
1131
|
] })
|
|
1134
1132
|
] }),
|
|
1135
1133
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1136
|
-
|
|
1134
|
+
_chunkLT3QKJI2cjs.Button,
|
|
1137
1135
|
{
|
|
1138
1136
|
onClick: handleConfirm,
|
|
1139
1137
|
loading: isSubmitting,
|
|
@@ -1142,7 +1140,7 @@ function ConfirmStep({
|
|
|
1142
1140
|
children: "Confirm Order"
|
|
1143
1141
|
}
|
|
1144
1142
|
) }),
|
|
1145
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1143
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLT3QKJI2cjs.PoweredBy, {})
|
|
1146
1144
|
] });
|
|
1147
1145
|
}
|
|
1148
1146
|
|
|
@@ -1436,7 +1434,7 @@ function DepositAddressStep({
|
|
|
1436
1434
|
onError
|
|
1437
1435
|
}) {
|
|
1438
1436
|
const hasSolana = Boolean(solanaDepositAddress);
|
|
1439
|
-
const evmChainIds = _react.useMemo.call(void 0, () =>
|
|
1437
|
+
const evmChainIds = _react.useMemo.call(void 0, () => _chunkNELAYNA3cjs.getSupportedChainIds.call(void 0, ), []);
|
|
1440
1438
|
const chainOptions = _react.useMemo.call(void 0,
|
|
1441
1439
|
() => hasSolana ? [...evmChainIds, "solana"] : evmChainIds,
|
|
1442
1440
|
[evmChainIds, hasSolana]
|
|
@@ -1446,7 +1444,7 @@ function DepositAddressStep({
|
|
|
1446
1444
|
const [sourceChainId, setSourceChainId] = _react.useState.call(void 0, defaultChainId);
|
|
1447
1445
|
const isSolana = sourceChainId === "solana";
|
|
1448
1446
|
const tokensForChain = _react.useMemo.call(void 0,
|
|
1449
|
-
() => isSolana ? SOLANA_TOKENS.map((t) => t.symbol) :
|
|
1447
|
+
() => isSolana ? SOLANA_TOKENS.map((t) => t.symbol) : _chunkNELAYNA3cjs.getTargetTokenSymbolsForChain.call(void 0, sourceChainId),
|
|
1450
1448
|
[sourceChainId, isSolana]
|
|
1451
1449
|
);
|
|
1452
1450
|
const defaultToken = tokensForChain.includes("USDC") ? "USDC" : _nullishCoalesce(tokensForChain[0], () => ( "USDC"));
|
|
@@ -1466,7 +1464,7 @@ function DepositAddressStep({
|
|
|
1466
1464
|
const depositHandledRef = _react.useRef.call(void 0, false);
|
|
1467
1465
|
const sourceSelectionRef = _react.useRef.call(void 0, {
|
|
1468
1466
|
chainId: defaultChainId,
|
|
1469
|
-
token: typeof defaultChainId === "number" ?
|
|
1467
|
+
token: typeof defaultChainId === "number" ? _chunkNELAYNA3cjs.getTokenAddress.call(void 0, defaultToken, defaultChainId) : void 0,
|
|
1470
1468
|
sourceSymbol: defaultToken
|
|
1471
1469
|
});
|
|
1472
1470
|
_react.useEffect.call(void 0, () => {
|
|
@@ -1482,7 +1480,7 @@ function DepositAddressStep({
|
|
|
1482
1480
|
}
|
|
1483
1481
|
sourceSelectionRef.current = {
|
|
1484
1482
|
chainId: sourceChainId,
|
|
1485
|
-
token:
|
|
1483
|
+
token: _chunkNELAYNA3cjs.getTokenAddress.call(void 0, sourceTokenSymbol, sourceChainId),
|
|
1486
1484
|
sourceSymbol: sourceTokenSymbol
|
|
1487
1485
|
};
|
|
1488
1486
|
}, [sourceChainId, sourceTokenSymbol, isSolana]);
|
|
@@ -1540,10 +1538,10 @@ function DepositAddressStep({
|
|
|
1540
1538
|
const status = await service.fetchLatestStatus(smartAccount);
|
|
1541
1539
|
if (cancelled || depositHandledRef.current) return;
|
|
1542
1540
|
const event = status.lastEvent;
|
|
1543
|
-
const eventTxHash =
|
|
1541
|
+
const eventTxHash = _chunkLT3QKJI2cjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkLT3QKJI2cjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
1544
1542
|
if (baselineTxHash === void 0) {
|
|
1545
1543
|
baselineTxHash = eventTxHash;
|
|
1546
|
-
} else if (eventTxHash && (!baselineTxHash || !
|
|
1544
|
+
} else if (eventTxHash && (!baselineTxHash || !_chunkLT3QKJI2cjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHash))) {
|
|
1547
1545
|
const details = getDepositEventDetails(event);
|
|
1548
1546
|
const fallback = sourceSelectionRef.current;
|
|
1549
1547
|
const chainId = _nullishCoalesce(details.chainId, () => ( fallback.chainId));
|
|
@@ -1582,7 +1580,7 @@ function DepositAddressStep({
|
|
|
1582
1580
|
clearTimeout(timeoutId);
|
|
1583
1581
|
};
|
|
1584
1582
|
}, [smartAccount, service, onDepositDetected, onError]);
|
|
1585
|
-
const qrIconSrc =
|
|
1583
|
+
const qrIconSrc = _chunkNELAYNA3cjs.getChainIcon.call(void 0, sourceChainId);
|
|
1586
1584
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
1587
1585
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-body", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address", children: [
|
|
1588
1586
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", children: [
|
|
@@ -1598,15 +1596,15 @@ function DepositAddressStep({
|
|
|
1598
1596
|
setTokenDropdownOpen(false);
|
|
1599
1597
|
},
|
|
1600
1598
|
children: [
|
|
1601
|
-
|
|
1599
|
+
_chunkNELAYNA3cjs.getChainIcon.call(void 0, sourceChainId) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1602
1600
|
"img",
|
|
1603
1601
|
{
|
|
1604
|
-
src:
|
|
1602
|
+
src: _chunkNELAYNA3cjs.getChainIcon.call(void 0, sourceChainId),
|
|
1605
1603
|
alt: "",
|
|
1606
1604
|
className: "rs-deposit-address-dropdown-icon"
|
|
1607
1605
|
}
|
|
1608
1606
|
),
|
|
1609
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children:
|
|
1607
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunkNELAYNA3cjs.getChainName.call(void 0, sourceChainId) }),
|
|
1610
1608
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1611
1609
|
"svg",
|
|
1612
1610
|
{
|
|
@@ -1638,15 +1636,15 @@ function DepositAddressStep({
|
|
|
1638
1636
|
setChainDropdownOpen(false);
|
|
1639
1637
|
},
|
|
1640
1638
|
children: [
|
|
1641
|
-
|
|
1639
|
+
_chunkNELAYNA3cjs.getChainIcon.call(void 0, chainId) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1642
1640
|
"img",
|
|
1643
1641
|
{
|
|
1644
|
-
src:
|
|
1642
|
+
src: _chunkNELAYNA3cjs.getChainIcon.call(void 0, chainId),
|
|
1645
1643
|
alt: "",
|
|
1646
1644
|
className: "rs-deposit-address-dropdown-icon"
|
|
1647
1645
|
}
|
|
1648
1646
|
),
|
|
1649
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children:
|
|
1647
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunkNELAYNA3cjs.getChainName.call(void 0, chainId) })
|
|
1650
1648
|
]
|
|
1651
1649
|
},
|
|
1652
1650
|
String(chainId)
|
|
@@ -1664,10 +1662,10 @@ function DepositAddressStep({
|
|
|
1664
1662
|
setChainDropdownOpen(false);
|
|
1665
1663
|
},
|
|
1666
1664
|
children: [
|
|
1667
|
-
|
|
1665
|
+
_chunkNELAYNA3cjs.getTokenIcon.call(void 0, sourceTokenSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1668
1666
|
"img",
|
|
1669
1667
|
{
|
|
1670
|
-
src:
|
|
1668
|
+
src: _chunkNELAYNA3cjs.getTokenIcon.call(void 0, sourceTokenSymbol),
|
|
1671
1669
|
alt: "",
|
|
1672
1670
|
className: "rs-deposit-address-dropdown-icon"
|
|
1673
1671
|
}
|
|
@@ -1704,10 +1702,10 @@ function DepositAddressStep({
|
|
|
1704
1702
|
setTokenDropdownOpen(false);
|
|
1705
1703
|
},
|
|
1706
1704
|
children: [
|
|
1707
|
-
|
|
1705
|
+
_chunkNELAYNA3cjs.getTokenIcon.call(void 0, symbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1708
1706
|
"img",
|
|
1709
1707
|
{
|
|
1710
|
-
src:
|
|
1708
|
+
src: _chunkNELAYNA3cjs.getTokenIcon.call(void 0, symbol),
|
|
1711
1709
|
alt: "",
|
|
1712
1710
|
className: "rs-deposit-address-dropdown-icon"
|
|
1713
1711
|
}
|
|
@@ -1766,7 +1764,7 @@ function DepositAddressStep({
|
|
|
1766
1764
|
] }),
|
|
1767
1765
|
pollingError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-error", children: pollingError })
|
|
1768
1766
|
] }) }),
|
|
1769
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1767
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLT3QKJI2cjs.PoweredBy, {})
|
|
1770
1768
|
] });
|
|
1771
1769
|
}
|
|
1772
1770
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -1797,7 +1795,7 @@ function SolanaTokenSelectStep({
|
|
|
1797
1795
|
setError(null);
|
|
1798
1796
|
const portfolioBySymbol = {};
|
|
1799
1797
|
try {
|
|
1800
|
-
|
|
1798
|
+
_chunkLT3QKJI2cjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
|
|
1801
1799
|
solanaAddress
|
|
1802
1800
|
});
|
|
1803
1801
|
const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
|
|
@@ -1820,12 +1818,12 @@ function SolanaTokenSelectStep({
|
|
|
1820
1818
|
};
|
|
1821
1819
|
}
|
|
1822
1820
|
}
|
|
1823
|
-
|
|
1821
|
+
_chunkLT3QKJI2cjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
|
|
1824
1822
|
symbols: Object.keys(portfolioBySymbol)
|
|
1825
1823
|
});
|
|
1826
1824
|
} catch (err) {
|
|
1827
1825
|
if (!active) return;
|
|
1828
|
-
|
|
1826
|
+
_chunkLT3QKJI2cjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
|
|
1829
1827
|
solanaAddress
|
|
1830
1828
|
});
|
|
1831
1829
|
setError(
|
|
@@ -1879,7 +1877,7 @@ function SolanaTokenSelectStep({
|
|
|
1879
1877
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
1880
1878
|
children: [
|
|
1881
1879
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
1882
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1880
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLT3QKJI2cjs.Spinner, { className: "rs-text-tertiary" }),
|
|
1883
1881
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
1884
1882
|
] }),
|
|
1885
1883
|
!loading && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
@@ -1910,13 +1908,13 @@ function SolanaTokenSelectStep({
|
|
|
1910
1908
|
] }),
|
|
1911
1909
|
!loading && rows.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: rows.map((entry) => {
|
|
1912
1910
|
const isSelected = selectedSymbol === entry.token.symbol;
|
|
1913
|
-
const tokenIcon =
|
|
1914
|
-
const chainIcon =
|
|
1911
|
+
const tokenIcon = _chunkNELAYNA3cjs.getTokenIcon.call(void 0, entry.token.symbol);
|
|
1912
|
+
const chainIcon = _chunkNELAYNA3cjs.getChainIcon.call(void 0, "solana");
|
|
1915
1913
|
let formattedBalance;
|
|
1916
1914
|
try {
|
|
1917
1915
|
const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
|
|
1918
1916
|
const numeric = Number(raw);
|
|
1919
|
-
formattedBalance = Number.isFinite(numeric) ?
|
|
1917
|
+
formattedBalance = Number.isFinite(numeric) ? _chunkLT3QKJI2cjs.tokenFormatter.format(numeric) : raw;
|
|
1920
1918
|
} catch (e14) {
|
|
1921
1919
|
formattedBalance = "...";
|
|
1922
1920
|
}
|
|
@@ -1960,7 +1958,7 @@ function SolanaTokenSelectStep({
|
|
|
1960
1958
|
] })
|
|
1961
1959
|
] })
|
|
1962
1960
|
] }),
|
|
1963
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ?
|
|
1961
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunkLT3QKJI2cjs.currencyFormatter.format(entry.balanceUsd) : `${formattedBalance} ${entry.token.symbol}` })
|
|
1964
1962
|
]
|
|
1965
1963
|
},
|
|
1966
1964
|
entry.token.symbol
|
|
@@ -1970,7 +1968,7 @@ function SolanaTokenSelectStep({
|
|
|
1970
1968
|
}
|
|
1971
1969
|
),
|
|
1972
1970
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1973
|
-
|
|
1971
|
+
_chunkLT3QKJI2cjs.Button,
|
|
1974
1972
|
{
|
|
1975
1973
|
onClick: () => selectedEntry && onContinue(
|
|
1976
1974
|
selectedEntry.token,
|
|
@@ -1982,7 +1980,7 @@ function SolanaTokenSelectStep({
|
|
|
1982
1980
|
children: "Continue"
|
|
1983
1981
|
}
|
|
1984
1982
|
) }),
|
|
1985
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1983
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLT3QKJI2cjs.PoweredBy, {})
|
|
1986
1984
|
] });
|
|
1987
1985
|
}
|
|
1988
1986
|
|
|
@@ -2005,14 +2003,14 @@ function SolanaAmountStep({
|
|
|
2005
2003
|
const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
|
|
2006
2004
|
const numeric = Number(raw);
|
|
2007
2005
|
if (!Number.isFinite(numeric)) return raw;
|
|
2008
|
-
return
|
|
2006
|
+
return _chunkLT3QKJI2cjs.tokenFormatter.format(numeric);
|
|
2009
2007
|
} catch (e15) {
|
|
2010
2008
|
return "...";
|
|
2011
2009
|
}
|
|
2012
2010
|
}, [balance, token.decimals]);
|
|
2013
2011
|
const formattedBalanceUsd = _react.useMemo.call(void 0, () => {
|
|
2014
2012
|
if (!Number.isFinite(balanceUsd) || balanceUsd <= 0) return null;
|
|
2015
|
-
return
|
|
2013
|
+
return _chunkLT3QKJI2cjs.currencyFormatter.format(balanceUsd);
|
|
2016
2014
|
}, [balanceUsd]);
|
|
2017
2015
|
const spendableBalance = _react.useMemo.call(void 0, () => {
|
|
2018
2016
|
if (!isNativeSol(token)) return balance;
|
|
@@ -2027,7 +2025,7 @@ function SolanaAmountStep({
|
|
|
2027
2025
|
const factor = 10 ** maxDecimals;
|
|
2028
2026
|
const truncated = Math.floor(value * factor) / factor;
|
|
2029
2027
|
const formatted = truncated.toFixed(maxDecimals).replace(/\.?0+$/, "");
|
|
2030
|
-
|
|
2028
|
+
_chunkLT3QKJI2cjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
|
|
2031
2029
|
percentage,
|
|
2032
2030
|
symbol: token.symbol,
|
|
2033
2031
|
formatted
|
|
@@ -2041,7 +2039,7 @@ function SolanaAmountStep({
|
|
|
2041
2039
|
const handleContinue = () => {
|
|
2042
2040
|
const numericAmount = parseFloat(amount);
|
|
2043
2041
|
if (isNaN(numericAmount) || numericAmount <= 0) {
|
|
2044
|
-
|
|
2042
|
+
_chunkLT3QKJI2cjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2045
2043
|
amount,
|
|
2046
2044
|
reason: "nan-or-non-positive"
|
|
2047
2045
|
});
|
|
@@ -2052,7 +2050,7 @@ function SolanaAmountStep({
|
|
|
2052
2050
|
try {
|
|
2053
2051
|
amountInUnits = _viem.parseUnits.call(void 0, amount, token.decimals);
|
|
2054
2052
|
} catch (e17) {
|
|
2055
|
-
|
|
2053
|
+
_chunkLT3QKJI2cjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2056
2054
|
amount,
|
|
2057
2055
|
reason: "parse-units-failed"
|
|
2058
2056
|
});
|
|
@@ -2061,7 +2059,7 @@ function SolanaAmountStep({
|
|
|
2061
2059
|
}
|
|
2062
2060
|
if (amountInUnits > spendableBalance) {
|
|
2063
2061
|
const isReserveIssue = isNativeSol(token) && amountInUnits <= balance;
|
|
2064
|
-
|
|
2062
|
+
_chunkLT3QKJI2cjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2065
2063
|
amount,
|
|
2066
2064
|
balance: balance.toString(),
|
|
2067
2065
|
spendableBalance: spendableBalance.toString(),
|
|
@@ -2073,7 +2071,7 @@ function SolanaAmountStep({
|
|
|
2073
2071
|
);
|
|
2074
2072
|
return;
|
|
2075
2073
|
}
|
|
2076
|
-
|
|
2074
|
+
_chunkLT3QKJI2cjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
|
|
2077
2075
|
symbol: token.symbol,
|
|
2078
2076
|
amount,
|
|
2079
2077
|
amountInUnits: amountInUnits.toString()
|
|
@@ -2163,7 +2161,7 @@ function SolanaAmountStep({
|
|
|
2163
2161
|
] })
|
|
2164
2162
|
] }),
|
|
2165
2163
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2166
|
-
|
|
2164
|
+
_chunkLT3QKJI2cjs.Button,
|
|
2167
2165
|
{
|
|
2168
2166
|
onClick: handleContinue,
|
|
2169
2167
|
fullWidth: true,
|
|
@@ -2171,7 +2169,7 @@ function SolanaAmountStep({
|
|
|
2171
2169
|
children: "Continue"
|
|
2172
2170
|
}
|
|
2173
2171
|
) }),
|
|
2174
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2172
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLT3QKJI2cjs.PoweredBy, {})
|
|
2175
2173
|
] });
|
|
2176
2174
|
}
|
|
2177
2175
|
|
|
@@ -2197,7 +2195,7 @@ function SolanaConfirmStep({
|
|
|
2197
2195
|
}) {
|
|
2198
2196
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
2199
2197
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
2200
|
-
const targetSymbol =
|
|
2198
|
+
const targetSymbol = _chunkNELAYNA3cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
2201
2199
|
const isSameToken = token.symbol.toUpperCase() === targetSymbol.toUpperCase();
|
|
2202
2200
|
const formattedAmount = amount && !Number.isNaN(Number(amount)) ? Number(amount).toLocaleString("en-US", { maximumFractionDigits: 6 }) : "0";
|
|
2203
2201
|
const formattedReceiveAmount = (() => {
|
|
@@ -2214,7 +2212,7 @@ function SolanaConfirmStep({
|
|
|
2214
2212
|
const receiveAmount = isSameToken ? formattedReceiveAmount : `~ ${formattedReceiveAmount}`;
|
|
2215
2213
|
const handleConfirm = async () => {
|
|
2216
2214
|
if (!solanaProvider) {
|
|
2217
|
-
|
|
2215
|
+
_chunkLT3QKJI2cjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
2218
2216
|
reason: "missing-provider"
|
|
2219
2217
|
});
|
|
2220
2218
|
setError("Solana wallet not connected");
|
|
@@ -2222,7 +2220,7 @@ function SolanaConfirmStep({
|
|
|
2222
2220
|
}
|
|
2223
2221
|
const parsedAmount = parseFloat(amount);
|
|
2224
2222
|
if (isNaN(parsedAmount) || parsedAmount <= 0) {
|
|
2225
|
-
|
|
2223
|
+
_chunkLT3QKJI2cjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
2226
2224
|
reason: "invalid-amount",
|
|
2227
2225
|
amount
|
|
2228
2226
|
});
|
|
@@ -2231,7 +2229,7 @@ function SolanaConfirmStep({
|
|
|
2231
2229
|
}
|
|
2232
2230
|
setError(null);
|
|
2233
2231
|
setIsSubmitting(true);
|
|
2234
|
-
|
|
2232
|
+
_chunkLT3QKJI2cjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
|
|
2235
2233
|
smartAccount,
|
|
2236
2234
|
solanaAddress,
|
|
2237
2235
|
solanaDepositAddress,
|
|
@@ -2240,7 +2238,7 @@ function SolanaConfirmStep({
|
|
|
2240
2238
|
});
|
|
2241
2239
|
try {
|
|
2242
2240
|
const check = await service.checkAccount(smartAccount);
|
|
2243
|
-
|
|
2241
|
+
_chunkLT3QKJI2cjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
|
|
2244
2242
|
smartAccount,
|
|
2245
2243
|
isRegistered: check.isRegistered,
|
|
2246
2244
|
targetChain: check.targetChain,
|
|
@@ -2253,7 +2251,7 @@ function SolanaConfirmStep({
|
|
|
2253
2251
|
}
|
|
2254
2252
|
const connection = getSolanaConnection();
|
|
2255
2253
|
const amountUnits = _viem.parseUnits.call(void 0, amount, token.decimals);
|
|
2256
|
-
|
|
2254
|
+
_chunkLT3QKJI2cjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
|
|
2257
2255
|
token: token.symbol,
|
|
2258
2256
|
amount,
|
|
2259
2257
|
amountUnits: amountUnits.toString()
|
|
@@ -2270,7 +2268,7 @@ function SolanaConfirmStep({
|
|
|
2270
2268
|
token.mint,
|
|
2271
2269
|
amountUnits
|
|
2272
2270
|
);
|
|
2273
|
-
|
|
2271
|
+
_chunkLT3QKJI2cjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
2274
2272
|
token: token.symbol,
|
|
2275
2273
|
instructionCount: transaction.instructions.length,
|
|
2276
2274
|
feePayer: _optionalChain([transaction, 'access', _34 => _34.feePayer, 'optionalAccess', _35 => _35.toBase58, 'call', _36 => _36()]),
|
|
@@ -2281,15 +2279,15 @@ function SolanaConfirmStep({
|
|
|
2281
2279
|
connection,
|
|
2282
2280
|
transaction
|
|
2283
2281
|
);
|
|
2284
|
-
|
|
2282
|
+
_chunkLT3QKJI2cjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
|
|
2285
2283
|
txHash,
|
|
2286
2284
|
amountUnits: amountUnits.toString()
|
|
2287
2285
|
});
|
|
2288
2286
|
onConfirm(txHash, amountUnits.toString());
|
|
2289
2287
|
} catch (err) {
|
|
2290
2288
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
2291
|
-
const message =
|
|
2292
|
-
|
|
2289
|
+
const message = _chunkLT3QKJI2cjs.formatUserError.call(void 0, raw);
|
|
2290
|
+
_chunkLT3QKJI2cjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
|
|
2293
2291
|
smartAccount,
|
|
2294
2292
|
token: token.symbol,
|
|
2295
2293
|
amount
|
|
@@ -2312,15 +2310,15 @@ function SolanaConfirmStep({
|
|
|
2312
2310
|
className: "rs-card-value",
|
|
2313
2311
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
2314
2312
|
children: [
|
|
2315
|
-
|
|
2313
|
+
_chunkNELAYNA3cjs.getChainIcon.call(void 0, "solana") && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2316
2314
|
"img",
|
|
2317
2315
|
{
|
|
2318
|
-
src:
|
|
2316
|
+
src: _chunkNELAYNA3cjs.getChainIcon.call(void 0, "solana"),
|
|
2319
2317
|
alt: "",
|
|
2320
2318
|
style: { width: 16, height: 16, borderRadius: 3 }
|
|
2321
2319
|
}
|
|
2322
2320
|
),
|
|
2323
|
-
|
|
2321
|
+
_chunkNELAYNA3cjs.getChainName.call(void 0, "solana")
|
|
2324
2322
|
]
|
|
2325
2323
|
}
|
|
2326
2324
|
)
|
|
@@ -2333,15 +2331,15 @@ function SolanaConfirmStep({
|
|
|
2333
2331
|
className: "rs-card-value",
|
|
2334
2332
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
2335
2333
|
children: [
|
|
2336
|
-
|
|
2334
|
+
_chunkNELAYNA3cjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2337
2335
|
"img",
|
|
2338
2336
|
{
|
|
2339
|
-
src:
|
|
2337
|
+
src: _chunkNELAYNA3cjs.getChainIcon.call(void 0, targetChain),
|
|
2340
2338
|
alt: "",
|
|
2341
2339
|
style: { width: 16, height: 16, borderRadius: 3 }
|
|
2342
2340
|
}
|
|
2343
2341
|
),
|
|
2344
|
-
|
|
2342
|
+
_chunkNELAYNA3cjs.getChainName.call(void 0, targetChain)
|
|
2345
2343
|
]
|
|
2346
2344
|
}
|
|
2347
2345
|
)
|
|
@@ -2360,10 +2358,10 @@ function SolanaConfirmStep({
|
|
|
2360
2358
|
className: "rs-card-value",
|
|
2361
2359
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
2362
2360
|
children: [
|
|
2363
|
-
|
|
2361
|
+
_chunkNELAYNA3cjs.getTokenIcon.call(void 0, token.symbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2364
2362
|
"img",
|
|
2365
2363
|
{
|
|
2366
|
-
src:
|
|
2364
|
+
src: _chunkNELAYNA3cjs.getTokenIcon.call(void 0, token.symbol),
|
|
2367
2365
|
alt: "",
|
|
2368
2366
|
style: { width: 16, height: 16, borderRadius: "50%" }
|
|
2369
2367
|
}
|
|
@@ -2383,10 +2381,10 @@ function SolanaConfirmStep({
|
|
|
2383
2381
|
className: "rs-card-value",
|
|
2384
2382
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
2385
2383
|
children: [
|
|
2386
|
-
|
|
2384
|
+
_chunkNELAYNA3cjs.getTokenIcon.call(void 0, targetSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2387
2385
|
"img",
|
|
2388
2386
|
{
|
|
2389
|
-
src:
|
|
2387
|
+
src: _chunkNELAYNA3cjs.getTokenIcon.call(void 0, targetSymbol),
|
|
2390
2388
|
alt: "",
|
|
2391
2389
|
style: { width: 16, height: 16, borderRadius: "50%" }
|
|
2392
2390
|
}
|
|
@@ -2422,7 +2420,7 @@ function SolanaConfirmStep({
|
|
|
2422
2420
|
] })
|
|
2423
2421
|
] }),
|
|
2424
2422
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2425
|
-
|
|
2423
|
+
_chunkLT3QKJI2cjs.Button,
|
|
2426
2424
|
{
|
|
2427
2425
|
onClick: handleConfirm,
|
|
2428
2426
|
loading: isSubmitting,
|
|
@@ -2431,7 +2429,7 @@ function SolanaConfirmStep({
|
|
|
2431
2429
|
children: "Confirm Order"
|
|
2432
2430
|
}
|
|
2433
2431
|
) }),
|
|
2434
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2432
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkLT3QKJI2cjs.PoweredBy, {})
|
|
2435
2433
|
] });
|
|
2436
2434
|
}
|
|
2437
2435
|
|
|
@@ -2454,7 +2452,7 @@ function DepositFlow({
|
|
|
2454
2452
|
sourceToken: defaultSourceToken,
|
|
2455
2453
|
amount: defaultAmount,
|
|
2456
2454
|
recipient,
|
|
2457
|
-
signerAddress =
|
|
2455
|
+
signerAddress = _chunkNELAYNA3cjs.DEFAULT_SIGNER_ADDRESS,
|
|
2458
2456
|
sessionChainIds,
|
|
2459
2457
|
forceRegister = false,
|
|
2460
2458
|
waitForFinalTx = true,
|
|
@@ -2486,13 +2484,13 @@ function DepositFlow({
|
|
|
2486
2484
|
flowModeRef.current = flowMode;
|
|
2487
2485
|
const logFlow = _react.useCallback.call(void 0,
|
|
2488
2486
|
(message, data) => {
|
|
2489
|
-
|
|
2487
|
+
_chunkLT3QKJI2cjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
|
|
2490
2488
|
},
|
|
2491
2489
|
[debug]
|
|
2492
2490
|
);
|
|
2493
2491
|
const logFlowError = _react.useCallback.call(void 0,
|
|
2494
2492
|
(message, error, data) => {
|
|
2495
|
-
|
|
2493
|
+
_chunkLT3QKJI2cjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
|
|
2496
2494
|
},
|
|
2497
2495
|
[debug]
|
|
2498
2496
|
);
|
|
@@ -2599,7 +2597,7 @@ function DepositFlow({
|
|
|
2599
2597
|
return {
|
|
2600
2598
|
ownerAddress: dappAddress,
|
|
2601
2599
|
walletClient: void 0,
|
|
2602
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
2600
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkLT3QKJI2cjs.getPublicClient.call(void 0, targetChain))),
|
|
2603
2601
|
switchChain: void 0
|
|
2604
2602
|
};
|
|
2605
2603
|
}
|
|
@@ -2608,7 +2606,7 @@ function DepositFlow({
|
|
|
2608
2606
|
return {
|
|
2609
2607
|
ownerAddress: dappWalletClient.account.address,
|
|
2610
2608
|
walletClient: dappWalletClient,
|
|
2611
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
2609
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkLT3QKJI2cjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
2612
2610
|
switchChain: dappSwitchChain
|
|
2613
2611
|
};
|
|
2614
2612
|
}
|
|
@@ -2622,7 +2620,7 @@ function DepositFlow({
|
|
|
2622
2620
|
return {
|
|
2623
2621
|
ownerAddress: dappAddress,
|
|
2624
2622
|
walletClient: void 0,
|
|
2625
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
2623
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkLT3QKJI2cjs.getPublicClient.call(void 0, targetChain))),
|
|
2626
2624
|
switchChain: void 0
|
|
2627
2625
|
};
|
|
2628
2626
|
}
|
|
@@ -2631,7 +2629,7 @@ function DepositFlow({
|
|
|
2631
2629
|
return {
|
|
2632
2630
|
ownerAddress: dappWalletClient.account.address,
|
|
2633
2631
|
walletClient: dappWalletClient,
|
|
2634
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
2632
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkLT3QKJI2cjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
2635
2633
|
switchChain: dappSwitchChain
|
|
2636
2634
|
};
|
|
2637
2635
|
}
|
|
@@ -2639,7 +2637,7 @@ function DepositFlow({
|
|
|
2639
2637
|
return {
|
|
2640
2638
|
ownerAddress: reownWallet.address,
|
|
2641
2639
|
walletClient: reownWallet.walletClient,
|
|
2642
|
-
publicClient: _nullishCoalesce(reownWallet.publicClient, () => (
|
|
2640
|
+
publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunkLT3QKJI2cjs.getPublicClient.call(void 0, targetChain))),
|
|
2643
2641
|
switchChain: reownWallet.switchChain
|
|
2644
2642
|
};
|
|
2645
2643
|
}
|
|
@@ -2677,7 +2675,7 @@ function DepositFlow({
|
|
|
2677
2675
|
return {
|
|
2678
2676
|
ownerAddress: dappAddress,
|
|
2679
2677
|
walletClient: void 0,
|
|
2680
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
2678
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkLT3QKJI2cjs.getPublicClient.call(void 0, targetChain))),
|
|
2681
2679
|
switchChain: void 0
|
|
2682
2680
|
};
|
|
2683
2681
|
}
|
|
@@ -2894,8 +2892,8 @@ function DepositFlow({
|
|
|
2894
2892
|
);
|
|
2895
2893
|
const handleSolanaAmountContinue = _react.useCallback.call(void 0,
|
|
2896
2894
|
(token, amount) => {
|
|
2897
|
-
const targetSym =
|
|
2898
|
-
const isTargetStable =
|
|
2895
|
+
const targetSym = _chunkNELAYNA3cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
2896
|
+
const isTargetStable = _chunkNELAYNA3cjs.isStablecoinSymbol.call(void 0, targetSym);
|
|
2899
2897
|
const targetTokenPriceUsd = isTargetStable ? 1 : getTokenPriceUsd(targetSym);
|
|
2900
2898
|
logFlow("solana:amount:continue", {
|
|
2901
2899
|
token: token.symbol,
|
|
@@ -2976,8 +2974,8 @@ function DepositFlow({
|
|
|
2976
2974
|
);
|
|
2977
2975
|
const handleAmountContinue = _react.useCallback.call(void 0,
|
|
2978
2976
|
(amount, targetAmount, balance) => {
|
|
2979
|
-
const targetSym =
|
|
2980
|
-
const isTargetStable =
|
|
2977
|
+
const targetSym = _chunkNELAYNA3cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
2978
|
+
const isTargetStable = _chunkNELAYNA3cjs.isStablecoinSymbol.call(void 0, targetSym);
|
|
2981
2979
|
const targetTokenPriceUsd = isTargetStable ? 1 : getTokenPriceUsd(targetSym);
|
|
2982
2980
|
setStep((prev) => {
|
|
2983
2981
|
if (prev.type !== "amount") return prev;
|
|
@@ -3095,7 +3093,7 @@ function DepositFlow({
|
|
|
3095
3093
|
return;
|
|
3096
3094
|
}
|
|
3097
3095
|
}
|
|
3098
|
-
if (!hasWalletOptions && dappAddress && !hasReownSession) {
|
|
3096
|
+
if (!hasWalletOptions && dappAddress && !hasReownSession && !dappWalletClient) {
|
|
3099
3097
|
handleSelectTransferCrypto();
|
|
3100
3098
|
setIsConnectSelectionConfirmed(true);
|
|
3101
3099
|
}
|
|
@@ -3106,6 +3104,7 @@ function DepositFlow({
|
|
|
3106
3104
|
flowMode,
|
|
3107
3105
|
selectedWalletIdEffective,
|
|
3108
3106
|
dappAddress,
|
|
3107
|
+
dappWalletClient,
|
|
3109
3108
|
walletOptions,
|
|
3110
3109
|
handleSelectProvider,
|
|
3111
3110
|
handleSelectSolanaWallet,
|
|
@@ -3113,7 +3112,7 @@ function DepositFlow({
|
|
|
3113
3112
|
]);
|
|
3114
3113
|
if (showConnectStep) {
|
|
3115
3114
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3116
|
-
|
|
3115
|
+
_chunkLT3QKJI2cjs.ConnectStep,
|
|
3117
3116
|
{
|
|
3118
3117
|
walletOptions,
|
|
3119
3118
|
selectedWalletId: selectedWalletIdEffective,
|
|
@@ -3173,7 +3172,7 @@ function DepositFlow({
|
|
|
3173
3172
|
}
|
|
3174
3173
|
),
|
|
3175
3174
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3176
|
-
|
|
3175
|
+
_chunkLT3QKJI2cjs.ProcessingStep,
|
|
3177
3176
|
{
|
|
3178
3177
|
smartAccount: step.smartAccount,
|
|
3179
3178
|
txHash: step.txHash,
|
|
@@ -3290,7 +3289,7 @@ function DepositFlow({
|
|
|
3290
3289
|
) })
|
|
3291
3290
|
] }) : null,
|
|
3292
3291
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3293
|
-
|
|
3292
|
+
_chunkLT3QKJI2cjs.ProcessingStep,
|
|
3294
3293
|
{
|
|
3295
3294
|
smartAccount: step.smartAccount,
|
|
3296
3295
|
txHash: step.txHash,
|
|
@@ -3322,7 +3321,7 @@ function DepositFlow({
|
|
|
3322
3321
|
if (_optionalChain([signerContext, 'access', _85 => _85.publicClient, 'access', _86 => _86.chain, 'optionalAccess', _87 => _87.id]) === chainId) {
|
|
3323
3322
|
return signerContext.publicClient;
|
|
3324
3323
|
}
|
|
3325
|
-
return
|
|
3324
|
+
return _chunkLT3QKJI2cjs.getPublicClient.call(void 0, chainId);
|
|
3326
3325
|
};
|
|
3327
3326
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
3328
3327
|
step.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3391,7 +3390,7 @@ function DepositFlow({
|
|
|
3391
3390
|
}
|
|
3392
3391
|
),
|
|
3393
3392
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3394
|
-
|
|
3393
|
+
_chunkLT3QKJI2cjs.ProcessingStep,
|
|
3395
3394
|
{
|
|
3396
3395
|
smartAccount: step.smartAccount,
|
|
3397
3396
|
txHash: step.txHash,
|
|
@@ -3418,7 +3417,7 @@ function DepositFlow({
|
|
|
3418
3417
|
// src/DepositModal.tsx
|
|
3419
3418
|
|
|
3420
3419
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
3421
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
3420
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-IUZNTZ3Y.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
3422
3421
|
);
|
|
3423
3422
|
function DepositModal(props) {
|
|
3424
3423
|
const needsReown = !!props.reownAppId;
|
|
@@ -3441,9 +3440,9 @@ function DepositModalInner({
|
|
|
3441
3440
|
sourceToken,
|
|
3442
3441
|
defaultAmount,
|
|
3443
3442
|
recipient,
|
|
3444
|
-
backendUrl =
|
|
3443
|
+
backendUrl = _chunkNELAYNA3cjs.DEFAULT_BACKEND_URL,
|
|
3445
3444
|
solanaRpcUrl,
|
|
3446
|
-
signerAddress =
|
|
3445
|
+
signerAddress = _chunkNELAYNA3cjs.DEFAULT_SIGNER_ADDRESS,
|
|
3447
3446
|
sessionChainIds,
|
|
3448
3447
|
forceRegister = false,
|
|
3449
3448
|
waitForFinalTx = true,
|
|
@@ -3468,10 +3467,10 @@ function DepositModalInner({
|
|
|
3468
3467
|
const [currentStepIndex, setCurrentStepIndex] = _react.useState.call(void 0, 0);
|
|
3469
3468
|
const [totalBalanceUsd, setTotalBalanceUsd] = _react.useState.call(void 0, null);
|
|
3470
3469
|
const backHandlerRef = _react.useRef.call(void 0, void 0);
|
|
3471
|
-
const targetChain =
|
|
3472
|
-
const sourceChain = sourceChainProp ?
|
|
3470
|
+
const targetChain = _chunkNELAYNA3cjs.getChainId.call(void 0, targetChainProp);
|
|
3471
|
+
const sourceChain = sourceChainProp ? _chunkNELAYNA3cjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
3473
3472
|
const service = _react.useMemo.call(void 0,
|
|
3474
|
-
() =>
|
|
3473
|
+
() => _chunkLT3QKJI2cjs.createDepositService.call(void 0, backendUrl, {
|
|
3475
3474
|
debug,
|
|
3476
3475
|
debugScope: "service:deposit"
|
|
3477
3476
|
}),
|
|
@@ -3479,7 +3478,7 @@ function DepositModalInner({
|
|
|
3479
3478
|
);
|
|
3480
3479
|
_react.useEffect.call(void 0, () => {
|
|
3481
3480
|
if (isOpen && modalRef.current) {
|
|
3482
|
-
|
|
3481
|
+
_chunkLT3QKJI2cjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
3483
3482
|
}
|
|
3484
3483
|
}, [isOpen, theme]);
|
|
3485
3484
|
_react.useEffect.call(void 0, () => {
|
|
@@ -3518,7 +3517,7 @@ function DepositModalInner({
|
|
|
3518
3517
|
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _96 => _96.title]), () => ( "Deposit"));
|
|
3519
3518
|
const canGoBack = currentStepIndex > 0 && currentStepIndex < 4 && backHandlerRef.current !== void 0;
|
|
3520
3519
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3521
|
-
|
|
3520
|
+
_chunkLT3QKJI2cjs.Modal,
|
|
3522
3521
|
{
|
|
3523
3522
|
isOpen,
|
|
3524
3523
|
onClose,
|
|
@@ -3579,7 +3578,7 @@ function DepositModalInner({
|
|
|
3579
3578
|
balance.title,
|
|
3580
3579
|
":"
|
|
3581
3580
|
] }),
|
|
3582
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ?
|
|
3581
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ? _chunkLT3QKJI2cjs.currencyFormatter.format(totalBalanceUsd) : null))) })
|
|
3583
3582
|
] })
|
|
3584
3583
|
] }),
|
|
3585
3584
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|