@rhinestone/deposit-modal 0.3.0-alpha.7 → 0.3.0-alpha.9
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-42D5V5II.mjs → DepositModalReown-I7I3KLD2.mjs} +4 -4
- package/dist/{DepositModalReown-ABLVMYFL.cjs → DepositModalReown-XUA47RYZ.cjs} +7 -7
- package/dist/{QRCode-SMMYPUQC.cjs → QRCode-KG47KTGX.cjs} +1 -1
- package/dist/{QRCode-YMQTKSSK.mjs → QRCode-YJ3EGWQS.mjs} +1 -1
- package/dist/{WithdrawModalReown-FJP3XTQ5.cjs → WithdrawModalReown-JATYMQYP.cjs} +7 -7
- package/dist/{WithdrawModalReown-EVHN5NOF.mjs → WithdrawModalReown-KN2DGOXR.mjs} +4 -4
- package/dist/{chunk-44IFH7DZ.mjs → chunk-4BUMVXPS.mjs} +9 -6
- package/dist/{chunk-MHKHSCIA.cjs → chunk-7JIDIX27.cjs} +1 -1
- package/dist/{chunk-CPXERFGC.cjs → chunk-G5Q4QBWX.cjs} +93 -93
- package/dist/{chunk-3FHYC3K7.mjs → chunk-KE4MRCFN.mjs} +3 -3
- package/dist/{chunk-YQFH2WSW.cjs → chunk-KIPKYPNF.cjs} +54 -14
- package/dist/{chunk-ENMIKNXS.cjs → chunk-MMXUBBGK.cjs} +123 -96
- package/dist/{chunk-5YXAQB6A.mjs → chunk-OISMGA2L.mjs} +56 -16
- package/dist/{chunk-UCZXBHLH.mjs → chunk-SZIYS42B.mjs} +1 -1
- package/dist/{chunk-7VKAUBZ7.mjs → chunk-TJG2AFPS.mjs} +99 -72
- package/dist/{chunk-LEVCOJD6.cjs → chunk-ZVG4JDKZ.cjs} +254 -251
- 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 +6 -6
- package/dist/index.mjs +5 -5
- package/dist/withdraw.cjs +4 -4
- package/dist/withdraw.mjs +3 -3
- package/package.json +5 -5
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
var
|
|
50
|
+
var _chunkMMXUBBGKcjs = require('./chunk-MMXUBBGK.cjs');
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
|
|
@@ -69,7 +69,7 @@ var _chunkENMIKNXScjs = require('./chunk-ENMIKNXS.cjs');
|
|
|
69
69
|
|
|
70
70
|
|
|
71
71
|
|
|
72
|
-
var
|
|
72
|
+
var _chunk7JIDIX27cjs = require('./chunk-7JIDIX27.cjs');
|
|
73
73
|
|
|
74
74
|
// src/DepositModal.tsx
|
|
75
75
|
|
|
@@ -108,7 +108,7 @@ function AssetSelectStep({
|
|
|
108
108
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
109
109
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
110
110
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
111
|
-
return
|
|
111
|
+
return _chunkMMXUBBGKcjs.getAssetId.call(void 0, {
|
|
112
112
|
chainId: defaultSourceChain,
|
|
113
113
|
token: defaultSourceToken
|
|
114
114
|
});
|
|
@@ -125,10 +125,10 @@ function AssetSelectStep({
|
|
|
125
125
|
try {
|
|
126
126
|
const portfolio = await service.fetchPortfolio(address);
|
|
127
127
|
if (!active) return;
|
|
128
|
-
const portfolioAssets =
|
|
128
|
+
const portfolioAssets = _chunkMMXUBBGKcjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
129
129
|
setAssets(portfolioAssets);
|
|
130
130
|
const hasNative = portfolioAssets.some(
|
|
131
|
-
(asset) => asset.token.toLowerCase() ===
|
|
131
|
+
(asset) => asset.token.toLowerCase() === _chunk7JIDIX27cjs.NATIVE_TOKEN_ADDRESS
|
|
132
132
|
);
|
|
133
133
|
if (!hasNative) {
|
|
134
134
|
const nativeAssets = await fetchNativeAssets(
|
|
@@ -206,7 +206,7 @@ function AssetSelectStep({
|
|
|
206
206
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
207
207
|
const numeric = Number(raw);
|
|
208
208
|
if (!Number.isFinite(numeric)) return raw;
|
|
209
|
-
return
|
|
209
|
+
return _chunkMMXUBBGKcjs.tokenFormatter.format(numeric);
|
|
210
210
|
} catch (e3) {
|
|
211
211
|
return asset.balance;
|
|
212
212
|
}
|
|
@@ -214,20 +214,20 @@ function AssetSelectStep({
|
|
|
214
214
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
215
215
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
216
216
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
217
|
-
|
|
217
|
+
_chunkMMXUBBGKcjs.BodyHeader,
|
|
218
218
|
{
|
|
219
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
219
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.WalletIcon, {}),
|
|
220
220
|
title: "Your assets",
|
|
221
221
|
subtitle: "Select source assets to transfer"
|
|
222
222
|
}
|
|
223
223
|
),
|
|
224
224
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
225
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
225
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
226
226
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
227
227
|
] }),
|
|
228
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
228
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.Callout, { variant: "error", children: error }),
|
|
229
229
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
230
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
230
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
231
231
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
232
232
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
233
233
|
address.slice(0, 6),
|
|
@@ -247,9 +247,9 @@ function AssetSelectStep({
|
|
|
247
247
|
!loading && !error && rows.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: rows.map((asset) => {
|
|
248
248
|
const isSelected = selectedAssetId === asset.id;
|
|
249
249
|
const tokenAmount = formatBalance(asset);
|
|
250
|
-
const badge =
|
|
251
|
-
const tokenIcon =
|
|
252
|
-
const chainIcon =
|
|
250
|
+
const badge = _chunk7JIDIX27cjs.getChainBadge.call(void 0, asset.chainId);
|
|
251
|
+
const tokenIcon = _chunk7JIDIX27cjs.getTokenIcon.call(void 0, asset.symbol);
|
|
252
|
+
const chainIcon = _chunk7JIDIX27cjs.getChainIcon.call(void 0, asset.chainId);
|
|
253
253
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
254
254
|
"button",
|
|
255
255
|
{
|
|
@@ -265,7 +265,7 @@ function AssetSelectStep({
|
|
|
265
265
|
"img",
|
|
266
266
|
{
|
|
267
267
|
src: chainIcon,
|
|
268
|
-
alt:
|
|
268
|
+
alt: _chunk7JIDIX27cjs.getChainName.call(void 0, asset.chainId)
|
|
269
269
|
}
|
|
270
270
|
) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
271
271
|
"span",
|
|
@@ -284,7 +284,7 @@ function AssetSelectStep({
|
|
|
284
284
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-name", children: asset.symbol }),
|
|
285
285
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-asset-chain", children: [
|
|
286
286
|
"on ",
|
|
287
|
-
|
|
287
|
+
_chunk7JIDIX27cjs.getChainName.call(void 0, asset.chainId)
|
|
288
288
|
] })
|
|
289
289
|
] }),
|
|
290
290
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-balance-small", children: [
|
|
@@ -294,14 +294,14 @@ function AssetSelectStep({
|
|
|
294
294
|
] })
|
|
295
295
|
] })
|
|
296
296
|
] }),
|
|
297
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ?
|
|
297
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunkMMXUBBGKcjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
298
298
|
]
|
|
299
299
|
},
|
|
300
300
|
asset.id
|
|
301
301
|
);
|
|
302
302
|
}) }),
|
|
303
303
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
304
|
-
|
|
304
|
+
_chunkMMXUBBGKcjs.Button,
|
|
305
305
|
{
|
|
306
306
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
307
307
|
disabled: !selectedAsset,
|
|
@@ -310,17 +310,17 @@ function AssetSelectStep({
|
|
|
310
310
|
}
|
|
311
311
|
)
|
|
312
312
|
] }),
|
|
313
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
313
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.PoweredBy, {})
|
|
314
314
|
] });
|
|
315
315
|
}
|
|
316
316
|
async function fetchNativeAssets(address, publicClient, existing) {
|
|
317
317
|
const existingIds = new Set(existing.map((asset) => asset.id));
|
|
318
318
|
const connectedChainId = _optionalChain([publicClient, 'access', _7 => _7.chain, 'optionalAccess', _8 => _8.id]);
|
|
319
319
|
if (!connectedChainId) return [];
|
|
320
|
-
if (!
|
|
321
|
-
const id =
|
|
320
|
+
if (!_chunk7JIDIX27cjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
|
|
321
|
+
const id = _chunkMMXUBBGKcjs.getAssetId.call(void 0, {
|
|
322
322
|
chainId: connectedChainId,
|
|
323
|
-
token:
|
|
323
|
+
token: _chunk7JIDIX27cjs.NATIVE_TOKEN_ADDRESS
|
|
324
324
|
});
|
|
325
325
|
if (existingIds.has(id)) return [];
|
|
326
326
|
try {
|
|
@@ -329,7 +329,7 @@ async function fetchNativeAssets(address, publicClient, existing) {
|
|
|
329
329
|
{
|
|
330
330
|
id,
|
|
331
331
|
chainId: connectedChainId,
|
|
332
|
-
token:
|
|
332
|
+
token: _chunk7JIDIX27cjs.NATIVE_TOKEN_ADDRESS,
|
|
333
333
|
symbol: "ETH",
|
|
334
334
|
name: "Ethereum",
|
|
335
335
|
decimals: 18,
|
|
@@ -491,8 +491,8 @@ function AmountStep({
|
|
|
491
491
|
const chainMismatch = Boolean(
|
|
492
492
|
_optionalChain([walletClient, 'optionalAccess', _13 => _13.chain, 'optionalAccess', _14 => _14.id]) && walletClient.chain.id !== asset.chainId
|
|
493
493
|
);
|
|
494
|
-
const targetSymbol =
|
|
495
|
-
const isSourceStablecoin =
|
|
494
|
+
const targetSymbol = _chunk7JIDIX27cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
495
|
+
const isSourceStablecoin = _chunk7JIDIX27cjs.isStablecoinSymbol.call(void 0, asset.symbol);
|
|
496
496
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
497
497
|
if (tokenPriceUsdOverride !== void 0 && tokenPriceUsdOverride > 0)
|
|
498
498
|
return tokenPriceUsdOverride;
|
|
@@ -516,7 +516,7 @@ function AmountStep({
|
|
|
516
516
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
517
517
|
if (!balanceTarget || !publicClient) return;
|
|
518
518
|
try {
|
|
519
|
-
const bal =
|
|
519
|
+
const bal = _chunkMMXUBBGKcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
520
520
|
address: asset.token,
|
|
521
521
|
abi: _viem.erc20Abi,
|
|
522
522
|
functionName: "balanceOf",
|
|
@@ -537,7 +537,7 @@ function AmountStep({
|
|
|
537
537
|
hasAttemptedSwitch.current = true;
|
|
538
538
|
switchChain(asset.chainId).catch((err) => {
|
|
539
539
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
540
|
-
setError(
|
|
540
|
+
setError(_chunkMMXUBBGKcjs.formatUserError.call(void 0, raw));
|
|
541
541
|
});
|
|
542
542
|
}
|
|
543
543
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -593,7 +593,7 @@ function AmountStep({
|
|
|
593
593
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
594
594
|
const numeric = Number(raw);
|
|
595
595
|
if (!Number.isFinite(numeric)) return raw;
|
|
596
|
-
return
|
|
596
|
+
return _chunkMMXUBBGKcjs.tokenFormatter.format(numeric);
|
|
597
597
|
} catch (e8) {
|
|
598
598
|
return "\u2026";
|
|
599
599
|
}
|
|
@@ -706,13 +706,13 @@ function AmountStep({
|
|
|
706
706
|
};
|
|
707
707
|
const continueLabel = exceedsBalance ? "Insufficient balance" : isAboveMax ? "Continue with max allowed deposit" : isBelowMin ? "Continue with minimum deposit" : "Continue";
|
|
708
708
|
const continueDisabled = chainMismatch || isCheckingLiquidity || exceedsBalance || numericAmount === 0 && !isBelowMin || balance === null;
|
|
709
|
-
const sourceChainName =
|
|
710
|
-
const targetChainName =
|
|
711
|
-
const sourceTokenIcon =
|
|
712
|
-
const targetTokenIcon =
|
|
709
|
+
const sourceChainName = _chunk7JIDIX27cjs.getChainName.call(void 0, asset.chainId);
|
|
710
|
+
const targetChainName = _chunk7JIDIX27cjs.getChainName.call(void 0, targetChain);
|
|
711
|
+
const sourceTokenIcon = _chunk7JIDIX27cjs.getTokenIcon.call(void 0, asset.symbol);
|
|
712
|
+
const targetTokenIcon = _chunk7JIDIX27cjs.getTokenIcon.call(void 0, targetSymbol);
|
|
713
713
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
714
714
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
715
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
715
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.WalletIcon, {}), title: "Wallet deposit" }),
|
|
716
716
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
717
717
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
718
718
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -732,13 +732,13 @@ function AmountStep({
|
|
|
732
732
|
" available",
|
|
733
733
|
balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
734
734
|
" (~",
|
|
735
|
-
|
|
735
|
+
_chunkMMXUBBGKcjs.currencyFormatter.format(balanceUsd),
|
|
736
736
|
")"
|
|
737
737
|
] })
|
|
738
738
|
] }),
|
|
739
739
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
740
740
|
"Min. deposit ",
|
|
741
|
-
|
|
741
|
+
_chunkMMXUBBGKcjs.currencyFormatter.format(minDepositUsd)
|
|
742
742
|
] })
|
|
743
743
|
] })
|
|
744
744
|
] }),
|
|
@@ -779,12 +779,12 @@ function AmountStep({
|
|
|
779
779
|
] }),
|
|
780
780
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
781
781
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
782
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
782
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkMMXUBBGKcjs.currencyFormatter.format(balanceAfterUsd) })
|
|
783
783
|
] })
|
|
784
784
|
] }),
|
|
785
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
785
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.Callout, { variant: "error", children: error }),
|
|
786
786
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
787
|
-
|
|
787
|
+
_chunkMMXUBBGKcjs.Button,
|
|
788
788
|
{
|
|
789
789
|
onClick: handleContinue,
|
|
790
790
|
fullWidth: true,
|
|
@@ -795,7 +795,7 @@ function AmountStep({
|
|
|
795
795
|
}
|
|
796
796
|
)
|
|
797
797
|
] }),
|
|
798
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
798
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.PoweredBy, {})
|
|
799
799
|
] });
|
|
800
800
|
}
|
|
801
801
|
|
|
@@ -833,13 +833,13 @@ function ConfirmStep({
|
|
|
833
833
|
_optionalChain([walletClient, 'optionalAccess', _22 => _22.chain, 'optionalAccess', _23 => _23.id]) && walletClient.chain.id !== asset.chainId
|
|
834
834
|
);
|
|
835
835
|
const sameRoute = targetChain === asset.chainId && targetToken.toLowerCase() === asset.token.toLowerCase();
|
|
836
|
-
const targetSymbol = sameRoute ? asset.symbol :
|
|
837
|
-
const sourceChainName =
|
|
838
|
-
const targetChainName =
|
|
839
|
-
const sourceChainIcon =
|
|
840
|
-
const targetChainIcon =
|
|
841
|
-
const sourceTokenIcon =
|
|
842
|
-
const targetTokenIcon =
|
|
836
|
+
const targetSymbol = sameRoute ? asset.symbol : _chunk7JIDIX27cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
837
|
+
const sourceChainName = _chunk7JIDIX27cjs.getChainName.call(void 0, asset.chainId);
|
|
838
|
+
const targetChainName = _chunk7JIDIX27cjs.getChainName.call(void 0, targetChain);
|
|
839
|
+
const sourceChainIcon = _chunk7JIDIX27cjs.getChainIcon.call(void 0, asset.chainId);
|
|
840
|
+
const targetChainIcon = _chunk7JIDIX27cjs.getChainIcon.call(void 0, targetChain);
|
|
841
|
+
const sourceTokenIcon = _chunk7JIDIX27cjs.getTokenIcon.call(void 0, asset.symbol);
|
|
842
|
+
const targetTokenIcon = _chunk7JIDIX27cjs.getTokenIcon.call(void 0, targetSymbol);
|
|
843
843
|
const formattedSendAmount = amount && !Number.isNaN(Number(amount)) ? Number(amount).toLocaleString("en-US", { maximumFractionDigits: 6 }) : "0";
|
|
844
844
|
const formattedReceiveAmount = (() => {
|
|
845
845
|
if (sameRoute) return formattedSendAmount;
|
|
@@ -860,7 +860,7 @@ function ConfirmStep({
|
|
|
860
860
|
hasAttemptedSwitch.current = true;
|
|
861
861
|
switchChain(asset.chainId).catch((err) => {
|
|
862
862
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
863
|
-
setError(
|
|
863
|
+
setError(_chunkMMXUBBGKcjs.formatUserError.call(void 0, raw));
|
|
864
864
|
});
|
|
865
865
|
}
|
|
866
866
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -907,7 +907,7 @@ function ConfirmStep({
|
|
|
907
907
|
const result = await executeTransfer(amountUnits);
|
|
908
908
|
hash = result.txHash;
|
|
909
909
|
resolvedSourceToken = result.sourceToken;
|
|
910
|
-
} else if (
|
|
910
|
+
} else if (_chunkMMXUBBGKcjs.isNativeAsset.call(void 0, asset)) {
|
|
911
911
|
hash = await walletClient.sendTransaction({
|
|
912
912
|
account,
|
|
913
913
|
chain,
|
|
@@ -928,7 +928,7 @@ function ConfirmStep({
|
|
|
928
928
|
onConfirm(hash, asset.chainId, amountUnits.toString(), resolvedSourceToken);
|
|
929
929
|
} catch (err) {
|
|
930
930
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
931
|
-
const message =
|
|
931
|
+
const message = _chunkMMXUBBGKcjs.formatUserError.call(void 0, raw);
|
|
932
932
|
setError(message);
|
|
933
933
|
_optionalChain([onError, 'optionalCall', _27 => _27(message, "TRANSFER_ERROR")]);
|
|
934
934
|
} finally {
|
|
@@ -937,7 +937,7 @@ function ConfirmStep({
|
|
|
937
937
|
};
|
|
938
938
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
939
939
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
940
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
940
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.WalletIcon, {}), title: "Review deposit" }),
|
|
941
941
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
|
|
942
942
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
943
943
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
@@ -989,13 +989,13 @@ function ConfirmStep({
|
|
|
989
989
|
children: "$0.04"
|
|
990
990
|
}
|
|
991
991
|
),
|
|
992
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
992
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.Tooltip, { content: feeTooltip, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-info", "aria-label": "Fee info", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.InfoIcon, {}) }) })
|
|
993
993
|
] })
|
|
994
994
|
] })
|
|
995
995
|
] }),
|
|
996
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
996
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.Callout, { variant: "error", children: error }),
|
|
997
997
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
998
|
-
|
|
998
|
+
_chunkMMXUBBGKcjs.Button,
|
|
999
999
|
{
|
|
1000
1000
|
onClick: handleConfirm,
|
|
1001
1001
|
loading: isSubmitting,
|
|
@@ -1006,7 +1006,7 @@ function ConfirmStep({
|
|
|
1006
1006
|
}
|
|
1007
1007
|
)
|
|
1008
1008
|
] }),
|
|
1009
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1009
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.PoweredBy, {})
|
|
1010
1010
|
] });
|
|
1011
1011
|
}
|
|
1012
1012
|
|
|
@@ -1029,9 +1029,9 @@ var INITIAL_POLL_INTERVAL = 3e3;
|
|
|
1029
1029
|
var MAX_POLL_INTERVAL = 3e4;
|
|
1030
1030
|
var BACKOFF_MULTIPLIER = 1.5;
|
|
1031
1031
|
function isEventForTx(event, txHash) {
|
|
1032
|
-
const eventTxHash =
|
|
1032
|
+
const eventTxHash = _chunkMMXUBBGKcjs.getEventTxHash.call(void 0, event);
|
|
1033
1033
|
if (!eventTxHash) return false;
|
|
1034
|
-
return
|
|
1034
|
+
return _chunkMMXUBBGKcjs.txRefsMatch.call(void 0, eventTxHash, txHash);
|
|
1035
1035
|
}
|
|
1036
1036
|
function truncateHash(hash) {
|
|
1037
1037
|
return `${hash.slice(0, 4)}\u2026${hash.slice(-4)}`;
|
|
@@ -1081,7 +1081,7 @@ function formatBridgeFailedMessage(event) {
|
|
|
1081
1081
|
}
|
|
1082
1082
|
return "Bridge failed";
|
|
1083
1083
|
}
|
|
1084
|
-
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1084
|
+
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.ExternalLinkIcon, { className: "rs-deposit-notification-link-icon" });
|
|
1085
1085
|
function DepositNotification({
|
|
1086
1086
|
deposit,
|
|
1087
1087
|
smartAccount,
|
|
@@ -1109,7 +1109,7 @@ function DepositNotification({
|
|
|
1109
1109
|
const pollIntervalRef = _react.useRef.call(void 0, INITIAL_POLL_INTERVAL);
|
|
1110
1110
|
const pollTimeoutRef = _react.useRef.call(void 0, null);
|
|
1111
1111
|
const completedRef = _react.useRef.call(void 0, _nullishCoalesce(directTransfer, () => ( false)));
|
|
1112
|
-
const depositContextRef =
|
|
1112
|
+
const depositContextRef = _chunkMMXUBBGKcjs.useLatestRef.call(void 0, {
|
|
1113
1113
|
amount,
|
|
1114
1114
|
sourceChain,
|
|
1115
1115
|
sourceToken: token,
|
|
@@ -1118,8 +1118,8 @@ function DepositNotification({
|
|
|
1118
1118
|
waitForFinalTx,
|
|
1119
1119
|
hasPostBridgeActions
|
|
1120
1120
|
});
|
|
1121
|
-
const onCompleteRef =
|
|
1122
|
-
const onFailedRef =
|
|
1121
|
+
const onCompleteRef = _chunkMMXUBBGKcjs.useLatestRef.call(void 0, onComplete);
|
|
1122
|
+
const onFailedRef = _chunkMMXUBBGKcjs.useLatestRef.call(void 0, onFailed);
|
|
1123
1123
|
const handleComplete = _react.useCallback.call(void 0,
|
|
1124
1124
|
(destTxHash) => {
|
|
1125
1125
|
if (completedRef.current) return;
|
|
@@ -1223,11 +1223,11 @@ function DepositNotification({
|
|
|
1223
1223
|
status,
|
|
1224
1224
|
txHash
|
|
1225
1225
|
]);
|
|
1226
|
-
const sourceExplorerUrl = sourceChain === "unknown" ? void 0 :
|
|
1227
|
-
const destExplorerUrl = destinationTxHash ?
|
|
1226
|
+
const sourceExplorerUrl = sourceChain === "unknown" ? void 0 : _chunk7JIDIX27cjs.getExplorerTxUrl.call(void 0, sourceChain, txHash);
|
|
1227
|
+
const destExplorerUrl = destinationTxHash ? _chunk7JIDIX27cjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
|
|
1228
1228
|
const title = status === "complete" ? "Deposit completed" : status === "failed" ? "Deposit failed" : "Deposit received and processing\u2026";
|
|
1229
1229
|
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.";
|
|
1230
|
-
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,
|
|
1230
|
+
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, _chunkMMXUBBGKcjs.CheckIcon, {}) }) : status === "failed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--failed", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.CloseIcon, {}) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--processing", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.Spinner, {}) });
|
|
1231
1231
|
const showClose = status !== "processing";
|
|
1232
1232
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1233
1233
|
"div",
|
|
@@ -1246,7 +1246,7 @@ function DepositNotification({
|
|
|
1246
1246
|
className: "rs-deposit-notification-close",
|
|
1247
1247
|
onClick: () => onDismiss(deposit.id),
|
|
1248
1248
|
"aria-label": "Dismiss",
|
|
1249
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1249
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.CloseIcon, {})
|
|
1250
1250
|
}
|
|
1251
1251
|
)
|
|
1252
1252
|
] }),
|
|
@@ -1262,7 +1262,7 @@ function DepositNotification({
|
|
|
1262
1262
|
"aria-expanded": expanded,
|
|
1263
1263
|
children: [
|
|
1264
1264
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: expanded ? "See less details" : "See more details" }),
|
|
1265
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1265
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.ChevronDownIcon, { className: "rs-deposit-notification-toggle-chevron" })
|
|
1266
1266
|
]
|
|
1267
1267
|
}
|
|
1268
1268
|
),
|
|
@@ -1316,7 +1316,7 @@ function DepositNotification({
|
|
|
1316
1316
|
// src/components/steps/DepositAddressStep.tsx
|
|
1317
1317
|
|
|
1318
1318
|
var QRCode = _react.lazy.call(void 0,
|
|
1319
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./QRCode-
|
|
1319
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./QRCode-KG47KTGX.cjs"))).then((m) => ({ default: m.QRCode }))
|
|
1320
1320
|
);
|
|
1321
1321
|
var POLL_INTERVAL_MS = 4e3;
|
|
1322
1322
|
function isRecord(value) {
|
|
@@ -1351,7 +1351,7 @@ function asString(value) {
|
|
|
1351
1351
|
function resolveSolanaTokenMeta(token) {
|
|
1352
1352
|
if (!token) return {};
|
|
1353
1353
|
const normalized = token.toLowerCase();
|
|
1354
|
-
const matched =
|
|
1354
|
+
const matched = _chunk7JIDIX27cjs.SOLANA_TOKENS.find(
|
|
1355
1355
|
(entry) => entry.mint.toLowerCase() === normalized
|
|
1356
1356
|
);
|
|
1357
1357
|
if (matched) {
|
|
@@ -1419,7 +1419,7 @@ function DepositAddressStep({
|
|
|
1419
1419
|
[_optionalChain([allowedRoutes, 'optionalAccess', _54 => _54.sourceTokens])]
|
|
1420
1420
|
);
|
|
1421
1421
|
const evmChainIds = _react.useMemo.call(void 0, () => {
|
|
1422
|
-
const all =
|
|
1422
|
+
const all = _chunk7JIDIX27cjs.getSupportedChainIds.call(void 0, );
|
|
1423
1423
|
return allowedChainSet ? all.filter((id) => allowedChainSet.has(id)) : all;
|
|
1424
1424
|
}, [allowedChainSet]);
|
|
1425
1425
|
const chainOptions = _react.useMemo.call(void 0, () => {
|
|
@@ -1433,7 +1433,7 @@ function DepositAddressStep({
|
|
|
1433
1433
|
const [sourceChainId, setSourceChainId] = _react.useState.call(void 0, defaultChainId);
|
|
1434
1434
|
const isSolana = sourceChainId === "solana";
|
|
1435
1435
|
const tokensForChain = _react.useMemo.call(void 0, () => {
|
|
1436
|
-
const all = isSolana ?
|
|
1436
|
+
const all = isSolana ? _chunk7JIDIX27cjs.SOLANA_TOKENS.map((t) => t.symbol) : _chunk7JIDIX27cjs.getTargetTokenSymbolsForChain.call(void 0, sourceChainId);
|
|
1437
1437
|
return allowedTokenSet ? all.filter((s) => allowedTokenSet.has(s.toUpperCase())) : all;
|
|
1438
1438
|
}, [sourceChainId, isSolana, allowedTokenSet]);
|
|
1439
1439
|
const defaultToken = tokensForChain.includes("USDC") ? "USDC" : _nullishCoalesce(tokensForChain[0], () => ( "USDC"));
|
|
@@ -1457,12 +1457,12 @@ function DepositAddressStep({
|
|
|
1457
1457
|
const notificationIdRef = _react.useRef.call(void 0, 0);
|
|
1458
1458
|
const sourceSelectionRef = _react.useRef.call(void 0, {
|
|
1459
1459
|
chainId: defaultChainId,
|
|
1460
|
-
token: typeof defaultChainId === "number" ?
|
|
1460
|
+
token: typeof defaultChainId === "number" ? _chunk7JIDIX27cjs.getTokenAddress.call(void 0, defaultToken, defaultChainId) : void 0,
|
|
1461
1461
|
sourceSymbol: defaultToken
|
|
1462
1462
|
});
|
|
1463
1463
|
_react.useEffect.call(void 0, () => {
|
|
1464
1464
|
if (isSolana) {
|
|
1465
|
-
const matched = _nullishCoalesce(
|
|
1465
|
+
const matched = _nullishCoalesce(_chunk7JIDIX27cjs.SOLANA_TOKENS.find((t) => t.symbol === sourceTokenSymbol), () => ( _chunk7JIDIX27cjs.SOLANA_TOKENS[0]));
|
|
1466
1466
|
sourceSelectionRef.current = {
|
|
1467
1467
|
chainId: "solana",
|
|
1468
1468
|
token: _optionalChain([matched, 'optionalAccess', _55 => _55.mint]),
|
|
@@ -1473,7 +1473,7 @@ function DepositAddressStep({
|
|
|
1473
1473
|
}
|
|
1474
1474
|
sourceSelectionRef.current = {
|
|
1475
1475
|
chainId: sourceChainId,
|
|
1476
|
-
token:
|
|
1476
|
+
token: _chunk7JIDIX27cjs.getTokenAddress.call(void 0, sourceTokenSymbol, sourceChainId),
|
|
1477
1477
|
sourceSymbol: sourceTokenSymbol
|
|
1478
1478
|
};
|
|
1479
1479
|
}, [sourceChainId, sourceTokenSymbol, isSolana]);
|
|
@@ -1485,7 +1485,7 @@ function DepositAddressStep({
|
|
|
1485
1485
|
setLiquidityHelper({ kind: "idle" });
|
|
1486
1486
|
return;
|
|
1487
1487
|
}
|
|
1488
|
-
const sourceTokenAddress =
|
|
1488
|
+
const sourceTokenAddress = _chunk7JIDIX27cjs.getTokenAddress.call(void 0,
|
|
1489
1489
|
sourceTokenSymbol,
|
|
1490
1490
|
sourceChainId
|
|
1491
1491
|
);
|
|
@@ -1625,10 +1625,10 @@ function DepositAddressStep({
|
|
|
1625
1625
|
return;
|
|
1626
1626
|
}
|
|
1627
1627
|
const event = status.lastEvent;
|
|
1628
|
-
const eventTxHash =
|
|
1628
|
+
const eventTxHash = _chunkMMXUBBGKcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkMMXUBBGKcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
1629
1629
|
if (baselineTxHashRef.current === void 0) {
|
|
1630
1630
|
baselineTxHashRef.current = eventTxHash;
|
|
1631
|
-
} else if (eventTxHash && (!baselineTxHashRef.current || !
|
|
1631
|
+
} else if (eventTxHash && (!baselineTxHashRef.current || !_chunkMMXUBBGKcjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
|
|
1632
1632
|
const details = getDepositEventDetails(event);
|
|
1633
1633
|
const chainId = _nullishCoalesce(details.chainId, () => ( "unknown"));
|
|
1634
1634
|
const amount = _nullishCoalesce(details.amount, () => ( "0"));
|
|
@@ -1698,10 +1698,10 @@ function DepositAddressStep({
|
|
|
1698
1698
|
const handleNotificationDismiss = _react.useCallback.call(void 0, (id) => {
|
|
1699
1699
|
setNotifications((prev) => prev.filter((n) => n.id !== id));
|
|
1700
1700
|
}, []);
|
|
1701
|
-
const qrIconSrc =
|
|
1701
|
+
const qrIconSrc = _chunk7JIDIX27cjs.getChainIcon.call(void 0, sourceChainId);
|
|
1702
1702
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-step--with-notifications", children: [
|
|
1703
1703
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
1704
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1704
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
1705
1705
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", children: [
|
|
1706
1706
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", ref: chainDropdownRef, children: [
|
|
1707
1707
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
@@ -1716,16 +1716,16 @@ function DepositAddressStep({
|
|
|
1716
1716
|
setTokenDropdownOpen(false);
|
|
1717
1717
|
},
|
|
1718
1718
|
children: [
|
|
1719
|
-
|
|
1719
|
+
_chunk7JIDIX27cjs.getChainIcon.call(void 0, sourceChainId) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1720
1720
|
"img",
|
|
1721
1721
|
{
|
|
1722
|
-
src:
|
|
1722
|
+
src: _chunk7JIDIX27cjs.getChainIcon.call(void 0, sourceChainId),
|
|
1723
1723
|
alt: "",
|
|
1724
1724
|
className: "rs-deposit-address-dropdown-icon"
|
|
1725
1725
|
}
|
|
1726
1726
|
),
|
|
1727
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children:
|
|
1728
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1727
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunk7JIDIX27cjs.getChainName.call(void 0, sourceChainId) }),
|
|
1728
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
1729
1729
|
]
|
|
1730
1730
|
}
|
|
1731
1731
|
),
|
|
@@ -1739,15 +1739,15 @@ function DepositAddressStep({
|
|
|
1739
1739
|
setChainDropdownOpen(false);
|
|
1740
1740
|
},
|
|
1741
1741
|
children: [
|
|
1742
|
-
|
|
1742
|
+
_chunk7JIDIX27cjs.getChainIcon.call(void 0, chainId) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1743
1743
|
"img",
|
|
1744
1744
|
{
|
|
1745
|
-
src:
|
|
1745
|
+
src: _chunk7JIDIX27cjs.getChainIcon.call(void 0, chainId),
|
|
1746
1746
|
alt: "",
|
|
1747
1747
|
className: "rs-deposit-address-dropdown-icon"
|
|
1748
1748
|
}
|
|
1749
1749
|
),
|
|
1750
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children:
|
|
1750
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunk7JIDIX27cjs.getChainName.call(void 0, chainId) })
|
|
1751
1751
|
]
|
|
1752
1752
|
},
|
|
1753
1753
|
String(chainId)
|
|
@@ -1759,8 +1759,8 @@ function DepositAddressStep({
|
|
|
1759
1759
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
1760
1760
|
"Min.$",
|
|
1761
1761
|
(_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _73 => _73.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
1762
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1763
|
-
|
|
1762
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1763
|
+
_chunkMMXUBBGKcjs.InfoIcon,
|
|
1764
1764
|
{
|
|
1765
1765
|
className: "rs-deposit-address-min-icon",
|
|
1766
1766
|
"aria-hidden": "true"
|
|
@@ -1779,16 +1779,16 @@ function DepositAddressStep({
|
|
|
1779
1779
|
setChainDropdownOpen(false);
|
|
1780
1780
|
},
|
|
1781
1781
|
children: [
|
|
1782
|
-
|
|
1782
|
+
_chunk7JIDIX27cjs.getTokenIcon.call(void 0, sourceTokenSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1783
1783
|
"img",
|
|
1784
1784
|
{
|
|
1785
|
-
src:
|
|
1785
|
+
src: _chunk7JIDIX27cjs.getTokenIcon.call(void 0, sourceTokenSymbol),
|
|
1786
1786
|
alt: "",
|
|
1787
1787
|
className: "rs-deposit-address-dropdown-icon"
|
|
1788
1788
|
}
|
|
1789
1789
|
),
|
|
1790
1790
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceTokenSymbol }),
|
|
1791
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1791
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
1792
1792
|
]
|
|
1793
1793
|
}
|
|
1794
1794
|
),
|
|
@@ -1802,10 +1802,10 @@ function DepositAddressStep({
|
|
|
1802
1802
|
setTokenDropdownOpen(false);
|
|
1803
1803
|
},
|
|
1804
1804
|
children: [
|
|
1805
|
-
|
|
1805
|
+
_chunk7JIDIX27cjs.getTokenIcon.call(void 0, symbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1806
1806
|
"img",
|
|
1807
1807
|
{
|
|
1808
|
-
src:
|
|
1808
|
+
src: _chunk7JIDIX27cjs.getTokenIcon.call(void 0, symbol),
|
|
1809
1809
|
alt: "",
|
|
1810
1810
|
className: "rs-deposit-address-dropdown-icon"
|
|
1811
1811
|
}
|
|
@@ -1840,7 +1840,7 @@ function DepositAddressStep({
|
|
|
1840
1840
|
alignItems: "center",
|
|
1841
1841
|
justifyContent: "center"
|
|
1842
1842
|
},
|
|
1843
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1843
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.Spinner, {})
|
|
1844
1844
|
}
|
|
1845
1845
|
),
|
|
1846
1846
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, QRCode, { value: displayAddress, size: 200, iconSrc: qrIconSrc })
|
|
@@ -1851,7 +1851,7 @@ function DepositAddressStep({
|
|
|
1851
1851
|
}
|
|
1852
1852
|
),
|
|
1853
1853
|
isUpdating ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-updating", role: "status", children: [
|
|
1854
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1854
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.Spinner, { className: "rs-spinner--sm" }),
|
|
1855
1855
|
"Updating deposit details\u2026"
|
|
1856
1856
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1857
1857
|
"button",
|
|
@@ -1860,7 +1860,7 @@ function DepositAddressStep({
|
|
|
1860
1860
|
className: "rs-deposit-address-copy",
|
|
1861
1861
|
onClick: handleCopy,
|
|
1862
1862
|
children: [
|
|
1863
|
-
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1863
|
+
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.CopyIcon, {}),
|
|
1864
1864
|
copied ? "Copied!" : "Copy address"
|
|
1865
1865
|
]
|
|
1866
1866
|
}
|
|
@@ -1885,16 +1885,16 @@ function DepositAddressStep({
|
|
|
1885
1885
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
|
|
1886
1886
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
|
|
1887
1887
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1888
|
-
|
|
1888
|
+
_chunkMMXUBBGKcjs.Tooltip,
|
|
1889
1889
|
{
|
|
1890
1890
|
className: "rs-price-impact-info",
|
|
1891
1891
|
content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
|
|
1892
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1892
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.InfoIcon, { "aria-hidden": "true" })
|
|
1893
1893
|
}
|
|
1894
1894
|
)
|
|
1895
1895
|
] }),
|
|
1896
1896
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1897
|
-
|
|
1897
|
+
_chunkMMXUBBGKcjs.ChevronDownIcon,
|
|
1898
1898
|
{
|
|
1899
1899
|
className: "rs-price-impact-chevron",
|
|
1900
1900
|
"aria-hidden": "true"
|
|
@@ -1905,29 +1905,29 @@ function DepositAddressStep({
|
|
|
1905
1905
|
),
|
|
1906
1906
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-price-impact-panel", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-panel-inner", children: [
|
|
1907
1907
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
1908
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1908
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.PercentIcon, {}) }),
|
|
1909
1909
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
1910
1910
|
"Max slippage: ",
|
|
1911
1911
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.2%" })
|
|
1912
1912
|
] }),
|
|
1913
1913
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1914
|
-
|
|
1914
|
+
_chunkMMXUBBGKcjs.Tooltip,
|
|
1915
1915
|
{
|
|
1916
1916
|
className: "rs-price-impact-info",
|
|
1917
1917
|
content: "Slippage accounts for price changes during execution. Slippage is adjusted per pair to ensure reliable execution.",
|
|
1918
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1918
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.InfoIcon, { "aria-hidden": "true" })
|
|
1919
1919
|
}
|
|
1920
1920
|
)
|
|
1921
1921
|
] }),
|
|
1922
1922
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
1923
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1923
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.ClockIcon, {}) }),
|
|
1924
1924
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
1925
1925
|
"Processing time: ",
|
|
1926
1926
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "< 1 min" })
|
|
1927
1927
|
] })
|
|
1928
1928
|
] }),
|
|
1929
1929
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
1930
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1930
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.PlusCircleIcon, {}) }),
|
|
1931
1931
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
1932
1932
|
"Max deposit:",
|
|
1933
1933
|
" ",
|
|
@@ -1960,7 +1960,7 @@ function DepositAddressStep({
|
|
|
1960
1960
|
},
|
|
1961
1961
|
deposit.id
|
|
1962
1962
|
)) }),
|
|
1963
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1963
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.PoweredBy, {})
|
|
1964
1964
|
] });
|
|
1965
1965
|
}
|
|
1966
1966
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -1992,14 +1992,14 @@ function SolanaTokenSelectStep({
|
|
|
1992
1992
|
setError(null);
|
|
1993
1993
|
const portfolioBySymbol = {};
|
|
1994
1994
|
try {
|
|
1995
|
-
|
|
1995
|
+
_chunkMMXUBBGKcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
|
|
1996
1996
|
solanaAddress
|
|
1997
1997
|
});
|
|
1998
1998
|
const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
|
|
1999
1999
|
if (!active) return;
|
|
2000
2000
|
for (const t of portfolio.tokens) {
|
|
2001
2001
|
const symbol = t.symbol.toUpperCase();
|
|
2002
|
-
if (!
|
|
2002
|
+
if (!_chunk7JIDIX27cjs.SOLANA_TOKENS.some((st) => st.symbol === symbol)) continue;
|
|
2003
2003
|
let parsed = 0n;
|
|
2004
2004
|
try {
|
|
2005
2005
|
parsed = BigInt(t.balance || "0");
|
|
@@ -2015,12 +2015,12 @@ function SolanaTokenSelectStep({
|
|
|
2015
2015
|
};
|
|
2016
2016
|
}
|
|
2017
2017
|
}
|
|
2018
|
-
|
|
2018
|
+
_chunkMMXUBBGKcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
|
|
2019
2019
|
symbols: Object.keys(portfolioBySymbol)
|
|
2020
2020
|
});
|
|
2021
2021
|
} catch (err) {
|
|
2022
2022
|
if (!active) return;
|
|
2023
|
-
|
|
2023
|
+
_chunkMMXUBBGKcjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
|
|
2024
2024
|
solanaAddress
|
|
2025
2025
|
});
|
|
2026
2026
|
setError(
|
|
@@ -2031,7 +2031,7 @@ function SolanaTokenSelectStep({
|
|
|
2031
2031
|
return;
|
|
2032
2032
|
}
|
|
2033
2033
|
const results = [];
|
|
2034
|
-
for (const token of
|
|
2034
|
+
for (const token of _chunk7JIDIX27cjs.SOLANA_TOKENS) {
|
|
2035
2035
|
const fromPortfolio = portfolioBySymbol[token.symbol];
|
|
2036
2036
|
if (fromPortfolio && fromPortfolio.balance > 0n) {
|
|
2037
2037
|
results.push({
|
|
@@ -2067,30 +2067,30 @@ function SolanaTokenSelectStep({
|
|
|
2067
2067
|
const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
|
|
2068
2068
|
const numeric = Number(raw);
|
|
2069
2069
|
if (!Number.isFinite(numeric)) return raw;
|
|
2070
|
-
return
|
|
2070
|
+
return _chunkMMXUBBGKcjs.tokenFormatter.format(numeric);
|
|
2071
2071
|
} catch (e16) {
|
|
2072
2072
|
return "--";
|
|
2073
2073
|
}
|
|
2074
2074
|
};
|
|
2075
|
-
const chainIcon =
|
|
2076
|
-
const chainName =
|
|
2075
|
+
const chainIcon = _chunk7JIDIX27cjs.getChainIcon.call(void 0, "solana");
|
|
2076
|
+
const chainName = _chunk7JIDIX27cjs.getChainName.call(void 0, "solana");
|
|
2077
2077
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
2078
2078
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
2079
2079
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2080
|
-
|
|
2080
|
+
_chunkMMXUBBGKcjs.BodyHeader,
|
|
2081
2081
|
{
|
|
2082
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2082
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.WalletIcon, {}),
|
|
2083
2083
|
title: "Your assets",
|
|
2084
2084
|
subtitle: "Select source assets to transfer"
|
|
2085
2085
|
}
|
|
2086
2086
|
),
|
|
2087
2087
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
2088
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2088
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
2089
2089
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
2090
2090
|
] }),
|
|
2091
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2091
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.Callout, { variant: "error", children: error }),
|
|
2092
2092
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
2093
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2093
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
2094
2094
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
2095
2095
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
2096
2096
|
solanaAddress.slice(0, 6),
|
|
@@ -2110,7 +2110,7 @@ function SolanaTokenSelectStep({
|
|
|
2110
2110
|
!loading && !error && rows.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: rows.map((entry) => {
|
|
2111
2111
|
const isSelected = selectedSymbol === entry.token.symbol;
|
|
2112
2112
|
const tokenAmount = formatBalance(entry);
|
|
2113
|
-
const tokenIcon =
|
|
2113
|
+
const tokenIcon = _chunk7JIDIX27cjs.getTokenIcon.call(void 0, entry.token.symbol);
|
|
2114
2114
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2115
2115
|
"button",
|
|
2116
2116
|
{
|
|
@@ -2139,14 +2139,14 @@ function SolanaTokenSelectStep({
|
|
|
2139
2139
|
] })
|
|
2140
2140
|
] })
|
|
2141
2141
|
] }),
|
|
2142
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ?
|
|
2142
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunkMMXUBBGKcjs.currencyFormatter.format(entry.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${entry.token.symbol}` : "--" })
|
|
2143
2143
|
]
|
|
2144
2144
|
},
|
|
2145
2145
|
entry.token.symbol
|
|
2146
2146
|
);
|
|
2147
2147
|
}) }),
|
|
2148
2148
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2149
|
-
|
|
2149
|
+
_chunkMMXUBBGKcjs.Button,
|
|
2150
2150
|
{
|
|
2151
2151
|
onClick: () => selectedEntry && onContinue(
|
|
2152
2152
|
selectedEntry.token,
|
|
@@ -2159,7 +2159,7 @@ function SolanaTokenSelectStep({
|
|
|
2159
2159
|
}
|
|
2160
2160
|
)
|
|
2161
2161
|
] }),
|
|
2162
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2162
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.PoweredBy, {})
|
|
2163
2163
|
] });
|
|
2164
2164
|
}
|
|
2165
2165
|
|
|
@@ -2190,7 +2190,7 @@ function SolanaAmountStep({
|
|
|
2190
2190
|
const [amount, setAmount] = _react.useState.call(void 0, "");
|
|
2191
2191
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
2192
2192
|
const hasAppliedDefaultRef = _react.useRef.call(void 0, false);
|
|
2193
|
-
const isSourceStablecoin =
|
|
2193
|
+
const isSourceStablecoin = _chunk7JIDIX27cjs.isStablecoinSymbol.call(void 0, token.symbol);
|
|
2194
2194
|
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess', _75 => _75.trim, 'call', _76 => _76(), 'access', _77 => _77.toLowerCase, 'call', _78 => _78()]) === "max";
|
|
2195
2195
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
2196
2196
|
if (isSourceStablecoin) return 1;
|
|
@@ -2211,7 +2211,7 @@ function SolanaAmountStep({
|
|
|
2211
2211
|
const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
|
|
2212
2212
|
const numeric = Number(raw);
|
|
2213
2213
|
if (!Number.isFinite(numeric)) return raw;
|
|
2214
|
-
return
|
|
2214
|
+
return _chunkMMXUBBGKcjs.tokenFormatter.format(numeric);
|
|
2215
2215
|
} catch (e18) {
|
|
2216
2216
|
return "\u2026";
|
|
2217
2217
|
}
|
|
@@ -2228,7 +2228,7 @@ function SolanaAmountStep({
|
|
|
2228
2228
|
}
|
|
2229
2229
|
}, [balance, token.decimals, tokenPriceUsd, balanceUsd]);
|
|
2230
2230
|
const spendableBalance = _react.useMemo.call(void 0, () => {
|
|
2231
|
-
if (!
|
|
2231
|
+
if (!_chunk7JIDIX27cjs.isNativeSol.call(void 0, token)) return balance;
|
|
2232
2232
|
return balance > SOL_FEE_RESERVE_LAMPORTS ? balance - SOL_FEE_RESERVE_LAMPORTS : 0n;
|
|
2233
2233
|
}, [balance, token]);
|
|
2234
2234
|
const spendableBalanceUsd = _react.useMemo.call(void 0, () => {
|
|
@@ -2304,7 +2304,7 @@ function SolanaAmountStep({
|
|
|
2304
2304
|
const handlePresetClick = (percentage) => {
|
|
2305
2305
|
const formatted = computePresetAmount(percentage);
|
|
2306
2306
|
if (!formatted) return;
|
|
2307
|
-
|
|
2307
|
+
_chunkMMXUBBGKcjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
|
|
2308
2308
|
percentage,
|
|
2309
2309
|
symbol: token.symbol,
|
|
2310
2310
|
formatted
|
|
@@ -2339,7 +2339,7 @@ function SolanaAmountStep({
|
|
|
2339
2339
|
try {
|
|
2340
2340
|
amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
|
|
2341
2341
|
} catch (e23) {
|
|
2342
|
-
|
|
2342
|
+
_chunkMMXUBBGKcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2343
2343
|
amount,
|
|
2344
2344
|
sourceAmount: sourceAmountStr,
|
|
2345
2345
|
reason: "parse-units-failed"
|
|
@@ -2348,13 +2348,13 @@ function SolanaAmountStep({
|
|
|
2348
2348
|
return;
|
|
2349
2349
|
}
|
|
2350
2350
|
if (amountInUnits > spendableBalance) {
|
|
2351
|
-
const isReserveIssue =
|
|
2351
|
+
const isReserveIssue = _chunk7JIDIX27cjs.isNativeSol.call(void 0, token) && amountInUnits <= balance;
|
|
2352
2352
|
setError(
|
|
2353
2353
|
isReserveIssue ? "Use a bit less than your full SOL balance" : "Insufficient balance"
|
|
2354
2354
|
);
|
|
2355
2355
|
return;
|
|
2356
2356
|
}
|
|
2357
|
-
|
|
2357
|
+
_chunkMMXUBBGKcjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
|
|
2358
2358
|
symbol: token.symbol,
|
|
2359
2359
|
inputAmountUsd: amount,
|
|
2360
2360
|
sourceAmount: sourceAmountStr,
|
|
@@ -2365,10 +2365,10 @@ function SolanaAmountStep({
|
|
|
2365
2365
|
};
|
|
2366
2366
|
const continueLabel = exceedsBalance ? "Insufficient balance" : isAboveMax ? "Continue with max allowed deposit" : isBelowMin ? "Continue with minimum deposit" : "Continue";
|
|
2367
2367
|
const continueDisabled = exceedsBalance || numericAmount === 0 && !isBelowMin;
|
|
2368
|
-
const sourceTokenIcon =
|
|
2368
|
+
const sourceTokenIcon = _chunk7JIDIX27cjs.getTokenIcon.call(void 0, token.symbol);
|
|
2369
2369
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
2370
2370
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2371
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2371
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.WalletIcon, {}), title: "Wallet deposit" }),
|
|
2372
2372
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
2373
2373
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
2374
2374
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2388,13 +2388,13 @@ function SolanaAmountStep({
|
|
|
2388
2388
|
" available",
|
|
2389
2389
|
computedBalanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2390
2390
|
" (~",
|
|
2391
|
-
|
|
2391
|
+
_chunkMMXUBBGKcjs.currencyFormatter.format(computedBalanceUsd),
|
|
2392
2392
|
")"
|
|
2393
2393
|
] })
|
|
2394
2394
|
] }),
|
|
2395
2395
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
2396
2396
|
"Min. deposit ",
|
|
2397
|
-
|
|
2397
|
+
_chunkMMXUBBGKcjs.currencyFormatter.format(minDepositUsd)
|
|
2398
2398
|
] })
|
|
2399
2399
|
] })
|
|
2400
2400
|
] }),
|
|
@@ -2433,12 +2433,12 @@ function SolanaAmountStep({
|
|
|
2433
2433
|
] }),
|
|
2434
2434
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
2435
2435
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
2436
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
2436
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkMMXUBBGKcjs.currencyFormatter.format(balanceAfterUsd) })
|
|
2437
2437
|
] })
|
|
2438
2438
|
] }),
|
|
2439
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2439
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.Callout, { variant: "error", children: error }),
|
|
2440
2440
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2441
|
-
|
|
2441
|
+
_chunkMMXUBBGKcjs.Button,
|
|
2442
2442
|
{
|
|
2443
2443
|
onClick: handleContinue,
|
|
2444
2444
|
fullWidth: true,
|
|
@@ -2447,7 +2447,7 @@ function SolanaAmountStep({
|
|
|
2447
2447
|
}
|
|
2448
2448
|
)
|
|
2449
2449
|
] }),
|
|
2450
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2450
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.PoweredBy, {})
|
|
2451
2451
|
] });
|
|
2452
2452
|
}
|
|
2453
2453
|
|
|
@@ -2583,14 +2583,14 @@ function SolanaConfirmStep({
|
|
|
2583
2583
|
}) {
|
|
2584
2584
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
2585
2585
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
2586
|
-
const targetSymbol =
|
|
2586
|
+
const targetSymbol = _chunk7JIDIX27cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
2587
2587
|
const isSameToken = token.symbol.toUpperCase() === targetSymbol.toUpperCase();
|
|
2588
|
-
const sourceChainName =
|
|
2589
|
-
const targetChainName =
|
|
2590
|
-
const sourceChainIcon =
|
|
2591
|
-
const targetChainIcon =
|
|
2592
|
-
const sourceTokenIcon =
|
|
2593
|
-
const targetTokenIcon =
|
|
2588
|
+
const sourceChainName = _chunk7JIDIX27cjs.getChainName.call(void 0, "solana");
|
|
2589
|
+
const targetChainName = _chunk7JIDIX27cjs.getChainName.call(void 0, targetChain);
|
|
2590
|
+
const sourceChainIcon = _chunk7JIDIX27cjs.getChainIcon.call(void 0, "solana");
|
|
2591
|
+
const targetChainIcon = _chunk7JIDIX27cjs.getChainIcon.call(void 0, targetChain);
|
|
2592
|
+
const sourceTokenIcon = _chunk7JIDIX27cjs.getTokenIcon.call(void 0, token.symbol);
|
|
2593
|
+
const targetTokenIcon = _chunk7JIDIX27cjs.getTokenIcon.call(void 0, targetSymbol);
|
|
2594
2594
|
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _83 => _83.feeSponsored]), () => ( false));
|
|
2595
2595
|
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _84 => _84.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
2596
2596
|
const formattedAmount = sourceAmount && !Number.isNaN(Number(sourceAmount)) ? Number(sourceAmount).toLocaleString("en-US", { maximumFractionDigits: 6 }) : "0";
|
|
@@ -2608,7 +2608,7 @@ function SolanaConfirmStep({
|
|
|
2608
2608
|
const receiveAmount = isSameToken ? formattedReceiveAmount : `~${formattedReceiveAmount}`;
|
|
2609
2609
|
const handleConfirm = async () => {
|
|
2610
2610
|
if (!solanaProvider) {
|
|
2611
|
-
|
|
2611
|
+
_chunkMMXUBBGKcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
2612
2612
|
reason: "missing-provider"
|
|
2613
2613
|
});
|
|
2614
2614
|
setError("Solana wallet not connected");
|
|
@@ -2616,7 +2616,7 @@ function SolanaConfirmStep({
|
|
|
2616
2616
|
}
|
|
2617
2617
|
const parsedAmount = parseFloat(sourceAmount);
|
|
2618
2618
|
if (isNaN(parsedAmount) || parsedAmount <= 0) {
|
|
2619
|
-
|
|
2619
|
+
_chunkMMXUBBGKcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
2620
2620
|
reason: "invalid-amount",
|
|
2621
2621
|
sourceAmount
|
|
2622
2622
|
});
|
|
@@ -2625,7 +2625,7 @@ function SolanaConfirmStep({
|
|
|
2625
2625
|
}
|
|
2626
2626
|
setError(null);
|
|
2627
2627
|
setIsSubmitting(true);
|
|
2628
|
-
|
|
2628
|
+
_chunkMMXUBBGKcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
|
|
2629
2629
|
smartAccount,
|
|
2630
2630
|
solanaAddress,
|
|
2631
2631
|
solanaDepositAddress,
|
|
@@ -2635,7 +2635,7 @@ function SolanaConfirmStep({
|
|
|
2635
2635
|
});
|
|
2636
2636
|
try {
|
|
2637
2637
|
const check = await service.checkAccount(smartAccount);
|
|
2638
|
-
|
|
2638
|
+
_chunkMMXUBBGKcjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
|
|
2639
2639
|
smartAccount,
|
|
2640
2640
|
isRegistered: check.isRegistered,
|
|
2641
2641
|
targetChain: check.targetChain,
|
|
@@ -2648,12 +2648,12 @@ function SolanaConfirmStep({
|
|
|
2648
2648
|
}
|
|
2649
2649
|
const connection = hasConfiguredSolanaRpcUrl() ? getSolanaConnection() : _nullishCoalesce(solanaConnection, () => ( getSolanaConnection()));
|
|
2650
2650
|
const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
|
|
2651
|
-
|
|
2651
|
+
_chunkMMXUBBGKcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
|
|
2652
2652
|
token: token.symbol,
|
|
2653
2653
|
sourceAmount,
|
|
2654
2654
|
amountUnits: amountUnits.toString()
|
|
2655
2655
|
});
|
|
2656
|
-
const transaction =
|
|
2656
|
+
const transaction = _chunk7JIDIX27cjs.isNativeSol.call(void 0, token) ? await buildSolTransferTransaction(
|
|
2657
2657
|
connection,
|
|
2658
2658
|
solanaAddress,
|
|
2659
2659
|
solanaDepositAddress,
|
|
@@ -2665,7 +2665,7 @@ function SolanaConfirmStep({
|
|
|
2665
2665
|
token.mint,
|
|
2666
2666
|
amountUnits
|
|
2667
2667
|
);
|
|
2668
|
-
|
|
2668
|
+
_chunkMMXUBBGKcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
2669
2669
|
token: token.symbol,
|
|
2670
2670
|
instructionCount: transaction.instructions.length,
|
|
2671
2671
|
feePayer: _optionalChain([transaction, 'access', _85 => _85.feePayer, 'optionalAccess', _86 => _86.toBase58, 'call', _87 => _87()]),
|
|
@@ -2676,15 +2676,15 @@ function SolanaConfirmStep({
|
|
|
2676
2676
|
connection,
|
|
2677
2677
|
transaction
|
|
2678
2678
|
);
|
|
2679
|
-
|
|
2679
|
+
_chunkMMXUBBGKcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
|
|
2680
2680
|
txHash,
|
|
2681
2681
|
amountUnits: amountUnits.toString()
|
|
2682
2682
|
});
|
|
2683
2683
|
onConfirm(txHash, amountUnits.toString());
|
|
2684
2684
|
} catch (err) {
|
|
2685
2685
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
2686
|
-
const message =
|
|
2687
|
-
|
|
2686
|
+
const message = _chunkMMXUBBGKcjs.formatUserError.call(void 0, raw);
|
|
2687
|
+
_chunkMMXUBBGKcjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
|
|
2688
2688
|
smartAccount,
|
|
2689
2689
|
token: token.symbol,
|
|
2690
2690
|
sourceAmount
|
|
@@ -2697,7 +2697,7 @@ function SolanaConfirmStep({
|
|
|
2697
2697
|
};
|
|
2698
2698
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
2699
2699
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2700
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2700
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.WalletIcon, {}), title: "Review deposit" }),
|
|
2701
2701
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
|
|
2702
2702
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
2703
2703
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
@@ -2749,13 +2749,13 @@ function SolanaConfirmStep({
|
|
|
2749
2749
|
children: "$0.04"
|
|
2750
2750
|
}
|
|
2751
2751
|
),
|
|
2752
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2752
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.Tooltip, { content: feeTooltip, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-info", "aria-label": "Fee info", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.InfoIcon, {}) }) })
|
|
2753
2753
|
] })
|
|
2754
2754
|
] })
|
|
2755
2755
|
] }),
|
|
2756
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2756
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.Callout, { variant: "error", children: error }),
|
|
2757
2757
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2758
|
-
|
|
2758
|
+
_chunkMMXUBBGKcjs.Button,
|
|
2759
2759
|
{
|
|
2760
2760
|
onClick: handleConfirm,
|
|
2761
2761
|
loading: isSubmitting,
|
|
@@ -2766,7 +2766,7 @@ function SolanaConfirmStep({
|
|
|
2766
2766
|
}
|
|
2767
2767
|
)
|
|
2768
2768
|
] }),
|
|
2769
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2769
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.PoweredBy, {})
|
|
2770
2770
|
] });
|
|
2771
2771
|
}
|
|
2772
2772
|
|
|
@@ -2780,21 +2780,21 @@ function DappImportAssetSelectStep({
|
|
|
2780
2780
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
2781
2781
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2782
2782
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2783
|
-
|
|
2783
|
+
_chunkMMXUBBGKcjs.BodyHeader,
|
|
2784
2784
|
{
|
|
2785
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2785
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.WalletIcon, {}),
|
|
2786
2786
|
title: `Transfer from ${sourceLabel}`,
|
|
2787
2787
|
subtitle: "Pick the balance to import"
|
|
2788
2788
|
}
|
|
2789
2789
|
),
|
|
2790
2790
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: assets.map((asset) => {
|
|
2791
|
-
const tokenAmount = asset.balance ?
|
|
2791
|
+
const tokenAmount = asset.balance ? _chunkMMXUBBGKcjs.tokenFormatter.format(
|
|
2792
2792
|
Number(asset.balance) / 10 ** asset.decimals
|
|
2793
2793
|
) : "0";
|
|
2794
|
-
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ?
|
|
2795
|
-
const tokenIcon = _nullishCoalesce(asset.icon, () => (
|
|
2796
|
-
const chainIcon =
|
|
2797
|
-
const badge =
|
|
2794
|
+
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ? _chunkMMXUBBGKcjs.currencyFormatter.format(asset.balanceUsd) : `${tokenAmount} ${asset.symbol}`;
|
|
2795
|
+
const tokenIcon = _nullishCoalesce(asset.icon, () => ( _chunk7JIDIX27cjs.getTokenIcon.call(void 0, asset.symbol)));
|
|
2796
|
+
const chainIcon = _chunk7JIDIX27cjs.getChainIcon.call(void 0, asset.chainId);
|
|
2797
|
+
const badge = _chunk7JIDIX27cjs.getChainBadge.call(void 0, asset.chainId);
|
|
2798
2798
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2799
2799
|
"button",
|
|
2800
2800
|
{
|
|
@@ -2809,7 +2809,7 @@ function DappImportAssetSelectStep({
|
|
|
2809
2809
|
"img",
|
|
2810
2810
|
{
|
|
2811
2811
|
src: chainIcon,
|
|
2812
|
-
alt:
|
|
2812
|
+
alt: _chunk7JIDIX27cjs.getChainName.call(void 0, asset.chainId)
|
|
2813
2813
|
}
|
|
2814
2814
|
) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2815
2815
|
"span",
|
|
@@ -2842,7 +2842,7 @@ function DappImportAssetSelectStep({
|
|
|
2842
2842
|
);
|
|
2843
2843
|
}) })
|
|
2844
2844
|
] }),
|
|
2845
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2845
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.PoweredBy, {})
|
|
2846
2846
|
] });
|
|
2847
2847
|
}
|
|
2848
2848
|
DappImportAssetSelectStep.displayName = "DappImportAssetSelectStep";
|
|
@@ -2908,7 +2908,7 @@ async function detectPolymarketWalletKind(params) {
|
|
|
2908
2908
|
contracts: [
|
|
2909
2909
|
{
|
|
2910
2910
|
address: proxyWallet,
|
|
2911
|
-
abi:
|
|
2911
|
+
abi: _chunkMMXUBBGKcjs.SAFE_ABI,
|
|
2912
2912
|
functionName: "isOwner",
|
|
2913
2913
|
args: [eoa]
|
|
2914
2914
|
},
|
|
@@ -3119,7 +3119,7 @@ async function executePolymarketSafeTransfer(params) {
|
|
|
3119
3119
|
}
|
|
3120
3120
|
const isOwner = await publicClient.readContract({
|
|
3121
3121
|
address: safeAddress,
|
|
3122
|
-
abi:
|
|
3122
|
+
abi: _chunkMMXUBBGKcjs.SAFE_ABI,
|
|
3123
3123
|
functionName: "isOwner",
|
|
3124
3124
|
args: [account.address]
|
|
3125
3125
|
});
|
|
@@ -3136,7 +3136,7 @@ async function executePolymarketSafeTransfer(params) {
|
|
|
3136
3136
|
account,
|
|
3137
3137
|
chain,
|
|
3138
3138
|
address: safeAddress,
|
|
3139
|
-
abi:
|
|
3139
|
+
abi: _chunkMMXUBBGKcjs.SAFE_ABI,
|
|
3140
3140
|
functionName: "execTransaction",
|
|
3141
3141
|
args: [
|
|
3142
3142
|
safeTx.to,
|
|
@@ -3155,7 +3155,7 @@ async function executePolymarketSafeTransfer(params) {
|
|
|
3155
3155
|
hash: txHash
|
|
3156
3156
|
});
|
|
3157
3157
|
const parsed = _viem.parseEventLogs.call(void 0, {
|
|
3158
|
-
abi:
|
|
3158
|
+
abi: _chunkMMXUBBGKcjs.SAFE_ABI,
|
|
3159
3159
|
logs: receipt.logs.filter(
|
|
3160
3160
|
(log) => log.address.toLowerCase() === safeAddress.toLowerCase()
|
|
3161
3161
|
),
|
|
@@ -3969,15 +3969,15 @@ var SetupError = class extends Error {
|
|
|
3969
3969
|
}
|
|
3970
3970
|
};
|
|
3971
3971
|
async function resolveSessionOwner(eoaAddress) {
|
|
3972
|
-
const local =
|
|
3972
|
+
const local = _chunkMMXUBBGKcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
3973
3973
|
if (local) {
|
|
3974
3974
|
return {
|
|
3975
|
-
account:
|
|
3975
|
+
account: _chunkMMXUBBGKcjs.accountFromPrivateKey.call(void 0, local.privateKey),
|
|
3976
3976
|
address: local.address
|
|
3977
3977
|
};
|
|
3978
3978
|
}
|
|
3979
|
-
const created =
|
|
3980
|
-
|
|
3979
|
+
const created = _chunkMMXUBBGKcjs.createSessionOwnerKey.call(void 0, );
|
|
3980
|
+
_chunkMMXUBBGKcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
3981
3981
|
return { account: created.account, address: created.address };
|
|
3982
3982
|
}
|
|
3983
3983
|
function stableStringify(value) {
|
|
@@ -4045,7 +4045,7 @@ async function runAccountSetup(input, deps) {
|
|
|
4045
4045
|
try {
|
|
4046
4046
|
const sessionOwner = await resolveSessionOwner(input.ownerAddress);
|
|
4047
4047
|
const cacheKey = computeCacheKey(input, sessionOwner.address);
|
|
4048
|
-
|
|
4048
|
+
_chunkMMXUBBGKcjs.debugLog.call(void 0, debug, "account-setup", "setup:start", {
|
|
4049
4049
|
owner: input.ownerAddress,
|
|
4050
4050
|
sessionOwner: sessionOwner.address,
|
|
4051
4051
|
hasPostBridgeActions: Boolean(_optionalChain([input, 'access', _99 => _99.postBridgeActions, 'optionalAccess', _100 => _100.length])),
|
|
@@ -4054,7 +4054,7 @@ async function runAccountSetup(input, deps) {
|
|
|
4054
4054
|
const setup = await service.setupAccount({
|
|
4055
4055
|
ownerAddress: input.ownerAddress,
|
|
4056
4056
|
sessionOwnerAddress: sessionOwner.address,
|
|
4057
|
-
targetChain:
|
|
4057
|
+
targetChain: _chunkMMXUBBGKcjs.targetChainToCaip2.call(void 0, input.targetChain),
|
|
4058
4058
|
targetToken: input.targetToken,
|
|
4059
4059
|
recipient: input.recipient,
|
|
4060
4060
|
postBridgeActions: input.postBridgeActions,
|
|
@@ -4093,7 +4093,7 @@ async function runAccountSetup(input, deps) {
|
|
|
4093
4093
|
primaryType: typedData.primaryType,
|
|
4094
4094
|
message: typedData.message
|
|
4095
4095
|
});
|
|
4096
|
-
const sessionDetails =
|
|
4096
|
+
const sessionDetails = _chunkMMXUBBGKcjs.buildSessionDetails.call(void 0,
|
|
4097
4097
|
setup.sessionDetailsUnsigned,
|
|
4098
4098
|
signature
|
|
4099
4099
|
);
|
|
@@ -4107,7 +4107,7 @@ async function runAccountSetup(input, deps) {
|
|
|
4107
4107
|
eoaAddress: input.ownerAddress,
|
|
4108
4108
|
sessionOwner: sessionOwner.address,
|
|
4109
4109
|
target: {
|
|
4110
|
-
chain:
|
|
4110
|
+
chain: _chunkMMXUBBGKcjs.targetChainToCaip2.call(void 0, input.targetChain),
|
|
4111
4111
|
token: input.targetToken,
|
|
4112
4112
|
...input.recipient && { recipient: input.recipient },
|
|
4113
4113
|
..._optionalChain([input, 'access', _101 => _101.postBridgeActions, 'optionalAccess', _102 => _102.length]) && {
|
|
@@ -4129,7 +4129,7 @@ async function runAccountSetup(input, deps) {
|
|
|
4129
4129
|
isRegistered: true
|
|
4130
4130
|
};
|
|
4131
4131
|
} catch (error) {
|
|
4132
|
-
|
|
4132
|
+
_chunkMMXUBBGKcjs.debugError.call(void 0, debug, "account-setup", "setup:failed", error, {
|
|
4133
4133
|
owner: input.ownerAddress
|
|
4134
4134
|
});
|
|
4135
4135
|
if (error instanceof SetupError) throw error;
|
|
@@ -4140,7 +4140,7 @@ function runAccountSetupDeduped(input, deps, requestKey) {
|
|
|
4140
4140
|
const now = Date.now();
|
|
4141
4141
|
const existing = setupRequestDedupe.get(requestKey);
|
|
4142
4142
|
if (existing && (!existing.settled || existing.expiresAt > now)) {
|
|
4143
|
-
|
|
4143
|
+
_chunkMMXUBBGKcjs.debugLog.call(void 0, deps.debug, "account-setup", "setup:dedupe-hit", {
|
|
4144
4144
|
owner: input.ownerAddress,
|
|
4145
4145
|
forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
|
|
4146
4146
|
});
|
|
@@ -4357,7 +4357,7 @@ function DepositFlow({
|
|
|
4357
4357
|
postBridgeActions,
|
|
4358
4358
|
outputTokenRules,
|
|
4359
4359
|
rejectUnmapped,
|
|
4360
|
-
signerAddress =
|
|
4360
|
+
signerAddress = _chunk7JIDIX27cjs.DEFAULT_SIGNER_ADDRESS,
|
|
4361
4361
|
sessionChainIds,
|
|
4362
4362
|
forceRegister = false,
|
|
4363
4363
|
waitForFinalTx = true,
|
|
@@ -4376,10 +4376,10 @@ function DepositFlow({
|
|
|
4376
4376
|
onError,
|
|
4377
4377
|
debug
|
|
4378
4378
|
}) {
|
|
4379
|
-
const onStepChangeRef =
|
|
4380
|
-
const onEventRef =
|
|
4381
|
-
const onLifecycleRef =
|
|
4382
|
-
const onErrorRef =
|
|
4379
|
+
const onStepChangeRef = _chunkMMXUBBGKcjs.useLatestRef.call(void 0, onStepChange);
|
|
4380
|
+
const onEventRef = _chunkMMXUBBGKcjs.useLatestRef.call(void 0, onEvent);
|
|
4381
|
+
const onLifecycleRef = _chunkMMXUBBGKcjs.useLatestRef.call(void 0, onLifecycle);
|
|
4382
|
+
const onErrorRef = _chunkMMXUBBGKcjs.useLatestRef.call(void 0, onError);
|
|
4383
4383
|
const hasInitialReownSession = Boolean(
|
|
4384
4384
|
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _105 => _105.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _106 => _106.address]) : _optionalChain([reownWallet, 'optionalAccess', _107 => _107.address])
|
|
4385
4385
|
);
|
|
@@ -4402,13 +4402,13 @@ function DepositFlow({
|
|
|
4402
4402
|
const stableWalletSelectionKeyRef = _react.useRef.call(void 0, null);
|
|
4403
4403
|
const logFlow = _react.useCallback.call(void 0,
|
|
4404
4404
|
(message, data) => {
|
|
4405
|
-
|
|
4405
|
+
_chunkMMXUBBGKcjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
|
|
4406
4406
|
},
|
|
4407
4407
|
[debug]
|
|
4408
4408
|
);
|
|
4409
4409
|
const logFlowError = _react.useCallback.call(void 0,
|
|
4410
4410
|
(message, error, data) => {
|
|
4411
|
-
|
|
4411
|
+
_chunkMMXUBBGKcjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
|
|
4412
4412
|
},
|
|
4413
4413
|
[debug]
|
|
4414
4414
|
);
|
|
@@ -4524,8 +4524,8 @@ function DepositFlow({
|
|
|
4524
4524
|
selectedWalletId
|
|
4525
4525
|
]);
|
|
4526
4526
|
const setupChainId = typeof targetChain === "number" ? targetChain : typeof defaultSourceChain === "number" ? defaultSourceChain : _chains.base.id;
|
|
4527
|
-
const targetSymbol =
|
|
4528
|
-
const isTargetStablecoin =
|
|
4527
|
+
const targetSymbol = _chunk7JIDIX27cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
4528
|
+
const isTargetStablecoin = _chunk7JIDIX27cjs.isStablecoinSymbol.call(void 0, targetSymbol);
|
|
4529
4529
|
const targetMarketPriceRef = _react.useRef.call(void 0, null);
|
|
4530
4530
|
_react.useEffect.call(void 0, () => {
|
|
4531
4531
|
targetMarketPriceRef.current = null;
|
|
@@ -4551,7 +4551,7 @@ function DepositFlow({
|
|
|
4551
4551
|
return {
|
|
4552
4552
|
ownerAddress: dappAddress,
|
|
4553
4553
|
walletClient: void 0,
|
|
4554
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
4554
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkMMXUBBGKcjs.getPublicClient.call(void 0, setupChainId))),
|
|
4555
4555
|
switchChain: void 0
|
|
4556
4556
|
};
|
|
4557
4557
|
}
|
|
@@ -4560,7 +4560,7 @@ function DepositFlow({
|
|
|
4560
4560
|
return {
|
|
4561
4561
|
ownerAddress: dappWalletClient.account.address,
|
|
4562
4562
|
walletClient: dappWalletClient,
|
|
4563
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
4563
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkMMXUBBGKcjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
4564
4564
|
switchChain: dappSwitchChain
|
|
4565
4565
|
};
|
|
4566
4566
|
}
|
|
@@ -4574,7 +4574,7 @@ function DepositFlow({
|
|
|
4574
4574
|
return {
|
|
4575
4575
|
ownerAddress: dappAddress,
|
|
4576
4576
|
walletClient: void 0,
|
|
4577
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
4577
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkMMXUBBGKcjs.getPublicClient.call(void 0, setupChainId))),
|
|
4578
4578
|
switchChain: void 0
|
|
4579
4579
|
};
|
|
4580
4580
|
}
|
|
@@ -4583,7 +4583,7 @@ function DepositFlow({
|
|
|
4583
4583
|
return {
|
|
4584
4584
|
ownerAddress: dappWalletClient.account.address,
|
|
4585
4585
|
walletClient: dappWalletClient,
|
|
4586
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
4586
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkMMXUBBGKcjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
4587
4587
|
switchChain: dappSwitchChain
|
|
4588
4588
|
};
|
|
4589
4589
|
}
|
|
@@ -4591,7 +4591,7 @@ function DepositFlow({
|
|
|
4591
4591
|
return {
|
|
4592
4592
|
ownerAddress: reownWallet.address,
|
|
4593
4593
|
walletClient: reownWallet.walletClient,
|
|
4594
|
-
publicClient: _nullishCoalesce(reownWallet.publicClient, () => (
|
|
4594
|
+
publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunkMMXUBBGKcjs.getPublicClient.call(void 0, setupChainId))),
|
|
4595
4595
|
switchChain: reownWallet.switchChain
|
|
4596
4596
|
};
|
|
4597
4597
|
}
|
|
@@ -4629,7 +4629,7 @@ function DepositFlow({
|
|
|
4629
4629
|
return {
|
|
4630
4630
|
ownerAddress: dappAddress,
|
|
4631
4631
|
walletClient: void 0,
|
|
4632
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
4632
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkMMXUBBGKcjs.getPublicClient.call(void 0, setupChainId))),
|
|
4633
4633
|
switchChain: void 0
|
|
4634
4634
|
};
|
|
4635
4635
|
}
|
|
@@ -4772,8 +4772,8 @@ function DepositFlow({
|
|
|
4772
4772
|
pred_balance: totalBalanceUsd
|
|
4773
4773
|
})]);
|
|
4774
4774
|
} else if (effectiveStep.type === "deposit-address") {
|
|
4775
|
-
const chainName =
|
|
4776
|
-
const tokenSymbol =
|
|
4775
|
+
const chainName = _chunk7JIDIX27cjs.getChainName.call(void 0, targetChain);
|
|
4776
|
+
const tokenSymbol = _chunk7JIDIX27cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
4777
4777
|
_optionalChain([onEventRef, 'access', _148 => _148.current, 'optionalCall', _149 => _149({
|
|
4778
4778
|
type: "deposit_modal_transfer_crypto_open",
|
|
4779
4779
|
default_chain: chainName,
|
|
@@ -4781,7 +4781,7 @@ function DepositFlow({
|
|
|
4781
4781
|
pred_balance: totalBalanceUsd
|
|
4782
4782
|
})]);
|
|
4783
4783
|
} else if (effectiveStep.type === "amount" && stepSendToken) {
|
|
4784
|
-
const receiveSymbol =
|
|
4784
|
+
const receiveSymbol = _chunk7JIDIX27cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
4785
4785
|
_optionalChain([onEventRef, 'access', _150 => _150.current, 'optionalCall', _151 => _151({
|
|
4786
4786
|
type: "deposit_modal_connected_wallet_enter_value_open",
|
|
4787
4787
|
send_token: stepSendToken,
|
|
@@ -4890,7 +4890,7 @@ function DepositFlow({
|
|
|
4890
4890
|
eoa: dappImportOwner,
|
|
4891
4891
|
getPublicClient: (chainId) => {
|
|
4892
4892
|
try {
|
|
4893
|
-
return
|
|
4893
|
+
return _chunkMMXUBBGKcjs.getPublicClient.call(void 0, chainId);
|
|
4894
4894
|
} catch (e28) {
|
|
4895
4895
|
return null;
|
|
4896
4896
|
}
|
|
@@ -4925,13 +4925,16 @@ function DepositFlow({
|
|
|
4925
4925
|
);
|
|
4926
4926
|
const connectStepDappImports = _react.useMemo.call(void 0,
|
|
4927
4927
|
() => enabledDappImportProviders.map((provider) => {
|
|
4928
|
-
const availabilityEntry = dappImportOwner && _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _159 => _159.toLowerCase, 'call', _160 => _160()]) === dappImportOwner.toLowerCase() ? dappImportAvailability[provider.id] : void 0;
|
|
4929
|
-
const dappImportSetup = readSetupForOwner(setupSlice, dappImportOwner);
|
|
4930
4928
|
const baseRow = {
|
|
4931
4929
|
id: provider.id,
|
|
4932
4930
|
label: provider.label,
|
|
4933
4931
|
icon: provider.icon
|
|
4934
4932
|
};
|
|
4933
|
+
if (!dappImportOwner) {
|
|
4934
|
+
return { ...baseRow, status: "needs-connect" };
|
|
4935
|
+
}
|
|
4936
|
+
const availabilityEntry = _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _159 => _159.toLowerCase, 'call', _160 => _160()]) === dappImportOwner.toLowerCase() ? dappImportAvailability[provider.id] : void 0;
|
|
4937
|
+
const dappImportSetup = readSetupForOwner(setupSlice, dappImportOwner);
|
|
4935
4938
|
if (availabilityEntry === "loading" || availabilityEntry === void 0) {
|
|
4936
4939
|
return { ...baseRow, status: "loading" };
|
|
4937
4940
|
}
|
|
@@ -5059,7 +5062,7 @@ function DepositFlow({
|
|
|
5059
5062
|
try {
|
|
5060
5063
|
sessionOwner = await resolveSessionOwner(owner);
|
|
5061
5064
|
} catch (error) {
|
|
5062
|
-
|
|
5065
|
+
_chunkMMXUBBGKcjs.debugError.call(void 0,
|
|
5063
5066
|
debug,
|
|
5064
5067
|
"deposit-flow",
|
|
5065
5068
|
"session-owner:resolve-failed",
|
|
@@ -5169,8 +5172,8 @@ function DepositFlow({
|
|
|
5169
5172
|
);
|
|
5170
5173
|
const handleSolanaAmountContinue = _react.useCallback.call(void 0,
|
|
5171
5174
|
(token, sourceAmount, inputAmountUsd) => {
|
|
5172
|
-
const targetSym =
|
|
5173
|
-
const isTargetStable =
|
|
5175
|
+
const targetSym = _chunk7JIDIX27cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
5176
|
+
const isTargetStable = _chunk7JIDIX27cjs.isStablecoinSymbol.call(void 0, targetSym);
|
|
5174
5177
|
const targetTokenPriceUsd = isTargetStable ? 1 : _nullishCoalesce(getTokenPriceUsd(targetSym), () => ( targetMarketPriceRef.current));
|
|
5175
5178
|
logFlow("solana:amount:continue", {
|
|
5176
5179
|
token: token.symbol,
|
|
@@ -5241,8 +5244,8 @@ function DepositFlow({
|
|
|
5241
5244
|
activeOwner
|
|
5242
5245
|
);
|
|
5243
5246
|
if (entry.status !== "ready") return;
|
|
5244
|
-
const targetSym =
|
|
5245
|
-
const isTargetStable =
|
|
5247
|
+
const targetSym = _chunk7JIDIX27cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
5248
|
+
const isTargetStable = _chunk7JIDIX27cjs.isStablecoinSymbol.call(void 0, targetSym);
|
|
5246
5249
|
const targetTokenPriceUsd = isTargetStable ? 1 : _nullishCoalesce(getTokenPriceUsd(targetSym), () => ( targetMarketPriceRef.current));
|
|
5247
5250
|
storeApi.dispatch({
|
|
5248
5251
|
type: "amount/entered",
|
|
@@ -5393,7 +5396,7 @@ function DepositFlow({
|
|
|
5393
5396
|
);
|
|
5394
5397
|
if (showConnectStep) {
|
|
5395
5398
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5396
|
-
|
|
5399
|
+
_chunkMMXUBBGKcjs.ConnectStep,
|
|
5397
5400
|
{
|
|
5398
5401
|
walletRows,
|
|
5399
5402
|
transferCryptoState: dappAddress ? transferCryptoState : void 0,
|
|
@@ -5464,8 +5467,8 @@ function DepositFlow({
|
|
|
5464
5467
|
onDepositComplete: handleDepositComplete,
|
|
5465
5468
|
onDepositFailed: handleDepositFailed,
|
|
5466
5469
|
onCopyAddress: () => {
|
|
5467
|
-
const chainName =
|
|
5468
|
-
const tokenSymbol =
|
|
5470
|
+
const chainName = _chunk7JIDIX27cjs.getChainName.call(void 0, targetChain);
|
|
5471
|
+
const tokenSymbol = _chunk7JIDIX27cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
5469
5472
|
_optionalChain([onEvent, 'optionalCall', _184 => _184({
|
|
5470
5473
|
type: "deposit_modal_transfer_crypto_cta_click",
|
|
5471
5474
|
default_chain: chainName,
|
|
@@ -5514,10 +5517,10 @@ function DepositFlow({
|
|
|
5514
5517
|
balanceUsd: effectiveStep.balanceUsd,
|
|
5515
5518
|
defaultAmount: effectiveStep.inputAmountUsd,
|
|
5516
5519
|
uiConfig,
|
|
5517
|
-
targetChainName:
|
|
5518
|
-
targetTokenSymbol:
|
|
5519
|
-
targetTokenIcon:
|
|
5520
|
-
|
|
5520
|
+
targetChainName: _chunk7JIDIX27cjs.getChainName.call(void 0, targetChain),
|
|
5521
|
+
targetTokenSymbol: _chunk7JIDIX27cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain),
|
|
5522
|
+
targetTokenIcon: _chunk7JIDIX27cjs.getTokenIcon.call(void 0,
|
|
5523
|
+
_chunk7JIDIX27cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain)
|
|
5521
5524
|
),
|
|
5522
5525
|
appBalanceUsd,
|
|
5523
5526
|
onContinue: handleSolanaAmountContinue,
|
|
@@ -5580,7 +5583,7 @@ function DepositFlow({
|
|
|
5580
5583
|
) })
|
|
5581
5584
|
] }) : null,
|
|
5582
5585
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5583
|
-
|
|
5586
|
+
_chunkMMXUBBGKcjs.ProcessingStep,
|
|
5584
5587
|
{
|
|
5585
5588
|
smartAccount: effectiveStep.smartAccount,
|
|
5586
5589
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
@@ -5615,7 +5618,7 @@ function DepositFlow({
|
|
|
5615
5618
|
if (_optionalChain([signerContext, 'access', _197 => _197.publicClient, 'access', _198 => _198.chain, 'optionalAccess', _199 => _199.id]) === chainId) {
|
|
5616
5619
|
return signerContext.publicClient;
|
|
5617
5620
|
}
|
|
5618
|
-
return
|
|
5621
|
+
return _chunkMMXUBBGKcjs.getPublicClient.call(void 0, chainId);
|
|
5619
5622
|
};
|
|
5620
5623
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
5621
5624
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -5672,7 +5675,7 @@ function DepositFlow({
|
|
|
5672
5675
|
service,
|
|
5673
5676
|
onContinue: handleAmountContinue,
|
|
5674
5677
|
onCtaClick: (ctaName) => {
|
|
5675
|
-
const receiveSymbol =
|
|
5678
|
+
const receiveSymbol = _chunk7JIDIX27cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
5676
5679
|
_optionalChain([onEvent, 'optionalCall', _203 => _203({
|
|
5677
5680
|
type: "deposit_modal_connected_wallet_enter_value_cta_click",
|
|
5678
5681
|
send_token: effectiveStep.asset.symbol,
|
|
@@ -5724,7 +5727,7 @@ function DepositFlow({
|
|
|
5724
5727
|
}
|
|
5725
5728
|
),
|
|
5726
5729
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5727
|
-
|
|
5730
|
+
_chunkMMXUBBGKcjs.ProcessingStep,
|
|
5728
5731
|
{
|
|
5729
5732
|
smartAccount: effectiveStep.smartAccount,
|
|
5730
5733
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
@@ -5776,8 +5779,8 @@ function formatDate(iso) {
|
|
|
5776
5779
|
function resolveChainId(value) {
|
|
5777
5780
|
if (value === void 0 || value === null) return null;
|
|
5778
5781
|
if (typeof value === "number") return value;
|
|
5779
|
-
if (
|
|
5780
|
-
const parsed =
|
|
5782
|
+
if (_chunkMMXUBBGKcjs.isSolanaCaip2.call(void 0, value) || value === "solana") return "solana";
|
|
5783
|
+
const parsed = _chunkMMXUBBGKcjs.parseEvmChainId.call(void 0, value);
|
|
5781
5784
|
if (parsed !== null) return parsed;
|
|
5782
5785
|
const num = Number(value);
|
|
5783
5786
|
return Number.isFinite(num) ? num : null;
|
|
@@ -5786,7 +5789,7 @@ function resolveTokenSymbol(token, chainId) {
|
|
|
5786
5789
|
if (!token) return "";
|
|
5787
5790
|
if (chainId === "solana") {
|
|
5788
5791
|
const normalized = token.toLowerCase();
|
|
5789
|
-
const matched =
|
|
5792
|
+
const matched = _chunk7JIDIX27cjs.SOLANA_TOKENS.find(
|
|
5790
5793
|
(entry) => entry.mint.toLowerCase() === normalized
|
|
5791
5794
|
);
|
|
5792
5795
|
if (matched) return matched.symbol;
|
|
@@ -5795,7 +5798,7 @@ function resolveTokenSymbol(token, chainId) {
|
|
|
5795
5798
|
}
|
|
5796
5799
|
}
|
|
5797
5800
|
if (chainId !== null && chainId !== void 0 && chainId !== "solana" && /^0x[a-fA-F0-9]{40}$/.test(token)) {
|
|
5798
|
-
const sym =
|
|
5801
|
+
const sym = _chunk7JIDIX27cjs.getTokenSymbol.call(void 0, token, chainId);
|
|
5799
5802
|
if (sym !== "Token") return sym;
|
|
5800
5803
|
}
|
|
5801
5804
|
return shortenHash(token);
|
|
@@ -5806,7 +5809,7 @@ function formatAmount(rawAmount, token, chainId) {
|
|
|
5806
5809
|
if (token && chainId !== null && chainId !== void 0) {
|
|
5807
5810
|
if (chainId === "solana") {
|
|
5808
5811
|
const normalized = token.toLowerCase();
|
|
5809
|
-
const matched =
|
|
5812
|
+
const matched = _chunk7JIDIX27cjs.SOLANA_TOKENS.find(
|
|
5810
5813
|
(entry) => entry.mint.toLowerCase() === normalized
|
|
5811
5814
|
);
|
|
5812
5815
|
if (matched) {
|
|
@@ -5815,7 +5818,7 @@ function formatAmount(rawAmount, token, chainId) {
|
|
|
5815
5818
|
decimals = 9;
|
|
5816
5819
|
}
|
|
5817
5820
|
} else if (/^0x[a-fA-F0-9]{40}$/.test(token)) {
|
|
5818
|
-
decimals =
|
|
5821
|
+
decimals = _chunk7JIDIX27cjs.getTokenDecimalsByAddress.call(void 0, token, chainId);
|
|
5819
5822
|
}
|
|
5820
5823
|
}
|
|
5821
5824
|
try {
|
|
@@ -5833,7 +5836,7 @@ function formatAmount(rawAmount, token, chainId) {
|
|
|
5833
5836
|
}
|
|
5834
5837
|
function getTxExplorerUrl(txHash, chainId) {
|
|
5835
5838
|
if (!chainId) return null;
|
|
5836
|
-
const base2 =
|
|
5839
|
+
const base2 = _chunk7JIDIX27cjs.getExplorerUrl.call(void 0, chainId);
|
|
5837
5840
|
if (!base2) return null;
|
|
5838
5841
|
return `${base2}/tx/${txHash}`;
|
|
5839
5842
|
}
|
|
@@ -5898,7 +5901,7 @@ function DepositHistoryPanel({
|
|
|
5898
5901
|
className: "rs-modal-header-back",
|
|
5899
5902
|
"aria-label": "Back",
|
|
5900
5903
|
onClick: onClose,
|
|
5901
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5904
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.ChevronLeftIcon, {})
|
|
5902
5905
|
}
|
|
5903
5906
|
) }),
|
|
5904
5907
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: onCloseModal && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -5908,29 +5911,29 @@ function DepositHistoryPanel({
|
|
|
5908
5911
|
className: "rs-modal-close",
|
|
5909
5912
|
"aria-label": "Close",
|
|
5910
5913
|
onClick: onCloseModal,
|
|
5911
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5914
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.CloseIcon, {})
|
|
5912
5915
|
}
|
|
5913
5916
|
) })
|
|
5914
5917
|
] }),
|
|
5915
5918
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen", children: [
|
|
5916
5919
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen-body", children: [
|
|
5917
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5920
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.HistoryIcon, {}), title: "History" }),
|
|
5918
5921
|
isLoading && deposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
5919
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5922
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.HistoryIcon, {}) }),
|
|
5920
5923
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
5921
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5924
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.Spinner, { className: "rs-spinner--sm" }),
|
|
5922
5925
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Loading history\u2026" })
|
|
5923
5926
|
] })
|
|
5924
5927
|
] }),
|
|
5925
5928
|
error && !isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
5926
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5929
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.AlertTriangleIcon, {}) }),
|
|
5927
5930
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
5928
5931
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "Couldn't load history" }),
|
|
5929
5932
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: error })
|
|
5930
5933
|
] })
|
|
5931
5934
|
] }),
|
|
5932
5935
|
!isLoading && !error && visibleDeposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
5933
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5936
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.HistoryIcon, {}) }),
|
|
5934
5937
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
5935
5938
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "No deposits yet" }),
|
|
5936
5939
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Your deposit history will appear here" })
|
|
@@ -5950,7 +5953,7 @@ function DepositHistoryPanel({
|
|
|
5950
5953
|
)
|
|
5951
5954
|
] })
|
|
5952
5955
|
] }),
|
|
5953
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5956
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.PoweredBy, {})
|
|
5954
5957
|
] })
|
|
5955
5958
|
]
|
|
5956
5959
|
}
|
|
@@ -5961,12 +5964,12 @@ function HistoryCard({ deposit }) {
|
|
|
5961
5964
|
const status = normalizeStatus(deposit.status, deposit.isSpam);
|
|
5962
5965
|
const sourceChainId = resolveChainId(deposit.chain);
|
|
5963
5966
|
const targetChainId = resolveChainId(deposit.targetChain);
|
|
5964
|
-
const sourceChainName = sourceChainId ?
|
|
5965
|
-
const targetChainName = targetChainId ?
|
|
5966
|
-
const sourceChainIcon = sourceChainId ?
|
|
5967
|
-
const targetChainIcon = targetChainId ?
|
|
5967
|
+
const sourceChainName = sourceChainId ? _chunk7JIDIX27cjs.getChainName.call(void 0, sourceChainId) : null;
|
|
5968
|
+
const targetChainName = targetChainId ? _chunk7JIDIX27cjs.getChainName.call(void 0, targetChainId) : null;
|
|
5969
|
+
const sourceChainIcon = sourceChainId ? _chunk7JIDIX27cjs.getChainIcon.call(void 0, sourceChainId) : void 0;
|
|
5970
|
+
const targetChainIcon = targetChainId ? _chunk7JIDIX27cjs.getChainIcon.call(void 0, targetChainId) : void 0;
|
|
5968
5971
|
const sourceSymbol = resolveTokenSymbol(deposit.token, sourceChainId);
|
|
5969
|
-
const sourceTokenIcon = sourceSymbol ?
|
|
5972
|
+
const sourceTokenIcon = sourceSymbol ? _chunk7JIDIX27cjs.getTokenIcon.call(void 0, sourceSymbol) : void 0;
|
|
5970
5973
|
const rawAmount = deposit.sourceAmount && deposit.sourceAmount !== "0" ? deposit.sourceAmount : deposit.amount;
|
|
5971
5974
|
const formattedAmount = rawAmount ? formatAmount(rawAmount, deposit.token, sourceChainId) : null;
|
|
5972
5975
|
const displayAmount = formattedAmount ? sourceSymbol && /^USD/.test(sourceSymbol) ? `$${Number(formattedAmount).toLocaleString("en-US", {
|
|
@@ -6025,7 +6028,7 @@ function HistoryCard({ deposit }) {
|
|
|
6025
6028
|
onClick: (e) => e.stopPropagation(),
|
|
6026
6029
|
children: [
|
|
6027
6030
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: shortenHash(deposit.sourceTxHash) }),
|
|
6028
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6031
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.ArrowUpRightIcon, {})
|
|
6029
6032
|
]
|
|
6030
6033
|
}
|
|
6031
6034
|
)
|
|
@@ -6040,7 +6043,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
|
6040
6043
|
// src/DepositModal.tsx
|
|
6041
6044
|
|
|
6042
6045
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
6043
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
6046
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-XUA47RYZ.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
6044
6047
|
);
|
|
6045
6048
|
function sortByCreatedAtDesc(items) {
|
|
6046
6049
|
return [...items].sort((a, b) => {
|
|
@@ -6089,9 +6092,9 @@ function DepositModalInner({
|
|
|
6089
6092
|
defaultAmount,
|
|
6090
6093
|
recipient,
|
|
6091
6094
|
appBalanceUsd,
|
|
6092
|
-
backendUrl =
|
|
6095
|
+
backendUrl = _chunk7JIDIX27cjs.DEFAULT_BACKEND_URL,
|
|
6093
6096
|
solanaRpcUrl,
|
|
6094
|
-
signerAddress =
|
|
6097
|
+
signerAddress = _chunk7JIDIX27cjs.DEFAULT_SIGNER_ADDRESS,
|
|
6095
6098
|
sessionChainIds,
|
|
6096
6099
|
forceRegister = false,
|
|
6097
6100
|
waitForFinalTx = true,
|
|
@@ -6115,7 +6118,7 @@ function DepositModalInner({
|
|
|
6115
6118
|
debug
|
|
6116
6119
|
}) {
|
|
6117
6120
|
const modalRef = _react.useRef.call(void 0, null);
|
|
6118
|
-
const onReadyRef =
|
|
6121
|
+
const onReadyRef = _chunkMMXUBBGKcjs.useLatestRef.call(void 0, onReady);
|
|
6119
6122
|
const [currentScreen, setCurrentScreen] = _react.useState.call(void 0, "connect");
|
|
6120
6123
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
6121
6124
|
void 0
|
|
@@ -6131,10 +6134,10 @@ function DepositModalInner({
|
|
|
6131
6134
|
const cursorRef = _react.useRef.call(void 0, null);
|
|
6132
6135
|
const historyStaleRef = _react.useRef.call(void 0, false);
|
|
6133
6136
|
const historyLoadedRef = _react.useRef.call(void 0, false);
|
|
6134
|
-
const targetChain = targetChainProp === "solana" ? "solana" :
|
|
6135
|
-
const sourceChain = sourceChainProp ?
|
|
6137
|
+
const targetChain = targetChainProp === "solana" ? "solana" : _chunk7JIDIX27cjs.getChainId.call(void 0, targetChainProp);
|
|
6138
|
+
const sourceChain = sourceChainProp ? _chunk7JIDIX27cjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
6136
6139
|
const service = _react.useMemo.call(void 0,
|
|
6137
|
-
() =>
|
|
6140
|
+
() => _chunkMMXUBBGKcjs.createDepositService.call(void 0, backendUrl, {
|
|
6138
6141
|
debug,
|
|
6139
6142
|
debugScope: "service:deposit"
|
|
6140
6143
|
}),
|
|
@@ -6150,7 +6153,7 @@ function DepositModalInner({
|
|
|
6150
6153
|
}, [store, targetChain, targetToken]);
|
|
6151
6154
|
_react.useEffect.call(void 0, () => {
|
|
6152
6155
|
if (isOpen && modalRef.current) {
|
|
6153
|
-
|
|
6156
|
+
_chunkMMXUBBGKcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
6154
6157
|
}
|
|
6155
6158
|
}, [isOpen, theme]);
|
|
6156
6159
|
_react.useEffect.call(void 0, () => {
|
|
@@ -6234,7 +6237,7 @@ function DepositModalInner({
|
|
|
6234
6237
|
fetchHistory("initial");
|
|
6235
6238
|
}
|
|
6236
6239
|
}, [historyOpen, fetchHistory]);
|
|
6237
|
-
const onLifecycleRef =
|
|
6240
|
+
const onLifecycleRef = _chunkMMXUBBGKcjs.useLatestRef.call(void 0, onLifecycle);
|
|
6238
6241
|
const handleLifecycle = _react.useCallback.call(void 0,
|
|
6239
6242
|
(event) => {
|
|
6240
6243
|
_optionalChain([onLifecycleRef, 'access', _211 => _211.current, 'optionalCall', _212 => _212(event)]);
|
|
@@ -6266,7 +6269,7 @@ function DepositModalInner({
|
|
|
6266
6269
|
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _213 => _213.showBackButton]), () => ( true));
|
|
6267
6270
|
const canGoBack = backHandler !== void 0;
|
|
6268
6271
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6269
|
-
|
|
6272
|
+
_chunkMMXUBBGKcjs.Modal,
|
|
6270
6273
|
{
|
|
6271
6274
|
isOpen,
|
|
6272
6275
|
onClose,
|
|
@@ -6282,7 +6285,7 @@ function DepositModalInner({
|
|
|
6282
6285
|
className: "rs-modal-header-back",
|
|
6283
6286
|
"aria-label": "Go back",
|
|
6284
6287
|
onClick: backHandler,
|
|
6285
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6288
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.ChevronLeftIcon, {})
|
|
6286
6289
|
}
|
|
6287
6290
|
) }),
|
|
6288
6291
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
|
|
@@ -6294,7 +6297,7 @@ function DepositModalInner({
|
|
|
6294
6297
|
"aria-label": "Deposit history",
|
|
6295
6298
|
onClick: handleHistoryOpen,
|
|
6296
6299
|
disabled: !recipient,
|
|
6297
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6300
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.HistoryIcon, {})
|
|
6298
6301
|
}
|
|
6299
6302
|
),
|
|
6300
6303
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -6304,7 +6307,7 @@ function DepositModalInner({
|
|
|
6304
6307
|
onClick: onClose,
|
|
6305
6308
|
className: "rs-modal-close",
|
|
6306
6309
|
"aria-label": "Close",
|
|
6307
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6310
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMMXUBBGKcjs.CloseIcon, {})
|
|
6308
6311
|
}
|
|
6309
6312
|
)
|
|
6310
6313
|
] })
|