@rhinestone/deposit-modal 0.2.3 → 0.2.4
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-QPJ5TT57.cjs → DepositModalReown-2UMPITRN.cjs} +4 -4
- package/dist/{DepositModalReown-SJHEU6RQ.mjs → DepositModalReown-CY5MSQGK.mjs} +3 -3
- package/dist/{WithdrawModalReown-RUJZCQ4C.mjs → WithdrawModalReown-YSRO5ZTA.mjs} +3 -3
- package/dist/{WithdrawModalReown-KGKKBTC7.cjs → WithdrawModalReown-Z5BUZQ4Z.cjs} +4 -4
- package/dist/{chunk-TYJEZX6S.cjs → chunk-ARGMXV6E.cjs} +189 -189
- package/dist/{chunk-DGT2DZXN.mjs → chunk-HFQV7EHS.mjs} +3 -3
- package/dist/{chunk-MKO5TNVQ.mjs → chunk-KJEHVIPZ.mjs} +3 -3
- package/dist/{chunk-T2KOQH57.cjs → chunk-NFXJEOE6.cjs} +23 -23
- package/dist/{chunk-5EU7N73M.cjs → chunk-QUOP5C6V.cjs} +73 -73
- package/dist/{chunk-MUWVDVY4.cjs → chunk-R2HP743T.cjs} +14 -1
- package/dist/{chunk-SDZKKUCJ.mjs → chunk-WHW3ZMOT.mjs} +14 -1
- package/dist/{chunk-JRNGXHWQ.mjs → chunk-WNFGZS56.mjs} +1 -1
- 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
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
var
|
|
31
|
+
var _chunkNFXJEOE6cjs = require('./chunk-NFXJEOE6.cjs');
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
@@ -47,7 +47,7 @@ var _chunkT2KOQH57cjs = require('./chunk-T2KOQH57.cjs');
|
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
var
|
|
50
|
+
var _chunkR2HP743Tcjs = require('./chunk-R2HP743T.cjs');
|
|
51
51
|
|
|
52
52
|
// src/DepositModal.tsx
|
|
53
53
|
|
|
@@ -68,15 +68,15 @@ var _viem = require('viem');
|
|
|
68
68
|
|
|
69
69
|
var _jsxruntime = require('react/jsx-runtime');
|
|
70
70
|
async function resolveSessionOwner(eoaAddress) {
|
|
71
|
-
const localOwner =
|
|
71
|
+
const localOwner = _chunkNFXJEOE6cjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
72
72
|
if (localOwner) {
|
|
73
73
|
return {
|
|
74
|
-
account:
|
|
74
|
+
account: _chunkNFXJEOE6cjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
75
75
|
address: localOwner.address
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
const created =
|
|
79
|
-
|
|
78
|
+
const created = _chunkNFXJEOE6cjs.createSessionOwnerKey.call(void 0, );
|
|
79
|
+
_chunkNFXJEOE6cjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
80
80
|
return {
|
|
81
81
|
account: created.account,
|
|
82
82
|
address: created.address
|
|
@@ -115,7 +115,7 @@ function SetupStep({
|
|
|
115
115
|
const setup = await service.setupAccount({
|
|
116
116
|
ownerAddress: address,
|
|
117
117
|
sessionOwnerAddress: sessionOwner.address,
|
|
118
|
-
targetChain:
|
|
118
|
+
targetChain: _chunkNFXJEOE6cjs.toEvmCaip2.call(void 0, targetChain),
|
|
119
119
|
targetToken,
|
|
120
120
|
recipient,
|
|
121
121
|
postBridgeActions,
|
|
@@ -149,7 +149,7 @@ function SetupStep({
|
|
|
149
149
|
primaryType: typedData.primaryType,
|
|
150
150
|
message: typedData.message
|
|
151
151
|
});
|
|
152
|
-
const sessionDetails =
|
|
152
|
+
const sessionDetails = _chunkNFXJEOE6cjs.buildSessionDetails.call(void 0, setup.sessionDetailsUnsigned, signature);
|
|
153
153
|
setState({ type: "registering" });
|
|
154
154
|
const registerResult = await service.registerAccount({
|
|
155
155
|
address: smartAccount,
|
|
@@ -161,7 +161,7 @@ function SetupStep({
|
|
|
161
161
|
eoaAddress: address,
|
|
162
162
|
sessionOwner: sessionOwner.address,
|
|
163
163
|
target: {
|
|
164
|
-
chain:
|
|
164
|
+
chain: _chunkNFXJEOE6cjs.toEvmCaip2.call(void 0, targetChain),
|
|
165
165
|
token: targetToken,
|
|
166
166
|
...recipient && { recipient },
|
|
167
167
|
..._optionalChain([postBridgeActions, 'optionalAccess', _2 => _2.length]) && { postBridgeActions },
|
|
@@ -230,7 +230,7 @@ function SetupStep({
|
|
|
230
230
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
231
231
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", children: [
|
|
232
232
|
isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
233
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
233
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNFXJEOE6cjs.Spinner, { className: "rs-spinner--lg rs-text-accent" }),
|
|
234
234
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-text", children: [
|
|
235
235
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-title", children: renderStateMessage() }),
|
|
236
236
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-subtitle", children: "This may take a moment" })
|
|
@@ -267,7 +267,7 @@ function SetupStep({
|
|
|
267
267
|
] })
|
|
268
268
|
] })
|
|
269
269
|
] }),
|
|
270
|
-
isError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
270
|
+
isError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNFXJEOE6cjs.Button, { onClick: handleRetry, variant: "default", fullWidth: true, children: "Try Again" }) })
|
|
271
271
|
] });
|
|
272
272
|
}
|
|
273
273
|
|
|
@@ -293,7 +293,7 @@ function AssetSelectStep({
|
|
|
293
293
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
294
294
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
295
295
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
296
|
-
return
|
|
296
|
+
return _chunkNFXJEOE6cjs.getAssetId.call(void 0, {
|
|
297
297
|
chainId: defaultSourceChain,
|
|
298
298
|
token: defaultSourceToken
|
|
299
299
|
});
|
|
@@ -310,10 +310,10 @@ function AssetSelectStep({
|
|
|
310
310
|
try {
|
|
311
311
|
const portfolio = await service.fetchPortfolio(address);
|
|
312
312
|
if (!active) return;
|
|
313
|
-
const portfolioAssets =
|
|
313
|
+
const portfolioAssets = _chunkNFXJEOE6cjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
314
314
|
setAssets(portfolioAssets);
|
|
315
315
|
const hasNative = portfolioAssets.some(
|
|
316
|
-
(asset) => asset.token.toLowerCase() ===
|
|
316
|
+
(asset) => asset.token.toLowerCase() === _chunkR2HP743Tcjs.NATIVE_TOKEN_ADDRESS
|
|
317
317
|
);
|
|
318
318
|
if (!hasNative) {
|
|
319
319
|
const nativeAssets = await fetchNativeAssets(
|
|
@@ -391,7 +391,7 @@ function AssetSelectStep({
|
|
|
391
391
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
392
392
|
const numeric = Number(raw);
|
|
393
393
|
if (!Number.isFinite(numeric)) return raw;
|
|
394
|
-
return
|
|
394
|
+
return _chunkNFXJEOE6cjs.tokenFormatter.format(numeric);
|
|
395
395
|
} catch (e3) {
|
|
396
396
|
return asset.balance;
|
|
397
397
|
}
|
|
@@ -405,7 +405,7 @@ function AssetSelectStep({
|
|
|
405
405
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
406
406
|
children: [
|
|
407
407
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
408
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
408
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNFXJEOE6cjs.Spinner, { className: "rs-text-tertiary" }),
|
|
409
409
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
410
410
|
] }),
|
|
411
411
|
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-alert rs-alert--error", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-alert-text", children: error }) }),
|
|
@@ -447,9 +447,9 @@ function AssetSelectStep({
|
|
|
447
447
|
!loading && !error && rows.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: rows.map((asset) => {
|
|
448
448
|
const isSelected = selectedAssetId === asset.id;
|
|
449
449
|
const tokenAmount = formatBalance(asset);
|
|
450
|
-
const badge =
|
|
451
|
-
const tokenIcon =
|
|
452
|
-
const chainIcon =
|
|
450
|
+
const badge = _chunkR2HP743Tcjs.getChainBadge.call(void 0, asset.chainId);
|
|
451
|
+
const tokenIcon = _chunkR2HP743Tcjs.getTokenIcon.call(void 0, asset.symbol);
|
|
452
|
+
const chainIcon = _chunkR2HP743Tcjs.getChainIcon.call(void 0, asset.chainId);
|
|
453
453
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
454
454
|
"button",
|
|
455
455
|
{
|
|
@@ -473,7 +473,7 @@ function AssetSelectStep({
|
|
|
473
473
|
"img",
|
|
474
474
|
{
|
|
475
475
|
src: chainIcon,
|
|
476
|
-
alt:
|
|
476
|
+
alt: _chunkR2HP743Tcjs.getChainName.call(void 0, asset.chainId),
|
|
477
477
|
className: "rs-asset-chain-badge"
|
|
478
478
|
}
|
|
479
479
|
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -494,7 +494,7 @@ function AssetSelectStep({
|
|
|
494
494
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-asset-chain", children: [
|
|
495
495
|
" ",
|
|
496
496
|
"on ",
|
|
497
|
-
|
|
497
|
+
_chunkR2HP743Tcjs.getChainName.call(void 0, asset.chainId)
|
|
498
498
|
] })
|
|
499
499
|
] }),
|
|
500
500
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-balance-small", children: [
|
|
@@ -504,7 +504,7 @@ function AssetSelectStep({
|
|
|
504
504
|
] })
|
|
505
505
|
] })
|
|
506
506
|
] }),
|
|
507
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ?
|
|
507
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunkNFXJEOE6cjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
508
508
|
]
|
|
509
509
|
},
|
|
510
510
|
asset.id
|
|
@@ -514,7 +514,7 @@ function AssetSelectStep({
|
|
|
514
514
|
}
|
|
515
515
|
),
|
|
516
516
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
517
|
-
|
|
517
|
+
_chunkNFXJEOE6cjs.Button,
|
|
518
518
|
{
|
|
519
519
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
520
520
|
disabled: !selectedAsset,
|
|
@@ -522,17 +522,17 @@ function AssetSelectStep({
|
|
|
522
522
|
children: "Continue"
|
|
523
523
|
}
|
|
524
524
|
) }),
|
|
525
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
525
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNFXJEOE6cjs.PoweredBy, {})
|
|
526
526
|
] });
|
|
527
527
|
}
|
|
528
528
|
async function fetchNativeAssets(address, publicClient, existing) {
|
|
529
529
|
const existingIds = new Set(existing.map((asset) => asset.id));
|
|
530
530
|
const connectedChainId = _optionalChain([publicClient, 'access', _12 => _12.chain, 'optionalAccess', _13 => _13.id]);
|
|
531
531
|
if (!connectedChainId) return [];
|
|
532
|
-
if (!
|
|
533
|
-
const id =
|
|
532
|
+
if (!_chunkR2HP743Tcjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
|
|
533
|
+
const id = _chunkNFXJEOE6cjs.getAssetId.call(void 0, {
|
|
534
534
|
chainId: connectedChainId,
|
|
535
|
-
token:
|
|
535
|
+
token: _chunkR2HP743Tcjs.NATIVE_TOKEN_ADDRESS
|
|
536
536
|
});
|
|
537
537
|
if (existingIds.has(id)) return [];
|
|
538
538
|
try {
|
|
@@ -541,7 +541,7 @@ async function fetchNativeAssets(address, publicClient, existing) {
|
|
|
541
541
|
{
|
|
542
542
|
id,
|
|
543
543
|
chainId: connectedChainId,
|
|
544
|
-
token:
|
|
544
|
+
token: _chunkR2HP743Tcjs.NATIVE_TOKEN_ADDRESS,
|
|
545
545
|
symbol: "ETH",
|
|
546
546
|
name: "Ethereum",
|
|
547
547
|
decimals: 18,
|
|
@@ -594,8 +594,8 @@ function AmountStep({
|
|
|
594
594
|
const chainMismatch = Boolean(
|
|
595
595
|
_optionalChain([walletClient, 'optionalAccess', _14 => _14.chain, 'optionalAccess', _15 => _15.id]) && walletClient.chain.id !== asset.chainId
|
|
596
596
|
);
|
|
597
|
-
const targetSymbol =
|
|
598
|
-
const isSourceStablecoin =
|
|
597
|
+
const targetSymbol = _chunkR2HP743Tcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
598
|
+
const isSourceStablecoin = _chunkR2HP743Tcjs.isStablecoinSymbol.call(void 0, asset.symbol);
|
|
599
599
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
600
600
|
if (tokenPriceUsdOverride !== void 0 && tokenPriceUsdOverride > 0)
|
|
601
601
|
return tokenPriceUsdOverride;
|
|
@@ -619,7 +619,7 @@ function AmountStep({
|
|
|
619
619
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
620
620
|
if (!balanceTarget || !publicClient) return;
|
|
621
621
|
try {
|
|
622
|
-
const bal =
|
|
622
|
+
const bal = _chunkNFXJEOE6cjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
623
623
|
address: asset.token,
|
|
624
624
|
abi: _viem.erc20Abi,
|
|
625
625
|
functionName: "balanceOf",
|
|
@@ -645,7 +645,7 @@ function AmountStep({
|
|
|
645
645
|
setIsSwitching(true);
|
|
646
646
|
switchChain(asset.chainId).catch((err) => {
|
|
647
647
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
648
|
-
setError(
|
|
648
|
+
setError(_chunkNFXJEOE6cjs.formatUserError.call(void 0, raw));
|
|
649
649
|
}).finally(() => {
|
|
650
650
|
setIsSwitching(false);
|
|
651
651
|
});
|
|
@@ -681,7 +681,7 @@ function AmountStep({
|
|
|
681
681
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
682
682
|
const numeric = Number(raw);
|
|
683
683
|
if (!Number.isFinite(numeric)) return raw;
|
|
684
|
-
return
|
|
684
|
+
return _chunkNFXJEOE6cjs.tokenFormatter.format(numeric);
|
|
685
685
|
} catch (e8) {
|
|
686
686
|
return "...";
|
|
687
687
|
}
|
|
@@ -725,7 +725,7 @@ function AmountStep({
|
|
|
725
725
|
const usdValue = numericAmount;
|
|
726
726
|
if (_optionalChain([uiConfig, 'optionalAccess', _18 => _18.maxDepositUsd]) && usdValue > uiConfig.maxDepositUsd) {
|
|
727
727
|
setError(
|
|
728
|
-
`Maximum deposit is ${
|
|
728
|
+
`Maximum deposit is ${_chunkNFXJEOE6cjs.currencyFormatter.format(uiConfig.maxDepositUsd)}`
|
|
729
729
|
);
|
|
730
730
|
return;
|
|
731
731
|
}
|
|
@@ -807,7 +807,7 @@ function AmountStep({
|
|
|
807
807
|
hasPricing && balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { style: { color: "var(--rs-muted-foreground)" }, children: [
|
|
808
808
|
" ",
|
|
809
809
|
"(",
|
|
810
|
-
|
|
810
|
+
_chunkNFXJEOE6cjs.currencyFormatter.format(balanceUsd),
|
|
811
811
|
")"
|
|
812
812
|
] })
|
|
813
813
|
] }) })
|
|
@@ -821,26 +821,26 @@ function AmountStep({
|
|
|
821
821
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-flow-pill-label", children: "You send" }),
|
|
822
822
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-flow-pill-token", children: [
|
|
823
823
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-flow-pill-token-icon-wrapper", children: [
|
|
824
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-flow-pill-token-icon", children:
|
|
824
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-flow-pill-token-icon", children: _chunkR2HP743Tcjs.getTokenIcon.call(void 0, asset.symbol) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
825
825
|
"img",
|
|
826
826
|
{
|
|
827
|
-
src:
|
|
827
|
+
src: _chunkR2HP743Tcjs.getTokenIcon.call(void 0, asset.symbol),
|
|
828
828
|
alt: asset.symbol
|
|
829
829
|
}
|
|
830
830
|
) : asset.symbol.slice(0, 2) }),
|
|
831
831
|
(() => {
|
|
832
|
-
const chainIcon =
|
|
832
|
+
const chainIcon = _chunkR2HP743Tcjs.getChainIcon.call(void 0, asset.chainId);
|
|
833
833
|
if (chainIcon) {
|
|
834
834
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
835
835
|
"img",
|
|
836
836
|
{
|
|
837
837
|
src: chainIcon,
|
|
838
|
-
alt:
|
|
838
|
+
alt: _chunkR2HP743Tcjs.getChainName.call(void 0, asset.chainId),
|
|
839
839
|
className: "rs-flow-pill-chain-badge"
|
|
840
840
|
}
|
|
841
841
|
);
|
|
842
842
|
}
|
|
843
|
-
const badge =
|
|
843
|
+
const badge = _chunkR2HP743Tcjs.getChainBadge.call(void 0, asset.chainId);
|
|
844
844
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
845
845
|
"div",
|
|
846
846
|
{
|
|
@@ -878,26 +878,26 @@ function AmountStep({
|
|
|
878
878
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-flow-pill-label", children: "You receive" }),
|
|
879
879
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-flow-pill-token", children: [
|
|
880
880
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-flow-pill-token-icon-wrapper", children: [
|
|
881
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-flow-pill-token-icon", children:
|
|
881
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-flow-pill-token-icon", children: _chunkR2HP743Tcjs.getTokenIcon.call(void 0, targetSymbol) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
882
882
|
"img",
|
|
883
883
|
{
|
|
884
|
-
src:
|
|
884
|
+
src: _chunkR2HP743Tcjs.getTokenIcon.call(void 0, targetSymbol),
|
|
885
885
|
alt: targetSymbol
|
|
886
886
|
}
|
|
887
887
|
) : targetSymbol.slice(0, 2) }),
|
|
888
888
|
(() => {
|
|
889
|
-
const chainIcon =
|
|
889
|
+
const chainIcon = _chunkR2HP743Tcjs.getChainIcon.call(void 0, targetChain);
|
|
890
890
|
if (chainIcon) {
|
|
891
891
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
892
892
|
"img",
|
|
893
893
|
{
|
|
894
894
|
src: chainIcon,
|
|
895
|
-
alt:
|
|
895
|
+
alt: _chunkR2HP743Tcjs.getChainName.call(void 0, targetChain),
|
|
896
896
|
className: "rs-flow-pill-chain-badge"
|
|
897
897
|
}
|
|
898
898
|
);
|
|
899
899
|
}
|
|
900
|
-
const badge =
|
|
900
|
+
const badge = _chunkR2HP743Tcjs.getChainBadge.call(void 0, targetChain);
|
|
901
901
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
902
902
|
"div",
|
|
903
903
|
{
|
|
@@ -944,7 +944,7 @@ function AmountStep({
|
|
|
944
944
|
)
|
|
945
945
|
] }),
|
|
946
946
|
_optionalChain([uiConfig, 'optionalAccess', _21 => _21.minDepositUsd]) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-minimum", children: [
|
|
947
|
-
|
|
947
|
+
_chunkNFXJEOE6cjs.currencyFormatter.format(uiConfig.minDepositUsd),
|
|
948
948
|
" minimum deposit"
|
|
949
949
|
] }),
|
|
950
950
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", children: [
|
|
@@ -970,7 +970,7 @@ function AmountStep({
|
|
|
970
970
|
] })
|
|
971
971
|
] }),
|
|
972
972
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
973
|
-
|
|
973
|
+
_chunkNFXJEOE6cjs.Button,
|
|
974
974
|
{
|
|
975
975
|
onClick: handleContinue,
|
|
976
976
|
fullWidth: true,
|
|
@@ -978,7 +978,7 @@ function AmountStep({
|
|
|
978
978
|
children: isCheckingLiquidity ? "Checking liquidity\u2026" : _optionalChain([uiConfig, 'optionalAccess', _22 => _22.minDepositUsd]) && parseFloat(amount) > 0 && parseFloat(amount) < uiConfig.minDepositUsd ? "Update order" : "Continue"
|
|
979
979
|
}
|
|
980
980
|
) }),
|
|
981
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
981
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNFXJEOE6cjs.PoweredBy, {})
|
|
982
982
|
] });
|
|
983
983
|
}
|
|
984
984
|
|
|
@@ -1010,7 +1010,7 @@ function ConfirmStep({
|
|
|
1010
1010
|
const hasAttemptedSwitch = _react.useRef.call(void 0, false);
|
|
1011
1011
|
const chainMismatch = _optionalChain([walletClient, 'optionalAccess', _23 => _23.chain, 'optionalAccess', _24 => _24.id]) && walletClient.chain.id !== asset.chainId;
|
|
1012
1012
|
const sameRoute = targetChain === asset.chainId && targetToken.toLowerCase() === asset.token.toLowerCase();
|
|
1013
|
-
const targetSymbol = sameRoute ? asset.symbol :
|
|
1013
|
+
const targetSymbol = sameRoute ? asset.symbol : _chunkR2HP743Tcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
1014
1014
|
const formattedSendAmount = amount && !Number.isNaN(Number(amount)) ? Number(amount).toLocaleString("en-US", { maximumFractionDigits: 6 }) : "0";
|
|
1015
1015
|
const formattedReceiveAmount = (() => {
|
|
1016
1016
|
if (sameRoute) return formattedSendAmount;
|
|
@@ -1029,7 +1029,7 @@ function ConfirmStep({
|
|
|
1029
1029
|
setIsSwitching(true);
|
|
1030
1030
|
switchChain(asset.chainId).catch((err) => {
|
|
1031
1031
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
1032
|
-
setError(
|
|
1032
|
+
setError(_chunkNFXJEOE6cjs.formatUserError.call(void 0, raw));
|
|
1033
1033
|
}).finally(() => {
|
|
1034
1034
|
setIsSwitching(false);
|
|
1035
1035
|
});
|
|
@@ -1044,7 +1044,7 @@ function ConfirmStep({
|
|
|
1044
1044
|
return;
|
|
1045
1045
|
}
|
|
1046
1046
|
if (chainMismatch) {
|
|
1047
|
-
setError(`Switch to ${
|
|
1047
|
+
setError(`Switch to ${_chunkR2HP743Tcjs.getChainName.call(void 0, asset.chainId)} to sign`);
|
|
1048
1048
|
return;
|
|
1049
1049
|
}
|
|
1050
1050
|
const parsedAmount = parseFloat(amount);
|
|
@@ -1072,7 +1072,7 @@ function ConfirmStep({
|
|
|
1072
1072
|
throw new Error("Wallet not properly connected");
|
|
1073
1073
|
}
|
|
1074
1074
|
const transferTo = sameRoute ? recipient : smartAccount;
|
|
1075
|
-
const hash =
|
|
1075
|
+
const hash = _chunkNFXJEOE6cjs.isNativeAsset.call(void 0, asset) ? await walletClient.sendTransaction({
|
|
1076
1076
|
account,
|
|
1077
1077
|
chain,
|
|
1078
1078
|
to: transferTo,
|
|
@@ -1089,7 +1089,7 @@ function ConfirmStep({
|
|
|
1089
1089
|
onConfirm(hash, asset.chainId, amountUnits.toString(), asset.token);
|
|
1090
1090
|
} catch (err) {
|
|
1091
1091
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
1092
|
-
const message =
|
|
1092
|
+
const message = _chunkNFXJEOE6cjs.formatUserError.call(void 0, raw);
|
|
1093
1093
|
setError(message);
|
|
1094
1094
|
_optionalChain([onError, 'optionalCall', _26 => _26(message, "TRANSFER_ERROR")]);
|
|
1095
1095
|
} finally {
|
|
@@ -1108,15 +1108,15 @@ function ConfirmStep({
|
|
|
1108
1108
|
className: "rs-card-value",
|
|
1109
1109
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
1110
1110
|
children: [
|
|
1111
|
-
|
|
1111
|
+
_chunkR2HP743Tcjs.getChainIcon.call(void 0, asset.chainId) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1112
1112
|
"img",
|
|
1113
1113
|
{
|
|
1114
|
-
src:
|
|
1114
|
+
src: _chunkR2HP743Tcjs.getChainIcon.call(void 0, asset.chainId),
|
|
1115
1115
|
alt: "",
|
|
1116
1116
|
style: { width: 16, height: 16, borderRadius: 3 }
|
|
1117
1117
|
}
|
|
1118
1118
|
),
|
|
1119
|
-
|
|
1119
|
+
_chunkR2HP743Tcjs.getChainName.call(void 0, asset.chainId)
|
|
1120
1120
|
]
|
|
1121
1121
|
}
|
|
1122
1122
|
)
|
|
@@ -1129,15 +1129,15 @@ function ConfirmStep({
|
|
|
1129
1129
|
className: "rs-card-value",
|
|
1130
1130
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
1131
1131
|
children: [
|
|
1132
|
-
|
|
1132
|
+
_chunkR2HP743Tcjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1133
1133
|
"img",
|
|
1134
1134
|
{
|
|
1135
|
-
src:
|
|
1135
|
+
src: _chunkR2HP743Tcjs.getChainIcon.call(void 0, targetChain),
|
|
1136
1136
|
alt: "",
|
|
1137
1137
|
style: { width: 16, height: 16, borderRadius: 3 }
|
|
1138
1138
|
}
|
|
1139
1139
|
),
|
|
1140
|
-
|
|
1140
|
+
_chunkR2HP743Tcjs.getChainName.call(void 0, targetChain)
|
|
1141
1141
|
]
|
|
1142
1142
|
}
|
|
1143
1143
|
)
|
|
@@ -1156,10 +1156,10 @@ function ConfirmStep({
|
|
|
1156
1156
|
className: "rs-card-value",
|
|
1157
1157
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
1158
1158
|
children: [
|
|
1159
|
-
|
|
1159
|
+
_chunkR2HP743Tcjs.getTokenIcon.call(void 0, asset.symbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1160
1160
|
"img",
|
|
1161
1161
|
{
|
|
1162
|
-
src:
|
|
1162
|
+
src: _chunkR2HP743Tcjs.getTokenIcon.call(void 0, asset.symbol),
|
|
1163
1163
|
alt: "",
|
|
1164
1164
|
style: { width: 16, height: 16, borderRadius: "50%" }
|
|
1165
1165
|
}
|
|
@@ -1179,10 +1179,10 @@ function ConfirmStep({
|
|
|
1179
1179
|
className: "rs-card-value",
|
|
1180
1180
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
1181
1181
|
children: [
|
|
1182
|
-
|
|
1182
|
+
_chunkR2HP743Tcjs.getTokenIcon.call(void 0, targetSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1183
1183
|
"img",
|
|
1184
1184
|
{
|
|
1185
|
-
src:
|
|
1185
|
+
src: _chunkR2HP743Tcjs.getTokenIcon.call(void 0, targetSymbol),
|
|
1186
1186
|
alt: "",
|
|
1187
1187
|
style: { width: 16, height: 16, borderRadius: "50%" }
|
|
1188
1188
|
}
|
|
@@ -1231,7 +1231,7 @@ function ConfirmStep({
|
|
|
1231
1231
|
] })
|
|
1232
1232
|
] }),
|
|
1233
1233
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1234
|
-
|
|
1234
|
+
_chunkNFXJEOE6cjs.Button,
|
|
1235
1235
|
{
|
|
1236
1236
|
onClick: handleConfirm,
|
|
1237
1237
|
loading: isSubmitting,
|
|
@@ -1240,7 +1240,7 @@ function ConfirmStep({
|
|
|
1240
1240
|
children: "Confirm Order"
|
|
1241
1241
|
}
|
|
1242
1242
|
) }),
|
|
1243
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1243
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNFXJEOE6cjs.PoweredBy, {})
|
|
1244
1244
|
] });
|
|
1245
1245
|
}
|
|
1246
1246
|
|
|
@@ -1378,9 +1378,9 @@ var INITIAL_POLL_INTERVAL = 3e3;
|
|
|
1378
1378
|
var MAX_POLL_INTERVAL = 3e4;
|
|
1379
1379
|
var BACKOFF_MULTIPLIER = 1.5;
|
|
1380
1380
|
function isEventForTx(event, txHash) {
|
|
1381
|
-
const eventTxHash =
|
|
1381
|
+
const eventTxHash = _chunkNFXJEOE6cjs.getEventTxHash.call(void 0, event);
|
|
1382
1382
|
if (!eventTxHash) return false;
|
|
1383
|
-
return
|
|
1383
|
+
return _chunkNFXJEOE6cjs.txRefsMatch.call(void 0, eventTxHash, txHash);
|
|
1384
1384
|
}
|
|
1385
1385
|
function truncateHash(hash) {
|
|
1386
1386
|
return `${hash.slice(0, 4)}\u2026${hash.slice(-4)}`;
|
|
@@ -1475,7 +1475,7 @@ function DepositNotification({
|
|
|
1475
1475
|
const pollIntervalRef = _react.useRef.call(void 0, INITIAL_POLL_INTERVAL);
|
|
1476
1476
|
const pollTimeoutRef = _react.useRef.call(void 0, null);
|
|
1477
1477
|
const completedRef = _react.useRef.call(void 0, _nullishCoalesce(directTransfer, () => ( false)));
|
|
1478
|
-
const depositContextRef =
|
|
1478
|
+
const depositContextRef = _chunkNFXJEOE6cjs.useLatestRef.call(void 0, {
|
|
1479
1479
|
amount,
|
|
1480
1480
|
sourceChain,
|
|
1481
1481
|
sourceToken: token,
|
|
@@ -1484,8 +1484,8 @@ function DepositNotification({
|
|
|
1484
1484
|
waitForFinalTx,
|
|
1485
1485
|
hasPostBridgeActions
|
|
1486
1486
|
});
|
|
1487
|
-
const onCompleteRef =
|
|
1488
|
-
const onFailedRef =
|
|
1487
|
+
const onCompleteRef = _chunkNFXJEOE6cjs.useLatestRef.call(void 0, onComplete);
|
|
1488
|
+
const onFailedRef = _chunkNFXJEOE6cjs.useLatestRef.call(void 0, onFailed);
|
|
1489
1489
|
const handleComplete = _react.useCallback.call(void 0,
|
|
1490
1490
|
(destTxHash) => {
|
|
1491
1491
|
if (completedRef.current) return;
|
|
@@ -1589,8 +1589,8 @@ function DepositNotification({
|
|
|
1589
1589
|
status,
|
|
1590
1590
|
txHash
|
|
1591
1591
|
]);
|
|
1592
|
-
const sourceExplorerUrl =
|
|
1593
|
-
const destExplorerUrl = destinationTxHash ?
|
|
1592
|
+
const sourceExplorerUrl = _chunkR2HP743Tcjs.getExplorerTxUrl.call(void 0, sourceChain, txHash);
|
|
1593
|
+
const destExplorerUrl = destinationTxHash ? _chunkR2HP743Tcjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
|
|
1594
1594
|
const title = status === "complete" ? "Deposit completed" : status === "failed" ? "Deposit failed" : "Deposit received and processing\u2026";
|
|
1595
1595
|
const subtitle = status === "complete" ? "Your deposit has been credited to your account." : status === "failed" ? "Your deposit could not be processed." : "Your deposit will be credited to your account shortly.";
|
|
1596
1596
|
const statusIcon = status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--complete", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1625,7 +1625,7 @@ function DepositNotification({
|
|
|
1625
1625
|
}
|
|
1626
1626
|
)
|
|
1627
1627
|
}
|
|
1628
|
-
) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--processing", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1628
|
+
) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--processing", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNFXJEOE6cjs.Spinner, {}) });
|
|
1629
1629
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1630
1630
|
"div",
|
|
1631
1631
|
{
|
|
@@ -1939,7 +1939,7 @@ function DepositAddressStep({
|
|
|
1939
1939
|
[_optionalChain([allowedRoutes, 'optionalAccess', _61 => _61.sourceTokens])]
|
|
1940
1940
|
);
|
|
1941
1941
|
const evmChainIds = _react.useMemo.call(void 0, () => {
|
|
1942
|
-
const all =
|
|
1942
|
+
const all = _chunkR2HP743Tcjs.getSupportedChainIds.call(void 0, );
|
|
1943
1943
|
return allowedChainSet ? all.filter((id) => allowedChainSet.has(id)) : all;
|
|
1944
1944
|
}, [allowedChainSet]);
|
|
1945
1945
|
const chainOptions = _react.useMemo.call(void 0, () => {
|
|
@@ -1953,7 +1953,7 @@ function DepositAddressStep({
|
|
|
1953
1953
|
const [sourceChainId, setSourceChainId] = _react.useState.call(void 0, defaultChainId);
|
|
1954
1954
|
const isSolana = sourceChainId === "solana";
|
|
1955
1955
|
const tokensForChain = _react.useMemo.call(void 0, () => {
|
|
1956
|
-
const all = isSolana ? SOLANA_TOKENS.map((t) => t.symbol) :
|
|
1956
|
+
const all = isSolana ? SOLANA_TOKENS.map((t) => t.symbol) : _chunkR2HP743Tcjs.getTargetTokenSymbolsForChain.call(void 0, sourceChainId);
|
|
1957
1957
|
return allowedTokenSet ? all.filter((s) => allowedTokenSet.has(s.toUpperCase())) : all;
|
|
1958
1958
|
}, [sourceChainId, isSolana, allowedTokenSet]);
|
|
1959
1959
|
const defaultToken = tokensForChain.includes("USDC") ? "USDC" : _nullishCoalesce(tokensForChain[0], () => ( "USDC"));
|
|
@@ -1977,7 +1977,7 @@ function DepositAddressStep({
|
|
|
1977
1977
|
const notificationIdRef = _react.useRef.call(void 0, 0);
|
|
1978
1978
|
const sourceSelectionRef = _react.useRef.call(void 0, {
|
|
1979
1979
|
chainId: defaultChainId,
|
|
1980
|
-
token: typeof defaultChainId === "number" ?
|
|
1980
|
+
token: typeof defaultChainId === "number" ? _chunkR2HP743Tcjs.getTokenAddress.call(void 0, defaultToken, defaultChainId) : void 0,
|
|
1981
1981
|
sourceSymbol: defaultToken
|
|
1982
1982
|
});
|
|
1983
1983
|
_react.useEffect.call(void 0, () => {
|
|
@@ -1993,7 +1993,7 @@ function DepositAddressStep({
|
|
|
1993
1993
|
}
|
|
1994
1994
|
sourceSelectionRef.current = {
|
|
1995
1995
|
chainId: sourceChainId,
|
|
1996
|
-
token:
|
|
1996
|
+
token: _chunkR2HP743Tcjs.getTokenAddress.call(void 0, sourceTokenSymbol, sourceChainId),
|
|
1997
1997
|
sourceSymbol: sourceTokenSymbol
|
|
1998
1998
|
};
|
|
1999
1999
|
}, [sourceChainId, sourceTokenSymbol, isSolana]);
|
|
@@ -2005,7 +2005,7 @@ function DepositAddressStep({
|
|
|
2005
2005
|
setLiquidityHelper({ kind: "idle" });
|
|
2006
2006
|
return;
|
|
2007
2007
|
}
|
|
2008
|
-
const sourceTokenAddress =
|
|
2008
|
+
const sourceTokenAddress = _chunkR2HP743Tcjs.getTokenAddress.call(void 0,
|
|
2009
2009
|
sourceTokenSymbol,
|
|
2010
2010
|
sourceChainId
|
|
2011
2011
|
);
|
|
@@ -2144,10 +2144,10 @@ function DepositAddressStep({
|
|
|
2144
2144
|
return;
|
|
2145
2145
|
}
|
|
2146
2146
|
const event = status.lastEvent;
|
|
2147
|
-
const eventTxHash =
|
|
2147
|
+
const eventTxHash = _chunkNFXJEOE6cjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkNFXJEOE6cjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
2148
2148
|
if (baselineTxHashRef.current === void 0) {
|
|
2149
2149
|
baselineTxHashRef.current = eventTxHash;
|
|
2150
|
-
} else if (eventTxHash && (!baselineTxHashRef.current || !
|
|
2150
|
+
} else if (eventTxHash && (!baselineTxHashRef.current || !_chunkNFXJEOE6cjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
|
|
2151
2151
|
const details = getDepositEventDetails(event);
|
|
2152
2152
|
const fallback = sourceSelectionRef.current;
|
|
2153
2153
|
const chainId = _nullishCoalesce(details.chainId, () => ( fallback.chainId));
|
|
@@ -2220,7 +2220,7 @@ function DepositAddressStep({
|
|
|
2220
2220
|
const handleNotificationDismiss = _react.useCallback.call(void 0, (id) => {
|
|
2221
2221
|
setNotifications((prev) => prev.filter((n) => n.id !== id));
|
|
2222
2222
|
}, []);
|
|
2223
|
-
const qrIconSrc =
|
|
2223
|
+
const qrIconSrc = _chunkR2HP743Tcjs.getChainIcon.call(void 0, sourceChainId);
|
|
2224
2224
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step rs-step--with-notifications", children: [
|
|
2225
2225
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-body", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address", children: [
|
|
2226
2226
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", children: [
|
|
@@ -2236,15 +2236,15 @@ function DepositAddressStep({
|
|
|
2236
2236
|
setTokenDropdownOpen(false);
|
|
2237
2237
|
},
|
|
2238
2238
|
children: [
|
|
2239
|
-
|
|
2239
|
+
_chunkR2HP743Tcjs.getChainIcon.call(void 0, sourceChainId) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2240
2240
|
"img",
|
|
2241
2241
|
{
|
|
2242
|
-
src:
|
|
2242
|
+
src: _chunkR2HP743Tcjs.getChainIcon.call(void 0, sourceChainId),
|
|
2243
2243
|
alt: "",
|
|
2244
2244
|
className: "rs-deposit-address-dropdown-icon"
|
|
2245
2245
|
}
|
|
2246
2246
|
),
|
|
2247
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children:
|
|
2247
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunkR2HP743Tcjs.getChainName.call(void 0, sourceChainId) }),
|
|
2248
2248
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2249
2249
|
"svg",
|
|
2250
2250
|
{
|
|
@@ -2276,15 +2276,15 @@ function DepositAddressStep({
|
|
|
2276
2276
|
setChainDropdownOpen(false);
|
|
2277
2277
|
},
|
|
2278
2278
|
children: [
|
|
2279
|
-
|
|
2279
|
+
_chunkR2HP743Tcjs.getChainIcon.call(void 0, chainId) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2280
2280
|
"img",
|
|
2281
2281
|
{
|
|
2282
|
-
src:
|
|
2282
|
+
src: _chunkR2HP743Tcjs.getChainIcon.call(void 0, chainId),
|
|
2283
2283
|
alt: "",
|
|
2284
2284
|
className: "rs-deposit-address-dropdown-icon"
|
|
2285
2285
|
}
|
|
2286
2286
|
),
|
|
2287
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children:
|
|
2287
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunkR2HP743Tcjs.getChainName.call(void 0, chainId) })
|
|
2288
2288
|
]
|
|
2289
2289
|
},
|
|
2290
2290
|
String(chainId)
|
|
@@ -2323,10 +2323,10 @@ function DepositAddressStep({
|
|
|
2323
2323
|
setChainDropdownOpen(false);
|
|
2324
2324
|
},
|
|
2325
2325
|
children: [
|
|
2326
|
-
|
|
2326
|
+
_chunkR2HP743Tcjs.getTokenIcon.call(void 0, sourceTokenSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2327
2327
|
"img",
|
|
2328
2328
|
{
|
|
2329
|
-
src:
|
|
2329
|
+
src: _chunkR2HP743Tcjs.getTokenIcon.call(void 0, sourceTokenSymbol),
|
|
2330
2330
|
alt: "",
|
|
2331
2331
|
className: "rs-deposit-address-dropdown-icon"
|
|
2332
2332
|
}
|
|
@@ -2363,10 +2363,10 @@ function DepositAddressStep({
|
|
|
2363
2363
|
setTokenDropdownOpen(false);
|
|
2364
2364
|
},
|
|
2365
2365
|
children: [
|
|
2366
|
-
|
|
2366
|
+
_chunkR2HP743Tcjs.getTokenIcon.call(void 0, symbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2367
2367
|
"img",
|
|
2368
2368
|
{
|
|
2369
|
-
src:
|
|
2369
|
+
src: _chunkR2HP743Tcjs.getTokenIcon.call(void 0, symbol),
|
|
2370
2370
|
alt: "",
|
|
2371
2371
|
className: "rs-deposit-address-dropdown-icon"
|
|
2372
2372
|
}
|
|
@@ -2580,7 +2580,7 @@ function DepositAddressStep({
|
|
|
2580
2580
|
},
|
|
2581
2581
|
deposit.id
|
|
2582
2582
|
)) }),
|
|
2583
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2583
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNFXJEOE6cjs.PoweredBy, {})
|
|
2584
2584
|
] });
|
|
2585
2585
|
}
|
|
2586
2586
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -2611,7 +2611,7 @@ function SolanaTokenSelectStep({
|
|
|
2611
2611
|
setError(null);
|
|
2612
2612
|
const portfolioBySymbol = {};
|
|
2613
2613
|
try {
|
|
2614
|
-
|
|
2614
|
+
_chunkNFXJEOE6cjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
|
|
2615
2615
|
solanaAddress
|
|
2616
2616
|
});
|
|
2617
2617
|
const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
|
|
@@ -2634,12 +2634,12 @@ function SolanaTokenSelectStep({
|
|
|
2634
2634
|
};
|
|
2635
2635
|
}
|
|
2636
2636
|
}
|
|
2637
|
-
|
|
2637
|
+
_chunkNFXJEOE6cjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
|
|
2638
2638
|
symbols: Object.keys(portfolioBySymbol)
|
|
2639
2639
|
});
|
|
2640
2640
|
} catch (err) {
|
|
2641
2641
|
if (!active) return;
|
|
2642
|
-
|
|
2642
|
+
_chunkNFXJEOE6cjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
|
|
2643
2643
|
solanaAddress
|
|
2644
2644
|
});
|
|
2645
2645
|
setError(
|
|
@@ -2693,7 +2693,7 @@ function SolanaTokenSelectStep({
|
|
|
2693
2693
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
2694
2694
|
children: [
|
|
2695
2695
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
2696
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2696
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNFXJEOE6cjs.Spinner, { className: "rs-text-tertiary" }),
|
|
2697
2697
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
2698
2698
|
] }),
|
|
2699
2699
|
!loading && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
@@ -2724,13 +2724,13 @@ function SolanaTokenSelectStep({
|
|
|
2724
2724
|
] }),
|
|
2725
2725
|
!loading && rows.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: rows.map((entry) => {
|
|
2726
2726
|
const isSelected = selectedSymbol === entry.token.symbol;
|
|
2727
|
-
const tokenIcon =
|
|
2728
|
-
const chainIcon =
|
|
2727
|
+
const tokenIcon = _chunkR2HP743Tcjs.getTokenIcon.call(void 0, entry.token.symbol);
|
|
2728
|
+
const chainIcon = _chunkR2HP743Tcjs.getChainIcon.call(void 0, "solana");
|
|
2729
2729
|
let formattedBalance;
|
|
2730
2730
|
try {
|
|
2731
2731
|
const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
|
|
2732
2732
|
const numeric = Number(raw);
|
|
2733
|
-
formattedBalance = Number.isFinite(numeric) ?
|
|
2733
|
+
formattedBalance = Number.isFinite(numeric) ? _chunkNFXJEOE6cjs.tokenFormatter.format(numeric) : raw;
|
|
2734
2734
|
} catch (e16) {
|
|
2735
2735
|
formattedBalance = "...";
|
|
2736
2736
|
}
|
|
@@ -2774,7 +2774,7 @@ function SolanaTokenSelectStep({
|
|
|
2774
2774
|
] })
|
|
2775
2775
|
] })
|
|
2776
2776
|
] }),
|
|
2777
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ?
|
|
2777
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunkNFXJEOE6cjs.currencyFormatter.format(entry.balanceUsd) : `${formattedBalance} ${entry.token.symbol}` })
|
|
2778
2778
|
]
|
|
2779
2779
|
},
|
|
2780
2780
|
entry.token.symbol
|
|
@@ -2784,7 +2784,7 @@ function SolanaTokenSelectStep({
|
|
|
2784
2784
|
}
|
|
2785
2785
|
),
|
|
2786
2786
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2787
|
-
|
|
2787
|
+
_chunkNFXJEOE6cjs.Button,
|
|
2788
2788
|
{
|
|
2789
2789
|
onClick: () => selectedEntry && onContinue(
|
|
2790
2790
|
selectedEntry.token,
|
|
@@ -2796,7 +2796,7 @@ function SolanaTokenSelectStep({
|
|
|
2796
2796
|
children: "Continue"
|
|
2797
2797
|
}
|
|
2798
2798
|
) }),
|
|
2799
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2799
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNFXJEOE6cjs.PoweredBy, {})
|
|
2800
2800
|
] });
|
|
2801
2801
|
}
|
|
2802
2802
|
|
|
@@ -2816,7 +2816,7 @@ function SolanaAmountStep({
|
|
|
2816
2816
|
}) {
|
|
2817
2817
|
const [amount, setAmount] = _react.useState.call(void 0, "");
|
|
2818
2818
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
2819
|
-
const isSourceStablecoin =
|
|
2819
|
+
const isSourceStablecoin = _chunkR2HP743Tcjs.isStablecoinSymbol.call(void 0, token.symbol);
|
|
2820
2820
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
2821
2821
|
if (isSourceStablecoin) return 1;
|
|
2822
2822
|
try {
|
|
@@ -2844,7 +2844,7 @@ function SolanaAmountStep({
|
|
|
2844
2844
|
const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
|
|
2845
2845
|
const numeric = Number(raw);
|
|
2846
2846
|
if (!Number.isFinite(numeric)) return raw;
|
|
2847
|
-
return
|
|
2847
|
+
return _chunkNFXJEOE6cjs.tokenFormatter.format(numeric);
|
|
2848
2848
|
} catch (e18) {
|
|
2849
2849
|
return "...";
|
|
2850
2850
|
}
|
|
@@ -2862,7 +2862,7 @@ function SolanaAmountStep({
|
|
|
2862
2862
|
}, [balance, token.decimals, tokenPriceUsd, balanceUsd]);
|
|
2863
2863
|
const formattedBalanceUsd = _react.useMemo.call(void 0, () => {
|
|
2864
2864
|
if (computedBalanceUsd === null || computedBalanceUsd <= 0) return null;
|
|
2865
|
-
return
|
|
2865
|
+
return _chunkNFXJEOE6cjs.currencyFormatter.format(computedBalanceUsd);
|
|
2866
2866
|
}, [computedBalanceUsd]);
|
|
2867
2867
|
const spendableBalance = _react.useMemo.call(void 0, () => {
|
|
2868
2868
|
if (!isNativeSol(token)) return balance;
|
|
@@ -2887,7 +2887,7 @@ function SolanaAmountStep({
|
|
|
2887
2887
|
const factor = 10 ** maxDecimals;
|
|
2888
2888
|
const truncated = Math.floor(value * factor) / factor;
|
|
2889
2889
|
const formatted = truncated.toFixed(maxDecimals).replace(/\.?0+$/, "");
|
|
2890
|
-
|
|
2890
|
+
_chunkNFXJEOE6cjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
|
|
2891
2891
|
percentage,
|
|
2892
2892
|
symbol: token.symbol,
|
|
2893
2893
|
formatted
|
|
@@ -2901,7 +2901,7 @@ function SolanaAmountStep({
|
|
|
2901
2901
|
const handleContinue = () => {
|
|
2902
2902
|
const numericAmount = parseFloat(amount);
|
|
2903
2903
|
if (isNaN(numericAmount) || numericAmount <= 0) {
|
|
2904
|
-
|
|
2904
|
+
_chunkNFXJEOE6cjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2905
2905
|
amount,
|
|
2906
2906
|
reason: "nan-or-non-positive"
|
|
2907
2907
|
});
|
|
@@ -2913,7 +2913,7 @@ function SolanaAmountStep({
|
|
|
2913
2913
|
const usdValue = numericAmount;
|
|
2914
2914
|
if (_optionalChain([uiConfig, 'optionalAccess', _82 => _82.maxDepositUsd]) && usdValue > uiConfig.maxDepositUsd) {
|
|
2915
2915
|
setError(
|
|
2916
|
-
`Maximum deposit is ${
|
|
2916
|
+
`Maximum deposit is ${_chunkNFXJEOE6cjs.currencyFormatter.format(uiConfig.maxDepositUsd)}`
|
|
2917
2917
|
);
|
|
2918
2918
|
return;
|
|
2919
2919
|
}
|
|
@@ -2928,7 +2928,7 @@ function SolanaAmountStep({
|
|
|
2928
2928
|
try {
|
|
2929
2929
|
amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
|
|
2930
2930
|
} catch (e22) {
|
|
2931
|
-
|
|
2931
|
+
_chunkNFXJEOE6cjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2932
2932
|
amount,
|
|
2933
2933
|
sourceAmount: sourceAmountStr,
|
|
2934
2934
|
reason: "parse-units-failed"
|
|
@@ -2938,7 +2938,7 @@ function SolanaAmountStep({
|
|
|
2938
2938
|
}
|
|
2939
2939
|
if (amountInUnits > spendableBalance) {
|
|
2940
2940
|
const isReserveIssue = isNativeSol(token) && amountInUnits <= balance;
|
|
2941
|
-
|
|
2941
|
+
_chunkNFXJEOE6cjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2942
2942
|
amount,
|
|
2943
2943
|
balance: balance.toString(),
|
|
2944
2944
|
spendableBalance: spendableBalance.toString(),
|
|
@@ -2950,7 +2950,7 @@ function SolanaAmountStep({
|
|
|
2950
2950
|
);
|
|
2951
2951
|
return;
|
|
2952
2952
|
}
|
|
2953
|
-
|
|
2953
|
+
_chunkNFXJEOE6cjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
|
|
2954
2954
|
symbol: token.symbol,
|
|
2955
2955
|
inputAmountUsd: amount,
|
|
2956
2956
|
sourceAmount: sourceAmountStr,
|
|
@@ -3019,7 +3019,7 @@ function SolanaAmountStep({
|
|
|
3019
3019
|
)
|
|
3020
3020
|
] }),
|
|
3021
3021
|
_optionalChain([uiConfig, 'optionalAccess', _84 => _84.minDepositUsd]) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-minimum", children: [
|
|
3022
|
-
|
|
3022
|
+
_chunkNFXJEOE6cjs.currencyFormatter.format(uiConfig.minDepositUsd),
|
|
3023
3023
|
" minimum deposit"
|
|
3024
3024
|
] }),
|
|
3025
3025
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", children: [
|
|
@@ -3045,7 +3045,7 @@ function SolanaAmountStep({
|
|
|
3045
3045
|
] })
|
|
3046
3046
|
] }),
|
|
3047
3047
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3048
|
-
|
|
3048
|
+
_chunkNFXJEOE6cjs.Button,
|
|
3049
3049
|
{
|
|
3050
3050
|
onClick: handleContinue,
|
|
3051
3051
|
fullWidth: true,
|
|
@@ -3053,7 +3053,7 @@ function SolanaAmountStep({
|
|
|
3053
3053
|
children: _optionalChain([uiConfig, 'optionalAccess', _85 => _85.minDepositUsd]) && parseFloat(amount) > 0 && parseFloat(amount) < uiConfig.minDepositUsd ? "Update order" : "Continue"
|
|
3054
3054
|
}
|
|
3055
3055
|
) }),
|
|
3056
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3056
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNFXJEOE6cjs.PoweredBy, {})
|
|
3057
3057
|
] });
|
|
3058
3058
|
}
|
|
3059
3059
|
|
|
@@ -3080,7 +3080,7 @@ function SolanaConfirmStep({
|
|
|
3080
3080
|
}) {
|
|
3081
3081
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
3082
3082
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
3083
|
-
const targetSymbol =
|
|
3083
|
+
const targetSymbol = _chunkR2HP743Tcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3084
3084
|
const isSameToken = token.symbol.toUpperCase() === targetSymbol.toUpperCase();
|
|
3085
3085
|
const formattedAmount = sourceAmount && !Number.isNaN(Number(sourceAmount)) ? Number(sourceAmount).toLocaleString("en-US", { maximumFractionDigits: 6 }) : "0";
|
|
3086
3086
|
const formattedReceiveAmount = (() => {
|
|
@@ -3097,7 +3097,7 @@ function SolanaConfirmStep({
|
|
|
3097
3097
|
const receiveAmount = isSameToken ? formattedReceiveAmount : `~ ${formattedReceiveAmount}`;
|
|
3098
3098
|
const handleConfirm = async () => {
|
|
3099
3099
|
if (!solanaProvider) {
|
|
3100
|
-
|
|
3100
|
+
_chunkNFXJEOE6cjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
3101
3101
|
reason: "missing-provider"
|
|
3102
3102
|
});
|
|
3103
3103
|
setError("Solana wallet not connected");
|
|
@@ -3105,7 +3105,7 @@ function SolanaConfirmStep({
|
|
|
3105
3105
|
}
|
|
3106
3106
|
const parsedAmount = parseFloat(sourceAmount);
|
|
3107
3107
|
if (isNaN(parsedAmount) || parsedAmount <= 0) {
|
|
3108
|
-
|
|
3108
|
+
_chunkNFXJEOE6cjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
3109
3109
|
reason: "invalid-amount",
|
|
3110
3110
|
sourceAmount
|
|
3111
3111
|
});
|
|
@@ -3114,7 +3114,7 @@ function SolanaConfirmStep({
|
|
|
3114
3114
|
}
|
|
3115
3115
|
setError(null);
|
|
3116
3116
|
setIsSubmitting(true);
|
|
3117
|
-
|
|
3117
|
+
_chunkNFXJEOE6cjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
|
|
3118
3118
|
smartAccount,
|
|
3119
3119
|
solanaAddress,
|
|
3120
3120
|
solanaDepositAddress,
|
|
@@ -3124,7 +3124,7 @@ function SolanaConfirmStep({
|
|
|
3124
3124
|
});
|
|
3125
3125
|
try {
|
|
3126
3126
|
const check = await service.checkAccount(smartAccount);
|
|
3127
|
-
|
|
3127
|
+
_chunkNFXJEOE6cjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
|
|
3128
3128
|
smartAccount,
|
|
3129
3129
|
isRegistered: check.isRegistered,
|
|
3130
3130
|
targetChain: check.targetChain,
|
|
@@ -3137,7 +3137,7 @@ function SolanaConfirmStep({
|
|
|
3137
3137
|
}
|
|
3138
3138
|
const connection = getSolanaConnection();
|
|
3139
3139
|
const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
|
|
3140
|
-
|
|
3140
|
+
_chunkNFXJEOE6cjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
|
|
3141
3141
|
token: token.symbol,
|
|
3142
3142
|
sourceAmount,
|
|
3143
3143
|
amountUnits: amountUnits.toString()
|
|
@@ -3154,7 +3154,7 @@ function SolanaConfirmStep({
|
|
|
3154
3154
|
token.mint,
|
|
3155
3155
|
amountUnits
|
|
3156
3156
|
);
|
|
3157
|
-
|
|
3157
|
+
_chunkNFXJEOE6cjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
3158
3158
|
token: token.symbol,
|
|
3159
3159
|
instructionCount: transaction.instructions.length,
|
|
3160
3160
|
feePayer: _optionalChain([transaction, 'access', _86 => _86.feePayer, 'optionalAccess', _87 => _87.toBase58, 'call', _88 => _88()]),
|
|
@@ -3165,15 +3165,15 @@ function SolanaConfirmStep({
|
|
|
3165
3165
|
connection,
|
|
3166
3166
|
transaction
|
|
3167
3167
|
);
|
|
3168
|
-
|
|
3168
|
+
_chunkNFXJEOE6cjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
|
|
3169
3169
|
txHash,
|
|
3170
3170
|
amountUnits: amountUnits.toString()
|
|
3171
3171
|
});
|
|
3172
3172
|
onConfirm(txHash, amountUnits.toString());
|
|
3173
3173
|
} catch (err) {
|
|
3174
3174
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
3175
|
-
const message =
|
|
3176
|
-
|
|
3175
|
+
const message = _chunkNFXJEOE6cjs.formatUserError.call(void 0, raw);
|
|
3176
|
+
_chunkNFXJEOE6cjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
|
|
3177
3177
|
smartAccount,
|
|
3178
3178
|
token: token.symbol,
|
|
3179
3179
|
sourceAmount
|
|
@@ -3196,15 +3196,15 @@ function SolanaConfirmStep({
|
|
|
3196
3196
|
className: "rs-card-value",
|
|
3197
3197
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
3198
3198
|
children: [
|
|
3199
|
-
|
|
3199
|
+
_chunkR2HP743Tcjs.getChainIcon.call(void 0, "solana") && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3200
3200
|
"img",
|
|
3201
3201
|
{
|
|
3202
|
-
src:
|
|
3202
|
+
src: _chunkR2HP743Tcjs.getChainIcon.call(void 0, "solana"),
|
|
3203
3203
|
alt: "",
|
|
3204
3204
|
style: { width: 16, height: 16, borderRadius: 3 }
|
|
3205
3205
|
}
|
|
3206
3206
|
),
|
|
3207
|
-
|
|
3207
|
+
_chunkR2HP743Tcjs.getChainName.call(void 0, "solana")
|
|
3208
3208
|
]
|
|
3209
3209
|
}
|
|
3210
3210
|
)
|
|
@@ -3217,15 +3217,15 @@ function SolanaConfirmStep({
|
|
|
3217
3217
|
className: "rs-card-value",
|
|
3218
3218
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
3219
3219
|
children: [
|
|
3220
|
-
|
|
3220
|
+
_chunkR2HP743Tcjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3221
3221
|
"img",
|
|
3222
3222
|
{
|
|
3223
|
-
src:
|
|
3223
|
+
src: _chunkR2HP743Tcjs.getChainIcon.call(void 0, targetChain),
|
|
3224
3224
|
alt: "",
|
|
3225
3225
|
style: { width: 16, height: 16, borderRadius: 3 }
|
|
3226
3226
|
}
|
|
3227
3227
|
),
|
|
3228
|
-
|
|
3228
|
+
_chunkR2HP743Tcjs.getChainName.call(void 0, targetChain)
|
|
3229
3229
|
]
|
|
3230
3230
|
}
|
|
3231
3231
|
)
|
|
@@ -3244,10 +3244,10 @@ function SolanaConfirmStep({
|
|
|
3244
3244
|
className: "rs-card-value",
|
|
3245
3245
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
3246
3246
|
children: [
|
|
3247
|
-
|
|
3247
|
+
_chunkR2HP743Tcjs.getTokenIcon.call(void 0, token.symbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3248
3248
|
"img",
|
|
3249
3249
|
{
|
|
3250
|
-
src:
|
|
3250
|
+
src: _chunkR2HP743Tcjs.getTokenIcon.call(void 0, token.symbol),
|
|
3251
3251
|
alt: "",
|
|
3252
3252
|
style: { width: 16, height: 16, borderRadius: "50%" }
|
|
3253
3253
|
}
|
|
@@ -3267,10 +3267,10 @@ function SolanaConfirmStep({
|
|
|
3267
3267
|
className: "rs-card-value",
|
|
3268
3268
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
3269
3269
|
children: [
|
|
3270
|
-
|
|
3270
|
+
_chunkR2HP743Tcjs.getTokenIcon.call(void 0, targetSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3271
3271
|
"img",
|
|
3272
3272
|
{
|
|
3273
|
-
src:
|
|
3273
|
+
src: _chunkR2HP743Tcjs.getTokenIcon.call(void 0, targetSymbol),
|
|
3274
3274
|
alt: "",
|
|
3275
3275
|
style: { width: 16, height: 16, borderRadius: "50%" }
|
|
3276
3276
|
}
|
|
@@ -3306,7 +3306,7 @@ function SolanaConfirmStep({
|
|
|
3306
3306
|
] })
|
|
3307
3307
|
] }),
|
|
3308
3308
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3309
|
-
|
|
3309
|
+
_chunkNFXJEOE6cjs.Button,
|
|
3310
3310
|
{
|
|
3311
3311
|
onClick: handleConfirm,
|
|
3312
3312
|
loading: isSubmitting,
|
|
@@ -3315,7 +3315,7 @@ function SolanaConfirmStep({
|
|
|
3315
3315
|
children: "Confirm Order"
|
|
3316
3316
|
}
|
|
3317
3317
|
) }),
|
|
3318
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3318
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNFXJEOE6cjs.PoweredBy, {})
|
|
3319
3319
|
] });
|
|
3320
3320
|
}
|
|
3321
3321
|
|
|
@@ -3343,7 +3343,7 @@ function DepositFlow({
|
|
|
3343
3343
|
postBridgeActions,
|
|
3344
3344
|
outputTokenRules,
|
|
3345
3345
|
rejectUnmapped,
|
|
3346
|
-
signerAddress =
|
|
3346
|
+
signerAddress = _chunkR2HP743Tcjs.DEFAULT_SIGNER_ADDRESS,
|
|
3347
3347
|
sessionChainIds,
|
|
3348
3348
|
forceRegister = false,
|
|
3349
3349
|
waitForFinalTx = true,
|
|
@@ -3367,14 +3367,14 @@ function DepositFlow({
|
|
|
3367
3367
|
onError,
|
|
3368
3368
|
debug
|
|
3369
3369
|
}) {
|
|
3370
|
-
const onStepChangeRef =
|
|
3371
|
-
const onTotalBalanceChangeRef =
|
|
3372
|
-
const onSmartAccountChangeRef =
|
|
3373
|
-
const onEventRef =
|
|
3374
|
-
const onDepositSubmittedRef =
|
|
3375
|
-
const onDepositCompleteRef =
|
|
3376
|
-
const onDepositFailedRef =
|
|
3377
|
-
const onErrorRef =
|
|
3370
|
+
const onStepChangeRef = _chunkNFXJEOE6cjs.useLatestRef.call(void 0, onStepChange);
|
|
3371
|
+
const onTotalBalanceChangeRef = _chunkNFXJEOE6cjs.useLatestRef.call(void 0, onTotalBalanceChange);
|
|
3372
|
+
const onSmartAccountChangeRef = _chunkNFXJEOE6cjs.useLatestRef.call(void 0, onSmartAccountChange);
|
|
3373
|
+
const onEventRef = _chunkNFXJEOE6cjs.useLatestRef.call(void 0, onEvent);
|
|
3374
|
+
const onDepositSubmittedRef = _chunkNFXJEOE6cjs.useLatestRef.call(void 0, onDepositSubmitted);
|
|
3375
|
+
const onDepositCompleteRef = _chunkNFXJEOE6cjs.useLatestRef.call(void 0, onDepositComplete);
|
|
3376
|
+
const onDepositFailedRef = _chunkNFXJEOE6cjs.useLatestRef.call(void 0, onDepositFailed);
|
|
3377
|
+
const onErrorRef = _chunkNFXJEOE6cjs.useLatestRef.call(void 0, onError);
|
|
3378
3378
|
const hasInitialReownSession = Boolean(
|
|
3379
3379
|
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _90 => _90.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _91 => _91.address]) : _optionalChain([reownWallet, 'optionalAccess', _92 => _92.address])
|
|
3380
3380
|
);
|
|
@@ -3394,13 +3394,13 @@ function DepositFlow({
|
|
|
3394
3394
|
flowModeRef.current = flowMode;
|
|
3395
3395
|
const logFlow = _react.useCallback.call(void 0,
|
|
3396
3396
|
(message, data) => {
|
|
3397
|
-
|
|
3397
|
+
_chunkNFXJEOE6cjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
|
|
3398
3398
|
},
|
|
3399
3399
|
[debug]
|
|
3400
3400
|
);
|
|
3401
3401
|
const logFlowError = _react.useCallback.call(void 0,
|
|
3402
3402
|
(message, error, data) => {
|
|
3403
|
-
|
|
3403
|
+
_chunkNFXJEOE6cjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
|
|
3404
3404
|
},
|
|
3405
3405
|
[debug]
|
|
3406
3406
|
);
|
|
@@ -3524,7 +3524,7 @@ function DepositFlow({
|
|
|
3524
3524
|
return {
|
|
3525
3525
|
ownerAddress: dappAddress,
|
|
3526
3526
|
walletClient: void 0,
|
|
3527
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
3527
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkNFXJEOE6cjs.getPublicClient.call(void 0, targetChain))),
|
|
3528
3528
|
switchChain: void 0
|
|
3529
3529
|
};
|
|
3530
3530
|
}
|
|
@@ -3533,7 +3533,7 @@ function DepositFlow({
|
|
|
3533
3533
|
return {
|
|
3534
3534
|
ownerAddress: dappWalletClient.account.address,
|
|
3535
3535
|
walletClient: dappWalletClient,
|
|
3536
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
3536
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkNFXJEOE6cjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
3537
3537
|
switchChain: dappSwitchChain
|
|
3538
3538
|
};
|
|
3539
3539
|
}
|
|
@@ -3547,7 +3547,7 @@ function DepositFlow({
|
|
|
3547
3547
|
return {
|
|
3548
3548
|
ownerAddress: dappAddress,
|
|
3549
3549
|
walletClient: void 0,
|
|
3550
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
3550
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkNFXJEOE6cjs.getPublicClient.call(void 0, targetChain))),
|
|
3551
3551
|
switchChain: void 0
|
|
3552
3552
|
};
|
|
3553
3553
|
}
|
|
@@ -3556,7 +3556,7 @@ function DepositFlow({
|
|
|
3556
3556
|
return {
|
|
3557
3557
|
ownerAddress: dappWalletClient.account.address,
|
|
3558
3558
|
walletClient: dappWalletClient,
|
|
3559
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
3559
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkNFXJEOE6cjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
3560
3560
|
switchChain: dappSwitchChain
|
|
3561
3561
|
};
|
|
3562
3562
|
}
|
|
@@ -3564,7 +3564,7 @@ function DepositFlow({
|
|
|
3564
3564
|
return {
|
|
3565
3565
|
ownerAddress: reownWallet.address,
|
|
3566
3566
|
walletClient: reownWallet.walletClient,
|
|
3567
|
-
publicClient: _nullishCoalesce(reownWallet.publicClient, () => (
|
|
3567
|
+
publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunkNFXJEOE6cjs.getPublicClient.call(void 0, targetChain))),
|
|
3568
3568
|
switchChain: reownWallet.switchChain
|
|
3569
3569
|
};
|
|
3570
3570
|
}
|
|
@@ -3602,7 +3602,7 @@ function DepositFlow({
|
|
|
3602
3602
|
return {
|
|
3603
3603
|
ownerAddress: dappAddress,
|
|
3604
3604
|
walletClient: void 0,
|
|
3605
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
3605
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkNFXJEOE6cjs.getPublicClient.call(void 0, targetChain))),
|
|
3606
3606
|
switchChain: void 0
|
|
3607
3607
|
};
|
|
3608
3608
|
}
|
|
@@ -3722,8 +3722,8 @@ function DepositFlow({
|
|
|
3722
3722
|
pred_balance: totalBalanceUsd
|
|
3723
3723
|
})]);
|
|
3724
3724
|
} else if (step.type === "deposit-address") {
|
|
3725
|
-
const chainName =
|
|
3726
|
-
const tokenSymbol =
|
|
3725
|
+
const chainName = _chunkR2HP743Tcjs.getChainName.call(void 0, targetChain);
|
|
3726
|
+
const tokenSymbol = _chunkR2HP743Tcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3727
3727
|
_optionalChain([onEventRef, 'access', _123 => _123.current, 'optionalCall', _124 => _124({
|
|
3728
3728
|
type: "deposit_modal_transfer_crypto_open",
|
|
3729
3729
|
default_chain: chainName,
|
|
@@ -3731,7 +3731,7 @@ function DepositFlow({
|
|
|
3731
3731
|
pred_balance: totalBalanceUsd
|
|
3732
3732
|
})]);
|
|
3733
3733
|
} else if (step.type === "amount" && stepSendToken) {
|
|
3734
|
-
const receiveSymbol =
|
|
3734
|
+
const receiveSymbol = _chunkR2HP743Tcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3735
3735
|
_optionalChain([onEventRef, 'access', _125 => _125.current, 'optionalCall', _126 => _126({
|
|
3736
3736
|
type: "deposit_modal_connected_wallet_enter_value_open",
|
|
3737
3737
|
send_token: stepSendToken,
|
|
@@ -3854,8 +3854,8 @@ function DepositFlow({
|
|
|
3854
3854
|
);
|
|
3855
3855
|
const handleSolanaAmountContinue = _react.useCallback.call(void 0,
|
|
3856
3856
|
(token, sourceAmount, inputAmountUsd) => {
|
|
3857
|
-
const targetSym =
|
|
3858
|
-
const isTargetStable =
|
|
3857
|
+
const targetSym = _chunkR2HP743Tcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3858
|
+
const isTargetStable = _chunkR2HP743Tcjs.isStablecoinSymbol.call(void 0, targetSym);
|
|
3859
3859
|
const targetTokenPriceUsd = isTargetStable ? 1 : getTokenPriceUsd(targetSym);
|
|
3860
3860
|
logFlow("solana:amount:continue", {
|
|
3861
3861
|
token: token.symbol,
|
|
@@ -3941,8 +3941,8 @@ function DepositFlow({
|
|
|
3941
3941
|
);
|
|
3942
3942
|
const handleAmountContinue = _react.useCallback.call(void 0,
|
|
3943
3943
|
(amount, targetAmount, balance, liquidityWarning) => {
|
|
3944
|
-
const targetSym =
|
|
3945
|
-
const isTargetStable =
|
|
3944
|
+
const targetSym = _chunkR2HP743Tcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3945
|
+
const isTargetStable = _chunkR2HP743Tcjs.isStablecoinSymbol.call(void 0, targetSym);
|
|
3946
3946
|
const targetTokenPriceUsd = isTargetStable ? 1 : getTokenPriceUsd(targetSym);
|
|
3947
3947
|
setStep((prev) => {
|
|
3948
3948
|
if (prev.type !== "amount") return prev;
|
|
@@ -4093,7 +4093,7 @@ function DepositFlow({
|
|
|
4093
4093
|
]);
|
|
4094
4094
|
if (showConnectStep) {
|
|
4095
4095
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4096
|
-
|
|
4096
|
+
_chunkNFXJEOE6cjs.ConnectStep,
|
|
4097
4097
|
{
|
|
4098
4098
|
walletOptions,
|
|
4099
4099
|
selectedWalletId: selectedWalletIdEffective,
|
|
@@ -4162,8 +4162,8 @@ function DepositFlow({
|
|
|
4162
4162
|
onDepositComplete: handleDepositComplete,
|
|
4163
4163
|
onDepositFailed: handleDepositFailed,
|
|
4164
4164
|
onCopyAddress: () => {
|
|
4165
|
-
const chainName =
|
|
4166
|
-
const tokenSymbol =
|
|
4165
|
+
const chainName = _chunkR2HP743Tcjs.getChainName.call(void 0, targetChain);
|
|
4166
|
+
const tokenSymbol = _chunkR2HP743Tcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
4167
4167
|
_optionalChain([onEvent, 'optionalCall', _150 => _150({
|
|
4168
4168
|
type: "deposit_modal_transfer_crypto_cta_click",
|
|
4169
4169
|
default_chain: chainName,
|
|
@@ -4279,7 +4279,7 @@ function DepositFlow({
|
|
|
4279
4279
|
) })
|
|
4280
4280
|
] }) : null,
|
|
4281
4281
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4282
|
-
|
|
4282
|
+
_chunkNFXJEOE6cjs.ProcessingStep,
|
|
4283
4283
|
{
|
|
4284
4284
|
smartAccount: step.smartAccount,
|
|
4285
4285
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
@@ -4314,7 +4314,7 @@ function DepositFlow({
|
|
|
4314
4314
|
if (_optionalChain([signerContext, 'access', _162 => _162.publicClient, 'access', _163 => _163.chain, 'optionalAccess', _164 => _164.id]) === chainId) {
|
|
4315
4315
|
return signerContext.publicClient;
|
|
4316
4316
|
}
|
|
4317
|
-
return
|
|
4317
|
+
return _chunkNFXJEOE6cjs.getPublicClient.call(void 0, chainId);
|
|
4318
4318
|
};
|
|
4319
4319
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
4320
4320
|
step.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -4371,7 +4371,7 @@ function DepositFlow({
|
|
|
4371
4371
|
service,
|
|
4372
4372
|
onContinue: handleAmountContinue,
|
|
4373
4373
|
onCtaClick: (ctaName) => {
|
|
4374
|
-
const receiveSymbol =
|
|
4374
|
+
const receiveSymbol = _chunkR2HP743Tcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
4375
4375
|
_optionalChain([onEvent, 'optionalCall', _165 => _165({
|
|
4376
4376
|
type: "deposit_modal_connected_wallet_enter_value_cta_click",
|
|
4377
4377
|
send_token: step.asset.symbol,
|
|
@@ -4404,7 +4404,7 @@ function DepositFlow({
|
|
|
4404
4404
|
}
|
|
4405
4405
|
),
|
|
4406
4406
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4407
|
-
|
|
4407
|
+
_chunkNFXJEOE6cjs.ProcessingStep,
|
|
4408
4408
|
{
|
|
4409
4409
|
smartAccount: step.smartAccount,
|
|
4410
4410
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
@@ -4462,8 +4462,8 @@ function formatTimestamp2(iso) {
|
|
|
4462
4462
|
function resolveChainId(value) {
|
|
4463
4463
|
if (value === void 0 || value === null) return null;
|
|
4464
4464
|
if (typeof value === "number") return value;
|
|
4465
|
-
if (
|
|
4466
|
-
const parsed =
|
|
4465
|
+
if (_chunkNFXJEOE6cjs.isSolanaCaip2.call(void 0, value) || value === "solana") return "solana";
|
|
4466
|
+
const parsed = _chunkNFXJEOE6cjs.parseEvmChainId.call(void 0, value);
|
|
4467
4467
|
if (parsed !== null) return parsed;
|
|
4468
4468
|
const num = Number(value);
|
|
4469
4469
|
return Number.isFinite(num) ? num : null;
|
|
@@ -4481,7 +4481,7 @@ function resolveTokenSymbol(token, chainId) {
|
|
|
4481
4481
|
}
|
|
4482
4482
|
}
|
|
4483
4483
|
if (chainId !== null && chainId !== void 0 && chainId !== "solana" && /^0x[a-fA-F0-9]{40}$/.test(token)) {
|
|
4484
|
-
const sym =
|
|
4484
|
+
const sym = _chunkR2HP743Tcjs.getTokenSymbol.call(void 0, token, chainId);
|
|
4485
4485
|
if (sym !== "Token") return sym;
|
|
4486
4486
|
}
|
|
4487
4487
|
return shortenHash(token);
|
|
@@ -4501,7 +4501,7 @@ function formatAmount(rawAmount, token, chainId) {
|
|
|
4501
4501
|
decimals = 9;
|
|
4502
4502
|
}
|
|
4503
4503
|
} else if (/^0x[a-fA-F0-9]{40}$/.test(token)) {
|
|
4504
|
-
decimals =
|
|
4504
|
+
decimals = _chunkR2HP743Tcjs.getTokenDecimalsByAddress.call(void 0, token, chainId);
|
|
4505
4505
|
}
|
|
4506
4506
|
}
|
|
4507
4507
|
try {
|
|
@@ -4520,7 +4520,7 @@ function formatAmount(rawAmount, token, chainId) {
|
|
|
4520
4520
|
}
|
|
4521
4521
|
function getTxExplorerUrl(txHash, chainId) {
|
|
4522
4522
|
if (!chainId) return null;
|
|
4523
|
-
const base =
|
|
4523
|
+
const base = _chunkR2HP743Tcjs.getExplorerUrl.call(void 0, chainId);
|
|
4524
4524
|
if (!base) return null;
|
|
4525
4525
|
return `${base}/tx/${txHash}`;
|
|
4526
4526
|
}
|
|
@@ -4622,10 +4622,10 @@ function HistoryRow({ deposit }) {
|
|
|
4622
4622
|
const status = normalizeStatus(deposit.status, deposit.isSpam);
|
|
4623
4623
|
const sourceChainId = resolveChainId(deposit.chain);
|
|
4624
4624
|
const targetChainId = resolveChainId(deposit.targetChain);
|
|
4625
|
-
const sourceChainName = sourceChainId ?
|
|
4626
|
-
const targetChainName = targetChainId ?
|
|
4627
|
-
const sourceChainIcon = sourceChainId ?
|
|
4628
|
-
const targetChainIcon = targetChainId ?
|
|
4625
|
+
const sourceChainName = sourceChainId ? _chunkR2HP743Tcjs.getChainName.call(void 0, sourceChainId) : null;
|
|
4626
|
+
const targetChainName = targetChainId ? _chunkR2HP743Tcjs.getChainName.call(void 0, targetChainId) : null;
|
|
4627
|
+
const sourceChainIcon = sourceChainId ? _chunkR2HP743Tcjs.getChainIcon.call(void 0, sourceChainId) : void 0;
|
|
4628
|
+
const targetChainIcon = targetChainId ? _chunkR2HP743Tcjs.getChainIcon.call(void 0, targetChainId) : void 0;
|
|
4629
4629
|
const sourceSymbol = resolveTokenSymbol(deposit.token, sourceChainId);
|
|
4630
4630
|
const targetSymbol = resolveTokenSymbol(deposit.targetToken, targetChainId);
|
|
4631
4631
|
const rawAmount = _nullishCoalesce(deposit.sourceAmount, () => ( deposit.amount));
|
|
@@ -4700,7 +4700,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
|
4700
4700
|
// src/DepositModal.tsx
|
|
4701
4701
|
|
|
4702
4702
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
4703
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
4703
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-2UMPITRN.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
4704
4704
|
);
|
|
4705
4705
|
function sortByCreatedAtDesc(items) {
|
|
4706
4706
|
return [...items].sort((a, b) => {
|
|
@@ -4748,9 +4748,9 @@ function DepositModalInner({
|
|
|
4748
4748
|
sourceToken,
|
|
4749
4749
|
defaultAmount,
|
|
4750
4750
|
recipient,
|
|
4751
|
-
backendUrl =
|
|
4751
|
+
backendUrl = _chunkR2HP743Tcjs.DEFAULT_BACKEND_URL,
|
|
4752
4752
|
solanaRpcUrl,
|
|
4753
|
-
signerAddress =
|
|
4753
|
+
signerAddress = _chunkR2HP743Tcjs.DEFAULT_SIGNER_ADDRESS,
|
|
4754
4754
|
sessionChainIds,
|
|
4755
4755
|
forceRegister = false,
|
|
4756
4756
|
waitForFinalTx = true,
|
|
@@ -4778,7 +4778,7 @@ function DepositModalInner({
|
|
|
4778
4778
|
debug
|
|
4779
4779
|
}) {
|
|
4780
4780
|
const modalRef = _react.useRef.call(void 0, null);
|
|
4781
|
-
const onReadyRef =
|
|
4781
|
+
const onReadyRef = _chunkNFXJEOE6cjs.useLatestRef.call(void 0, onReady);
|
|
4782
4782
|
const [currentStepIndex, setCurrentStepIndex] = _react.useState.call(void 0, 0);
|
|
4783
4783
|
const [totalBalanceUsd, setTotalBalanceUsd] = _react.useState.call(void 0, null);
|
|
4784
4784
|
const backHandlerRef = _react.useRef.call(void 0, void 0);
|
|
@@ -4797,10 +4797,10 @@ function DepositModalInner({
|
|
|
4797
4797
|
const solanaCursorRef = _react.useRef.call(void 0, null);
|
|
4798
4798
|
const historyStaleRef = _react.useRef.call(void 0, false);
|
|
4799
4799
|
const historyLoadedRef = _react.useRef.call(void 0, false);
|
|
4800
|
-
const targetChain =
|
|
4801
|
-
const sourceChain = sourceChainProp ?
|
|
4800
|
+
const targetChain = _chunkR2HP743Tcjs.getChainId.call(void 0, targetChainProp);
|
|
4801
|
+
const sourceChain = sourceChainProp ? _chunkR2HP743Tcjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
4802
4802
|
const service = _react.useMemo.call(void 0,
|
|
4803
|
-
() =>
|
|
4803
|
+
() => _chunkNFXJEOE6cjs.createDepositService.call(void 0, backendUrl, {
|
|
4804
4804
|
debug,
|
|
4805
4805
|
debugScope: "service:deposit"
|
|
4806
4806
|
}),
|
|
@@ -4808,7 +4808,7 @@ function DepositModalInner({
|
|
|
4808
4808
|
);
|
|
4809
4809
|
_react.useEffect.call(void 0, () => {
|
|
4810
4810
|
if (isOpen && modalRef.current) {
|
|
4811
|
-
|
|
4811
|
+
_chunkNFXJEOE6cjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
4812
4812
|
}
|
|
4813
4813
|
}, [isOpen, theme]);
|
|
4814
4814
|
_react.useEffect.call(void 0, () => {
|
|
@@ -4940,9 +4940,9 @@ function DepositModalInner({
|
|
|
4940
4940
|
fetchHistory("initial");
|
|
4941
4941
|
}
|
|
4942
4942
|
}, [historyOpen, fetchHistory]);
|
|
4943
|
-
const onDepositSubmittedRef =
|
|
4944
|
-
const onDepositCompleteRef =
|
|
4945
|
-
const onDepositFailedRef =
|
|
4943
|
+
const onDepositSubmittedRef = _chunkNFXJEOE6cjs.useLatestRef.call(void 0, onDepositSubmitted);
|
|
4944
|
+
const onDepositCompleteRef = _chunkNFXJEOE6cjs.useLatestRef.call(void 0, onDepositComplete);
|
|
4945
|
+
const onDepositFailedRef = _chunkNFXJEOE6cjs.useLatestRef.call(void 0, onDepositFailed);
|
|
4946
4946
|
const handleDepositSubmitted = _react.useCallback.call(void 0,
|
|
4947
4947
|
(data) => {
|
|
4948
4948
|
_optionalChain([onDepositSubmittedRef, 'access', _172 => _172.current, 'optionalCall', _173 => _173(data)]);
|
|
@@ -4986,7 +4986,7 @@ function DepositModalInner({
|
|
|
4986
4986
|
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _183 => _183.title]), () => ( "Deposit"));
|
|
4987
4987
|
const canGoBack = currentStepIndex > 0 && currentStepIndex < 4 && backHandlerRef.current !== void 0;
|
|
4988
4988
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4989
|
-
|
|
4989
|
+
_chunkNFXJEOE6cjs.Modal,
|
|
4990
4990
|
{
|
|
4991
4991
|
isOpen,
|
|
4992
4992
|
onClose,
|
|
@@ -5079,7 +5079,7 @@ function DepositModalInner({
|
|
|
5079
5079
|
balance.title,
|
|
5080
5080
|
":"
|
|
5081
5081
|
] }),
|
|
5082
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ?
|
|
5082
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ? _chunkNFXJEOE6cjs.currencyFormatter.format(totalBalanceUsd) : null))) })
|
|
5083
5083
|
] })
|
|
5084
5084
|
] }),
|
|
5085
5085
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
|