@rhinestone/deposit-modal 0.1.37 → 0.1.38
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-BVOV57WT.mjs → DepositModalReown-BJWM3JMC.mjs} +3 -3
- package/dist/{DepositModalReown-72SF66F7.cjs → DepositModalReown-M6GRPFJW.cjs} +4 -4
- package/dist/{WithdrawModalReown-P3XFNMCB.cjs → WithdrawModalReown-OGPBUDZU.cjs} +4 -4
- package/dist/{WithdrawModalReown-UWTDJXSE.mjs → WithdrawModalReown-OIG2DANP.mjs} +3 -3
- package/dist/{chunk-FQIIKMDJ.cjs → chunk-4ZOF4A2N.cjs} +100 -100
- package/dist/{chunk-MMVDUFJD.mjs → chunk-7HJ7TUHX.mjs} +3 -3
- package/dist/{chunk-SFYMDLKJ.cjs → chunk-G4EYX7SO.cjs} +55 -55
- package/dist/{chunk-S4UBVD3H.cjs → chunk-HYUITBRV.cjs} +23 -7
- package/dist/{chunk-YIHOACM3.cjs → chunk-NULE6WII.cjs} +26 -26
- package/dist/{chunk-MKOZFFFJ.mjs → chunk-P7B7B6LU.mjs} +3 -3
- package/dist/{chunk-DLFUXLAM.mjs → chunk-UBPIPY3L.mjs} +1 -1
- package/dist/{chunk-C6I5TFSL.mjs → chunk-ZL4KPLWE.mjs} +23 -7
- 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
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _chunkNULE6WIIcjs = require('./chunk-NULE6WII.cjs');
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
@@ -37,7 +37,7 @@ var _chunkYIHOACM3cjs = require('./chunk-YIHOACM3.cjs');
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
var
|
|
40
|
+
var _chunkHYUITBRVcjs = require('./chunk-HYUITBRV.cjs');
|
|
41
41
|
|
|
42
42
|
// src/DepositModal.tsx
|
|
43
43
|
|
|
@@ -57,15 +57,15 @@ var _react = require('react');
|
|
|
57
57
|
|
|
58
58
|
var _jsxruntime = require('react/jsx-runtime');
|
|
59
59
|
async function resolveSessionOwner(eoaAddress) {
|
|
60
|
-
const localOwner =
|
|
60
|
+
const localOwner = _chunkNULE6WIIcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
61
61
|
if (localOwner) {
|
|
62
62
|
return {
|
|
63
|
-
account:
|
|
63
|
+
account: _chunkNULE6WIIcjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
64
64
|
address: localOwner.address
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
|
-
const created =
|
|
68
|
-
|
|
67
|
+
const created = _chunkNULE6WIIcjs.createSessionOwnerKey.call(void 0, );
|
|
68
|
+
_chunkNULE6WIIcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
69
69
|
return {
|
|
70
70
|
account: created.account,
|
|
71
71
|
address: created.address
|
|
@@ -127,7 +127,7 @@ function SetupStep({
|
|
|
127
127
|
primaryType: typedData.primaryType,
|
|
128
128
|
message: typedData.message
|
|
129
129
|
});
|
|
130
|
-
const sessionDetails =
|
|
130
|
+
const sessionDetails = _chunkNULE6WIIcjs.buildSessionDetails.call(void 0, setup.sessionDetailsUnsigned, signature);
|
|
131
131
|
setState({ type: "registering" });
|
|
132
132
|
await service.registerAccount({
|
|
133
133
|
address: smartAccount,
|
|
@@ -198,7 +198,7 @@ function SetupStep({
|
|
|
198
198
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
199
199
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", children: [
|
|
200
200
|
isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
201
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
201
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNULE6WIIcjs.Spinner, { className: "rs-spinner--lg rs-text-accent" }),
|
|
202
202
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-text", children: [
|
|
203
203
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-title", children: renderStateMessage() }),
|
|
204
204
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-subtitle", children: "This may take a moment" })
|
|
@@ -235,7 +235,7 @@ function SetupStep({
|
|
|
235
235
|
] })
|
|
236
236
|
] })
|
|
237
237
|
] }),
|
|
238
|
-
isError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
238
|
+
isError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNULE6WIIcjs.Button, { onClick: handleRetry, variant: "default", fullWidth: true, children: "Try Again" }) })
|
|
239
239
|
] });
|
|
240
240
|
}
|
|
241
241
|
|
|
@@ -259,7 +259,7 @@ function AssetSelectStep({
|
|
|
259
259
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
260
260
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
261
261
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
262
|
-
return
|
|
262
|
+
return _chunkNULE6WIIcjs.getAssetId.call(void 0, {
|
|
263
263
|
chainId: defaultSourceChain,
|
|
264
264
|
token: defaultSourceToken
|
|
265
265
|
});
|
|
@@ -276,10 +276,10 @@ function AssetSelectStep({
|
|
|
276
276
|
try {
|
|
277
277
|
const portfolio = await service.fetchPortfolio(address);
|
|
278
278
|
if (!active) return;
|
|
279
|
-
const portfolioAssets =
|
|
279
|
+
const portfolioAssets = _chunkNULE6WIIcjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
280
280
|
setAssets(portfolioAssets);
|
|
281
281
|
const hasNative = portfolioAssets.some(
|
|
282
|
-
(asset) => asset.token.toLowerCase() ===
|
|
282
|
+
(asset) => asset.token.toLowerCase() === _chunkHYUITBRVcjs.NATIVE_TOKEN_ADDRESS
|
|
283
283
|
);
|
|
284
284
|
if (!hasNative) {
|
|
285
285
|
const nativeAssets = await fetchNativeAssets(
|
|
@@ -345,7 +345,7 @@ function AssetSelectStep({
|
|
|
345
345
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
346
346
|
const numeric = Number(raw);
|
|
347
347
|
if (!Number.isFinite(numeric)) return raw;
|
|
348
|
-
return
|
|
348
|
+
return _chunkNULE6WIIcjs.tokenFormatter.format(numeric);
|
|
349
349
|
} catch (e3) {
|
|
350
350
|
return asset.balance;
|
|
351
351
|
}
|
|
@@ -359,7 +359,7 @@ function AssetSelectStep({
|
|
|
359
359
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
360
360
|
children: [
|
|
361
361
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
362
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
362
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNULE6WIIcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
363
363
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
364
364
|
] }),
|
|
365
365
|
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 }) }),
|
|
@@ -392,9 +392,9 @@ function AssetSelectStep({
|
|
|
392
392
|
!loading && !error && rows.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: rows.map((asset) => {
|
|
393
393
|
const isSelected = selectedAssetId === asset.id;
|
|
394
394
|
const tokenAmount = formatBalance(asset);
|
|
395
|
-
const badge =
|
|
396
|
-
const tokenIcon =
|
|
397
|
-
const chainIcon =
|
|
395
|
+
const badge = _chunkHYUITBRVcjs.getChainBadge.call(void 0, asset.chainId);
|
|
396
|
+
const tokenIcon = _chunkHYUITBRVcjs.getTokenIcon.call(void 0, asset.symbol);
|
|
397
|
+
const chainIcon = _chunkHYUITBRVcjs.getChainIcon.call(void 0, asset.chainId);
|
|
398
398
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
399
399
|
"button",
|
|
400
400
|
{
|
|
@@ -418,7 +418,7 @@ function AssetSelectStep({
|
|
|
418
418
|
"img",
|
|
419
419
|
{
|
|
420
420
|
src: chainIcon,
|
|
421
|
-
alt:
|
|
421
|
+
alt: _chunkHYUITBRVcjs.getChainName.call(void 0, asset.chainId),
|
|
422
422
|
className: "rs-asset-chain-badge"
|
|
423
423
|
}
|
|
424
424
|
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -439,7 +439,7 @@ function AssetSelectStep({
|
|
|
439
439
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-asset-chain", children: [
|
|
440
440
|
" ",
|
|
441
441
|
"on ",
|
|
442
|
-
|
|
442
|
+
_chunkHYUITBRVcjs.getChainName.call(void 0, asset.chainId)
|
|
443
443
|
] })
|
|
444
444
|
] }),
|
|
445
445
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-balance-small", children: [
|
|
@@ -449,7 +449,7 @@ function AssetSelectStep({
|
|
|
449
449
|
] })
|
|
450
450
|
] })
|
|
451
451
|
] }),
|
|
452
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ?
|
|
452
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunkNULE6WIIcjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
453
453
|
]
|
|
454
454
|
},
|
|
455
455
|
asset.id
|
|
@@ -459,7 +459,7 @@ function AssetSelectStep({
|
|
|
459
459
|
}
|
|
460
460
|
),
|
|
461
461
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
462
|
-
|
|
462
|
+
_chunkNULE6WIIcjs.Button,
|
|
463
463
|
{
|
|
464
464
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
465
465
|
disabled: !selectedAsset,
|
|
@@ -467,17 +467,17 @@ function AssetSelectStep({
|
|
|
467
467
|
children: "Continue"
|
|
468
468
|
}
|
|
469
469
|
) }),
|
|
470
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
470
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNULE6WIIcjs.PoweredBy, {})
|
|
471
471
|
] });
|
|
472
472
|
}
|
|
473
473
|
async function fetchNativeAssets(address, publicClient, existing) {
|
|
474
474
|
const existingIds = new Set(existing.map((asset) => asset.id));
|
|
475
475
|
const connectedChainId = _optionalChain([publicClient, 'access', _6 => _6.chain, 'optionalAccess', _7 => _7.id]);
|
|
476
476
|
if (!connectedChainId) return [];
|
|
477
|
-
if (!
|
|
478
|
-
const id =
|
|
477
|
+
if (!_chunkHYUITBRVcjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
|
|
478
|
+
const id = _chunkNULE6WIIcjs.getAssetId.call(void 0, {
|
|
479
479
|
chainId: connectedChainId,
|
|
480
|
-
token:
|
|
480
|
+
token: _chunkHYUITBRVcjs.NATIVE_TOKEN_ADDRESS
|
|
481
481
|
});
|
|
482
482
|
if (existingIds.has(id)) return [];
|
|
483
483
|
try {
|
|
@@ -486,7 +486,7 @@ async function fetchNativeAssets(address, publicClient, existing) {
|
|
|
486
486
|
{
|
|
487
487
|
id,
|
|
488
488
|
chainId: connectedChainId,
|
|
489
|
-
token:
|
|
489
|
+
token: _chunkHYUITBRVcjs.NATIVE_TOKEN_ADDRESS,
|
|
490
490
|
symbol: "ETH",
|
|
491
491
|
name: "Ethereum",
|
|
492
492
|
decimals: 18,
|
|
@@ -536,8 +536,8 @@ function AmountStep({
|
|
|
536
536
|
const chainMismatch = Boolean(
|
|
537
537
|
_optionalChain([walletClient, 'optionalAccess', _8 => _8.chain, 'optionalAccess', _9 => _9.id]) && walletClient.chain.id !== asset.chainId
|
|
538
538
|
);
|
|
539
|
-
const targetSymbol =
|
|
540
|
-
const isSourceStablecoin =
|
|
539
|
+
const targetSymbol = _chunkHYUITBRVcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
540
|
+
const isSourceStablecoin = _chunkHYUITBRVcjs.isStablecoinSymbol.call(void 0, asset.symbol);
|
|
541
541
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
542
542
|
if (tokenPriceUsdOverride !== void 0 && tokenPriceUsdOverride > 0)
|
|
543
543
|
return tokenPriceUsdOverride;
|
|
@@ -561,7 +561,7 @@ function AmountStep({
|
|
|
561
561
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
562
562
|
if (!balanceTarget || !publicClient) return;
|
|
563
563
|
try {
|
|
564
|
-
const bal =
|
|
564
|
+
const bal = _chunkNULE6WIIcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
565
565
|
address: asset.token,
|
|
566
566
|
abi: _viem.erc20Abi,
|
|
567
567
|
functionName: "balanceOf",
|
|
@@ -587,7 +587,7 @@ function AmountStep({
|
|
|
587
587
|
setIsSwitching(true);
|
|
588
588
|
switchChain(asset.chainId).catch((err) => {
|
|
589
589
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
590
|
-
setError(
|
|
590
|
+
setError(_chunkNULE6WIIcjs.formatUserError.call(void 0, raw));
|
|
591
591
|
}).finally(() => {
|
|
592
592
|
setIsSwitching(false);
|
|
593
593
|
});
|
|
@@ -623,7 +623,7 @@ function AmountStep({
|
|
|
623
623
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
624
624
|
const numeric = Number(raw);
|
|
625
625
|
if (!Number.isFinite(numeric)) return raw;
|
|
626
|
-
return
|
|
626
|
+
return _chunkNULE6WIIcjs.tokenFormatter.format(numeric);
|
|
627
627
|
} catch (e8) {
|
|
628
628
|
return "...";
|
|
629
629
|
}
|
|
@@ -665,13 +665,13 @@ function AmountStep({
|
|
|
665
665
|
const usdValue = numericAmount;
|
|
666
666
|
if (_optionalChain([uiConfig, 'optionalAccess', _11 => _11.maxDepositUsd]) && usdValue > uiConfig.maxDepositUsd) {
|
|
667
667
|
setError(
|
|
668
|
-
`Maximum deposit is ${
|
|
668
|
+
`Maximum deposit is ${_chunkNULE6WIIcjs.currencyFormatter.format(uiConfig.maxDepositUsd)}`
|
|
669
669
|
);
|
|
670
670
|
return;
|
|
671
671
|
}
|
|
672
672
|
if (_optionalChain([uiConfig, 'optionalAccess', _12 => _12.minDepositUsd]) && usdValue < uiConfig.minDepositUsd) {
|
|
673
673
|
setError(
|
|
674
|
-
`Minimum deposit is ${
|
|
674
|
+
`Minimum deposit is ${_chunkNULE6WIIcjs.currencyFormatter.format(uiConfig.minDepositUsd)}`
|
|
675
675
|
);
|
|
676
676
|
return;
|
|
677
677
|
}
|
|
@@ -720,7 +720,7 @@ function AmountStep({
|
|
|
720
720
|
hasPricing && balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { style: { color: "var(--rs-muted-foreground)" }, children: [
|
|
721
721
|
" ",
|
|
722
722
|
"(",
|
|
723
|
-
|
|
723
|
+
_chunkNULE6WIIcjs.currencyFormatter.format(balanceUsd),
|
|
724
724
|
")"
|
|
725
725
|
] })
|
|
726
726
|
] }) })
|
|
@@ -734,26 +734,26 @@ function AmountStep({
|
|
|
734
734
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-flow-pill-label", children: "You send" }),
|
|
735
735
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-flow-pill-token", children: [
|
|
736
736
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-flow-pill-token-icon-wrapper", children: [
|
|
737
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-flow-pill-token-icon", children:
|
|
737
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-flow-pill-token-icon", children: _chunkHYUITBRVcjs.getTokenIcon.call(void 0, asset.symbol) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
738
738
|
"img",
|
|
739
739
|
{
|
|
740
|
-
src:
|
|
740
|
+
src: _chunkHYUITBRVcjs.getTokenIcon.call(void 0, asset.symbol),
|
|
741
741
|
alt: asset.symbol
|
|
742
742
|
}
|
|
743
743
|
) : asset.symbol.slice(0, 2) }),
|
|
744
744
|
(() => {
|
|
745
|
-
const chainIcon =
|
|
745
|
+
const chainIcon = _chunkHYUITBRVcjs.getChainIcon.call(void 0, asset.chainId);
|
|
746
746
|
if (chainIcon) {
|
|
747
747
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
748
748
|
"img",
|
|
749
749
|
{
|
|
750
750
|
src: chainIcon,
|
|
751
|
-
alt:
|
|
751
|
+
alt: _chunkHYUITBRVcjs.getChainName.call(void 0, asset.chainId),
|
|
752
752
|
className: "rs-flow-pill-chain-badge"
|
|
753
753
|
}
|
|
754
754
|
);
|
|
755
755
|
}
|
|
756
|
-
const badge =
|
|
756
|
+
const badge = _chunkHYUITBRVcjs.getChainBadge.call(void 0, asset.chainId);
|
|
757
757
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
758
758
|
"div",
|
|
759
759
|
{
|
|
@@ -791,26 +791,26 @@ function AmountStep({
|
|
|
791
791
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-flow-pill-label", children: "You receive" }),
|
|
792
792
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-flow-pill-token", children: [
|
|
793
793
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-flow-pill-token-icon-wrapper", children: [
|
|
794
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-flow-pill-token-icon", children:
|
|
794
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-flow-pill-token-icon", children: _chunkHYUITBRVcjs.getTokenIcon.call(void 0, targetSymbol) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
795
795
|
"img",
|
|
796
796
|
{
|
|
797
|
-
src:
|
|
797
|
+
src: _chunkHYUITBRVcjs.getTokenIcon.call(void 0, targetSymbol),
|
|
798
798
|
alt: targetSymbol
|
|
799
799
|
}
|
|
800
800
|
) : targetSymbol.slice(0, 2) }),
|
|
801
801
|
(() => {
|
|
802
|
-
const chainIcon =
|
|
802
|
+
const chainIcon = _chunkHYUITBRVcjs.getChainIcon.call(void 0, targetChain);
|
|
803
803
|
if (chainIcon) {
|
|
804
804
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
805
805
|
"img",
|
|
806
806
|
{
|
|
807
807
|
src: chainIcon,
|
|
808
|
-
alt:
|
|
808
|
+
alt: _chunkHYUITBRVcjs.getChainName.call(void 0, targetChain),
|
|
809
809
|
className: "rs-flow-pill-chain-badge"
|
|
810
810
|
}
|
|
811
811
|
);
|
|
812
812
|
}
|
|
813
|
-
const badge =
|
|
813
|
+
const badge = _chunkHYUITBRVcjs.getChainBadge.call(void 0, targetChain);
|
|
814
814
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
815
815
|
"div",
|
|
816
816
|
{
|
|
@@ -856,7 +856,7 @@ function AmountStep({
|
|
|
856
856
|
}
|
|
857
857
|
)
|
|
858
858
|
] }),
|
|
859
|
-
chainMismatch && /* @__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: isSwitching ? `Switching to ${
|
|
859
|
+
chainMismatch && /* @__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: isSwitching ? `Switching to ${_chunkHYUITBRVcjs.getChainName.call(void 0, asset.chainId)}...` : `Switch your wallet to ${_chunkHYUITBRVcjs.getChainName.call(void 0, asset.chainId)} to continue.` }) }),
|
|
860
860
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", children: [
|
|
861
861
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
862
862
|
"svg",
|
|
@@ -880,7 +880,7 @@ function AmountStep({
|
|
|
880
880
|
] })
|
|
881
881
|
] }),
|
|
882
882
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
883
|
-
|
|
883
|
+
_chunkNULE6WIIcjs.Button,
|
|
884
884
|
{
|
|
885
885
|
onClick: handleContinue,
|
|
886
886
|
fullWidth: true,
|
|
@@ -888,7 +888,7 @@ function AmountStep({
|
|
|
888
888
|
children: "Continue"
|
|
889
889
|
}
|
|
890
890
|
) }),
|
|
891
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
891
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNULE6WIIcjs.PoweredBy, {})
|
|
892
892
|
] });
|
|
893
893
|
}
|
|
894
894
|
|
|
@@ -919,7 +919,7 @@ function ConfirmStep({
|
|
|
919
919
|
const hasAttemptedSwitch = _react.useRef.call(void 0, false);
|
|
920
920
|
const chainMismatch = _optionalChain([walletClient, 'optionalAccess', _13 => _13.chain, 'optionalAccess', _14 => _14.id]) && walletClient.chain.id !== asset.chainId;
|
|
921
921
|
const sameRoute = targetChain === asset.chainId && targetToken.toLowerCase() === asset.token.toLowerCase();
|
|
922
|
-
const targetSymbol = sameRoute ? asset.symbol :
|
|
922
|
+
const targetSymbol = sameRoute ? asset.symbol : _chunkHYUITBRVcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
923
923
|
const formattedSendAmount = amount && !Number.isNaN(Number(amount)) ? Number(amount).toLocaleString("en-US", { maximumFractionDigits: 6 }) : "0";
|
|
924
924
|
const formattedReceiveAmount = (() => {
|
|
925
925
|
if (sameRoute) return formattedSendAmount;
|
|
@@ -938,7 +938,7 @@ function ConfirmStep({
|
|
|
938
938
|
setIsSwitching(true);
|
|
939
939
|
switchChain(asset.chainId).catch((err) => {
|
|
940
940
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
941
|
-
setError(
|
|
941
|
+
setError(_chunkNULE6WIIcjs.formatUserError.call(void 0, raw));
|
|
942
942
|
}).finally(() => {
|
|
943
943
|
setIsSwitching(false);
|
|
944
944
|
});
|
|
@@ -953,7 +953,7 @@ function ConfirmStep({
|
|
|
953
953
|
return;
|
|
954
954
|
}
|
|
955
955
|
if (chainMismatch) {
|
|
956
|
-
setError(`Switch to ${
|
|
956
|
+
setError(`Switch to ${_chunkHYUITBRVcjs.getChainName.call(void 0, asset.chainId)} to sign`);
|
|
957
957
|
return;
|
|
958
958
|
}
|
|
959
959
|
const parsedAmount = parseFloat(amount);
|
|
@@ -981,7 +981,7 @@ function ConfirmStep({
|
|
|
981
981
|
throw new Error("Wallet not properly connected");
|
|
982
982
|
}
|
|
983
983
|
const transferTo = sameRoute ? recipient : smartAccount;
|
|
984
|
-
const hash =
|
|
984
|
+
const hash = _chunkNULE6WIIcjs.isNativeAsset.call(void 0, asset) ? await walletClient.sendTransaction({
|
|
985
985
|
account,
|
|
986
986
|
chain,
|
|
987
987
|
to: transferTo,
|
|
@@ -998,7 +998,7 @@ function ConfirmStep({
|
|
|
998
998
|
onConfirm(hash, asset.chainId, amountUnits.toString(), asset.token);
|
|
999
999
|
} catch (err) {
|
|
1000
1000
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
1001
|
-
const message =
|
|
1001
|
+
const message = _chunkNULE6WIIcjs.formatUserError.call(void 0, raw);
|
|
1002
1002
|
setError(message);
|
|
1003
1003
|
_optionalChain([onError, 'optionalCall', _16 => _16(message, "TRANSFER_ERROR")]);
|
|
1004
1004
|
} finally {
|
|
@@ -1017,15 +1017,15 @@ function ConfirmStep({
|
|
|
1017
1017
|
className: "rs-card-value",
|
|
1018
1018
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
1019
1019
|
children: [
|
|
1020
|
-
|
|
1020
|
+
_chunkHYUITBRVcjs.getChainIcon.call(void 0, asset.chainId) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1021
1021
|
"img",
|
|
1022
1022
|
{
|
|
1023
|
-
src:
|
|
1023
|
+
src: _chunkHYUITBRVcjs.getChainIcon.call(void 0, asset.chainId),
|
|
1024
1024
|
alt: "",
|
|
1025
1025
|
style: { width: 16, height: 16, borderRadius: 3 }
|
|
1026
1026
|
}
|
|
1027
1027
|
),
|
|
1028
|
-
|
|
1028
|
+
_chunkHYUITBRVcjs.getChainName.call(void 0, asset.chainId)
|
|
1029
1029
|
]
|
|
1030
1030
|
}
|
|
1031
1031
|
)
|
|
@@ -1038,15 +1038,15 @@ function ConfirmStep({
|
|
|
1038
1038
|
className: "rs-card-value",
|
|
1039
1039
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
1040
1040
|
children: [
|
|
1041
|
-
|
|
1041
|
+
_chunkHYUITBRVcjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1042
1042
|
"img",
|
|
1043
1043
|
{
|
|
1044
|
-
src:
|
|
1044
|
+
src: _chunkHYUITBRVcjs.getChainIcon.call(void 0, targetChain),
|
|
1045
1045
|
alt: "",
|
|
1046
1046
|
style: { width: 16, height: 16, borderRadius: 3 }
|
|
1047
1047
|
}
|
|
1048
1048
|
),
|
|
1049
|
-
|
|
1049
|
+
_chunkHYUITBRVcjs.getChainName.call(void 0, targetChain)
|
|
1050
1050
|
]
|
|
1051
1051
|
}
|
|
1052
1052
|
)
|
|
@@ -1065,10 +1065,10 @@ function ConfirmStep({
|
|
|
1065
1065
|
className: "rs-card-value",
|
|
1066
1066
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
1067
1067
|
children: [
|
|
1068
|
-
|
|
1068
|
+
_chunkHYUITBRVcjs.getTokenIcon.call(void 0, asset.symbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1069
1069
|
"img",
|
|
1070
1070
|
{
|
|
1071
|
-
src:
|
|
1071
|
+
src: _chunkHYUITBRVcjs.getTokenIcon.call(void 0, asset.symbol),
|
|
1072
1072
|
alt: "",
|
|
1073
1073
|
style: { width: 16, height: 16, borderRadius: "50%" }
|
|
1074
1074
|
}
|
|
@@ -1088,10 +1088,10 @@ function ConfirmStep({
|
|
|
1088
1088
|
className: "rs-card-value",
|
|
1089
1089
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
1090
1090
|
children: [
|
|
1091
|
-
|
|
1091
|
+
_chunkHYUITBRVcjs.getTokenIcon.call(void 0, targetSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1092
1092
|
"img",
|
|
1093
1093
|
{
|
|
1094
|
-
src:
|
|
1094
|
+
src: _chunkHYUITBRVcjs.getTokenIcon.call(void 0, targetSymbol),
|
|
1095
1095
|
alt: "",
|
|
1096
1096
|
style: { width: 16, height: 16, borderRadius: "50%" }
|
|
1097
1097
|
}
|
|
@@ -1104,7 +1104,7 @@ function ConfirmStep({
|
|
|
1104
1104
|
)
|
|
1105
1105
|
] })
|
|
1106
1106
|
] }),
|
|
1107
|
-
chainMismatch && /* @__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: isSwitching ? `Switching to ${
|
|
1107
|
+
chainMismatch && /* @__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: isSwitching ? `Switching to ${_chunkHYUITBRVcjs.getChainName.call(void 0, asset.chainId)}...` : `Switch your wallet to ${_chunkHYUITBRVcjs.getChainName.call(void 0, asset.chainId)} to sign.` }) }),
|
|
1108
1108
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-alert rs-alert--error", children: [
|
|
1109
1109
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1110
1110
|
"svg",
|
|
@@ -1128,7 +1128,7 @@ function ConfirmStep({
|
|
|
1128
1128
|
] })
|
|
1129
1129
|
] }),
|
|
1130
1130
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1131
|
-
|
|
1131
|
+
_chunkNULE6WIIcjs.Button,
|
|
1132
1132
|
{
|
|
1133
1133
|
onClick: handleConfirm,
|
|
1134
1134
|
loading: isSubmitting,
|
|
@@ -1137,7 +1137,7 @@ function ConfirmStep({
|
|
|
1137
1137
|
children: "Confirm Order"
|
|
1138
1138
|
}
|
|
1139
1139
|
) }),
|
|
1140
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1140
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNULE6WIIcjs.PoweredBy, {})
|
|
1141
1141
|
] });
|
|
1142
1142
|
}
|
|
1143
1143
|
|
|
@@ -1282,12 +1282,12 @@ function DepositAddressStep({
|
|
|
1282
1282
|
onDepositDetected,
|
|
1283
1283
|
onError
|
|
1284
1284
|
}) {
|
|
1285
|
-
const supportedChainIds = _react.useMemo.call(void 0, () =>
|
|
1285
|
+
const supportedChainIds = _react.useMemo.call(void 0, () => _chunkHYUITBRVcjs.getSupportedChainIds.call(void 0, ), []);
|
|
1286
1286
|
const BASE_CHAIN_ID = 8453;
|
|
1287
1287
|
const defaultChainId = supportedChainIds.includes(BASE_CHAIN_ID) ? BASE_CHAIN_ID : supportedChainIds[0];
|
|
1288
1288
|
const [sourceChainId, setSourceChainId] = _react.useState.call(void 0, defaultChainId);
|
|
1289
1289
|
const tokensForChain = _react.useMemo.call(void 0,
|
|
1290
|
-
() =>
|
|
1290
|
+
() => _chunkHYUITBRVcjs.getTargetTokenSymbolsForChain.call(void 0, sourceChainId),
|
|
1291
1291
|
[sourceChainId]
|
|
1292
1292
|
);
|
|
1293
1293
|
const defaultToken = tokensForChain.includes("USDC") ? "USDC" : _nullishCoalesce(tokensForChain[0], () => ( "USDC"));
|
|
@@ -1362,7 +1362,7 @@ function DepositAddressStep({
|
|
|
1362
1362
|
const status = await service.fetchLatestStatus(smartAccount);
|
|
1363
1363
|
if (cancelled || depositHandledRef.current) return;
|
|
1364
1364
|
const event = status.lastEvent;
|
|
1365
|
-
const eventTxHash =
|
|
1365
|
+
const eventTxHash = _chunkNULE6WIIcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_optionalChain([_chunkNULE6WIIcjs.getEventTxHash.call(void 0, event), 'optionalAccess', _26 => _26.toLowerCase, 'call', _27 => _27()]), () => ( null)) : null;
|
|
1366
1366
|
if (baselineTxHash === void 0) {
|
|
1367
1367
|
baselineTxHash = eventTxHash;
|
|
1368
1368
|
} else if (eventTxHash && eventTxHash !== baselineTxHash) {
|
|
@@ -1370,7 +1370,7 @@ function DepositAddressStep({
|
|
|
1370
1370
|
const fallback = sourceSelectionRef.current;
|
|
1371
1371
|
const chainId = _nullishCoalesce(details.chainId, () => ( fallback.chainId));
|
|
1372
1372
|
const amount = _nullishCoalesce(details.amount, () => ( "0"));
|
|
1373
|
-
const token = _nullishCoalesce(details.token, () => (
|
|
1373
|
+
const token = _nullishCoalesce(details.token, () => ( _chunkHYUITBRVcjs.getTokenAddress.call(void 0, fallback.tokenSymbol, fallback.chainId)));
|
|
1374
1374
|
if (token) {
|
|
1375
1375
|
depositHandledRef.current = true;
|
|
1376
1376
|
onDepositDetected(eventTxHash, chainId, amount, token);
|
|
@@ -1395,7 +1395,7 @@ function DepositAddressStep({
|
|
|
1395
1395
|
clearTimeout(timeoutId);
|
|
1396
1396
|
};
|
|
1397
1397
|
}, [smartAccount, service, onDepositDetected, onError]);
|
|
1398
|
-
const chainIconSrc =
|
|
1398
|
+
const chainIconSrc = _chunkHYUITBRVcjs.getChainIcon.call(void 0, sourceChainId);
|
|
1399
1399
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
1400
1400
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-body", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address", children: [
|
|
1401
1401
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", children: [
|
|
@@ -1411,10 +1411,10 @@ function DepositAddressStep({
|
|
|
1411
1411
|
setChainDropdownOpen(false);
|
|
1412
1412
|
},
|
|
1413
1413
|
children: [
|
|
1414
|
-
|
|
1414
|
+
_chunkHYUITBRVcjs.getTokenIcon.call(void 0, sourceTokenSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1415
1415
|
"img",
|
|
1416
1416
|
{
|
|
1417
|
-
src:
|
|
1417
|
+
src: _chunkHYUITBRVcjs.getTokenIcon.call(void 0, sourceTokenSymbol),
|
|
1418
1418
|
alt: "",
|
|
1419
1419
|
className: "rs-deposit-address-dropdown-icon"
|
|
1420
1420
|
}
|
|
@@ -1451,10 +1451,10 @@ function DepositAddressStep({
|
|
|
1451
1451
|
setTokenDropdownOpen(false);
|
|
1452
1452
|
},
|
|
1453
1453
|
children: [
|
|
1454
|
-
|
|
1454
|
+
_chunkHYUITBRVcjs.getTokenIcon.call(void 0, symbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1455
1455
|
"img",
|
|
1456
1456
|
{
|
|
1457
|
-
src:
|
|
1457
|
+
src: _chunkHYUITBRVcjs.getTokenIcon.call(void 0, symbol),
|
|
1458
1458
|
alt: "",
|
|
1459
1459
|
className: "rs-deposit-address-dropdown-icon"
|
|
1460
1460
|
}
|
|
@@ -1477,15 +1477,15 @@ function DepositAddressStep({
|
|
|
1477
1477
|
setTokenDropdownOpen(false);
|
|
1478
1478
|
},
|
|
1479
1479
|
children: [
|
|
1480
|
-
|
|
1480
|
+
_chunkHYUITBRVcjs.getChainIcon.call(void 0, sourceChainId) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1481
1481
|
"img",
|
|
1482
1482
|
{
|
|
1483
|
-
src:
|
|
1483
|
+
src: _chunkHYUITBRVcjs.getChainIcon.call(void 0, sourceChainId),
|
|
1484
1484
|
alt: "",
|
|
1485
1485
|
className: "rs-deposit-address-dropdown-icon"
|
|
1486
1486
|
}
|
|
1487
1487
|
),
|
|
1488
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children:
|
|
1488
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunkHYUITBRVcjs.getChainName.call(void 0, sourceChainId) }),
|
|
1489
1489
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1490
1490
|
"svg",
|
|
1491
1491
|
{
|
|
@@ -1517,15 +1517,15 @@ function DepositAddressStep({
|
|
|
1517
1517
|
setChainDropdownOpen(false);
|
|
1518
1518
|
},
|
|
1519
1519
|
children: [
|
|
1520
|
-
|
|
1520
|
+
_chunkHYUITBRVcjs.getChainIcon.call(void 0, chainId) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1521
1521
|
"img",
|
|
1522
1522
|
{
|
|
1523
|
-
src:
|
|
1523
|
+
src: _chunkHYUITBRVcjs.getChainIcon.call(void 0, chainId),
|
|
1524
1524
|
alt: "",
|
|
1525
1525
|
className: "rs-deposit-address-dropdown-icon"
|
|
1526
1526
|
}
|
|
1527
1527
|
),
|
|
1528
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children:
|
|
1528
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunkHYUITBRVcjs.getChainName.call(void 0, chainId) })
|
|
1529
1529
|
]
|
|
1530
1530
|
},
|
|
1531
1531
|
chainId
|
|
@@ -1575,7 +1575,7 @@ function DepositAddressStep({
|
|
|
1575
1575
|
] }),
|
|
1576
1576
|
pollingError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-error", children: pollingError })
|
|
1577
1577
|
] }) }),
|
|
1578
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1578
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNULE6WIIcjs.PoweredBy, {})
|
|
1579
1579
|
] });
|
|
1580
1580
|
}
|
|
1581
1581
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -1596,7 +1596,7 @@ function DepositFlow({
|
|
|
1596
1596
|
sourceToken: defaultSourceToken,
|
|
1597
1597
|
amount: defaultAmount,
|
|
1598
1598
|
recipient,
|
|
1599
|
-
signerAddress =
|
|
1599
|
+
signerAddress = _chunkHYUITBRVcjs.DEFAULT_SIGNER_ADDRESS,
|
|
1600
1600
|
sessionChainIds,
|
|
1601
1601
|
forceRegister = false,
|
|
1602
1602
|
waitForFinalTx = true,
|
|
@@ -1683,7 +1683,7 @@ function DepositFlow({
|
|
|
1683
1683
|
return {
|
|
1684
1684
|
ownerAddress: dappAddress,
|
|
1685
1685
|
walletClient: void 0,
|
|
1686
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
1686
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkNULE6WIIcjs.getPublicClient.call(void 0, targetChain))),
|
|
1687
1687
|
switchChain: void 0
|
|
1688
1688
|
};
|
|
1689
1689
|
}
|
|
@@ -1692,7 +1692,7 @@ function DepositFlow({
|
|
|
1692
1692
|
return {
|
|
1693
1693
|
ownerAddress: dappWalletClient.account.address,
|
|
1694
1694
|
walletClient: dappWalletClient,
|
|
1695
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
1695
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkNULE6WIIcjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
1696
1696
|
switchChain: dappSwitchChain
|
|
1697
1697
|
};
|
|
1698
1698
|
}
|
|
@@ -1702,7 +1702,7 @@ function DepositFlow({
|
|
|
1702
1702
|
return {
|
|
1703
1703
|
ownerAddress: dappWalletClient.account.address,
|
|
1704
1704
|
walletClient: dappWalletClient,
|
|
1705
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
1705
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkNULE6WIIcjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
1706
1706
|
switchChain: dappSwitchChain
|
|
1707
1707
|
};
|
|
1708
1708
|
}
|
|
@@ -1838,8 +1838,8 @@ function DepositFlow({
|
|
|
1838
1838
|
);
|
|
1839
1839
|
const handleAmountContinue = _react.useCallback.call(void 0,
|
|
1840
1840
|
(amount, targetAmount, balance) => {
|
|
1841
|
-
const targetSym =
|
|
1842
|
-
const isTargetStable =
|
|
1841
|
+
const targetSym = _chunkHYUITBRVcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
1842
|
+
const isTargetStable = _chunkHYUITBRVcjs.isStablecoinSymbol.call(void 0, targetSym);
|
|
1843
1843
|
const targetTokenPriceUsd = isTargetStable ? 1 : getTokenPriceUsd(targetSym);
|
|
1844
1844
|
setStep((prev) => {
|
|
1845
1845
|
if (prev.type !== "amount") return prev;
|
|
@@ -1944,7 +1944,7 @@ function DepositFlow({
|
|
|
1944
1944
|
]);
|
|
1945
1945
|
if (showConnectStep) {
|
|
1946
1946
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1947
|
-
|
|
1947
|
+
_chunkNULE6WIIcjs.ConnectStep,
|
|
1948
1948
|
{
|
|
1949
1949
|
walletOptions,
|
|
1950
1950
|
selectedAddress: selectedConnectAddressEffective,
|
|
@@ -1996,7 +1996,7 @@ function DepositFlow({
|
|
|
1996
1996
|
}
|
|
1997
1997
|
),
|
|
1998
1998
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1999
|
-
|
|
1999
|
+
_chunkNULE6WIIcjs.ProcessingStep,
|
|
2000
2000
|
{
|
|
2001
2001
|
smartAccount: step.smartAccount,
|
|
2002
2002
|
txHash: step.txHash,
|
|
@@ -2026,7 +2026,7 @@ function DepositFlow({
|
|
|
2026
2026
|
if (_optionalChain([signerContext, 'access', _67 => _67.publicClient, 'access', _68 => _68.chain, 'optionalAccess', _69 => _69.id]) === chainId) {
|
|
2027
2027
|
return signerContext.publicClient;
|
|
2028
2028
|
}
|
|
2029
|
-
return
|
|
2029
|
+
return _chunkNULE6WIIcjs.getPublicClient.call(void 0, chainId);
|
|
2030
2030
|
};
|
|
2031
2031
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
2032
2032
|
step.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2095,7 +2095,7 @@ function DepositFlow({
|
|
|
2095
2095
|
}
|
|
2096
2096
|
),
|
|
2097
2097
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2098
|
-
|
|
2098
|
+
_chunkNULE6WIIcjs.ProcessingStep,
|
|
2099
2099
|
{
|
|
2100
2100
|
smartAccount: step.smartAccount,
|
|
2101
2101
|
txHash: step.txHash,
|
|
@@ -2119,7 +2119,7 @@ function DepositFlow({
|
|
|
2119
2119
|
// src/DepositModal.tsx
|
|
2120
2120
|
|
|
2121
2121
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
2122
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
2122
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-M6GRPFJW.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
2123
2123
|
);
|
|
2124
2124
|
function DepositModal(props) {
|
|
2125
2125
|
const needsReown = !!props.reownAppId;
|
|
@@ -2142,8 +2142,8 @@ function DepositModalInner({
|
|
|
2142
2142
|
sourceToken,
|
|
2143
2143
|
defaultAmount,
|
|
2144
2144
|
recipient,
|
|
2145
|
-
backendUrl =
|
|
2146
|
-
signerAddress =
|
|
2145
|
+
backendUrl = _chunkHYUITBRVcjs.DEFAULT_BACKEND_URL,
|
|
2146
|
+
signerAddress = _chunkHYUITBRVcjs.DEFAULT_SIGNER_ADDRESS,
|
|
2147
2147
|
sessionChainIds,
|
|
2148
2148
|
forceRegister = false,
|
|
2149
2149
|
waitForFinalTx = true,
|
|
@@ -2168,12 +2168,12 @@ function DepositModalInner({
|
|
|
2168
2168
|
const [currentStepIndex, setCurrentStepIndex] = _react.useState.call(void 0, 0);
|
|
2169
2169
|
const [totalBalanceUsd, setTotalBalanceUsd] = _react.useState.call(void 0, null);
|
|
2170
2170
|
const backHandlerRef = _react.useRef.call(void 0, void 0);
|
|
2171
|
-
const targetChain =
|
|
2172
|
-
const sourceChain = sourceChainProp ?
|
|
2173
|
-
const service = _react.useMemo.call(void 0, () =>
|
|
2171
|
+
const targetChain = _chunkHYUITBRVcjs.getChainId.call(void 0, targetChainProp);
|
|
2172
|
+
const sourceChain = sourceChainProp ? _chunkHYUITBRVcjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
2173
|
+
const service = _react.useMemo.call(void 0, () => _chunkNULE6WIIcjs.createDepositService.call(void 0, backendUrl), [backendUrl]);
|
|
2174
2174
|
_react.useEffect.call(void 0, () => {
|
|
2175
2175
|
if (isOpen && modalRef.current) {
|
|
2176
|
-
|
|
2176
|
+
_chunkNULE6WIIcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
2177
2177
|
}
|
|
2178
2178
|
}, [isOpen, theme]);
|
|
2179
2179
|
const hasCalledReady = _react.useRef.call(void 0, false);
|
|
@@ -2209,7 +2209,7 @@ function DepositModalInner({
|
|
|
2209
2209
|
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _78 => _78.title]), () => ( "Deposit"));
|
|
2210
2210
|
const canGoBack = currentStepIndex > 0 && currentStepIndex < 4 && backHandlerRef.current !== void 0;
|
|
2211
2211
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2212
|
-
|
|
2212
|
+
_chunkNULE6WIIcjs.Modal,
|
|
2213
2213
|
{
|
|
2214
2214
|
isOpen,
|
|
2215
2215
|
onClose,
|
|
@@ -2270,7 +2270,7 @@ function DepositModalInner({
|
|
|
2270
2270
|
balance.title,
|
|
2271
2271
|
":"
|
|
2272
2272
|
] }),
|
|
2273
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ?
|
|
2273
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ? _chunkNULE6WIIcjs.currencyFormatter.format(totalBalanceUsd) : null))) })
|
|
2274
2274
|
] })
|
|
2275
2275
|
] }),
|
|
2276
2276
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|