@rhinestone/deposit-modal 0.3.0 → 0.3.1
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-6SUEC5IU.mjs → DepositModalReown-G7UX4IBZ.mjs} +5 -3
- package/dist/{DepositModalReown-DNW4GH6L.cjs → DepositModalReown-MECHBE6P.cjs} +8 -6
- package/dist/{WithdrawModalReown-7UAGSOSU.mjs → WithdrawModalReown-CUJAFUQM.mjs} +4 -3
- package/dist/{WithdrawModalReown-OUWBSKSM.cjs → WithdrawModalReown-WJ6VBZKK.cjs} +7 -6
- package/dist/{caip-CrQ2KKU-.d.cts → caip-CsslyHGL.d.cts} +1 -1
- package/dist/{caip-CrQ2KKU-.d.ts → caip-CsslyHGL.d.ts} +1 -1
- package/dist/{chunk-KAWJABTW.mjs → chunk-3C35DVPE.mjs} +2 -291
- package/dist/chunk-AJHFNHG3.cjs +295 -0
- package/dist/chunk-BAEB5AFZ.mjs +212 -0
- package/dist/{chunk-TKQYTBU6.mjs → chunk-DZQD3DAV.mjs} +7 -5
- package/dist/{chunk-2SMS542Q.cjs → chunk-LEL6GMEQ.cjs} +56 -54
- package/dist/{chunk-RABZINV3.cjs → chunk-MQIJZNTP.cjs} +3 -292
- package/dist/{chunk-KJ2RR2D4.mjs → chunk-QYSCCX4K.mjs} +534 -413
- package/dist/chunk-R5CPOBCF.cjs +212 -0
- package/dist/{chunk-GPSBM66J.mjs → chunk-R5WDHHVM.mjs} +1 -1
- package/dist/{chunk-VVJAIMKB.cjs → chunk-SPUZLWQS.cjs} +783 -662
- package/dist/chunk-TQ2AYMWS.mjs +295 -0
- package/dist/{chunk-33H6O5UU.cjs → chunk-ULEAK63T.cjs} +2 -2
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/deposit.cjs +5 -3
- package/dist/deposit.d.cts +4 -4
- package/dist/deposit.d.ts +4 -4
- package/dist/deposit.mjs +4 -2
- package/dist/index.cjs +6 -4
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.mjs +5 -3
- package/dist/polymarket.cjs +64 -0
- package/dist/polymarket.d.cts +57 -0
- package/dist/polymarket.d.ts +57 -0
- package/dist/polymarket.mjs +64 -0
- package/dist/styles.css +34 -0
- package/dist/{types-BMcGO5k_.d.cts → types-RzfAD14B.d.cts} +9 -0
- package/dist/{types-BMcGO5k_.d.ts → types-RzfAD14B.d.ts} +9 -0
- package/dist/withdraw.cjs +4 -3
- package/dist/withdraw.d.cts +4 -4
- package/dist/withdraw.d.ts +4 -4
- package/dist/withdraw.mjs +3 -2
- package/package.json +15 -2
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
+
var _chunkR5CPOBCFcjs = require('./chunk-R5CPOBCF.cjs');
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
|
|
@@ -50,7 +51,18 @@
|
|
|
50
51
|
|
|
51
52
|
|
|
52
53
|
|
|
53
|
-
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
var _chunkMQIJZNTPcjs = require('./chunk-MQIJZNTP.cjs');
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
var _chunkAJHFNHG3cjs = require('./chunk-AJHFNHG3.cjs');
|
|
54
66
|
|
|
55
67
|
|
|
56
68
|
|
|
@@ -127,13 +139,13 @@ function AssetSelectStep({
|
|
|
127
139
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
128
140
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
129
141
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
130
|
-
return
|
|
142
|
+
return _chunkMQIJZNTPcjs.getAssetId.call(void 0, {
|
|
131
143
|
chainId: defaultSourceChain,
|
|
132
144
|
token: defaultSourceToken
|
|
133
145
|
});
|
|
134
146
|
}, [defaultSourceChain, defaultSourceToken]);
|
|
135
|
-
const onTotalBalanceComputedRef =
|
|
136
|
-
const onAssetsLoadedRef =
|
|
147
|
+
const onTotalBalanceComputedRef = _chunkMQIJZNTPcjs.useLatestRef.call(void 0, onTotalBalanceComputed);
|
|
148
|
+
const onAssetsLoadedRef = _chunkMQIJZNTPcjs.useLatestRef.call(void 0, onAssetsLoaded);
|
|
137
149
|
_react.useEffect.call(void 0, () => {
|
|
138
150
|
let active = true;
|
|
139
151
|
function emitAssetsUpdate(currentAssets) {
|
|
@@ -141,8 +153,8 @@ function AssetSelectStep({
|
|
|
141
153
|
(sum, asset) => sum + (_nullishCoalesce(asset.balanceUsd, () => ( 0))),
|
|
142
154
|
0
|
|
143
155
|
);
|
|
144
|
-
_optionalChain([onTotalBalanceComputedRef, 'access',
|
|
145
|
-
if (currentAssets.length > 0) _optionalChain([onAssetsLoadedRef, 'access',
|
|
156
|
+
_optionalChain([onTotalBalanceComputedRef, 'access', _2 => _2.current, 'optionalCall', _3 => _3(total)]);
|
|
157
|
+
if (currentAssets.length > 0) _optionalChain([onAssetsLoadedRef, 'access', _4 => _4.current, 'optionalCall', _5 => _5(currentAssets)]);
|
|
146
158
|
}
|
|
147
159
|
async function loadPortfolio() {
|
|
148
160
|
if (!address) {
|
|
@@ -154,7 +166,7 @@ function AssetSelectStep({
|
|
|
154
166
|
try {
|
|
155
167
|
const portfolio = await service.fetchPortfolio(address);
|
|
156
168
|
if (!active) return;
|
|
157
|
-
const portfolioAssets =
|
|
169
|
+
const portfolioAssets = _chunkMQIJZNTPcjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
158
170
|
setAssets(portfolioAssets);
|
|
159
171
|
emitAssetsUpdate(portfolioAssets);
|
|
160
172
|
const hasNative = portfolioAssets.some(
|
|
@@ -194,12 +206,12 @@ function AssetSelectStep({
|
|
|
194
206
|
}
|
|
195
207
|
}, [assets, defaultAssetId, selectedAssetId]);
|
|
196
208
|
const allowedChainSet = _react.useMemo.call(void 0,
|
|
197
|
-
() => _optionalChain([allowedRoutes, 'optionalAccess',
|
|
198
|
-
[_optionalChain([allowedRoutes, 'optionalAccess',
|
|
209
|
+
() => _optionalChain([allowedRoutes, 'optionalAccess', _6 => _6.sourceChains]) ? new Set(allowedRoutes.sourceChains) : null,
|
|
210
|
+
[_optionalChain([allowedRoutes, 'optionalAccess', _7 => _7.sourceChains])]
|
|
199
211
|
);
|
|
200
212
|
const allowedTokenSet = _react.useMemo.call(void 0,
|
|
201
|
-
() => _optionalChain([allowedRoutes, 'optionalAccess',
|
|
202
|
-
[_optionalChain([allowedRoutes, 'optionalAccess',
|
|
213
|
+
() => _optionalChain([allowedRoutes, 'optionalAccess', _8 => _8.sourceTokens]) ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null,
|
|
214
|
+
[_optionalChain([allowedRoutes, 'optionalAccess', _9 => _9.sourceTokens])]
|
|
203
215
|
);
|
|
204
216
|
const rows = _react.useMemo.call(void 0, () => {
|
|
205
217
|
return assets.filter((a) => {
|
|
@@ -230,7 +242,7 @@ function AssetSelectStep({
|
|
|
230
242
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
231
243
|
const numeric = Number(raw);
|
|
232
244
|
if (!Number.isFinite(numeric)) return raw;
|
|
233
|
-
return
|
|
245
|
+
return _chunkMQIJZNTPcjs.tokenFormatter.format(numeric);
|
|
234
246
|
} catch (e3) {
|
|
235
247
|
return asset.balance;
|
|
236
248
|
}
|
|
@@ -238,20 +250,20 @@ function AssetSelectStep({
|
|
|
238
250
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
239
251
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
240
252
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
241
|
-
|
|
253
|
+
_chunkMQIJZNTPcjs.BodyHeader,
|
|
242
254
|
{
|
|
243
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
255
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.WalletIcon, {}),
|
|
244
256
|
title: "Your assets",
|
|
245
257
|
subtitle: "Select source assets to transfer"
|
|
246
258
|
}
|
|
247
259
|
),
|
|
248
260
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
249
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
261
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
250
262
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
251
263
|
] }),
|
|
252
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
264
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.Callout, { variant: "error", children: error }),
|
|
253
265
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
254
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
266
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
255
267
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
256
268
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
257
269
|
address.slice(0, 6),
|
|
@@ -318,14 +330,14 @@ function AssetSelectStep({
|
|
|
318
330
|
] })
|
|
319
331
|
] })
|
|
320
332
|
] }),
|
|
321
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ?
|
|
333
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunkMQIJZNTPcjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
322
334
|
]
|
|
323
335
|
},
|
|
324
336
|
asset.id
|
|
325
337
|
);
|
|
326
338
|
}) }),
|
|
327
339
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
328
|
-
|
|
340
|
+
_chunkMQIJZNTPcjs.Button,
|
|
329
341
|
{
|
|
330
342
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
331
343
|
disabled: !selectedAsset,
|
|
@@ -334,15 +346,15 @@ function AssetSelectStep({
|
|
|
334
346
|
}
|
|
335
347
|
)
|
|
336
348
|
] }),
|
|
337
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
349
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.PoweredBy, {})
|
|
338
350
|
] });
|
|
339
351
|
}
|
|
340
352
|
async function fetchNativeAssets(address, publicClient, existing) {
|
|
341
353
|
const existingIds = new Set(existing.map((asset) => asset.id));
|
|
342
|
-
const connectedChainId = _optionalChain([publicClient, 'access',
|
|
354
|
+
const connectedChainId = _optionalChain([publicClient, 'access', _10 => _10.chain, 'optionalAccess', _11 => _11.id]);
|
|
343
355
|
if (!connectedChainId) return [];
|
|
344
356
|
if (!_chunkMILJQWPTcjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
|
|
345
|
-
const id =
|
|
357
|
+
const id = _chunkMQIJZNTPcjs.getAssetId.call(void 0, {
|
|
346
358
|
chainId: connectedChainId,
|
|
347
359
|
token: _chunkMILJQWPTcjs.NATIVE_TOKEN_ADDRESS
|
|
348
360
|
});
|
|
@@ -510,9 +522,9 @@ function AmountStep({
|
|
|
510
522
|
const [isCheckingLiquidity, setIsCheckingLiquidity] = _react.useState.call(void 0, false);
|
|
511
523
|
const hasAttemptedSwitch = _react.useRef.call(void 0, false);
|
|
512
524
|
const hasAppliedDefaultRef = _react.useRef.call(void 0, false);
|
|
513
|
-
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess',
|
|
525
|
+
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess', _12 => _12.trim, 'call', _13 => _13(), 'access', _14 => _14.toLowerCase, 'call', _15 => _15()]) === "max";
|
|
514
526
|
const chainMismatch = Boolean(
|
|
515
|
-
_optionalChain([walletClient, 'optionalAccess',
|
|
527
|
+
_optionalChain([walletClient, 'optionalAccess', _16 => _16.chain, 'optionalAccess', _17 => _17.id]) && walletClient.chain.id !== asset.chainId
|
|
516
528
|
);
|
|
517
529
|
const targetSymbol = _chunkMILJQWPTcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
518
530
|
const isSourceStablecoin = _chunkMILJQWPTcjs.isStablecoinSymbol.call(void 0, asset.symbol);
|
|
@@ -539,7 +551,7 @@ function AmountStep({
|
|
|
539
551
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
540
552
|
if (!balanceTarget || !publicClient) return;
|
|
541
553
|
try {
|
|
542
|
-
const bal =
|
|
554
|
+
const bal = _chunkMQIJZNTPcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
543
555
|
address: asset.token,
|
|
544
556
|
abi: _viem.erc20Abi,
|
|
545
557
|
functionName: "balanceOf",
|
|
@@ -560,7 +572,7 @@ function AmountStep({
|
|
|
560
572
|
hasAttemptedSwitch.current = true;
|
|
561
573
|
switchChain(asset.chainId).catch((err) => {
|
|
562
574
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
563
|
-
setError(
|
|
575
|
+
setError(_chunkMQIJZNTPcjs.formatUserError.call(void 0, raw));
|
|
564
576
|
});
|
|
565
577
|
}
|
|
566
578
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -613,7 +625,7 @@ function AmountStep({
|
|
|
613
625
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
614
626
|
const numeric = Number(raw);
|
|
615
627
|
if (!Number.isFinite(numeric)) return raw;
|
|
616
|
-
return
|
|
628
|
+
return _chunkMQIJZNTPcjs.tokenFormatter.format(numeric);
|
|
617
629
|
} catch (e8) {
|
|
618
630
|
return "\u2026";
|
|
619
631
|
}
|
|
@@ -632,8 +644,8 @@ function AmountStep({
|
|
|
632
644
|
return null;
|
|
633
645
|
}
|
|
634
646
|
}, [numericAmount, isSourceStablecoin, hasPricing, tokenPriceUsd, asset.decimals]);
|
|
635
|
-
const minDepositUsd = targetChain === _chunkMILJQWPTcjs.HYPERCORE_CHAIN_ID ? Math.max(_chunkMILJQWPTcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
636
|
-
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
647
|
+
const minDepositUsd = targetChain === _chunkMILJQWPTcjs.HYPERCORE_CHAIN_ID ? Math.max(_chunkMILJQWPTcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _18 => _18.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _19 => _19.minDepositUsd]), () => ( null));
|
|
648
|
+
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _20 => _20.maxDepositUsd]), () => ( null));
|
|
637
649
|
const isBelowMin = minDepositUsd !== null && numericAmount > 0 && amountUsd < minDepositUsd;
|
|
638
650
|
const isAboveMax = maxDepositUsd !== null && amountUsd > maxDepositUsd;
|
|
639
651
|
const exceedsBalance = Boolean(
|
|
@@ -642,7 +654,7 @@ function AmountStep({
|
|
|
642
654
|
const balanceAfterUsd = appBalanceUsd !== void 0 ? appBalanceUsd + numericAmount : null;
|
|
643
655
|
const handlePresetClick = (percentage) => {
|
|
644
656
|
if (balance === null) return;
|
|
645
|
-
_optionalChain([onCtaClick, 'optionalCall',
|
|
657
|
+
_optionalChain([onCtaClick, 'optionalCall', _21 => _21(percentage === 100 ? "Max" : `${percentage}%`)]);
|
|
646
658
|
const next = formatAmountFromBalance(
|
|
647
659
|
balance,
|
|
648
660
|
asset.decimals,
|
|
@@ -689,13 +701,13 @@ function AmountStep({
|
|
|
689
701
|
return;
|
|
690
702
|
}
|
|
691
703
|
setError(null);
|
|
692
|
-
_optionalChain([onCtaClick, 'optionalCall',
|
|
704
|
+
_optionalChain([onCtaClick, 'optionalCall', _22 => _22("continue")]);
|
|
693
705
|
setIsCheckingLiquidity(true);
|
|
694
706
|
let liquidityWarning;
|
|
695
707
|
try {
|
|
696
708
|
const liquidity = await service.checkLiquidity({
|
|
697
|
-
sourceChainId: _nullishCoalesce(_optionalChain([liquiditySource, 'optionalAccess',
|
|
698
|
-
sourceToken: _nullishCoalesce(_optionalChain([liquiditySource, 'optionalAccess',
|
|
709
|
+
sourceChainId: _nullishCoalesce(_optionalChain([liquiditySource, 'optionalAccess', _23 => _23.chainId]), () => ( asset.chainId)),
|
|
710
|
+
sourceToken: _nullishCoalesce(_optionalChain([liquiditySource, 'optionalAccess', _24 => _24.token]), () => ( asset.token)),
|
|
699
711
|
destinationChainId: targetChain,
|
|
700
712
|
destinationToken: targetToken,
|
|
701
713
|
amount: amountInUnits.toString()
|
|
@@ -732,7 +744,7 @@ function AmountStep({
|
|
|
732
744
|
const targetTokenIcon = _chunkMILJQWPTcjs.getTokenIcon.call(void 0, targetSymbol);
|
|
733
745
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
734
746
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
735
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
747
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.WalletIcon, {}), title: "Wallet deposit" }),
|
|
736
748
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
737
749
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
738
750
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -752,13 +764,13 @@ function AmountStep({
|
|
|
752
764
|
" available",
|
|
753
765
|
balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
754
766
|
" (~",
|
|
755
|
-
|
|
767
|
+
_chunkMQIJZNTPcjs.currencyFormatter.format(balanceUsd),
|
|
756
768
|
")"
|
|
757
769
|
] })
|
|
758
770
|
] }),
|
|
759
771
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
760
772
|
"Min. deposit ",
|
|
761
|
-
|
|
773
|
+
_chunkMQIJZNTPcjs.currencyFormatter.format(minDepositUsd)
|
|
762
774
|
] })
|
|
763
775
|
] })
|
|
764
776
|
] }),
|
|
@@ -799,13 +811,13 @@ function AmountStep({
|
|
|
799
811
|
] }),
|
|
800
812
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
801
813
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
802
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
814
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkMQIJZNTPcjs.currencyFormatter.format(balanceAfterUsd) })
|
|
803
815
|
] })
|
|
804
816
|
] }),
|
|
805
|
-
targetChain === _chunkMILJQWPTcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
806
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
817
|
+
targetChain === _chunkMILJQWPTcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
|
|
818
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.Callout, { variant: "error", children: error }),
|
|
807
819
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
808
|
-
|
|
820
|
+
_chunkMQIJZNTPcjs.Button,
|
|
809
821
|
{
|
|
810
822
|
onClick: handleContinue,
|
|
811
823
|
fullWidth: true,
|
|
@@ -816,7 +828,7 @@ function AmountStep({
|
|
|
816
828
|
}
|
|
817
829
|
)
|
|
818
830
|
] }),
|
|
819
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
831
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.PoweredBy, {})
|
|
820
832
|
] });
|
|
821
833
|
}
|
|
822
834
|
|
|
@@ -853,7 +865,7 @@ function ConfirmStep({
|
|
|
853
865
|
const [quote, setQuote] = _react.useState.call(void 0, null);
|
|
854
866
|
const hasAttemptedSwitch = _react.useRef.call(void 0, false);
|
|
855
867
|
const chainMismatch = Boolean(
|
|
856
|
-
_optionalChain([walletClient, 'optionalAccess',
|
|
868
|
+
_optionalChain([walletClient, 'optionalAccess', _25 => _25.chain, 'optionalAccess', _26 => _26.id]) && walletClient.chain.id !== asset.chainId
|
|
857
869
|
);
|
|
858
870
|
const sameRoute = targetChain === asset.chainId && targetToken.toLowerCase() === asset.token.toLowerCase();
|
|
859
871
|
const targetSymbol = sameRoute ? asset.symbol : _chunkMILJQWPTcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
@@ -882,8 +894,8 @@ function ConfirmStep({
|
|
|
882
894
|
return formattedSendAmount;
|
|
883
895
|
})();
|
|
884
896
|
const receiveAmount = sameRoute ? formattedReceiveAmount : `~${formattedReceiveAmount}`;
|
|
885
|
-
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
886
|
-
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
897
|
+
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _27 => _27.feeSponsored]), () => ( false));
|
|
898
|
+
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _28 => _28.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
887
899
|
const feeDisplay = quote ? `$${quote.fees.totalUsd.toFixed(2)}` : null;
|
|
888
900
|
const estimatedTimeDisplay = quote ? quote.estimatedFillTimeSeconds < 60 ? "< 1 min" : `~${Math.round(quote.estimatedFillTimeSeconds / 60)} min` : estimatedTime;
|
|
889
901
|
_react.useEffect.call(void 0, () => {
|
|
@@ -891,7 +903,7 @@ function ConfirmStep({
|
|
|
891
903
|
hasAttemptedSwitch.current = true;
|
|
892
904
|
switchChain(asset.chainId).catch((err) => {
|
|
893
905
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
894
|
-
setError(
|
|
906
|
+
setError(_chunkMQIJZNTPcjs.formatUserError.call(void 0, raw));
|
|
895
907
|
});
|
|
896
908
|
}
|
|
897
909
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -971,7 +983,7 @@ function ConfirmStep({
|
|
|
971
983
|
const result = await executeTransfer(amountUnits);
|
|
972
984
|
hash = result.txHash;
|
|
973
985
|
resolvedSourceToken = result.sourceToken;
|
|
974
|
-
} else if (
|
|
986
|
+
} else if (_chunkMQIJZNTPcjs.isNativeAsset.call(void 0, asset)) {
|
|
975
987
|
hash = await walletClient.sendTransaction({
|
|
976
988
|
account,
|
|
977
989
|
chain,
|
|
@@ -988,20 +1000,20 @@ function ConfirmStep({
|
|
|
988
1000
|
args: [transferTo, amountUnits]
|
|
989
1001
|
});
|
|
990
1002
|
}
|
|
991
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
1003
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _29 => _29(hash, asset.chainId, amountUnits.toString())]);
|
|
992
1004
|
onConfirm(hash, asset.chainId, amountUnits.toString(), resolvedSourceToken);
|
|
993
1005
|
} catch (err) {
|
|
994
1006
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
995
|
-
const message =
|
|
1007
|
+
const message = _chunkMQIJZNTPcjs.formatUserError.call(void 0, raw);
|
|
996
1008
|
setError(message);
|
|
997
|
-
_optionalChain([onError, 'optionalCall',
|
|
1009
|
+
_optionalChain([onError, 'optionalCall', _30 => _30(message, "TRANSFER_ERROR")]);
|
|
998
1010
|
} finally {
|
|
999
1011
|
setIsSubmitting(false);
|
|
1000
1012
|
}
|
|
1001
1013
|
};
|
|
1002
1014
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
1003
1015
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
1004
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1016
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.WalletIcon, {}), title: "Review deposit" }),
|
|
1005
1017
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
|
|
1006
1018
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1007
1019
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
@@ -1059,14 +1071,14 @@ function ConfirmStep({
|
|
|
1059
1071
|
children: feeDisplay
|
|
1060
1072
|
}
|
|
1061
1073
|
),
|
|
1062
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1074
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.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, _chunkMQIJZNTPcjs.InfoIcon, {}) }) })
|
|
1063
1075
|
] })
|
|
1064
1076
|
] })
|
|
1065
1077
|
] }),
|
|
1066
|
-
targetChain === _chunkMILJQWPTcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1067
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1078
|
+
targetChain === _chunkMILJQWPTcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
|
|
1079
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.Callout, { variant: "error", children: error }),
|
|
1068
1080
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1069
|
-
|
|
1081
|
+
_chunkMQIJZNTPcjs.Button,
|
|
1070
1082
|
{
|
|
1071
1083
|
onClick: handleConfirm,
|
|
1072
1084
|
loading: isSubmitting,
|
|
@@ -1077,7 +1089,7 @@ function ConfirmStep({
|
|
|
1077
1089
|
}
|
|
1078
1090
|
)
|
|
1079
1091
|
] }),
|
|
1080
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1092
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.PoweredBy, {})
|
|
1081
1093
|
] });
|
|
1082
1094
|
}
|
|
1083
1095
|
|
|
@@ -1100,9 +1112,9 @@ var INITIAL_POLL_INTERVAL = 3e3;
|
|
|
1100
1112
|
var MAX_POLL_INTERVAL = 3e4;
|
|
1101
1113
|
var BACKOFF_MULTIPLIER = 1.5;
|
|
1102
1114
|
function isEventForTx(event, txHash) {
|
|
1103
|
-
const eventTxHash =
|
|
1115
|
+
const eventTxHash = _chunkMQIJZNTPcjs.getEventTxHash.call(void 0, event);
|
|
1104
1116
|
if (!eventTxHash) return false;
|
|
1105
|
-
return
|
|
1117
|
+
return _chunkMQIJZNTPcjs.txRefsMatch.call(void 0, eventTxHash, txHash);
|
|
1106
1118
|
}
|
|
1107
1119
|
function truncateHash(hash) {
|
|
1108
1120
|
return `${hash.slice(0, 4)}\u2026${hash.slice(-4)}`;
|
|
@@ -1132,7 +1144,7 @@ function formatTimestamp(ms) {
|
|
|
1132
1144
|
return `${month} ${day}${suffix} \xB7 ${hours}:${minutes}:${seconds}`;
|
|
1133
1145
|
}
|
|
1134
1146
|
function formatBridgeFailedMessage(event) {
|
|
1135
|
-
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess',
|
|
1147
|
+
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _31 => _31.data]), () => ( {}));
|
|
1136
1148
|
const backendMessage = typeof eventData.message === "string" ? eventData.message.trim() : "";
|
|
1137
1149
|
if (backendMessage.length > 0) {
|
|
1138
1150
|
const lower = backendMessage.toLowerCase();
|
|
@@ -1152,7 +1164,7 @@ function formatBridgeFailedMessage(event) {
|
|
|
1152
1164
|
}
|
|
1153
1165
|
return "Bridge failed";
|
|
1154
1166
|
}
|
|
1155
|
-
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1167
|
+
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.ExternalLinkIcon, { className: "rs-deposit-notification-link-icon" });
|
|
1156
1168
|
function DepositNotification({
|
|
1157
1169
|
deposit,
|
|
1158
1170
|
smartAccount,
|
|
@@ -1187,7 +1199,7 @@ function DepositNotification({
|
|
|
1187
1199
|
const pollIntervalRef = _react.useRef.call(void 0, INITIAL_POLL_INTERVAL);
|
|
1188
1200
|
const pollTimeoutRef = _react.useRef.call(void 0, null);
|
|
1189
1201
|
const completedRef = _react.useRef.call(void 0, _nullishCoalesce(directTransfer, () => ( false)));
|
|
1190
|
-
const depositContextRef =
|
|
1202
|
+
const depositContextRef = _chunkMQIJZNTPcjs.useLatestRef.call(void 0, {
|
|
1191
1203
|
amount,
|
|
1192
1204
|
sourceChain,
|
|
1193
1205
|
sourceToken: token,
|
|
@@ -1196,8 +1208,8 @@ function DepositNotification({
|
|
|
1196
1208
|
targetToken,
|
|
1197
1209
|
hasPostBridgeActions
|
|
1198
1210
|
});
|
|
1199
|
-
const onCompleteRef =
|
|
1200
|
-
const onFailedRef =
|
|
1211
|
+
const onCompleteRef = _chunkMQIJZNTPcjs.useLatestRef.call(void 0, onComplete);
|
|
1212
|
+
const onFailedRef = _chunkMQIJZNTPcjs.useLatestRef.call(void 0, onFailed);
|
|
1201
1213
|
const handleComplete = _react.useCallback.call(void 0,
|
|
1202
1214
|
(destTxHash) => {
|
|
1203
1215
|
if (completedRef.current) return;
|
|
@@ -1206,7 +1218,7 @@ function DepositNotification({
|
|
|
1206
1218
|
setCompletedAt(Date.now());
|
|
1207
1219
|
setStatus("complete");
|
|
1208
1220
|
const context = depositContextRef.current;
|
|
1209
|
-
_optionalChain([onCompleteRef, 'access',
|
|
1221
|
+
_optionalChain([onCompleteRef, 'access', _32 => _32.current, 'optionalCall', _33 => _33(txHash, destTxHash, {
|
|
1210
1222
|
amount: context.amount,
|
|
1211
1223
|
sourceChain: context.sourceChain,
|
|
1212
1224
|
sourceToken: context.sourceToken,
|
|
@@ -1222,7 +1234,7 @@ function DepositNotification({
|
|
|
1222
1234
|
if (completedRef.current) return;
|
|
1223
1235
|
completedRef.current = true;
|
|
1224
1236
|
setStatus("failed");
|
|
1225
|
-
_optionalChain([onFailedRef, 'access',
|
|
1237
|
+
_optionalChain([onFailedRef, 'access', _34 => _34.current, 'optionalCall', _35 => _35(txHash, error)]);
|
|
1226
1238
|
},
|
|
1227
1239
|
[onFailedRef, txHash]
|
|
1228
1240
|
);
|
|
@@ -1241,26 +1253,26 @@ function DepositNotification({
|
|
|
1241
1253
|
const lastEvent = data.lastEvent;
|
|
1242
1254
|
const eventForTx = isEventForTx(lastEvent, txHash) ? lastEvent : void 0;
|
|
1243
1255
|
const awaitingPostBridgeSwap = depositContextRef.current.hasPostBridgeActions;
|
|
1244
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
1245
|
-
const swapTxHash = _optionalChain([eventForTx, 'access',
|
|
1256
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _36 => _36.type]) === "post-bridge-swap-complete") {
|
|
1257
|
+
const swapTxHash = _optionalChain([eventForTx, 'access', _37 => _37.data, 'optionalAccess', _38 => _38.swap, 'optionalAccess', _39 => _39.transactionHash]);
|
|
1246
1258
|
handleComplete(swapTxHash);
|
|
1247
1259
|
return;
|
|
1248
1260
|
}
|
|
1249
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
1261
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _40 => _40.type]) === "post-bridge-swap-failed") {
|
|
1250
1262
|
handleFailed(formatBridgeFailedMessage(eventForTx));
|
|
1251
1263
|
return;
|
|
1252
1264
|
}
|
|
1253
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
1254
|
-
const destTx = _optionalChain([eventForTx, 'access',
|
|
1265
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _41 => _41.type]) === "bridge-complete" && !awaitingPostBridgeSwap) {
|
|
1266
|
+
const destTx = _optionalChain([eventForTx, 'access', _42 => _42.data, 'optionalAccess', _43 => _43.destination, 'optionalAccess', _44 => _44.transactionHash]);
|
|
1255
1267
|
handleComplete(destTx);
|
|
1256
1268
|
return;
|
|
1257
1269
|
}
|
|
1258
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
1270
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _45 => _45.type]) === "bridge-failed") {
|
|
1259
1271
|
handleFailed(formatBridgeFailedMessage(eventForTx));
|
|
1260
1272
|
return;
|
|
1261
1273
|
}
|
|
1262
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
1263
|
-
const errorMessage = _nullishCoalesce(_optionalChain([eventForTx, 'access',
|
|
1274
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _46 => _46.type]) === "error") {
|
|
1275
|
+
const errorMessage = _nullishCoalesce(_optionalChain([eventForTx, 'access', _47 => _47.data, 'optionalAccess', _48 => _48.message]), () => ( "Unknown error"));
|
|
1264
1276
|
handleFailed(errorMessage);
|
|
1265
1277
|
return;
|
|
1266
1278
|
}
|
|
@@ -1302,7 +1314,7 @@ function DepositNotification({
|
|
|
1302
1314
|
const destExplorerUrl = destinationTxHash ? _chunkMILJQWPTcjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
|
|
1303
1315
|
const title = status === "complete" ? "Deposit completed" : status === "failed" ? "Deposit failed" : "Deposit received and processing\u2026";
|
|
1304
1316
|
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.";
|
|
1305
|
-
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,
|
|
1317
|
+
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, _chunkMQIJZNTPcjs.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, _chunkMQIJZNTPcjs.CloseIcon, {}) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--processing", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1306
1318
|
"svg",
|
|
1307
1319
|
{
|
|
1308
1320
|
className: "rs-deposit-notification-spinner",
|
|
@@ -1352,7 +1364,7 @@ function DepositNotification({
|
|
|
1352
1364
|
className: "rs-deposit-notification-close",
|
|
1353
1365
|
onClick: () => onDismiss(deposit.id),
|
|
1354
1366
|
"aria-label": "Dismiss",
|
|
1355
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1367
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.CloseIcon, {})
|
|
1356
1368
|
}
|
|
1357
1369
|
)
|
|
1358
1370
|
] }),
|
|
@@ -1368,7 +1380,7 @@ function DepositNotification({
|
|
|
1368
1380
|
"aria-expanded": expanded,
|
|
1369
1381
|
children: [
|
|
1370
1382
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: expanded ? "See less details" : "See more details" }),
|
|
1371
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1383
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.ChevronDownIcon, { className: "rs-deposit-notification-toggle-chevron" })
|
|
1372
1384
|
]
|
|
1373
1385
|
}
|
|
1374
1386
|
),
|
|
@@ -1469,7 +1481,7 @@ function resolveSolanaTokenMeta(token) {
|
|
|
1469
1481
|
return {};
|
|
1470
1482
|
}
|
|
1471
1483
|
function getDepositEventDetails(event) {
|
|
1472
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
1484
|
+
if (!_optionalChain([event, 'optionalAccess', _49 => _49.type]) || !isRecord(event.data)) return {};
|
|
1473
1485
|
if (event.type === "deposit-received") {
|
|
1474
1486
|
const chainId = asChainId(event.data.chain);
|
|
1475
1487
|
const token = asString(event.data.token);
|
|
@@ -1484,12 +1496,12 @@ function getDepositEventDetails(event) {
|
|
|
1484
1496
|
const source = isRecord(event.data.source) ? event.data.source : void 0;
|
|
1485
1497
|
const deposit = isRecord(event.data.deposit) ? event.data.deposit : void 0;
|
|
1486
1498
|
if (source || deposit) {
|
|
1487
|
-
const chainId = _nullishCoalesce(asChainId(_optionalChain([source, 'optionalAccess',
|
|
1488
|
-
const token = _nullishCoalesce(_nullishCoalesce(asString(_optionalChain([source, 'optionalAccess',
|
|
1499
|
+
const chainId = _nullishCoalesce(asChainId(_optionalChain([source, 'optionalAccess', _50 => _50.chain])), () => ( asChainId(_optionalChain([deposit, 'optionalAccess', _51 => _51.chain]))));
|
|
1500
|
+
const token = _nullishCoalesce(_nullishCoalesce(asString(_optionalChain([source, 'optionalAccess', _52 => _52.asset])), () => ( asString(_optionalChain([deposit, 'optionalAccess', _53 => _53.asset])))), () => ( asString(_optionalChain([deposit, 'optionalAccess', _54 => _54.token]))));
|
|
1489
1501
|
const solanaMeta = chainId === "solana" ? resolveSolanaTokenMeta(token) : {};
|
|
1490
1502
|
return {
|
|
1491
1503
|
chainId,
|
|
1492
|
-
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess',
|
|
1504
|
+
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess', _55 => _55.amount])), () => ( asAmount(_optionalChain([deposit, 'optionalAccess', _56 => _56.amount])))),
|
|
1493
1505
|
token,
|
|
1494
1506
|
...solanaMeta
|
|
1495
1507
|
};
|
|
@@ -1525,12 +1537,12 @@ function DepositAddressStep({
|
|
|
1525
1537
|
}) {
|
|
1526
1538
|
const hasSolana = Boolean(solanaDepositAddress);
|
|
1527
1539
|
const allowedChainSet = _react.useMemo.call(void 0,
|
|
1528
|
-
() => _optionalChain([allowedRoutes, 'optionalAccess',
|
|
1529
|
-
[_optionalChain([allowedRoutes, 'optionalAccess',
|
|
1540
|
+
() => _optionalChain([allowedRoutes, 'optionalAccess', _57 => _57.sourceChains]) ? new Set(allowedRoutes.sourceChains) : null,
|
|
1541
|
+
[_optionalChain([allowedRoutes, 'optionalAccess', _58 => _58.sourceChains])]
|
|
1530
1542
|
);
|
|
1531
1543
|
const allowedTokenSet = _react.useMemo.call(void 0,
|
|
1532
|
-
() => _optionalChain([allowedRoutes, 'optionalAccess',
|
|
1533
|
-
[_optionalChain([allowedRoutes, 'optionalAccess',
|
|
1544
|
+
() => _optionalChain([allowedRoutes, 'optionalAccess', _59 => _59.sourceTokens]) ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null,
|
|
1545
|
+
[_optionalChain([allowedRoutes, 'optionalAccess', _60 => _60.sourceTokens])]
|
|
1534
1546
|
);
|
|
1535
1547
|
const evmChainIds = _react.useMemo.call(void 0, () => {
|
|
1536
1548
|
const all = _chunkMILJQWPTcjs.getSupportedChainIds.call(void 0, );
|
|
@@ -1622,8 +1634,8 @@ function DepositAddressStep({
|
|
|
1622
1634
|
function handlePointerDown(event) {
|
|
1623
1635
|
const target = event.target;
|
|
1624
1636
|
if (!target) return;
|
|
1625
|
-
const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access',
|
|
1626
|
-
const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access',
|
|
1637
|
+
const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access', _61 => _61.current, 'optionalAccess', _62 => _62.contains, 'call', _63 => _63(target)]);
|
|
1638
|
+
const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access', _64 => _64.current, 'optionalAccess', _65 => _65.contains, 'call', _66 => _66(target)]);
|
|
1627
1639
|
if (clickedChainDropdown || clickedTokenDropdown) return;
|
|
1628
1640
|
setChainDropdownOpen(false);
|
|
1629
1641
|
setTokenDropdownOpen(false);
|
|
@@ -1636,7 +1648,7 @@ function DepositAddressStep({
|
|
|
1636
1648
|
};
|
|
1637
1649
|
}, [chainDropdownOpen, tokenDropdownOpen]);
|
|
1638
1650
|
const handleCopy = _react.useCallback.call(void 0, async () => {
|
|
1639
|
-
_optionalChain([onCopyAddress, 'optionalCall',
|
|
1651
|
+
_optionalChain([onCopyAddress, 'optionalCall', _67 => _67()]);
|
|
1640
1652
|
try {
|
|
1641
1653
|
await navigator.clipboard.writeText(displayAddress);
|
|
1642
1654
|
setCopied(true);
|
|
@@ -1715,10 +1727,10 @@ function DepositAddressStep({
|
|
|
1715
1727
|
return;
|
|
1716
1728
|
}
|
|
1717
1729
|
const event = status.lastEvent;
|
|
1718
|
-
const eventTxHash =
|
|
1730
|
+
const eventTxHash = _chunkMQIJZNTPcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkMQIJZNTPcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
1719
1731
|
if (baselineTxHashRef.current === void 0) {
|
|
1720
1732
|
baselineTxHashRef.current = eventTxHash;
|
|
1721
|
-
} else if (eventTxHash && (!baselineTxHashRef.current || !
|
|
1733
|
+
} else if (eventTxHash && (!baselineTxHashRef.current || !_chunkMQIJZNTPcjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
|
|
1722
1734
|
const details = getDepositEventDetails(event);
|
|
1723
1735
|
const chainId = _nullishCoalesce(details.chainId, () => ( "unknown"));
|
|
1724
1736
|
const amount = _nullishCoalesce(details.amount, () => ( "0"));
|
|
@@ -1750,7 +1762,7 @@ function DepositAddressStep({
|
|
|
1750
1762
|
directTransfer
|
|
1751
1763
|
};
|
|
1752
1764
|
setNotifications((prev) => [notification, ...prev]);
|
|
1753
|
-
_optionalChain([onDepositSubmittedRef, 'access',
|
|
1765
|
+
_optionalChain([onDepositSubmittedRef, 'access', _68 => _68.current, 'optionalCall', _69 => _69({
|
|
1754
1766
|
txHash: eventTxHash,
|
|
1755
1767
|
sourceChain: chainId,
|
|
1756
1768
|
amount,
|
|
@@ -1762,7 +1774,7 @@ function DepositAddressStep({
|
|
|
1762
1774
|
if (!cancelled) {
|
|
1763
1775
|
const msg = err instanceof Error ? err.message : "Failed to check status";
|
|
1764
1776
|
setPollingError(msg);
|
|
1765
|
-
_optionalChain([onErrorRef, 'access',
|
|
1777
|
+
_optionalChain([onErrorRef, 'access', _70 => _70.current, 'optionalCall', _71 => _71(msg, "STATUS_POLL_ERROR")]);
|
|
1766
1778
|
}
|
|
1767
1779
|
}
|
|
1768
1780
|
if (!cancelled) {
|
|
@@ -1778,14 +1790,14 @@ function DepositAddressStep({
|
|
|
1778
1790
|
const handleNotificationComplete = _react.useCallback.call(void 0,
|
|
1779
1791
|
(txHash, destinationTxHash, context) => {
|
|
1780
1792
|
isTrackingRef.current = false;
|
|
1781
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
1793
|
+
_optionalChain([onDepositCompleteRef, 'access', _72 => _72.current, 'optionalCall', _73 => _73(txHash, destinationTxHash, context)]);
|
|
1782
1794
|
},
|
|
1783
1795
|
[]
|
|
1784
1796
|
);
|
|
1785
1797
|
const handleNotificationFailed = _react.useCallback.call(void 0,
|
|
1786
1798
|
(txHash, error) => {
|
|
1787
1799
|
isTrackingRef.current = false;
|
|
1788
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
1800
|
+
_optionalChain([onDepositFailedRef, 'access', _74 => _74.current, 'optionalCall', _75 => _75(txHash, error)]);
|
|
1789
1801
|
},
|
|
1790
1802
|
[]
|
|
1791
1803
|
);
|
|
@@ -1795,7 +1807,7 @@ function DepositAddressStep({
|
|
|
1795
1807
|
const qrIconSrc = _chunkMILJQWPTcjs.getChainIcon.call(void 0, sourceChainId);
|
|
1796
1808
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-step--with-notifications", children: [
|
|
1797
1809
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
1798
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1810
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
1799
1811
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", children: [
|
|
1800
1812
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", ref: chainDropdownRef, children: [
|
|
1801
1813
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
@@ -1819,7 +1831,7 @@ function DepositAddressStep({
|
|
|
1819
1831
|
}
|
|
1820
1832
|
),
|
|
1821
1833
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunkMILJQWPTcjs.getChainName.call(void 0, sourceChainId) }),
|
|
1822
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1834
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
1823
1835
|
]
|
|
1824
1836
|
}
|
|
1825
1837
|
),
|
|
@@ -1849,9 +1861,9 @@ function DepositAddressStep({
|
|
|
1849
1861
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Supported token" }),
|
|
1850
1862
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
1851
1863
|
"Min.$",
|
|
1852
|
-
(targetChain === _chunkMILJQWPTcjs.HYPERCORE_CHAIN_ID ? Math.max(_chunkMILJQWPTcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
1853
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1854
|
-
|
|
1864
|
+
(targetChain === _chunkMILJQWPTcjs.HYPERCORE_CHAIN_ID ? Math.max(_chunkMILJQWPTcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _76 => _76.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _77 => _77.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
1865
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1866
|
+
_chunkMQIJZNTPcjs.InfoIcon,
|
|
1855
1867
|
{
|
|
1856
1868
|
className: "rs-deposit-address-min-icon",
|
|
1857
1869
|
"aria-hidden": "true"
|
|
@@ -1879,7 +1891,7 @@ function DepositAddressStep({
|
|
|
1879
1891
|
}
|
|
1880
1892
|
),
|
|
1881
1893
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceTokenSymbol }),
|
|
1882
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1894
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
1883
1895
|
]
|
|
1884
1896
|
}
|
|
1885
1897
|
),
|
|
@@ -1930,7 +1942,7 @@ function DepositAddressStep({
|
|
|
1930
1942
|
className: "rs-deposit-address-copy",
|
|
1931
1943
|
onClick: handleCopy,
|
|
1932
1944
|
children: [
|
|
1933
|
-
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1945
|
+
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.CopyIcon, {}),
|
|
1934
1946
|
copied ? "Copied!" : "Copy address"
|
|
1935
1947
|
]
|
|
1936
1948
|
}
|
|
@@ -1938,7 +1950,7 @@ function DepositAddressStep({
|
|
|
1938
1950
|
]
|
|
1939
1951
|
}
|
|
1940
1952
|
),
|
|
1941
|
-
targetChain === _chunkMILJQWPTcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1953
|
+
targetChain === _chunkMILJQWPTcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.Callout, { variant: "warning", children: "HyperCore's first deposit to a new account includes a ~1 USDC activation fee \u2014 send at least 1 USDC or it will fail." }),
|
|
1942
1954
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1943
1955
|
"div",
|
|
1944
1956
|
{
|
|
@@ -1956,16 +1968,16 @@ function DepositAddressStep({
|
|
|
1956
1968
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
|
|
1957
1969
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
|
|
1958
1970
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1959
|
-
|
|
1971
|
+
_chunkMQIJZNTPcjs.Tooltip,
|
|
1960
1972
|
{
|
|
1961
1973
|
className: "rs-price-impact-info",
|
|
1962
1974
|
content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
|
|
1963
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1975
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.InfoIcon, { "aria-hidden": "true" })
|
|
1964
1976
|
}
|
|
1965
1977
|
)
|
|
1966
1978
|
] }),
|
|
1967
1979
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1968
|
-
|
|
1980
|
+
_chunkMQIJZNTPcjs.ChevronDownIcon,
|
|
1969
1981
|
{
|
|
1970
1982
|
className: "rs-price-impact-chevron",
|
|
1971
1983
|
"aria-hidden": "true"
|
|
@@ -1976,29 +1988,29 @@ function DepositAddressStep({
|
|
|
1976
1988
|
),
|
|
1977
1989
|
/* @__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: [
|
|
1978
1990
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
1979
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1991
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.PercentIcon, {}) }),
|
|
1980
1992
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
1981
1993
|
"Max slippage: ",
|
|
1982
1994
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.2%" })
|
|
1983
1995
|
] }),
|
|
1984
1996
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1985
|
-
|
|
1997
|
+
_chunkMQIJZNTPcjs.Tooltip,
|
|
1986
1998
|
{
|
|
1987
1999
|
className: "rs-price-impact-info",
|
|
1988
2000
|
content: "Slippage accounts for price changes during execution. Slippage is adjusted per pair to ensure reliable execution.",
|
|
1989
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2001
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.InfoIcon, { "aria-hidden": "true" })
|
|
1990
2002
|
}
|
|
1991
2003
|
)
|
|
1992
2004
|
] }),
|
|
1993
2005
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
1994
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2006
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.ClockIcon, {}) }),
|
|
1995
2007
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
1996
2008
|
"Processing time: ",
|
|
1997
2009
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "< 1 min" })
|
|
1998
2010
|
] })
|
|
1999
2011
|
] }),
|
|
2000
2012
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
2001
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2013
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.PlusCircleIcon, {}) }),
|
|
2002
2014
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
2003
2015
|
"Max deposit:",
|
|
2004
2016
|
" ",
|
|
@@ -2030,7 +2042,7 @@ function DepositAddressStep({
|
|
|
2030
2042
|
},
|
|
2031
2043
|
deposit.id
|
|
2032
2044
|
)) }),
|
|
2033
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2045
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.PoweredBy, {})
|
|
2034
2046
|
] });
|
|
2035
2047
|
}
|
|
2036
2048
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -2067,7 +2079,7 @@ function SwappedOrderTracker({
|
|
|
2067
2079
|
];
|
|
2068
2080
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-swapped-tracker", children: [
|
|
2069
2081
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2070
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2082
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.HandCoinsIcon, {}), title }),
|
|
2071
2083
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ol", { className: "rs-swapped-tracker-steps", children: labels.map((label, idx) => {
|
|
2072
2084
|
const status = stepStates[idx];
|
|
2073
2085
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
@@ -2081,7 +2093,7 @@ function SwappedOrderTracker({
|
|
|
2081
2093
|
{
|
|
2082
2094
|
className: "rs-swapped-tracker-step-marker",
|
|
2083
2095
|
"aria-hidden": "true",
|
|
2084
|
-
children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2096
|
+
children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.CheckIcon, {}) : status === "failed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.CloseIcon, {}) : status === "active" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.Spinner, {}) : null
|
|
2085
2097
|
}
|
|
2086
2098
|
)
|
|
2087
2099
|
]
|
|
@@ -2108,7 +2120,7 @@ function SwappedOrderTracker({
|
|
|
2108
2120
|
}
|
|
2109
2121
|
)
|
|
2110
2122
|
] }),
|
|
2111
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2123
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.PoweredBy, {})
|
|
2112
2124
|
] });
|
|
2113
2125
|
}
|
|
2114
2126
|
function formatTrackerAmount(amount) {
|
|
@@ -2226,7 +2238,7 @@ function SwappedIframeStep({
|
|
|
2226
2238
|
if (cancelled) return;
|
|
2227
2239
|
const message = err instanceof Error ? err.message : loadErrorFallback;
|
|
2228
2240
|
setLoadError(message);
|
|
2229
|
-
_optionalChain([onErrorRef, 'access',
|
|
2241
|
+
_optionalChain([onErrorRef, 'access', _78 => _78.current, 'optionalCall', _79 => _79(message, loadErrorCode)]);
|
|
2230
2242
|
});
|
|
2231
2243
|
return () => {
|
|
2232
2244
|
cancelled = true;
|
|
@@ -2272,10 +2284,10 @@ function SwappedIframeStep({
|
|
|
2272
2284
|
const status = await service.fetchLatestStatus(smartAccount);
|
|
2273
2285
|
if (cancelled) return;
|
|
2274
2286
|
const event = status.lastEvent;
|
|
2275
|
-
const eventTxHash =
|
|
2287
|
+
const eventTxHash = _chunkMQIJZNTPcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkMQIJZNTPcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
2276
2288
|
if (baselineDepositTxHashRef.current === void 0) {
|
|
2277
2289
|
baselineDepositTxHashRef.current = eventTxHash;
|
|
2278
|
-
} else if (eventTxHash && (!baselineDepositTxHashRef.current || !
|
|
2290
|
+
} else if (eventTxHash && (!baselineDepositTxHashRef.current || !_chunkMQIJZNTPcjs.txRefsMatch.call(void 0, eventTxHash, baselineDepositTxHashRef.current))) {
|
|
2279
2291
|
currentDepositTxHashRef.current = eventTxHash;
|
|
2280
2292
|
setLatestEvent(_nullishCoalesce(event, () => ( null)));
|
|
2281
2293
|
}
|
|
@@ -2300,10 +2312,10 @@ function SwappedIframeStep({
|
|
|
2300
2312
|
}, [service, smartAccount]);
|
|
2301
2313
|
_react.useEffect.call(void 0, () => {
|
|
2302
2314
|
if (fastDepositPollEnabledRef.current) return;
|
|
2303
|
-
const status = _optionalChain([orderState, 'optionalAccess',
|
|
2315
|
+
const status = _optionalChain([orderState, 'optionalAccess', _80 => _80.status]);
|
|
2304
2316
|
if (!status || !SWAPPED_TERMINAL_STATUSES.has(status)) return;
|
|
2305
2317
|
fastDepositPollEnabledRef.current = true;
|
|
2306
|
-
_optionalChain([rescheduleDepositPollRef, 'access',
|
|
2318
|
+
_optionalChain([rescheduleDepositPollRef, 'access', _81 => _81.current, 'optionalCall', _82 => _82(DEPOSIT_POLL_FAST_INITIAL_DELAY_MS)]);
|
|
2307
2319
|
}, [orderState]);
|
|
2308
2320
|
_react.useEffect.call(void 0, () => {
|
|
2309
2321
|
function onMessage(e) {
|
|
@@ -2311,16 +2323,16 @@ function SwappedIframeStep({
|
|
|
2311
2323
|
const parsed = parseSwappedIframeMessage(e.data);
|
|
2312
2324
|
if (!parsed) return;
|
|
2313
2325
|
setOrderState((prev) => ({
|
|
2314
|
-
orderId: _nullishCoalesce(_nullishCoalesce(parsed.orderId, () => ( _optionalChain([prev, 'optionalAccess',
|
|
2326
|
+
orderId: _nullishCoalesce(_nullishCoalesce(parsed.orderId, () => ( _optionalChain([prev, 'optionalAccess', _83 => _83.orderId]))), () => ( "")),
|
|
2315
2327
|
status: parsed.status,
|
|
2316
|
-
orderCrypto: _nullishCoalesce(_nullishCoalesce(parsed.orderCrypto, () => ( _optionalChain([prev, 'optionalAccess',
|
|
2317
|
-
orderCryptoAmount: _nullishCoalesce(_nullishCoalesce(parsed.orderCryptoAmount, () => ( _optionalChain([prev, 'optionalAccess',
|
|
2318
|
-
transactionId: _nullishCoalesce(_nullishCoalesce(parsed.transactionId, () => ( _optionalChain([prev, 'optionalAccess',
|
|
2328
|
+
orderCrypto: _nullishCoalesce(_nullishCoalesce(parsed.orderCrypto, () => ( _optionalChain([prev, 'optionalAccess', _84 => _84.orderCrypto]))), () => ( null)),
|
|
2329
|
+
orderCryptoAmount: _nullishCoalesce(_nullishCoalesce(parsed.orderCryptoAmount, () => ( _optionalChain([prev, 'optionalAccess', _85 => _85.orderCryptoAmount]))), () => ( null)),
|
|
2330
|
+
transactionId: _nullishCoalesce(_nullishCoalesce(parsed.transactionId, () => ( _optionalChain([prev, 'optionalAccess', _86 => _86.transactionId]))), () => ( null)),
|
|
2319
2331
|
receivedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2320
|
-
paidAmountUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
2321
|
-
paidAmountEur: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
2322
|
-
onrampFeeUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
2323
|
-
paymentMethod: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
2332
|
+
paidAmountUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _87 => _87.paidAmountUsd]), () => ( null)),
|
|
2333
|
+
paidAmountEur: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _88 => _88.paidAmountEur]), () => ( null)),
|
|
2334
|
+
onrampFeeUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _89 => _89.onrampFeeUsd]), () => ( null)),
|
|
2335
|
+
paymentMethod: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _90 => _90.paymentMethod]), () => ( null))
|
|
2324
2336
|
}));
|
|
2325
2337
|
}
|
|
2326
2338
|
window.addEventListener("message", onMessage);
|
|
@@ -2332,17 +2344,17 @@ function SwappedIframeStep({
|
|
|
2332
2344
|
}
|
|
2333
2345
|
}, [phase, orderState]);
|
|
2334
2346
|
const stepStates = _react.useMemo.call(void 0,
|
|
2335
|
-
() => deriveStepStates(_nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
2347
|
+
() => deriveStepStates(_nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _91 => _91.status]), () => ( null)), latestEvent),
|
|
2336
2348
|
[orderState, latestEvent]
|
|
2337
2349
|
);
|
|
2338
2350
|
const terminalState = _react.useMemo.call(void 0, () => {
|
|
2339
|
-
if (
|
|
2351
|
+
if (_chunkMQIJZNTPcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
|
|
2340
2352
|
return {
|
|
2341
2353
|
kind: "failed",
|
|
2342
|
-
message:
|
|
2354
|
+
message: _chunkMQIJZNTPcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
|
|
2343
2355
|
};
|
|
2344
2356
|
}
|
|
2345
|
-
if (_optionalChain([orderState, 'optionalAccess',
|
|
2357
|
+
if (_optionalChain([orderState, 'optionalAccess', _92 => _92.status]) === "order_cancelled") {
|
|
2346
2358
|
const banner = bannerForStatus("order_cancelled", {});
|
|
2347
2359
|
return { kind: "cancelled", message: _nullishCoalesce(banner.detail, () => ( banner.title)) };
|
|
2348
2360
|
}
|
|
@@ -2350,7 +2362,7 @@ function SwappedIframeStep({
|
|
|
2350
2362
|
}, [latestEvent, orderState, bannerForStatus]);
|
|
2351
2363
|
_react.useEffect.call(void 0, () => {
|
|
2352
2364
|
if (completeFiredRef.current || failedFiredRef.current) return;
|
|
2353
|
-
const t = _optionalChain([latestEvent, 'optionalAccess',
|
|
2365
|
+
const t = _optionalChain([latestEvent, 'optionalAccess', _93 => _93.type]);
|
|
2354
2366
|
const isSuccess = t === "bridge-complete" || t === "post-bridge-swap-complete";
|
|
2355
2367
|
if (!isSuccess) return;
|
|
2356
2368
|
const txHash = currentDepositTxHashRef.current;
|
|
@@ -2358,30 +2370,30 @@ function SwappedIframeStep({
|
|
|
2358
2370
|
completeFiredRef.current = true;
|
|
2359
2371
|
onSwappedCompleteRef.current({
|
|
2360
2372
|
txHash,
|
|
2361
|
-
orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
2373
|
+
orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _94 => _94.orderCrypto]), () => ( null)),
|
|
2362
2374
|
// Base-unit source amount from the deposit row/event, consistent with the
|
|
2363
2375
|
// wallet/QR path. ProcessingStep + onLifecycle expect base units.
|
|
2364
|
-
amount: _nullishCoalesce(
|
|
2376
|
+
amount: _nullishCoalesce(_chunkMQIJZNTPcjs.getEventSourceDetails.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0))).amount, () => ( null))
|
|
2365
2377
|
});
|
|
2366
2378
|
}, [latestEvent, orderState]);
|
|
2367
2379
|
_react.useEffect.call(void 0, () => {
|
|
2368
2380
|
if (failedFiredRef.current || completeFiredRef.current) return;
|
|
2369
|
-
if (!
|
|
2381
|
+
if (!_chunkMQIJZNTPcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) return;
|
|
2370
2382
|
const txHash = currentDepositTxHashRef.current;
|
|
2371
2383
|
if (!txHash) return;
|
|
2372
2384
|
failedFiredRef.current = true;
|
|
2373
2385
|
setPhase("tracker");
|
|
2374
|
-
_optionalChain([onSwappedFailedRef, 'access',
|
|
2386
|
+
_optionalChain([onSwappedFailedRef, 'access', _95 => _95.current, 'optionalCall', _96 => _96(
|
|
2375
2387
|
txHash,
|
|
2376
|
-
|
|
2388
|
+
_chunkMQIJZNTPcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
|
|
2377
2389
|
)]);
|
|
2378
2390
|
}, [latestEvent]);
|
|
2379
2391
|
if (phase === "tracker") {
|
|
2380
2392
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2381
2393
|
SwappedOrderTracker,
|
|
2382
2394
|
{
|
|
2383
|
-
amount: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
2384
|
-
currency: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
2395
|
+
amount: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _97 => _97.orderCryptoAmount]), () => ( null)),
|
|
2396
|
+
currency: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _98 => _98.orderCrypto]), () => ( "USDC")),
|
|
2385
2397
|
stepStates,
|
|
2386
2398
|
terminal: terminalState,
|
|
2387
2399
|
onRetry: () => setRetryToken((n) => n + 1),
|
|
@@ -2392,9 +2404,9 @@ function SwappedIframeStep({
|
|
|
2392
2404
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-fiat-onramp", "data-variant": variant, children: [
|
|
2393
2405
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2394
2406
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2395
|
-
|
|
2407
|
+
_chunkMQIJZNTPcjs.BodyHeader,
|
|
2396
2408
|
{
|
|
2397
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2409
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.HandCoinsIcon, {}),
|
|
2398
2410
|
title: "Deposit",
|
|
2399
2411
|
subtitle: "Add money to your balance"
|
|
2400
2412
|
}
|
|
@@ -2412,7 +2424,7 @@ function SwappedIframeStep({
|
|
|
2412
2424
|
}
|
|
2413
2425
|
)
|
|
2414
2426
|
] }),
|
|
2415
|
-
!loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2427
|
+
!loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.Spinner, {}) }),
|
|
2416
2428
|
widgetUrl && !loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2417
2429
|
"iframe",
|
|
2418
2430
|
{
|
|
@@ -2427,11 +2439,11 @@ function SwappedIframeStep({
|
|
|
2427
2439
|
)
|
|
2428
2440
|
] })
|
|
2429
2441
|
] }),
|
|
2430
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2442
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.PoweredBy, {})
|
|
2431
2443
|
] });
|
|
2432
2444
|
}
|
|
2433
2445
|
function deriveStepStates(swappedStatus, latestEvent) {
|
|
2434
|
-
if (
|
|
2446
|
+
if (_chunkMQIJZNTPcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
|
|
2435
2447
|
return ["complete", "complete", "failed", "pending"];
|
|
2436
2448
|
}
|
|
2437
2449
|
if (swappedStatus === "order_cancelled") {
|
|
@@ -2439,7 +2451,7 @@ function deriveStepStates(swappedStatus, latestEvent) {
|
|
|
2439
2451
|
}
|
|
2440
2452
|
const step1Complete = swappedStatus === "order_completed" || swappedStatus === "order_broadcasted";
|
|
2441
2453
|
const step2Complete = latestEvent !== null;
|
|
2442
|
-
const step3Complete = _optionalChain([latestEvent, 'optionalAccess',
|
|
2454
|
+
const step3Complete = _optionalChain([latestEvent, 'optionalAccess', _99 => _99.type]) === "bridge-complete" || _optionalChain([latestEvent, 'optionalAccess', _100 => _100.type]) === "post-bridge-swap-complete";
|
|
2443
2455
|
if (step3Complete) {
|
|
2444
2456
|
return ["complete", "complete", "complete", "pending"];
|
|
2445
2457
|
}
|
|
@@ -2601,7 +2613,7 @@ ExchangeConnectStep.displayName = "ExchangeConnectStep";
|
|
|
2601
2613
|
function ExchangeLogo({ exchange }) {
|
|
2602
2614
|
const [failed, setFailed] = _react.useState.call(void 0, false);
|
|
2603
2615
|
if (!exchange.logoUrl || failed) {
|
|
2604
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2616
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.BankIcon, {});
|
|
2605
2617
|
}
|
|
2606
2618
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2607
2619
|
"img",
|
|
@@ -2636,7 +2648,7 @@ function ExchangeSelectStep({
|
|
|
2636
2648
|
const message = err instanceof Error ? err.message : "Failed to load exchanges";
|
|
2637
2649
|
setExchanges([]);
|
|
2638
2650
|
setError(message);
|
|
2639
|
-
_optionalChain([onError, 'optionalCall',
|
|
2651
|
+
_optionalChain([onError, 'optionalCall', _101 => _101(message, "SWAPPED_CONNECT_EXCHANGES_FAILED")]);
|
|
2640
2652
|
}).finally(() => {
|
|
2641
2653
|
if (!cancelled) setLoading(false);
|
|
2642
2654
|
});
|
|
@@ -2647,14 +2659,14 @@ function ExchangeSelectStep({
|
|
|
2647
2659
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-exchange-select", children: [
|
|
2648
2660
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2649
2661
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2650
|
-
|
|
2662
|
+
_chunkMQIJZNTPcjs.BodyHeader,
|
|
2651
2663
|
{
|
|
2652
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2664
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.BankIcon, {}),
|
|
2653
2665
|
title: "Fund from Exchange",
|
|
2654
2666
|
subtitle: "Choose your exchange"
|
|
2655
2667
|
}
|
|
2656
2668
|
),
|
|
2657
|
-
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2669
|
+
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.Spinner, {}) }),
|
|
2658
2670
|
!loading && error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: [
|
|
2659
2671
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state-title", children: "Couldn\u2019t load exchanges" }),
|
|
2660
2672
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2694,7 +2706,7 @@ function ExchangeSelectStep({
|
|
|
2694
2706
|
exchange.connection
|
|
2695
2707
|
)) })
|
|
2696
2708
|
] }),
|
|
2697
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2709
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.PoweredBy, {})
|
|
2698
2710
|
] });
|
|
2699
2711
|
}
|
|
2700
2712
|
ExchangeSelectStep.displayName = "ExchangeSelectStep";
|
|
@@ -2706,8 +2718,8 @@ function DepositAddressSkeleton({
|
|
|
2706
2718
|
uiConfig,
|
|
2707
2719
|
allowedRoutes
|
|
2708
2720
|
}) {
|
|
2709
|
-
const allowedChainSet = _optionalChain([allowedRoutes, 'optionalAccess',
|
|
2710
|
-
const allowedTokenSet = _optionalChain([allowedRoutes, 'optionalAccess',
|
|
2721
|
+
const allowedChainSet = _optionalChain([allowedRoutes, 'optionalAccess', _102 => _102.sourceChains]) ? new Set(allowedRoutes.sourceChains) : null;
|
|
2722
|
+
const allowedTokenSet = _optionalChain([allowedRoutes, 'optionalAccess', _103 => _103.sourceTokens]) ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null;
|
|
2711
2723
|
const evmChainIds = (() => {
|
|
2712
2724
|
const all = _chunkMILJQWPTcjs.getSupportedChainIds.call(void 0, );
|
|
2713
2725
|
return allowedChainSet ? all.filter((id) => allowedChainSet.has(id)) : all;
|
|
@@ -2724,7 +2736,7 @@ function DepositAddressSkeleton({
|
|
|
2724
2736
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", "aria-busy": "true", children: [
|
|
2725
2737
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: "Preparing deposit details\u2026" }),
|
|
2726
2738
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
2727
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2739
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
2728
2740
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", "aria-hidden": "true", children: [
|
|
2729
2741
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
2730
2742
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
@@ -2738,7 +2750,7 @@ function DepositAddressSkeleton({
|
|
|
2738
2750
|
}
|
|
2739
2751
|
),
|
|
2740
2752
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainName }),
|
|
2741
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2753
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2742
2754
|
] })
|
|
2743
2755
|
] }),
|
|
2744
2756
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
@@ -2746,9 +2758,9 @@ function DepositAddressSkeleton({
|
|
|
2746
2758
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Supported token" }),
|
|
2747
2759
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
2748
2760
|
"Min.$",
|
|
2749
|
-
(_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
2750
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2751
|
-
|
|
2761
|
+
(_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _104 => _104.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
2762
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2763
|
+
_chunkMQIJZNTPcjs.InfoIcon,
|
|
2752
2764
|
{
|
|
2753
2765
|
className: "rs-deposit-address-min-icon",
|
|
2754
2766
|
"aria-hidden": "true"
|
|
@@ -2766,7 +2778,7 @@ function DepositAddressSkeleton({
|
|
|
2766
2778
|
}
|
|
2767
2779
|
),
|
|
2768
2780
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: defaultToken }),
|
|
2769
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2781
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2770
2782
|
] })
|
|
2771
2783
|
] })
|
|
2772
2784
|
] }),
|
|
@@ -2787,7 +2799,7 @@ function DepositAddressSkeleton({
|
|
|
2787
2799
|
disabled: true,
|
|
2788
2800
|
"aria-hidden": "true",
|
|
2789
2801
|
children: [
|
|
2790
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2802
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.CopyIcon, {}),
|
|
2791
2803
|
"Copy address"
|
|
2792
2804
|
]
|
|
2793
2805
|
}
|
|
@@ -2800,16 +2812,16 @@ function DepositAddressSkeleton({
|
|
|
2800
2812
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
|
|
2801
2813
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
|
|
2802
2814
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2803
|
-
|
|
2815
|
+
_chunkMQIJZNTPcjs.Tooltip,
|
|
2804
2816
|
{
|
|
2805
2817
|
className: "rs-price-impact-info",
|
|
2806
2818
|
content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
|
|
2807
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2819
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.InfoIcon, { "aria-hidden": "true" })
|
|
2808
2820
|
}
|
|
2809
2821
|
)
|
|
2810
2822
|
] }),
|
|
2811
2823
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2812
|
-
|
|
2824
|
+
_chunkMQIJZNTPcjs.ChevronDownIcon,
|
|
2813
2825
|
{
|
|
2814
2826
|
className: "rs-price-impact-chevron",
|
|
2815
2827
|
"aria-hidden": "true"
|
|
@@ -2817,7 +2829,7 @@ function DepositAddressSkeleton({
|
|
|
2817
2829
|
)
|
|
2818
2830
|
] }) })
|
|
2819
2831
|
] }),
|
|
2820
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2832
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.PoweredBy, {})
|
|
2821
2833
|
] });
|
|
2822
2834
|
}
|
|
2823
2835
|
DepositAddressSkeleton.displayName = "DepositAddressSkeleton";
|
|
@@ -2849,7 +2861,7 @@ function SolanaTokenSelectStep({
|
|
|
2849
2861
|
setError(null);
|
|
2850
2862
|
const portfolioBySymbol = {};
|
|
2851
2863
|
try {
|
|
2852
|
-
|
|
2864
|
+
_chunkMQIJZNTPcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
|
|
2853
2865
|
solanaAddress
|
|
2854
2866
|
});
|
|
2855
2867
|
const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
|
|
@@ -2872,12 +2884,12 @@ function SolanaTokenSelectStep({
|
|
|
2872
2884
|
};
|
|
2873
2885
|
}
|
|
2874
2886
|
}
|
|
2875
|
-
|
|
2887
|
+
_chunkMQIJZNTPcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
|
|
2876
2888
|
symbols: Object.keys(portfolioBySymbol)
|
|
2877
2889
|
});
|
|
2878
2890
|
} catch (err) {
|
|
2879
2891
|
if (!active) return;
|
|
2880
|
-
|
|
2892
|
+
_chunkMQIJZNTPcjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
|
|
2881
2893
|
solanaAddress
|
|
2882
2894
|
});
|
|
2883
2895
|
setError(
|
|
@@ -2902,7 +2914,7 @@ function SolanaTokenSelectStep({
|
|
|
2902
2914
|
setTokenBalances(results);
|
|
2903
2915
|
setLoading(false);
|
|
2904
2916
|
const totalUsd = results.reduce((sum, r) => sum + r.balanceUsd, 0);
|
|
2905
|
-
_optionalChain([onTotalBalanceComputed, 'optionalCall',
|
|
2917
|
+
_optionalChain([onTotalBalanceComputed, 'optionalCall', _105 => _105(totalUsd)]);
|
|
2906
2918
|
}
|
|
2907
2919
|
void loadBalances();
|
|
2908
2920
|
return () => {
|
|
@@ -2924,7 +2936,7 @@ function SolanaTokenSelectStep({
|
|
|
2924
2936
|
const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
|
|
2925
2937
|
const numeric = Number(raw);
|
|
2926
2938
|
if (!Number.isFinite(numeric)) return raw;
|
|
2927
|
-
return
|
|
2939
|
+
return _chunkMQIJZNTPcjs.tokenFormatter.format(numeric);
|
|
2928
2940
|
} catch (e20) {
|
|
2929
2941
|
return "--";
|
|
2930
2942
|
}
|
|
@@ -2934,20 +2946,20 @@ function SolanaTokenSelectStep({
|
|
|
2934
2946
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
2935
2947
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
2936
2948
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2937
|
-
|
|
2949
|
+
_chunkMQIJZNTPcjs.BodyHeader,
|
|
2938
2950
|
{
|
|
2939
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2951
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.WalletIcon, {}),
|
|
2940
2952
|
title: "Your assets",
|
|
2941
2953
|
subtitle: "Select source assets to transfer"
|
|
2942
2954
|
}
|
|
2943
2955
|
),
|
|
2944
2956
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
2945
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2957
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
2946
2958
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
2947
2959
|
] }),
|
|
2948
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2960
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.Callout, { variant: "error", children: error }),
|
|
2949
2961
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
2950
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2962
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
2951
2963
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
2952
2964
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
2953
2965
|
solanaAddress.slice(0, 6),
|
|
@@ -2996,14 +3008,14 @@ function SolanaTokenSelectStep({
|
|
|
2996
3008
|
] })
|
|
2997
3009
|
] })
|
|
2998
3010
|
] }),
|
|
2999
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ?
|
|
3011
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunkMQIJZNTPcjs.currencyFormatter.format(entry.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${entry.token.symbol}` : "--" })
|
|
3000
3012
|
]
|
|
3001
3013
|
},
|
|
3002
3014
|
entry.token.symbol
|
|
3003
3015
|
);
|
|
3004
3016
|
}) }),
|
|
3005
3017
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3006
|
-
|
|
3018
|
+
_chunkMQIJZNTPcjs.Button,
|
|
3007
3019
|
{
|
|
3008
3020
|
onClick: () => selectedEntry && onContinue(
|
|
3009
3021
|
selectedEntry.token,
|
|
@@ -3016,7 +3028,7 @@ function SolanaTokenSelectStep({
|
|
|
3016
3028
|
}
|
|
3017
3029
|
)
|
|
3018
3030
|
] }),
|
|
3019
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3031
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.PoweredBy, {})
|
|
3020
3032
|
] });
|
|
3021
3033
|
}
|
|
3022
3034
|
|
|
@@ -3049,7 +3061,7 @@ function SolanaAmountStep({
|
|
|
3049
3061
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
3050
3062
|
const hasAppliedDefaultRef = _react.useRef.call(void 0, false);
|
|
3051
3063
|
const isSourceStablecoin = _chunkMILJQWPTcjs.isStablecoinSymbol.call(void 0, token.symbol);
|
|
3052
|
-
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess',
|
|
3064
|
+
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess', _106 => _106.trim, 'call', _107 => _107(), 'access', _108 => _108.toLowerCase, 'call', _109 => _109()]) === "max";
|
|
3053
3065
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
3054
3066
|
if (isSourceStablecoin) return 1;
|
|
3055
3067
|
try {
|
|
@@ -3069,7 +3081,7 @@ function SolanaAmountStep({
|
|
|
3069
3081
|
const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
|
|
3070
3082
|
const numeric = Number(raw);
|
|
3071
3083
|
if (!Number.isFinite(numeric)) return raw;
|
|
3072
|
-
return
|
|
3084
|
+
return _chunkMQIJZNTPcjs.tokenFormatter.format(numeric);
|
|
3073
3085
|
} catch (e22) {
|
|
3074
3086
|
return "\u2026";
|
|
3075
3087
|
}
|
|
@@ -3151,8 +3163,8 @@ function SolanaAmountStep({
|
|
|
3151
3163
|
return null;
|
|
3152
3164
|
}
|
|
3153
3165
|
}, [numericAmount, isSourceStablecoin, hasPricing, tokenPriceUsd, token.decimals]);
|
|
3154
|
-
const minDepositUsd = targetChain === _chunkMILJQWPTcjs.HYPERCORE_CHAIN_ID ? Math.max(_chunkMILJQWPTcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3155
|
-
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3166
|
+
const minDepositUsd = targetChain === _chunkMILJQWPTcjs.HYPERCORE_CHAIN_ID ? Math.max(_chunkMILJQWPTcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _110 => _110.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _111 => _111.minDepositUsd]), () => ( null));
|
|
3167
|
+
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _112 => _112.maxDepositUsd]), () => ( null));
|
|
3156
3168
|
const isBelowMin = minDepositUsd !== null && numericAmount > 0 && numericAmount < minDepositUsd;
|
|
3157
3169
|
const isAboveMax = maxDepositUsd !== null && numericAmount > maxDepositUsd;
|
|
3158
3170
|
const exceedsBalance = Boolean(
|
|
@@ -3162,7 +3174,7 @@ function SolanaAmountStep({
|
|
|
3162
3174
|
const handlePresetClick = (percentage) => {
|
|
3163
3175
|
const formatted = computePresetAmount(percentage);
|
|
3164
3176
|
if (!formatted) return;
|
|
3165
|
-
|
|
3177
|
+
_chunkMQIJZNTPcjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
|
|
3166
3178
|
percentage,
|
|
3167
3179
|
symbol: token.symbol,
|
|
3168
3180
|
formatted
|
|
@@ -3197,7 +3209,7 @@ function SolanaAmountStep({
|
|
|
3197
3209
|
try {
|
|
3198
3210
|
amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
|
|
3199
3211
|
} catch (e27) {
|
|
3200
|
-
|
|
3212
|
+
_chunkMQIJZNTPcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
3201
3213
|
amount,
|
|
3202
3214
|
sourceAmount: sourceAmountStr,
|
|
3203
3215
|
reason: "parse-units-failed"
|
|
@@ -3212,7 +3224,7 @@ function SolanaAmountStep({
|
|
|
3212
3224
|
);
|
|
3213
3225
|
return;
|
|
3214
3226
|
}
|
|
3215
|
-
|
|
3227
|
+
_chunkMQIJZNTPcjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
|
|
3216
3228
|
symbol: token.symbol,
|
|
3217
3229
|
inputAmountUsd: amount,
|
|
3218
3230
|
sourceAmount: sourceAmountStr,
|
|
@@ -3226,7 +3238,7 @@ function SolanaAmountStep({
|
|
|
3226
3238
|
const sourceTokenIcon = _chunkMILJQWPTcjs.getTokenIcon.call(void 0, token.symbol);
|
|
3227
3239
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
3228
3240
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3229
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3241
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.WalletIcon, {}), title: "Wallet deposit" }),
|
|
3230
3242
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
3231
3243
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
3232
3244
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3246,13 +3258,13 @@ function SolanaAmountStep({
|
|
|
3246
3258
|
" available",
|
|
3247
3259
|
computedBalanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
3248
3260
|
" (~",
|
|
3249
|
-
|
|
3261
|
+
_chunkMQIJZNTPcjs.currencyFormatter.format(computedBalanceUsd),
|
|
3250
3262
|
")"
|
|
3251
3263
|
] })
|
|
3252
3264
|
] }),
|
|
3253
3265
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
3254
3266
|
"Min. deposit ",
|
|
3255
|
-
|
|
3267
|
+
_chunkMQIJZNTPcjs.currencyFormatter.format(minDepositUsd)
|
|
3256
3268
|
] })
|
|
3257
3269
|
] })
|
|
3258
3270
|
] }),
|
|
@@ -3291,13 +3303,13 @@ function SolanaAmountStep({
|
|
|
3291
3303
|
] }),
|
|
3292
3304
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
3293
3305
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
3294
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
3306
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkMQIJZNTPcjs.currencyFormatter.format(balanceAfterUsd) })
|
|
3295
3307
|
] })
|
|
3296
3308
|
] }),
|
|
3297
|
-
targetChain === _chunkMILJQWPTcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3298
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3309
|
+
targetChain === _chunkMILJQWPTcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
|
|
3310
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.Callout, { variant: "error", children: error }),
|
|
3299
3311
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3300
|
-
|
|
3312
|
+
_chunkMQIJZNTPcjs.Button,
|
|
3301
3313
|
{
|
|
3302
3314
|
onClick: handleContinue,
|
|
3303
3315
|
fullWidth: true,
|
|
@@ -3306,7 +3318,7 @@ function SolanaAmountStep({
|
|
|
3306
3318
|
}
|
|
3307
3319
|
)
|
|
3308
3320
|
] }),
|
|
3309
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3321
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.PoweredBy, {})
|
|
3310
3322
|
] });
|
|
3311
3323
|
}
|
|
3312
3324
|
|
|
@@ -3330,7 +3342,7 @@ var DEFAULT_SOLANA_RPC_URL = "https://api.mainnet.solana.com";
|
|
|
3330
3342
|
var configuredSolanaRpcUrl = null;
|
|
3331
3343
|
var cachedConnections = /* @__PURE__ */ new Map();
|
|
3332
3344
|
function configureSolanaRpcUrl(rpcUrl) {
|
|
3333
|
-
const normalized = _optionalChain([rpcUrl, 'optionalAccess',
|
|
3345
|
+
const normalized = _optionalChain([rpcUrl, 'optionalAccess', _113 => _113.trim, 'call', _114 => _114()]);
|
|
3334
3346
|
configuredSolanaRpcUrl = normalized ? normalized : null;
|
|
3335
3347
|
cachedConnections.clear();
|
|
3336
3348
|
}
|
|
@@ -3450,8 +3462,8 @@ function SolanaConfirmStep({
|
|
|
3450
3462
|
const targetChainIcon = _chunkMILJQWPTcjs.getChainIcon.call(void 0, targetChain);
|
|
3451
3463
|
const sourceTokenIcon = _chunkMILJQWPTcjs.getTokenIcon.call(void 0, token.symbol);
|
|
3452
3464
|
const targetTokenIcon = _chunkMILJQWPTcjs.getTokenIcon.call(void 0, targetSymbol);
|
|
3453
|
-
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3454
|
-
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3465
|
+
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _115 => _115.feeSponsored]), () => ( false));
|
|
3466
|
+
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _116 => _116.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
3455
3467
|
const formattedAmount = sourceAmount && !Number.isNaN(Number(sourceAmount)) ? Number(sourceAmount).toLocaleString("en-US", {
|
|
3456
3468
|
minimumFractionDigits: 2,
|
|
3457
3469
|
maximumFractionDigits: 6
|
|
@@ -3473,7 +3485,7 @@ function SolanaConfirmStep({
|
|
|
3473
3485
|
const receiveAmount = isSameToken ? formattedReceiveAmount : `~${formattedReceiveAmount}`;
|
|
3474
3486
|
const handleConfirm = async () => {
|
|
3475
3487
|
if (!solanaProvider) {
|
|
3476
|
-
|
|
3488
|
+
_chunkMQIJZNTPcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
3477
3489
|
reason: "missing-provider"
|
|
3478
3490
|
});
|
|
3479
3491
|
setError("Solana wallet not connected");
|
|
@@ -3481,7 +3493,7 @@ function SolanaConfirmStep({
|
|
|
3481
3493
|
}
|
|
3482
3494
|
const parsedAmount = parseFloat(sourceAmount);
|
|
3483
3495
|
if (isNaN(parsedAmount) || parsedAmount <= 0) {
|
|
3484
|
-
|
|
3496
|
+
_chunkMQIJZNTPcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
3485
3497
|
reason: "invalid-amount",
|
|
3486
3498
|
sourceAmount
|
|
3487
3499
|
});
|
|
@@ -3490,7 +3502,7 @@ function SolanaConfirmStep({
|
|
|
3490
3502
|
}
|
|
3491
3503
|
setError(null);
|
|
3492
3504
|
setIsSubmitting(true);
|
|
3493
|
-
|
|
3505
|
+
_chunkMQIJZNTPcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
|
|
3494
3506
|
smartAccount,
|
|
3495
3507
|
solanaAddress,
|
|
3496
3508
|
solanaDepositAddress,
|
|
@@ -3500,7 +3512,7 @@ function SolanaConfirmStep({
|
|
|
3500
3512
|
});
|
|
3501
3513
|
try {
|
|
3502
3514
|
const check = await service.checkAccount(smartAccount);
|
|
3503
|
-
|
|
3515
|
+
_chunkMQIJZNTPcjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
|
|
3504
3516
|
smartAccount,
|
|
3505
3517
|
isRegistered: check.isRegistered,
|
|
3506
3518
|
targetChain: check.targetChain,
|
|
@@ -3513,7 +3525,7 @@ function SolanaConfirmStep({
|
|
|
3513
3525
|
}
|
|
3514
3526
|
const connection = hasConfiguredSolanaRpcUrl() ? getSolanaConnection() : _nullishCoalesce(solanaConnection, () => ( getSolanaConnection()));
|
|
3515
3527
|
const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
|
|
3516
|
-
|
|
3528
|
+
_chunkMQIJZNTPcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
|
|
3517
3529
|
token: token.symbol,
|
|
3518
3530
|
sourceAmount,
|
|
3519
3531
|
amountUnits: amountUnits.toString()
|
|
@@ -3530,10 +3542,10 @@ function SolanaConfirmStep({
|
|
|
3530
3542
|
token.mint,
|
|
3531
3543
|
amountUnits
|
|
3532
3544
|
);
|
|
3533
|
-
|
|
3545
|
+
_chunkMQIJZNTPcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
3534
3546
|
token: token.symbol,
|
|
3535
3547
|
instructionCount: transaction.instructions.length,
|
|
3536
|
-
feePayer: _optionalChain([transaction, 'access',
|
|
3548
|
+
feePayer: _optionalChain([transaction, 'access', _117 => _117.feePayer, 'optionalAccess', _118 => _118.toBase58, 'call', _119 => _119()]),
|
|
3537
3549
|
recentBlockhash: transaction.recentBlockhash
|
|
3538
3550
|
});
|
|
3539
3551
|
const txHash = await sendSolanaTransaction(
|
|
@@ -3541,28 +3553,28 @@ function SolanaConfirmStep({
|
|
|
3541
3553
|
connection,
|
|
3542
3554
|
transaction
|
|
3543
3555
|
);
|
|
3544
|
-
|
|
3556
|
+
_chunkMQIJZNTPcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
|
|
3545
3557
|
txHash,
|
|
3546
3558
|
amountUnits: amountUnits.toString()
|
|
3547
3559
|
});
|
|
3548
3560
|
onConfirm(txHash, amountUnits.toString());
|
|
3549
3561
|
} catch (err) {
|
|
3550
3562
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
3551
|
-
const message =
|
|
3552
|
-
|
|
3563
|
+
const message = _chunkMQIJZNTPcjs.formatUserError.call(void 0, raw);
|
|
3564
|
+
_chunkMQIJZNTPcjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
|
|
3553
3565
|
smartAccount,
|
|
3554
3566
|
token: token.symbol,
|
|
3555
3567
|
sourceAmount
|
|
3556
3568
|
});
|
|
3557
3569
|
setError(message);
|
|
3558
|
-
_optionalChain([onError, 'optionalCall',
|
|
3570
|
+
_optionalChain([onError, 'optionalCall', _120 => _120(message, "SOLANA_TRANSFER_ERROR")]);
|
|
3559
3571
|
} finally {
|
|
3560
3572
|
setIsSubmitting(false);
|
|
3561
3573
|
}
|
|
3562
3574
|
};
|
|
3563
3575
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
3564
3576
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3565
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3577
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.WalletIcon, {}), title: "Review deposit" }),
|
|
3566
3578
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
|
|
3567
3579
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
3568
3580
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
@@ -3614,13 +3626,13 @@ function SolanaConfirmStep({
|
|
|
3614
3626
|
children: "$0.04"
|
|
3615
3627
|
}
|
|
3616
3628
|
),
|
|
3617
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3629
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.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, _chunkMQIJZNTPcjs.InfoIcon, {}) }) })
|
|
3618
3630
|
] })
|
|
3619
3631
|
] })
|
|
3620
3632
|
] }),
|
|
3621
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3633
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.Callout, { variant: "error", children: error }),
|
|
3622
3634
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3623
|
-
|
|
3635
|
+
_chunkMQIJZNTPcjs.Button,
|
|
3624
3636
|
{
|
|
3625
3637
|
onClick: handleConfirm,
|
|
3626
3638
|
loading: isSubmitting,
|
|
@@ -3631,7 +3643,7 @@ function SolanaConfirmStep({
|
|
|
3631
3643
|
}
|
|
3632
3644
|
)
|
|
3633
3645
|
] }),
|
|
3634
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3646
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.PoweredBy, {})
|
|
3635
3647
|
] });
|
|
3636
3648
|
}
|
|
3637
3649
|
|
|
@@ -3645,18 +3657,18 @@ function DappImportAssetSelectStep({
|
|
|
3645
3657
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
3646
3658
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3647
3659
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3648
|
-
|
|
3660
|
+
_chunkMQIJZNTPcjs.BodyHeader,
|
|
3649
3661
|
{
|
|
3650
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3662
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.WalletIcon, {}),
|
|
3651
3663
|
title: `Transfer from ${sourceLabel}`,
|
|
3652
3664
|
subtitle: "Pick the balance to import"
|
|
3653
3665
|
}
|
|
3654
3666
|
),
|
|
3655
3667
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: assets.map((asset) => {
|
|
3656
|
-
const tokenAmount = asset.balance ?
|
|
3668
|
+
const tokenAmount = asset.balance ? _chunkMQIJZNTPcjs.tokenFormatter.format(
|
|
3657
3669
|
Number(asset.balance) / 10 ** asset.decimals
|
|
3658
3670
|
) : "0";
|
|
3659
|
-
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ?
|
|
3671
|
+
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ? _chunkMQIJZNTPcjs.currencyFormatter.format(asset.balanceUsd) : `${tokenAmount} ${asset.symbol}`;
|
|
3660
3672
|
const tokenIcon = _nullishCoalesce(asset.icon, () => ( _chunkMILJQWPTcjs.getTokenIcon.call(void 0, asset.symbol)));
|
|
3661
3673
|
const chainIcon = _chunkMILJQWPTcjs.getChainIcon.call(void 0, asset.chainId);
|
|
3662
3674
|
const badge = _chunkMILJQWPTcjs.getChainBadge.call(void 0, asset.chainId);
|
|
@@ -3707,23 +3719,71 @@ function DappImportAssetSelectStep({
|
|
|
3707
3719
|
);
|
|
3708
3720
|
}) })
|
|
3709
3721
|
] }),
|
|
3710
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3722
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.PoweredBy, {})
|
|
3711
3723
|
] });
|
|
3712
3724
|
}
|
|
3713
3725
|
DappImportAssetSelectStep.displayName = "DappImportAssetSelectStep";
|
|
3714
3726
|
|
|
3715
|
-
// src/
|
|
3727
|
+
// src/components/steps/DappImportAssetSelectSkeleton.tsx
|
|
3728
|
+
|
|
3729
|
+
function DappImportAssetSelectSkeleton({
|
|
3730
|
+
sourceLabel,
|
|
3731
|
+
rowCount = 3,
|
|
3732
|
+
error = false,
|
|
3733
|
+
onRetry
|
|
3734
|
+
}) {
|
|
3735
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", "aria-busy": error ? "false" : "true", children: [
|
|
3736
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: error ? "Couldn't load balances" : "Loading balances\u2026" }),
|
|
3737
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3738
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3739
|
+
_chunkMQIJZNTPcjs.BodyHeader,
|
|
3740
|
+
{
|
|
3741
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.WalletIcon, {}),
|
|
3742
|
+
title: `Transfer from ${sourceLabel}`,
|
|
3743
|
+
subtitle: "Pick the balance to import"
|
|
3744
|
+
}
|
|
3745
|
+
),
|
|
3746
|
+
error ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-state", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-text", children: [
|
|
3747
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-title rs-text-error", children: "Couldn\u2019t load your balances" }),
|
|
3748
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-subtitle", children: "Check your connection and try again." })
|
|
3749
|
+
] }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", "aria-hidden": "true", children: Array.from({ length: rowCount }, (_, index) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3750
|
+
"div",
|
|
3751
|
+
{
|
|
3752
|
+
className: "rs-asset-row rs-asset-row--skeleton",
|
|
3753
|
+
children: [
|
|
3754
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
|
|
3755
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-icon-wrapper", children: [
|
|
3756
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-skeleton rs-skeleton-fill" }) }),
|
|
3757
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-skeleton rs-skeleton-fill" }) })
|
|
3758
|
+
] }),
|
|
3759
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-text", children: [
|
|
3760
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-name-row", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-skeleton rs-skeleton-text rs-skeleton-text--name" }) }),
|
|
3761
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance-small", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-skeleton rs-skeleton-text rs-skeleton-text--balance" }) })
|
|
3762
|
+
] })
|
|
3763
|
+
] }),
|
|
3764
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-skeleton rs-skeleton-text rs-skeleton-text--usd" }) })
|
|
3765
|
+
]
|
|
3766
|
+
},
|
|
3767
|
+
index
|
|
3768
|
+
)) })
|
|
3769
|
+
] }),
|
|
3770
|
+
error && onRetry && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3771
|
+
"button",
|
|
3772
|
+
{
|
|
3773
|
+
type: "button",
|
|
3774
|
+
className: "rs-button rs-button--default rs-button--full-width",
|
|
3775
|
+
onClick: onRetry,
|
|
3776
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Try again" })
|
|
3777
|
+
}
|
|
3778
|
+
) }),
|
|
3779
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.PoweredBy, {})
|
|
3780
|
+
] });
|
|
3781
|
+
}
|
|
3782
|
+
DappImportAssetSelectSkeleton.displayName = "DappImportAssetSelectSkeleton";
|
|
3716
3783
|
|
|
3784
|
+
// src/core/dapp-imports/polymarket/index.ts
|
|
3717
3785
|
|
|
3718
3786
|
|
|
3719
|
-
// src/core/dapp-imports/polymarket/constants.ts
|
|
3720
|
-
var POLYMARKET_POLYGON_CHAIN_ID = 137;
|
|
3721
|
-
var POLYMARKET_PUSD_ADDRESS = "0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB";
|
|
3722
|
-
var POLYMARKET_USDCE_ADDRESS = "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174";
|
|
3723
|
-
var POLYMARKET_COLLATERAL_OFFRAMP_ADDRESS = "0x2957922Eb93258b93368531d39fAcCA3B4dC5854";
|
|
3724
|
-
var SAFE_MULTI_SEND_CALL_ONLY_ADDRESS = "0x40A2aCCbd92BCA938b02010E17A5b8929b49130D";
|
|
3725
|
-
var GAMMA_API_PUBLIC_PROFILE = "https://gamma-api.polymarket.com/public-profile";
|
|
3726
|
-
var POLYMARKET_ICON_URL = "data:image/svg+xml,%3Csvg width='512' height='512' viewBox='0 0 512 512' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='512' height='512' fill='%232E5CFF'/%3E%3Cpath d='M375.84 389.422C375.84 403.572 375.84 410.647 371.212 414.154C366.585 417.662 359.773 415.75 346.15 411.927L127.22 350.493C119.012 348.19 114.907 347.038 112.534 343.907C110.161 340.776 110.161 336.513 110.161 327.988V184.012C110.161 175.487 110.161 171.224 112.534 168.093C114.907 164.962 119.012 163.81 127.22 161.507L346.15 100.072C359.773 96.2495 366.585 94.338 371.212 97.8455C375.84 101.353 375.84 108.428 375.84 122.578V389.422ZM164.761 330.463L346.035 381.337V279.595L164.761 330.463ZM139.963 306.862L321.201 256L139.963 205.138V306.862ZM164.759 181.537L346.035 232.406V130.663L164.759 181.537Z' fill='white'/%3E%3C/svg%3E";
|
|
3727
3787
|
|
|
3728
3788
|
// src/core/dapp-imports/polymarket/deposit-wallet.ts
|
|
3729
3789
|
|
|
@@ -3773,7 +3833,7 @@ async function detectPolymarketWalletKind(params) {
|
|
|
3773
3833
|
contracts: [
|
|
3774
3834
|
{
|
|
3775
3835
|
address: proxyWallet,
|
|
3776
|
-
abi:
|
|
3836
|
+
abi: _chunkAJHFNHG3cjs.SAFE_ABI,
|
|
3777
3837
|
functionName: "isOwner",
|
|
3778
3838
|
args: [eoa]
|
|
3779
3839
|
},
|
|
@@ -3806,7 +3866,7 @@ async function buildSignedDepositWalletBatch(params) {
|
|
|
3806
3866
|
if (!account || !chain) {
|
|
3807
3867
|
throw new Error("Wallet not connected");
|
|
3808
3868
|
}
|
|
3809
|
-
if (chain.id !== POLYMARKET_POLYGON_CHAIN_ID) {
|
|
3869
|
+
if (chain.id !== _chunkR5CPOBCFcjs.POLYMARKET_POLYGON_CHAIN_ID) {
|
|
3810
3870
|
throw new Error("Switch to Polygon to sign");
|
|
3811
3871
|
}
|
|
3812
3872
|
const owner = await publicClient.readContract({
|
|
@@ -3851,14 +3911,14 @@ async function buildSignedDepositWalletBatch(params) {
|
|
|
3851
3911
|
})),
|
|
3852
3912
|
signature
|
|
3853
3913
|
},
|
|
3854
|
-
sourceToken: POLYMARKET_USDCE_ADDRESS,
|
|
3914
|
+
sourceToken: _chunkR5CPOBCFcjs.POLYMARKET_USDCE_ADDRESS,
|
|
3855
3915
|
sourceSymbol: tokenKind === "pusd" ? "pUSD" : "USDC.e"
|
|
3856
3916
|
};
|
|
3857
3917
|
}
|
|
3858
3918
|
function buildUsdceTransferCalls(recipient, amount) {
|
|
3859
3919
|
return [
|
|
3860
3920
|
{
|
|
3861
|
-
target: POLYMARKET_USDCE_ADDRESS,
|
|
3921
|
+
target: _chunkR5CPOBCFcjs.POLYMARKET_USDCE_ADDRESS,
|
|
3862
3922
|
value: 0n,
|
|
3863
3923
|
data: _viem.encodeFunctionData.call(void 0, {
|
|
3864
3924
|
abi: _viem.erc20Abi,
|
|
@@ -3871,248 +3931,56 @@ function buildUsdceTransferCalls(recipient, amount) {
|
|
|
3871
3931
|
function buildPusdUnwrapCalls(recipient, amount) {
|
|
3872
3932
|
return [
|
|
3873
3933
|
{
|
|
3874
|
-
target: POLYMARKET_PUSD_ADDRESS,
|
|
3934
|
+
target: _chunkR5CPOBCFcjs.POLYMARKET_PUSD_ADDRESS,
|
|
3875
3935
|
value: 0n,
|
|
3876
3936
|
data: _viem.encodeFunctionData.call(void 0, {
|
|
3877
3937
|
abi: _viem.erc20Abi,
|
|
3878
3938
|
functionName: "approve",
|
|
3879
|
-
args: [POLYMARKET_COLLATERAL_OFFRAMP_ADDRESS, amount]
|
|
3939
|
+
args: [_chunkR5CPOBCFcjs.POLYMARKET_COLLATERAL_OFFRAMP_ADDRESS, amount]
|
|
3880
3940
|
})
|
|
3881
3941
|
},
|
|
3882
3942
|
{
|
|
3883
|
-
target: POLYMARKET_COLLATERAL_OFFRAMP_ADDRESS,
|
|
3943
|
+
target: _chunkR5CPOBCFcjs.POLYMARKET_COLLATERAL_OFFRAMP_ADDRESS,
|
|
3884
3944
|
value: 0n,
|
|
3885
3945
|
data: _viem.encodeFunctionData.call(void 0, {
|
|
3886
3946
|
abi: COLLATERAL_OFFRAMP_ABI,
|
|
3887
3947
|
functionName: "unwrap",
|
|
3888
|
-
args: [POLYMARKET_USDCE_ADDRESS, recipient, amount]
|
|
3948
|
+
args: [_chunkR5CPOBCFcjs.POLYMARKET_USDCE_ADDRESS, recipient, amount]
|
|
3889
3949
|
})
|
|
3890
3950
|
}
|
|
3891
3951
|
];
|
|
3892
3952
|
}
|
|
3893
3953
|
|
|
3894
|
-
// src/core/dapp-imports/polymarket/gamma-api.ts
|
|
3895
|
-
|
|
3896
|
-
async function fetchPolymarketProxyWallet(eoa, signal) {
|
|
3897
|
-
const url = `${GAMMA_API_PUBLIC_PROFILE}?address=${eoa}`;
|
|
3898
|
-
let response;
|
|
3899
|
-
try {
|
|
3900
|
-
response = await fetch(url, { signal });
|
|
3901
|
-
} catch (e28) {
|
|
3902
|
-
return null;
|
|
3903
|
-
}
|
|
3904
|
-
if (!response.ok) {
|
|
3905
|
-
return null;
|
|
3906
|
-
}
|
|
3907
|
-
let payload;
|
|
3908
|
-
try {
|
|
3909
|
-
payload = await response.json();
|
|
3910
|
-
} catch (e29) {
|
|
3911
|
-
return null;
|
|
3912
|
-
}
|
|
3913
|
-
const raw = payload.proxyWallet;
|
|
3914
|
-
if (!raw || !_viem.isAddress.call(void 0, raw)) {
|
|
3915
|
-
return null;
|
|
3916
|
-
}
|
|
3917
|
-
const checksummed = _viem.getAddress.call(void 0, raw);
|
|
3918
|
-
if (checksummed === _viem.zeroAddress) {
|
|
3919
|
-
return null;
|
|
3920
|
-
}
|
|
3921
|
-
return checksummed;
|
|
3922
|
-
}
|
|
3923
|
-
|
|
3924
|
-
// src/core/dapp-imports/polymarket/safe.ts
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
var COLLATERAL_OFFRAMP_ABI2 = _viem.parseAbi.call(void 0, [
|
|
3937
|
-
"function unwrap(address _asset, address _to, uint256 _amount)"
|
|
3938
|
-
]);
|
|
3939
|
-
var MULTI_SEND_ABI = _viem.parseAbi.call(void 0, ["function multiSend(bytes transactions)"]);
|
|
3940
|
-
async function readPolymarketBalances(params) {
|
|
3941
|
-
const { publicClient, proxyWallet } = params;
|
|
3942
|
-
try {
|
|
3943
|
-
const results = await publicClient.multicall({
|
|
3944
|
-
allowFailure: true,
|
|
3945
|
-
contracts: [
|
|
3946
|
-
{
|
|
3947
|
-
address: POLYMARKET_PUSD_ADDRESS,
|
|
3948
|
-
abi: _viem.erc20Abi,
|
|
3949
|
-
functionName: "balanceOf",
|
|
3950
|
-
args: [proxyWallet]
|
|
3951
|
-
},
|
|
3952
|
-
{
|
|
3953
|
-
address: POLYMARKET_USDCE_ADDRESS,
|
|
3954
|
-
abi: _viem.erc20Abi,
|
|
3955
|
-
functionName: "balanceOf",
|
|
3956
|
-
args: [proxyWallet]
|
|
3957
|
-
}
|
|
3958
|
-
]
|
|
3959
|
-
});
|
|
3960
|
-
return {
|
|
3961
|
-
pusd: results[0].status === "success" ? results[0].result : 0n,
|
|
3962
|
-
usdce: results[1].status === "success" ? results[1].result : 0n
|
|
3963
|
-
};
|
|
3964
|
-
} catch (e30) {
|
|
3965
|
-
return { pusd: 0n, usdce: 0n };
|
|
3966
|
-
}
|
|
3967
|
-
}
|
|
3968
|
-
async function executePolymarketSafeTransfer(params) {
|
|
3969
|
-
const {
|
|
3970
|
-
walletClient,
|
|
3971
|
-
publicClient,
|
|
3972
|
-
safeAddress,
|
|
3973
|
-
recipient,
|
|
3974
|
-
amount,
|
|
3975
|
-
tokenKind
|
|
3976
|
-
} = params;
|
|
3977
|
-
const account = walletClient.account;
|
|
3978
|
-
const chain = walletClient.chain;
|
|
3979
|
-
if (!account || !chain) {
|
|
3980
|
-
throw new Error("Wallet not connected");
|
|
3981
|
-
}
|
|
3982
|
-
if (chain.id !== POLYMARKET_POLYGON_CHAIN_ID) {
|
|
3983
|
-
throw new Error("Switch to Polygon to sign");
|
|
3984
|
-
}
|
|
3985
|
-
const isOwner = await publicClient.readContract({
|
|
3986
|
-
address: safeAddress,
|
|
3987
|
-
abi: _chunkRABZINV3cjs.SAFE_ABI,
|
|
3988
|
-
functionName: "isOwner",
|
|
3989
|
-
args: [account.address]
|
|
3990
|
-
});
|
|
3991
|
-
if (!isOwner) {
|
|
3992
|
-
throw new Error("Connected wallet is not a Polymarket Safe owner");
|
|
3993
|
-
}
|
|
3994
|
-
const safeTx = tokenKind === "pusd" ? buildPusdUnwrapSafeTx(recipient, amount) : buildUsdceTransferSafeTx(recipient, amount);
|
|
3995
|
-
const signature = _viem.concat.call(void 0, [
|
|
3996
|
-
_viem.pad.call(void 0, account.address, { size: 32 }),
|
|
3997
|
-
_viem.pad.call(void 0, _viem.toHex.call(void 0, 0), { size: 32 }),
|
|
3998
|
-
_viem.toHex.call(void 0, 1, { size: 1 })
|
|
3999
|
-
]);
|
|
4000
|
-
const txHash = await walletClient.writeContract({
|
|
4001
|
-
account,
|
|
4002
|
-
chain,
|
|
4003
|
-
address: safeAddress,
|
|
4004
|
-
abi: _chunkRABZINV3cjs.SAFE_ABI,
|
|
4005
|
-
functionName: "execTransaction",
|
|
4006
|
-
args: [
|
|
4007
|
-
safeTx.to,
|
|
4008
|
-
0n,
|
|
4009
|
-
safeTx.data,
|
|
4010
|
-
safeTx.operation,
|
|
4011
|
-
0n,
|
|
4012
|
-
0n,
|
|
4013
|
-
0n,
|
|
4014
|
-
_viem.zeroAddress,
|
|
4015
|
-
_viem.zeroAddress,
|
|
4016
|
-
signature
|
|
4017
|
-
]
|
|
4018
|
-
});
|
|
4019
|
-
const receipt = await publicClient.waitForTransactionReceipt({
|
|
4020
|
-
hash: txHash
|
|
4021
|
-
});
|
|
4022
|
-
const parsed = _viem.parseEventLogs.call(void 0, {
|
|
4023
|
-
abi: _chunkRABZINV3cjs.SAFE_ABI,
|
|
4024
|
-
logs: receipt.logs.filter(
|
|
4025
|
-
(log) => log.address.toLowerCase() === safeAddress.toLowerCase()
|
|
4026
|
-
),
|
|
4027
|
-
strict: false
|
|
4028
|
-
});
|
|
4029
|
-
if (parsed.some((log) => log.eventName === "ExecutionFailure")) {
|
|
4030
|
-
throw new Error("Polymarket Safe transaction failed");
|
|
4031
|
-
}
|
|
4032
|
-
if (!parsed.some((log) => log.eventName === "ExecutionSuccess")) {
|
|
4033
|
-
throw new Error("Polymarket Safe transaction status unavailable");
|
|
4034
|
-
}
|
|
4035
|
-
return {
|
|
4036
|
-
txHash,
|
|
4037
|
-
// The smart account always receives USDC.e — pUSD is unwrapped to USDC.e
|
|
4038
|
-
// before it lands at `recipient`.
|
|
4039
|
-
sourceToken: POLYMARKET_USDCE_ADDRESS,
|
|
4040
|
-
sourceSymbol: tokenKind === "pusd" ? "pUSD" : "USDC.e"
|
|
4041
|
-
};
|
|
4042
|
-
}
|
|
4043
|
-
function buildUsdceTransferSafeTx(recipient, amount) {
|
|
4044
|
-
return {
|
|
4045
|
-
to: POLYMARKET_USDCE_ADDRESS,
|
|
4046
|
-
data: _viem.encodeFunctionData.call(void 0, {
|
|
4047
|
-
abi: _viem.erc20Abi,
|
|
4048
|
-
functionName: "transfer",
|
|
4049
|
-
args: [recipient, amount]
|
|
4050
|
-
}),
|
|
4051
|
-
operation: 0
|
|
4052
|
-
};
|
|
4053
|
-
}
|
|
4054
|
-
function buildPusdUnwrapSafeTx(recipient, amount) {
|
|
4055
|
-
const approveData = _viem.encodeFunctionData.call(void 0, {
|
|
4056
|
-
abi: _viem.erc20Abi,
|
|
4057
|
-
functionName: "approve",
|
|
4058
|
-
args: [POLYMARKET_COLLATERAL_OFFRAMP_ADDRESS, amount]
|
|
4059
|
-
});
|
|
4060
|
-
const unwrapData = _viem.encodeFunctionData.call(void 0, {
|
|
4061
|
-
abi: COLLATERAL_OFFRAMP_ABI2,
|
|
4062
|
-
functionName: "unwrap",
|
|
4063
|
-
args: [POLYMARKET_USDCE_ADDRESS, recipient, amount]
|
|
4064
|
-
});
|
|
4065
|
-
return {
|
|
4066
|
-
to: SAFE_MULTI_SEND_CALL_ONLY_ADDRESS,
|
|
4067
|
-
data: _viem.encodeFunctionData.call(void 0, {
|
|
4068
|
-
abi: MULTI_SEND_ABI,
|
|
4069
|
-
functionName: "multiSend",
|
|
4070
|
-
args: [
|
|
4071
|
-
_viem.concat.call(void 0, [
|
|
4072
|
-
encodeMultiSendCall(POLYMARKET_PUSD_ADDRESS, approveData),
|
|
4073
|
-
encodeMultiSendCall(POLYMARKET_COLLATERAL_OFFRAMP_ADDRESS, unwrapData)
|
|
4074
|
-
])
|
|
4075
|
-
]
|
|
4076
|
-
}),
|
|
4077
|
-
operation: 1
|
|
4078
|
-
};
|
|
4079
|
-
}
|
|
4080
|
-
function encodeMultiSendCall(to, data) {
|
|
4081
|
-
return _viem.encodePacked.call(void 0,
|
|
4082
|
-
["uint8", "address", "uint256", "uint256", "bytes"],
|
|
4083
|
-
[0, to, 0n, BigInt((data.length - 2) / 2), data]
|
|
4084
|
-
);
|
|
4085
|
-
}
|
|
4086
|
-
|
|
4087
3954
|
// src/core/dapp-imports/polymarket/index.ts
|
|
4088
3955
|
var PROVIDER_ID = "polymarket";
|
|
4089
3956
|
var polymarketProvider = {
|
|
4090
3957
|
id: PROVIDER_ID,
|
|
4091
3958
|
label: "Transfer from Polymarket",
|
|
3959
|
+
sourceLabel: "Polymarket",
|
|
4092
3960
|
icon: _react.createElement.call(void 0, "img", {
|
|
4093
|
-
src: POLYMARKET_ICON_URL,
|
|
3961
|
+
src: _chunkR5CPOBCFcjs.POLYMARKET_ICON_URL,
|
|
4094
3962
|
alt: "Polymarket",
|
|
4095
3963
|
style: { width: 24, height: 24, borderRadius: 6 }
|
|
4096
3964
|
}),
|
|
4097
|
-
chainId: POLYMARKET_POLYGON_CHAIN_ID,
|
|
3965
|
+
chainId: _chunkR5CPOBCFcjs.POLYMARKET_POLYGON_CHAIN_ID,
|
|
4098
3966
|
async fetchAvailability({ eoa, getPublicClient: getPublicClient2, signal }) {
|
|
4099
|
-
const proxyWallet = await fetchPolymarketProxyWallet(eoa, signal);
|
|
3967
|
+
const proxyWallet = await _chunkR5CPOBCFcjs.fetchPolymarketProxyWallet.call(void 0, eoa, signal);
|
|
4100
3968
|
if (!proxyWallet) return null;
|
|
4101
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
4102
|
-
const polygonClient = getPublicClient2(POLYMARKET_POLYGON_CHAIN_ID);
|
|
3969
|
+
if (_optionalChain([signal, 'optionalAccess', _121 => _121.aborted])) return null;
|
|
3970
|
+
const polygonClient = getPublicClient2(_chunkR5CPOBCFcjs.POLYMARKET_POLYGON_CHAIN_ID);
|
|
4103
3971
|
if (!polygonClient) return null;
|
|
4104
|
-
const balances = await readPolymarketBalances({
|
|
3972
|
+
const balances = await _chunkR5CPOBCFcjs.readPolymarketBalances.call(void 0, {
|
|
4105
3973
|
publicClient: polygonClient,
|
|
4106
3974
|
proxyWallet
|
|
4107
3975
|
});
|
|
4108
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
3976
|
+
if (_optionalChain([signal, 'optionalAccess', _122 => _122.aborted])) return null;
|
|
4109
3977
|
if (balances.pusd === 0n && balances.usdce === 0n) return null;
|
|
4110
3978
|
const walletKind = await detectPolymarketWalletKind({
|
|
4111
3979
|
publicClient: polygonClient,
|
|
4112
3980
|
proxyWallet,
|
|
4113
3981
|
eoa
|
|
4114
3982
|
});
|
|
4115
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
3983
|
+
if (_optionalChain([signal, 'optionalAccess', _123 => _123.aborted])) return null;
|
|
4116
3984
|
if (!walletKind) return null;
|
|
4117
3985
|
const assets = [];
|
|
4118
3986
|
if (balances.pusd > 0n) {
|
|
@@ -4159,7 +4027,7 @@ var polymarketProvider = {
|
|
|
4159
4027
|
const { txHash } = await backend.submitPolymarketWithdraw(payload);
|
|
4160
4028
|
return { txHash, sourceToken, sourceSymbol, sourceDecimals: 6 };
|
|
4161
4029
|
}
|
|
4162
|
-
const result = await executePolymarketSafeTransfer({
|
|
4030
|
+
const result = await _chunkR5CPOBCFcjs.executePolymarketSafeTransfer.call(void 0, {
|
|
4163
4031
|
walletClient,
|
|
4164
4032
|
publicClient,
|
|
4165
4033
|
safeAddress: metadata.proxyWallet,
|
|
@@ -4178,17 +4046,17 @@ var polymarketProvider = {
|
|
|
4178
4046
|
function buildAsset(params) {
|
|
4179
4047
|
const { tokenKind, proxyWallet, walletKind, balance } = params;
|
|
4180
4048
|
const isPusd = tokenKind === "pusd";
|
|
4181
|
-
const tokenAddress = isPusd ? POLYMARKET_PUSD_ADDRESS : POLYMARKET_USDCE_ADDRESS;
|
|
4049
|
+
const tokenAddress = isPusd ? _chunkR5CPOBCFcjs.POLYMARKET_PUSD_ADDRESS : _chunkR5CPOBCFcjs.POLYMARKET_USDCE_ADDRESS;
|
|
4182
4050
|
const symbol = isPusd ? "pUSD" : "USDC.e";
|
|
4183
4051
|
const balanceUsd = Number(_viem.formatUnits.call(void 0, balance, 6));
|
|
4184
4052
|
const metadata = { proxyWallet, tokenKind, walletKind };
|
|
4185
4053
|
return {
|
|
4186
4054
|
id: `polymarket:${tokenKind}`,
|
|
4187
|
-
chainId: POLYMARKET_POLYGON_CHAIN_ID,
|
|
4055
|
+
chainId: _chunkR5CPOBCFcjs.POLYMARKET_POLYGON_CHAIN_ID,
|
|
4188
4056
|
token: tokenAddress,
|
|
4189
4057
|
symbol,
|
|
4190
4058
|
name: isPusd ? "Polymarket USD" : "Polygon USDC.e",
|
|
4191
|
-
icon: isPusd ? POLYMARKET_ICON_URL : void 0,
|
|
4059
|
+
icon: isPusd ? _chunkR5CPOBCFcjs.POLYMARKET_ICON_URL : void 0,
|
|
4192
4060
|
decimals: 6,
|
|
4193
4061
|
balance: balance.toString(),
|
|
4194
4062
|
balanceUsd: Number.isFinite(balanceUsd) ? balanceUsd : 0,
|
|
@@ -4198,8 +4066,8 @@ function buildAsset(params) {
|
|
|
4198
4066
|
// pUSD unwraps to USDC.e via the offramp; USDC.e is what actually
|
|
4199
4067
|
// arrives at the smart account, so it's also what the orchestrator
|
|
4200
4068
|
// bridges from.
|
|
4201
|
-
depositToken: POLYMARKET_USDCE_ADDRESS,
|
|
4202
|
-
depositChainId: POLYMARKET_POLYGON_CHAIN_ID,
|
|
4069
|
+
depositToken: _chunkR5CPOBCFcjs.POLYMARKET_USDCE_ADDRESS,
|
|
4070
|
+
depositChainId: _chunkR5CPOBCFcjs.POLYMARKET_POLYGON_CHAIN_ID,
|
|
4203
4071
|
providerMetadata: metadata
|
|
4204
4072
|
};
|
|
4205
4073
|
}
|
|
@@ -4213,6 +4081,77 @@ function getEnabledProviders(config) {
|
|
|
4213
4081
|
);
|
|
4214
4082
|
}
|
|
4215
4083
|
|
|
4084
|
+
// src/store/selectors.ts
|
|
4085
|
+
var selectedWalletIdSelector = (state) => state.wallet.selectedWalletId;
|
|
4086
|
+
var IDLE_SETUP_ENTRY = {
|
|
4087
|
+
owner: null,
|
|
4088
|
+
requestKey: null,
|
|
4089
|
+
cacheKey: null,
|
|
4090
|
+
status: "idle",
|
|
4091
|
+
smartAccount: null,
|
|
4092
|
+
sessionOwnerAddress: null,
|
|
4093
|
+
solanaDepositAddress: null,
|
|
4094
|
+
message: null,
|
|
4095
|
+
cacheable: true,
|
|
4096
|
+
attemptNonce: 0
|
|
4097
|
+
};
|
|
4098
|
+
function readSetupForOwner(setup, owner) {
|
|
4099
|
+
if (!owner) return IDLE_SETUP_ENTRY;
|
|
4100
|
+
const entry = setup.byOwner[owner.toLowerCase()];
|
|
4101
|
+
return _nullishCoalesce(entry, () => ( { ...IDLE_SETUP_ENTRY, owner }));
|
|
4102
|
+
}
|
|
4103
|
+
|
|
4104
|
+
// src/core/dapp-imports/status.ts
|
|
4105
|
+
function computeDappImportStatus(providerId, inputs) {
|
|
4106
|
+
const { owner, availability, availabilityOwner, setup } = inputs;
|
|
4107
|
+
if (!owner) return "needs-connect";
|
|
4108
|
+
const entry = _optionalChain([availabilityOwner, 'optionalAccess', _124 => _124.toLowerCase, 'call', _125 => _125()]) === owner.toLowerCase() ? availability[providerId] : void 0;
|
|
4109
|
+
if (entry === "loading" || entry === void 0) return "loading";
|
|
4110
|
+
if (entry === "error") {
|
|
4111
|
+
return {
|
|
4112
|
+
enabled: false,
|
|
4113
|
+
reason: "Couldn't load balance \u2014 tap to retry",
|
|
4114
|
+
retryable: true
|
|
4115
|
+
};
|
|
4116
|
+
}
|
|
4117
|
+
if (entry === null) return { enabled: false, reason: "No balance" };
|
|
4118
|
+
const setupEntry = readSetupForOwner(setup, owner);
|
|
4119
|
+
if (setupEntry.status === "loading") return "loading";
|
|
4120
|
+
if (setupEntry.status === "error") {
|
|
4121
|
+
return {
|
|
4122
|
+
enabled: false,
|
|
4123
|
+
reason: "Couldn't prepare account \u2014 tap to retry",
|
|
4124
|
+
retryable: true
|
|
4125
|
+
};
|
|
4126
|
+
}
|
|
4127
|
+
return { enabled: true, balanceUsd: entry.totalUsd };
|
|
4128
|
+
}
|
|
4129
|
+
function resolveBootOutcome(params) {
|
|
4130
|
+
const { status, setupStatus, timedOut, walletHydrating, signerAvailable } = params;
|
|
4131
|
+
if (status === "needs-connect") {
|
|
4132
|
+
return walletHydrating && !timedOut ? "wait" : "unavailable";
|
|
4133
|
+
}
|
|
4134
|
+
if (status === "loading") return timedOut ? "error" : "wait";
|
|
4135
|
+
if (!status.enabled) {
|
|
4136
|
+
return status.retryable ? "error" : "unavailable";
|
|
4137
|
+
}
|
|
4138
|
+
if (setupStatus === "ready") {
|
|
4139
|
+
if (!signerAvailable) return timedOut ? "error" : "wait";
|
|
4140
|
+
return "ready";
|
|
4141
|
+
}
|
|
4142
|
+
if (setupStatus === "error") return "error";
|
|
4143
|
+
return timedOut ? "error" : "wait";
|
|
4144
|
+
}
|
|
4145
|
+
function bootRetryPlan(params) {
|
|
4146
|
+
const { setupStatus, availabilityEntry } = params;
|
|
4147
|
+
return {
|
|
4148
|
+
restartSetup: setupStatus !== "ready",
|
|
4149
|
+
// `null` is a delivered "no account" — only refetch when nothing
|
|
4150
|
+
// usable came back ("error", still "loading", or never recorded).
|
|
4151
|
+
refetchAvailability: availabilityEntry === "error" || availabilityEntry === "loading" || availabilityEntry === void 0
|
|
4152
|
+
};
|
|
4153
|
+
}
|
|
4154
|
+
|
|
4216
4155
|
// src/core/dapp-imports/types.ts
|
|
4217
4156
|
function isDappImportAsset(asset) {
|
|
4218
4157
|
return typeof asset.source === "string" && typeof asset.sourceLabel === "string" && "providerMetadata" in asset;
|
|
@@ -4336,6 +4275,7 @@ function applyBack(state, hasWalletOptions) {
|
|
|
4336
4275
|
case "fiat-onramp":
|
|
4337
4276
|
case "exchange-select":
|
|
4338
4277
|
case "solana-token-select":
|
|
4278
|
+
case "dapp-import-resolving":
|
|
4339
4279
|
case "dapp-import-asset-select":
|
|
4340
4280
|
return {
|
|
4341
4281
|
...state,
|
|
@@ -4350,7 +4290,8 @@ function applyBack(state, hasWalletOptions) {
|
|
|
4350
4290
|
dappImport: {
|
|
4351
4291
|
...state.dappImport,
|
|
4352
4292
|
activeProviderId: null,
|
|
4353
|
-
selectedAsset: null
|
|
4293
|
+
selectedAsset: null,
|
|
4294
|
+
bootError: false
|
|
4354
4295
|
},
|
|
4355
4296
|
exchange: { selectedConnection: null }
|
|
4356
4297
|
};
|
|
@@ -4493,16 +4434,6 @@ function applyAction(state, action) {
|
|
|
4493
4434
|
},
|
|
4494
4435
|
exchange: { selectedConnection: action.connection }
|
|
4495
4436
|
};
|
|
4496
|
-
case "connect/auto-locked":
|
|
4497
|
-
return {
|
|
4498
|
-
...state,
|
|
4499
|
-
flow: {
|
|
4500
|
-
...state.flow,
|
|
4501
|
-
mode: "wallet",
|
|
4502
|
-
isConnectSelectionConfirmed: true,
|
|
4503
|
-
step: "select-asset"
|
|
4504
|
-
}
|
|
4505
|
-
};
|
|
4506
4437
|
case "connect/wallet-picker-requested":
|
|
4507
4438
|
return {
|
|
4508
4439
|
...state,
|
|
@@ -4528,12 +4459,12 @@ function applyAction(state, action) {
|
|
|
4528
4459
|
requestKey: action.requestKey,
|
|
4529
4460
|
cacheKey: action.cacheKey,
|
|
4530
4461
|
status: "loading",
|
|
4531
|
-
smartAccount: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
4532
|
-
sessionOwnerAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
4533
|
-
solanaDepositAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
4462
|
+
smartAccount: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _126 => _126.smartAccount]), () => ( null)),
|
|
4463
|
+
sessionOwnerAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _127 => _127.sessionOwnerAddress]), () => ( null)),
|
|
4464
|
+
solanaDepositAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _128 => _128.solanaDepositAddress]), () => ( null)),
|
|
4534
4465
|
message: null,
|
|
4535
4466
|
cacheable: action.cacheable,
|
|
4536
|
-
attemptNonce: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
4467
|
+
attemptNonce: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _129 => _129.attemptNonce]), () => ( 0))
|
|
4537
4468
|
}));
|
|
4538
4469
|
}
|
|
4539
4470
|
case "setup/ready": {
|
|
@@ -4685,17 +4616,41 @@ function applyAction(state, action) {
|
|
|
4685
4616
|
}
|
|
4686
4617
|
}
|
|
4687
4618
|
};
|
|
4688
|
-
case "dapp-import/availability-
|
|
4619
|
+
case "dapp-import/availability-failed":
|
|
4620
|
+
if (!state.dappImport.availabilityOwner || ownerKey(state.dappImport.availabilityOwner) !== ownerKey(action.owner)) {
|
|
4621
|
+
return state;
|
|
4622
|
+
}
|
|
4623
|
+
return {
|
|
4624
|
+
...state,
|
|
4625
|
+
dappImport: {
|
|
4626
|
+
...state.dappImport,
|
|
4627
|
+
availability: {
|
|
4628
|
+
...state.dappImport.availability,
|
|
4629
|
+
[action.providerId]: "error"
|
|
4630
|
+
}
|
|
4631
|
+
}
|
|
4632
|
+
};
|
|
4633
|
+
case "dapp-import/availability-retry-requested":
|
|
4634
|
+
return {
|
|
4635
|
+
...state,
|
|
4636
|
+
dappImport: {
|
|
4637
|
+
...state.dappImport,
|
|
4638
|
+
attemptNonce: state.dappImport.attemptNonce + 1
|
|
4639
|
+
}
|
|
4640
|
+
};
|
|
4641
|
+
case "dapp-import/availability-cleared": {
|
|
4642
|
+
const isBootResolving = state.flow.step === "dapp-import-resolving";
|
|
4689
4643
|
return {
|
|
4690
4644
|
...state,
|
|
4691
4645
|
dappImport: {
|
|
4692
4646
|
...state.dappImport,
|
|
4693
4647
|
availabilityOwner: null,
|
|
4694
4648
|
availability: {},
|
|
4695
|
-
activeProviderId: null,
|
|
4696
|
-
selectedAsset: null
|
|
4649
|
+
activeProviderId: isBootResolving ? state.dappImport.activeProviderId : null,
|
|
4650
|
+
selectedAsset: isBootResolving ? state.dappImport.selectedAsset : null
|
|
4697
4651
|
}
|
|
4698
4652
|
};
|
|
4653
|
+
}
|
|
4699
4654
|
case "dapp-import/provider-selected":
|
|
4700
4655
|
return {
|
|
4701
4656
|
...state,
|
|
@@ -4724,6 +4679,57 @@ function applyAction(state, action) {
|
|
|
4724
4679
|
},
|
|
4725
4680
|
flow: { ...state.flow, step: "amount" }
|
|
4726
4681
|
};
|
|
4682
|
+
case "dapp-import/boot-requested":
|
|
4683
|
+
return {
|
|
4684
|
+
...state,
|
|
4685
|
+
flow: {
|
|
4686
|
+
...state.flow,
|
|
4687
|
+
mode: "dapp-import",
|
|
4688
|
+
isConnectSelectionConfirmed: true,
|
|
4689
|
+
step: "dapp-import-resolving"
|
|
4690
|
+
},
|
|
4691
|
+
dappImport: {
|
|
4692
|
+
...state.dappImport,
|
|
4693
|
+
activeProviderId: action.providerId,
|
|
4694
|
+
selectedAsset: null,
|
|
4695
|
+
bootError: false
|
|
4696
|
+
}
|
|
4697
|
+
};
|
|
4698
|
+
case "dapp-import/boot-resolved": {
|
|
4699
|
+
if (state.flow.step !== "dapp-import-resolving" || state.dappImport.activeProviderId !== action.providerId) {
|
|
4700
|
+
return state;
|
|
4701
|
+
}
|
|
4702
|
+
switch (action.outcome) {
|
|
4703
|
+
case "ready":
|
|
4704
|
+
return {
|
|
4705
|
+
...state,
|
|
4706
|
+
flow: { ...state.flow, step: "dapp-import-asset-select" },
|
|
4707
|
+
dappImport: { ...state.dappImport, bootError: false }
|
|
4708
|
+
};
|
|
4709
|
+
case "unavailable":
|
|
4710
|
+
return {
|
|
4711
|
+
...state,
|
|
4712
|
+
flow: {
|
|
4713
|
+
...state.flow,
|
|
4714
|
+
step: "connect",
|
|
4715
|
+
mode: null,
|
|
4716
|
+
isConnectSelectionConfirmed: false,
|
|
4717
|
+
hasNavigatedBack: true
|
|
4718
|
+
},
|
|
4719
|
+
dappImport: {
|
|
4720
|
+
...state.dappImport,
|
|
4721
|
+
activeProviderId: null,
|
|
4722
|
+
selectedAsset: null,
|
|
4723
|
+
bootError: false
|
|
4724
|
+
}
|
|
4725
|
+
};
|
|
4726
|
+
case "error":
|
|
4727
|
+
return {
|
|
4728
|
+
...state,
|
|
4729
|
+
dappImport: { ...state.dappImport, bootError: true }
|
|
4730
|
+
};
|
|
4731
|
+
}
|
|
4732
|
+
}
|
|
4727
4733
|
case "back/requested":
|
|
4728
4734
|
return applyBack(state, action.hasWalletOptions);
|
|
4729
4735
|
case "flow/reset": {
|
|
@@ -4751,12 +4757,18 @@ function applyAction(state, action) {
|
|
|
4751
4757
|
txHash: null,
|
|
4752
4758
|
directTransfer: false
|
|
4753
4759
|
},
|
|
4754
|
-
//
|
|
4755
|
-
//
|
|
4760
|
+
// Drop fetched availability wholesale. The fetch effect refetches
|
|
4761
|
+
// unconditionally on remount (so keeping the map saves nothing),
|
|
4762
|
+
// and a preserved terminal entry (null / "error") could be consumed
|
|
4763
|
+
// by a fresh pre-routed boot before the refetch's loading update
|
|
4764
|
+
// lands — routing a now-funded account home off stale data.
|
|
4756
4765
|
dappImport: {
|
|
4757
|
-
...state.dappImport,
|
|
4758
4766
|
activeProviderId: null,
|
|
4759
|
-
|
|
4767
|
+
availabilityOwner: null,
|
|
4768
|
+
availability: {},
|
|
4769
|
+
selectedAsset: null,
|
|
4770
|
+
bootError: false,
|
|
4771
|
+
attemptNonce: 0
|
|
4760
4772
|
},
|
|
4761
4773
|
setup: { byOwner: preservedByOwner },
|
|
4762
4774
|
fiat: { selectedMethod: null },
|
|
@@ -4830,7 +4842,9 @@ function createInitialState(overrides) {
|
|
|
4830
4842
|
activeProviderId: null,
|
|
4831
4843
|
availabilityOwner: null,
|
|
4832
4844
|
availability: {},
|
|
4833
|
-
selectedAsset: null
|
|
4845
|
+
selectedAsset: null,
|
|
4846
|
+
bootError: false,
|
|
4847
|
+
attemptNonce: 0
|
|
4834
4848
|
},
|
|
4835
4849
|
setup: {
|
|
4836
4850
|
byOwner: {}
|
|
@@ -4844,26 +4858,6 @@ function createInitialState(overrides) {
|
|
|
4844
4858
|
};
|
|
4845
4859
|
}
|
|
4846
4860
|
|
|
4847
|
-
// src/store/selectors.ts
|
|
4848
|
-
var selectedWalletIdSelector = (state) => state.wallet.selectedWalletId;
|
|
4849
|
-
var IDLE_SETUP_ENTRY = {
|
|
4850
|
-
owner: null,
|
|
4851
|
-
requestKey: null,
|
|
4852
|
-
cacheKey: null,
|
|
4853
|
-
status: "idle",
|
|
4854
|
-
smartAccount: null,
|
|
4855
|
-
sessionOwnerAddress: null,
|
|
4856
|
-
solanaDepositAddress: null,
|
|
4857
|
-
message: null,
|
|
4858
|
-
cacheable: true,
|
|
4859
|
-
attemptNonce: 0
|
|
4860
|
-
};
|
|
4861
|
-
function readSetupForOwner(setup, owner) {
|
|
4862
|
-
if (!owner) return IDLE_SETUP_ENTRY;
|
|
4863
|
-
const entry = setup.byOwner[owner.toLowerCase()];
|
|
4864
|
-
return _nullishCoalesce(entry, () => ( { ...IDLE_SETUP_ENTRY, owner }));
|
|
4865
|
-
}
|
|
4866
|
-
|
|
4867
4861
|
// src/store/index.ts
|
|
4868
4862
|
function createDepositStore(overrides) {
|
|
4869
4863
|
const store = _vanilla.createStore.call(void 0, () => createInitialState(overrides));
|
|
@@ -4908,15 +4902,15 @@ var SetupError = class extends Error {
|
|
|
4908
4902
|
}
|
|
4909
4903
|
};
|
|
4910
4904
|
async function resolveSessionOwner(eoaAddress) {
|
|
4911
|
-
const local =
|
|
4905
|
+
const local = _chunkMQIJZNTPcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
4912
4906
|
if (local) {
|
|
4913
4907
|
return {
|
|
4914
|
-
account:
|
|
4908
|
+
account: _chunkMQIJZNTPcjs.accountFromPrivateKey.call(void 0, local.privateKey),
|
|
4915
4909
|
address: local.address
|
|
4916
4910
|
};
|
|
4917
4911
|
}
|
|
4918
|
-
const created =
|
|
4919
|
-
|
|
4912
|
+
const created = _chunkMQIJZNTPcjs.createSessionOwnerKey.call(void 0, );
|
|
4913
|
+
_chunkMQIJZNTPcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
4920
4914
|
return { account: created.account, address: created.address };
|
|
4921
4915
|
}
|
|
4922
4916
|
function stableStringify(value) {
|
|
@@ -4966,14 +4960,14 @@ function computeCacheKey(input, sessionOwnerAddress) {
|
|
|
4966
4960
|
});
|
|
4967
4961
|
}
|
|
4968
4962
|
function computeIsCacheable(input) {
|
|
4969
|
-
return !input.forceRegister && !(_nullishCoalesce(_optionalChain([input, 'access',
|
|
4963
|
+
return !input.forceRegister && !(_nullishCoalesce(_optionalChain([input, 'access', _130 => _130.postBridgeActions, 'optionalAccess', _131 => _131.length]), () => ( 0)));
|
|
4970
4964
|
}
|
|
4971
4965
|
var SETUP_REQUEST_DEDUPE_TTL_MS = 3e4;
|
|
4972
4966
|
var setupRequestDedupe = /* @__PURE__ */ new Map();
|
|
4973
4967
|
function readDedupedAccountSetupResult(requestKey) {
|
|
4974
4968
|
const now = Date.now();
|
|
4975
4969
|
const existing = setupRequestDedupe.get(requestKey);
|
|
4976
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
4970
|
+
if (_optionalChain([existing, 'optionalAccess', _132 => _132.settled]) && existing.expiresAt > now && existing.result) {
|
|
4977
4971
|
return existing.result;
|
|
4978
4972
|
}
|
|
4979
4973
|
return null;
|
|
@@ -4984,10 +4978,10 @@ async function runAccountSetup(input, deps) {
|
|
|
4984
4978
|
try {
|
|
4985
4979
|
const sessionOwner = await resolveSessionOwner(input.ownerAddress);
|
|
4986
4980
|
const cacheKey = computeCacheKey(input, sessionOwner.address);
|
|
4987
|
-
|
|
4981
|
+
_chunkMQIJZNTPcjs.debugLog.call(void 0, debug, "account-setup", "setup:start", {
|
|
4988
4982
|
owner: input.ownerAddress,
|
|
4989
4983
|
sessionOwner: sessionOwner.address,
|
|
4990
|
-
hasPostBridgeActions: Boolean(_optionalChain([input, 'access',
|
|
4984
|
+
hasPostBridgeActions: Boolean(_optionalChain([input, 'access', _133 => _133.postBridgeActions, 'optionalAccess', _134 => _134.length])),
|
|
4991
4985
|
forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
|
|
4992
4986
|
});
|
|
4993
4987
|
const setup = await service.setupAccount({
|
|
@@ -5032,7 +5026,7 @@ async function runAccountSetup(input, deps) {
|
|
|
5032
5026
|
primaryType: typedData.primaryType,
|
|
5033
5027
|
message: typedData.message
|
|
5034
5028
|
});
|
|
5035
|
-
const sessionDetails =
|
|
5029
|
+
const sessionDetails = _chunkMQIJZNTPcjs.buildSessionDetails.call(void 0,
|
|
5036
5030
|
setup.sessionDetailsUnsigned,
|
|
5037
5031
|
signature
|
|
5038
5032
|
);
|
|
@@ -5049,10 +5043,10 @@ async function runAccountSetup(input, deps) {
|
|
|
5049
5043
|
chain: _chunkMILJQWPTcjs.targetChainToCaip2.call(void 0, input.targetChain),
|
|
5050
5044
|
token: input.targetToken,
|
|
5051
5045
|
...input.recipient && { recipient: input.recipient },
|
|
5052
|
-
..._optionalChain([input, 'access',
|
|
5046
|
+
..._optionalChain([input, 'access', _135 => _135.postBridgeActions, 'optionalAccess', _136 => _136.length]) && {
|
|
5053
5047
|
postBridgeActions: input.postBridgeActions
|
|
5054
5048
|
},
|
|
5055
|
-
..._optionalChain([input, 'access',
|
|
5049
|
+
..._optionalChain([input, 'access', _137 => _137.outputTokenRules, 'optionalAccess', _138 => _138.length]) && {
|
|
5056
5050
|
outputTokenRules: input.outputTokenRules
|
|
5057
5051
|
},
|
|
5058
5052
|
...input.rejectUnmapped != null && {
|
|
@@ -5068,7 +5062,7 @@ async function runAccountSetup(input, deps) {
|
|
|
5068
5062
|
isRegistered: true
|
|
5069
5063
|
};
|
|
5070
5064
|
} catch (error) {
|
|
5071
|
-
|
|
5065
|
+
_chunkMQIJZNTPcjs.debugError.call(void 0, debug, "account-setup", "setup:failed", error, {
|
|
5072
5066
|
owner: input.ownerAddress
|
|
5073
5067
|
});
|
|
5074
5068
|
if (error instanceof SetupError) throw error;
|
|
@@ -5079,7 +5073,7 @@ function runAccountSetupDeduped(input, deps, requestKey) {
|
|
|
5079
5073
|
const now = Date.now();
|
|
5080
5074
|
const existing = setupRequestDedupe.get(requestKey);
|
|
5081
5075
|
if (existing && (!existing.settled || existing.expiresAt > now)) {
|
|
5082
|
-
|
|
5076
|
+
_chunkMQIJZNTPcjs.debugLog.call(void 0, deps.debug, "account-setup", "setup:dedupe-hit", {
|
|
5083
5077
|
owner: input.ownerAddress,
|
|
5084
5078
|
forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
|
|
5085
5079
|
});
|
|
@@ -5164,6 +5158,7 @@ function AccountPreparingSkeleton({
|
|
|
5164
5158
|
] });
|
|
5165
5159
|
}
|
|
5166
5160
|
var QR_AUTO_ADVANCE_HYDRATION_GRACE_MS = 1e3;
|
|
5161
|
+
var DAPP_IMPORT_RESOLVE_TIMEOUT_MS = 1e4;
|
|
5167
5162
|
function isSameRoute2(sourceChain, sourceToken, targetChain, targetToken) {
|
|
5168
5163
|
return sourceChain === targetChain && sourceToken.toLowerCase() === targetToken.toLowerCase();
|
|
5169
5164
|
}
|
|
@@ -5252,6 +5247,8 @@ function deriveStep(flow, d, p, activeEntry, fiat, exchange) {
|
|
|
5252
5247
|
balanceUsd: d.balanceUsd,
|
|
5253
5248
|
inputAmountUsd: _nullishCoalesce(d.inputAmountUsd, () => ( void 0))
|
|
5254
5249
|
};
|
|
5250
|
+
case "dapp-import-resolving":
|
|
5251
|
+
return { type: "dapp-import-resolving" };
|
|
5255
5252
|
case "dapp-import-asset-select":
|
|
5256
5253
|
if (!smartAccount) return { type: "setup" };
|
|
5257
5254
|
return { type: "dapp-import-asset-select", smartAccount };
|
|
@@ -5326,6 +5323,7 @@ function DepositFlow({
|
|
|
5326
5323
|
forceRegister = false,
|
|
5327
5324
|
enableSolana = true,
|
|
5328
5325
|
dappImports,
|
|
5326
|
+
initialDappImport,
|
|
5329
5327
|
enableFiatOnramp = false,
|
|
5330
5328
|
enableQrTransfer = true,
|
|
5331
5329
|
fiatOnrampMethods,
|
|
@@ -5343,12 +5341,12 @@ function DepositFlow({
|
|
|
5343
5341
|
onError,
|
|
5344
5342
|
debug
|
|
5345
5343
|
}) {
|
|
5346
|
-
const onStepChangeRef =
|
|
5347
|
-
const onEventRef =
|
|
5348
|
-
const onLifecycleRef =
|
|
5349
|
-
const onErrorRef =
|
|
5344
|
+
const onStepChangeRef = _chunkMQIJZNTPcjs.useLatestRef.call(void 0, onStepChange);
|
|
5345
|
+
const onEventRef = _chunkMQIJZNTPcjs.useLatestRef.call(void 0, onEvent);
|
|
5346
|
+
const onLifecycleRef = _chunkMQIJZNTPcjs.useLatestRef.call(void 0, onLifecycle);
|
|
5347
|
+
const onErrorRef = _chunkMQIJZNTPcjs.useLatestRef.call(void 0, onError);
|
|
5350
5348
|
const hasInitialReownSession = Boolean(
|
|
5351
|
-
enableSolana ? _optionalChain([reownWallet, 'optionalAccess',
|
|
5349
|
+
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _139 => _139.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _140 => _140.address]) : _optionalChain([reownWallet, 'optionalAccess', _141 => _141.address])
|
|
5352
5350
|
);
|
|
5353
5351
|
const hasInitialWalletHydrationPending = Boolean(
|
|
5354
5352
|
dappAddress && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasInitialReownSession && !reownWallet.isReady)
|
|
@@ -5371,13 +5369,13 @@ function DepositFlow({
|
|
|
5371
5369
|
const stableWalletSelectionKeyRef = _react.useRef.call(void 0, null);
|
|
5372
5370
|
const logFlow = _react.useCallback.call(void 0,
|
|
5373
5371
|
(message, data) => {
|
|
5374
|
-
|
|
5372
|
+
_chunkMQIJZNTPcjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
|
|
5375
5373
|
},
|
|
5376
5374
|
[debug]
|
|
5377
5375
|
);
|
|
5378
5376
|
const logFlowError = _react.useCallback.call(void 0,
|
|
5379
5377
|
(message, error, data) => {
|
|
5380
|
-
|
|
5378
|
+
_chunkMQIJZNTPcjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
|
|
5381
5379
|
},
|
|
5382
5380
|
[debug]
|
|
5383
5381
|
);
|
|
@@ -5393,19 +5391,19 @@ function DepositFlow({
|
|
|
5393
5391
|
_viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals)
|
|
5394
5392
|
);
|
|
5395
5393
|
if (balanceUnits > 0) return asset.balanceUsd / balanceUnits;
|
|
5396
|
-
} catch (
|
|
5394
|
+
} catch (e28) {
|
|
5397
5395
|
}
|
|
5398
5396
|
}
|
|
5399
5397
|
}
|
|
5400
5398
|
return null;
|
|
5401
5399
|
}, []);
|
|
5402
5400
|
const dappSwitchChain = _react.useMemo.call(void 0, () => {
|
|
5403
|
-
if (!_optionalChain([dappWalletClient, 'optionalAccess',
|
|
5401
|
+
if (!_optionalChain([dappWalletClient, 'optionalAccess', _142 => _142.switchChain])) return void 0;
|
|
5404
5402
|
return async (chainId) => {
|
|
5405
|
-
await _optionalChain([dappWalletClient, 'access',
|
|
5403
|
+
await _optionalChain([dappWalletClient, 'access', _143 => _143.switchChain, 'optionalCall', _144 => _144({ id: chainId })]);
|
|
5406
5404
|
};
|
|
5407
5405
|
}, [dappWalletClient]);
|
|
5408
|
-
const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
5406
|
+
const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _145 => _145.account, 'optionalAccess', _146 => _146.address]), () => ( null));
|
|
5409
5407
|
const walletOptions = _react.useMemo.call(void 0, () => {
|
|
5410
5408
|
const options = [];
|
|
5411
5409
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -5419,7 +5417,7 @@ function DepositFlow({
|
|
|
5419
5417
|
});
|
|
5420
5418
|
seen.add(id);
|
|
5421
5419
|
}
|
|
5422
|
-
if (enableSolana && _optionalChain([reownWallet, 'optionalAccess',
|
|
5420
|
+
if (enableSolana && _optionalChain([reownWallet, 'optionalAccess', _147 => _147.isConnected]) && reownWallet.isSolana && reownWallet.solanaAddress && dappAddress) {
|
|
5423
5421
|
const id = _nullishCoalesce(reownWallet.caipAddress, () => ( `solana:${reownWallet.solanaAddress}`));
|
|
5424
5422
|
if (!seen.has(id)) {
|
|
5425
5423
|
options.push({
|
|
@@ -5431,7 +5429,7 @@ function DepositFlow({
|
|
|
5431
5429
|
});
|
|
5432
5430
|
seen.add(id);
|
|
5433
5431
|
}
|
|
5434
|
-
} else if (_optionalChain([reownWallet, 'optionalAccess',
|
|
5432
|
+
} else if (_optionalChain([reownWallet, 'optionalAccess', _148 => _148.address]) && reownWallet.isConnected && reownWallet.walletClient && reownWallet.publicClient && !seen.has(`evm:${reownWallet.address.toLowerCase()}`)) {
|
|
5435
5433
|
const id = `evm:${reownWallet.address.toLowerCase()}`;
|
|
5436
5434
|
if (!seen.has(id)) {
|
|
5437
5435
|
options.push({
|
|
@@ -5448,24 +5446,27 @@ function DepositFlow({
|
|
|
5448
5446
|
}, [
|
|
5449
5447
|
connectedWalletAddress,
|
|
5450
5448
|
dappAddress,
|
|
5451
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5452
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5453
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5454
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5455
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5449
|
+
_optionalChain([reownWallet, 'optionalAccess', _149 => _149.address]),
|
|
5450
|
+
_optionalChain([reownWallet, 'optionalAccess', _150 => _150.isConnected]),
|
|
5451
|
+
_optionalChain([reownWallet, 'optionalAccess', _151 => _151.walletClient]),
|
|
5452
|
+
_optionalChain([reownWallet, 'optionalAccess', _152 => _152.publicClient]),
|
|
5453
|
+
_optionalChain([reownWallet, 'optionalAccess', _153 => _153.icon]),
|
|
5456
5454
|
enableSolana,
|
|
5457
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5458
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5459
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5455
|
+
_optionalChain([reownWallet, 'optionalAccess', _154 => _154.isSolana]),
|
|
5456
|
+
_optionalChain([reownWallet, 'optionalAccess', _155 => _155.solanaAddress]),
|
|
5457
|
+
_optionalChain([reownWallet, 'optionalAccess', _156 => _156.caipAddress])
|
|
5460
5458
|
]);
|
|
5461
|
-
const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess',
|
|
5459
|
+
const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess', _157 => _157.account]) && dappAddress && !reownWallet && !enableFiatOnramp && !enableExchangeConnect;
|
|
5462
5460
|
const hasWalletOptions = walletOptions.length > 0;
|
|
5463
5461
|
const hasReownSession = Boolean(
|
|
5464
|
-
enableSolana ? _optionalChain([reownWallet, 'optionalAccess',
|
|
5462
|
+
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _158 => _158.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _159 => _159.address]) : _optionalChain([reownWallet, 'optionalAccess', _160 => _160.address])
|
|
5465
5463
|
);
|
|
5466
5464
|
const isWalletHydrationPending = Boolean(
|
|
5467
5465
|
dappAddress && !hasWalletOptions && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasReownSession && !reownWallet.isReady)
|
|
5468
5466
|
);
|
|
5467
|
+
const isDappImportWalletHydrating = Boolean(
|
|
5468
|
+
hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasReownSession && !reownWallet.isReady
|
|
5469
|
+
);
|
|
5469
5470
|
const showConnectStep = flowMode === null && !isConnectSelectionConfirmed;
|
|
5470
5471
|
_react.useEffect.call(void 0, () => {
|
|
5471
5472
|
if (!isWalletHydrationPending) {
|
|
@@ -5520,16 +5521,16 @@ function DepositFlow({
|
|
|
5520
5521
|
return {
|
|
5521
5522
|
ownerAddress: dappAddress,
|
|
5522
5523
|
walletClient: void 0,
|
|
5523
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
5524
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkMQIJZNTPcjs.getPublicClient.call(void 0, setupChainId))),
|
|
5524
5525
|
switchChain: void 0
|
|
5525
5526
|
};
|
|
5526
5527
|
}
|
|
5527
5528
|
if (canAutoLock) {
|
|
5528
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
5529
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _161 => _161.chain, 'optionalAccess', _162 => _162.id]), () => ( setupChainId));
|
|
5529
5530
|
return {
|
|
5530
5531
|
ownerAddress: dappWalletClient.account.address,
|
|
5531
5532
|
walletClient: dappWalletClient,
|
|
5532
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
5533
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkMQIJZNTPcjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
5533
5534
|
switchChain: dappSwitchChain
|
|
5534
5535
|
};
|
|
5535
5536
|
}
|
|
@@ -5543,24 +5544,24 @@ function DepositFlow({
|
|
|
5543
5544
|
return {
|
|
5544
5545
|
ownerAddress: dappAddress,
|
|
5545
5546
|
walletClient: void 0,
|
|
5546
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
5547
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkMQIJZNTPcjs.getPublicClient.call(void 0, setupChainId))),
|
|
5547
5548
|
switchChain: void 0
|
|
5548
5549
|
};
|
|
5549
5550
|
}
|
|
5550
|
-
if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess',
|
|
5551
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
5551
|
+
if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess', _163 => _163.account]) && selectedOption.address && dappWalletClient.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
5552
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _164 => _164.chain, 'optionalAccess', _165 => _165.id]), () => ( setupChainId));
|
|
5552
5553
|
return {
|
|
5553
5554
|
ownerAddress: dappWalletClient.account.address,
|
|
5554
5555
|
walletClient: dappWalletClient,
|
|
5555
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
5556
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkMQIJZNTPcjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
5556
5557
|
switchChain: dappSwitchChain
|
|
5557
5558
|
};
|
|
5558
5559
|
}
|
|
5559
|
-
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess',
|
|
5560
|
+
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess', _166 => _166.address]) && selectedOption.address && reownWallet.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
5560
5561
|
return {
|
|
5561
5562
|
ownerAddress: reownWallet.address,
|
|
5562
5563
|
walletClient: reownWallet.walletClient,
|
|
5563
|
-
publicClient: _nullishCoalesce(reownWallet.publicClient, () => (
|
|
5564
|
+
publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunkMQIJZNTPcjs.getPublicClient.call(void 0, setupChainId))),
|
|
5564
5565
|
switchChain: reownWallet.switchChain
|
|
5565
5566
|
};
|
|
5566
5567
|
}
|
|
@@ -5598,7 +5599,7 @@ function DepositFlow({
|
|
|
5598
5599
|
return {
|
|
5599
5600
|
ownerAddress: dappAddress,
|
|
5600
5601
|
walletClient: void 0,
|
|
5601
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
5602
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkMQIJZNTPcjs.getPublicClient.call(void 0, setupChainId))),
|
|
5602
5603
|
switchChain: void 0
|
|
5603
5604
|
};
|
|
5604
5605
|
}
|
|
@@ -5623,37 +5624,37 @@ function DepositFlow({
|
|
|
5623
5624
|
const selectedEvmWalletOwner = _react.useMemo.call(void 0, () => {
|
|
5624
5625
|
if (!selectedWalletId) return null;
|
|
5625
5626
|
const opt = walletOptions.find((o) => o.id === selectedWalletId);
|
|
5626
|
-
if (_optionalChain([opt, 'optionalAccess',
|
|
5627
|
+
if (_optionalChain([opt, 'optionalAccess', _167 => _167.kind]) === "external" && opt.address) {
|
|
5627
5628
|
return opt.address;
|
|
5628
5629
|
}
|
|
5629
|
-
if (_optionalChain([opt, 'optionalAccess',
|
|
5630
|
+
if (_optionalChain([opt, 'optionalAccess', _168 => _168.kind]) === "connected" && opt.address) {
|
|
5630
5631
|
return opt.address;
|
|
5631
5632
|
}
|
|
5632
5633
|
return null;
|
|
5633
5634
|
}, [selectedWalletId, walletOptions]);
|
|
5634
5635
|
const dappImportOwner = _react.useMemo.call(void 0, () => {
|
|
5635
5636
|
if (selectedEvmWalletOwner) return selectedEvmWalletOwner;
|
|
5636
|
-
if (_optionalChain([reownWallet, 'optionalAccess',
|
|
5637
|
+
if (_optionalChain([reownWallet, 'optionalAccess', _169 => _169.address]) && reownWallet.isConnected) {
|
|
5637
5638
|
return reownWallet.address;
|
|
5638
5639
|
}
|
|
5639
5640
|
if (connectedWalletAddress) return connectedWalletAddress;
|
|
5640
5641
|
return null;
|
|
5641
5642
|
}, [
|
|
5642
5643
|
selectedEvmWalletOwner,
|
|
5643
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5644
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5644
|
+
_optionalChain([reownWallet, 'optionalAccess', _170 => _170.address]),
|
|
5645
|
+
_optionalChain([reownWallet, 'optionalAccess', _171 => _171.isConnected]),
|
|
5645
5646
|
connectedWalletAddress
|
|
5646
5647
|
]);
|
|
5647
5648
|
const activeOwner = _react.useMemo.call(void 0,
|
|
5648
5649
|
() => resolveOwnerForMode(flowMode, {
|
|
5649
5650
|
dappAddress,
|
|
5650
|
-
walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess',
|
|
5651
|
+
walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _172 => _172.ownerAddress]), () => ( (canAutoLock ? connectedWalletAddress : selectedEvmWalletOwner))),
|
|
5651
5652
|
dappImportOwner
|
|
5652
5653
|
}),
|
|
5653
5654
|
[
|
|
5654
5655
|
flowMode,
|
|
5655
5656
|
dappAddress,
|
|
5656
|
-
_optionalChain([signerContext, 'optionalAccess',
|
|
5657
|
+
_optionalChain([signerContext, 'optionalAccess', _173 => _173.ownerAddress]),
|
|
5657
5658
|
canAutoLock,
|
|
5658
5659
|
connectedWalletAddress,
|
|
5659
5660
|
selectedEvmWalletOwner,
|
|
@@ -5682,12 +5683,12 @@ function DepositFlow({
|
|
|
5682
5683
|
return;
|
|
5683
5684
|
}
|
|
5684
5685
|
lastActiveSetupLifecycleKeyRef.current = lifecycleKey;
|
|
5685
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
5686
|
+
_optionalChain([onLifecycleRef, 'access', _174 => _174.current, 'optionalCall', _175 => _175({
|
|
5686
5687
|
type: "smart-account-changed",
|
|
5687
5688
|
evm: activeEntry.smartAccount,
|
|
5688
5689
|
solana: _nullishCoalesce(activeEntry.solanaDepositAddress, () => ( null))
|
|
5689
5690
|
})]);
|
|
5690
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
5691
|
+
_optionalChain([onLifecycleRef, 'access', _176 => _176.current, 'optionalCall', _177 => _177({
|
|
5691
5692
|
type: "connected",
|
|
5692
5693
|
address: activeOwner,
|
|
5693
5694
|
smartAccount: activeEntry.smartAccount
|
|
@@ -5730,11 +5731,14 @@ function DepositFlow({
|
|
|
5730
5731
|
portfolioAssetsRef.current = [];
|
|
5731
5732
|
}
|
|
5732
5733
|
}, [storeApi, hasWalletOptions, reownWallet]);
|
|
5733
|
-
const canGoBackFromHere = effectiveStep.type === "deposit-address" || effectiveStep.type === "solana-token-select" || effectiveStep.type === "solana-amount" || effectiveStep.type === "solana-confirm" || effectiveStep.type === "amount" || effectiveStep.type === "confirm" ||
|
|
5734
|
+
const canGoBackFromHere = effectiveStep.type === "deposit-address" || effectiveStep.type === "solana-token-select" || effectiveStep.type === "solana-amount" || effectiveStep.type === "solana-confirm" || effectiveStep.type === "amount" || effectiveStep.type === "confirm" || // Escape hatch from a slow or stuck pre-routed resolve. Mode-gated so
|
|
5735
|
+
// the chevron doesn't linger if a disconnect cleared the mode out from
|
|
5736
|
+
// under the step.
|
|
5737
|
+
effectiveStep.type === "dapp-import-resolving" && flowMode === "dapp-import" || effectiveStep.type === "dapp-import-asset-select" || effectiveStep.type === "fiat-onramp" || effectiveStep.type === "exchange-select" || effectiveStep.type === "exchange-connect" || effectiveStep.type === "select-asset" && signerContext && !canAutoLock;
|
|
5734
5738
|
const currentBackHandler = canGoBackFromHere ? handleBack : void 0;
|
|
5735
5739
|
const currentScreen = showConnectStep ? "connect" : effectiveStep.type;
|
|
5736
5740
|
_react.useEffect.call(void 0, () => {
|
|
5737
|
-
_optionalChain([onStepChangeRef, 'access',
|
|
5741
|
+
_optionalChain([onStepChangeRef, 'access', _178 => _178.current, 'optionalCall', _179 => _179(currentBackHandler, currentScreen)]);
|
|
5738
5742
|
}, [currentBackHandler, currentScreen, onStepChangeRef]);
|
|
5739
5743
|
const lastModalHeightRef = _react.useRef.call(void 0, 0);
|
|
5740
5744
|
const modalContentElRef = _react.useRef.call(void 0, null);
|
|
@@ -5744,7 +5748,7 @@ function DepositFlow({
|
|
|
5744
5748
|
modalContentElRef.current = mc;
|
|
5745
5749
|
const ro = new ResizeObserver((entries) => {
|
|
5746
5750
|
for (const entry of entries) {
|
|
5747
|
-
const border = _optionalChain([entry, 'access',
|
|
5751
|
+
const border = _optionalChain([entry, 'access', _180 => _180.borderBoxSize, 'optionalAccess', _181 => _181[0], 'optionalAccess', _182 => _182.blockSize]);
|
|
5748
5752
|
lastModalHeightRef.current = typeof border === "number" ? border : entry.contentRect.height;
|
|
5749
5753
|
}
|
|
5750
5754
|
});
|
|
@@ -5785,7 +5789,7 @@ function DepositFlow({
|
|
|
5785
5789
|
}
|
|
5786
5790
|
lastStepOpenEventKeyRef.current = stepOpenEventKey;
|
|
5787
5791
|
if (effectiveStep.type === "select-asset") {
|
|
5788
|
-
_optionalChain([onEventRef, 'access',
|
|
5792
|
+
_optionalChain([onEventRef, 'access', _183 => _183.current, 'optionalCall', _184 => _184({
|
|
5789
5793
|
type: "deposit_modal_connected_wallet_select_source_open",
|
|
5790
5794
|
total_balance_in_external_wallet: totalBalanceUsd,
|
|
5791
5795
|
pred_balance: totalBalanceUsd
|
|
@@ -5793,7 +5797,7 @@ function DepositFlow({
|
|
|
5793
5797
|
} else if (effectiveStep.type === "deposit-address") {
|
|
5794
5798
|
const chainName = _chunkMILJQWPTcjs.getChainName.call(void 0, targetChain);
|
|
5795
5799
|
const tokenSymbol = _chunkMILJQWPTcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
5796
|
-
_optionalChain([onEventRef, 'access',
|
|
5800
|
+
_optionalChain([onEventRef, 'access', _185 => _185.current, 'optionalCall', _186 => _186({
|
|
5797
5801
|
type: "deposit_modal_transfer_crypto_open",
|
|
5798
5802
|
default_chain: chainName,
|
|
5799
5803
|
default_token: tokenSymbol,
|
|
@@ -5801,7 +5805,7 @@ function DepositFlow({
|
|
|
5801
5805
|
})]);
|
|
5802
5806
|
} else if (effectiveStep.type === "amount" && stepSendToken) {
|
|
5803
5807
|
const receiveSymbol = _chunkMILJQWPTcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
5804
|
-
_optionalChain([onEventRef, 'access',
|
|
5808
|
+
_optionalChain([onEventRef, 'access', _187 => _187.current, 'optionalCall', _188 => _188({
|
|
5805
5809
|
type: "deposit_modal_connected_wallet_enter_value_open",
|
|
5806
5810
|
send_token: stepSendToken,
|
|
5807
5811
|
receive_token: receiveSymbol,
|
|
@@ -5834,7 +5838,7 @@ function DepositFlow({
|
|
|
5834
5838
|
targetToken
|
|
5835
5839
|
]);
|
|
5836
5840
|
_react.useEffect.call(void 0, () => {
|
|
5837
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
5841
|
+
_optionalChain([onLifecycleRef, 'access', _189 => _189.current, 'optionalCall', _190 => _190({
|
|
5838
5842
|
type: "balance-changed",
|
|
5839
5843
|
totalUsd: totalBalanceUsd
|
|
5840
5844
|
})]);
|
|
@@ -5850,7 +5854,7 @@ function DepositFlow({
|
|
|
5850
5854
|
const handleConfirmWallet = _react.useCallback.call(void 0,
|
|
5851
5855
|
(walletId) => {
|
|
5852
5856
|
const selectedOption = walletOptions.find((o) => o.id === walletId);
|
|
5853
|
-
const mode = enableSolana && _optionalChain([selectedOption, 'optionalAccess',
|
|
5857
|
+
const mode = enableSolana && _optionalChain([selectedOption, 'optionalAccess', _191 => _191.kind]) === "solana" ? "solana-wallet" : "wallet";
|
|
5854
5858
|
storeApi.dispatch({
|
|
5855
5859
|
type: "connect/wallet-confirmed",
|
|
5856
5860
|
walletId,
|
|
@@ -5860,7 +5864,7 @@ function DepositFlow({
|
|
|
5860
5864
|
[walletOptions, enableSolana, storeApi]
|
|
5861
5865
|
);
|
|
5862
5866
|
const isSolanaWalletConnected = Boolean(
|
|
5863
|
-
enableSolana && _optionalChain([reownWallet, 'optionalAccess',
|
|
5867
|
+
enableSolana && _optionalChain([reownWallet, 'optionalAccess', _192 => _192.isConnected]) && _optionalChain([reownWallet, 'optionalAccess', _193 => _193.isSolana])
|
|
5864
5868
|
);
|
|
5865
5869
|
const dappImportsKey = dappImports ? Object.keys(dappImports).filter((k) => dappImports[k]).sort().join(",") : "";
|
|
5866
5870
|
const enabledDappImportProviders = _react.useMemo.call(void 0,
|
|
@@ -5868,12 +5872,16 @@ function DepositFlow({
|
|
|
5868
5872
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- intentional: keyed on dappImportsKey, not the dappImports object identity
|
|
5869
5873
|
[dappImportsKey, isSolanaWalletConnected]
|
|
5870
5874
|
);
|
|
5875
|
+
const initialDappImportProvider = _react.useMemo.call(void 0,
|
|
5876
|
+
() => initialDappImport ? _nullishCoalesce(enabledDappImportProviders.find((p) => p.id === initialDappImport), () => ( null)) : null,
|
|
5877
|
+
[initialDappImport, enabledDappImportProviders]
|
|
5878
|
+
);
|
|
5871
5879
|
const handleSelectDappImport = _react.useCallback.call(void 0,
|
|
5872
5880
|
(providerId) => {
|
|
5873
5881
|
const owner = dappImportOwner;
|
|
5874
5882
|
if (owner) {
|
|
5875
5883
|
const wallet = walletOptions.find(
|
|
5876
|
-
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess',
|
|
5884
|
+
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _194 => _194.toLowerCase, 'call', _195 => _195()]) === owner.toLowerCase()
|
|
5877
5885
|
);
|
|
5878
5886
|
if (wallet) {
|
|
5879
5887
|
storeApi.dispatch({
|
|
@@ -5895,6 +5903,9 @@ function DepositFlow({
|
|
|
5895
5903
|
},
|
|
5896
5904
|
[storeApi]
|
|
5897
5905
|
);
|
|
5906
|
+
const dappImportAttemptNonce = useDepositStore(
|
|
5907
|
+
(s) => s.dappImport.attemptNonce
|
|
5908
|
+
);
|
|
5898
5909
|
_react.useEffect.call(void 0, () => {
|
|
5899
5910
|
if (!dappImportOwner || enabledDappImportProviders.length === 0) {
|
|
5900
5911
|
storeApi.dispatch({ type: "dapp-import/availability-cleared" });
|
|
@@ -5911,8 +5922,8 @@ function DepositFlow({
|
|
|
5911
5922
|
eoa: dappImportOwner,
|
|
5912
5923
|
getPublicClient: (chainId) => {
|
|
5913
5924
|
try {
|
|
5914
|
-
return
|
|
5915
|
-
} catch (
|
|
5925
|
+
return _chunkMQIJZNTPcjs.getPublicClient.call(void 0, chainId);
|
|
5926
|
+
} catch (e29) {
|
|
5916
5927
|
return null;
|
|
5917
5928
|
}
|
|
5918
5929
|
},
|
|
@@ -5928,15 +5939,29 @@ function DepositFlow({
|
|
|
5928
5939
|
}).catch(() => {
|
|
5929
5940
|
if (controller.signal.aborted) return;
|
|
5930
5941
|
storeApi.dispatch({
|
|
5931
|
-
type: "dapp-import/availability-
|
|
5942
|
+
type: "dapp-import/availability-failed",
|
|
5932
5943
|
providerId: provider.id,
|
|
5933
|
-
owner: dappImportOwner
|
|
5934
|
-
availability: null
|
|
5944
|
+
owner: dappImportOwner
|
|
5935
5945
|
});
|
|
5936
5946
|
});
|
|
5937
5947
|
}
|
|
5938
5948
|
return () => controller.abort();
|
|
5939
|
-
}, [
|
|
5949
|
+
}, [
|
|
5950
|
+
dappImportOwner,
|
|
5951
|
+
enabledDappImportProviders,
|
|
5952
|
+
dappImportAttemptNonce,
|
|
5953
|
+
storeApi
|
|
5954
|
+
]);
|
|
5955
|
+
_react.useLayoutEffect.call(void 0, () => {
|
|
5956
|
+
if (!initialDappImportProvider) return;
|
|
5957
|
+
if (flowSlice.step !== "connect" || flowSlice.mode !== null || flowSlice.isConnectSelectionConfirmed || flowSlice.hasNavigatedBack) {
|
|
5958
|
+
return;
|
|
5959
|
+
}
|
|
5960
|
+
storeApi.dispatch({
|
|
5961
|
+
type: "dapp-import/boot-requested",
|
|
5962
|
+
providerId: initialDappImportProvider.id
|
|
5963
|
+
});
|
|
5964
|
+
}, [initialDappImportProvider, flowSlice, storeApi]);
|
|
5940
5965
|
const dappImportAvailability = useDepositStore((s) => s.dappImport.availability);
|
|
5941
5966
|
const dappImportAvailabilityOwner = useDepositStore(
|
|
5942
5967
|
(s) => s.dappImport.availabilityOwner
|
|
@@ -5944,48 +5969,19 @@ function DepositFlow({
|
|
|
5944
5969
|
const activeDappImportProviderId = useDepositStore(
|
|
5945
5970
|
(s) => s.dappImport.activeProviderId
|
|
5946
5971
|
);
|
|
5972
|
+
const dappImportBootError = useDepositStore((s) => s.dappImport.bootError);
|
|
5947
5973
|
const connectStepDappImports = _react.useMemo.call(void 0,
|
|
5948
|
-
() => enabledDappImportProviders.map((provider) => {
|
|
5949
|
-
|
|
5950
|
-
|
|
5951
|
-
|
|
5952
|
-
|
|
5953
|
-
|
|
5954
|
-
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
|
|
5958
|
-
|
|
5959
|
-
if (availabilityEntry === "loading" || availabilityEntry === void 0) {
|
|
5960
|
-
return { ...baseRow, status: "loading" };
|
|
5961
|
-
}
|
|
5962
|
-
if (availabilityEntry === null) {
|
|
5963
|
-
return {
|
|
5964
|
-
...baseRow,
|
|
5965
|
-
status: { enabled: false, reason: "No balance" }
|
|
5966
|
-
};
|
|
5967
|
-
}
|
|
5968
|
-
if (dappImportSetup.status === "loading" || !dappImportOwner) {
|
|
5969
|
-
return { ...baseRow, status: "loading" };
|
|
5970
|
-
}
|
|
5971
|
-
if (dappImportSetup.status === "error") {
|
|
5972
|
-
return {
|
|
5973
|
-
...baseRow,
|
|
5974
|
-
status: {
|
|
5975
|
-
enabled: false,
|
|
5976
|
-
reason: "Couldn't prepare account \u2014 tap to retry",
|
|
5977
|
-
retryable: true
|
|
5978
|
-
}
|
|
5979
|
-
};
|
|
5980
|
-
}
|
|
5981
|
-
return {
|
|
5982
|
-
...baseRow,
|
|
5983
|
-
status: {
|
|
5984
|
-
enabled: true,
|
|
5985
|
-
balanceUsd: availabilityEntry.totalUsd
|
|
5986
|
-
}
|
|
5987
|
-
};
|
|
5988
|
-
}),
|
|
5974
|
+
() => enabledDappImportProviders.map((provider) => ({
|
|
5975
|
+
id: provider.id,
|
|
5976
|
+
label: provider.label,
|
|
5977
|
+
icon: provider.icon,
|
|
5978
|
+
status: computeDappImportStatus(provider.id, {
|
|
5979
|
+
owner: dappImportOwner,
|
|
5980
|
+
availability: dappImportAvailability,
|
|
5981
|
+
availabilityOwner: dappImportAvailabilityOwner,
|
|
5982
|
+
setup: setupSlice
|
|
5983
|
+
})
|
|
5984
|
+
})),
|
|
5989
5985
|
[
|
|
5990
5986
|
enabledDappImportProviders,
|
|
5991
5987
|
dappImportAvailability,
|
|
@@ -6002,11 +5998,11 @@ function DepositFlow({
|
|
|
6002
5998
|
}, [activeDappImportProviderId, enabledDappImportProviders]);
|
|
6003
5999
|
const activeDappImportAvailability = _react.useMemo.call(void 0, () => {
|
|
6004
6000
|
if (!activeDappImportProviderId) return null;
|
|
6005
|
-
if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess',
|
|
6001
|
+
if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _196 => _196.toLowerCase, 'call', _197 => _197()]) !== dappImportOwner.toLowerCase()) {
|
|
6006
6002
|
return null;
|
|
6007
6003
|
}
|
|
6008
6004
|
const entry = dappImportAvailability[activeDappImportProviderId];
|
|
6009
|
-
if (!entry || entry === "loading") return null;
|
|
6005
|
+
if (!entry || entry === "loading" || entry === "error") return null;
|
|
6010
6006
|
return entry;
|
|
6011
6007
|
}, [
|
|
6012
6008
|
activeDappImportProviderId,
|
|
@@ -6014,6 +6010,96 @@ function DepositFlow({
|
|
|
6014
6010
|
dappImportAvailabilityOwner,
|
|
6015
6011
|
dappImportOwner
|
|
6016
6012
|
]);
|
|
6013
|
+
const isBootResolving = isDappImportMode && flowSlice.step === "dapp-import-resolving";
|
|
6014
|
+
const [hasResolveDeadlinePassed, setHasResolveDeadlinePassed] = _react.useState.call(void 0, false);
|
|
6015
|
+
_react.useEffect.call(void 0, () => {
|
|
6016
|
+
setHasResolveDeadlinePassed(false);
|
|
6017
|
+
if (!isBootResolving || dappImportBootError) return;
|
|
6018
|
+
const timeout = window.setTimeout(() => {
|
|
6019
|
+
setHasResolveDeadlinePassed(true);
|
|
6020
|
+
}, DAPP_IMPORT_RESOLVE_TIMEOUT_MS);
|
|
6021
|
+
return () => window.clearTimeout(timeout);
|
|
6022
|
+
}, [isBootResolving, dappImportBootError]);
|
|
6023
|
+
_react.useEffect.call(void 0, () => {
|
|
6024
|
+
if (!isBootResolving || dappImportBootError) return;
|
|
6025
|
+
const providerId = activeDappImportProviderId;
|
|
6026
|
+
if (!providerId) return;
|
|
6027
|
+
if (!enabledDappImportProviders.some((p) => p.id === providerId)) {
|
|
6028
|
+
storeApi.dispatch({
|
|
6029
|
+
type: "dapp-import/boot-resolved",
|
|
6030
|
+
providerId,
|
|
6031
|
+
outcome: "unavailable"
|
|
6032
|
+
});
|
|
6033
|
+
return;
|
|
6034
|
+
}
|
|
6035
|
+
const status = computeDappImportStatus(providerId, {
|
|
6036
|
+
owner: dappImportOwner,
|
|
6037
|
+
availability: dappImportAvailability,
|
|
6038
|
+
availabilityOwner: dappImportAvailabilityOwner,
|
|
6039
|
+
setup: setupSlice
|
|
6040
|
+
});
|
|
6041
|
+
const pinnableWallet = dappImportOwner ? _nullishCoalesce(walletOptions.find(
|
|
6042
|
+
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _198 => _198.toLowerCase, 'call', _199 => _199()]) === dappImportOwner.toLowerCase()
|
|
6043
|
+
), () => ( null)) : null;
|
|
6044
|
+
const outcome = resolveBootOutcome({
|
|
6045
|
+
status,
|
|
6046
|
+
setupStatus: readSetupForOwner(setupSlice, dappImportOwner).status,
|
|
6047
|
+
timedOut: hasResolveDeadlinePassed,
|
|
6048
|
+
walletHydrating: isDappImportWalletHydrating,
|
|
6049
|
+
signerAvailable: pinnableWallet !== null
|
|
6050
|
+
});
|
|
6051
|
+
if (outcome === "wait") return;
|
|
6052
|
+
if (outcome === "ready" && pinnableWallet) {
|
|
6053
|
+
storeApi.dispatch({
|
|
6054
|
+
type: "wallet/id-selected",
|
|
6055
|
+
walletId: pinnableWallet.id
|
|
6056
|
+
});
|
|
6057
|
+
}
|
|
6058
|
+
storeApi.dispatch({
|
|
6059
|
+
type: "dapp-import/boot-resolved",
|
|
6060
|
+
providerId,
|
|
6061
|
+
outcome
|
|
6062
|
+
});
|
|
6063
|
+
}, [
|
|
6064
|
+
isBootResolving,
|
|
6065
|
+
dappImportBootError,
|
|
6066
|
+
activeDappImportProviderId,
|
|
6067
|
+
enabledDappImportProviders,
|
|
6068
|
+
dappImportOwner,
|
|
6069
|
+
dappImportAvailability,
|
|
6070
|
+
dappImportAvailabilityOwner,
|
|
6071
|
+
setupSlice,
|
|
6072
|
+
hasResolveDeadlinePassed,
|
|
6073
|
+
isDappImportWalletHydrating,
|
|
6074
|
+
walletOptions,
|
|
6075
|
+
storeApi
|
|
6076
|
+
]);
|
|
6077
|
+
const handleBootRetry = _react.useCallback.call(void 0, () => {
|
|
6078
|
+
const snapshot = storeApi.getState();
|
|
6079
|
+
const providerId = snapshot.dappImport.activeProviderId;
|
|
6080
|
+
if (!providerId) return;
|
|
6081
|
+
if (dappImportOwner) {
|
|
6082
|
+
const plan = bootRetryPlan({
|
|
6083
|
+
setupStatus: readSetupForOwner(snapshot.setup, dappImportOwner).status,
|
|
6084
|
+
availabilityEntry: _optionalChain([snapshot, 'access', _200 => _200.dappImport, 'access', _201 => _201.availabilityOwner, 'optionalAccess', _202 => _202.toLowerCase, 'call', _203 => _203()]) === dappImportOwner.toLowerCase() ? snapshot.dappImport.availability[providerId] : void 0
|
|
6085
|
+
});
|
|
6086
|
+
if (plan.restartSetup) {
|
|
6087
|
+
storeApi.dispatch({
|
|
6088
|
+
type: "setup/retry-requested",
|
|
6089
|
+
owner: dappImportOwner
|
|
6090
|
+
});
|
|
6091
|
+
}
|
|
6092
|
+
if (plan.refetchAvailability) {
|
|
6093
|
+
storeApi.dispatch({
|
|
6094
|
+
type: "dapp-import/availability-retry-requested"
|
|
6095
|
+
});
|
|
6096
|
+
}
|
|
6097
|
+
}
|
|
6098
|
+
storeApi.dispatch({
|
|
6099
|
+
type: "dapp-import/boot-requested",
|
|
6100
|
+
providerId
|
|
6101
|
+
});
|
|
6102
|
+
}, [storeApi, dappImportOwner]);
|
|
6017
6103
|
const handleSelectFiatMethod = _react.useCallback.call(void 0,
|
|
6018
6104
|
(paymentMethod) => {
|
|
6019
6105
|
storeApi.dispatch({
|
|
@@ -6036,7 +6122,7 @@ function DepositFlow({
|
|
|
6036
6122
|
[storeApi]
|
|
6037
6123
|
);
|
|
6038
6124
|
const handleNewDeposit = _react.useCallback.call(void 0, () => {
|
|
6039
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6125
|
+
_optionalChain([onLifecycleRef, 'access', _204 => _204.current, 'optionalCall', _205 => _205({
|
|
6040
6126
|
type: "smart-account-changed",
|
|
6041
6127
|
evm: null,
|
|
6042
6128
|
solana: null
|
|
@@ -6084,13 +6170,13 @@ function DepositFlow({
|
|
|
6084
6170
|
};
|
|
6085
6171
|
push(dappAddress);
|
|
6086
6172
|
push(connectedWalletAddress);
|
|
6087
|
-
push(_optionalChain([reownWallet, 'optionalAccess',
|
|
6173
|
+
push(_optionalChain([reownWallet, 'optionalAccess', _206 => _206.address]));
|
|
6088
6174
|
push(dappImportOwner);
|
|
6089
6175
|
return owners;
|
|
6090
6176
|
}, [
|
|
6091
6177
|
dappAddress,
|
|
6092
6178
|
connectedWalletAddress,
|
|
6093
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
6179
|
+
_optionalChain([reownWallet, 'optionalAccess', _207 => _207.address]),
|
|
6094
6180
|
dappImportOwner
|
|
6095
6181
|
]);
|
|
6096
6182
|
_react.useEffect.call(void 0, () => {
|
|
@@ -6104,7 +6190,7 @@ function DepositFlow({
|
|
|
6104
6190
|
try {
|
|
6105
6191
|
sessionOwner = await resolveSessionOwner(owner);
|
|
6106
6192
|
} catch (error) {
|
|
6107
|
-
|
|
6193
|
+
_chunkMQIJZNTPcjs.debugError.call(void 0,
|
|
6108
6194
|
debug,
|
|
6109
6195
|
"deposit-flow",
|
|
6110
6196
|
"session-owner:resolve-failed",
|
|
@@ -6195,7 +6281,7 @@ function DepositFlow({
|
|
|
6195
6281
|
sourceChain: data.sourceChain,
|
|
6196
6282
|
amount: data.amount
|
|
6197
6283
|
});
|
|
6198
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6284
|
+
_optionalChain([onLifecycleRef, 'access', _208 => _208.current, 'optionalCall', _209 => _209({ type: "submitted", ...data })]);
|
|
6199
6285
|
},
|
|
6200
6286
|
[logFlow, onLifecycleRef]
|
|
6201
6287
|
);
|
|
@@ -6255,7 +6341,7 @@ function DepositFlow({
|
|
|
6255
6341
|
sourceDecimals: tokenAtSubmit.decimals,
|
|
6256
6342
|
inputAmountUsd: amountUsd
|
|
6257
6343
|
});
|
|
6258
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6344
|
+
_optionalChain([onLifecycleRef, 'access', _210 => _210.current, 'optionalCall', _211 => _211({
|
|
6259
6345
|
type: "submitted",
|
|
6260
6346
|
txHash,
|
|
6261
6347
|
sourceChain: "solana",
|
|
@@ -6268,7 +6354,7 @@ function DepositFlow({
|
|
|
6268
6354
|
);
|
|
6269
6355
|
const handleAssetContinue = _react.useCallback.call(void 0,
|
|
6270
6356
|
(asset) => {
|
|
6271
|
-
_optionalChain([onEventRef, 'access',
|
|
6357
|
+
_optionalChain([onEventRef, 'access', _212 => _212.current, 'optionalCall', _213 => _213({
|
|
6272
6358
|
type: "deposit_modal_connected_wallet_select_source_cta_click",
|
|
6273
6359
|
total_balance_in_external_wallet: totalBalanceUsd,
|
|
6274
6360
|
pred_balance: totalBalanceUsd,
|
|
@@ -6322,8 +6408,8 @@ function DepositFlow({
|
|
|
6322
6408
|
sourceChain: chainId,
|
|
6323
6409
|
sourceToken: token,
|
|
6324
6410
|
amount,
|
|
6325
|
-
sourceSymbol: _optionalChain([asset, 'optionalAccess',
|
|
6326
|
-
sourceDecimals: _optionalChain([asset, 'optionalAccess',
|
|
6411
|
+
sourceSymbol: _optionalChain([asset, 'optionalAccess', _214 => _214.symbol]),
|
|
6412
|
+
sourceDecimals: _optionalChain([asset, 'optionalAccess', _215 => _215.decimals]),
|
|
6327
6413
|
inputAmountUsd: _nullishCoalesce(depositAtSubmit.inputAmountUsd, () => ( void 0)),
|
|
6328
6414
|
directTransfer: !dappImport && isSameRoute2(chainId, token, targetChain, targetToken)
|
|
6329
6415
|
});
|
|
@@ -6346,7 +6432,7 @@ function DepositFlow({
|
|
|
6346
6432
|
sourceSymbol: _nullishCoalesce(info.orderCrypto, () => ( "USDC")),
|
|
6347
6433
|
sourceDecimals: SWAPPED_SOURCE_DECIMALS
|
|
6348
6434
|
});
|
|
6349
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6435
|
+
_optionalChain([onLifecycleRef, 'access', _216 => _216.current, 'optionalCall', _217 => _217({
|
|
6350
6436
|
type: "submitted",
|
|
6351
6437
|
txHash: info.txHash,
|
|
6352
6438
|
sourceChain: SWAPPED_SOURCE_CHAIN,
|
|
@@ -6359,12 +6445,12 @@ function DepositFlow({
|
|
|
6359
6445
|
const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
|
|
6360
6446
|
(txHash, sourceChain, amount) => {
|
|
6361
6447
|
const depositAtSubmit = storeApi.getState().deposit;
|
|
6362
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6448
|
+
_optionalChain([onLifecycleRef, 'access', _218 => _218.current, 'optionalCall', _219 => _219({
|
|
6363
6449
|
type: "submitted",
|
|
6364
6450
|
txHash,
|
|
6365
6451
|
sourceChain,
|
|
6366
6452
|
amount,
|
|
6367
|
-
sourceDecimals: _optionalChain([depositAtSubmit, 'access',
|
|
6453
|
+
sourceDecimals: _optionalChain([depositAtSubmit, 'access', _220 => _220.selectedAsset, 'optionalAccess', _221 => _221.decimals]),
|
|
6368
6454
|
amountUsd: _nullishCoalesce(depositAtSubmit.inputAmountUsd, () => ( void 0))
|
|
6369
6455
|
})]);
|
|
6370
6456
|
},
|
|
@@ -6373,7 +6459,7 @@ function DepositFlow({
|
|
|
6373
6459
|
const handleDepositComplete = _react.useCallback.call(void 0,
|
|
6374
6460
|
(txHash, destinationTxHash, context) => {
|
|
6375
6461
|
logFlow("deposit:complete", { txHash, destinationTxHash, ...context });
|
|
6376
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6462
|
+
_optionalChain([onLifecycleRef, 'access', _222 => _222.current, 'optionalCall', _223 => _223({
|
|
6377
6463
|
type: "complete",
|
|
6378
6464
|
txHash,
|
|
6379
6465
|
destinationTxHash,
|
|
@@ -6385,14 +6471,14 @@ function DepositFlow({
|
|
|
6385
6471
|
const handleDepositFailed = _react.useCallback.call(void 0,
|
|
6386
6472
|
(txHash, error) => {
|
|
6387
6473
|
logFlowError("deposit:failed", error, { txHash });
|
|
6388
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6474
|
+
_optionalChain([onLifecycleRef, 'access', _224 => _224.current, 'optionalCall', _225 => _225({ type: "failed", txHash, error })]);
|
|
6389
6475
|
},
|
|
6390
6476
|
[logFlowError, onLifecycleRef]
|
|
6391
6477
|
);
|
|
6392
6478
|
const handleError = _react.useCallback.call(void 0,
|
|
6393
6479
|
(message, code) => {
|
|
6394
6480
|
logFlowError("flow:error", message, { code });
|
|
6395
|
-
_optionalChain([onErrorRef, 'access',
|
|
6481
|
+
_optionalChain([onErrorRef, 'access', _226 => _226.current, 'optionalCall', _227 => _227({ message, code })]);
|
|
6396
6482
|
},
|
|
6397
6483
|
[logFlowError, onErrorRef]
|
|
6398
6484
|
);
|
|
@@ -6414,10 +6500,17 @@ function DepositFlow({
|
|
|
6414
6500
|
}
|
|
6415
6501
|
}, [walletOptionsKey]);
|
|
6416
6502
|
_react.useEffect.call(void 0, () => {
|
|
6417
|
-
if (!showConnectStep && isConnectSelectionConfirmed && (flowMode === "wallet" || flowMode === "dapp-import") && !signerContext) {
|
|
6503
|
+
if (!showConnectStep && isConnectSelectionConfirmed && (flowMode === "wallet" || flowMode === "dapp-import") && flowSlice.step !== "dapp-import-resolving" && !signerContext) {
|
|
6418
6504
|
storeApi.dispatch({ type: "wallet/cleared" });
|
|
6419
6505
|
}
|
|
6420
|
-
}, [
|
|
6506
|
+
}, [
|
|
6507
|
+
showConnectStep,
|
|
6508
|
+
isConnectSelectionConfirmed,
|
|
6509
|
+
flowMode,
|
|
6510
|
+
flowSlice.step,
|
|
6511
|
+
signerContext,
|
|
6512
|
+
storeApi
|
|
6513
|
+
]);
|
|
6421
6514
|
_react.useEffect.call(void 0, () => {
|
|
6422
6515
|
if (enableSolana || flowMode !== "solana-wallet") {
|
|
6423
6516
|
return;
|
|
@@ -6428,7 +6521,7 @@ function DepositFlow({
|
|
|
6428
6521
|
}
|
|
6429
6522
|
}, [enableSolana, flowMode, storeApi]);
|
|
6430
6523
|
_react.useEffect.call(void 0, () => {
|
|
6431
|
-
if (hasNavigatedBack || isConnectSelectionConfirmed || flowMode || enableFiatOnramp || enableExchangeConnect) {
|
|
6524
|
+
if (hasNavigatedBack || isConnectSelectionConfirmed || flowMode || enableFiatOnramp || enableExchangeConnect || initialDappImportProvider) {
|
|
6432
6525
|
return;
|
|
6433
6526
|
}
|
|
6434
6527
|
if (enableQrTransfer && !hasWalletOptions && dappAddress && !hasReownSession && !dappWalletClient && hasQrAutoAdvanceGraceElapsed) {
|
|
@@ -6444,6 +6537,7 @@ function DepositFlow({
|
|
|
6444
6537
|
hasNavigatedBack,
|
|
6445
6538
|
dappAddress,
|
|
6446
6539
|
dappWalletClient,
|
|
6540
|
+
initialDappImportProvider,
|
|
6447
6541
|
handleSelectTransferCrypto
|
|
6448
6542
|
]);
|
|
6449
6543
|
const walletRows = _react.useMemo.call(void 0, () => {
|
|
@@ -6475,7 +6569,7 @@ function DepositFlow({
|
|
|
6475
6569
|
);
|
|
6476
6570
|
if (showConnectStep) {
|
|
6477
6571
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6478
|
-
|
|
6572
|
+
_chunkMQIJZNTPcjs.ConnectStep,
|
|
6479
6573
|
{
|
|
6480
6574
|
walletRows,
|
|
6481
6575
|
transferCryptoState: dappAddress ? transferCryptoState : void 0,
|
|
@@ -6508,6 +6602,13 @@ function DepositFlow({
|
|
|
6508
6602
|
},
|
|
6509
6603
|
dappImports: connectStepDappImports,
|
|
6510
6604
|
onSelectDappImport: (providerId) => {
|
|
6605
|
+
const availabilityEntry = dappImportOwner && _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _228 => _228.toLowerCase, 'call', _229 => _229()]) === dappImportOwner.toLowerCase() ? dappImportAvailability[providerId] : void 0;
|
|
6606
|
+
if (availabilityEntry === "error") {
|
|
6607
|
+
storeApi.dispatch({
|
|
6608
|
+
type: "dapp-import/availability-retry-requested"
|
|
6609
|
+
});
|
|
6610
|
+
return;
|
|
6611
|
+
}
|
|
6511
6612
|
const dappImportEntry = readSetupForOwner(
|
|
6512
6613
|
setupSlice,
|
|
6513
6614
|
dappImportOwner
|
|
@@ -6547,7 +6648,7 @@ function DepositFlow({
|
|
|
6547
6648
|
allowedRoutes,
|
|
6548
6649
|
targetChain,
|
|
6549
6650
|
targetToken,
|
|
6550
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
6651
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _230 => _230.length])),
|
|
6551
6652
|
uiConfig,
|
|
6552
6653
|
onDepositSubmitted: handleDepositAddressSubmitted,
|
|
6553
6654
|
onDepositComplete: handleDepositComplete,
|
|
@@ -6555,7 +6656,7 @@ function DepositFlow({
|
|
|
6555
6656
|
onCopyAddress: () => {
|
|
6556
6657
|
const chainName = _chunkMILJQWPTcjs.getChainName.call(void 0, targetChain);
|
|
6557
6658
|
const tokenSymbol = _chunkMILJQWPTcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
6558
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
6659
|
+
_optionalChain([onEvent, 'optionalCall', _231 => _231({
|
|
6559
6660
|
type: "deposit_modal_transfer_crypto_cta_click",
|
|
6560
6661
|
default_chain: chainName,
|
|
6561
6662
|
default_token: tokenSymbol,
|
|
@@ -6599,7 +6700,7 @@ function DepositFlow({
|
|
|
6599
6700
|
}
|
|
6600
6701
|
),
|
|
6601
6702
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6602
|
-
|
|
6703
|
+
_chunkMQIJZNTPcjs.ProcessingStep,
|
|
6603
6704
|
{
|
|
6604
6705
|
smartAccount: step.smartAccount,
|
|
6605
6706
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
@@ -6612,7 +6713,7 @@ function DepositFlow({
|
|
|
6612
6713
|
sourceSymbol: step.sourceSymbol,
|
|
6613
6714
|
sourceDecimals: step.sourceDecimals,
|
|
6614
6715
|
amountUsd: step.inputAmountUsd,
|
|
6615
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
6716
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _232 => _232.length])),
|
|
6616
6717
|
service,
|
|
6617
6718
|
directTransfer: step.directTransfer,
|
|
6618
6719
|
isSwappedOrder: true,
|
|
@@ -6666,7 +6767,7 @@ function DepositFlow({
|
|
|
6666
6767
|
}
|
|
6667
6768
|
),
|
|
6668
6769
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6669
|
-
|
|
6770
|
+
_chunkMQIJZNTPcjs.ProcessingStep,
|
|
6670
6771
|
{
|
|
6671
6772
|
smartAccount: step.smartAccount,
|
|
6672
6773
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
@@ -6679,7 +6780,7 @@ function DepositFlow({
|
|
|
6679
6780
|
sourceSymbol: step.sourceSymbol,
|
|
6680
6781
|
sourceDecimals: step.sourceDecimals,
|
|
6681
6782
|
amountUsd: step.inputAmountUsd,
|
|
6682
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
6783
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _233 => _233.length])),
|
|
6683
6784
|
service,
|
|
6684
6785
|
directTransfer: step.directTransfer,
|
|
6685
6786
|
isSwappedOrder: true,
|
|
@@ -6697,8 +6798,8 @@ function DepositFlow({
|
|
|
6697
6798
|
}
|
|
6698
6799
|
if (isSolanaWalletMode) {
|
|
6699
6800
|
if (!dappAddress) return null;
|
|
6700
|
-
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess',
|
|
6701
|
-
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess',
|
|
6801
|
+
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess', _234 => _234.solanaAddress]);
|
|
6802
|
+
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess', _235 => _235.solanaProvider]);
|
|
6702
6803
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
6703
6804
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6704
6805
|
AccountPreparingSkeleton,
|
|
@@ -6755,7 +6856,7 @@ function DepositFlow({
|
|
|
6755
6856
|
targetToken,
|
|
6756
6857
|
service,
|
|
6757
6858
|
solanaProvider,
|
|
6758
|
-
solanaConnection: _optionalChain([reownWallet, 'optionalAccess',
|
|
6859
|
+
solanaConnection: _optionalChain([reownWallet, 'optionalAccess', _236 => _236.solanaConnection]),
|
|
6759
6860
|
uiConfig,
|
|
6760
6861
|
onConfirm: handleSolanaConfirmed,
|
|
6761
6862
|
onError: handleError,
|
|
@@ -6796,7 +6897,7 @@ function DepositFlow({
|
|
|
6796
6897
|
) })
|
|
6797
6898
|
] }) : null,
|
|
6798
6899
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6799
|
-
|
|
6900
|
+
_chunkMQIJZNTPcjs.ProcessingStep,
|
|
6800
6901
|
{
|
|
6801
6902
|
smartAccount: effectiveStep.smartAccount,
|
|
6802
6903
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
@@ -6809,7 +6910,7 @@ function DepositFlow({
|
|
|
6809
6910
|
sourceSymbol: effectiveStep.sourceSymbol,
|
|
6810
6911
|
sourceDecimals: effectiveStep.sourceDecimals,
|
|
6811
6912
|
amountUsd: effectiveStep.inputAmountUsd,
|
|
6812
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
6913
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _237 => _237.length])),
|
|
6813
6914
|
service,
|
|
6814
6915
|
directTransfer: effectiveStep.directTransfer,
|
|
6815
6916
|
onClose,
|
|
@@ -6822,16 +6923,34 @@ function DepositFlow({
|
|
|
6822
6923
|
)
|
|
6823
6924
|
] });
|
|
6824
6925
|
}
|
|
6825
|
-
if (
|
|
6926
|
+
if (isDappImportMode && effectiveStep.type === "dapp-import-resolving") {
|
|
6927
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6928
|
+
"div",
|
|
6929
|
+
{
|
|
6930
|
+
className: "rs-modal-body",
|
|
6931
|
+
"data-flow-mode": "dapp-import",
|
|
6932
|
+
"data-step-type": effectiveStep.type,
|
|
6933
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6934
|
+
DappImportAssetSelectSkeleton,
|
|
6935
|
+
{
|
|
6936
|
+
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportProvider, 'optionalAccess', _238 => _238.sourceLabel]), () => ( "")),
|
|
6937
|
+
error: dappImportBootError,
|
|
6938
|
+
onRetry: handleBootRetry
|
|
6939
|
+
}
|
|
6940
|
+
)
|
|
6941
|
+
}
|
|
6942
|
+
);
|
|
6943
|
+
}
|
|
6944
|
+
if (!_optionalChain([signerContext, 'optionalAccess', _239 => _239.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _240 => _240.publicClient])) {
|
|
6826
6945
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-state", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-text", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-title", children: "Connecting wallet\u2026" }) }) }) }) });
|
|
6827
6946
|
}
|
|
6828
6947
|
const ownerAddress = signerContext.ownerAddress;
|
|
6829
|
-
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access',
|
|
6948
|
+
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _241 => _241.walletClient, 'optionalAccess', _242 => _242.chain, 'optionalAccess', _243 => _243.id]), () => ( _optionalChain([signerContext, 'access', _244 => _244.publicClient, 'access', _245 => _245.chain, 'optionalAccess', _246 => _246.id]))), () => ( setupChainId));
|
|
6830
6949
|
const getReadClientForChain = (chainId) => {
|
|
6831
|
-
if (_optionalChain([signerContext, 'access',
|
|
6950
|
+
if (_optionalChain([signerContext, 'access', _247 => _247.publicClient, 'access', _248 => _248.chain, 'optionalAccess', _249 => _249.id]) === chainId) {
|
|
6832
6951
|
return signerContext.publicClient;
|
|
6833
6952
|
}
|
|
6834
|
-
return
|
|
6953
|
+
return _chunkMQIJZNTPcjs.getPublicClient.call(void 0, chainId);
|
|
6835
6954
|
};
|
|
6836
6955
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
6837
6956
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -6862,7 +6981,7 @@ function DepositFlow({
|
|
|
6862
6981
|
effectiveStep.type === "dapp-import-asset-select" && activeDappImportProvider && activeDappImportAvailability && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6863
6982
|
DappImportAssetSelectStep,
|
|
6864
6983
|
{
|
|
6865
|
-
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access',
|
|
6984
|
+
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access', _250 => _250.assets, 'access', _251 => _251[0], 'optionalAccess', _252 => _252.sourceLabel]), () => ( activeDappImportProvider.sourceLabel)),
|
|
6866
6985
|
assets: activeDappImportAvailability.assets,
|
|
6867
6986
|
onSelect: handleDappImportAssetSelected
|
|
6868
6987
|
}
|
|
@@ -6889,7 +7008,7 @@ function DepositFlow({
|
|
|
6889
7008
|
onContinue: handleAmountContinue,
|
|
6890
7009
|
onCtaClick: (ctaName) => {
|
|
6891
7010
|
const receiveSymbol = _chunkMILJQWPTcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
6892
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
7011
|
+
_optionalChain([onEvent, 'optionalCall', _253 => _253({
|
|
6893
7012
|
type: "deposit_modal_connected_wallet_enter_value_cta_click",
|
|
6894
7013
|
send_token: effectiveStep.asset.symbol,
|
|
6895
7014
|
receive_token: receiveSymbol,
|
|
@@ -6941,7 +7060,7 @@ function DepositFlow({
|
|
|
6941
7060
|
}
|
|
6942
7061
|
),
|
|
6943
7062
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6944
|
-
|
|
7063
|
+
_chunkMQIJZNTPcjs.ProcessingStep,
|
|
6945
7064
|
{
|
|
6946
7065
|
smartAccount: effectiveStep.smartAccount,
|
|
6947
7066
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
@@ -6954,7 +7073,7 @@ function DepositFlow({
|
|
|
6954
7073
|
sourceSymbol: effectiveStep.sourceSymbol,
|
|
6955
7074
|
sourceDecimals: effectiveStep.sourceDecimals,
|
|
6956
7075
|
amountUsd: effectiveStep.inputAmountUsd,
|
|
6957
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
7076
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _254 => _254.length])),
|
|
6958
7077
|
service,
|
|
6959
7078
|
directTransfer: effectiveStep.directTransfer,
|
|
6960
7079
|
uiConfig,
|
|
@@ -6986,7 +7105,7 @@ function formatDate(iso) {
|
|
|
6986
7105
|
month: "short",
|
|
6987
7106
|
year: "numeric"
|
|
6988
7107
|
});
|
|
6989
|
-
} catch (
|
|
7108
|
+
} catch (e30) {
|
|
6990
7109
|
return iso;
|
|
6991
7110
|
}
|
|
6992
7111
|
}
|
|
@@ -7044,7 +7163,7 @@ function formatAmount(rawAmount, token, chainId) {
|
|
|
7044
7163
|
let frac = fracStr.slice(0, 5).replace(/0+$/, "");
|
|
7045
7164
|
if (frac.length < 2) frac = frac.padEnd(2, "0");
|
|
7046
7165
|
return `${whole}.${frac}`;
|
|
7047
|
-
} catch (
|
|
7166
|
+
} catch (e31) {
|
|
7048
7167
|
return rawAmount;
|
|
7049
7168
|
}
|
|
7050
7169
|
}
|
|
@@ -7093,7 +7212,7 @@ function DepositHistoryPanel({
|
|
|
7093
7212
|
);
|
|
7094
7213
|
const visibleDeposits = _react.useMemo.call(void 0, () => {
|
|
7095
7214
|
const sourceHashes = new Set(
|
|
7096
|
-
deposits.map((d) => _optionalChain([d, 'access',
|
|
7215
|
+
deposits.map((d) => _optionalChain([d, 'access', _255 => _255.sourceTxHash, 'optionalAccess', _256 => _256.toLowerCase, 'call', _257 => _257()])).filter((h) => Boolean(h))
|
|
7097
7216
|
);
|
|
7098
7217
|
return deposits.filter(
|
|
7099
7218
|
(d) => !(d.txHash && sourceHashes.has(d.txHash.toLowerCase()))
|
|
@@ -7115,7 +7234,7 @@ function DepositHistoryPanel({
|
|
|
7115
7234
|
className: "rs-modal-header-back",
|
|
7116
7235
|
"aria-label": "Back",
|
|
7117
7236
|
onClick: onClose,
|
|
7118
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7237
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.ChevronLeftIcon, {})
|
|
7119
7238
|
}
|
|
7120
7239
|
) }),
|
|
7121
7240
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: onCloseModal && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -7125,29 +7244,29 @@ function DepositHistoryPanel({
|
|
|
7125
7244
|
className: "rs-modal-close",
|
|
7126
7245
|
"aria-label": "Close",
|
|
7127
7246
|
onClick: onCloseModal,
|
|
7128
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7247
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.CloseIcon, {})
|
|
7129
7248
|
}
|
|
7130
7249
|
) })
|
|
7131
7250
|
] }),
|
|
7132
7251
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen", children: [
|
|
7133
7252
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen-body", children: [
|
|
7134
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7253
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.HistoryIcon, {}), title: "History" }),
|
|
7135
7254
|
isLoading && deposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
7136
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7255
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.HistoryIcon, {}) }),
|
|
7137
7256
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
7138
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7257
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.Spinner, { className: "rs-spinner--sm" }),
|
|
7139
7258
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Loading history\u2026" })
|
|
7140
7259
|
] })
|
|
7141
7260
|
] }),
|
|
7142
7261
|
error && !isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
7143
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7262
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.AlertTriangleIcon, {}) }),
|
|
7144
7263
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
7145
7264
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "Couldn't load history" }),
|
|
7146
7265
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: error })
|
|
7147
7266
|
] })
|
|
7148
7267
|
] }),
|
|
7149
7268
|
!isLoading && !error && visibleDeposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
7150
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7269
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.HistoryIcon, {}) }),
|
|
7151
7270
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
7152
7271
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "No deposits yet" }),
|
|
7153
7272
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Your deposit history will appear here" })
|
|
@@ -7167,7 +7286,7 @@ function DepositHistoryPanel({
|
|
|
7167
7286
|
)
|
|
7168
7287
|
] })
|
|
7169
7288
|
] }),
|
|
7170
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7289
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.PoweredBy, {})
|
|
7171
7290
|
] })
|
|
7172
7291
|
]
|
|
7173
7292
|
}
|
|
@@ -7242,7 +7361,7 @@ function HistoryCard({ deposit }) {
|
|
|
7242
7361
|
onClick: (e) => e.stopPropagation(),
|
|
7243
7362
|
children: [
|
|
7244
7363
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: shortenHash(deposit.sourceTxHash) }),
|
|
7245
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7364
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.ArrowUpRightIcon, {})
|
|
7246
7365
|
]
|
|
7247
7366
|
}
|
|
7248
7367
|
)
|
|
@@ -7257,7 +7376,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
|
7257
7376
|
// src/DepositModal.tsx
|
|
7258
7377
|
|
|
7259
7378
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
7260
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
7379
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-MECHBE6P.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
7261
7380
|
);
|
|
7262
7381
|
function sortByCreatedAtDesc(items) {
|
|
7263
7382
|
return [...items].sort((a, b) => {
|
|
@@ -7313,6 +7432,7 @@ function DepositModalInner({
|
|
|
7313
7432
|
forceRegister = false,
|
|
7314
7433
|
enableSolana = true,
|
|
7315
7434
|
dappImports,
|
|
7435
|
+
initialDappImport,
|
|
7316
7436
|
enableFiatOnramp = false,
|
|
7317
7437
|
enableQrTransfer = true,
|
|
7318
7438
|
fiatOnrampMethods,
|
|
@@ -7335,12 +7455,12 @@ function DepositModalInner({
|
|
|
7335
7455
|
debug
|
|
7336
7456
|
}) {
|
|
7337
7457
|
const modalRef = _react.useRef.call(void 0, null);
|
|
7338
|
-
const onReadyRef =
|
|
7458
|
+
const onReadyRef = _chunkMQIJZNTPcjs.useLatestRef.call(void 0, onReady);
|
|
7339
7459
|
const [currentScreen, setCurrentScreen] = _react.useState.call(void 0, "connect");
|
|
7340
7460
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
7341
7461
|
void 0
|
|
7342
7462
|
);
|
|
7343
|
-
const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
7463
|
+
const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _258 => _258.showHistoryButton]), () => ( false));
|
|
7344
7464
|
const historyButtonVisible = showHistoryButton && (currentScreen === "select-asset" || currentScreen === "deposit-address");
|
|
7345
7465
|
const [historyOpen, setHistoryOpen] = _react.useState.call(void 0, false);
|
|
7346
7466
|
const [historyDeposits, setHistoryDeposits] = _react.useState.call(void 0, []);
|
|
@@ -7354,19 +7474,19 @@ function DepositModalInner({
|
|
|
7354
7474
|
const targetChain = targetChainProp === "solana" ? "solana" : _chunkMILJQWPTcjs.getChainId.call(void 0, targetChainProp);
|
|
7355
7475
|
const sourceChain = sourceChainProp ? _chunkMILJQWPTcjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
7356
7476
|
const [recipientIsContract, setRecipientIsContract] = _react.useState.call(void 0, false);
|
|
7357
|
-
const onErrorRef =
|
|
7477
|
+
const onErrorRef = _chunkMQIJZNTPcjs.useLatestRef.call(void 0, onError);
|
|
7358
7478
|
_react.useEffect.call(void 0, () => {
|
|
7359
7479
|
if (targetChain !== _chunkMILJQWPTcjs.HYPERCORE_CHAIN_ID || !_viem.isAddress.call(void 0, recipient, { strict: false })) {
|
|
7360
7480
|
setRecipientIsContract(false);
|
|
7361
7481
|
return;
|
|
7362
7482
|
}
|
|
7363
7483
|
let cancelled = false;
|
|
7364
|
-
|
|
7484
|
+
_chunkMQIJZNTPcjs.getHyperEvmReadClient.call(void 0, ).getCode({ address: recipient }).then((code) => {
|
|
7365
7485
|
if (cancelled) return;
|
|
7366
7486
|
const isContract = _chunkMILJQWPTcjs.isContractBytecode.call(void 0, code);
|
|
7367
7487
|
setRecipientIsContract(isContract);
|
|
7368
7488
|
if (isContract) {
|
|
7369
|
-
_optionalChain([onErrorRef, 'access',
|
|
7489
|
+
_optionalChain([onErrorRef, 'access', _259 => _259.current, 'optionalCall', _260 => _260({
|
|
7370
7490
|
message: "HyperCore deposits require an EOA recipient; the configured recipient is a smart contract.",
|
|
7371
7491
|
code: "HYPERCORE_RECIPIENT_NOT_EOA"
|
|
7372
7492
|
})]);
|
|
@@ -7379,7 +7499,7 @@ function DepositModalInner({
|
|
|
7379
7499
|
};
|
|
7380
7500
|
}, [targetChain, recipient, onErrorRef]);
|
|
7381
7501
|
const service = _react.useMemo.call(void 0,
|
|
7382
|
-
() =>
|
|
7502
|
+
() => _chunkMQIJZNTPcjs.createDepositService.call(void 0, backendUrl, {
|
|
7383
7503
|
debug,
|
|
7384
7504
|
debugScope: "service:deposit"
|
|
7385
7505
|
}),
|
|
@@ -7395,7 +7515,7 @@ function DepositModalInner({
|
|
|
7395
7515
|
}, [store, targetChain, targetToken]);
|
|
7396
7516
|
_react.useEffect.call(void 0, () => {
|
|
7397
7517
|
if (isOpen && modalRef.current) {
|
|
7398
|
-
|
|
7518
|
+
_chunkMQIJZNTPcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
7399
7519
|
}
|
|
7400
7520
|
}, [isOpen, theme]);
|
|
7401
7521
|
_react.useEffect.call(void 0, () => {
|
|
@@ -7403,7 +7523,7 @@ function DepositModalInner({
|
|
|
7403
7523
|
}, [solanaRpcUrl]);
|
|
7404
7524
|
_react.useEffect.call(void 0, () => {
|
|
7405
7525
|
if (isOpen) {
|
|
7406
|
-
_optionalChain([onReadyRef, 'access',
|
|
7526
|
+
_optionalChain([onReadyRef, 'access', _261 => _261.current, 'optionalCall', _262 => _262()]);
|
|
7407
7527
|
}
|
|
7408
7528
|
}, [isOpen, onReadyRef]);
|
|
7409
7529
|
const handleStepChange = _react.useCallback.call(void 0,
|
|
@@ -7479,10 +7599,10 @@ function DepositModalInner({
|
|
|
7479
7599
|
fetchHistory("initial");
|
|
7480
7600
|
}
|
|
7481
7601
|
}, [historyOpen, fetchHistory]);
|
|
7482
|
-
const onLifecycleRef =
|
|
7602
|
+
const onLifecycleRef = _chunkMQIJZNTPcjs.useLatestRef.call(void 0, onLifecycle);
|
|
7483
7603
|
const handleLifecycle = _react.useCallback.call(void 0,
|
|
7484
7604
|
(event) => {
|
|
7485
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7605
|
+
_optionalChain([onLifecycleRef, 'access', _263 => _263.current, 'optionalCall', _264 => _264(event)]);
|
|
7486
7606
|
if (event.type === "smart-account-changed" && !event.evm && !event.solana) {
|
|
7487
7607
|
historyStaleRef.current = true;
|
|
7488
7608
|
}
|
|
@@ -7508,10 +7628,10 @@ function DepositModalInner({
|
|
|
7508
7628
|
store.dispatch({ type: "flow/reset" });
|
|
7509
7629
|
}
|
|
7510
7630
|
}, [isOpen, store]);
|
|
7511
|
-
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
7631
|
+
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _265 => _265.showBackButton]), () => ( true));
|
|
7512
7632
|
const canGoBack = backHandler !== void 0;
|
|
7513
7633
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7514
|
-
|
|
7634
|
+
_chunkMQIJZNTPcjs.Modal,
|
|
7515
7635
|
{
|
|
7516
7636
|
isOpen,
|
|
7517
7637
|
onClose,
|
|
@@ -7527,7 +7647,7 @@ function DepositModalInner({
|
|
|
7527
7647
|
className: "rs-modal-header-back",
|
|
7528
7648
|
"aria-label": "Go back",
|
|
7529
7649
|
onClick: backHandler,
|
|
7530
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7650
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.ChevronLeftIcon, {})
|
|
7531
7651
|
}
|
|
7532
7652
|
) }),
|
|
7533
7653
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
|
|
@@ -7539,7 +7659,7 @@ function DepositModalInner({
|
|
|
7539
7659
|
"aria-label": "Deposit history",
|
|
7540
7660
|
onClick: handleHistoryOpen,
|
|
7541
7661
|
disabled: !recipient,
|
|
7542
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7662
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.HistoryIcon, {})
|
|
7543
7663
|
}
|
|
7544
7664
|
),
|
|
7545
7665
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -7549,12 +7669,12 @@ function DepositModalInner({
|
|
|
7549
7669
|
onClick: onClose,
|
|
7550
7670
|
className: "rs-modal-close",
|
|
7551
7671
|
"aria-label": "Close",
|
|
7552
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7672
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.CloseIcon, {})
|
|
7553
7673
|
}
|
|
7554
7674
|
)
|
|
7555
7675
|
] })
|
|
7556
7676
|
] }),
|
|
7557
|
-
recipientIsContract ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7677
|
+
recipientIsContract ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkMQIJZNTPcjs.Callout, { variant: "error", children: "HyperCore deposits require an EOA recipient. The configured recipient is a smart contract, which is not supported." }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7558
7678
|
DepositFlow,
|
|
7559
7679
|
{
|
|
7560
7680
|
dappWalletClient,
|
|
@@ -7577,6 +7697,7 @@ function DepositModalInner({
|
|
|
7577
7697
|
forceRegister,
|
|
7578
7698
|
enableSolana,
|
|
7579
7699
|
dappImports,
|
|
7700
|
+
initialDappImport,
|
|
7580
7701
|
enableFiatOnramp,
|
|
7581
7702
|
enableQrTransfer,
|
|
7582
7703
|
fiatOnrampMethods,
|