@rhinestone/deposit-modal 0.1.68 → 0.1.70
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-WXFTSZSK.cjs → DepositModalReown-66DE7NAY.cjs} +6 -6
- package/dist/{DepositModalReown-RYCOXWMH.mjs → DepositModalReown-PROPLCBI.mjs} +3 -3
- package/dist/{WithdrawModalReown-WHPQDJJJ.cjs → WithdrawModalReown-HXTXSZCJ.cjs} +6 -6
- package/dist/{WithdrawModalReown-6VYKKKJN.mjs → WithdrawModalReown-URF6AERQ.mjs} +3 -3
- package/dist/{chunk-IUW3SJQT.mjs → chunk-3CRG5NPG.mjs} +128 -16
- package/dist/{chunk-MBURQ26S.mjs → chunk-5YXAQB6A.mjs} +10 -0
- package/dist/{chunk-OEB25YZ4.mjs → chunk-7NEVAAPY.mjs} +145 -20
- package/dist/{chunk-LTLFJPHO.cjs → chunk-7TEGUTU4.cjs} +52 -47
- package/dist/{chunk-5FDIQNJJ.mjs → chunk-TKTOPC2W.mjs} +12 -7
- package/dist/{chunk-J7ILKS5N.cjs → chunk-UHQSFV5V.cjs} +248 -123
- package/dist/{chunk-FLVSQDP4.cjs → chunk-XW4M7WDI.cjs} +196 -84
- package/dist/{chunk-N2Y34LQO.cjs → chunk-YQFH2WSW.cjs} +11 -1
- package/dist/deposit.cjs +3 -3
- package/dist/deposit.mjs +2 -2
- package/dist/index.cjs +8 -4
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +7 -3
- package/dist/reown.cjs +8 -4
- package/dist/reown.d.cts +4 -0
- package/dist/reown.d.ts +4 -0
- package/dist/reown.mjs +8 -4
- package/dist/styles.css +5 -5
- package/dist/withdraw.cjs +3 -3
- package/dist/withdraw.mjs +2 -2
- package/package.json +1 -1
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
var
|
|
31
|
+
var _chunkXW4M7WDIcjs = require('./chunk-XW4M7WDI.cjs');
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
@@ -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 = _chunkXW4M7WDIcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
72
72
|
if (localOwner) {
|
|
73
73
|
return {
|
|
74
|
-
account:
|
|
74
|
+
account: _chunkXW4M7WDIcjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
75
75
|
address: localOwner.address
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
const created =
|
|
79
|
-
|
|
78
|
+
const created = _chunkXW4M7WDIcjs.createSessionOwnerKey.call(void 0, );
|
|
79
|
+
_chunkXW4M7WDIcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
80
80
|
return {
|
|
81
81
|
account: created.account,
|
|
82
82
|
address: created.address
|
|
@@ -115,10 +115,12 @@ function SetupStep({
|
|
|
115
115
|
const setup = await service.setupAccount({
|
|
116
116
|
ownerAddress: address,
|
|
117
117
|
sessionOwnerAddress: sessionOwner.address,
|
|
118
|
-
targetChain:
|
|
118
|
+
targetChain: _chunkXW4M7WDIcjs.toEvmCaip2.call(void 0, targetChain),
|
|
119
119
|
targetToken,
|
|
120
120
|
recipient,
|
|
121
121
|
postBridgeActions,
|
|
122
|
+
outputTokenRules,
|
|
123
|
+
rejectUnmapped,
|
|
122
124
|
signerAddress,
|
|
123
125
|
sessionChainIds,
|
|
124
126
|
forceRegister
|
|
@@ -147,7 +149,7 @@ function SetupStep({
|
|
|
147
149
|
primaryType: typedData.primaryType,
|
|
148
150
|
message: typedData.message
|
|
149
151
|
});
|
|
150
|
-
const sessionDetails =
|
|
152
|
+
const sessionDetails = _chunkXW4M7WDIcjs.buildSessionDetails.call(void 0, setup.sessionDetailsUnsigned, signature);
|
|
151
153
|
setState({ type: "registering" });
|
|
152
154
|
const registerResult = await service.registerAccount({
|
|
153
155
|
address: smartAccount,
|
|
@@ -159,7 +161,7 @@ function SetupStep({
|
|
|
159
161
|
eoaAddress: address,
|
|
160
162
|
sessionOwner: sessionOwner.address,
|
|
161
163
|
target: {
|
|
162
|
-
chain:
|
|
164
|
+
chain: _chunkXW4M7WDIcjs.toEvmCaip2.call(void 0, targetChain),
|
|
163
165
|
token: targetToken,
|
|
164
166
|
...recipient && { recipient },
|
|
165
167
|
..._optionalChain([postBridgeActions, 'optionalAccess', _2 => _2.length]) && { postBridgeActions },
|
|
@@ -187,6 +189,8 @@ function SetupStep({
|
|
|
187
189
|
sessionChainIds,
|
|
188
190
|
recipient,
|
|
189
191
|
postBridgeActions,
|
|
192
|
+
outputTokenRules,
|
|
193
|
+
rejectUnmapped,
|
|
190
194
|
forceRegister,
|
|
191
195
|
enableSolana,
|
|
192
196
|
service,
|
|
@@ -226,7 +230,7 @@ function SetupStep({
|
|
|
226
230
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
227
231
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", children: [
|
|
228
232
|
isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
229
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
233
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXW4M7WDIcjs.Spinner, { className: "rs-spinner--lg rs-text-accent" }),
|
|
230
234
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-text", children: [
|
|
231
235
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-title", children: renderStateMessage() }),
|
|
232
236
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-subtitle", children: "This may take a moment" })
|
|
@@ -263,7 +267,7 @@ function SetupStep({
|
|
|
263
267
|
] })
|
|
264
268
|
] })
|
|
265
269
|
] }),
|
|
266
|
-
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, _chunkXW4M7WDIcjs.Button, { onClick: handleRetry, variant: "default", fullWidth: true, children: "Try Again" }) })
|
|
267
271
|
] });
|
|
268
272
|
}
|
|
269
273
|
|
|
@@ -289,7 +293,7 @@ function AssetSelectStep({
|
|
|
289
293
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
290
294
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
291
295
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
292
|
-
return
|
|
296
|
+
return _chunkXW4M7WDIcjs.getAssetId.call(void 0, {
|
|
293
297
|
chainId: defaultSourceChain,
|
|
294
298
|
token: defaultSourceToken
|
|
295
299
|
});
|
|
@@ -306,7 +310,7 @@ function AssetSelectStep({
|
|
|
306
310
|
try {
|
|
307
311
|
const portfolio = await service.fetchPortfolio(address);
|
|
308
312
|
if (!active) return;
|
|
309
|
-
const portfolioAssets =
|
|
313
|
+
const portfolioAssets = _chunkXW4M7WDIcjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
310
314
|
setAssets(portfolioAssets);
|
|
311
315
|
const hasNative = portfolioAssets.some(
|
|
312
316
|
(asset) => asset.token.toLowerCase() === _chunkMUWVDVY4cjs.NATIVE_TOKEN_ADDRESS
|
|
@@ -387,7 +391,7 @@ function AssetSelectStep({
|
|
|
387
391
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
388
392
|
const numeric = Number(raw);
|
|
389
393
|
if (!Number.isFinite(numeric)) return raw;
|
|
390
|
-
return
|
|
394
|
+
return _chunkXW4M7WDIcjs.tokenFormatter.format(numeric);
|
|
391
395
|
} catch (e3) {
|
|
392
396
|
return asset.balance;
|
|
393
397
|
}
|
|
@@ -401,7 +405,7 @@ function AssetSelectStep({
|
|
|
401
405
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
402
406
|
children: [
|
|
403
407
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
404
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
408
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXW4M7WDIcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
405
409
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
406
410
|
] }),
|
|
407
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 }) }),
|
|
@@ -500,7 +504,7 @@ function AssetSelectStep({
|
|
|
500
504
|
] })
|
|
501
505
|
] })
|
|
502
506
|
] }),
|
|
503
|
-
/* @__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 ? _chunkXW4M7WDIcjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
504
508
|
]
|
|
505
509
|
},
|
|
506
510
|
asset.id
|
|
@@ -510,7 +514,7 @@ function AssetSelectStep({
|
|
|
510
514
|
}
|
|
511
515
|
),
|
|
512
516
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
513
|
-
|
|
517
|
+
_chunkXW4M7WDIcjs.Button,
|
|
514
518
|
{
|
|
515
519
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
516
520
|
disabled: !selectedAsset,
|
|
@@ -518,7 +522,7 @@ function AssetSelectStep({
|
|
|
518
522
|
children: "Continue"
|
|
519
523
|
}
|
|
520
524
|
) }),
|
|
521
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
525
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXW4M7WDIcjs.PoweredBy, {})
|
|
522
526
|
] });
|
|
523
527
|
}
|
|
524
528
|
async function fetchNativeAssets(address, publicClient, existing) {
|
|
@@ -526,7 +530,7 @@ async function fetchNativeAssets(address, publicClient, existing) {
|
|
|
526
530
|
const connectedChainId = _optionalChain([publicClient, 'access', _12 => _12.chain, 'optionalAccess', _13 => _13.id]);
|
|
527
531
|
if (!connectedChainId) return [];
|
|
528
532
|
if (!_chunkMUWVDVY4cjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
|
|
529
|
-
const id =
|
|
533
|
+
const id = _chunkXW4M7WDIcjs.getAssetId.call(void 0, {
|
|
530
534
|
chainId: connectedChainId,
|
|
531
535
|
token: _chunkMUWVDVY4cjs.NATIVE_TOKEN_ADDRESS
|
|
532
536
|
});
|
|
@@ -578,12 +582,14 @@ function AmountStep({
|
|
|
578
582
|
tokenPriceUsdOverride,
|
|
579
583
|
onBalanceUsdChange,
|
|
580
584
|
onContinue,
|
|
581
|
-
onCtaClick
|
|
585
|
+
onCtaClick,
|
|
586
|
+
service
|
|
582
587
|
}) {
|
|
583
588
|
const [amount, setAmount] = _react.useState.call(void 0, "");
|
|
584
589
|
const [balance, setBalance] = _react.useState.call(void 0, null);
|
|
585
590
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
586
591
|
const [isSwitching, setIsSwitching] = _react.useState.call(void 0, false);
|
|
592
|
+
const [isCheckingLiquidity, setIsCheckingLiquidity] = _react.useState.call(void 0, false);
|
|
587
593
|
const hasAttemptedSwitch = _react.useRef.call(void 0, false);
|
|
588
594
|
const chainMismatch = Boolean(
|
|
589
595
|
_optionalChain([walletClient, 'optionalAccess', _14 => _14.chain, 'optionalAccess', _15 => _15.id]) && walletClient.chain.id !== asset.chainId
|
|
@@ -613,7 +619,7 @@ function AmountStep({
|
|
|
613
619
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
614
620
|
if (!balanceTarget || !publicClient) return;
|
|
615
621
|
try {
|
|
616
|
-
const bal =
|
|
622
|
+
const bal = _chunkXW4M7WDIcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
617
623
|
address: asset.token,
|
|
618
624
|
abi: _viem.erc20Abi,
|
|
619
625
|
functionName: "balanceOf",
|
|
@@ -639,7 +645,7 @@ function AmountStep({
|
|
|
639
645
|
setIsSwitching(true);
|
|
640
646
|
switchChain(asset.chainId).catch((err) => {
|
|
641
647
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
642
|
-
setError(
|
|
648
|
+
setError(_chunkXW4M7WDIcjs.formatUserError.call(void 0, raw));
|
|
643
649
|
}).finally(() => {
|
|
644
650
|
setIsSwitching(false);
|
|
645
651
|
});
|
|
@@ -675,7 +681,7 @@ function AmountStep({
|
|
|
675
681
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
676
682
|
const numeric = Number(raw);
|
|
677
683
|
if (!Number.isFinite(numeric)) return raw;
|
|
678
|
-
return
|
|
684
|
+
return _chunkXW4M7WDIcjs.tokenFormatter.format(numeric);
|
|
679
685
|
} catch (e8) {
|
|
680
686
|
return "...";
|
|
681
687
|
}
|
|
@@ -703,7 +709,7 @@ function AmountStep({
|
|
|
703
709
|
}
|
|
704
710
|
if (error) setError(null);
|
|
705
711
|
};
|
|
706
|
-
const handleContinue = () => {
|
|
712
|
+
const handleContinue = async () => {
|
|
707
713
|
const numericAmount = parseFloat(amount);
|
|
708
714
|
if (isNaN(numericAmount) || numericAmount <= 0) {
|
|
709
715
|
setError("Please enter a valid amount");
|
|
@@ -719,7 +725,7 @@ function AmountStep({
|
|
|
719
725
|
const usdValue = numericAmount;
|
|
720
726
|
if (_optionalChain([uiConfig, 'optionalAccess', _18 => _18.maxDepositUsd]) && usdValue > uiConfig.maxDepositUsd) {
|
|
721
727
|
setError(
|
|
722
|
-
`Maximum deposit is ${
|
|
728
|
+
`Maximum deposit is ${_chunkXW4M7WDIcjs.currencyFormatter.format(uiConfig.maxDepositUsd)}`
|
|
723
729
|
);
|
|
724
730
|
return;
|
|
725
731
|
}
|
|
@@ -743,7 +749,34 @@ function AmountStep({
|
|
|
743
749
|
}
|
|
744
750
|
setError(null);
|
|
745
751
|
_optionalChain([onCtaClick, 'optionalCall', _20 => _20("continue")]);
|
|
746
|
-
|
|
752
|
+
setIsCheckingLiquidity(true);
|
|
753
|
+
let liquidityWarning;
|
|
754
|
+
try {
|
|
755
|
+
const liquidity = await service.checkLiquidity({
|
|
756
|
+
sourceChainId: asset.chainId,
|
|
757
|
+
sourceToken: asset.token,
|
|
758
|
+
destinationChainId: targetChain,
|
|
759
|
+
destinationToken: targetToken,
|
|
760
|
+
amount: amountInUnits.toString()
|
|
761
|
+
});
|
|
762
|
+
if (liquidity.unlimited || liquidity.hasLiquidity) {
|
|
763
|
+
liquidityWarning = void 0;
|
|
764
|
+
} else if (liquidity.maxAmount !== null) {
|
|
765
|
+
liquidityWarning = {
|
|
766
|
+
kind: "low",
|
|
767
|
+
maxAmount: liquidity.maxAmount,
|
|
768
|
+
decimals: liquidity.decimals,
|
|
769
|
+
symbol: liquidity.symbol
|
|
770
|
+
};
|
|
771
|
+
} else {
|
|
772
|
+
liquidityWarning = { kind: "unavailable" };
|
|
773
|
+
}
|
|
774
|
+
} catch (e11) {
|
|
775
|
+
liquidityWarning = { kind: "check-failed" };
|
|
776
|
+
} finally {
|
|
777
|
+
setIsCheckingLiquidity(false);
|
|
778
|
+
}
|
|
779
|
+
onContinue(tokenAmountStr, amount, _nullishCoalesce(balance, () => ( void 0)), liquidityWarning);
|
|
747
780
|
};
|
|
748
781
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
749
782
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step-body", style: { paddingTop: 0 }, children: [
|
|
@@ -774,7 +807,7 @@ function AmountStep({
|
|
|
774
807
|
hasPricing && balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { style: { color: "var(--rs-muted-foreground)" }, children: [
|
|
775
808
|
" ",
|
|
776
809
|
"(",
|
|
777
|
-
|
|
810
|
+
_chunkXW4M7WDIcjs.currencyFormatter.format(balanceUsd),
|
|
778
811
|
")"
|
|
779
812
|
] })
|
|
780
813
|
] }) })
|
|
@@ -911,7 +944,7 @@ function AmountStep({
|
|
|
911
944
|
)
|
|
912
945
|
] }),
|
|
913
946
|
_optionalChain([uiConfig, 'optionalAccess', _21 => _21.minDepositUsd]) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-minimum", children: [
|
|
914
|
-
|
|
947
|
+
_chunkXW4M7WDIcjs.currencyFormatter.format(uiConfig.minDepositUsd),
|
|
915
948
|
" minimum deposit"
|
|
916
949
|
] }),
|
|
917
950
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", children: [
|
|
@@ -937,15 +970,15 @@ function AmountStep({
|
|
|
937
970
|
] })
|
|
938
971
|
] }),
|
|
939
972
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
940
|
-
|
|
973
|
+
_chunkXW4M7WDIcjs.Button,
|
|
941
974
|
{
|
|
942
975
|
onClick: handleContinue,
|
|
943
976
|
fullWidth: true,
|
|
944
|
-
disabled: !amount || chainMismatch,
|
|
945
|
-
children: _optionalChain([uiConfig, 'optionalAccess', _22 => _22.minDepositUsd]) && parseFloat(amount) > 0 && parseFloat(amount) < uiConfig.minDepositUsd ? "Update order" : "Continue"
|
|
977
|
+
disabled: !amount || chainMismatch || isCheckingLiquidity,
|
|
978
|
+
children: isCheckingLiquidity ? "Checking liquidity\u2026" : _optionalChain([uiConfig, 'optionalAccess', _22 => _22.minDepositUsd]) && parseFloat(amount) > 0 && parseFloat(amount) < uiConfig.minDepositUsd ? "Update order" : "Continue"
|
|
946
979
|
}
|
|
947
980
|
) }),
|
|
948
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
981
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXW4M7WDIcjs.PoweredBy, {})
|
|
949
982
|
] });
|
|
950
983
|
}
|
|
951
984
|
|
|
@@ -966,6 +999,7 @@ function ConfirmStep({
|
|
|
966
999
|
targetChain,
|
|
967
1000
|
targetToken,
|
|
968
1001
|
switchChain,
|
|
1002
|
+
liquidityWarning,
|
|
969
1003
|
onConfirm,
|
|
970
1004
|
onError,
|
|
971
1005
|
onDepositSubmitted
|
|
@@ -995,7 +1029,7 @@ function ConfirmStep({
|
|
|
995
1029
|
setIsSwitching(true);
|
|
996
1030
|
switchChain(asset.chainId).catch((err) => {
|
|
997
1031
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
998
|
-
setError(
|
|
1032
|
+
setError(_chunkXW4M7WDIcjs.formatUserError.call(void 0, raw));
|
|
999
1033
|
}).finally(() => {
|
|
1000
1034
|
setIsSwitching(false);
|
|
1001
1035
|
});
|
|
@@ -1021,7 +1055,7 @@ function ConfirmStep({
|
|
|
1021
1055
|
let amountUnits;
|
|
1022
1056
|
try {
|
|
1023
1057
|
amountUnits = _viem.parseUnits.call(void 0, amount, asset.decimals);
|
|
1024
|
-
} catch (
|
|
1058
|
+
} catch (e12) {
|
|
1025
1059
|
setError("Please enter a valid amount");
|
|
1026
1060
|
return;
|
|
1027
1061
|
}
|
|
@@ -1038,7 +1072,7 @@ function ConfirmStep({
|
|
|
1038
1072
|
throw new Error("Wallet not properly connected");
|
|
1039
1073
|
}
|
|
1040
1074
|
const transferTo = sameRoute ? recipient : smartAccount;
|
|
1041
|
-
const hash =
|
|
1075
|
+
const hash = _chunkXW4M7WDIcjs.isNativeAsset.call(void 0, asset) ? await walletClient.sendTransaction({
|
|
1042
1076
|
account,
|
|
1043
1077
|
chain,
|
|
1044
1078
|
to: transferTo,
|
|
@@ -1055,7 +1089,7 @@ function ConfirmStep({
|
|
|
1055
1089
|
onConfirm(hash, asset.chainId, amountUnits.toString(), asset.token);
|
|
1056
1090
|
} catch (err) {
|
|
1057
1091
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
1058
|
-
const message =
|
|
1092
|
+
const message = _chunkXW4M7WDIcjs.formatUserError.call(void 0, raw);
|
|
1059
1093
|
setError(message);
|
|
1060
1094
|
_optionalChain([onError, 'optionalCall', _26 => _26(message, "TRANSFER_ERROR")]);
|
|
1061
1095
|
} finally {
|
|
@@ -1161,6 +1195,19 @@ function ConfirmStep({
|
|
|
1161
1195
|
)
|
|
1162
1196
|
] })
|
|
1163
1197
|
] }),
|
|
1198
|
+
liquidityWarning && (liquidityWarning.kind === "unavailable" || liquidityWarning.kind === "check-failed") && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1199
|
+
"div",
|
|
1200
|
+
{
|
|
1201
|
+
style: {
|
|
1202
|
+
fontSize: 11,
|
|
1203
|
+
color: "var(--color-amber8)",
|
|
1204
|
+
marginTop: 8,
|
|
1205
|
+
textAlign: "center",
|
|
1206
|
+
opacity: 0.85
|
|
1207
|
+
},
|
|
1208
|
+
children: liquidityWarning.kind === "unavailable" ? "Route may be unavailable" : "Liquidity check failed"
|
|
1209
|
+
}
|
|
1210
|
+
),
|
|
1164
1211
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-alert rs-alert--error", children: [
|
|
1165
1212
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1166
1213
|
"svg",
|
|
@@ -1184,7 +1231,7 @@ function ConfirmStep({
|
|
|
1184
1231
|
] })
|
|
1185
1232
|
] }),
|
|
1186
1233
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1187
|
-
|
|
1234
|
+
_chunkXW4M7WDIcjs.Button,
|
|
1188
1235
|
{
|
|
1189
1236
|
onClick: handleConfirm,
|
|
1190
1237
|
loading: isSubmitting,
|
|
@@ -1193,13 +1240,14 @@ function ConfirmStep({
|
|
|
1193
1240
|
children: "Confirm Order"
|
|
1194
1241
|
}
|
|
1195
1242
|
) }),
|
|
1196
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1243
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXW4M7WDIcjs.PoweredBy, {})
|
|
1197
1244
|
] });
|
|
1198
1245
|
}
|
|
1199
1246
|
|
|
1200
1247
|
// src/components/steps/DepositAddressStep.tsx
|
|
1201
1248
|
|
|
1202
1249
|
|
|
1250
|
+
|
|
1203
1251
|
// src/components/ui/QRCode.tsx
|
|
1204
1252
|
var _reactqrcodelogo = require('react-qrcode-logo');
|
|
1205
1253
|
|
|
@@ -1330,9 +1378,9 @@ var INITIAL_POLL_INTERVAL = 3e3;
|
|
|
1330
1378
|
var MAX_POLL_INTERVAL = 3e4;
|
|
1331
1379
|
var BACKOFF_MULTIPLIER = 1.5;
|
|
1332
1380
|
function isEventForTx(event, txHash) {
|
|
1333
|
-
const eventTxHash =
|
|
1381
|
+
const eventTxHash = _chunkXW4M7WDIcjs.getEventTxHash.call(void 0, event);
|
|
1334
1382
|
if (!eventTxHash) return false;
|
|
1335
|
-
return
|
|
1383
|
+
return _chunkXW4M7WDIcjs.txRefsMatch.call(void 0, eventTxHash, txHash);
|
|
1336
1384
|
}
|
|
1337
1385
|
function truncateHash(hash) {
|
|
1338
1386
|
return `${hash.slice(0, 4)}\u2026${hash.slice(-4)}`;
|
|
@@ -1426,7 +1474,7 @@ function DepositNotification({
|
|
|
1426
1474
|
const pollIntervalRef = _react.useRef.call(void 0, INITIAL_POLL_INTERVAL);
|
|
1427
1475
|
const pollTimeoutRef = _react.useRef.call(void 0, null);
|
|
1428
1476
|
const completedRef = _react.useRef.call(void 0, _nullishCoalesce(directTransfer, () => ( false)));
|
|
1429
|
-
const depositContextRef =
|
|
1477
|
+
const depositContextRef = _chunkXW4M7WDIcjs.useLatestRef.call(void 0, {
|
|
1430
1478
|
amount,
|
|
1431
1479
|
sourceChain,
|
|
1432
1480
|
sourceToken: token,
|
|
@@ -1435,8 +1483,8 @@ function DepositNotification({
|
|
|
1435
1483
|
waitForFinalTx,
|
|
1436
1484
|
hasPostBridgeActions
|
|
1437
1485
|
});
|
|
1438
|
-
const onCompleteRef =
|
|
1439
|
-
const onFailedRef =
|
|
1486
|
+
const onCompleteRef = _chunkXW4M7WDIcjs.useLatestRef.call(void 0, onComplete);
|
|
1487
|
+
const onFailedRef = _chunkXW4M7WDIcjs.useLatestRef.call(void 0, onFailed);
|
|
1440
1488
|
const handleComplete = _react.useCallback.call(void 0,
|
|
1441
1489
|
(destTxHash) => {
|
|
1442
1490
|
if (completedRef.current) return;
|
|
@@ -1506,7 +1554,7 @@ function DepositNotification({
|
|
|
1506
1554
|
return;
|
|
1507
1555
|
}
|
|
1508
1556
|
scheduleNextPoll();
|
|
1509
|
-
} catch (
|
|
1557
|
+
} catch (e13) {
|
|
1510
1558
|
scheduleNextPoll();
|
|
1511
1559
|
}
|
|
1512
1560
|
}
|
|
@@ -1573,7 +1621,7 @@ function DepositNotification({
|
|
|
1573
1621
|
}
|
|
1574
1622
|
)
|
|
1575
1623
|
}
|
|
1576
|
-
) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--processing", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1624
|
+
) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--processing", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXW4M7WDIcjs.Spinner, {}) });
|
|
1577
1625
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1578
1626
|
"div",
|
|
1579
1627
|
{
|
|
@@ -1945,6 +1993,59 @@ function DepositAddressStep({
|
|
|
1945
1993
|
sourceSymbol: sourceTokenSymbol
|
|
1946
1994
|
};
|
|
1947
1995
|
}, [sourceChainId, sourceTokenSymbol, isSolana]);
|
|
1996
|
+
const [liquidityHelper, setLiquidityHelper] = _react.useState.call(void 0, {
|
|
1997
|
+
kind: "idle"
|
|
1998
|
+
});
|
|
1999
|
+
_react.useEffect.call(void 0, () => {
|
|
2000
|
+
if (isSolana) {
|
|
2001
|
+
setLiquidityHelper({ kind: "idle" });
|
|
2002
|
+
return;
|
|
2003
|
+
}
|
|
2004
|
+
const sourceTokenAddress = _chunkMUWVDVY4cjs.getTokenAddress.call(void 0,
|
|
2005
|
+
sourceTokenSymbol,
|
|
2006
|
+
sourceChainId
|
|
2007
|
+
);
|
|
2008
|
+
if (!sourceTokenAddress) {
|
|
2009
|
+
setLiquidityHelper({ kind: "idle" });
|
|
2010
|
+
return;
|
|
2011
|
+
}
|
|
2012
|
+
let cancelled = false;
|
|
2013
|
+
setLiquidityHelper({ kind: "loading" });
|
|
2014
|
+
service.checkLiquidity({
|
|
2015
|
+
sourceChainId,
|
|
2016
|
+
sourceToken: sourceTokenAddress,
|
|
2017
|
+
destinationChainId: targetChain,
|
|
2018
|
+
destinationToken: targetToken,
|
|
2019
|
+
amount: "1"
|
|
2020
|
+
}).then((result) => {
|
|
2021
|
+
if (cancelled) return;
|
|
2022
|
+
if (result.unlimited) {
|
|
2023
|
+
setLiquidityHelper({ kind: "unlimited" });
|
|
2024
|
+
} else if (result.maxAmount === null) {
|
|
2025
|
+
setLiquidityHelper({ kind: "unavailable" });
|
|
2026
|
+
} else {
|
|
2027
|
+
setLiquidityHelper({
|
|
2028
|
+
kind: "max",
|
|
2029
|
+
maxAmount: result.maxAmount,
|
|
2030
|
+
decimals: result.decimals,
|
|
2031
|
+
symbol: result.symbol || sourceTokenSymbol
|
|
2032
|
+
});
|
|
2033
|
+
}
|
|
2034
|
+
}).catch(() => {
|
|
2035
|
+
if (cancelled) return;
|
|
2036
|
+
setLiquidityHelper({ kind: "error" });
|
|
2037
|
+
});
|
|
2038
|
+
return () => {
|
|
2039
|
+
cancelled = true;
|
|
2040
|
+
};
|
|
2041
|
+
}, [
|
|
2042
|
+
isSolana,
|
|
2043
|
+
sourceChainId,
|
|
2044
|
+
sourceTokenSymbol,
|
|
2045
|
+
targetChain,
|
|
2046
|
+
targetToken,
|
|
2047
|
+
service
|
|
2048
|
+
]);
|
|
1948
2049
|
const displayAddress = isSolana && solanaDepositAddress ? solanaDepositAddress : smartAccount;
|
|
1949
2050
|
_react.useEffect.call(void 0, () => {
|
|
1950
2051
|
if (!chainDropdownOpen && !tokenDropdownOpen) return;
|
|
@@ -1970,7 +2071,7 @@ function DepositAddressStep({
|
|
|
1970
2071
|
await navigator.clipboard.writeText(displayAddress);
|
|
1971
2072
|
setCopied(true);
|
|
1972
2073
|
setTimeout(() => setCopied(false), 2e3);
|
|
1973
|
-
} catch (
|
|
2074
|
+
} catch (e14) {
|
|
1974
2075
|
const textarea = document.createElement("textarea");
|
|
1975
2076
|
textarea.value = displayAddress;
|
|
1976
2077
|
textarea.style.position = "fixed";
|
|
@@ -2024,10 +2125,10 @@ function DepositAddressStep({
|
|
|
2024
2125
|
return;
|
|
2025
2126
|
}
|
|
2026
2127
|
const event = status.lastEvent;
|
|
2027
|
-
const eventTxHash =
|
|
2128
|
+
const eventTxHash = _chunkXW4M7WDIcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkXW4M7WDIcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
2028
2129
|
if (baselineTxHashRef.current === void 0) {
|
|
2029
2130
|
baselineTxHashRef.current = eventTxHash;
|
|
2030
|
-
} else if (eventTxHash && (!baselineTxHashRef.current || !
|
|
2131
|
+
} else if (eventTxHash && (!baselineTxHashRef.current || !_chunkXW4M7WDIcjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
|
|
2031
2132
|
const details = getDepositEventDetails(event);
|
|
2032
2133
|
const fallback = sourceSelectionRef.current;
|
|
2033
2134
|
const chainId = _nullishCoalesce(details.chainId, () => ( fallback.chainId));
|
|
@@ -2372,7 +2473,7 @@ function DepositAddressStep({
|
|
|
2372
2473
|
] }) }),
|
|
2373
2474
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
2374
2475
|
"Max slippage: ",
|
|
2375
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "
|
|
2476
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.2%" })
|
|
2376
2477
|
] }),
|
|
2377
2478
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2378
2479
|
Tooltip,
|
|
@@ -2395,6 +2496,27 @@ function DepositAddressStep({
|
|
|
2395
2496
|
"Processing time: ",
|
|
2396
2497
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "< 1 min" })
|
|
2397
2498
|
] })
|
|
2499
|
+
] }),
|
|
2500
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
2501
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", children: [
|
|
2502
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "12", cy: "12", r: "9" }),
|
|
2503
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2504
|
+
"path",
|
|
2505
|
+
{
|
|
2506
|
+
strokeLinecap: "round",
|
|
2507
|
+
strokeLinejoin: "round",
|
|
2508
|
+
d: "M8 12h8M12 8v8"
|
|
2509
|
+
}
|
|
2510
|
+
)
|
|
2511
|
+
] }) }),
|
|
2512
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
2513
|
+
"Max deposit:",
|
|
2514
|
+
" ",
|
|
2515
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: liquidityHelper.kind === "max" ? `${_viem.formatUnits.call(void 0,
|
|
2516
|
+
BigInt(liquidityHelper.maxAmount),
|
|
2517
|
+
liquidityHelper.decimals
|
|
2518
|
+
)} ${liquidityHelper.symbol}` : liquidityHelper.kind === "unlimited" ? "Unlimited" : liquidityHelper.kind === "unavailable" ? "Unavailable" : liquidityHelper.kind === "error" ? "\u2014" : "\u2026" })
|
|
2519
|
+
] })
|
|
2398
2520
|
] })
|
|
2399
2521
|
] }) })
|
|
2400
2522
|
]
|
|
@@ -2418,7 +2540,7 @@ function DepositAddressStep({
|
|
|
2418
2540
|
},
|
|
2419
2541
|
deposit.id
|
|
2420
2542
|
)) }),
|
|
2421
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2543
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXW4M7WDIcjs.PoweredBy, {})
|
|
2422
2544
|
] });
|
|
2423
2545
|
}
|
|
2424
2546
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -2449,7 +2571,7 @@ function SolanaTokenSelectStep({
|
|
|
2449
2571
|
setError(null);
|
|
2450
2572
|
const portfolioBySymbol = {};
|
|
2451
2573
|
try {
|
|
2452
|
-
|
|
2574
|
+
_chunkXW4M7WDIcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
|
|
2453
2575
|
solanaAddress
|
|
2454
2576
|
});
|
|
2455
2577
|
const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
|
|
@@ -2460,7 +2582,7 @@ function SolanaTokenSelectStep({
|
|
|
2460
2582
|
let parsed = 0n;
|
|
2461
2583
|
try {
|
|
2462
2584
|
parsed = BigInt(t.balance || "0");
|
|
2463
|
-
} catch (
|
|
2585
|
+
} catch (e15) {
|
|
2464
2586
|
parsed = 0n;
|
|
2465
2587
|
}
|
|
2466
2588
|
if (parsed <= 0n) continue;
|
|
@@ -2472,12 +2594,12 @@ function SolanaTokenSelectStep({
|
|
|
2472
2594
|
};
|
|
2473
2595
|
}
|
|
2474
2596
|
}
|
|
2475
|
-
|
|
2597
|
+
_chunkXW4M7WDIcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
|
|
2476
2598
|
symbols: Object.keys(portfolioBySymbol)
|
|
2477
2599
|
});
|
|
2478
2600
|
} catch (err) {
|
|
2479
2601
|
if (!active) return;
|
|
2480
|
-
|
|
2602
|
+
_chunkXW4M7WDIcjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
|
|
2481
2603
|
solanaAddress
|
|
2482
2604
|
});
|
|
2483
2605
|
setError(
|
|
@@ -2531,7 +2653,7 @@ function SolanaTokenSelectStep({
|
|
|
2531
2653
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
2532
2654
|
children: [
|
|
2533
2655
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
2534
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2656
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXW4M7WDIcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
2535
2657
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
2536
2658
|
] }),
|
|
2537
2659
|
!loading && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
@@ -2568,8 +2690,8 @@ function SolanaTokenSelectStep({
|
|
|
2568
2690
|
try {
|
|
2569
2691
|
const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
|
|
2570
2692
|
const numeric = Number(raw);
|
|
2571
|
-
formattedBalance = Number.isFinite(numeric) ?
|
|
2572
|
-
} catch (
|
|
2693
|
+
formattedBalance = Number.isFinite(numeric) ? _chunkXW4M7WDIcjs.tokenFormatter.format(numeric) : raw;
|
|
2694
|
+
} catch (e16) {
|
|
2573
2695
|
formattedBalance = "...";
|
|
2574
2696
|
}
|
|
2575
2697
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
@@ -2612,7 +2734,7 @@ function SolanaTokenSelectStep({
|
|
|
2612
2734
|
] })
|
|
2613
2735
|
] })
|
|
2614
2736
|
] }),
|
|
2615
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ?
|
|
2737
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunkXW4M7WDIcjs.currencyFormatter.format(entry.balanceUsd) : `${formattedBalance} ${entry.token.symbol}` })
|
|
2616
2738
|
]
|
|
2617
2739
|
},
|
|
2618
2740
|
entry.token.symbol
|
|
@@ -2622,7 +2744,7 @@ function SolanaTokenSelectStep({
|
|
|
2622
2744
|
}
|
|
2623
2745
|
),
|
|
2624
2746
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2625
|
-
|
|
2747
|
+
_chunkXW4M7WDIcjs.Button,
|
|
2626
2748
|
{
|
|
2627
2749
|
onClick: () => selectedEntry && onContinue(
|
|
2628
2750
|
selectedEntry.token,
|
|
@@ -2634,7 +2756,7 @@ function SolanaTokenSelectStep({
|
|
|
2634
2756
|
children: "Continue"
|
|
2635
2757
|
}
|
|
2636
2758
|
) }),
|
|
2637
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2759
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXW4M7WDIcjs.PoweredBy, {})
|
|
2638
2760
|
] });
|
|
2639
2761
|
}
|
|
2640
2762
|
|
|
@@ -2664,7 +2786,7 @@ function SolanaAmountStep({
|
|
|
2664
2786
|
}
|
|
2665
2787
|
const price = balanceUsd / balanceUnits;
|
|
2666
2788
|
return price > 0 ? price : null;
|
|
2667
|
-
} catch (
|
|
2789
|
+
} catch (e17) {
|
|
2668
2790
|
return null;
|
|
2669
2791
|
}
|
|
2670
2792
|
}, [isSourceStablecoin, balance, token.decimals, balanceUsd]);
|
|
@@ -2682,8 +2804,8 @@ function SolanaAmountStep({
|
|
|
2682
2804
|
const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
|
|
2683
2805
|
const numeric = Number(raw);
|
|
2684
2806
|
if (!Number.isFinite(numeric)) return raw;
|
|
2685
|
-
return
|
|
2686
|
-
} catch (
|
|
2807
|
+
return _chunkXW4M7WDIcjs.tokenFormatter.format(numeric);
|
|
2808
|
+
} catch (e18) {
|
|
2687
2809
|
return "...";
|
|
2688
2810
|
}
|
|
2689
2811
|
}, [balance, token.decimals]);
|
|
@@ -2694,13 +2816,13 @@ function SolanaAmountStep({
|
|
|
2694
2816
|
if (tokenPriceUsd !== null) return balanceUnits * tokenPriceUsd;
|
|
2695
2817
|
if (Number.isFinite(balanceUsd) && balanceUsd > 0) return balanceUsd;
|
|
2696
2818
|
return null;
|
|
2697
|
-
} catch (
|
|
2819
|
+
} catch (e19) {
|
|
2698
2820
|
return null;
|
|
2699
2821
|
}
|
|
2700
2822
|
}, [balance, token.decimals, tokenPriceUsd, balanceUsd]);
|
|
2701
2823
|
const formattedBalanceUsd = _react.useMemo.call(void 0, () => {
|
|
2702
2824
|
if (computedBalanceUsd === null || computedBalanceUsd <= 0) return null;
|
|
2703
|
-
return
|
|
2825
|
+
return _chunkXW4M7WDIcjs.currencyFormatter.format(computedBalanceUsd);
|
|
2704
2826
|
}, [computedBalanceUsd]);
|
|
2705
2827
|
const spendableBalance = _react.useMemo.call(void 0, () => {
|
|
2706
2828
|
if (!isNativeSol(token)) return balance;
|
|
@@ -2712,7 +2834,7 @@ function SolanaAmountStep({
|
|
|
2712
2834
|
if (!Number.isFinite(spendableUnits) || spendableUnits < 0) return null;
|
|
2713
2835
|
if (tokenPriceUsd !== null) return spendableUnits * tokenPriceUsd;
|
|
2714
2836
|
return null;
|
|
2715
|
-
} catch (
|
|
2837
|
+
} catch (e20) {
|
|
2716
2838
|
return null;
|
|
2717
2839
|
}
|
|
2718
2840
|
}, [spendableBalance, token.decimals, tokenPriceUsd]);
|
|
@@ -2725,13 +2847,13 @@ function SolanaAmountStep({
|
|
|
2725
2847
|
const factor = 10 ** maxDecimals;
|
|
2726
2848
|
const truncated = Math.floor(value * factor) / factor;
|
|
2727
2849
|
const formatted = truncated.toFixed(maxDecimals).replace(/\.?0+$/, "");
|
|
2728
|
-
|
|
2850
|
+
_chunkXW4M7WDIcjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
|
|
2729
2851
|
percentage,
|
|
2730
2852
|
symbol: token.symbol,
|
|
2731
2853
|
formatted
|
|
2732
2854
|
});
|
|
2733
2855
|
setAmount(formatted);
|
|
2734
|
-
} catch (
|
|
2856
|
+
} catch (e21) {
|
|
2735
2857
|
return;
|
|
2736
2858
|
}
|
|
2737
2859
|
if (error) setError(null);
|
|
@@ -2739,7 +2861,7 @@ function SolanaAmountStep({
|
|
|
2739
2861
|
const handleContinue = () => {
|
|
2740
2862
|
const numericAmount = parseFloat(amount);
|
|
2741
2863
|
if (isNaN(numericAmount) || numericAmount <= 0) {
|
|
2742
|
-
|
|
2864
|
+
_chunkXW4M7WDIcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2743
2865
|
amount,
|
|
2744
2866
|
reason: "nan-or-non-positive"
|
|
2745
2867
|
});
|
|
@@ -2751,7 +2873,7 @@ function SolanaAmountStep({
|
|
|
2751
2873
|
const usdValue = numericAmount;
|
|
2752
2874
|
if (_optionalChain([uiConfig, 'optionalAccess', _82 => _82.maxDepositUsd]) && usdValue > uiConfig.maxDepositUsd) {
|
|
2753
2875
|
setError(
|
|
2754
|
-
`Maximum deposit is ${
|
|
2876
|
+
`Maximum deposit is ${_chunkXW4M7WDIcjs.currencyFormatter.format(uiConfig.maxDepositUsd)}`
|
|
2755
2877
|
);
|
|
2756
2878
|
return;
|
|
2757
2879
|
}
|
|
@@ -2765,8 +2887,8 @@ function SolanaAmountStep({
|
|
|
2765
2887
|
let amountInUnits;
|
|
2766
2888
|
try {
|
|
2767
2889
|
amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
|
|
2768
|
-
} catch (
|
|
2769
|
-
|
|
2890
|
+
} catch (e22) {
|
|
2891
|
+
_chunkXW4M7WDIcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2770
2892
|
amount,
|
|
2771
2893
|
sourceAmount: sourceAmountStr,
|
|
2772
2894
|
reason: "parse-units-failed"
|
|
@@ -2776,7 +2898,7 @@ function SolanaAmountStep({
|
|
|
2776
2898
|
}
|
|
2777
2899
|
if (amountInUnits > spendableBalance) {
|
|
2778
2900
|
const isReserveIssue = isNativeSol(token) && amountInUnits <= balance;
|
|
2779
|
-
|
|
2901
|
+
_chunkXW4M7WDIcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2780
2902
|
amount,
|
|
2781
2903
|
balance: balance.toString(),
|
|
2782
2904
|
spendableBalance: spendableBalance.toString(),
|
|
@@ -2788,7 +2910,7 @@ function SolanaAmountStep({
|
|
|
2788
2910
|
);
|
|
2789
2911
|
return;
|
|
2790
2912
|
}
|
|
2791
|
-
|
|
2913
|
+
_chunkXW4M7WDIcjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
|
|
2792
2914
|
symbol: token.symbol,
|
|
2793
2915
|
inputAmountUsd: amount,
|
|
2794
2916
|
sourceAmount: sourceAmountStr,
|
|
@@ -2857,7 +2979,7 @@ function SolanaAmountStep({
|
|
|
2857
2979
|
)
|
|
2858
2980
|
] }),
|
|
2859
2981
|
_optionalChain([uiConfig, 'optionalAccess', _84 => _84.minDepositUsd]) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-minimum", children: [
|
|
2860
|
-
|
|
2982
|
+
_chunkXW4M7WDIcjs.currencyFormatter.format(uiConfig.minDepositUsd),
|
|
2861
2983
|
" minimum deposit"
|
|
2862
2984
|
] }),
|
|
2863
2985
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", children: [
|
|
@@ -2883,7 +3005,7 @@ function SolanaAmountStep({
|
|
|
2883
3005
|
] })
|
|
2884
3006
|
] }),
|
|
2885
3007
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2886
|
-
|
|
3008
|
+
_chunkXW4M7WDIcjs.Button,
|
|
2887
3009
|
{
|
|
2888
3010
|
onClick: handleContinue,
|
|
2889
3011
|
fullWidth: true,
|
|
@@ -2891,7 +3013,7 @@ function SolanaAmountStep({
|
|
|
2891
3013
|
children: _optionalChain([uiConfig, 'optionalAccess', _85 => _85.minDepositUsd]) && parseFloat(amount) > 0 && parseFloat(amount) < uiConfig.minDepositUsd ? "Update order" : "Continue"
|
|
2892
3014
|
}
|
|
2893
3015
|
) }),
|
|
2894
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3016
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXW4M7WDIcjs.PoweredBy, {})
|
|
2895
3017
|
] });
|
|
2896
3018
|
}
|
|
2897
3019
|
|
|
@@ -2935,7 +3057,7 @@ function SolanaConfirmStep({
|
|
|
2935
3057
|
const receiveAmount = isSameToken ? formattedReceiveAmount : `~ ${formattedReceiveAmount}`;
|
|
2936
3058
|
const handleConfirm = async () => {
|
|
2937
3059
|
if (!solanaProvider) {
|
|
2938
|
-
|
|
3060
|
+
_chunkXW4M7WDIcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
2939
3061
|
reason: "missing-provider"
|
|
2940
3062
|
});
|
|
2941
3063
|
setError("Solana wallet not connected");
|
|
@@ -2943,7 +3065,7 @@ function SolanaConfirmStep({
|
|
|
2943
3065
|
}
|
|
2944
3066
|
const parsedAmount = parseFloat(sourceAmount);
|
|
2945
3067
|
if (isNaN(parsedAmount) || parsedAmount <= 0) {
|
|
2946
|
-
|
|
3068
|
+
_chunkXW4M7WDIcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
2947
3069
|
reason: "invalid-amount",
|
|
2948
3070
|
sourceAmount
|
|
2949
3071
|
});
|
|
@@ -2952,7 +3074,7 @@ function SolanaConfirmStep({
|
|
|
2952
3074
|
}
|
|
2953
3075
|
setError(null);
|
|
2954
3076
|
setIsSubmitting(true);
|
|
2955
|
-
|
|
3077
|
+
_chunkXW4M7WDIcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
|
|
2956
3078
|
smartAccount,
|
|
2957
3079
|
solanaAddress,
|
|
2958
3080
|
solanaDepositAddress,
|
|
@@ -2962,7 +3084,7 @@ function SolanaConfirmStep({
|
|
|
2962
3084
|
});
|
|
2963
3085
|
try {
|
|
2964
3086
|
const check = await service.checkAccount(smartAccount);
|
|
2965
|
-
|
|
3087
|
+
_chunkXW4M7WDIcjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
|
|
2966
3088
|
smartAccount,
|
|
2967
3089
|
isRegistered: check.isRegistered,
|
|
2968
3090
|
targetChain: check.targetChain,
|
|
@@ -2975,7 +3097,7 @@ function SolanaConfirmStep({
|
|
|
2975
3097
|
}
|
|
2976
3098
|
const connection = getSolanaConnection();
|
|
2977
3099
|
const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
|
|
2978
|
-
|
|
3100
|
+
_chunkXW4M7WDIcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
|
|
2979
3101
|
token: token.symbol,
|
|
2980
3102
|
sourceAmount,
|
|
2981
3103
|
amountUnits: amountUnits.toString()
|
|
@@ -2992,7 +3114,7 @@ function SolanaConfirmStep({
|
|
|
2992
3114
|
token.mint,
|
|
2993
3115
|
amountUnits
|
|
2994
3116
|
);
|
|
2995
|
-
|
|
3117
|
+
_chunkXW4M7WDIcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
2996
3118
|
token: token.symbol,
|
|
2997
3119
|
instructionCount: transaction.instructions.length,
|
|
2998
3120
|
feePayer: _optionalChain([transaction, 'access', _86 => _86.feePayer, 'optionalAccess', _87 => _87.toBase58, 'call', _88 => _88()]),
|
|
@@ -3003,15 +3125,15 @@ function SolanaConfirmStep({
|
|
|
3003
3125
|
connection,
|
|
3004
3126
|
transaction
|
|
3005
3127
|
);
|
|
3006
|
-
|
|
3128
|
+
_chunkXW4M7WDIcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
|
|
3007
3129
|
txHash,
|
|
3008
3130
|
amountUnits: amountUnits.toString()
|
|
3009
3131
|
});
|
|
3010
3132
|
onConfirm(txHash, amountUnits.toString());
|
|
3011
3133
|
} catch (err) {
|
|
3012
3134
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
3013
|
-
const message =
|
|
3014
|
-
|
|
3135
|
+
const message = _chunkXW4M7WDIcjs.formatUserError.call(void 0, raw);
|
|
3136
|
+
_chunkXW4M7WDIcjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
|
|
3015
3137
|
smartAccount,
|
|
3016
3138
|
token: token.symbol,
|
|
3017
3139
|
sourceAmount
|
|
@@ -3144,7 +3266,7 @@ function SolanaConfirmStep({
|
|
|
3144
3266
|
] })
|
|
3145
3267
|
] }),
|
|
3146
3268
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3147
|
-
|
|
3269
|
+
_chunkXW4M7WDIcjs.Button,
|
|
3148
3270
|
{
|
|
3149
3271
|
onClick: handleConfirm,
|
|
3150
3272
|
loading: isSubmitting,
|
|
@@ -3153,7 +3275,7 @@ function SolanaConfirmStep({
|
|
|
3153
3275
|
children: "Confirm Order"
|
|
3154
3276
|
}
|
|
3155
3277
|
) }),
|
|
3156
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3278
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkXW4M7WDIcjs.PoweredBy, {})
|
|
3157
3279
|
] });
|
|
3158
3280
|
}
|
|
3159
3281
|
|
|
@@ -3205,14 +3327,14 @@ function DepositFlow({
|
|
|
3205
3327
|
onError,
|
|
3206
3328
|
debug
|
|
3207
3329
|
}) {
|
|
3208
|
-
const onStepChangeRef =
|
|
3209
|
-
const onTotalBalanceChangeRef =
|
|
3210
|
-
const onSmartAccountChangeRef =
|
|
3211
|
-
const onEventRef =
|
|
3212
|
-
const onDepositSubmittedRef =
|
|
3213
|
-
const onDepositCompleteRef =
|
|
3214
|
-
const onDepositFailedRef =
|
|
3215
|
-
const onErrorRef =
|
|
3330
|
+
const onStepChangeRef = _chunkXW4M7WDIcjs.useLatestRef.call(void 0, onStepChange);
|
|
3331
|
+
const onTotalBalanceChangeRef = _chunkXW4M7WDIcjs.useLatestRef.call(void 0, onTotalBalanceChange);
|
|
3332
|
+
const onSmartAccountChangeRef = _chunkXW4M7WDIcjs.useLatestRef.call(void 0, onSmartAccountChange);
|
|
3333
|
+
const onEventRef = _chunkXW4M7WDIcjs.useLatestRef.call(void 0, onEvent);
|
|
3334
|
+
const onDepositSubmittedRef = _chunkXW4M7WDIcjs.useLatestRef.call(void 0, onDepositSubmitted);
|
|
3335
|
+
const onDepositCompleteRef = _chunkXW4M7WDIcjs.useLatestRef.call(void 0, onDepositComplete);
|
|
3336
|
+
const onDepositFailedRef = _chunkXW4M7WDIcjs.useLatestRef.call(void 0, onDepositFailed);
|
|
3337
|
+
const onErrorRef = _chunkXW4M7WDIcjs.useLatestRef.call(void 0, onError);
|
|
3216
3338
|
const hasInitialReownSession = Boolean(
|
|
3217
3339
|
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _90 => _90.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _91 => _91.address]) : _optionalChain([reownWallet, 'optionalAccess', _92 => _92.address])
|
|
3218
3340
|
);
|
|
@@ -3232,13 +3354,13 @@ function DepositFlow({
|
|
|
3232
3354
|
flowModeRef.current = flowMode;
|
|
3233
3355
|
const logFlow = _react.useCallback.call(void 0,
|
|
3234
3356
|
(message, data) => {
|
|
3235
|
-
|
|
3357
|
+
_chunkXW4M7WDIcjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
|
|
3236
3358
|
},
|
|
3237
3359
|
[debug]
|
|
3238
3360
|
);
|
|
3239
3361
|
const logFlowError = _react.useCallback.call(void 0,
|
|
3240
3362
|
(message, error, data) => {
|
|
3241
|
-
|
|
3363
|
+
_chunkXW4M7WDIcjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
|
|
3242
3364
|
},
|
|
3243
3365
|
[debug]
|
|
3244
3366
|
);
|
|
@@ -3254,7 +3376,7 @@ function DepositFlow({
|
|
|
3254
3376
|
_viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals)
|
|
3255
3377
|
);
|
|
3256
3378
|
if (balanceUnits > 0) return asset.balanceUsd / balanceUnits;
|
|
3257
|
-
} catch (
|
|
3379
|
+
} catch (e23) {
|
|
3258
3380
|
}
|
|
3259
3381
|
}
|
|
3260
3382
|
}
|
|
@@ -3362,7 +3484,7 @@ function DepositFlow({
|
|
|
3362
3484
|
return {
|
|
3363
3485
|
ownerAddress: dappAddress,
|
|
3364
3486
|
walletClient: void 0,
|
|
3365
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
3487
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkXW4M7WDIcjs.getPublicClient.call(void 0, targetChain))),
|
|
3366
3488
|
switchChain: void 0
|
|
3367
3489
|
};
|
|
3368
3490
|
}
|
|
@@ -3371,7 +3493,7 @@ function DepositFlow({
|
|
|
3371
3493
|
return {
|
|
3372
3494
|
ownerAddress: dappWalletClient.account.address,
|
|
3373
3495
|
walletClient: dappWalletClient,
|
|
3374
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
3496
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkXW4M7WDIcjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
3375
3497
|
switchChain: dappSwitchChain
|
|
3376
3498
|
};
|
|
3377
3499
|
}
|
|
@@ -3385,7 +3507,7 @@ function DepositFlow({
|
|
|
3385
3507
|
return {
|
|
3386
3508
|
ownerAddress: dappAddress,
|
|
3387
3509
|
walletClient: void 0,
|
|
3388
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
3510
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkXW4M7WDIcjs.getPublicClient.call(void 0, targetChain))),
|
|
3389
3511
|
switchChain: void 0
|
|
3390
3512
|
};
|
|
3391
3513
|
}
|
|
@@ -3394,7 +3516,7 @@ function DepositFlow({
|
|
|
3394
3516
|
return {
|
|
3395
3517
|
ownerAddress: dappWalletClient.account.address,
|
|
3396
3518
|
walletClient: dappWalletClient,
|
|
3397
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
3519
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkXW4M7WDIcjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
3398
3520
|
switchChain: dappSwitchChain
|
|
3399
3521
|
};
|
|
3400
3522
|
}
|
|
@@ -3402,7 +3524,7 @@ function DepositFlow({
|
|
|
3402
3524
|
return {
|
|
3403
3525
|
ownerAddress: reownWallet.address,
|
|
3404
3526
|
walletClient: reownWallet.walletClient,
|
|
3405
|
-
publicClient: _nullishCoalesce(reownWallet.publicClient, () => (
|
|
3527
|
+
publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunkXW4M7WDIcjs.getPublicClient.call(void 0, targetChain))),
|
|
3406
3528
|
switchChain: reownWallet.switchChain
|
|
3407
3529
|
};
|
|
3408
3530
|
}
|
|
@@ -3440,7 +3562,7 @@ function DepositFlow({
|
|
|
3440
3562
|
return {
|
|
3441
3563
|
ownerAddress: dappAddress,
|
|
3442
3564
|
walletClient: void 0,
|
|
3443
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
3565
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkXW4M7WDIcjs.getPublicClient.call(void 0, targetChain))),
|
|
3444
3566
|
switchChain: void 0
|
|
3445
3567
|
};
|
|
3446
3568
|
}
|
|
@@ -3774,7 +3896,7 @@ function DepositFlow({
|
|
|
3774
3896
|
[defaultAmount, onEvent, totalBalanceUsd]
|
|
3775
3897
|
);
|
|
3776
3898
|
const handleAmountContinue = _react.useCallback.call(void 0,
|
|
3777
|
-
(amount, targetAmount, balance) => {
|
|
3899
|
+
(amount, targetAmount, balance, liquidityWarning) => {
|
|
3778
3900
|
const targetSym = _chunkMUWVDVY4cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3779
3901
|
const isTargetStable = _chunkMUWVDVY4cjs.isStablecoinSymbol.call(void 0, targetSym);
|
|
3780
3902
|
const targetTokenPriceUsd = isTargetStable ? 1 : getTokenPriceUsd(targetSym);
|
|
@@ -3787,7 +3909,8 @@ function DepositFlow({
|
|
|
3787
3909
|
amount,
|
|
3788
3910
|
targetAmount,
|
|
3789
3911
|
targetTokenPriceUsd,
|
|
3790
|
-
balance
|
|
3912
|
+
balance,
|
|
3913
|
+
liquidityWarning
|
|
3791
3914
|
};
|
|
3792
3915
|
});
|
|
3793
3916
|
},
|
|
@@ -3926,7 +4049,7 @@ function DepositFlow({
|
|
|
3926
4049
|
]);
|
|
3927
4050
|
if (showConnectStep) {
|
|
3928
4051
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3929
|
-
|
|
4052
|
+
_chunkXW4M7WDIcjs.ConnectStep,
|
|
3930
4053
|
{
|
|
3931
4054
|
walletOptions,
|
|
3932
4055
|
selectedWalletId: selectedWalletIdEffective,
|
|
@@ -4112,7 +4235,7 @@ function DepositFlow({
|
|
|
4112
4235
|
) })
|
|
4113
4236
|
] }) : null,
|
|
4114
4237
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4115
|
-
|
|
4238
|
+
_chunkXW4M7WDIcjs.ProcessingStep,
|
|
4116
4239
|
{
|
|
4117
4240
|
smartAccount: step.smartAccount,
|
|
4118
4241
|
txHash: step.txHash,
|
|
@@ -4146,7 +4269,7 @@ function DepositFlow({
|
|
|
4146
4269
|
if (_optionalChain([signerContext, 'access', _162 => _162.publicClient, 'access', _163 => _163.chain, 'optionalAccess', _164 => _164.id]) === chainId) {
|
|
4147
4270
|
return signerContext.publicClient;
|
|
4148
4271
|
}
|
|
4149
|
-
return
|
|
4272
|
+
return _chunkXW4M7WDIcjs.getPublicClient.call(void 0, chainId);
|
|
4150
4273
|
};
|
|
4151
4274
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
4152
4275
|
step.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -4200,6 +4323,7 @@ function DepositFlow({
|
|
|
4200
4323
|
targetChain,
|
|
4201
4324
|
targetToken,
|
|
4202
4325
|
uiConfig,
|
|
4326
|
+
service,
|
|
4203
4327
|
onContinue: handleAmountContinue,
|
|
4204
4328
|
onCtaClick: (ctaName) => {
|
|
4205
4329
|
const receiveSymbol = _chunkMUWVDVY4cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
@@ -4228,13 +4352,14 @@ function DepositFlow({
|
|
|
4228
4352
|
targetChain,
|
|
4229
4353
|
targetToken,
|
|
4230
4354
|
switchChain: signerContext.switchChain,
|
|
4355
|
+
liquidityWarning: step.liquidityWarning,
|
|
4231
4356
|
onConfirm: handleDepositSubmitted,
|
|
4232
4357
|
onDepositSubmitted: handleDepositSubmittedCallback,
|
|
4233
4358
|
onError: handleError
|
|
4234
4359
|
}
|
|
4235
4360
|
),
|
|
4236
4361
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4237
|
-
|
|
4362
|
+
_chunkXW4M7WDIcjs.ProcessingStep,
|
|
4238
4363
|
{
|
|
4239
4364
|
smartAccount: step.smartAccount,
|
|
4240
4365
|
txHash: step.txHash,
|
|
@@ -4284,15 +4409,15 @@ function formatTimestamp2(iso) {
|
|
|
4284
4409
|
month: "short",
|
|
4285
4410
|
day: "numeric"
|
|
4286
4411
|
});
|
|
4287
|
-
} catch (
|
|
4412
|
+
} catch (e24) {
|
|
4288
4413
|
return iso;
|
|
4289
4414
|
}
|
|
4290
4415
|
}
|
|
4291
4416
|
function resolveChainId(value) {
|
|
4292
4417
|
if (value === void 0 || value === null) return null;
|
|
4293
4418
|
if (typeof value === "number") return value;
|
|
4294
|
-
if (
|
|
4295
|
-
const parsed =
|
|
4419
|
+
if (_chunkXW4M7WDIcjs.isSolanaCaip2.call(void 0, value) || value === "solana") return "solana";
|
|
4420
|
+
const parsed = _chunkXW4M7WDIcjs.parseEvmChainId.call(void 0, value);
|
|
4296
4421
|
if (parsed !== null) return parsed;
|
|
4297
4422
|
const num = Number(value);
|
|
4298
4423
|
return Number.isFinite(num) ? num : null;
|
|
@@ -4343,7 +4468,7 @@ function formatAmount(rawAmount, token, chainId) {
|
|
|
4343
4468
|
const trimmed = fracStr.slice(0, 6).replace(/0+$/, "");
|
|
4344
4469
|
if (!trimmed) return whole.toString();
|
|
4345
4470
|
return `${whole}.${trimmed}`;
|
|
4346
|
-
} catch (
|
|
4471
|
+
} catch (e25) {
|
|
4347
4472
|
return rawAmount;
|
|
4348
4473
|
}
|
|
4349
4474
|
}
|
|
@@ -4526,7 +4651,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
|
4526
4651
|
// src/DepositModal.tsx
|
|
4527
4652
|
|
|
4528
4653
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
4529
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
4654
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-66DE7NAY.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
4530
4655
|
);
|
|
4531
4656
|
function DepositModal(props) {
|
|
4532
4657
|
const needsReown = !!props.reownAppId;
|
|
@@ -4597,7 +4722,7 @@ function DepositModalInner({
|
|
|
4597
4722
|
debug
|
|
4598
4723
|
}) {
|
|
4599
4724
|
const modalRef = _react.useRef.call(void 0, null);
|
|
4600
|
-
const onReadyRef =
|
|
4725
|
+
const onReadyRef = _chunkXW4M7WDIcjs.useLatestRef.call(void 0, onReady);
|
|
4601
4726
|
const [currentStepIndex, setCurrentStepIndex] = _react.useState.call(void 0, 0);
|
|
4602
4727
|
const [totalBalanceUsd, setTotalBalanceUsd] = _react.useState.call(void 0, null);
|
|
4603
4728
|
const backHandlerRef = _react.useRef.call(void 0, void 0);
|
|
@@ -4614,7 +4739,7 @@ function DepositModalInner({
|
|
|
4614
4739
|
const targetChain = _chunkMUWVDVY4cjs.getChainId.call(void 0, targetChainProp);
|
|
4615
4740
|
const sourceChain = sourceChainProp ? _chunkMUWVDVY4cjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
4616
4741
|
const service = _react.useMemo.call(void 0,
|
|
4617
|
-
() =>
|
|
4742
|
+
() => _chunkXW4M7WDIcjs.createDepositService.call(void 0, backendUrl, {
|
|
4618
4743
|
debug,
|
|
4619
4744
|
debugScope: "service:deposit"
|
|
4620
4745
|
}),
|
|
@@ -4622,7 +4747,7 @@ function DepositModalInner({
|
|
|
4622
4747
|
);
|
|
4623
4748
|
_react.useEffect.call(void 0, () => {
|
|
4624
4749
|
if (isOpen && modalRef.current) {
|
|
4625
|
-
|
|
4750
|
+
_chunkXW4M7WDIcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
4626
4751
|
}
|
|
4627
4752
|
}, [isOpen, theme]);
|
|
4628
4753
|
_react.useEffect.call(void 0, () => {
|
|
@@ -4718,9 +4843,9 @@ function DepositModalInner({
|
|
|
4718
4843
|
fetchHistory();
|
|
4719
4844
|
}
|
|
4720
4845
|
}, [historyOpen, fetchHistory]);
|
|
4721
|
-
const onDepositSubmittedRef =
|
|
4722
|
-
const onDepositCompleteRef =
|
|
4723
|
-
const onDepositFailedRef =
|
|
4846
|
+
const onDepositSubmittedRef = _chunkXW4M7WDIcjs.useLatestRef.call(void 0, onDepositSubmitted);
|
|
4847
|
+
const onDepositCompleteRef = _chunkXW4M7WDIcjs.useLatestRef.call(void 0, onDepositComplete);
|
|
4848
|
+
const onDepositFailedRef = _chunkXW4M7WDIcjs.useLatestRef.call(void 0, onDepositFailed);
|
|
4724
4849
|
const handleDepositSubmitted = _react.useCallback.call(void 0,
|
|
4725
4850
|
(data) => {
|
|
4726
4851
|
_optionalChain([onDepositSubmittedRef, 'access', _172 => _172.current, 'optionalCall', _173 => _173(data)]);
|
|
@@ -4761,7 +4886,7 @@ function DepositModalInner({
|
|
|
4761
4886
|
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _183 => _183.title]), () => ( "Deposit"));
|
|
4762
4887
|
const canGoBack = currentStepIndex > 0 && currentStepIndex < 4 && backHandlerRef.current !== void 0;
|
|
4763
4888
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4764
|
-
|
|
4889
|
+
_chunkXW4M7WDIcjs.Modal,
|
|
4765
4890
|
{
|
|
4766
4891
|
isOpen,
|
|
4767
4892
|
onClose,
|
|
@@ -4854,7 +4979,7 @@ function DepositModalInner({
|
|
|
4854
4979
|
balance.title,
|
|
4855
4980
|
":"
|
|
4856
4981
|
] }),
|
|
4857
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ?
|
|
4982
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ? _chunkXW4M7WDIcjs.currencyFormatter.format(totalBalanceUsd) : null))) })
|
|
4858
4983
|
] })
|
|
4859
4984
|
] }),
|
|
4860
4985
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
|