@rhinestone/deposit-modal 0.3.0 → 0.4.0
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-DNW4GH6L.cjs → DepositModalReown-KFTMS2WX.cjs} +9 -7
- package/dist/{DepositModalReown-6SUEC5IU.mjs → DepositModalReown-PC7EX5VK.mjs} +6 -4
- package/dist/{WithdrawModalReown-7UAGSOSU.mjs → WithdrawModalReown-BE23LUMT.mjs} +5 -4
- package/dist/{WithdrawModalReown-OUWBSKSM.cjs → WithdrawModalReown-Z2YF2FSJ.cjs} +8 -7
- 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-33H6O5UU.cjs → chunk-3MXWIYAT.cjs} +16 -6
- package/dist/{chunk-KJ2RR2D4.mjs → chunk-3PVDRSJ7.mjs} +930 -682
- package/dist/{chunk-VVJAIMKB.cjs → chunk-7MP2UWIQ.cjs} +1091 -843
- package/dist/{chunk-MILJQWPT.cjs → chunk-ABVRVW3P.cjs} +133 -8
- package/dist/{chunk-2SMS542Q.cjs → chunk-AE5LHTPM.cjs} +122 -100
- package/dist/chunk-F7P4MV72.mjs +295 -0
- package/dist/chunk-FJWLC4AM.mjs +212 -0
- package/dist/{chunk-KAWJABTW.mjs → chunk-GKC22JC4.mjs} +901 -717
- package/dist/chunk-NRNJAQUA.cjs +212 -0
- package/dist/{chunk-RABZINV3.cjs → chunk-OQVLEVNR.cjs} +758 -574
- package/dist/chunk-UEKPBRBY.cjs +295 -0
- package/dist/{chunk-GPSBM66J.mjs → chunk-UFKFSGT3.mjs} +14 -4
- package/dist/{chunk-TKQYTBU6.mjs → chunk-WCIGOV34.mjs} +36 -14
- package/dist/{chunk-6YRDD462.mjs → chunk-WJX3TJFK.mjs} +135 -10
- package/dist/constants.cjs +2 -2
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +6 -4
- package/dist/deposit.d.cts +4 -4
- package/dist/deposit.d.ts +4 -4
- package/dist/deposit.mjs +5 -3
- package/dist/index.cjs +7 -5
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.mjs +6 -4
- 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 +252 -9
- package/dist/{types-BMcGO5k_.d.cts → types-CFRuisqK.d.cts} +10 -1
- package/dist/{types-BMcGO5k_.d.ts → types-CFRuisqK.d.ts} +10 -1
- package/dist/withdraw.cjs +5 -4
- package/dist/withdraw.d.cts +4 -4
- package/dist/withdraw.d.ts +4 -4
- package/dist/withdraw.mjs +4 -3
- package/package.json +15 -2
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
+
var _chunkNRNJAQUAcjs = require('./chunk-NRNJAQUA.cjs');
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
|
|
@@ -50,7 +51,6 @@
|
|
|
50
51
|
|
|
51
52
|
|
|
52
53
|
|
|
53
|
-
var _chunkRABZINV3cjs = require('./chunk-RABZINV3.cjs');
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
|
|
@@ -62,8 +62,10 @@ var _chunkRABZINV3cjs = require('./chunk-RABZINV3.cjs');
|
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
|
|
65
|
+
var _chunkOQVLEVNRcjs = require('./chunk-OQVLEVNR.cjs');
|
|
65
66
|
|
|
66
67
|
|
|
68
|
+
var _chunkUEKPBRBYcjs = require('./chunk-UEKPBRBY.cjs');
|
|
67
69
|
|
|
68
70
|
|
|
69
71
|
|
|
@@ -80,7 +82,20 @@ var _chunkRABZINV3cjs = require('./chunk-RABZINV3.cjs');
|
|
|
80
82
|
|
|
81
83
|
|
|
82
84
|
|
|
83
|
-
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
var _chunkABVRVW3Pcjs = require('./chunk-ABVRVW3P.cjs');
|
|
84
99
|
|
|
85
100
|
// src/DepositModal.tsx
|
|
86
101
|
|
|
@@ -127,13 +142,13 @@ function AssetSelectStep({
|
|
|
127
142
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
128
143
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
129
144
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
130
|
-
return
|
|
145
|
+
return _chunkOQVLEVNRcjs.getAssetId.call(void 0, {
|
|
131
146
|
chainId: defaultSourceChain,
|
|
132
147
|
token: defaultSourceToken
|
|
133
148
|
});
|
|
134
149
|
}, [defaultSourceChain, defaultSourceToken]);
|
|
135
|
-
const onTotalBalanceComputedRef =
|
|
136
|
-
const onAssetsLoadedRef =
|
|
150
|
+
const onTotalBalanceComputedRef = _chunkOQVLEVNRcjs.useLatestRef.call(void 0, onTotalBalanceComputed);
|
|
151
|
+
const onAssetsLoadedRef = _chunkOQVLEVNRcjs.useLatestRef.call(void 0, onAssetsLoaded);
|
|
137
152
|
_react.useEffect.call(void 0, () => {
|
|
138
153
|
let active = true;
|
|
139
154
|
function emitAssetsUpdate(currentAssets) {
|
|
@@ -141,8 +156,8 @@ function AssetSelectStep({
|
|
|
141
156
|
(sum, asset) => sum + (_nullishCoalesce(asset.balanceUsd, () => ( 0))),
|
|
142
157
|
0
|
|
143
158
|
);
|
|
144
|
-
_optionalChain([onTotalBalanceComputedRef, 'access',
|
|
145
|
-
if (currentAssets.length > 0) _optionalChain([onAssetsLoadedRef, 'access',
|
|
159
|
+
_optionalChain([onTotalBalanceComputedRef, 'access', _2 => _2.current, 'optionalCall', _3 => _3(total)]);
|
|
160
|
+
if (currentAssets.length > 0) _optionalChain([onAssetsLoadedRef, 'access', _4 => _4.current, 'optionalCall', _5 => _5(currentAssets)]);
|
|
146
161
|
}
|
|
147
162
|
async function loadPortfolio() {
|
|
148
163
|
if (!address) {
|
|
@@ -154,11 +169,11 @@ function AssetSelectStep({
|
|
|
154
169
|
try {
|
|
155
170
|
const portfolio = await service.fetchPortfolio(address);
|
|
156
171
|
if (!active) return;
|
|
157
|
-
const portfolioAssets =
|
|
172
|
+
const portfolioAssets = _chunkOQVLEVNRcjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
158
173
|
setAssets(portfolioAssets);
|
|
159
174
|
emitAssetsUpdate(portfolioAssets);
|
|
160
175
|
const hasNative = portfolioAssets.some(
|
|
161
|
-
(asset) => asset.token.toLowerCase() ===
|
|
176
|
+
(asset) => asset.token.toLowerCase() === _chunkABVRVW3Pcjs.NATIVE_TOKEN_ADDRESS
|
|
162
177
|
);
|
|
163
178
|
if (!hasNative) {
|
|
164
179
|
const nativeAssets = await fetchNativeAssets(
|
|
@@ -194,12 +209,12 @@ function AssetSelectStep({
|
|
|
194
209
|
}
|
|
195
210
|
}, [assets, defaultAssetId, selectedAssetId]);
|
|
196
211
|
const allowedChainSet = _react.useMemo.call(void 0,
|
|
197
|
-
() => _optionalChain([allowedRoutes, 'optionalAccess',
|
|
198
|
-
[_optionalChain([allowedRoutes, 'optionalAccess',
|
|
212
|
+
() => _optionalChain([allowedRoutes, 'optionalAccess', _6 => _6.sourceChains]) ? new Set(allowedRoutes.sourceChains) : null,
|
|
213
|
+
[_optionalChain([allowedRoutes, 'optionalAccess', _7 => _7.sourceChains])]
|
|
199
214
|
);
|
|
200
215
|
const allowedTokenSet = _react.useMemo.call(void 0,
|
|
201
|
-
() => _optionalChain([allowedRoutes, 'optionalAccess',
|
|
202
|
-
[_optionalChain([allowedRoutes, 'optionalAccess',
|
|
216
|
+
() => _optionalChain([allowedRoutes, 'optionalAccess', _8 => _8.sourceTokens]) ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null,
|
|
217
|
+
[_optionalChain([allowedRoutes, 'optionalAccess', _9 => _9.sourceTokens])]
|
|
203
218
|
);
|
|
204
219
|
const rows = _react.useMemo.call(void 0, () => {
|
|
205
220
|
return assets.filter((a) => {
|
|
@@ -230,7 +245,7 @@ function AssetSelectStep({
|
|
|
230
245
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
231
246
|
const numeric = Number(raw);
|
|
232
247
|
if (!Number.isFinite(numeric)) return raw;
|
|
233
|
-
return
|
|
248
|
+
return _chunkOQVLEVNRcjs.tokenFormatter.format(numeric);
|
|
234
249
|
} catch (e3) {
|
|
235
250
|
return asset.balance;
|
|
236
251
|
}
|
|
@@ -238,20 +253,20 @@ function AssetSelectStep({
|
|
|
238
253
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
239
254
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
240
255
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
241
|
-
|
|
256
|
+
_chunkOQVLEVNRcjs.BodyHeader,
|
|
242
257
|
{
|
|
243
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
258
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.WalletIcon, {}),
|
|
244
259
|
title: "Your assets",
|
|
245
260
|
subtitle: "Select source assets to transfer"
|
|
246
261
|
}
|
|
247
262
|
),
|
|
248
263
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
249
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
264
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
250
265
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
251
266
|
] }),
|
|
252
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
267
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.Callout, { variant: "error", children: error }),
|
|
253
268
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
254
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
269
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
255
270
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
256
271
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
257
272
|
address.slice(0, 6),
|
|
@@ -271,9 +286,9 @@ function AssetSelectStep({
|
|
|
271
286
|
!loading && !error && rows.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: rows.map((asset) => {
|
|
272
287
|
const isSelected = selectedAssetId === asset.id;
|
|
273
288
|
const tokenAmount = formatBalance(asset);
|
|
274
|
-
const badge =
|
|
275
|
-
const tokenIcon =
|
|
276
|
-
const chainIcon =
|
|
289
|
+
const badge = _chunkABVRVW3Pcjs.getChainBadge.call(void 0, asset.chainId);
|
|
290
|
+
const tokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, asset.symbol);
|
|
291
|
+
const chainIcon = _chunkABVRVW3Pcjs.getChainIcon.call(void 0, asset.chainId);
|
|
277
292
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
278
293
|
"button",
|
|
279
294
|
{
|
|
@@ -289,7 +304,7 @@ function AssetSelectStep({
|
|
|
289
304
|
"img",
|
|
290
305
|
{
|
|
291
306
|
src: chainIcon,
|
|
292
|
-
alt:
|
|
307
|
+
alt: _chunkABVRVW3Pcjs.getChainName.call(void 0, asset.chainId)
|
|
293
308
|
}
|
|
294
309
|
) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
295
310
|
"span",
|
|
@@ -308,7 +323,7 @@ function AssetSelectStep({
|
|
|
308
323
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-name", children: asset.symbol }),
|
|
309
324
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-asset-chain", children: [
|
|
310
325
|
"on ",
|
|
311
|
-
|
|
326
|
+
_chunkABVRVW3Pcjs.getChainName.call(void 0, asset.chainId)
|
|
312
327
|
] })
|
|
313
328
|
] }),
|
|
314
329
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-balance-small", children: [
|
|
@@ -318,14 +333,14 @@ function AssetSelectStep({
|
|
|
318
333
|
] })
|
|
319
334
|
] })
|
|
320
335
|
] }),
|
|
321
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ?
|
|
336
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunkOQVLEVNRcjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
322
337
|
]
|
|
323
338
|
},
|
|
324
339
|
asset.id
|
|
325
340
|
);
|
|
326
341
|
}) }),
|
|
327
342
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
328
|
-
|
|
343
|
+
_chunkOQVLEVNRcjs.Button,
|
|
329
344
|
{
|
|
330
345
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
331
346
|
disabled: !selectedAsset,
|
|
@@ -334,17 +349,17 @@ function AssetSelectStep({
|
|
|
334
349
|
}
|
|
335
350
|
)
|
|
336
351
|
] }),
|
|
337
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
352
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.PoweredBy, {})
|
|
338
353
|
] });
|
|
339
354
|
}
|
|
340
355
|
async function fetchNativeAssets(address, publicClient, existing) {
|
|
341
356
|
const existingIds = new Set(existing.map((asset) => asset.id));
|
|
342
|
-
const connectedChainId = _optionalChain([publicClient, 'access',
|
|
357
|
+
const connectedChainId = _optionalChain([publicClient, 'access', _10 => _10.chain, 'optionalAccess', _11 => _11.id]);
|
|
343
358
|
if (!connectedChainId) return [];
|
|
344
|
-
if (!
|
|
345
|
-
const id =
|
|
359
|
+
if (!_chunkABVRVW3Pcjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
|
|
360
|
+
const id = _chunkOQVLEVNRcjs.getAssetId.call(void 0, {
|
|
346
361
|
chainId: connectedChainId,
|
|
347
|
-
token:
|
|
362
|
+
token: _chunkABVRVW3Pcjs.NATIVE_TOKEN_ADDRESS
|
|
348
363
|
});
|
|
349
364
|
if (existingIds.has(id)) return [];
|
|
350
365
|
try {
|
|
@@ -353,7 +368,7 @@ async function fetchNativeAssets(address, publicClient, existing) {
|
|
|
353
368
|
{
|
|
354
369
|
id,
|
|
355
370
|
chainId: connectedChainId,
|
|
356
|
-
token:
|
|
371
|
+
token: _chunkABVRVW3Pcjs.NATIVE_TOKEN_ADDRESS,
|
|
357
372
|
symbol: "ETH",
|
|
358
373
|
name: "Ethereum",
|
|
359
374
|
decimals: 18,
|
|
@@ -510,12 +525,12 @@ function AmountStep({
|
|
|
510
525
|
const [isCheckingLiquidity, setIsCheckingLiquidity] = _react.useState.call(void 0, false);
|
|
511
526
|
const hasAttemptedSwitch = _react.useRef.call(void 0, false);
|
|
512
527
|
const hasAppliedDefaultRef = _react.useRef.call(void 0, false);
|
|
513
|
-
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess',
|
|
528
|
+
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess', _12 => _12.trim, 'call', _13 => _13(), 'access', _14 => _14.toLowerCase, 'call', _15 => _15()]) === "max";
|
|
514
529
|
const chainMismatch = Boolean(
|
|
515
|
-
_optionalChain([walletClient, 'optionalAccess',
|
|
530
|
+
_optionalChain([walletClient, 'optionalAccess', _16 => _16.chain, 'optionalAccess', _17 => _17.id]) && walletClient.chain.id !== asset.chainId
|
|
516
531
|
);
|
|
517
|
-
const targetSymbol =
|
|
518
|
-
const isSourceStablecoin =
|
|
532
|
+
const targetSymbol = _chunkABVRVW3Pcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
533
|
+
const isSourceStablecoin = _chunkABVRVW3Pcjs.isStablecoinSymbol.call(void 0, asset.symbol);
|
|
519
534
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
520
535
|
if (tokenPriceUsdOverride !== void 0 && tokenPriceUsdOverride > 0)
|
|
521
536
|
return tokenPriceUsdOverride;
|
|
@@ -539,7 +554,7 @@ function AmountStep({
|
|
|
539
554
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
540
555
|
if (!balanceTarget || !publicClient) return;
|
|
541
556
|
try {
|
|
542
|
-
const bal =
|
|
557
|
+
const bal = _chunkOQVLEVNRcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
543
558
|
address: asset.token,
|
|
544
559
|
abi: _viem.erc20Abi,
|
|
545
560
|
functionName: "balanceOf",
|
|
@@ -560,7 +575,7 @@ function AmountStep({
|
|
|
560
575
|
hasAttemptedSwitch.current = true;
|
|
561
576
|
switchChain(asset.chainId).catch((err) => {
|
|
562
577
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
563
|
-
setError(
|
|
578
|
+
setError(_chunkOQVLEVNRcjs.formatUserError.call(void 0, raw));
|
|
564
579
|
});
|
|
565
580
|
}
|
|
566
581
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -613,7 +628,7 @@ function AmountStep({
|
|
|
613
628
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
614
629
|
const numeric = Number(raw);
|
|
615
630
|
if (!Number.isFinite(numeric)) return raw;
|
|
616
|
-
return
|
|
631
|
+
return _chunkOQVLEVNRcjs.tokenFormatter.format(numeric);
|
|
617
632
|
} catch (e8) {
|
|
618
633
|
return "\u2026";
|
|
619
634
|
}
|
|
@@ -632,8 +647,8 @@ function AmountStep({
|
|
|
632
647
|
return null;
|
|
633
648
|
}
|
|
634
649
|
}, [numericAmount, isSourceStablecoin, hasPricing, tokenPriceUsd, asset.decimals]);
|
|
635
|
-
const minDepositUsd = targetChain ===
|
|
636
|
-
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
650
|
+
const minDepositUsd = targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID ? Math.max(_chunkABVRVW3Pcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _18 => _18.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _19 => _19.minDepositUsd]), () => ( null));
|
|
651
|
+
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _20 => _20.maxDepositUsd]), () => ( null));
|
|
637
652
|
const isBelowMin = minDepositUsd !== null && numericAmount > 0 && amountUsd < minDepositUsd;
|
|
638
653
|
const isAboveMax = maxDepositUsd !== null && amountUsd > maxDepositUsd;
|
|
639
654
|
const exceedsBalance = Boolean(
|
|
@@ -642,7 +657,7 @@ function AmountStep({
|
|
|
642
657
|
const balanceAfterUsd = appBalanceUsd !== void 0 ? appBalanceUsd + numericAmount : null;
|
|
643
658
|
const handlePresetClick = (percentage) => {
|
|
644
659
|
if (balance === null) return;
|
|
645
|
-
_optionalChain([onCtaClick, 'optionalCall',
|
|
660
|
+
_optionalChain([onCtaClick, 'optionalCall', _21 => _21(percentage === 100 ? "Max" : `${percentage}%`)]);
|
|
646
661
|
const next = formatAmountFromBalance(
|
|
647
662
|
balance,
|
|
648
663
|
asset.decimals,
|
|
@@ -689,13 +704,13 @@ function AmountStep({
|
|
|
689
704
|
return;
|
|
690
705
|
}
|
|
691
706
|
setError(null);
|
|
692
|
-
_optionalChain([onCtaClick, 'optionalCall',
|
|
707
|
+
_optionalChain([onCtaClick, 'optionalCall', _22 => _22("continue")]);
|
|
693
708
|
setIsCheckingLiquidity(true);
|
|
694
709
|
let liquidityWarning;
|
|
695
710
|
try {
|
|
696
711
|
const liquidity = await service.checkLiquidity({
|
|
697
|
-
sourceChainId: _nullishCoalesce(_optionalChain([liquiditySource, 'optionalAccess',
|
|
698
|
-
sourceToken: _nullishCoalesce(_optionalChain([liquiditySource, 'optionalAccess',
|
|
712
|
+
sourceChainId: _nullishCoalesce(_optionalChain([liquiditySource, 'optionalAccess', _23 => _23.chainId]), () => ( asset.chainId)),
|
|
713
|
+
sourceToken: _nullishCoalesce(_optionalChain([liquiditySource, 'optionalAccess', _24 => _24.token]), () => ( asset.token)),
|
|
699
714
|
destinationChainId: targetChain,
|
|
700
715
|
destinationToken: targetToken,
|
|
701
716
|
amount: amountInUnits.toString()
|
|
@@ -726,13 +741,13 @@ function AmountStep({
|
|
|
726
741
|
};
|
|
727
742
|
const continueLabel = exceedsBalance ? "Insufficient balance" : isAboveMax ? "Continue with max allowed deposit" : isBelowMin ? "Continue with minimum deposit" : "Continue";
|
|
728
743
|
const continueDisabled = chainMismatch || isCheckingLiquidity || exceedsBalance || numericAmount === 0 && !isBelowMin || balance === null;
|
|
729
|
-
const sourceChainName =
|
|
730
|
-
const targetChainName =
|
|
731
|
-
const sourceTokenIcon =
|
|
732
|
-
const targetTokenIcon =
|
|
744
|
+
const sourceChainName = _chunkABVRVW3Pcjs.getChainName.call(void 0, asset.chainId);
|
|
745
|
+
const targetChainName = _chunkABVRVW3Pcjs.getChainName.call(void 0, targetChain);
|
|
746
|
+
const sourceTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, asset.symbol);
|
|
747
|
+
const targetTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, targetSymbol);
|
|
733
748
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
734
749
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
735
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
750
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.WalletIcon, {}), title: "Wallet deposit" }),
|
|
736
751
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
737
752
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
738
753
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -752,13 +767,13 @@ function AmountStep({
|
|
|
752
767
|
" available",
|
|
753
768
|
balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
754
769
|
" (~",
|
|
755
|
-
|
|
770
|
+
_chunkOQVLEVNRcjs.currencyFormatter.format(balanceUsd),
|
|
756
771
|
")"
|
|
757
772
|
] })
|
|
758
773
|
] }),
|
|
759
774
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
760
775
|
"Min. deposit ",
|
|
761
|
-
|
|
776
|
+
_chunkOQVLEVNRcjs.currencyFormatter.format(minDepositUsd)
|
|
762
777
|
] })
|
|
763
778
|
] })
|
|
764
779
|
] }),
|
|
@@ -799,13 +814,13 @@ function AmountStep({
|
|
|
799
814
|
] }),
|
|
800
815
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
801
816
|
/* @__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:
|
|
817
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkOQVLEVNRcjs.currencyFormatter.format(balanceAfterUsd) })
|
|
803
818
|
] })
|
|
804
819
|
] }),
|
|
805
|
-
targetChain ===
|
|
806
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
820
|
+
targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
|
|
821
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.Callout, { variant: "error", children: error }),
|
|
807
822
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
808
|
-
|
|
823
|
+
_chunkOQVLEVNRcjs.Button,
|
|
809
824
|
{
|
|
810
825
|
onClick: handleContinue,
|
|
811
826
|
fullWidth: true,
|
|
@@ -816,7 +831,7 @@ function AmountStep({
|
|
|
816
831
|
}
|
|
817
832
|
)
|
|
818
833
|
] }),
|
|
819
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
834
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.PoweredBy, {})
|
|
820
835
|
] });
|
|
821
836
|
}
|
|
822
837
|
|
|
@@ -853,37 +868,33 @@ function ConfirmStep({
|
|
|
853
868
|
const [quote, setQuote] = _react.useState.call(void 0, null);
|
|
854
869
|
const hasAttemptedSwitch = _react.useRef.call(void 0, false);
|
|
855
870
|
const chainMismatch = Boolean(
|
|
856
|
-
_optionalChain([walletClient, 'optionalAccess',
|
|
871
|
+
_optionalChain([walletClient, 'optionalAccess', _25 => _25.chain, 'optionalAccess', _26 => _26.id]) && walletClient.chain.id !== asset.chainId
|
|
857
872
|
);
|
|
858
873
|
const sameRoute = targetChain === asset.chainId && targetToken.toLowerCase() === asset.token.toLowerCase();
|
|
859
|
-
const targetSymbol = sameRoute ? asset.symbol :
|
|
860
|
-
const sourceChainName =
|
|
861
|
-
const targetChainName =
|
|
862
|
-
const sourceChainIcon =
|
|
863
|
-
const targetChainIcon =
|
|
864
|
-
const sourceTokenIcon =
|
|
865
|
-
const targetTokenIcon =
|
|
866
|
-
const formattedSendAmount = amount &&
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
});
|
|
881
|
-
}
|
|
882
|
-
return formattedSendAmount;
|
|
874
|
+
const targetSymbol = sameRoute ? asset.symbol : _chunkABVRVW3Pcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
875
|
+
const sourceChainName = _chunkABVRVW3Pcjs.getChainName.call(void 0, asset.chainId);
|
|
876
|
+
const targetChainName = _chunkABVRVW3Pcjs.getChainName.call(void 0, targetChain);
|
|
877
|
+
const sourceChainIcon = _chunkABVRVW3Pcjs.getChainIcon.call(void 0, asset.chainId);
|
|
878
|
+
const targetChainIcon = _chunkABVRVW3Pcjs.getChainIcon.call(void 0, targetChain);
|
|
879
|
+
const sourceTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, asset.symbol);
|
|
880
|
+
const targetTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, targetSymbol);
|
|
881
|
+
const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? _nullishCoalesce(_chunkOQVLEVNRcjs.formatTokenAmount.call(void 0, Number(amount), asset.symbol), () => ( "0")) : "0";
|
|
882
|
+
const receiveDisplay = (() => {
|
|
883
|
+
if (sameRoute) return `${formattedSendAmount} ${asset.symbol}`;
|
|
884
|
+
const usdValue = Number(targetAmount);
|
|
885
|
+
const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
|
|
886
|
+
const estimate = _chunkOQVLEVNRcjs.formatReceiveEstimate.call(void 0, {
|
|
887
|
+
sourceAmount: Number.isFinite(Number(amount)) ? Number(amount) : void 0,
|
|
888
|
+
sourceSymbol: asset.symbol,
|
|
889
|
+
targetSymbol,
|
|
890
|
+
sourceAmountUsd,
|
|
891
|
+
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : {}
|
|
892
|
+
});
|
|
893
|
+
if (estimate !== void 0) return estimate;
|
|
894
|
+
return sourceAmountUsd !== void 0 ? `~$${sourceAmountUsd.toFixed(2)}` : `${formattedSendAmount} ${asset.symbol}`;
|
|
883
895
|
})();
|
|
884
|
-
const
|
|
885
|
-
const
|
|
886
|
-
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _27 => _27.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
896
|
+
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _27 => _27.feeSponsored]), () => ( false));
|
|
897
|
+
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _28 => _28.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
887
898
|
const feeDisplay = quote ? `$${quote.fees.totalUsd.toFixed(2)}` : null;
|
|
888
899
|
const estimatedTimeDisplay = quote ? quote.estimatedFillTimeSeconds < 60 ? "< 1 min" : `~${Math.round(quote.estimatedFillTimeSeconds / 60)} min` : estimatedTime;
|
|
889
900
|
_react.useEffect.call(void 0, () => {
|
|
@@ -891,7 +902,7 @@ function ConfirmStep({
|
|
|
891
902
|
hasAttemptedSwitch.current = true;
|
|
892
903
|
switchChain(asset.chainId).catch((err) => {
|
|
893
904
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
894
|
-
setError(
|
|
905
|
+
setError(_chunkOQVLEVNRcjs.formatUserError.call(void 0, raw));
|
|
895
906
|
});
|
|
896
907
|
}
|
|
897
908
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -971,7 +982,7 @@ function ConfirmStep({
|
|
|
971
982
|
const result = await executeTransfer(amountUnits);
|
|
972
983
|
hash = result.txHash;
|
|
973
984
|
resolvedSourceToken = result.sourceToken;
|
|
974
|
-
} else if (
|
|
985
|
+
} else if (_chunkOQVLEVNRcjs.isNativeAsset.call(void 0, asset)) {
|
|
975
986
|
hash = await walletClient.sendTransaction({
|
|
976
987
|
account,
|
|
977
988
|
chain,
|
|
@@ -988,20 +999,20 @@ function ConfirmStep({
|
|
|
988
999
|
args: [transferTo, amountUnits]
|
|
989
1000
|
});
|
|
990
1001
|
}
|
|
991
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
1002
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _29 => _29(hash, asset.chainId, amountUnits.toString())]);
|
|
992
1003
|
onConfirm(hash, asset.chainId, amountUnits.toString(), resolvedSourceToken);
|
|
993
1004
|
} catch (err) {
|
|
994
1005
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
995
|
-
const message =
|
|
1006
|
+
const message = _chunkOQVLEVNRcjs.formatUserError.call(void 0, raw);
|
|
996
1007
|
setError(message);
|
|
997
|
-
_optionalChain([onError, 'optionalCall',
|
|
1008
|
+
_optionalChain([onError, 'optionalCall', _30 => _30(message, "TRANSFER_ERROR")]);
|
|
998
1009
|
} finally {
|
|
999
1010
|
setIsSubmitting(false);
|
|
1000
1011
|
}
|
|
1001
1012
|
};
|
|
1002
1013
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
1003
1014
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
1004
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1015
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.WalletIcon, {}), title: "Review deposit" }),
|
|
1005
1016
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
|
|
1006
1017
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1007
1018
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
@@ -1035,11 +1046,7 @@ function ConfirmStep({
|
|
|
1035
1046
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1036
1047
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Receive" }),
|
|
1037
1048
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1038
|
-
/* @__PURE__ */ _jsxruntime.
|
|
1039
|
-
receiveAmount,
|
|
1040
|
-
" ",
|
|
1041
|
-
targetSymbol
|
|
1042
|
-
] }),
|
|
1049
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: receiveDisplay }),
|
|
1043
1050
|
targetTokenIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: targetTokenIcon, alt: "" }) })
|
|
1044
1051
|
] })
|
|
1045
1052
|
] }),
|
|
@@ -1059,14 +1066,14 @@ function ConfirmStep({
|
|
|
1059
1066
|
children: feeDisplay
|
|
1060
1067
|
}
|
|
1061
1068
|
),
|
|
1062
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1069
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.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, _chunkOQVLEVNRcjs.InfoIcon, {}) }) })
|
|
1063
1070
|
] })
|
|
1064
1071
|
] })
|
|
1065
1072
|
] }),
|
|
1066
|
-
targetChain ===
|
|
1067
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1073
|
+
targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
|
|
1074
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.Callout, { variant: "error", children: error }),
|
|
1068
1075
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1069
|
-
|
|
1076
|
+
_chunkOQVLEVNRcjs.Button,
|
|
1070
1077
|
{
|
|
1071
1078
|
onClick: handleConfirm,
|
|
1072
1079
|
loading: isSubmitting,
|
|
@@ -1077,7 +1084,7 @@ function ConfirmStep({
|
|
|
1077
1084
|
}
|
|
1078
1085
|
)
|
|
1079
1086
|
] }),
|
|
1080
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1087
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.PoweredBy, {})
|
|
1081
1088
|
] });
|
|
1082
1089
|
}
|
|
1083
1090
|
|
|
@@ -1100,9 +1107,9 @@ var INITIAL_POLL_INTERVAL = 3e3;
|
|
|
1100
1107
|
var MAX_POLL_INTERVAL = 3e4;
|
|
1101
1108
|
var BACKOFF_MULTIPLIER = 1.5;
|
|
1102
1109
|
function isEventForTx(event, txHash) {
|
|
1103
|
-
const eventTxHash =
|
|
1110
|
+
const eventTxHash = _chunkOQVLEVNRcjs.getEventTxHash.call(void 0, event);
|
|
1104
1111
|
if (!eventTxHash) return false;
|
|
1105
|
-
return
|
|
1112
|
+
return _chunkOQVLEVNRcjs.txRefsMatch.call(void 0, eventTxHash, txHash);
|
|
1106
1113
|
}
|
|
1107
1114
|
function truncateHash(hash) {
|
|
1108
1115
|
return `${hash.slice(0, 4)}\u2026${hash.slice(-4)}`;
|
|
@@ -1132,7 +1139,7 @@ function formatTimestamp(ms) {
|
|
|
1132
1139
|
return `${month} ${day}${suffix} \xB7 ${hours}:${minutes}:${seconds}`;
|
|
1133
1140
|
}
|
|
1134
1141
|
function formatBridgeFailedMessage(event) {
|
|
1135
|
-
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess',
|
|
1142
|
+
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _31 => _31.data]), () => ( {}));
|
|
1136
1143
|
const backendMessage = typeof eventData.message === "string" ? eventData.message.trim() : "";
|
|
1137
1144
|
if (backendMessage.length > 0) {
|
|
1138
1145
|
const lower = backendMessage.toLowerCase();
|
|
@@ -1152,7 +1159,7 @@ function formatBridgeFailedMessage(event) {
|
|
|
1152
1159
|
}
|
|
1153
1160
|
return "Bridge failed";
|
|
1154
1161
|
}
|
|
1155
|
-
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1162
|
+
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.ExternalLinkIcon, { className: "rs-deposit-notification-link-icon" });
|
|
1156
1163
|
function DepositNotification({
|
|
1157
1164
|
deposit,
|
|
1158
1165
|
smartAccount,
|
|
@@ -1187,7 +1194,7 @@ function DepositNotification({
|
|
|
1187
1194
|
const pollIntervalRef = _react.useRef.call(void 0, INITIAL_POLL_INTERVAL);
|
|
1188
1195
|
const pollTimeoutRef = _react.useRef.call(void 0, null);
|
|
1189
1196
|
const completedRef = _react.useRef.call(void 0, _nullishCoalesce(directTransfer, () => ( false)));
|
|
1190
|
-
const depositContextRef =
|
|
1197
|
+
const depositContextRef = _chunkOQVLEVNRcjs.useLatestRef.call(void 0, {
|
|
1191
1198
|
amount,
|
|
1192
1199
|
sourceChain,
|
|
1193
1200
|
sourceToken: token,
|
|
@@ -1196,8 +1203,8 @@ function DepositNotification({
|
|
|
1196
1203
|
targetToken,
|
|
1197
1204
|
hasPostBridgeActions
|
|
1198
1205
|
});
|
|
1199
|
-
const onCompleteRef =
|
|
1200
|
-
const onFailedRef =
|
|
1206
|
+
const onCompleteRef = _chunkOQVLEVNRcjs.useLatestRef.call(void 0, onComplete);
|
|
1207
|
+
const onFailedRef = _chunkOQVLEVNRcjs.useLatestRef.call(void 0, onFailed);
|
|
1201
1208
|
const handleComplete = _react.useCallback.call(void 0,
|
|
1202
1209
|
(destTxHash) => {
|
|
1203
1210
|
if (completedRef.current) return;
|
|
@@ -1206,7 +1213,7 @@ function DepositNotification({
|
|
|
1206
1213
|
setCompletedAt(Date.now());
|
|
1207
1214
|
setStatus("complete");
|
|
1208
1215
|
const context = depositContextRef.current;
|
|
1209
|
-
_optionalChain([onCompleteRef, 'access',
|
|
1216
|
+
_optionalChain([onCompleteRef, 'access', _32 => _32.current, 'optionalCall', _33 => _33(txHash, destTxHash, {
|
|
1210
1217
|
amount: context.amount,
|
|
1211
1218
|
sourceChain: context.sourceChain,
|
|
1212
1219
|
sourceToken: context.sourceToken,
|
|
@@ -1222,7 +1229,7 @@ function DepositNotification({
|
|
|
1222
1229
|
if (completedRef.current) return;
|
|
1223
1230
|
completedRef.current = true;
|
|
1224
1231
|
setStatus("failed");
|
|
1225
|
-
_optionalChain([onFailedRef, 'access',
|
|
1232
|
+
_optionalChain([onFailedRef, 'access', _34 => _34.current, 'optionalCall', _35 => _35(txHash, error)]);
|
|
1226
1233
|
},
|
|
1227
1234
|
[onFailedRef, txHash]
|
|
1228
1235
|
);
|
|
@@ -1241,26 +1248,26 @@ function DepositNotification({
|
|
|
1241
1248
|
const lastEvent = data.lastEvent;
|
|
1242
1249
|
const eventForTx = isEventForTx(lastEvent, txHash) ? lastEvent : void 0;
|
|
1243
1250
|
const awaitingPostBridgeSwap = depositContextRef.current.hasPostBridgeActions;
|
|
1244
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
1245
|
-
const swapTxHash = _optionalChain([eventForTx, 'access',
|
|
1251
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _36 => _36.type]) === "post-bridge-swap-complete") {
|
|
1252
|
+
const swapTxHash = _optionalChain([eventForTx, 'access', _37 => _37.data, 'optionalAccess', _38 => _38.swap, 'optionalAccess', _39 => _39.transactionHash]);
|
|
1246
1253
|
handleComplete(swapTxHash);
|
|
1247
1254
|
return;
|
|
1248
1255
|
}
|
|
1249
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
1256
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _40 => _40.type]) === "post-bridge-swap-failed") {
|
|
1250
1257
|
handleFailed(formatBridgeFailedMessage(eventForTx));
|
|
1251
1258
|
return;
|
|
1252
1259
|
}
|
|
1253
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
1254
|
-
const destTx = _optionalChain([eventForTx, 'access',
|
|
1260
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _41 => _41.type]) === "bridge-complete" && !awaitingPostBridgeSwap) {
|
|
1261
|
+
const destTx = _optionalChain([eventForTx, 'access', _42 => _42.data, 'optionalAccess', _43 => _43.destination, 'optionalAccess', _44 => _44.transactionHash]);
|
|
1255
1262
|
handleComplete(destTx);
|
|
1256
1263
|
return;
|
|
1257
1264
|
}
|
|
1258
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
1265
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _45 => _45.type]) === "bridge-failed") {
|
|
1259
1266
|
handleFailed(formatBridgeFailedMessage(eventForTx));
|
|
1260
1267
|
return;
|
|
1261
1268
|
}
|
|
1262
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
1263
|
-
const errorMessage = _nullishCoalesce(_optionalChain([eventForTx, 'access',
|
|
1269
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _46 => _46.type]) === "error") {
|
|
1270
|
+
const errorMessage = _nullishCoalesce(_optionalChain([eventForTx, 'access', _47 => _47.data, 'optionalAccess', _48 => _48.message]), () => ( "Unknown error"));
|
|
1264
1271
|
handleFailed(errorMessage);
|
|
1265
1272
|
return;
|
|
1266
1273
|
}
|
|
@@ -1298,11 +1305,11 @@ function DepositNotification({
|
|
|
1298
1305
|
status,
|
|
1299
1306
|
txHash
|
|
1300
1307
|
]);
|
|
1301
|
-
const sourceExplorerUrl = sourceChain === "unknown" ? void 0 :
|
|
1302
|
-
const destExplorerUrl = destinationTxHash ?
|
|
1308
|
+
const sourceExplorerUrl = sourceChain === "unknown" ? void 0 : _chunkABVRVW3Pcjs.getExplorerTxUrl.call(void 0, sourceChain, txHash);
|
|
1309
|
+
const destExplorerUrl = destinationTxHash ? _chunkABVRVW3Pcjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
|
|
1303
1310
|
const title = status === "complete" ? "Deposit completed" : status === "failed" ? "Deposit failed" : "Deposit received and processing\u2026";
|
|
1304
1311
|
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,
|
|
1312
|
+
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, _chunkOQVLEVNRcjs.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, _chunkOQVLEVNRcjs.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
1313
|
"svg",
|
|
1307
1314
|
{
|
|
1308
1315
|
className: "rs-deposit-notification-spinner",
|
|
@@ -1352,7 +1359,7 @@ function DepositNotification({
|
|
|
1352
1359
|
className: "rs-deposit-notification-close",
|
|
1353
1360
|
onClick: () => onDismiss(deposit.id),
|
|
1354
1361
|
"aria-label": "Dismiss",
|
|
1355
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1362
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.CloseIcon, {})
|
|
1356
1363
|
}
|
|
1357
1364
|
)
|
|
1358
1365
|
] }),
|
|
@@ -1368,7 +1375,7 @@ function DepositNotification({
|
|
|
1368
1375
|
"aria-expanded": expanded,
|
|
1369
1376
|
children: [
|
|
1370
1377
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: expanded ? "See less details" : "See more details" }),
|
|
1371
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1378
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.ChevronDownIcon, { className: "rs-deposit-notification-toggle-chevron" })
|
|
1372
1379
|
]
|
|
1373
1380
|
}
|
|
1374
1381
|
),
|
|
@@ -1457,7 +1464,7 @@ function asString(value) {
|
|
|
1457
1464
|
function resolveSolanaTokenMeta(token) {
|
|
1458
1465
|
if (!token) return {};
|
|
1459
1466
|
const normalized = token.toLowerCase();
|
|
1460
|
-
const matched =
|
|
1467
|
+
const matched = _chunkABVRVW3Pcjs.SOLANA_TOKENS.find(
|
|
1461
1468
|
(entry) => entry.mint.toLowerCase() === normalized
|
|
1462
1469
|
);
|
|
1463
1470
|
if (matched) {
|
|
@@ -1469,7 +1476,7 @@ function resolveSolanaTokenMeta(token) {
|
|
|
1469
1476
|
return {};
|
|
1470
1477
|
}
|
|
1471
1478
|
function getDepositEventDetails(event) {
|
|
1472
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
1479
|
+
if (!_optionalChain([event, 'optionalAccess', _49 => _49.type]) || !isRecord(event.data)) return {};
|
|
1473
1480
|
if (event.type === "deposit-received") {
|
|
1474
1481
|
const chainId = asChainId(event.data.chain);
|
|
1475
1482
|
const token = asString(event.data.token);
|
|
@@ -1484,12 +1491,12 @@ function getDepositEventDetails(event) {
|
|
|
1484
1491
|
const source = isRecord(event.data.source) ? event.data.source : void 0;
|
|
1485
1492
|
const deposit = isRecord(event.data.deposit) ? event.data.deposit : void 0;
|
|
1486
1493
|
if (source || deposit) {
|
|
1487
|
-
const chainId = _nullishCoalesce(asChainId(_optionalChain([source, 'optionalAccess',
|
|
1488
|
-
const token = _nullishCoalesce(_nullishCoalesce(asString(_optionalChain([source, 'optionalAccess',
|
|
1494
|
+
const chainId = _nullishCoalesce(asChainId(_optionalChain([source, 'optionalAccess', _50 => _50.chain])), () => ( asChainId(_optionalChain([deposit, 'optionalAccess', _51 => _51.chain]))));
|
|
1495
|
+
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
1496
|
const solanaMeta = chainId === "solana" ? resolveSolanaTokenMeta(token) : {};
|
|
1490
1497
|
return {
|
|
1491
1498
|
chainId,
|
|
1492
|
-
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess',
|
|
1499
|
+
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess', _55 => _55.amount])), () => ( asAmount(_optionalChain([deposit, 'optionalAccess', _56 => _56.amount])))),
|
|
1493
1500
|
token,
|
|
1494
1501
|
...solanaMeta
|
|
1495
1502
|
};
|
|
@@ -1500,7 +1507,7 @@ function isSameRoute(sourceChain, sourceToken, targetChain, targetToken) {
|
|
|
1500
1507
|
return sourceChain === targetChain && sourceToken.toLowerCase() === targetToken.toLowerCase();
|
|
1501
1508
|
}
|
|
1502
1509
|
function computeTokensForChain(chainId, allowedTokenSet) {
|
|
1503
|
-
const all = chainId === "solana" ?
|
|
1510
|
+
const all = chainId === "solana" ? _chunkABVRVW3Pcjs.SOLANA_TOKENS.map((t) => t.symbol) : _chunkABVRVW3Pcjs.getTargetTokenSymbolsForChain.call(void 0, chainId);
|
|
1504
1511
|
return allowedTokenSet ? all.filter((s) => allowedTokenSet.has(s.toUpperCase())) : all;
|
|
1505
1512
|
}
|
|
1506
1513
|
function pickFallbackToken(tokens, current) {
|
|
@@ -1525,15 +1532,15 @@ function DepositAddressStep({
|
|
|
1525
1532
|
}) {
|
|
1526
1533
|
const hasSolana = Boolean(solanaDepositAddress);
|
|
1527
1534
|
const allowedChainSet = _react.useMemo.call(void 0,
|
|
1528
|
-
() => _optionalChain([allowedRoutes, 'optionalAccess',
|
|
1529
|
-
[_optionalChain([allowedRoutes, 'optionalAccess',
|
|
1535
|
+
() => _optionalChain([allowedRoutes, 'optionalAccess', _57 => _57.sourceChains]) ? new Set(allowedRoutes.sourceChains) : null,
|
|
1536
|
+
[_optionalChain([allowedRoutes, 'optionalAccess', _58 => _58.sourceChains])]
|
|
1530
1537
|
);
|
|
1531
1538
|
const allowedTokenSet = _react.useMemo.call(void 0,
|
|
1532
|
-
() => _optionalChain([allowedRoutes, 'optionalAccess',
|
|
1533
|
-
[_optionalChain([allowedRoutes, 'optionalAccess',
|
|
1539
|
+
() => _optionalChain([allowedRoutes, 'optionalAccess', _59 => _59.sourceTokens]) ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null,
|
|
1540
|
+
[_optionalChain([allowedRoutes, 'optionalAccess', _60 => _60.sourceTokens])]
|
|
1534
1541
|
);
|
|
1535
1542
|
const evmChainIds = _react.useMemo.call(void 0, () => {
|
|
1536
|
-
const all =
|
|
1543
|
+
const all = _chunkABVRVW3Pcjs.getSupportedChainIds.call(void 0, );
|
|
1537
1544
|
return allowedChainSet ? all.filter((id) => allowedChainSet.has(id)) : all;
|
|
1538
1545
|
}, [allowedChainSet]);
|
|
1539
1546
|
const chainOptions = _react.useMemo.call(void 0, () => {
|
|
@@ -1571,7 +1578,7 @@ function DepositAddressStep({
|
|
|
1571
1578
|
setLiquidityHelper({ kind: "idle" });
|
|
1572
1579
|
return;
|
|
1573
1580
|
}
|
|
1574
|
-
const sourceTokenAddress =
|
|
1581
|
+
const sourceTokenAddress = _chunkABVRVW3Pcjs.getTokenAddress.call(void 0,
|
|
1575
1582
|
sourceTokenSymbol,
|
|
1576
1583
|
sourceChainId
|
|
1577
1584
|
);
|
|
@@ -1622,8 +1629,8 @@ function DepositAddressStep({
|
|
|
1622
1629
|
function handlePointerDown(event) {
|
|
1623
1630
|
const target = event.target;
|
|
1624
1631
|
if (!target) return;
|
|
1625
|
-
const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access',
|
|
1626
|
-
const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access',
|
|
1632
|
+
const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access', _61 => _61.current, 'optionalAccess', _62 => _62.contains, 'call', _63 => _63(target)]);
|
|
1633
|
+
const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access', _64 => _64.current, 'optionalAccess', _65 => _65.contains, 'call', _66 => _66(target)]);
|
|
1627
1634
|
if (clickedChainDropdown || clickedTokenDropdown) return;
|
|
1628
1635
|
setChainDropdownOpen(false);
|
|
1629
1636
|
setTokenDropdownOpen(false);
|
|
@@ -1636,7 +1643,7 @@ function DepositAddressStep({
|
|
|
1636
1643
|
};
|
|
1637
1644
|
}, [chainDropdownOpen, tokenDropdownOpen]);
|
|
1638
1645
|
const handleCopy = _react.useCallback.call(void 0, async () => {
|
|
1639
|
-
_optionalChain([onCopyAddress, 'optionalCall',
|
|
1646
|
+
_optionalChain([onCopyAddress, 'optionalCall', _67 => _67()]);
|
|
1640
1647
|
try {
|
|
1641
1648
|
await navigator.clipboard.writeText(displayAddress);
|
|
1642
1649
|
setCopied(true);
|
|
@@ -1715,10 +1722,10 @@ function DepositAddressStep({
|
|
|
1715
1722
|
return;
|
|
1716
1723
|
}
|
|
1717
1724
|
const event = status.lastEvent;
|
|
1718
|
-
const eventTxHash =
|
|
1725
|
+
const eventTxHash = _chunkOQVLEVNRcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkOQVLEVNRcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
1719
1726
|
if (baselineTxHashRef.current === void 0) {
|
|
1720
1727
|
baselineTxHashRef.current = eventTxHash;
|
|
1721
|
-
} else if (eventTxHash && (!baselineTxHashRef.current || !
|
|
1728
|
+
} else if (eventTxHash && (!baselineTxHashRef.current || !_chunkOQVLEVNRcjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
|
|
1722
1729
|
const details = getDepositEventDetails(event);
|
|
1723
1730
|
const chainId = _nullishCoalesce(details.chainId, () => ( "unknown"));
|
|
1724
1731
|
const amount = _nullishCoalesce(details.amount, () => ( "0"));
|
|
@@ -1727,7 +1734,7 @@ function DepositAddressStep({
|
|
|
1727
1734
|
baselineTxHashRef.current = eventTxHash;
|
|
1728
1735
|
isTrackingRef.current = true;
|
|
1729
1736
|
const isEvmToken = token ? /^0x[a-fA-F0-9]{40}$/.test(token) : false;
|
|
1730
|
-
const sourceDecimals = _nullishCoalesce(details.sourceDecimals, () => ( (isEvmToken ?
|
|
1737
|
+
const sourceDecimals = _nullishCoalesce(details.sourceDecimals, () => ( (isEvmToken ? _chunkABVRVW3Pcjs.findTokenDecimals.call(void 0,
|
|
1731
1738
|
token,
|
|
1732
1739
|
typeof chainId === "number" ? chainId : void 0
|
|
1733
1740
|
) : void 0)));
|
|
@@ -1750,7 +1757,7 @@ function DepositAddressStep({
|
|
|
1750
1757
|
directTransfer
|
|
1751
1758
|
};
|
|
1752
1759
|
setNotifications((prev) => [notification, ...prev]);
|
|
1753
|
-
_optionalChain([onDepositSubmittedRef, 'access',
|
|
1760
|
+
_optionalChain([onDepositSubmittedRef, 'access', _68 => _68.current, 'optionalCall', _69 => _69({
|
|
1754
1761
|
txHash: eventTxHash,
|
|
1755
1762
|
sourceChain: chainId,
|
|
1756
1763
|
amount,
|
|
@@ -1762,7 +1769,7 @@ function DepositAddressStep({
|
|
|
1762
1769
|
if (!cancelled) {
|
|
1763
1770
|
const msg = err instanceof Error ? err.message : "Failed to check status";
|
|
1764
1771
|
setPollingError(msg);
|
|
1765
|
-
_optionalChain([onErrorRef, 'access',
|
|
1772
|
+
_optionalChain([onErrorRef, 'access', _70 => _70.current, 'optionalCall', _71 => _71(msg, "STATUS_POLL_ERROR")]);
|
|
1766
1773
|
}
|
|
1767
1774
|
}
|
|
1768
1775
|
if (!cancelled) {
|
|
@@ -1778,24 +1785,24 @@ function DepositAddressStep({
|
|
|
1778
1785
|
const handleNotificationComplete = _react.useCallback.call(void 0,
|
|
1779
1786
|
(txHash, destinationTxHash, context) => {
|
|
1780
1787
|
isTrackingRef.current = false;
|
|
1781
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
1788
|
+
_optionalChain([onDepositCompleteRef, 'access', _72 => _72.current, 'optionalCall', _73 => _73(txHash, destinationTxHash, context)]);
|
|
1782
1789
|
},
|
|
1783
1790
|
[]
|
|
1784
1791
|
);
|
|
1785
1792
|
const handleNotificationFailed = _react.useCallback.call(void 0,
|
|
1786
1793
|
(txHash, error) => {
|
|
1787
1794
|
isTrackingRef.current = false;
|
|
1788
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
1795
|
+
_optionalChain([onDepositFailedRef, 'access', _74 => _74.current, 'optionalCall', _75 => _75(txHash, error)]);
|
|
1789
1796
|
},
|
|
1790
1797
|
[]
|
|
1791
1798
|
);
|
|
1792
1799
|
const handleNotificationDismiss = _react.useCallback.call(void 0, (id) => {
|
|
1793
1800
|
setNotifications((prev) => prev.filter((n) => n.id !== id));
|
|
1794
1801
|
}, []);
|
|
1795
|
-
const qrIconSrc =
|
|
1802
|
+
const qrIconSrc = _chunkABVRVW3Pcjs.getChainIcon.call(void 0, sourceChainId);
|
|
1796
1803
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-step--with-notifications", children: [
|
|
1797
1804
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
1798
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1805
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
1799
1806
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", children: [
|
|
1800
1807
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", ref: chainDropdownRef, children: [
|
|
1801
1808
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
@@ -1810,16 +1817,16 @@ function DepositAddressStep({
|
|
|
1810
1817
|
setTokenDropdownOpen(false);
|
|
1811
1818
|
},
|
|
1812
1819
|
children: [
|
|
1813
|
-
|
|
1820
|
+
_chunkABVRVW3Pcjs.getChainIcon.call(void 0, sourceChainId) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1814
1821
|
"img",
|
|
1815
1822
|
{
|
|
1816
|
-
src:
|
|
1823
|
+
src: _chunkABVRVW3Pcjs.getChainIcon.call(void 0, sourceChainId),
|
|
1817
1824
|
alt: "",
|
|
1818
1825
|
className: "rs-deposit-address-dropdown-icon"
|
|
1819
1826
|
}
|
|
1820
1827
|
),
|
|
1821
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children:
|
|
1822
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1828
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunkABVRVW3Pcjs.getChainName.call(void 0, sourceChainId) }),
|
|
1829
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
1823
1830
|
]
|
|
1824
1831
|
}
|
|
1825
1832
|
),
|
|
@@ -1830,15 +1837,15 @@ function DepositAddressStep({
|
|
|
1830
1837
|
className: `rs-deposit-address-dropdown-item ${chainId === sourceChainId ? "rs-deposit-address-dropdown-item--active" : ""}`,
|
|
1831
1838
|
onClick: () => handleSelectChain(chainId),
|
|
1832
1839
|
children: [
|
|
1833
|
-
|
|
1840
|
+
_chunkABVRVW3Pcjs.getChainIcon.call(void 0, chainId) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1834
1841
|
"img",
|
|
1835
1842
|
{
|
|
1836
|
-
src:
|
|
1843
|
+
src: _chunkABVRVW3Pcjs.getChainIcon.call(void 0, chainId),
|
|
1837
1844
|
alt: "",
|
|
1838
1845
|
className: "rs-deposit-address-dropdown-icon"
|
|
1839
1846
|
}
|
|
1840
1847
|
),
|
|
1841
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children:
|
|
1848
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunkABVRVW3Pcjs.getChainName.call(void 0, chainId) })
|
|
1842
1849
|
]
|
|
1843
1850
|
},
|
|
1844
1851
|
String(chainId)
|
|
@@ -1849,9 +1856,9 @@ function DepositAddressStep({
|
|
|
1849
1856
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Supported token" }),
|
|
1850
1857
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
1851
1858
|
"Min.$",
|
|
1852
|
-
(targetChain ===
|
|
1853
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1854
|
-
|
|
1859
|
+
(targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID ? Math.max(_chunkABVRVW3Pcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _76 => _76.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _77 => _77.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
1860
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1861
|
+
_chunkOQVLEVNRcjs.InfoIcon,
|
|
1855
1862
|
{
|
|
1856
1863
|
className: "rs-deposit-address-min-icon",
|
|
1857
1864
|
"aria-hidden": "true"
|
|
@@ -1870,16 +1877,16 @@ function DepositAddressStep({
|
|
|
1870
1877
|
setChainDropdownOpen(false);
|
|
1871
1878
|
},
|
|
1872
1879
|
children: [
|
|
1873
|
-
|
|
1880
|
+
_chunkABVRVW3Pcjs.getTokenIcon.call(void 0, sourceTokenSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1874
1881
|
"img",
|
|
1875
1882
|
{
|
|
1876
|
-
src:
|
|
1883
|
+
src: _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, sourceTokenSymbol),
|
|
1877
1884
|
alt: "",
|
|
1878
1885
|
className: "rs-deposit-address-dropdown-icon"
|
|
1879
1886
|
}
|
|
1880
1887
|
),
|
|
1881
1888
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceTokenSymbol }),
|
|
1882
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1889
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
1883
1890
|
]
|
|
1884
1891
|
}
|
|
1885
1892
|
),
|
|
@@ -1893,10 +1900,10 @@ function DepositAddressStep({
|
|
|
1893
1900
|
setTokenDropdownOpen(false);
|
|
1894
1901
|
},
|
|
1895
1902
|
children: [
|
|
1896
|
-
|
|
1903
|
+
_chunkABVRVW3Pcjs.getTokenIcon.call(void 0, symbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1897
1904
|
"img",
|
|
1898
1905
|
{
|
|
1899
|
-
src:
|
|
1906
|
+
src: _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, symbol),
|
|
1900
1907
|
alt: "",
|
|
1901
1908
|
className: "rs-deposit-address-dropdown-icon"
|
|
1902
1909
|
}
|
|
@@ -1930,7 +1937,7 @@ function DepositAddressStep({
|
|
|
1930
1937
|
className: "rs-deposit-address-copy",
|
|
1931
1938
|
onClick: handleCopy,
|
|
1932
1939
|
children: [
|
|
1933
|
-
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1940
|
+
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.CopyIcon, {}),
|
|
1934
1941
|
copied ? "Copied!" : "Copy address"
|
|
1935
1942
|
]
|
|
1936
1943
|
}
|
|
@@ -1938,7 +1945,7 @@ function DepositAddressStep({
|
|
|
1938
1945
|
]
|
|
1939
1946
|
}
|
|
1940
1947
|
),
|
|
1941
|
-
targetChain ===
|
|
1948
|
+
targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.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
1949
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1943
1950
|
"div",
|
|
1944
1951
|
{
|
|
@@ -1956,16 +1963,16 @@ function DepositAddressStep({
|
|
|
1956
1963
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
|
|
1957
1964
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
|
|
1958
1965
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1959
|
-
|
|
1966
|
+
_chunkOQVLEVNRcjs.Tooltip,
|
|
1960
1967
|
{
|
|
1961
1968
|
className: "rs-price-impact-info",
|
|
1962
1969
|
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,
|
|
1970
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.InfoIcon, { "aria-hidden": "true" })
|
|
1964
1971
|
}
|
|
1965
1972
|
)
|
|
1966
1973
|
] }),
|
|
1967
1974
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1968
|
-
|
|
1975
|
+
_chunkOQVLEVNRcjs.ChevronDownIcon,
|
|
1969
1976
|
{
|
|
1970
1977
|
className: "rs-price-impact-chevron",
|
|
1971
1978
|
"aria-hidden": "true"
|
|
@@ -1976,29 +1983,29 @@ function DepositAddressStep({
|
|
|
1976
1983
|
),
|
|
1977
1984
|
/* @__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
1985
|
/* @__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,
|
|
1986
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.PercentIcon, {}) }),
|
|
1980
1987
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
1981
1988
|
"Max slippage: ",
|
|
1982
1989
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.2%" })
|
|
1983
1990
|
] }),
|
|
1984
1991
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1985
|
-
|
|
1992
|
+
_chunkOQVLEVNRcjs.Tooltip,
|
|
1986
1993
|
{
|
|
1987
1994
|
className: "rs-price-impact-info",
|
|
1988
1995
|
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,
|
|
1996
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.InfoIcon, { "aria-hidden": "true" })
|
|
1990
1997
|
}
|
|
1991
1998
|
)
|
|
1992
1999
|
] }),
|
|
1993
2000
|
/* @__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,
|
|
2001
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.ClockIcon, {}) }),
|
|
1995
2002
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
1996
2003
|
"Processing time: ",
|
|
1997
2004
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "< 1 min" })
|
|
1998
2005
|
] })
|
|
1999
2006
|
] }),
|
|
2000
2007
|
/* @__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,
|
|
2008
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.PlusCircleIcon, {}) }),
|
|
2002
2009
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
2003
2010
|
"Max deposit:",
|
|
2004
2011
|
" ",
|
|
@@ -2030,7 +2037,7 @@ function DepositAddressStep({
|
|
|
2030
2037
|
},
|
|
2031
2038
|
deposit.id
|
|
2032
2039
|
)) }),
|
|
2033
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2040
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.PoweredBy, {})
|
|
2034
2041
|
] });
|
|
2035
2042
|
}
|
|
2036
2043
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -2041,12 +2048,28 @@ DepositAddressStep.displayName = "DepositAddressStep";
|
|
|
2041
2048
|
// src/components/steps/SwappedIframeStep.tsx
|
|
2042
2049
|
|
|
2043
2050
|
|
|
2051
|
+
// src/components/steps/FinalisingDepositStep.tsx
|
|
2052
|
+
|
|
2053
|
+
function FinalisingDepositStep() {
|
|
2054
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-finalising", children: [
|
|
2055
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-finalising-body", children: [
|
|
2056
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-finalising-spinner", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.Spinner, {}) }),
|
|
2057
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-finalising-text", children: [
|
|
2058
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h2", { className: "rs-finalising-title", children: "Finalising deposit" }),
|
|
2059
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "rs-finalising-subtitle", children: "We are depositing your funds to the application." })
|
|
2060
|
+
] })
|
|
2061
|
+
] }),
|
|
2062
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.PoweredBy, {})
|
|
2063
|
+
] });
|
|
2064
|
+
}
|
|
2065
|
+
FinalisingDepositStep.displayName = "FinalisingDepositStep";
|
|
2066
|
+
|
|
2044
2067
|
// src/components/steps/SwappedOrderTracker.tsx
|
|
2045
2068
|
|
|
2046
2069
|
var STEP_LABELS = [
|
|
2047
2070
|
"Payment received",
|
|
2048
2071
|
null,
|
|
2049
|
-
"Processing
|
|
2072
|
+
"Processing deposit",
|
|
2050
2073
|
"Deposit successful"
|
|
2051
2074
|
];
|
|
2052
2075
|
function SwappedOrderTracker({
|
|
@@ -2067,7 +2090,7 @@ function SwappedOrderTracker({
|
|
|
2067
2090
|
];
|
|
2068
2091
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-swapped-tracker", children: [
|
|
2069
2092
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2070
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2093
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.HandCoinsIcon, {}), title }),
|
|
2071
2094
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ol", { className: "rs-swapped-tracker-steps", children: labels.map((label, idx) => {
|
|
2072
2095
|
const status = stepStates[idx];
|
|
2073
2096
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
@@ -2081,7 +2104,7 @@ function SwappedOrderTracker({
|
|
|
2081
2104
|
{
|
|
2082
2105
|
className: "rs-swapped-tracker-step-marker",
|
|
2083
2106
|
"aria-hidden": "true",
|
|
2084
|
-
children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2107
|
+
children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.CheckIcon, {}) : status === "failed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.CloseIcon, {}) : status === "active" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.Spinner, {}) : null
|
|
2085
2108
|
}
|
|
2086
2109
|
)
|
|
2087
2110
|
]
|
|
@@ -2108,7 +2131,7 @@ function SwappedOrderTracker({
|
|
|
2108
2131
|
}
|
|
2109
2132
|
)
|
|
2110
2133
|
] }),
|
|
2111
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2134
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.PoweredBy, {})
|
|
2112
2135
|
] });
|
|
2113
2136
|
}
|
|
2114
2137
|
function formatTrackerAmount(amount) {
|
|
@@ -2226,7 +2249,7 @@ function SwappedIframeStep({
|
|
|
2226
2249
|
if (cancelled) return;
|
|
2227
2250
|
const message = err instanceof Error ? err.message : loadErrorFallback;
|
|
2228
2251
|
setLoadError(message);
|
|
2229
|
-
_optionalChain([onErrorRef, 'access',
|
|
2252
|
+
_optionalChain([onErrorRef, 'access', _78 => _78.current, 'optionalCall', _79 => _79(message, loadErrorCode)]);
|
|
2230
2253
|
});
|
|
2231
2254
|
return () => {
|
|
2232
2255
|
cancelled = true;
|
|
@@ -2272,10 +2295,10 @@ function SwappedIframeStep({
|
|
|
2272
2295
|
const status = await service.fetchLatestStatus(smartAccount);
|
|
2273
2296
|
if (cancelled) return;
|
|
2274
2297
|
const event = status.lastEvent;
|
|
2275
|
-
const eventTxHash =
|
|
2298
|
+
const eventTxHash = _chunkOQVLEVNRcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkOQVLEVNRcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
2276
2299
|
if (baselineDepositTxHashRef.current === void 0) {
|
|
2277
2300
|
baselineDepositTxHashRef.current = eventTxHash;
|
|
2278
|
-
} else if (eventTxHash && (!baselineDepositTxHashRef.current || !
|
|
2301
|
+
} else if (eventTxHash && (!baselineDepositTxHashRef.current || !_chunkOQVLEVNRcjs.txRefsMatch.call(void 0, eventTxHash, baselineDepositTxHashRef.current))) {
|
|
2279
2302
|
currentDepositTxHashRef.current = eventTxHash;
|
|
2280
2303
|
setLatestEvent(_nullishCoalesce(event, () => ( null)));
|
|
2281
2304
|
}
|
|
@@ -2300,10 +2323,10 @@ function SwappedIframeStep({
|
|
|
2300
2323
|
}, [service, smartAccount]);
|
|
2301
2324
|
_react.useEffect.call(void 0, () => {
|
|
2302
2325
|
if (fastDepositPollEnabledRef.current) return;
|
|
2303
|
-
const status = _optionalChain([orderState, 'optionalAccess',
|
|
2326
|
+
const status = _optionalChain([orderState, 'optionalAccess', _80 => _80.status]);
|
|
2304
2327
|
if (!status || !SWAPPED_TERMINAL_STATUSES.has(status)) return;
|
|
2305
2328
|
fastDepositPollEnabledRef.current = true;
|
|
2306
|
-
_optionalChain([rescheduleDepositPollRef, 'access',
|
|
2329
|
+
_optionalChain([rescheduleDepositPollRef, 'access', _81 => _81.current, 'optionalCall', _82 => _82(DEPOSIT_POLL_FAST_INITIAL_DELAY_MS)]);
|
|
2307
2330
|
}, [orderState]);
|
|
2308
2331
|
_react.useEffect.call(void 0, () => {
|
|
2309
2332
|
function onMessage(e) {
|
|
@@ -2311,16 +2334,16 @@ function SwappedIframeStep({
|
|
|
2311
2334
|
const parsed = parseSwappedIframeMessage(e.data);
|
|
2312
2335
|
if (!parsed) return;
|
|
2313
2336
|
setOrderState((prev) => ({
|
|
2314
|
-
orderId: _nullishCoalesce(_nullishCoalesce(parsed.orderId, () => ( _optionalChain([prev, 'optionalAccess',
|
|
2337
|
+
orderId: _nullishCoalesce(_nullishCoalesce(parsed.orderId, () => ( _optionalChain([prev, 'optionalAccess', _83 => _83.orderId]))), () => ( "")),
|
|
2315
2338
|
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',
|
|
2339
|
+
orderCrypto: _nullishCoalesce(_nullishCoalesce(parsed.orderCrypto, () => ( _optionalChain([prev, 'optionalAccess', _84 => _84.orderCrypto]))), () => ( null)),
|
|
2340
|
+
orderCryptoAmount: _nullishCoalesce(_nullishCoalesce(parsed.orderCryptoAmount, () => ( _optionalChain([prev, 'optionalAccess', _85 => _85.orderCryptoAmount]))), () => ( null)),
|
|
2341
|
+
transactionId: _nullishCoalesce(_nullishCoalesce(parsed.transactionId, () => ( _optionalChain([prev, 'optionalAccess', _86 => _86.transactionId]))), () => ( null)),
|
|
2319
2342
|
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',
|
|
2343
|
+
paidAmountUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _87 => _87.paidAmountUsd]), () => ( null)),
|
|
2344
|
+
paidAmountEur: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _88 => _88.paidAmountEur]), () => ( null)),
|
|
2345
|
+
onrampFeeUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _89 => _89.onrampFeeUsd]), () => ( null)),
|
|
2346
|
+
paymentMethod: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _90 => _90.paymentMethod]), () => ( null))
|
|
2324
2347
|
}));
|
|
2325
2348
|
}
|
|
2326
2349
|
window.addEventListener("message", onMessage);
|
|
@@ -2332,17 +2355,17 @@ function SwappedIframeStep({
|
|
|
2332
2355
|
}
|
|
2333
2356
|
}, [phase, orderState]);
|
|
2334
2357
|
const stepStates = _react.useMemo.call(void 0,
|
|
2335
|
-
() => deriveStepStates(_nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
2358
|
+
() => deriveStepStates(_nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _91 => _91.status]), () => ( null)), latestEvent),
|
|
2336
2359
|
[orderState, latestEvent]
|
|
2337
2360
|
);
|
|
2338
2361
|
const terminalState = _react.useMemo.call(void 0, () => {
|
|
2339
|
-
if (
|
|
2362
|
+
if (_chunkOQVLEVNRcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
|
|
2340
2363
|
return {
|
|
2341
2364
|
kind: "failed",
|
|
2342
|
-
message:
|
|
2365
|
+
message: _chunkOQVLEVNRcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
|
|
2343
2366
|
};
|
|
2344
2367
|
}
|
|
2345
|
-
if (_optionalChain([orderState, 'optionalAccess',
|
|
2368
|
+
if (_optionalChain([orderState, 'optionalAccess', _92 => _92.status]) === "order_cancelled") {
|
|
2346
2369
|
const banner = bannerForStatus("order_cancelled", {});
|
|
2347
2370
|
return { kind: "cancelled", message: _nullishCoalesce(banner.detail, () => ( banner.title)) };
|
|
2348
2371
|
}
|
|
@@ -2350,7 +2373,7 @@ function SwappedIframeStep({
|
|
|
2350
2373
|
}, [latestEvent, orderState, bannerForStatus]);
|
|
2351
2374
|
_react.useEffect.call(void 0, () => {
|
|
2352
2375
|
if (completeFiredRef.current || failedFiredRef.current) return;
|
|
2353
|
-
const t = _optionalChain([latestEvent, 'optionalAccess',
|
|
2376
|
+
const t = _optionalChain([latestEvent, 'optionalAccess', _93 => _93.type]);
|
|
2354
2377
|
const isSuccess = t === "bridge-complete" || t === "post-bridge-swap-complete";
|
|
2355
2378
|
if (!isSuccess) return;
|
|
2356
2379
|
const txHash = currentDepositTxHashRef.current;
|
|
@@ -2358,30 +2381,34 @@ function SwappedIframeStep({
|
|
|
2358
2381
|
completeFiredRef.current = true;
|
|
2359
2382
|
onSwappedCompleteRef.current({
|
|
2360
2383
|
txHash,
|
|
2361
|
-
orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
2384
|
+
orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _94 => _94.orderCrypto]), () => ( null)),
|
|
2362
2385
|
// Base-unit source amount from the deposit row/event, consistent with the
|
|
2363
2386
|
// wallet/QR path. ProcessingStep + onLifecycle expect base units.
|
|
2364
|
-
amount: _nullishCoalesce(
|
|
2387
|
+
amount: _nullishCoalesce(_chunkOQVLEVNRcjs.getEventSourceDetails.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0))).amount, () => ( null))
|
|
2365
2388
|
});
|
|
2366
2389
|
}, [latestEvent, orderState]);
|
|
2367
2390
|
_react.useEffect.call(void 0, () => {
|
|
2368
2391
|
if (failedFiredRef.current || completeFiredRef.current) return;
|
|
2369
|
-
if (!
|
|
2392
|
+
if (!_chunkOQVLEVNRcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) return;
|
|
2370
2393
|
const txHash = currentDepositTxHashRef.current;
|
|
2371
2394
|
if (!txHash) return;
|
|
2372
2395
|
failedFiredRef.current = true;
|
|
2373
2396
|
setPhase("tracker");
|
|
2374
|
-
_optionalChain([onSwappedFailedRef, 'access',
|
|
2397
|
+
_optionalChain([onSwappedFailedRef, 'access', _95 => _95.current, 'optionalCall', _96 => _96(
|
|
2375
2398
|
txHash,
|
|
2376
|
-
|
|
2399
|
+
_chunkOQVLEVNRcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
|
|
2377
2400
|
)]);
|
|
2378
2401
|
}, [latestEvent]);
|
|
2379
2402
|
if (phase === "tracker") {
|
|
2403
|
+
const paymentReceived = stepStates[0] === "complete";
|
|
2404
|
+
if (variant === "connect" && !terminalState && paymentReceived) {
|
|
2405
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FinalisingDepositStep, {});
|
|
2406
|
+
}
|
|
2380
2407
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2381
2408
|
SwappedOrderTracker,
|
|
2382
2409
|
{
|
|
2383
|
-
amount: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
2384
|
-
currency: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
2410
|
+
amount: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _97 => _97.orderCryptoAmount]), () => ( null)),
|
|
2411
|
+
currency: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _98 => _98.orderCrypto]), () => ( "USDC")),
|
|
2385
2412
|
stepStates,
|
|
2386
2413
|
terminal: terminalState,
|
|
2387
2414
|
onRetry: () => setRetryToken((n) => n + 1),
|
|
@@ -2392,9 +2419,9 @@ function SwappedIframeStep({
|
|
|
2392
2419
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-fiat-onramp", "data-variant": variant, children: [
|
|
2393
2420
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2394
2421
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2395
|
-
|
|
2422
|
+
_chunkOQVLEVNRcjs.BodyHeader,
|
|
2396
2423
|
{
|
|
2397
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2424
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.HandCoinsIcon, {}),
|
|
2398
2425
|
title: "Deposit",
|
|
2399
2426
|
subtitle: "Add money to your balance"
|
|
2400
2427
|
}
|
|
@@ -2412,7 +2439,7 @@ function SwappedIframeStep({
|
|
|
2412
2439
|
}
|
|
2413
2440
|
)
|
|
2414
2441
|
] }),
|
|
2415
|
-
!loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2442
|
+
!loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.Spinner, {}) }),
|
|
2416
2443
|
widgetUrl && !loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2417
2444
|
"iframe",
|
|
2418
2445
|
{
|
|
@@ -2427,11 +2454,11 @@ function SwappedIframeStep({
|
|
|
2427
2454
|
)
|
|
2428
2455
|
] })
|
|
2429
2456
|
] }),
|
|
2430
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2457
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.PoweredBy, {})
|
|
2431
2458
|
] });
|
|
2432
2459
|
}
|
|
2433
2460
|
function deriveStepStates(swappedStatus, latestEvent) {
|
|
2434
|
-
if (
|
|
2461
|
+
if (_chunkOQVLEVNRcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
|
|
2435
2462
|
return ["complete", "complete", "failed", "pending"];
|
|
2436
2463
|
}
|
|
2437
2464
|
if (swappedStatus === "order_cancelled") {
|
|
@@ -2439,7 +2466,7 @@ function deriveStepStates(swappedStatus, latestEvent) {
|
|
|
2439
2466
|
}
|
|
2440
2467
|
const step1Complete = swappedStatus === "order_completed" || swappedStatus === "order_broadcasted";
|
|
2441
2468
|
const step2Complete = latestEvent !== null;
|
|
2442
|
-
const step3Complete = _optionalChain([latestEvent, 'optionalAccess',
|
|
2469
|
+
const step3Complete = _optionalChain([latestEvent, 'optionalAccess', _99 => _99.type]) === "bridge-complete" || _optionalChain([latestEvent, 'optionalAccess', _100 => _100.type]) === "post-bridge-swap-complete";
|
|
2443
2470
|
if (step3Complete) {
|
|
2444
2471
|
return ["complete", "complete", "complete", "pending"];
|
|
2445
2472
|
}
|
|
@@ -2495,11 +2522,6 @@ function FiatOnrampStep({
|
|
|
2495
2522
|
smartAccount,
|
|
2496
2523
|
method: paymentMethod
|
|
2497
2524
|
});
|
|
2498
|
-
if (res.currencyCode !== "USDC_BASE") {
|
|
2499
|
-
console.warn(
|
|
2500
|
-
`[FiatOnrampStep] Expected backend to return currencyCode=USDC_BASE, got ${res.currencyCode}. Swapped purchases may not bridge as expected.`
|
|
2501
|
-
);
|
|
2502
|
-
}
|
|
2503
2525
|
return res;
|
|
2504
2526
|
}, [service, smartAccount, paymentMethod]);
|
|
2505
2527
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2568,11 +2590,6 @@ function ExchangeConnectStep({
|
|
|
2568
2590
|
smartAccount,
|
|
2569
2591
|
connection
|
|
2570
2592
|
});
|
|
2571
|
-
if (res.currencyCode !== "USDC_BASE") {
|
|
2572
|
-
console.warn(
|
|
2573
|
-
`[ExchangeConnectStep] Expected backend to return currencyCode=USDC_BASE, got ${res.currencyCode}. Swapped Connect pulls may not bridge as expected.`
|
|
2574
|
-
);
|
|
2575
|
-
}
|
|
2576
2593
|
return res;
|
|
2577
2594
|
}, [service, smartAccount, connection]);
|
|
2578
2595
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2598,10 +2615,114 @@ ExchangeConnectStep.displayName = "ExchangeConnectStep";
|
|
|
2598
2615
|
// src/components/steps/ExchangeSelectStep.tsx
|
|
2599
2616
|
|
|
2600
2617
|
|
|
2618
|
+
// src/components/ui/ExchangeLogos.tsx
|
|
2619
|
+
|
|
2620
|
+
var HTX_LOGO_DATA_URI = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXYAAACQCAMAAAAr6rB8AAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAACNUExURQAAAAAAPgAAPgAAPgAAQAAAPQAAPgAAPQAAPQAAPgAAOAAAPgAAPQAAPQAAPAAAOgAAPgAAPQAAPQAAQAAAQACK1QCM1QCNzwCL1gCL1gCM1QCM1gCL1gAAPgCL1wCK1ACL1QCL0wCM1gCM1QCM1ACL1AAAPQCM1gAAPgCM1gAAOgCM1gAAPgCM1v///6KyLqIAAAAsdFJOUwCAj88Qn6BQv+8g33CvQDCQT2AgUCBgEN+AkL/eb58wcECw71Cgvs/O7zGgm66ePgAAAAFiS0dELlTTEIcAAAAHdElNRQfoDAUMAwII1OX3AAAI7ElEQVR42u2dbWPaOBCEQ8Ml4UyAg5IQ0ru8kLS9Vv7/f+9CaArYs7sjg/GtrfmKjeXHYjVarcXZGa/ep4iDk46lXjjvN92GDqoXEvcG9IY9/NF0I7qnizfsodd0Kzqnd+zhsulmdE1X79gHfzbdjo5pgz1cNd2OjinbYA/DphvSLf2iHgbJRZ5Q/Q/s4brppnRJo9/Yw6jptnRIl1vsaVQ9nXohdfcGdL2D/bzpxnRHVyF19wY02MWeovuJNA4hdffT63Ife+rup9FkH3tIU9WT6LyAPSXeT6F+gXoYNN2iTuiyiD0NqqfQRQn7pOkmdUFZSFHm9BqHkKLM6TUB2CdNN6r9ygD2lA+rWyjGpBlT7bqA2P9qulktVz+D2CdNt6vlmkLqKR1Ws3BnT869XgmdPYRUl1enMgl7GlNrlNjZw7TpprVZYmdPVqZGyZ09vdtRn/pyZ08Osj71ZOopK1ObZgr1kDXdutYqS9gbkBZiEva6pIaYhL0m9bOEvQF9Cgn76dUzqCffXofGFvX07lgNmmUm9vSG6tFlDadrpUqZo+vcpp5KB44uy8QcPqKOpyUxv56+ddpseiSN1982Qp98pm5wfoOknmKamLUOW+XoVXuOYAa3n38e2Q3n9F7BPxugj5hB7XaRA90dTP3ApVQf2EGFeeB2d1ki6veHUz/QtTvBDss/iZT3DaL+Za6c8TfXrAMXsL1gx5bO2pxxDkOMFtmnXKsOzQx4wS5MG43h/x5R/+dw6uUBVfsBecZ+NkSf6uH9LjbEjAdco0qd/SF/bCn2/ff+mcbOEfX86XDq5c5+Y7gjx9hjXWS0dyQSMRuVI/uz5Ur9YscuMoylNkLv+OUI1IFnX5mzAb/YsYvMhOQI9I65HNh56pPSuS/ELMwv9hgXOY8NMUz6a/Ocy539mbCmfrELLhKmR6B3VKanTPpLutx27H5oJXbeRcZ6R3JyGmDJ6evvKyxI/+4MO3aRX5X+x01PZ3R7wFCya5m+tRM7dpHF8I69ozw9ZVaTfgn8svYG72UrsQsuspAkwN5RDgB8YEc7yew/Y2U65hg75SKf4qanbCYGlwsUnOritkHsiq4OOPdMCgiF8A5G1LvIb4RPF6WAigGNCTP+sAsuspAkKPlHZXrKLWyshWbE5SdMhBmH2AUXuY9kviqwUKanNHUU2MG0TF288osdu8hCeH9hQ4ywp0AgW/ma5xW6u0vslItckh2QHvxh8gdOEBbtxC64yP3/idn17trSBvzpAOEVlW8Iu52b8Ykdu8gCmIcVg4Hu7LAsB6c57ejuFDvlIh8/KGirp2xkhztu4jQnEd2dYhfW3wou8tkOMayNwVBeBepmd/eKHbvIQpLgV3jXuh7Z2eE8CU+GNzKmqm6xUy7yyfCOxjuQW+EChYWM/bGt2LGLLCRNlur0lB5Q8VbKS5m6FWX8YheQlZIE6sIDF2Nw85QQY0YZx9gpFzl/VL+CijE4sM8XKnb9up6xYxf5PeI1Cy7G4MD+qlJXTatv7IKLjPizcCr3iAP7jU49/7e92CkXGdmUknBxrxFi8lwfU3xjx9z4P5Nlah4rhZjcyMvwKX5LjWDHLvIrebb9zq8UYl5M6voik3PsnIuUdBlMCe8PmCEmz5/bjB27SLkeNfbmcYi5s6nrFTPusWMXmVEu8tq6J6Fhc4K6bmXcYz/7Ud1FmkYmqzqertVu7IKLZMK7WeSLx1Oqs+sOsgXYq7tIKzUgjKf3CftaP2B7vtsnWreEX3C35qddwS6kEe3wbtxRdfP4Lq3WvQXYh1KLzCRBpTt6Iqm3vLfPxBm+6SKNO8KjAxnZ245dGRetJIGeksG5qQeWeruxqzdguEjdyeABlfPsa1VutQPsn9U2DfQkge7bYYgiPXve7lmq9TKpHt7V5ACOMax7bHdOxpzeqy5yop2JA9Q3GnvsXkGDjND/AzvRaS6V04faidB+8jEmOt/uZ3WJqaTTkgRqvh2e8chjf2krdu6dI+V2+sppeEMsPsboL2R7xk7WL/bkb1CeG9zCNyLGtLZygH6tUU4SKA9ugo4nllA/pK7pOcY+Y7c6Ulyk8uTgb2TJY4/e4dMJdhggerD/int+K8EdYqfzMUaZjF/s0Dt+FYZZMUkg+36YGuCpt7TiFyYF1kufsIJDdJGy8UdPik+DWS+NOcWOkwLvPXSIPpHqUeUog4IMnWq3YoxX7DCb0hO/X04SiFFmAg7mEzJ6va9X7DA2fKzBYYsjuEix1Bo1ialKojq7T+w4KfA7fkdtfy3ZUDRLpbG38r1U063AzKJwW9Kgiv5inMZubjrgETv05rtfEeMi+1J3Z/d9qxDZXWKHU8v9sjkc3vFSk9TdwQ7tLHZ7ezx/2KkRcwgfDXSRUh5zUj6UdDLE5qf+sOOkQPEo6DDxZYSsO8DAZcLsbU0cYle941Yx4R1790H5t8HlfZmt8bxhp+f+EUkCIZcJnP6KoE7tr+wMu5IUKAq6SFyPOoTYJ+UDiQwkt+2pM+wRITsmSYBLtcvH2Uup5Ca/vrDjwC6kuSKSBPhHVD7UTEGuGt5auRbsRlKgKGzw4UOCr0pOysdZS9jUTrPOsPc577hVRJJgCI4EXsaYMDW+bX4d2OEGyFpVb4yL7FFH3q6OQt0TdiIpUBR8vWZAJwkACWURe8VTd4Qdj5DG/2cO4aPCYzBAUR5U5RnTiv2DCF/YYcCYVLiYuNRUZgFQSNGd/XsIZ9jJpECpofz8Cl2j3N2F6P6T2bXdH3a8+Ea8expVSTAkWKAp0+oxCrob7LO48pddxSw1la8DZlflDMF95P9HusFuLigp+o7OlSoJZoUrARjFreEXakm1Z+w4sJObJEVVErz51Mw6bq9cZhFhG51hx0kBekuwIXxoYj3qfodHNLZuZnUXN5R6wh6dFCgqrh717e52E51oAHmtHNQ/rjAqidl5qF8+bcZechx7LrjYmyJusj9F0l7iG23Bg8zM2e0mJfazIvQkUbOLTPlZve9H+Bz9pUmERhvyqLuv/wohbl6aFKHx9Dob4NexlzE5mKSt/gNCZI6GyUmWNAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyNC0xMi0wNVQxMjowMzowMiswMDowMLpM60QAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjQtMTItMDVUMTI6MDM6MDIrMDA6MDDLEVP4AAAAKHRFWHRkYXRlOnRpbWVzdGFtcAAyMDI0LTEyLTA1VDEyOjAzOjAyKzAwOjAwnARyJwAAAABJRU5ErkJggg==";
|
|
2621
|
+
function Tile({
|
|
2622
|
+
bg,
|
|
2623
|
+
children,
|
|
2624
|
+
fg = "#fff"
|
|
2625
|
+
}) {
|
|
2626
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { viewBox: "0 0 40 40", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
|
|
2627
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "rect", { width: "40", height: "40", fill: bg }),
|
|
2628
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "g", { color: fg, children })
|
|
2629
|
+
] });
|
|
2630
|
+
}
|
|
2631
|
+
function Icon({
|
|
2632
|
+
children,
|
|
2633
|
+
x = 8,
|
|
2634
|
+
y = 8,
|
|
2635
|
+
size = 24,
|
|
2636
|
+
viewBox = "0 0 24 24"
|
|
2637
|
+
}) {
|
|
2638
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { x, y, width: size, height: size, viewBox, children });
|
|
2639
|
+
}
|
|
2640
|
+
var LOGOS = {
|
|
2641
|
+
coinbase: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Tile, { bg: "#0052FF", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Icon, { x: 7, y: 7, size: 26, viewBox: "0 0 512 512", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2642
|
+
"path",
|
|
2643
|
+
{
|
|
2644
|
+
fill: "#fff",
|
|
2645
|
+
d: "M256.737 338.138c-45.081 0-81.512-36.531-81.512-81.513 0-44.98 36.53-81.512 81.512-81.512 40.356 0 73.863 29.387 80.306 67.925h82.113C412.212 159.313 342.175 93.5 256.637 93.5c-90.069 0-163.125 73.063-163.125 163.125 0 90.07 73.056 163.125 163.125 163.125 85.538 0 155.575-65.812 162.519-149.537h-82.213c-6.443 38.537-39.85 67.925-80.206 67.925z"
|
|
2646
|
+
}
|
|
2647
|
+
) }) }),
|
|
2648
|
+
binance: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Tile, { bg: "#181A20", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Icon, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2649
|
+
"path",
|
|
2650
|
+
{
|
|
2651
|
+
fill: "#F0B90B",
|
|
2652
|
+
d: "m16.624 13.920 2.718 2.716-7.353 7.353-7.353-7.353 2.717-2.716 4.636 4.66zm4.637-4.636L24 12l-2.715 2.716L18.568 12zm-9.272.001 2.716 2.691-2.716 2.717L9.272 12zm-9.273-.001L5.409 12l-2.692 2.692L0 12zM11.989.012l7.353 7.329-2.718 2.715-4.635-4.636-4.636 4.66-2.717-2.716z"
|
|
2653
|
+
}
|
|
2654
|
+
) }) }),
|
|
2655
|
+
bitfinex: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Tile, { bg: "#101914", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Icon, { x: 5, y: 8, size: 30, viewBox: "780 0 116 100", children: [
|
|
2656
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2657
|
+
"path",
|
|
2658
|
+
{
|
|
2659
|
+
fill: "#97C554",
|
|
2660
|
+
d: "m792.54 88.414c4.795 5.078 31.135 29.418 72.478 1.17C894.913 66.302 894.166 15.827 891.294.584c-1 2.219-35.724 78.26-98.754 87.83Z"
|
|
2661
|
+
}
|
|
2662
|
+
),
|
|
2663
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2664
|
+
"path",
|
|
2665
|
+
{
|
|
2666
|
+
fill: "#709B30",
|
|
2667
|
+
d: "M891.29.572c-.366-.152-38.827-5.395-76.85 19.094-23.61 15.207-26.731 37.464-25.654 52.295 55.273-6.185 101.25-69.646 102.504-71.39Z"
|
|
2668
|
+
}
|
|
2669
|
+
)
|
|
2670
|
+
] }) }),
|
|
2671
|
+
bybit: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Tile, { bg: "#16171A", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Icon, { x: 4, y: 4, size: 32, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "g", { fill: "none", children: [
|
|
2672
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { fill: "#F6A500", d: "M15.829 13.626V9h.93v4.626z" }),
|
|
2673
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2674
|
+
"path",
|
|
2675
|
+
{
|
|
2676
|
+
fill: "#fff",
|
|
2677
|
+
d: "M4.993 15H3v-4.626h1.913c.93 0 1.471.507 1.471 1.3 0 .513-.348.845-.588.955.287.13.655.423.655 1.04 0 .863-.609 1.33-1.458 1.33m-.154-3.82h-.91v1.065h.91c.395 0 .615-.214.615-.533 0-.317-.22-.532-.615-.532m.06 1.877h-.97v1.137h.97c.42 0 .622-.259.622-.571s-.201-.565-.622-.565zm4.388.046V15h-.923v-1.898l-1.431-2.728h1.01l.889 1.864.877-1.864h1.01zM13.355 15h-1.993v-4.626h1.913c.93 0 1.47.507 1.47 1.3 0 .513-.347.845-.588.955.287.13.655.423.655 1.04 0 .863-.608 1.33-1.457 1.33m-.155-3.82h-.91v1.065h.91c.395 0 .616-.214.616-.533 0-.317-.22-.532-.616-.532m.06 1.877h-.97v1.137h.97c.422 0 .622-.259.622-.571s-.2-.565-.622-.565zm6.495-1.876V15h-.929v-3.82h-1.245v-.806H21v.806z"
|
|
2678
|
+
}
|
|
2679
|
+
)
|
|
2680
|
+
] }) }) }),
|
|
2681
|
+
btcturk: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Tile, { bg: "#FFFFFF", fg: "#0D0D17", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Icon, { x: 7, y: 7, size: 26, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2682
|
+
"path",
|
|
2683
|
+
{
|
|
2684
|
+
fill: "currentColor",
|
|
2685
|
+
d: "M14.126 18.743c-1.05.742-1.67 1.67-1.38 2.072s1.365.128 2.414-.612 1.667-1.668 1.379-2.072c-.089-.12-.256-.186-.474-.186-.48 0-1.218.29-1.94.798m-5.76-1.584c-2.028.842-3.433 2.088-3.141 2.796.291.709 2.17.607 4.2-.23 2.03-.836 3.428-2.084 3.137-2.797-.13-.317-.576-.47-1.21-.47-.787 0-1.865.24-2.987.701m9.293-.84c-.36.683-.47 1.33-.251 1.44.22.11.685-.345 1.043-1.028s.47-1.33.25-1.44a.15.15 0 0 0-.074-.017c-.24 0-.648.433-.968 1.045m-2.927-1.891c-.695.4-1.058 1.073-.812 1.5s1.008.448 1.703.047c.695-.4 1.057-1.073.811-1.5-.128-.222-.396-.335-.72-.335-.346.01-.684.11-.981.288m2.568-.91c-.202.348-.188.735.03.86.218.127.56-.053.76-.404.202-.35.19-.735-.03-.861a.3.3 0 0 0-.155-.041c-.204 0-.447.17-.6.445m-2.592-1.499c0 .418.384.758.858.758s.858-.34.858-.758c0-.417-.384-.757-.858-.757s-.858.339-.858.757m-5.728 0c0 .938 1.057 1.697 2.361 1.697s2.36-.755 2.36-1.697-1.055-1.698-2.36-1.698-2.361.761-2.361 1.698m8.369-2.4c-.218.12-.232.513-.03.862.201.35.541.531.76.404.22-.127.232-.51.03-.861-.158-.274-.401-.446-.6-.446a.3.3 0 0 0-.155.041m-3.413-1.545c-.24.427.12 1.099.811 1.5.691.4 1.457.38 1.703-.047s-.12-1.098-.811-1.5a2 2 0 0 0-.983-.287c-.325 0-.593.112-.72.334m3.456-1.833c-.218.12-.107.762.25 1.44.358.678.825 1.144 1.045 1.029.22-.116.105-.762-.252-1.44-.32-.612-.73-1.046-.969-1.046a.2.2 0 0 0-.074.017M5.225 4.05c-.292.708 1.115 1.96 3.14 2.797s3.902.94 4.197.233-1.115-1.962-3.14-2.798c-1.123-.464-2.196-.702-2.988-.702-.633 0-1.08.154-1.21.47m7.51-.864c-.284.403.337 1.33 1.386 2.071s2.13 1.016 2.413.612c.283-.403-.336-1.33-1.387-2.071C14.427 3.289 13.692 3 13.21 3c-.219 0-.385.06-.48.186"
|
|
2686
|
+
}
|
|
2687
|
+
) }) }),
|
|
2688
|
+
gate: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Tile, { bg: "#FFFFFF", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Icon, { x: 7, y: 7, size: 26, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "g", { fill: "none", children: [
|
|
2689
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { fill: "#2354E6", d: "M12 16.95a4.95 4.95 0 1 1 0-9.9V3a9 9 0 1 0 9 9h-4.05A4.95 4.95 0 0 1 12 16.95" }),
|
|
2690
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { fill: "#17E6A1", d: "M16.95 7.05H12V12h4.95z" })
|
|
2691
|
+
] }) }) }),
|
|
2692
|
+
gateio: () => LOGOS.gate(),
|
|
2693
|
+
htx: () => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { viewBox: "0 0 40 40", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
|
|
2694
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "rect", { width: "40", height: "40", fill: "#fff" }),
|
|
2695
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "image", { href: HTX_LOGO_DATA_URI, x: "3", y: "12", width: "34", height: "13.1", preserveAspectRatio: "xMidYMid meet" })
|
|
2696
|
+
] }),
|
|
2697
|
+
kraken: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Tile, { bg: "#7133F5", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Icon, { x: 6, y: 6, size: 28, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2698
|
+
"path",
|
|
2699
|
+
{
|
|
2700
|
+
fill: "#fff",
|
|
2701
|
+
d: "M11.998 4.5C7.028 4.5 3 8.774 3 14.047v4.09c0 .753.575 1.363 1.285 1.363s1.288-.61 1.288-1.362v-4.091c0-.755.573-1.365 1.285-1.365.71 0 1.284.61 1.284 1.365v4.09c0 .753.575 1.363 1.285 1.363.712 0 1.286-.61 1.286-1.362v-4.091c0-.755.575-1.365 1.285-1.365.712 0 1.289.61 1.289 1.365v4.09c0 .753.574 1.363 1.284 1.363s1.285-.61 1.285-1.362v-4.091c0-.755.574-1.365 1.288-1.365.71 0 1.285.61 1.285 1.365v4.09c0 .753.575 1.363 1.287 1.363.71 0 1.284-.61 1.284-1.362v-4.091C21 8.774 16.97 4.5 11.998 4.5"
|
|
2702
|
+
}
|
|
2703
|
+
) }) }),
|
|
2704
|
+
kucoin: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Tile, { bg: "#01BC8D", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Icon, { x: 7, y: 7, size: 26, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2705
|
+
"path",
|
|
2706
|
+
{
|
|
2707
|
+
fill: "#fff",
|
|
2708
|
+
d: "m7.928 11.996 7.122 7.122 4.49-4.49a2.004 2.004 0 0 1 2.865 0 2.004 2.004 0 0 1 0 2.865l-5.918 5.918a2.058 2.058 0 0 1-2.883 0l-8.541-8.542v5.07a2.034 2.034 0 1 1-4.07 0V4.043a2.034 2.034 0 1 1 4.07 0v5.088L13.604.589a2.058 2.058 0 0 1 2.883 0l5.918 5.918c.785.803.785 2.088 0 2.865-.804.785-2.089.785-2.865 0l-4.49-4.49zM15.05 9.96a2.038 2.038 0 0 0-2.053 2.035c0 1.133.902 2.052 2.035 2.052a2.038 2.038 0 0 0 2.053-2.035v-.018a2.07 2.07 0 0 0-2.035-2.034z"
|
|
2709
|
+
}
|
|
2710
|
+
) }) })
|
|
2711
|
+
};
|
|
2712
|
+
function normalize(value) {
|
|
2713
|
+
return value.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
2714
|
+
}
|
|
2715
|
+
function getExchangeLogo(name, connection) {
|
|
2716
|
+
const render = _nullishCoalesce(LOGOS[normalize(name)], () => ( LOGOS[normalize(_nullishCoalesce(connection, () => ( "")))]));
|
|
2717
|
+
return render ? render() : null;
|
|
2718
|
+
}
|
|
2719
|
+
|
|
2720
|
+
// src/components/steps/ExchangeSelectStep.tsx
|
|
2721
|
+
|
|
2601
2722
|
function ExchangeLogo({ exchange }) {
|
|
2602
2723
|
const [failed, setFailed] = _react.useState.call(void 0, false);
|
|
2603
2724
|
if (!exchange.logoUrl || failed) {
|
|
2604
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2725
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.BankIcon, {});
|
|
2605
2726
|
}
|
|
2606
2727
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2607
2728
|
"img",
|
|
@@ -2636,7 +2757,7 @@ function ExchangeSelectStep({
|
|
|
2636
2757
|
const message = err instanceof Error ? err.message : "Failed to load exchanges";
|
|
2637
2758
|
setExchanges([]);
|
|
2638
2759
|
setError(message);
|
|
2639
|
-
_optionalChain([onError, 'optionalCall',
|
|
2760
|
+
_optionalChain([onError, 'optionalCall', _101 => _101(message, "SWAPPED_CONNECT_EXCHANGES_FAILED")]);
|
|
2640
2761
|
}).finally(() => {
|
|
2641
2762
|
if (!cancelled) setLoading(false);
|
|
2642
2763
|
});
|
|
@@ -2647,14 +2768,14 @@ function ExchangeSelectStep({
|
|
|
2647
2768
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-exchange-select", children: [
|
|
2648
2769
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2649
2770
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2650
|
-
|
|
2771
|
+
_chunkOQVLEVNRcjs.BodyHeader,
|
|
2651
2772
|
{
|
|
2652
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2653
|
-
title: "
|
|
2654
|
-
subtitle: "
|
|
2773
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.UnplugIcon, {}),
|
|
2774
|
+
title: "Connect exchange",
|
|
2775
|
+
subtitle: "Select an exchange to connect"
|
|
2655
2776
|
}
|
|
2656
2777
|
),
|
|
2657
|
-
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2778
|
+
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.Spinner, {}) }),
|
|
2658
2779
|
!loading && error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: [
|
|
2659
2780
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state-title", children: "Couldn\u2019t load exchanges" }),
|
|
2660
2781
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2679,22 +2800,31 @@ function ExchangeSelectStep({
|
|
|
2679
2800
|
}
|
|
2680
2801
|
)
|
|
2681
2802
|
] }),
|
|
2682
|
-
!loading && !error && exchanges.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-grid", children: exchanges.map((exchange) =>
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2803
|
+
!loading && !error && exchanges.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-grid", children: exchanges.map((exchange) => {
|
|
2804
|
+
const brand = getExchangeLogo(exchange.name, exchange.connection);
|
|
2805
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2806
|
+
"button",
|
|
2807
|
+
{
|
|
2808
|
+
type: "button",
|
|
2809
|
+
className: "rs-exchange-card",
|
|
2810
|
+
onClick: () => onSelectExchange(exchange.connection),
|
|
2811
|
+
"aria-label": `Select ${exchange.name}`,
|
|
2812
|
+
children: [
|
|
2813
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2814
|
+
"span",
|
|
2815
|
+
{
|
|
2816
|
+
className: `rs-exchange-card-logo${brand ? " rs-exchange-card-logo--brand" : ""}`,
|
|
2817
|
+
children: _nullishCoalesce(brand, () => ( /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExchangeLogo, { exchange })))
|
|
2818
|
+
}
|
|
2819
|
+
),
|
|
2820
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-exchange-card-name", children: exchange.name })
|
|
2821
|
+
]
|
|
2822
|
+
},
|
|
2823
|
+
exchange.connection
|
|
2824
|
+
);
|
|
2825
|
+
}) })
|
|
2696
2826
|
] }),
|
|
2697
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2827
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.PoweredBy, {})
|
|
2698
2828
|
] });
|
|
2699
2829
|
}
|
|
2700
2830
|
ExchangeSelectStep.displayName = "ExchangeSelectStep";
|
|
@@ -2706,25 +2836,25 @@ function DepositAddressSkeleton({
|
|
|
2706
2836
|
uiConfig,
|
|
2707
2837
|
allowedRoutes
|
|
2708
2838
|
}) {
|
|
2709
|
-
const allowedChainSet = _optionalChain([allowedRoutes, 'optionalAccess',
|
|
2710
|
-
const allowedTokenSet = _optionalChain([allowedRoutes, 'optionalAccess',
|
|
2839
|
+
const allowedChainSet = _optionalChain([allowedRoutes, 'optionalAccess', _102 => _102.sourceChains]) ? new Set(allowedRoutes.sourceChains) : null;
|
|
2840
|
+
const allowedTokenSet = _optionalChain([allowedRoutes, 'optionalAccess', _103 => _103.sourceTokens]) ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null;
|
|
2711
2841
|
const evmChainIds = (() => {
|
|
2712
|
-
const all =
|
|
2842
|
+
const all = _chunkABVRVW3Pcjs.getSupportedChainIds.call(void 0, );
|
|
2713
2843
|
return allowedChainSet ? all.filter((id) => allowedChainSet.has(id)) : all;
|
|
2714
2844
|
})();
|
|
2715
2845
|
const defaultChainId = evmChainIds.includes(BASE_CHAIN_ID) ? BASE_CHAIN_ID : evmChainIds[0];
|
|
2716
2846
|
const tokensForChain = (() => {
|
|
2717
|
-
const all =
|
|
2847
|
+
const all = _chunkABVRVW3Pcjs.getTargetTokenSymbolsForChain.call(void 0, defaultChainId);
|
|
2718
2848
|
return allowedTokenSet ? all.filter((s) => allowedTokenSet.has(s.toUpperCase())) : all;
|
|
2719
2849
|
})();
|
|
2720
2850
|
const defaultToken = tokensForChain.includes("USDC") ? "USDC" : _nullishCoalesce(tokensForChain[0], () => ( "USDC"));
|
|
2721
|
-
const chainName =
|
|
2722
|
-
const chainIcon =
|
|
2723
|
-
const tokenIcon =
|
|
2851
|
+
const chainName = _chunkABVRVW3Pcjs.getChainName.call(void 0, defaultChainId);
|
|
2852
|
+
const chainIcon = _chunkABVRVW3Pcjs.getChainIcon.call(void 0, defaultChainId);
|
|
2853
|
+
const tokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, defaultToken);
|
|
2724
2854
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", "aria-busy": "true", children: [
|
|
2725
2855
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: "Preparing deposit details\u2026" }),
|
|
2726
2856
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
2727
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2857
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
2728
2858
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", "aria-hidden": "true", children: [
|
|
2729
2859
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
2730
2860
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
@@ -2738,7 +2868,7 @@ function DepositAddressSkeleton({
|
|
|
2738
2868
|
}
|
|
2739
2869
|
),
|
|
2740
2870
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainName }),
|
|
2741
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2871
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2742
2872
|
] })
|
|
2743
2873
|
] }),
|
|
2744
2874
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
@@ -2746,9 +2876,9 @@ function DepositAddressSkeleton({
|
|
|
2746
2876
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Supported token" }),
|
|
2747
2877
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
2748
2878
|
"Min.$",
|
|
2749
|
-
(_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
2750
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2751
|
-
|
|
2879
|
+
(_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _104 => _104.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
2880
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2881
|
+
_chunkOQVLEVNRcjs.InfoIcon,
|
|
2752
2882
|
{
|
|
2753
2883
|
className: "rs-deposit-address-min-icon",
|
|
2754
2884
|
"aria-hidden": "true"
|
|
@@ -2766,7 +2896,7 @@ function DepositAddressSkeleton({
|
|
|
2766
2896
|
}
|
|
2767
2897
|
),
|
|
2768
2898
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: defaultToken }),
|
|
2769
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2899
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2770
2900
|
] })
|
|
2771
2901
|
] })
|
|
2772
2902
|
] }),
|
|
@@ -2787,7 +2917,7 @@ function DepositAddressSkeleton({
|
|
|
2787
2917
|
disabled: true,
|
|
2788
2918
|
"aria-hidden": "true",
|
|
2789
2919
|
children: [
|
|
2790
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2920
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.CopyIcon, {}),
|
|
2791
2921
|
"Copy address"
|
|
2792
2922
|
]
|
|
2793
2923
|
}
|
|
@@ -2800,16 +2930,16 @@ function DepositAddressSkeleton({
|
|
|
2800
2930
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
|
|
2801
2931
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
|
|
2802
2932
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2803
|
-
|
|
2933
|
+
_chunkOQVLEVNRcjs.Tooltip,
|
|
2804
2934
|
{
|
|
2805
2935
|
className: "rs-price-impact-info",
|
|
2806
2936
|
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,
|
|
2937
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.InfoIcon, { "aria-hidden": "true" })
|
|
2808
2938
|
}
|
|
2809
2939
|
)
|
|
2810
2940
|
] }),
|
|
2811
2941
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2812
|
-
|
|
2942
|
+
_chunkOQVLEVNRcjs.ChevronDownIcon,
|
|
2813
2943
|
{
|
|
2814
2944
|
className: "rs-price-impact-chevron",
|
|
2815
2945
|
"aria-hidden": "true"
|
|
@@ -2817,7 +2947,7 @@ function DepositAddressSkeleton({
|
|
|
2817
2947
|
)
|
|
2818
2948
|
] }) })
|
|
2819
2949
|
] }),
|
|
2820
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2950
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.PoweredBy, {})
|
|
2821
2951
|
] });
|
|
2822
2952
|
}
|
|
2823
2953
|
DepositAddressSkeleton.displayName = "DepositAddressSkeleton";
|
|
@@ -2849,14 +2979,14 @@ function SolanaTokenSelectStep({
|
|
|
2849
2979
|
setError(null);
|
|
2850
2980
|
const portfolioBySymbol = {};
|
|
2851
2981
|
try {
|
|
2852
|
-
|
|
2982
|
+
_chunkOQVLEVNRcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
|
|
2853
2983
|
solanaAddress
|
|
2854
2984
|
});
|
|
2855
2985
|
const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
|
|
2856
2986
|
if (!active) return;
|
|
2857
2987
|
for (const t of portfolio.tokens) {
|
|
2858
2988
|
const symbol = t.symbol.toUpperCase();
|
|
2859
|
-
if (!
|
|
2989
|
+
if (!_chunkABVRVW3Pcjs.SOLANA_TOKENS.some((st) => st.symbol === symbol)) continue;
|
|
2860
2990
|
let parsed = 0n;
|
|
2861
2991
|
try {
|
|
2862
2992
|
parsed = BigInt(t.balance || "0");
|
|
@@ -2872,12 +3002,12 @@ function SolanaTokenSelectStep({
|
|
|
2872
3002
|
};
|
|
2873
3003
|
}
|
|
2874
3004
|
}
|
|
2875
|
-
|
|
3005
|
+
_chunkOQVLEVNRcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
|
|
2876
3006
|
symbols: Object.keys(portfolioBySymbol)
|
|
2877
3007
|
});
|
|
2878
3008
|
} catch (err) {
|
|
2879
3009
|
if (!active) return;
|
|
2880
|
-
|
|
3010
|
+
_chunkOQVLEVNRcjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
|
|
2881
3011
|
solanaAddress
|
|
2882
3012
|
});
|
|
2883
3013
|
setError(
|
|
@@ -2888,7 +3018,7 @@ function SolanaTokenSelectStep({
|
|
|
2888
3018
|
return;
|
|
2889
3019
|
}
|
|
2890
3020
|
const results = [];
|
|
2891
|
-
for (const token of
|
|
3021
|
+
for (const token of _chunkABVRVW3Pcjs.SOLANA_TOKENS) {
|
|
2892
3022
|
const fromPortfolio = portfolioBySymbol[token.symbol];
|
|
2893
3023
|
if (fromPortfolio && fromPortfolio.balance > 0n) {
|
|
2894
3024
|
results.push({
|
|
@@ -2902,7 +3032,7 @@ function SolanaTokenSelectStep({
|
|
|
2902
3032
|
setTokenBalances(results);
|
|
2903
3033
|
setLoading(false);
|
|
2904
3034
|
const totalUsd = results.reduce((sum, r) => sum + r.balanceUsd, 0);
|
|
2905
|
-
_optionalChain([onTotalBalanceComputed, 'optionalCall',
|
|
3035
|
+
_optionalChain([onTotalBalanceComputed, 'optionalCall', _105 => _105(totalUsd)]);
|
|
2906
3036
|
}
|
|
2907
3037
|
void loadBalances();
|
|
2908
3038
|
return () => {
|
|
@@ -2924,30 +3054,30 @@ function SolanaTokenSelectStep({
|
|
|
2924
3054
|
const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
|
|
2925
3055
|
const numeric = Number(raw);
|
|
2926
3056
|
if (!Number.isFinite(numeric)) return raw;
|
|
2927
|
-
return
|
|
3057
|
+
return _chunkOQVLEVNRcjs.tokenFormatter.format(numeric);
|
|
2928
3058
|
} catch (e20) {
|
|
2929
3059
|
return "--";
|
|
2930
3060
|
}
|
|
2931
3061
|
};
|
|
2932
|
-
const chainIcon =
|
|
2933
|
-
const chainName =
|
|
3062
|
+
const chainIcon = _chunkABVRVW3Pcjs.getChainIcon.call(void 0, "solana");
|
|
3063
|
+
const chainName = _chunkABVRVW3Pcjs.getChainName.call(void 0, "solana");
|
|
2934
3064
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
2935
3065
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
2936
3066
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2937
|
-
|
|
3067
|
+
_chunkOQVLEVNRcjs.BodyHeader,
|
|
2938
3068
|
{
|
|
2939
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3069
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.WalletIcon, {}),
|
|
2940
3070
|
title: "Your assets",
|
|
2941
3071
|
subtitle: "Select source assets to transfer"
|
|
2942
3072
|
}
|
|
2943
3073
|
),
|
|
2944
3074
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
2945
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3075
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
2946
3076
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
2947
3077
|
] }),
|
|
2948
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3078
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.Callout, { variant: "error", children: error }),
|
|
2949
3079
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
2950
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3080
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
2951
3081
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
2952
3082
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
2953
3083
|
solanaAddress.slice(0, 6),
|
|
@@ -2967,7 +3097,7 @@ function SolanaTokenSelectStep({
|
|
|
2967
3097
|
!loading && !error && rows.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: rows.map((entry) => {
|
|
2968
3098
|
const isSelected = selectedSymbol === entry.token.symbol;
|
|
2969
3099
|
const tokenAmount = formatBalance(entry);
|
|
2970
|
-
const tokenIcon =
|
|
3100
|
+
const tokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, entry.token.symbol);
|
|
2971
3101
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2972
3102
|
"button",
|
|
2973
3103
|
{
|
|
@@ -2996,14 +3126,14 @@ function SolanaTokenSelectStep({
|
|
|
2996
3126
|
] })
|
|
2997
3127
|
] })
|
|
2998
3128
|
] }),
|
|
2999
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ?
|
|
3129
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunkOQVLEVNRcjs.currencyFormatter.format(entry.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${entry.token.symbol}` : "--" })
|
|
3000
3130
|
]
|
|
3001
3131
|
},
|
|
3002
3132
|
entry.token.symbol
|
|
3003
3133
|
);
|
|
3004
3134
|
}) }),
|
|
3005
3135
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3006
|
-
|
|
3136
|
+
_chunkOQVLEVNRcjs.Button,
|
|
3007
3137
|
{
|
|
3008
3138
|
onClick: () => selectedEntry && onContinue(
|
|
3009
3139
|
selectedEntry.token,
|
|
@@ -3016,7 +3146,7 @@ function SolanaTokenSelectStep({
|
|
|
3016
3146
|
}
|
|
3017
3147
|
)
|
|
3018
3148
|
] }),
|
|
3019
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3149
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.PoweredBy, {})
|
|
3020
3150
|
] });
|
|
3021
3151
|
}
|
|
3022
3152
|
|
|
@@ -3048,8 +3178,8 @@ function SolanaAmountStep({
|
|
|
3048
3178
|
const [amount, setAmount] = _react.useState.call(void 0, "");
|
|
3049
3179
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
3050
3180
|
const hasAppliedDefaultRef = _react.useRef.call(void 0, false);
|
|
3051
|
-
const isSourceStablecoin =
|
|
3052
|
-
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess',
|
|
3181
|
+
const isSourceStablecoin = _chunkABVRVW3Pcjs.isStablecoinSymbol.call(void 0, token.symbol);
|
|
3182
|
+
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess', _106 => _106.trim, 'call', _107 => _107(), 'access', _108 => _108.toLowerCase, 'call', _109 => _109()]) === "max";
|
|
3053
3183
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
3054
3184
|
if (isSourceStablecoin) return 1;
|
|
3055
3185
|
try {
|
|
@@ -3069,7 +3199,7 @@ function SolanaAmountStep({
|
|
|
3069
3199
|
const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
|
|
3070
3200
|
const numeric = Number(raw);
|
|
3071
3201
|
if (!Number.isFinite(numeric)) return raw;
|
|
3072
|
-
return
|
|
3202
|
+
return _chunkOQVLEVNRcjs.tokenFormatter.format(numeric);
|
|
3073
3203
|
} catch (e22) {
|
|
3074
3204
|
return "\u2026";
|
|
3075
3205
|
}
|
|
@@ -3086,7 +3216,7 @@ function SolanaAmountStep({
|
|
|
3086
3216
|
}
|
|
3087
3217
|
}, [balance, token.decimals, tokenPriceUsd, balanceUsd]);
|
|
3088
3218
|
const spendableBalance = _react.useMemo.call(void 0, () => {
|
|
3089
|
-
if (!
|
|
3219
|
+
if (!_chunkABVRVW3Pcjs.isNativeSol.call(void 0, token)) return balance;
|
|
3090
3220
|
return balance > SOL_FEE_RESERVE_LAMPORTS ? balance - SOL_FEE_RESERVE_LAMPORTS : 0n;
|
|
3091
3221
|
}, [balance, token]);
|
|
3092
3222
|
const spendableBalanceUsd = _react.useMemo.call(void 0, () => {
|
|
@@ -3151,8 +3281,8 @@ function SolanaAmountStep({
|
|
|
3151
3281
|
return null;
|
|
3152
3282
|
}
|
|
3153
3283
|
}, [numericAmount, isSourceStablecoin, hasPricing, tokenPriceUsd, token.decimals]);
|
|
3154
|
-
const minDepositUsd = targetChain ===
|
|
3155
|
-
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3284
|
+
const minDepositUsd = targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID ? Math.max(_chunkABVRVW3Pcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _110 => _110.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _111 => _111.minDepositUsd]), () => ( null));
|
|
3285
|
+
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _112 => _112.maxDepositUsd]), () => ( null));
|
|
3156
3286
|
const isBelowMin = minDepositUsd !== null && numericAmount > 0 && numericAmount < minDepositUsd;
|
|
3157
3287
|
const isAboveMax = maxDepositUsd !== null && numericAmount > maxDepositUsd;
|
|
3158
3288
|
const exceedsBalance = Boolean(
|
|
@@ -3162,7 +3292,7 @@ function SolanaAmountStep({
|
|
|
3162
3292
|
const handlePresetClick = (percentage) => {
|
|
3163
3293
|
const formatted = computePresetAmount(percentage);
|
|
3164
3294
|
if (!formatted) return;
|
|
3165
|
-
|
|
3295
|
+
_chunkOQVLEVNRcjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
|
|
3166
3296
|
percentage,
|
|
3167
3297
|
symbol: token.symbol,
|
|
3168
3298
|
formatted
|
|
@@ -3197,7 +3327,7 @@ function SolanaAmountStep({
|
|
|
3197
3327
|
try {
|
|
3198
3328
|
amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
|
|
3199
3329
|
} catch (e27) {
|
|
3200
|
-
|
|
3330
|
+
_chunkOQVLEVNRcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
3201
3331
|
amount,
|
|
3202
3332
|
sourceAmount: sourceAmountStr,
|
|
3203
3333
|
reason: "parse-units-failed"
|
|
@@ -3206,13 +3336,13 @@ function SolanaAmountStep({
|
|
|
3206
3336
|
return;
|
|
3207
3337
|
}
|
|
3208
3338
|
if (amountInUnits > spendableBalance) {
|
|
3209
|
-
const isReserveIssue =
|
|
3339
|
+
const isReserveIssue = _chunkABVRVW3Pcjs.isNativeSol.call(void 0, token) && amountInUnits <= balance;
|
|
3210
3340
|
setError(
|
|
3211
3341
|
isReserveIssue ? "Use a bit less than your full SOL balance" : "Insufficient balance"
|
|
3212
3342
|
);
|
|
3213
3343
|
return;
|
|
3214
3344
|
}
|
|
3215
|
-
|
|
3345
|
+
_chunkOQVLEVNRcjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
|
|
3216
3346
|
symbol: token.symbol,
|
|
3217
3347
|
inputAmountUsd: amount,
|
|
3218
3348
|
sourceAmount: sourceAmountStr,
|
|
@@ -3223,10 +3353,10 @@ function SolanaAmountStep({
|
|
|
3223
3353
|
};
|
|
3224
3354
|
const continueLabel = exceedsBalance ? "Insufficient balance" : isAboveMax ? "Continue with max allowed deposit" : isBelowMin ? "Continue with minimum deposit" : "Continue";
|
|
3225
3355
|
const continueDisabled = exceedsBalance || numericAmount === 0 && !isBelowMin;
|
|
3226
|
-
const sourceTokenIcon =
|
|
3356
|
+
const sourceTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, token.symbol);
|
|
3227
3357
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
3228
3358
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3229
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3359
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.WalletIcon, {}), title: "Wallet deposit" }),
|
|
3230
3360
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
3231
3361
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
3232
3362
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3246,13 +3376,13 @@ function SolanaAmountStep({
|
|
|
3246
3376
|
" available",
|
|
3247
3377
|
computedBalanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
3248
3378
|
" (~",
|
|
3249
|
-
|
|
3379
|
+
_chunkOQVLEVNRcjs.currencyFormatter.format(computedBalanceUsd),
|
|
3250
3380
|
")"
|
|
3251
3381
|
] })
|
|
3252
3382
|
] }),
|
|
3253
3383
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
3254
3384
|
"Min. deposit ",
|
|
3255
|
-
|
|
3385
|
+
_chunkOQVLEVNRcjs.currencyFormatter.format(minDepositUsd)
|
|
3256
3386
|
] })
|
|
3257
3387
|
] })
|
|
3258
3388
|
] }),
|
|
@@ -3291,13 +3421,13 @@ function SolanaAmountStep({
|
|
|
3291
3421
|
] }),
|
|
3292
3422
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
3293
3423
|
/* @__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:
|
|
3424
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkOQVLEVNRcjs.currencyFormatter.format(balanceAfterUsd) })
|
|
3295
3425
|
] })
|
|
3296
3426
|
] }),
|
|
3297
|
-
targetChain ===
|
|
3298
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3427
|
+
targetChain === _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
|
|
3428
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.Callout, { variant: "error", children: error }),
|
|
3299
3429
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3300
|
-
|
|
3430
|
+
_chunkOQVLEVNRcjs.Button,
|
|
3301
3431
|
{
|
|
3302
3432
|
onClick: handleContinue,
|
|
3303
3433
|
fullWidth: true,
|
|
@@ -3306,7 +3436,7 @@ function SolanaAmountStep({
|
|
|
3306
3436
|
}
|
|
3307
3437
|
)
|
|
3308
3438
|
] }),
|
|
3309
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3439
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.PoweredBy, {})
|
|
3310
3440
|
] });
|
|
3311
3441
|
}
|
|
3312
3442
|
|
|
@@ -3330,7 +3460,7 @@ var DEFAULT_SOLANA_RPC_URL = "https://api.mainnet.solana.com";
|
|
|
3330
3460
|
var configuredSolanaRpcUrl = null;
|
|
3331
3461
|
var cachedConnections = /* @__PURE__ */ new Map();
|
|
3332
3462
|
function configureSolanaRpcUrl(rpcUrl) {
|
|
3333
|
-
const normalized = _optionalChain([rpcUrl, 'optionalAccess',
|
|
3463
|
+
const normalized = _optionalChain([rpcUrl, 'optionalAccess', _113 => _113.trim, 'call', _114 => _114()]);
|
|
3334
3464
|
configuredSolanaRpcUrl = normalized ? normalized : null;
|
|
3335
3465
|
cachedConnections.clear();
|
|
3336
3466
|
}
|
|
@@ -3442,38 +3572,32 @@ function SolanaConfirmStep({
|
|
|
3442
3572
|
}) {
|
|
3443
3573
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
3444
3574
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
3445
|
-
const targetSymbol =
|
|
3446
|
-
const
|
|
3447
|
-
const
|
|
3448
|
-
const
|
|
3449
|
-
const
|
|
3450
|
-
const
|
|
3451
|
-
const
|
|
3452
|
-
const
|
|
3453
|
-
const
|
|
3454
|
-
const
|
|
3455
|
-
const
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
minimumFractionDigits: 2,
|
|
3468
|
-
maximumFractionDigits: 6
|
|
3469
|
-
});
|
|
3470
|
-
}
|
|
3471
|
-
return formattedAmount;
|
|
3575
|
+
const targetSymbol = _chunkABVRVW3Pcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3576
|
+
const sourceChainName = _chunkABVRVW3Pcjs.getChainName.call(void 0, "solana");
|
|
3577
|
+
const targetChainName = _chunkABVRVW3Pcjs.getChainName.call(void 0, targetChain);
|
|
3578
|
+
const sourceChainIcon = _chunkABVRVW3Pcjs.getChainIcon.call(void 0, "solana");
|
|
3579
|
+
const targetChainIcon = _chunkABVRVW3Pcjs.getChainIcon.call(void 0, targetChain);
|
|
3580
|
+
const sourceTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, token.symbol);
|
|
3581
|
+
const targetTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, targetSymbol);
|
|
3582
|
+
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _115 => _115.feeSponsored]), () => ( false));
|
|
3583
|
+
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _116 => _116.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
3584
|
+
const formattedAmount = sourceAmount && Number.isFinite(Number(sourceAmount)) ? _nullishCoalesce(_chunkOQVLEVNRcjs.formatTokenAmount.call(void 0, Number(sourceAmount), token.symbol), () => ( "0")) : "0";
|
|
3585
|
+
const receiveDisplay = (() => {
|
|
3586
|
+
const usdValue = Number(targetAmount);
|
|
3587
|
+
const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
|
|
3588
|
+
const estimate = _chunkOQVLEVNRcjs.formatReceiveEstimate.call(void 0, {
|
|
3589
|
+
sourceAmount: Number.isFinite(Number(sourceAmount)) ? Number(sourceAmount) : void 0,
|
|
3590
|
+
sourceSymbol: token.symbol,
|
|
3591
|
+
targetSymbol,
|
|
3592
|
+
sourceAmountUsd,
|
|
3593
|
+
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : {}
|
|
3594
|
+
});
|
|
3595
|
+
if (estimate !== void 0) return estimate;
|
|
3596
|
+
return sourceAmountUsd !== void 0 ? `~$${sourceAmountUsd.toFixed(2)}` : `${formattedAmount} ${token.symbol}`;
|
|
3472
3597
|
})();
|
|
3473
|
-
const receiveAmount = isSameToken ? formattedReceiveAmount : `~${formattedReceiveAmount}`;
|
|
3474
3598
|
const handleConfirm = async () => {
|
|
3475
3599
|
if (!solanaProvider) {
|
|
3476
|
-
|
|
3600
|
+
_chunkOQVLEVNRcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
3477
3601
|
reason: "missing-provider"
|
|
3478
3602
|
});
|
|
3479
3603
|
setError("Solana wallet not connected");
|
|
@@ -3481,7 +3605,7 @@ function SolanaConfirmStep({
|
|
|
3481
3605
|
}
|
|
3482
3606
|
const parsedAmount = parseFloat(sourceAmount);
|
|
3483
3607
|
if (isNaN(parsedAmount) || parsedAmount <= 0) {
|
|
3484
|
-
|
|
3608
|
+
_chunkOQVLEVNRcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
3485
3609
|
reason: "invalid-amount",
|
|
3486
3610
|
sourceAmount
|
|
3487
3611
|
});
|
|
@@ -3490,7 +3614,7 @@ function SolanaConfirmStep({
|
|
|
3490
3614
|
}
|
|
3491
3615
|
setError(null);
|
|
3492
3616
|
setIsSubmitting(true);
|
|
3493
|
-
|
|
3617
|
+
_chunkOQVLEVNRcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
|
|
3494
3618
|
smartAccount,
|
|
3495
3619
|
solanaAddress,
|
|
3496
3620
|
solanaDepositAddress,
|
|
@@ -3500,7 +3624,7 @@ function SolanaConfirmStep({
|
|
|
3500
3624
|
});
|
|
3501
3625
|
try {
|
|
3502
3626
|
const check = await service.checkAccount(smartAccount);
|
|
3503
|
-
|
|
3627
|
+
_chunkOQVLEVNRcjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
|
|
3504
3628
|
smartAccount,
|
|
3505
3629
|
isRegistered: check.isRegistered,
|
|
3506
3630
|
targetChain: check.targetChain,
|
|
@@ -3513,12 +3637,12 @@ function SolanaConfirmStep({
|
|
|
3513
3637
|
}
|
|
3514
3638
|
const connection = hasConfiguredSolanaRpcUrl() ? getSolanaConnection() : _nullishCoalesce(solanaConnection, () => ( getSolanaConnection()));
|
|
3515
3639
|
const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
|
|
3516
|
-
|
|
3640
|
+
_chunkOQVLEVNRcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
|
|
3517
3641
|
token: token.symbol,
|
|
3518
3642
|
sourceAmount,
|
|
3519
3643
|
amountUnits: amountUnits.toString()
|
|
3520
3644
|
});
|
|
3521
|
-
const transaction =
|
|
3645
|
+
const transaction = _chunkABVRVW3Pcjs.isNativeSol.call(void 0, token) ? await buildSolTransferTransaction(
|
|
3522
3646
|
connection,
|
|
3523
3647
|
solanaAddress,
|
|
3524
3648
|
solanaDepositAddress,
|
|
@@ -3530,10 +3654,10 @@ function SolanaConfirmStep({
|
|
|
3530
3654
|
token.mint,
|
|
3531
3655
|
amountUnits
|
|
3532
3656
|
);
|
|
3533
|
-
|
|
3657
|
+
_chunkOQVLEVNRcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
3534
3658
|
token: token.symbol,
|
|
3535
3659
|
instructionCount: transaction.instructions.length,
|
|
3536
|
-
feePayer: _optionalChain([transaction, 'access',
|
|
3660
|
+
feePayer: _optionalChain([transaction, 'access', _117 => _117.feePayer, 'optionalAccess', _118 => _118.toBase58, 'call', _119 => _119()]),
|
|
3537
3661
|
recentBlockhash: transaction.recentBlockhash
|
|
3538
3662
|
});
|
|
3539
3663
|
const txHash = await sendSolanaTransaction(
|
|
@@ -3541,28 +3665,28 @@ function SolanaConfirmStep({
|
|
|
3541
3665
|
connection,
|
|
3542
3666
|
transaction
|
|
3543
3667
|
);
|
|
3544
|
-
|
|
3668
|
+
_chunkOQVLEVNRcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
|
|
3545
3669
|
txHash,
|
|
3546
3670
|
amountUnits: amountUnits.toString()
|
|
3547
3671
|
});
|
|
3548
3672
|
onConfirm(txHash, amountUnits.toString());
|
|
3549
3673
|
} catch (err) {
|
|
3550
3674
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
3551
|
-
const message =
|
|
3552
|
-
|
|
3675
|
+
const message = _chunkOQVLEVNRcjs.formatUserError.call(void 0, raw);
|
|
3676
|
+
_chunkOQVLEVNRcjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
|
|
3553
3677
|
smartAccount,
|
|
3554
3678
|
token: token.symbol,
|
|
3555
3679
|
sourceAmount
|
|
3556
3680
|
});
|
|
3557
3681
|
setError(message);
|
|
3558
|
-
_optionalChain([onError, 'optionalCall',
|
|
3682
|
+
_optionalChain([onError, 'optionalCall', _120 => _120(message, "SOLANA_TRANSFER_ERROR")]);
|
|
3559
3683
|
} finally {
|
|
3560
3684
|
setIsSubmitting(false);
|
|
3561
3685
|
}
|
|
3562
3686
|
};
|
|
3563
3687
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
3564
3688
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3565
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3689
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.WalletIcon, {}), title: "Review deposit" }),
|
|
3566
3690
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
|
|
3567
3691
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
3568
3692
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
@@ -3596,11 +3720,7 @@ function SolanaConfirmStep({
|
|
|
3596
3720
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
3597
3721
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Receive" }),
|
|
3598
3722
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
3599
|
-
/* @__PURE__ */ _jsxruntime.
|
|
3600
|
-
receiveAmount,
|
|
3601
|
-
" ",
|
|
3602
|
-
targetSymbol
|
|
3603
|
-
] }),
|
|
3723
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: receiveDisplay }),
|
|
3604
3724
|
targetTokenIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: targetTokenIcon, alt: "" }) })
|
|
3605
3725
|
] })
|
|
3606
3726
|
] }),
|
|
@@ -3614,13 +3734,13 @@ function SolanaConfirmStep({
|
|
|
3614
3734
|
children: "$0.04"
|
|
3615
3735
|
}
|
|
3616
3736
|
),
|
|
3617
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3737
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.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, _chunkOQVLEVNRcjs.InfoIcon, {}) }) })
|
|
3618
3738
|
] })
|
|
3619
3739
|
] })
|
|
3620
3740
|
] }),
|
|
3621
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3741
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.Callout, { variant: "error", children: error }),
|
|
3622
3742
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3623
|
-
|
|
3743
|
+
_chunkOQVLEVNRcjs.Button,
|
|
3624
3744
|
{
|
|
3625
3745
|
onClick: handleConfirm,
|
|
3626
3746
|
loading: isSubmitting,
|
|
@@ -3631,7 +3751,7 @@ function SolanaConfirmStep({
|
|
|
3631
3751
|
}
|
|
3632
3752
|
)
|
|
3633
3753
|
] }),
|
|
3634
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3754
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.PoweredBy, {})
|
|
3635
3755
|
] });
|
|
3636
3756
|
}
|
|
3637
3757
|
|
|
@@ -3645,21 +3765,21 @@ function DappImportAssetSelectStep({
|
|
|
3645
3765
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
3646
3766
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3647
3767
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3648
|
-
|
|
3768
|
+
_chunkOQVLEVNRcjs.BodyHeader,
|
|
3649
3769
|
{
|
|
3650
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3770
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.WalletIcon, {}),
|
|
3651
3771
|
title: `Transfer from ${sourceLabel}`,
|
|
3652
3772
|
subtitle: "Pick the balance to import"
|
|
3653
3773
|
}
|
|
3654
3774
|
),
|
|
3655
3775
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: assets.map((asset) => {
|
|
3656
|
-
const tokenAmount = asset.balance ?
|
|
3776
|
+
const tokenAmount = asset.balance ? _chunkOQVLEVNRcjs.tokenFormatter.format(
|
|
3657
3777
|
Number(asset.balance) / 10 ** asset.decimals
|
|
3658
3778
|
) : "0";
|
|
3659
|
-
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ?
|
|
3660
|
-
const tokenIcon = _nullishCoalesce(asset.icon, () => (
|
|
3661
|
-
const chainIcon =
|
|
3662
|
-
const badge =
|
|
3779
|
+
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ? _chunkOQVLEVNRcjs.currencyFormatter.format(asset.balanceUsd) : `${tokenAmount} ${asset.symbol}`;
|
|
3780
|
+
const tokenIcon = _nullishCoalesce(asset.icon, () => ( _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, asset.symbol)));
|
|
3781
|
+
const chainIcon = _chunkABVRVW3Pcjs.getChainIcon.call(void 0, asset.chainId);
|
|
3782
|
+
const badge = _chunkABVRVW3Pcjs.getChainBadge.call(void 0, asset.chainId);
|
|
3663
3783
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3664
3784
|
"button",
|
|
3665
3785
|
{
|
|
@@ -3674,7 +3794,7 @@ function DappImportAssetSelectStep({
|
|
|
3674
3794
|
"img",
|
|
3675
3795
|
{
|
|
3676
3796
|
src: chainIcon,
|
|
3677
|
-
alt:
|
|
3797
|
+
alt: _chunkABVRVW3Pcjs.getChainName.call(void 0, asset.chainId)
|
|
3678
3798
|
}
|
|
3679
3799
|
) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3680
3800
|
"span",
|
|
@@ -3707,23 +3827,71 @@ function DappImportAssetSelectStep({
|
|
|
3707
3827
|
);
|
|
3708
3828
|
}) })
|
|
3709
3829
|
] }),
|
|
3710
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3830
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.PoweredBy, {})
|
|
3711
3831
|
] });
|
|
3712
3832
|
}
|
|
3713
3833
|
DappImportAssetSelectStep.displayName = "DappImportAssetSelectStep";
|
|
3714
3834
|
|
|
3715
|
-
// src/
|
|
3835
|
+
// src/components/steps/DappImportAssetSelectSkeleton.tsx
|
|
3836
|
+
|
|
3837
|
+
function DappImportAssetSelectSkeleton({
|
|
3838
|
+
sourceLabel,
|
|
3839
|
+
rowCount = 3,
|
|
3840
|
+
error = false,
|
|
3841
|
+
onRetry
|
|
3842
|
+
}) {
|
|
3843
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", "aria-busy": error ? "false" : "true", children: [
|
|
3844
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: error ? "Couldn't load balances" : "Loading balances\u2026" }),
|
|
3845
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3846
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3847
|
+
_chunkOQVLEVNRcjs.BodyHeader,
|
|
3848
|
+
{
|
|
3849
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.WalletIcon, {}),
|
|
3850
|
+
title: `Transfer from ${sourceLabel}`,
|
|
3851
|
+
subtitle: "Pick the balance to import"
|
|
3852
|
+
}
|
|
3853
|
+
),
|
|
3854
|
+
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: [
|
|
3855
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-title rs-text-error", children: "Couldn\u2019t load your balances" }),
|
|
3856
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-subtitle", children: "Check your connection and try again." })
|
|
3857
|
+
] }) }) : /* @__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,
|
|
3858
|
+
"div",
|
|
3859
|
+
{
|
|
3860
|
+
className: "rs-asset-row rs-asset-row--skeleton",
|
|
3861
|
+
children: [
|
|
3862
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
|
|
3863
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-icon-wrapper", children: [
|
|
3864
|
+
/* @__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" }) }),
|
|
3865
|
+
/* @__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" }) })
|
|
3866
|
+
] }),
|
|
3867
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-text", children: [
|
|
3868
|
+
/* @__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" }) }),
|
|
3869
|
+
/* @__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" }) })
|
|
3870
|
+
] })
|
|
3871
|
+
] }),
|
|
3872
|
+
/* @__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" }) })
|
|
3873
|
+
]
|
|
3874
|
+
},
|
|
3875
|
+
index
|
|
3876
|
+
)) })
|
|
3877
|
+
] }),
|
|
3878
|
+
error && onRetry && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3879
|
+
"button",
|
|
3880
|
+
{
|
|
3881
|
+
type: "button",
|
|
3882
|
+
className: "rs-button rs-button--default rs-button--full-width",
|
|
3883
|
+
onClick: onRetry,
|
|
3884
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Try again" })
|
|
3885
|
+
}
|
|
3886
|
+
) }),
|
|
3887
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.PoweredBy, {})
|
|
3888
|
+
] });
|
|
3889
|
+
}
|
|
3890
|
+
DappImportAssetSelectSkeleton.displayName = "DappImportAssetSelectSkeleton";
|
|
3716
3891
|
|
|
3892
|
+
// src/core/dapp-imports/polymarket/index.ts
|
|
3717
3893
|
|
|
3718
3894
|
|
|
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
3895
|
|
|
3728
3896
|
// src/core/dapp-imports/polymarket/deposit-wallet.ts
|
|
3729
3897
|
|
|
@@ -3773,7 +3941,7 @@ async function detectPolymarketWalletKind(params) {
|
|
|
3773
3941
|
contracts: [
|
|
3774
3942
|
{
|
|
3775
3943
|
address: proxyWallet,
|
|
3776
|
-
abi:
|
|
3944
|
+
abi: _chunkUEKPBRBYcjs.SAFE_ABI,
|
|
3777
3945
|
functionName: "isOwner",
|
|
3778
3946
|
args: [eoa]
|
|
3779
3947
|
},
|
|
@@ -3806,7 +3974,7 @@ async function buildSignedDepositWalletBatch(params) {
|
|
|
3806
3974
|
if (!account || !chain) {
|
|
3807
3975
|
throw new Error("Wallet not connected");
|
|
3808
3976
|
}
|
|
3809
|
-
if (chain.id !== POLYMARKET_POLYGON_CHAIN_ID) {
|
|
3977
|
+
if (chain.id !== _chunkNRNJAQUAcjs.POLYMARKET_POLYGON_CHAIN_ID) {
|
|
3810
3978
|
throw new Error("Switch to Polygon to sign");
|
|
3811
3979
|
}
|
|
3812
3980
|
const owner = await publicClient.readContract({
|
|
@@ -3851,14 +4019,14 @@ async function buildSignedDepositWalletBatch(params) {
|
|
|
3851
4019
|
})),
|
|
3852
4020
|
signature
|
|
3853
4021
|
},
|
|
3854
|
-
sourceToken: POLYMARKET_USDCE_ADDRESS,
|
|
4022
|
+
sourceToken: _chunkNRNJAQUAcjs.POLYMARKET_USDCE_ADDRESS,
|
|
3855
4023
|
sourceSymbol: tokenKind === "pusd" ? "pUSD" : "USDC.e"
|
|
3856
4024
|
};
|
|
3857
4025
|
}
|
|
3858
4026
|
function buildUsdceTransferCalls(recipient, amount) {
|
|
3859
4027
|
return [
|
|
3860
4028
|
{
|
|
3861
|
-
target: POLYMARKET_USDCE_ADDRESS,
|
|
4029
|
+
target: _chunkNRNJAQUAcjs.POLYMARKET_USDCE_ADDRESS,
|
|
3862
4030
|
value: 0n,
|
|
3863
4031
|
data: _viem.encodeFunctionData.call(void 0, {
|
|
3864
4032
|
abi: _viem.erc20Abi,
|
|
@@ -3871,248 +4039,56 @@ function buildUsdceTransferCalls(recipient, amount) {
|
|
|
3871
4039
|
function buildPusdUnwrapCalls(recipient, amount) {
|
|
3872
4040
|
return [
|
|
3873
4041
|
{
|
|
3874
|
-
target: POLYMARKET_PUSD_ADDRESS,
|
|
4042
|
+
target: _chunkNRNJAQUAcjs.POLYMARKET_PUSD_ADDRESS,
|
|
3875
4043
|
value: 0n,
|
|
3876
4044
|
data: _viem.encodeFunctionData.call(void 0, {
|
|
3877
4045
|
abi: _viem.erc20Abi,
|
|
3878
4046
|
functionName: "approve",
|
|
3879
|
-
args: [POLYMARKET_COLLATERAL_OFFRAMP_ADDRESS, amount]
|
|
4047
|
+
args: [_chunkNRNJAQUAcjs.POLYMARKET_COLLATERAL_OFFRAMP_ADDRESS, amount]
|
|
3880
4048
|
})
|
|
3881
4049
|
},
|
|
3882
4050
|
{
|
|
3883
|
-
target: POLYMARKET_COLLATERAL_OFFRAMP_ADDRESS,
|
|
4051
|
+
target: _chunkNRNJAQUAcjs.POLYMARKET_COLLATERAL_OFFRAMP_ADDRESS,
|
|
3884
4052
|
value: 0n,
|
|
3885
4053
|
data: _viem.encodeFunctionData.call(void 0, {
|
|
3886
4054
|
abi: COLLATERAL_OFFRAMP_ABI,
|
|
3887
4055
|
functionName: "unwrap",
|
|
3888
|
-
args: [POLYMARKET_USDCE_ADDRESS, recipient, amount]
|
|
4056
|
+
args: [_chunkNRNJAQUAcjs.POLYMARKET_USDCE_ADDRESS, recipient, amount]
|
|
3889
4057
|
})
|
|
3890
4058
|
}
|
|
3891
4059
|
];
|
|
3892
4060
|
}
|
|
3893
4061
|
|
|
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
4062
|
// src/core/dapp-imports/polymarket/index.ts
|
|
4088
4063
|
var PROVIDER_ID = "polymarket";
|
|
4089
4064
|
var polymarketProvider = {
|
|
4090
4065
|
id: PROVIDER_ID,
|
|
4091
4066
|
label: "Transfer from Polymarket",
|
|
4067
|
+
sourceLabel: "Polymarket",
|
|
4092
4068
|
icon: _react.createElement.call(void 0, "img", {
|
|
4093
|
-
src: POLYMARKET_ICON_URL,
|
|
4069
|
+
src: _chunkNRNJAQUAcjs.POLYMARKET_ICON_URL,
|
|
4094
4070
|
alt: "Polymarket",
|
|
4095
4071
|
style: { width: 24, height: 24, borderRadius: 6 }
|
|
4096
4072
|
}),
|
|
4097
|
-
chainId: POLYMARKET_POLYGON_CHAIN_ID,
|
|
4073
|
+
chainId: _chunkNRNJAQUAcjs.POLYMARKET_POLYGON_CHAIN_ID,
|
|
4098
4074
|
async fetchAvailability({ eoa, getPublicClient: getPublicClient2, signal }) {
|
|
4099
|
-
const proxyWallet = await fetchPolymarketProxyWallet(eoa, signal);
|
|
4075
|
+
const proxyWallet = await _chunkNRNJAQUAcjs.fetchPolymarketProxyWallet.call(void 0, eoa, signal);
|
|
4100
4076
|
if (!proxyWallet) return null;
|
|
4101
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
4102
|
-
const polygonClient = getPublicClient2(POLYMARKET_POLYGON_CHAIN_ID);
|
|
4077
|
+
if (_optionalChain([signal, 'optionalAccess', _121 => _121.aborted])) return null;
|
|
4078
|
+
const polygonClient = getPublicClient2(_chunkNRNJAQUAcjs.POLYMARKET_POLYGON_CHAIN_ID);
|
|
4103
4079
|
if (!polygonClient) return null;
|
|
4104
|
-
const balances = await readPolymarketBalances({
|
|
4080
|
+
const balances = await _chunkNRNJAQUAcjs.readPolymarketBalances.call(void 0, {
|
|
4105
4081
|
publicClient: polygonClient,
|
|
4106
4082
|
proxyWallet
|
|
4107
4083
|
});
|
|
4108
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
4084
|
+
if (_optionalChain([signal, 'optionalAccess', _122 => _122.aborted])) return null;
|
|
4109
4085
|
if (balances.pusd === 0n && balances.usdce === 0n) return null;
|
|
4110
4086
|
const walletKind = await detectPolymarketWalletKind({
|
|
4111
4087
|
publicClient: polygonClient,
|
|
4112
4088
|
proxyWallet,
|
|
4113
4089
|
eoa
|
|
4114
4090
|
});
|
|
4115
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
4091
|
+
if (_optionalChain([signal, 'optionalAccess', _123 => _123.aborted])) return null;
|
|
4116
4092
|
if (!walletKind) return null;
|
|
4117
4093
|
const assets = [];
|
|
4118
4094
|
if (balances.pusd > 0n) {
|
|
@@ -4159,7 +4135,7 @@ var polymarketProvider = {
|
|
|
4159
4135
|
const { txHash } = await backend.submitPolymarketWithdraw(payload);
|
|
4160
4136
|
return { txHash, sourceToken, sourceSymbol, sourceDecimals: 6 };
|
|
4161
4137
|
}
|
|
4162
|
-
const result = await executePolymarketSafeTransfer({
|
|
4138
|
+
const result = await _chunkNRNJAQUAcjs.executePolymarketSafeTransfer.call(void 0, {
|
|
4163
4139
|
walletClient,
|
|
4164
4140
|
publicClient,
|
|
4165
4141
|
safeAddress: metadata.proxyWallet,
|
|
@@ -4178,17 +4154,17 @@ var polymarketProvider = {
|
|
|
4178
4154
|
function buildAsset(params) {
|
|
4179
4155
|
const { tokenKind, proxyWallet, walletKind, balance } = params;
|
|
4180
4156
|
const isPusd = tokenKind === "pusd";
|
|
4181
|
-
const tokenAddress = isPusd ? POLYMARKET_PUSD_ADDRESS : POLYMARKET_USDCE_ADDRESS;
|
|
4157
|
+
const tokenAddress = isPusd ? _chunkNRNJAQUAcjs.POLYMARKET_PUSD_ADDRESS : _chunkNRNJAQUAcjs.POLYMARKET_USDCE_ADDRESS;
|
|
4182
4158
|
const symbol = isPusd ? "pUSD" : "USDC.e";
|
|
4183
4159
|
const balanceUsd = Number(_viem.formatUnits.call(void 0, balance, 6));
|
|
4184
4160
|
const metadata = { proxyWallet, tokenKind, walletKind };
|
|
4185
4161
|
return {
|
|
4186
4162
|
id: `polymarket:${tokenKind}`,
|
|
4187
|
-
chainId: POLYMARKET_POLYGON_CHAIN_ID,
|
|
4163
|
+
chainId: _chunkNRNJAQUAcjs.POLYMARKET_POLYGON_CHAIN_ID,
|
|
4188
4164
|
token: tokenAddress,
|
|
4189
4165
|
symbol,
|
|
4190
4166
|
name: isPusd ? "Polymarket USD" : "Polygon USDC.e",
|
|
4191
|
-
icon: isPusd ? POLYMARKET_ICON_URL : void 0,
|
|
4167
|
+
icon: isPusd ? _chunkNRNJAQUAcjs.POLYMARKET_ICON_URL : void 0,
|
|
4192
4168
|
decimals: 6,
|
|
4193
4169
|
balance: balance.toString(),
|
|
4194
4170
|
balanceUsd: Number.isFinite(balanceUsd) ? balanceUsd : 0,
|
|
@@ -4198,8 +4174,8 @@ function buildAsset(params) {
|
|
|
4198
4174
|
// pUSD unwraps to USDC.e via the offramp; USDC.e is what actually
|
|
4199
4175
|
// arrives at the smart account, so it's also what the orchestrator
|
|
4200
4176
|
// bridges from.
|
|
4201
|
-
depositToken: POLYMARKET_USDCE_ADDRESS,
|
|
4202
|
-
depositChainId: POLYMARKET_POLYGON_CHAIN_ID,
|
|
4177
|
+
depositToken: _chunkNRNJAQUAcjs.POLYMARKET_USDCE_ADDRESS,
|
|
4178
|
+
depositChainId: _chunkNRNJAQUAcjs.POLYMARKET_POLYGON_CHAIN_ID,
|
|
4203
4179
|
providerMetadata: metadata
|
|
4204
4180
|
};
|
|
4205
4181
|
}
|
|
@@ -4213,6 +4189,77 @@ function getEnabledProviders(config) {
|
|
|
4213
4189
|
);
|
|
4214
4190
|
}
|
|
4215
4191
|
|
|
4192
|
+
// src/store/selectors.ts
|
|
4193
|
+
var selectedWalletIdSelector = (state) => state.wallet.selectedWalletId;
|
|
4194
|
+
var IDLE_SETUP_ENTRY = {
|
|
4195
|
+
owner: null,
|
|
4196
|
+
requestKey: null,
|
|
4197
|
+
cacheKey: null,
|
|
4198
|
+
status: "idle",
|
|
4199
|
+
smartAccount: null,
|
|
4200
|
+
sessionOwnerAddress: null,
|
|
4201
|
+
solanaDepositAddress: null,
|
|
4202
|
+
message: null,
|
|
4203
|
+
cacheable: true,
|
|
4204
|
+
attemptNonce: 0
|
|
4205
|
+
};
|
|
4206
|
+
function readSetupForOwner(setup, owner) {
|
|
4207
|
+
if (!owner) return IDLE_SETUP_ENTRY;
|
|
4208
|
+
const entry = setup.byOwner[owner.toLowerCase()];
|
|
4209
|
+
return _nullishCoalesce(entry, () => ( { ...IDLE_SETUP_ENTRY, owner }));
|
|
4210
|
+
}
|
|
4211
|
+
|
|
4212
|
+
// src/core/dapp-imports/status.ts
|
|
4213
|
+
function computeDappImportStatus(providerId, inputs) {
|
|
4214
|
+
const { owner, availability, availabilityOwner, setup } = inputs;
|
|
4215
|
+
if (!owner) return "needs-connect";
|
|
4216
|
+
const entry = _optionalChain([availabilityOwner, 'optionalAccess', _124 => _124.toLowerCase, 'call', _125 => _125()]) === owner.toLowerCase() ? availability[providerId] : void 0;
|
|
4217
|
+
if (entry === "loading" || entry === void 0) return "loading";
|
|
4218
|
+
if (entry === "error") {
|
|
4219
|
+
return {
|
|
4220
|
+
enabled: false,
|
|
4221
|
+
reason: "Couldn't load balance \u2014 tap to retry",
|
|
4222
|
+
retryable: true
|
|
4223
|
+
};
|
|
4224
|
+
}
|
|
4225
|
+
if (entry === null) return { enabled: false, reason: "No balance" };
|
|
4226
|
+
const setupEntry = readSetupForOwner(setup, owner);
|
|
4227
|
+
if (setupEntry.status === "loading") return "loading";
|
|
4228
|
+
if (setupEntry.status === "error") {
|
|
4229
|
+
return {
|
|
4230
|
+
enabled: false,
|
|
4231
|
+
reason: "Couldn't prepare account \u2014 tap to retry",
|
|
4232
|
+
retryable: true
|
|
4233
|
+
};
|
|
4234
|
+
}
|
|
4235
|
+
return { enabled: true, balanceUsd: entry.totalUsd };
|
|
4236
|
+
}
|
|
4237
|
+
function resolveBootOutcome(params) {
|
|
4238
|
+
const { status, setupStatus, timedOut, walletHydrating, signerAvailable } = params;
|
|
4239
|
+
if (status === "needs-connect") {
|
|
4240
|
+
return walletHydrating && !timedOut ? "wait" : "unavailable";
|
|
4241
|
+
}
|
|
4242
|
+
if (status === "loading") return timedOut ? "error" : "wait";
|
|
4243
|
+
if (!status.enabled) {
|
|
4244
|
+
return status.retryable ? "error" : "unavailable";
|
|
4245
|
+
}
|
|
4246
|
+
if (setupStatus === "ready") {
|
|
4247
|
+
if (!signerAvailable) return timedOut ? "error" : "wait";
|
|
4248
|
+
return "ready";
|
|
4249
|
+
}
|
|
4250
|
+
if (setupStatus === "error") return "error";
|
|
4251
|
+
return timedOut ? "error" : "wait";
|
|
4252
|
+
}
|
|
4253
|
+
function bootRetryPlan(params) {
|
|
4254
|
+
const { setupStatus, availabilityEntry } = params;
|
|
4255
|
+
return {
|
|
4256
|
+
restartSetup: setupStatus !== "ready",
|
|
4257
|
+
// `null` is a delivered "no account" — only refetch when nothing
|
|
4258
|
+
// usable came back ("error", still "loading", or never recorded).
|
|
4259
|
+
refetchAvailability: availabilityEntry === "error" || availabilityEntry === "loading" || availabilityEntry === void 0
|
|
4260
|
+
};
|
|
4261
|
+
}
|
|
4262
|
+
|
|
4216
4263
|
// src/core/dapp-imports/types.ts
|
|
4217
4264
|
function isDappImportAsset(asset) {
|
|
4218
4265
|
return typeof asset.source === "string" && typeof asset.sourceLabel === "string" && "providerMetadata" in asset;
|
|
@@ -4336,6 +4383,7 @@ function applyBack(state, hasWalletOptions) {
|
|
|
4336
4383
|
case "fiat-onramp":
|
|
4337
4384
|
case "exchange-select":
|
|
4338
4385
|
case "solana-token-select":
|
|
4386
|
+
case "dapp-import-resolving":
|
|
4339
4387
|
case "dapp-import-asset-select":
|
|
4340
4388
|
return {
|
|
4341
4389
|
...state,
|
|
@@ -4350,7 +4398,8 @@ function applyBack(state, hasWalletOptions) {
|
|
|
4350
4398
|
dappImport: {
|
|
4351
4399
|
...state.dappImport,
|
|
4352
4400
|
activeProviderId: null,
|
|
4353
|
-
selectedAsset: null
|
|
4401
|
+
selectedAsset: null,
|
|
4402
|
+
bootError: false
|
|
4354
4403
|
},
|
|
4355
4404
|
exchange: { selectedConnection: null }
|
|
4356
4405
|
};
|
|
@@ -4493,16 +4542,6 @@ function applyAction(state, action) {
|
|
|
4493
4542
|
},
|
|
4494
4543
|
exchange: { selectedConnection: action.connection }
|
|
4495
4544
|
};
|
|
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
4545
|
case "connect/wallet-picker-requested":
|
|
4507
4546
|
return {
|
|
4508
4547
|
...state,
|
|
@@ -4528,12 +4567,12 @@ function applyAction(state, action) {
|
|
|
4528
4567
|
requestKey: action.requestKey,
|
|
4529
4568
|
cacheKey: action.cacheKey,
|
|
4530
4569
|
status: "loading",
|
|
4531
|
-
smartAccount: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
4532
|
-
sessionOwnerAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
4533
|
-
solanaDepositAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
4570
|
+
smartAccount: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _126 => _126.smartAccount]), () => ( null)),
|
|
4571
|
+
sessionOwnerAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _127 => _127.sessionOwnerAddress]), () => ( null)),
|
|
4572
|
+
solanaDepositAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _128 => _128.solanaDepositAddress]), () => ( null)),
|
|
4534
4573
|
message: null,
|
|
4535
4574
|
cacheable: action.cacheable,
|
|
4536
|
-
attemptNonce: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
4575
|
+
attemptNonce: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _129 => _129.attemptNonce]), () => ( 0))
|
|
4537
4576
|
}));
|
|
4538
4577
|
}
|
|
4539
4578
|
case "setup/ready": {
|
|
@@ -4685,17 +4724,41 @@ function applyAction(state, action) {
|
|
|
4685
4724
|
}
|
|
4686
4725
|
}
|
|
4687
4726
|
};
|
|
4688
|
-
case "dapp-import/availability-
|
|
4727
|
+
case "dapp-import/availability-failed":
|
|
4728
|
+
if (!state.dappImport.availabilityOwner || ownerKey(state.dappImport.availabilityOwner) !== ownerKey(action.owner)) {
|
|
4729
|
+
return state;
|
|
4730
|
+
}
|
|
4731
|
+
return {
|
|
4732
|
+
...state,
|
|
4733
|
+
dappImport: {
|
|
4734
|
+
...state.dappImport,
|
|
4735
|
+
availability: {
|
|
4736
|
+
...state.dappImport.availability,
|
|
4737
|
+
[action.providerId]: "error"
|
|
4738
|
+
}
|
|
4739
|
+
}
|
|
4740
|
+
};
|
|
4741
|
+
case "dapp-import/availability-retry-requested":
|
|
4742
|
+
return {
|
|
4743
|
+
...state,
|
|
4744
|
+
dappImport: {
|
|
4745
|
+
...state.dappImport,
|
|
4746
|
+
attemptNonce: state.dappImport.attemptNonce + 1
|
|
4747
|
+
}
|
|
4748
|
+
};
|
|
4749
|
+
case "dapp-import/availability-cleared": {
|
|
4750
|
+
const isBootResolving = state.flow.step === "dapp-import-resolving";
|
|
4689
4751
|
return {
|
|
4690
4752
|
...state,
|
|
4691
4753
|
dappImport: {
|
|
4692
4754
|
...state.dappImport,
|
|
4693
4755
|
availabilityOwner: null,
|
|
4694
4756
|
availability: {},
|
|
4695
|
-
activeProviderId: null,
|
|
4696
|
-
selectedAsset: null
|
|
4757
|
+
activeProviderId: isBootResolving ? state.dappImport.activeProviderId : null,
|
|
4758
|
+
selectedAsset: isBootResolving ? state.dappImport.selectedAsset : null
|
|
4697
4759
|
}
|
|
4698
4760
|
};
|
|
4761
|
+
}
|
|
4699
4762
|
case "dapp-import/provider-selected":
|
|
4700
4763
|
return {
|
|
4701
4764
|
...state,
|
|
@@ -4724,6 +4787,57 @@ function applyAction(state, action) {
|
|
|
4724
4787
|
},
|
|
4725
4788
|
flow: { ...state.flow, step: "amount" }
|
|
4726
4789
|
};
|
|
4790
|
+
case "dapp-import/boot-requested":
|
|
4791
|
+
return {
|
|
4792
|
+
...state,
|
|
4793
|
+
flow: {
|
|
4794
|
+
...state.flow,
|
|
4795
|
+
mode: "dapp-import",
|
|
4796
|
+
isConnectSelectionConfirmed: true,
|
|
4797
|
+
step: "dapp-import-resolving"
|
|
4798
|
+
},
|
|
4799
|
+
dappImport: {
|
|
4800
|
+
...state.dappImport,
|
|
4801
|
+
activeProviderId: action.providerId,
|
|
4802
|
+
selectedAsset: null,
|
|
4803
|
+
bootError: false
|
|
4804
|
+
}
|
|
4805
|
+
};
|
|
4806
|
+
case "dapp-import/boot-resolved": {
|
|
4807
|
+
if (state.flow.step !== "dapp-import-resolving" || state.dappImport.activeProviderId !== action.providerId) {
|
|
4808
|
+
return state;
|
|
4809
|
+
}
|
|
4810
|
+
switch (action.outcome) {
|
|
4811
|
+
case "ready":
|
|
4812
|
+
return {
|
|
4813
|
+
...state,
|
|
4814
|
+
flow: { ...state.flow, step: "dapp-import-asset-select" },
|
|
4815
|
+
dappImport: { ...state.dappImport, bootError: false }
|
|
4816
|
+
};
|
|
4817
|
+
case "unavailable":
|
|
4818
|
+
return {
|
|
4819
|
+
...state,
|
|
4820
|
+
flow: {
|
|
4821
|
+
...state.flow,
|
|
4822
|
+
step: "connect",
|
|
4823
|
+
mode: null,
|
|
4824
|
+
isConnectSelectionConfirmed: false,
|
|
4825
|
+
hasNavigatedBack: true
|
|
4826
|
+
},
|
|
4827
|
+
dappImport: {
|
|
4828
|
+
...state.dappImport,
|
|
4829
|
+
activeProviderId: null,
|
|
4830
|
+
selectedAsset: null,
|
|
4831
|
+
bootError: false
|
|
4832
|
+
}
|
|
4833
|
+
};
|
|
4834
|
+
case "error":
|
|
4835
|
+
return {
|
|
4836
|
+
...state,
|
|
4837
|
+
dappImport: { ...state.dappImport, bootError: true }
|
|
4838
|
+
};
|
|
4839
|
+
}
|
|
4840
|
+
}
|
|
4727
4841
|
case "back/requested":
|
|
4728
4842
|
return applyBack(state, action.hasWalletOptions);
|
|
4729
4843
|
case "flow/reset": {
|
|
@@ -4751,12 +4865,18 @@ function applyAction(state, action) {
|
|
|
4751
4865
|
txHash: null,
|
|
4752
4866
|
directTransfer: false
|
|
4753
4867
|
},
|
|
4754
|
-
//
|
|
4755
|
-
//
|
|
4868
|
+
// Drop fetched availability wholesale. The fetch effect refetches
|
|
4869
|
+
// unconditionally on remount (so keeping the map saves nothing),
|
|
4870
|
+
// and a preserved terminal entry (null / "error") could be consumed
|
|
4871
|
+
// by a fresh pre-routed boot before the refetch's loading update
|
|
4872
|
+
// lands — routing a now-funded account home off stale data.
|
|
4756
4873
|
dappImport: {
|
|
4757
|
-
...state.dappImport,
|
|
4758
4874
|
activeProviderId: null,
|
|
4759
|
-
|
|
4875
|
+
availabilityOwner: null,
|
|
4876
|
+
availability: {},
|
|
4877
|
+
selectedAsset: null,
|
|
4878
|
+
bootError: false,
|
|
4879
|
+
attemptNonce: 0
|
|
4760
4880
|
},
|
|
4761
4881
|
setup: { byOwner: preservedByOwner },
|
|
4762
4882
|
fiat: { selectedMethod: null },
|
|
@@ -4830,7 +4950,9 @@ function createInitialState(overrides) {
|
|
|
4830
4950
|
activeProviderId: null,
|
|
4831
4951
|
availabilityOwner: null,
|
|
4832
4952
|
availability: {},
|
|
4833
|
-
selectedAsset: null
|
|
4953
|
+
selectedAsset: null,
|
|
4954
|
+
bootError: false,
|
|
4955
|
+
attemptNonce: 0
|
|
4834
4956
|
},
|
|
4835
4957
|
setup: {
|
|
4836
4958
|
byOwner: {}
|
|
@@ -4844,26 +4966,6 @@ function createInitialState(overrides) {
|
|
|
4844
4966
|
};
|
|
4845
4967
|
}
|
|
4846
4968
|
|
|
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
4969
|
// src/store/index.ts
|
|
4868
4970
|
function createDepositStore(overrides) {
|
|
4869
4971
|
const store = _vanilla.createStore.call(void 0, () => createInitialState(overrides));
|
|
@@ -4908,15 +5010,15 @@ var SetupError = class extends Error {
|
|
|
4908
5010
|
}
|
|
4909
5011
|
};
|
|
4910
5012
|
async function resolveSessionOwner(eoaAddress) {
|
|
4911
|
-
const local =
|
|
5013
|
+
const local = _chunkOQVLEVNRcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
4912
5014
|
if (local) {
|
|
4913
5015
|
return {
|
|
4914
|
-
account:
|
|
5016
|
+
account: _chunkOQVLEVNRcjs.accountFromPrivateKey.call(void 0, local.privateKey),
|
|
4915
5017
|
address: local.address
|
|
4916
5018
|
};
|
|
4917
5019
|
}
|
|
4918
|
-
const created =
|
|
4919
|
-
|
|
5020
|
+
const created = _chunkOQVLEVNRcjs.createSessionOwnerKey.call(void 0, );
|
|
5021
|
+
_chunkOQVLEVNRcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
4920
5022
|
return { account: created.account, address: created.address };
|
|
4921
5023
|
}
|
|
4922
5024
|
function stableStringify(value) {
|
|
@@ -4966,14 +5068,14 @@ function computeCacheKey(input, sessionOwnerAddress) {
|
|
|
4966
5068
|
});
|
|
4967
5069
|
}
|
|
4968
5070
|
function computeIsCacheable(input) {
|
|
4969
|
-
return !input.forceRegister && !(_nullishCoalesce(_optionalChain([input, 'access',
|
|
5071
|
+
return !input.forceRegister && !(_nullishCoalesce(_optionalChain([input, 'access', _130 => _130.postBridgeActions, 'optionalAccess', _131 => _131.length]), () => ( 0)));
|
|
4970
5072
|
}
|
|
4971
5073
|
var SETUP_REQUEST_DEDUPE_TTL_MS = 3e4;
|
|
4972
5074
|
var setupRequestDedupe = /* @__PURE__ */ new Map();
|
|
4973
5075
|
function readDedupedAccountSetupResult(requestKey) {
|
|
4974
5076
|
const now = Date.now();
|
|
4975
5077
|
const existing = setupRequestDedupe.get(requestKey);
|
|
4976
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
5078
|
+
if (_optionalChain([existing, 'optionalAccess', _132 => _132.settled]) && existing.expiresAt > now && existing.result) {
|
|
4977
5079
|
return existing.result;
|
|
4978
5080
|
}
|
|
4979
5081
|
return null;
|
|
@@ -4984,16 +5086,16 @@ async function runAccountSetup(input, deps) {
|
|
|
4984
5086
|
try {
|
|
4985
5087
|
const sessionOwner = await resolveSessionOwner(input.ownerAddress);
|
|
4986
5088
|
const cacheKey = computeCacheKey(input, sessionOwner.address);
|
|
4987
|
-
|
|
5089
|
+
_chunkOQVLEVNRcjs.debugLog.call(void 0, debug, "account-setup", "setup:start", {
|
|
4988
5090
|
owner: input.ownerAddress,
|
|
4989
5091
|
sessionOwner: sessionOwner.address,
|
|
4990
|
-
hasPostBridgeActions: Boolean(_optionalChain([input, 'access',
|
|
5092
|
+
hasPostBridgeActions: Boolean(_optionalChain([input, 'access', _133 => _133.postBridgeActions, 'optionalAccess', _134 => _134.length])),
|
|
4991
5093
|
forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
|
|
4992
5094
|
});
|
|
4993
5095
|
const setup = await service.setupAccount({
|
|
4994
5096
|
ownerAddress: input.ownerAddress,
|
|
4995
5097
|
sessionOwnerAddress: sessionOwner.address,
|
|
4996
|
-
targetChain:
|
|
5098
|
+
targetChain: _chunkABVRVW3Pcjs.targetChainToCaip2.call(void 0, input.targetChain),
|
|
4997
5099
|
targetToken: input.targetToken,
|
|
4998
5100
|
recipient: input.recipient,
|
|
4999
5101
|
postBridgeActions: input.postBridgeActions,
|
|
@@ -5032,7 +5134,7 @@ async function runAccountSetup(input, deps) {
|
|
|
5032
5134
|
primaryType: typedData.primaryType,
|
|
5033
5135
|
message: typedData.message
|
|
5034
5136
|
});
|
|
5035
|
-
const sessionDetails =
|
|
5137
|
+
const sessionDetails = _chunkOQVLEVNRcjs.buildSessionDetails.call(void 0,
|
|
5036
5138
|
setup.sessionDetailsUnsigned,
|
|
5037
5139
|
signature
|
|
5038
5140
|
);
|
|
@@ -5046,13 +5148,13 @@ async function runAccountSetup(input, deps) {
|
|
|
5046
5148
|
eoaAddress: input.ownerAddress,
|
|
5047
5149
|
sessionOwner: sessionOwner.address,
|
|
5048
5150
|
target: {
|
|
5049
|
-
chain:
|
|
5151
|
+
chain: _chunkABVRVW3Pcjs.targetChainToCaip2.call(void 0, input.targetChain),
|
|
5050
5152
|
token: input.targetToken,
|
|
5051
5153
|
...input.recipient && { recipient: input.recipient },
|
|
5052
|
-
..._optionalChain([input, 'access',
|
|
5154
|
+
..._optionalChain([input, 'access', _135 => _135.postBridgeActions, 'optionalAccess', _136 => _136.length]) && {
|
|
5053
5155
|
postBridgeActions: input.postBridgeActions
|
|
5054
5156
|
},
|
|
5055
|
-
..._optionalChain([input, 'access',
|
|
5157
|
+
..._optionalChain([input, 'access', _137 => _137.outputTokenRules, 'optionalAccess', _138 => _138.length]) && {
|
|
5056
5158
|
outputTokenRules: input.outputTokenRules
|
|
5057
5159
|
},
|
|
5058
5160
|
...input.rejectUnmapped != null && {
|
|
@@ -5068,7 +5170,7 @@ async function runAccountSetup(input, deps) {
|
|
|
5068
5170
|
isRegistered: true
|
|
5069
5171
|
};
|
|
5070
5172
|
} catch (error) {
|
|
5071
|
-
|
|
5173
|
+
_chunkOQVLEVNRcjs.debugError.call(void 0, debug, "account-setup", "setup:failed", error, {
|
|
5072
5174
|
owner: input.ownerAddress
|
|
5073
5175
|
});
|
|
5074
5176
|
if (error instanceof SetupError) throw error;
|
|
@@ -5079,7 +5181,7 @@ function runAccountSetupDeduped(input, deps, requestKey) {
|
|
|
5079
5181
|
const now = Date.now();
|
|
5080
5182
|
const existing = setupRequestDedupe.get(requestKey);
|
|
5081
5183
|
if (existing && (!existing.settled || existing.expiresAt > now)) {
|
|
5082
|
-
|
|
5184
|
+
_chunkOQVLEVNRcjs.debugLog.call(void 0, deps.debug, "account-setup", "setup:dedupe-hit", {
|
|
5083
5185
|
owner: input.ownerAddress,
|
|
5084
5186
|
forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
|
|
5085
5187
|
});
|
|
@@ -5164,12 +5266,33 @@ function AccountPreparingSkeleton({
|
|
|
5164
5266
|
] });
|
|
5165
5267
|
}
|
|
5166
5268
|
var QR_AUTO_ADVANCE_HYDRATION_GRACE_MS = 1e3;
|
|
5269
|
+
var DAPP_IMPORT_RESOLVE_TIMEOUT_MS = 1e4;
|
|
5167
5270
|
function isSameRoute2(sourceChain, sourceToken, targetChain, targetToken) {
|
|
5168
5271
|
return sourceChain === targetChain && sourceToken.toLowerCase() === targetToken.toLowerCase();
|
|
5169
5272
|
}
|
|
5170
5273
|
var SWAPPED_SOURCE_CHAIN = 8453;
|
|
5171
5274
|
var SWAPPED_SOURCE_TOKEN = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
|
|
5172
5275
|
var SWAPPED_SOURCE_DECIMALS = 6;
|
|
5276
|
+
var DEFAULT_FIAT_ONRAMP_METHODS = [
|
|
5277
|
+
{
|
|
5278
|
+
method: "creditcard",
|
|
5279
|
+
label: "Debit/Credit card",
|
|
5280
|
+
sublabel: "Instant - $10,000 limit",
|
|
5281
|
+
icon: "card"
|
|
5282
|
+
},
|
|
5283
|
+
{
|
|
5284
|
+
method: "bank-transfer",
|
|
5285
|
+
label: "Bank transfer",
|
|
5286
|
+
sublabel: "Instant - $10,000 limit",
|
|
5287
|
+
icon: "bank"
|
|
5288
|
+
},
|
|
5289
|
+
{
|
|
5290
|
+
method: "apple-pay",
|
|
5291
|
+
label: "Apple pay",
|
|
5292
|
+
sublabel: "Instant - $10,000 limit",
|
|
5293
|
+
icon: "apple"
|
|
5294
|
+
}
|
|
5295
|
+
];
|
|
5173
5296
|
function getAddressKey(address) {
|
|
5174
5297
|
return address ? address.toLowerCase() : null;
|
|
5175
5298
|
}
|
|
@@ -5252,6 +5375,8 @@ function deriveStep(flow, d, p, activeEntry, fiat, exchange) {
|
|
|
5252
5375
|
balanceUsd: d.balanceUsd,
|
|
5253
5376
|
inputAmountUsd: _nullishCoalesce(d.inputAmountUsd, () => ( void 0))
|
|
5254
5377
|
};
|
|
5378
|
+
case "dapp-import-resolving":
|
|
5379
|
+
return { type: "dapp-import-resolving" };
|
|
5255
5380
|
case "dapp-import-asset-select":
|
|
5256
5381
|
if (!smartAccount) return { type: "setup" };
|
|
5257
5382
|
return { type: "dapp-import-asset-select", smartAccount };
|
|
@@ -5321,11 +5446,12 @@ function DepositFlow({
|
|
|
5321
5446
|
postBridgeActions,
|
|
5322
5447
|
outputTokenRules,
|
|
5323
5448
|
rejectUnmapped,
|
|
5324
|
-
signerAddress =
|
|
5449
|
+
signerAddress = _chunkABVRVW3Pcjs.DEFAULT_SIGNER_ADDRESS,
|
|
5325
5450
|
sessionChainIds,
|
|
5326
5451
|
forceRegister = false,
|
|
5327
5452
|
enableSolana = true,
|
|
5328
5453
|
dappImports,
|
|
5454
|
+
initialDappImport,
|
|
5329
5455
|
enableFiatOnramp = false,
|
|
5330
5456
|
enableQrTransfer = true,
|
|
5331
5457
|
fiatOnrampMethods,
|
|
@@ -5343,12 +5469,12 @@ function DepositFlow({
|
|
|
5343
5469
|
onError,
|
|
5344
5470
|
debug
|
|
5345
5471
|
}) {
|
|
5346
|
-
const onStepChangeRef =
|
|
5347
|
-
const onEventRef =
|
|
5348
|
-
const onLifecycleRef =
|
|
5349
|
-
const onErrorRef =
|
|
5472
|
+
const onStepChangeRef = _chunkOQVLEVNRcjs.useLatestRef.call(void 0, onStepChange);
|
|
5473
|
+
const onEventRef = _chunkOQVLEVNRcjs.useLatestRef.call(void 0, onEvent);
|
|
5474
|
+
const onLifecycleRef = _chunkOQVLEVNRcjs.useLatestRef.call(void 0, onLifecycle);
|
|
5475
|
+
const onErrorRef = _chunkOQVLEVNRcjs.useLatestRef.call(void 0, onError);
|
|
5350
5476
|
const hasInitialReownSession = Boolean(
|
|
5351
|
-
enableSolana ? _optionalChain([reownWallet, 'optionalAccess',
|
|
5477
|
+
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _139 => _139.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _140 => _140.address]) : _optionalChain([reownWallet, 'optionalAccess', _141 => _141.address])
|
|
5352
5478
|
);
|
|
5353
5479
|
const hasInitialWalletHydrationPending = Boolean(
|
|
5354
5480
|
dappAddress && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasInitialReownSession && !reownWallet.isReady)
|
|
@@ -5371,13 +5497,13 @@ function DepositFlow({
|
|
|
5371
5497
|
const stableWalletSelectionKeyRef = _react.useRef.call(void 0, null);
|
|
5372
5498
|
const logFlow = _react.useCallback.call(void 0,
|
|
5373
5499
|
(message, data) => {
|
|
5374
|
-
|
|
5500
|
+
_chunkOQVLEVNRcjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
|
|
5375
5501
|
},
|
|
5376
5502
|
[debug]
|
|
5377
5503
|
);
|
|
5378
5504
|
const logFlowError = _react.useCallback.call(void 0,
|
|
5379
5505
|
(message, error, data) => {
|
|
5380
|
-
|
|
5506
|
+
_chunkOQVLEVNRcjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
|
|
5381
5507
|
},
|
|
5382
5508
|
[debug]
|
|
5383
5509
|
);
|
|
@@ -5393,19 +5519,19 @@ function DepositFlow({
|
|
|
5393
5519
|
_viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals)
|
|
5394
5520
|
);
|
|
5395
5521
|
if (balanceUnits > 0) return asset.balanceUsd / balanceUnits;
|
|
5396
|
-
} catch (
|
|
5522
|
+
} catch (e28) {
|
|
5397
5523
|
}
|
|
5398
5524
|
}
|
|
5399
5525
|
}
|
|
5400
5526
|
return null;
|
|
5401
5527
|
}, []);
|
|
5402
5528
|
const dappSwitchChain = _react.useMemo.call(void 0, () => {
|
|
5403
|
-
if (!_optionalChain([dappWalletClient, 'optionalAccess',
|
|
5529
|
+
if (!_optionalChain([dappWalletClient, 'optionalAccess', _142 => _142.switchChain])) return void 0;
|
|
5404
5530
|
return async (chainId) => {
|
|
5405
|
-
await _optionalChain([dappWalletClient, 'access',
|
|
5531
|
+
await _optionalChain([dappWalletClient, 'access', _143 => _143.switchChain, 'optionalCall', _144 => _144({ id: chainId })]);
|
|
5406
5532
|
};
|
|
5407
5533
|
}, [dappWalletClient]);
|
|
5408
|
-
const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
5534
|
+
const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _145 => _145.account, 'optionalAccess', _146 => _146.address]), () => ( null));
|
|
5409
5535
|
const walletOptions = _react.useMemo.call(void 0, () => {
|
|
5410
5536
|
const options = [];
|
|
5411
5537
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -5419,7 +5545,7 @@ function DepositFlow({
|
|
|
5419
5545
|
});
|
|
5420
5546
|
seen.add(id);
|
|
5421
5547
|
}
|
|
5422
|
-
if (enableSolana && _optionalChain([reownWallet, 'optionalAccess',
|
|
5548
|
+
if (enableSolana && _optionalChain([reownWallet, 'optionalAccess', _147 => _147.isConnected]) && reownWallet.isSolana && reownWallet.solanaAddress && dappAddress) {
|
|
5423
5549
|
const id = _nullishCoalesce(reownWallet.caipAddress, () => ( `solana:${reownWallet.solanaAddress}`));
|
|
5424
5550
|
if (!seen.has(id)) {
|
|
5425
5551
|
options.push({
|
|
@@ -5431,7 +5557,7 @@ function DepositFlow({
|
|
|
5431
5557
|
});
|
|
5432
5558
|
seen.add(id);
|
|
5433
5559
|
}
|
|
5434
|
-
} else if (_optionalChain([reownWallet, 'optionalAccess',
|
|
5560
|
+
} else if (_optionalChain([reownWallet, 'optionalAccess', _148 => _148.address]) && reownWallet.isConnected && reownWallet.walletClient && reownWallet.publicClient && !seen.has(`evm:${reownWallet.address.toLowerCase()}`)) {
|
|
5435
5561
|
const id = `evm:${reownWallet.address.toLowerCase()}`;
|
|
5436
5562
|
if (!seen.has(id)) {
|
|
5437
5563
|
options.push({
|
|
@@ -5448,24 +5574,27 @@ function DepositFlow({
|
|
|
5448
5574
|
}, [
|
|
5449
5575
|
connectedWalletAddress,
|
|
5450
5576
|
dappAddress,
|
|
5451
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5452
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5453
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5454
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5455
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5577
|
+
_optionalChain([reownWallet, 'optionalAccess', _149 => _149.address]),
|
|
5578
|
+
_optionalChain([reownWallet, 'optionalAccess', _150 => _150.isConnected]),
|
|
5579
|
+
_optionalChain([reownWallet, 'optionalAccess', _151 => _151.walletClient]),
|
|
5580
|
+
_optionalChain([reownWallet, 'optionalAccess', _152 => _152.publicClient]),
|
|
5581
|
+
_optionalChain([reownWallet, 'optionalAccess', _153 => _153.icon]),
|
|
5456
5582
|
enableSolana,
|
|
5457
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5458
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5459
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5583
|
+
_optionalChain([reownWallet, 'optionalAccess', _154 => _154.isSolana]),
|
|
5584
|
+
_optionalChain([reownWallet, 'optionalAccess', _155 => _155.solanaAddress]),
|
|
5585
|
+
_optionalChain([reownWallet, 'optionalAccess', _156 => _156.caipAddress])
|
|
5460
5586
|
]);
|
|
5461
|
-
const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess',
|
|
5587
|
+
const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess', _157 => _157.account]) && dappAddress && !reownWallet && !enableFiatOnramp && !enableExchangeConnect;
|
|
5462
5588
|
const hasWalletOptions = walletOptions.length > 0;
|
|
5463
5589
|
const hasReownSession = Boolean(
|
|
5464
|
-
enableSolana ? _optionalChain([reownWallet, 'optionalAccess',
|
|
5590
|
+
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _158 => _158.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _159 => _159.address]) : _optionalChain([reownWallet, 'optionalAccess', _160 => _160.address])
|
|
5465
5591
|
);
|
|
5466
5592
|
const isWalletHydrationPending = Boolean(
|
|
5467
5593
|
dappAddress && !hasWalletOptions && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasReownSession && !reownWallet.isReady)
|
|
5468
5594
|
);
|
|
5595
|
+
const isDappImportWalletHydrating = Boolean(
|
|
5596
|
+
hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasReownSession && !reownWallet.isReady
|
|
5597
|
+
);
|
|
5469
5598
|
const showConnectStep = flowMode === null && !isConnectSelectionConfirmed;
|
|
5470
5599
|
_react.useEffect.call(void 0, () => {
|
|
5471
5600
|
if (!isWalletHydrationPending) {
|
|
@@ -5492,9 +5621,9 @@ function DepositFlow({
|
|
|
5492
5621
|
isConnectSelectionConfirmed,
|
|
5493
5622
|
selectedWalletId
|
|
5494
5623
|
]);
|
|
5495
|
-
const setupChainId = typeof targetChain === "number" && !
|
|
5496
|
-
const targetSymbol =
|
|
5497
|
-
const isTargetStablecoin =
|
|
5624
|
+
const setupChainId = typeof targetChain === "number" && !_chunkABVRVW3Pcjs.isVirtualDestination.call(void 0, targetChain) ? targetChain : typeof defaultSourceChain === "number" ? defaultSourceChain : _chains.base.id;
|
|
5625
|
+
const targetSymbol = _chunkABVRVW3Pcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
5626
|
+
const isTargetStablecoin = _chunkABVRVW3Pcjs.isStablecoinSymbol.call(void 0, targetSymbol);
|
|
5498
5627
|
const targetMarketPriceRef = _react.useRef.call(void 0, null);
|
|
5499
5628
|
_react.useEffect.call(void 0, () => {
|
|
5500
5629
|
targetMarketPriceRef.current = null;
|
|
@@ -5520,16 +5649,16 @@ function DepositFlow({
|
|
|
5520
5649
|
return {
|
|
5521
5650
|
ownerAddress: dappAddress,
|
|
5522
5651
|
walletClient: void 0,
|
|
5523
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
5652
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkOQVLEVNRcjs.getPublicClient.call(void 0, setupChainId))),
|
|
5524
5653
|
switchChain: void 0
|
|
5525
5654
|
};
|
|
5526
5655
|
}
|
|
5527
5656
|
if (canAutoLock) {
|
|
5528
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
5657
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _161 => _161.chain, 'optionalAccess', _162 => _162.id]), () => ( setupChainId));
|
|
5529
5658
|
return {
|
|
5530
5659
|
ownerAddress: dappWalletClient.account.address,
|
|
5531
5660
|
walletClient: dappWalletClient,
|
|
5532
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
5661
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkOQVLEVNRcjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
5533
5662
|
switchChain: dappSwitchChain
|
|
5534
5663
|
};
|
|
5535
5664
|
}
|
|
@@ -5543,24 +5672,24 @@ function DepositFlow({
|
|
|
5543
5672
|
return {
|
|
5544
5673
|
ownerAddress: dappAddress,
|
|
5545
5674
|
walletClient: void 0,
|
|
5546
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
5675
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkOQVLEVNRcjs.getPublicClient.call(void 0, setupChainId))),
|
|
5547
5676
|
switchChain: void 0
|
|
5548
5677
|
};
|
|
5549
5678
|
}
|
|
5550
|
-
if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess',
|
|
5551
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
5679
|
+
if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess', _163 => _163.account]) && selectedOption.address && dappWalletClient.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
5680
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _164 => _164.chain, 'optionalAccess', _165 => _165.id]), () => ( setupChainId));
|
|
5552
5681
|
return {
|
|
5553
5682
|
ownerAddress: dappWalletClient.account.address,
|
|
5554
5683
|
walletClient: dappWalletClient,
|
|
5555
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
5684
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkOQVLEVNRcjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
5556
5685
|
switchChain: dappSwitchChain
|
|
5557
5686
|
};
|
|
5558
5687
|
}
|
|
5559
|
-
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess',
|
|
5688
|
+
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess', _166 => _166.address]) && selectedOption.address && reownWallet.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
5560
5689
|
return {
|
|
5561
5690
|
ownerAddress: reownWallet.address,
|
|
5562
5691
|
walletClient: reownWallet.walletClient,
|
|
5563
|
-
publicClient: _nullishCoalesce(reownWallet.publicClient, () => (
|
|
5692
|
+
publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunkOQVLEVNRcjs.getPublicClient.call(void 0, setupChainId))),
|
|
5564
5693
|
switchChain: reownWallet.switchChain
|
|
5565
5694
|
};
|
|
5566
5695
|
}
|
|
@@ -5598,7 +5727,7 @@ function DepositFlow({
|
|
|
5598
5727
|
return {
|
|
5599
5728
|
ownerAddress: dappAddress,
|
|
5600
5729
|
walletClient: void 0,
|
|
5601
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
5730
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkOQVLEVNRcjs.getPublicClient.call(void 0, setupChainId))),
|
|
5602
5731
|
switchChain: void 0
|
|
5603
5732
|
};
|
|
5604
5733
|
}
|
|
@@ -5623,37 +5752,37 @@ function DepositFlow({
|
|
|
5623
5752
|
const selectedEvmWalletOwner = _react.useMemo.call(void 0, () => {
|
|
5624
5753
|
if (!selectedWalletId) return null;
|
|
5625
5754
|
const opt = walletOptions.find((o) => o.id === selectedWalletId);
|
|
5626
|
-
if (_optionalChain([opt, 'optionalAccess',
|
|
5755
|
+
if (_optionalChain([opt, 'optionalAccess', _167 => _167.kind]) === "external" && opt.address) {
|
|
5627
5756
|
return opt.address;
|
|
5628
5757
|
}
|
|
5629
|
-
if (_optionalChain([opt, 'optionalAccess',
|
|
5758
|
+
if (_optionalChain([opt, 'optionalAccess', _168 => _168.kind]) === "connected" && opt.address) {
|
|
5630
5759
|
return opt.address;
|
|
5631
5760
|
}
|
|
5632
5761
|
return null;
|
|
5633
5762
|
}, [selectedWalletId, walletOptions]);
|
|
5634
5763
|
const dappImportOwner = _react.useMemo.call(void 0, () => {
|
|
5635
5764
|
if (selectedEvmWalletOwner) return selectedEvmWalletOwner;
|
|
5636
|
-
if (_optionalChain([reownWallet, 'optionalAccess',
|
|
5765
|
+
if (_optionalChain([reownWallet, 'optionalAccess', _169 => _169.address]) && reownWallet.isConnected) {
|
|
5637
5766
|
return reownWallet.address;
|
|
5638
5767
|
}
|
|
5639
5768
|
if (connectedWalletAddress) return connectedWalletAddress;
|
|
5640
5769
|
return null;
|
|
5641
5770
|
}, [
|
|
5642
5771
|
selectedEvmWalletOwner,
|
|
5643
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5644
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5772
|
+
_optionalChain([reownWallet, 'optionalAccess', _170 => _170.address]),
|
|
5773
|
+
_optionalChain([reownWallet, 'optionalAccess', _171 => _171.isConnected]),
|
|
5645
5774
|
connectedWalletAddress
|
|
5646
5775
|
]);
|
|
5647
5776
|
const activeOwner = _react.useMemo.call(void 0,
|
|
5648
5777
|
() => resolveOwnerForMode(flowMode, {
|
|
5649
5778
|
dappAddress,
|
|
5650
|
-
walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess',
|
|
5779
|
+
walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _172 => _172.ownerAddress]), () => ( (canAutoLock ? connectedWalletAddress : selectedEvmWalletOwner))),
|
|
5651
5780
|
dappImportOwner
|
|
5652
5781
|
}),
|
|
5653
5782
|
[
|
|
5654
5783
|
flowMode,
|
|
5655
5784
|
dappAddress,
|
|
5656
|
-
_optionalChain([signerContext, 'optionalAccess',
|
|
5785
|
+
_optionalChain([signerContext, 'optionalAccess', _173 => _173.ownerAddress]),
|
|
5657
5786
|
canAutoLock,
|
|
5658
5787
|
connectedWalletAddress,
|
|
5659
5788
|
selectedEvmWalletOwner,
|
|
@@ -5682,12 +5811,12 @@ function DepositFlow({
|
|
|
5682
5811
|
return;
|
|
5683
5812
|
}
|
|
5684
5813
|
lastActiveSetupLifecycleKeyRef.current = lifecycleKey;
|
|
5685
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
5814
|
+
_optionalChain([onLifecycleRef, 'access', _174 => _174.current, 'optionalCall', _175 => _175({
|
|
5686
5815
|
type: "smart-account-changed",
|
|
5687
5816
|
evm: activeEntry.smartAccount,
|
|
5688
5817
|
solana: _nullishCoalesce(activeEntry.solanaDepositAddress, () => ( null))
|
|
5689
5818
|
})]);
|
|
5690
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
5819
|
+
_optionalChain([onLifecycleRef, 'access', _176 => _176.current, 'optionalCall', _177 => _177({
|
|
5691
5820
|
type: "connected",
|
|
5692
5821
|
address: activeOwner,
|
|
5693
5822
|
smartAccount: activeEntry.smartAccount
|
|
@@ -5730,11 +5859,14 @@ function DepositFlow({
|
|
|
5730
5859
|
portfolioAssetsRef.current = [];
|
|
5731
5860
|
}
|
|
5732
5861
|
}, [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" ||
|
|
5862
|
+
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
|
|
5863
|
+
// the chevron doesn't linger if a disconnect cleared the mode out from
|
|
5864
|
+
// under the step.
|
|
5865
|
+
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
5866
|
const currentBackHandler = canGoBackFromHere ? handleBack : void 0;
|
|
5735
5867
|
const currentScreen = showConnectStep ? "connect" : effectiveStep.type;
|
|
5736
5868
|
_react.useEffect.call(void 0, () => {
|
|
5737
|
-
_optionalChain([onStepChangeRef, 'access',
|
|
5869
|
+
_optionalChain([onStepChangeRef, 'access', _178 => _178.current, 'optionalCall', _179 => _179(currentBackHandler, currentScreen)]);
|
|
5738
5870
|
}, [currentBackHandler, currentScreen, onStepChangeRef]);
|
|
5739
5871
|
const lastModalHeightRef = _react.useRef.call(void 0, 0);
|
|
5740
5872
|
const modalContentElRef = _react.useRef.call(void 0, null);
|
|
@@ -5744,7 +5876,7 @@ function DepositFlow({
|
|
|
5744
5876
|
modalContentElRef.current = mc;
|
|
5745
5877
|
const ro = new ResizeObserver((entries) => {
|
|
5746
5878
|
for (const entry of entries) {
|
|
5747
|
-
const border = _optionalChain([entry, 'access',
|
|
5879
|
+
const border = _optionalChain([entry, 'access', _180 => _180.borderBoxSize, 'optionalAccess', _181 => _181[0], 'optionalAccess', _182 => _182.blockSize]);
|
|
5748
5880
|
lastModalHeightRef.current = typeof border === "number" ? border : entry.contentRect.height;
|
|
5749
5881
|
}
|
|
5750
5882
|
});
|
|
@@ -5785,23 +5917,23 @@ function DepositFlow({
|
|
|
5785
5917
|
}
|
|
5786
5918
|
lastStepOpenEventKeyRef.current = stepOpenEventKey;
|
|
5787
5919
|
if (effectiveStep.type === "select-asset") {
|
|
5788
|
-
_optionalChain([onEventRef, 'access',
|
|
5920
|
+
_optionalChain([onEventRef, 'access', _183 => _183.current, 'optionalCall', _184 => _184({
|
|
5789
5921
|
type: "deposit_modal_connected_wallet_select_source_open",
|
|
5790
5922
|
total_balance_in_external_wallet: totalBalanceUsd,
|
|
5791
5923
|
pred_balance: totalBalanceUsd
|
|
5792
5924
|
})]);
|
|
5793
5925
|
} else if (effectiveStep.type === "deposit-address") {
|
|
5794
|
-
const chainName =
|
|
5795
|
-
const tokenSymbol =
|
|
5796
|
-
_optionalChain([onEventRef, 'access',
|
|
5926
|
+
const chainName = _chunkABVRVW3Pcjs.getChainName.call(void 0, targetChain);
|
|
5927
|
+
const tokenSymbol = _chunkABVRVW3Pcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
5928
|
+
_optionalChain([onEventRef, 'access', _185 => _185.current, 'optionalCall', _186 => _186({
|
|
5797
5929
|
type: "deposit_modal_transfer_crypto_open",
|
|
5798
5930
|
default_chain: chainName,
|
|
5799
5931
|
default_token: tokenSymbol,
|
|
5800
5932
|
pred_balance: totalBalanceUsd
|
|
5801
5933
|
})]);
|
|
5802
5934
|
} else if (effectiveStep.type === "amount" && stepSendToken) {
|
|
5803
|
-
const receiveSymbol =
|
|
5804
|
-
_optionalChain([onEventRef, 'access',
|
|
5935
|
+
const receiveSymbol = _chunkABVRVW3Pcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
5936
|
+
_optionalChain([onEventRef, 'access', _187 => _187.current, 'optionalCall', _188 => _188({
|
|
5805
5937
|
type: "deposit_modal_connected_wallet_enter_value_open",
|
|
5806
5938
|
send_token: stepSendToken,
|
|
5807
5939
|
receive_token: receiveSymbol,
|
|
@@ -5834,7 +5966,7 @@ function DepositFlow({
|
|
|
5834
5966
|
targetToken
|
|
5835
5967
|
]);
|
|
5836
5968
|
_react.useEffect.call(void 0, () => {
|
|
5837
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
5969
|
+
_optionalChain([onLifecycleRef, 'access', _189 => _189.current, 'optionalCall', _190 => _190({
|
|
5838
5970
|
type: "balance-changed",
|
|
5839
5971
|
totalUsd: totalBalanceUsd
|
|
5840
5972
|
})]);
|
|
@@ -5850,7 +5982,7 @@ function DepositFlow({
|
|
|
5850
5982
|
const handleConfirmWallet = _react.useCallback.call(void 0,
|
|
5851
5983
|
(walletId) => {
|
|
5852
5984
|
const selectedOption = walletOptions.find((o) => o.id === walletId);
|
|
5853
|
-
const mode = enableSolana && _optionalChain([selectedOption, 'optionalAccess',
|
|
5985
|
+
const mode = enableSolana && _optionalChain([selectedOption, 'optionalAccess', _191 => _191.kind]) === "solana" ? "solana-wallet" : "wallet";
|
|
5854
5986
|
storeApi.dispatch({
|
|
5855
5987
|
type: "connect/wallet-confirmed",
|
|
5856
5988
|
walletId,
|
|
@@ -5860,7 +5992,7 @@ function DepositFlow({
|
|
|
5860
5992
|
[walletOptions, enableSolana, storeApi]
|
|
5861
5993
|
);
|
|
5862
5994
|
const isSolanaWalletConnected = Boolean(
|
|
5863
|
-
enableSolana && _optionalChain([reownWallet, 'optionalAccess',
|
|
5995
|
+
enableSolana && _optionalChain([reownWallet, 'optionalAccess', _192 => _192.isConnected]) && _optionalChain([reownWallet, 'optionalAccess', _193 => _193.isSolana])
|
|
5864
5996
|
);
|
|
5865
5997
|
const dappImportsKey = dappImports ? Object.keys(dappImports).filter((k) => dappImports[k]).sort().join(",") : "";
|
|
5866
5998
|
const enabledDappImportProviders = _react.useMemo.call(void 0,
|
|
@@ -5868,12 +6000,16 @@ function DepositFlow({
|
|
|
5868
6000
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- intentional: keyed on dappImportsKey, not the dappImports object identity
|
|
5869
6001
|
[dappImportsKey, isSolanaWalletConnected]
|
|
5870
6002
|
);
|
|
6003
|
+
const initialDappImportProvider = _react.useMemo.call(void 0,
|
|
6004
|
+
() => initialDappImport ? _nullishCoalesce(enabledDappImportProviders.find((p) => p.id === initialDappImport), () => ( null)) : null,
|
|
6005
|
+
[initialDappImport, enabledDappImportProviders]
|
|
6006
|
+
);
|
|
5871
6007
|
const handleSelectDappImport = _react.useCallback.call(void 0,
|
|
5872
6008
|
(providerId) => {
|
|
5873
6009
|
const owner = dappImportOwner;
|
|
5874
6010
|
if (owner) {
|
|
5875
6011
|
const wallet = walletOptions.find(
|
|
5876
|
-
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess',
|
|
6012
|
+
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _194 => _194.toLowerCase, 'call', _195 => _195()]) === owner.toLowerCase()
|
|
5877
6013
|
);
|
|
5878
6014
|
if (wallet) {
|
|
5879
6015
|
storeApi.dispatch({
|
|
@@ -5895,6 +6031,9 @@ function DepositFlow({
|
|
|
5895
6031
|
},
|
|
5896
6032
|
[storeApi]
|
|
5897
6033
|
);
|
|
6034
|
+
const dappImportAttemptNonce = useDepositStore(
|
|
6035
|
+
(s) => s.dappImport.attemptNonce
|
|
6036
|
+
);
|
|
5898
6037
|
_react.useEffect.call(void 0, () => {
|
|
5899
6038
|
if (!dappImportOwner || enabledDappImportProviders.length === 0) {
|
|
5900
6039
|
storeApi.dispatch({ type: "dapp-import/availability-cleared" });
|
|
@@ -5911,8 +6050,8 @@ function DepositFlow({
|
|
|
5911
6050
|
eoa: dappImportOwner,
|
|
5912
6051
|
getPublicClient: (chainId) => {
|
|
5913
6052
|
try {
|
|
5914
|
-
return
|
|
5915
|
-
} catch (
|
|
6053
|
+
return _chunkOQVLEVNRcjs.getPublicClient.call(void 0, chainId);
|
|
6054
|
+
} catch (e29) {
|
|
5916
6055
|
return null;
|
|
5917
6056
|
}
|
|
5918
6057
|
},
|
|
@@ -5928,15 +6067,29 @@ function DepositFlow({
|
|
|
5928
6067
|
}).catch(() => {
|
|
5929
6068
|
if (controller.signal.aborted) return;
|
|
5930
6069
|
storeApi.dispatch({
|
|
5931
|
-
type: "dapp-import/availability-
|
|
6070
|
+
type: "dapp-import/availability-failed",
|
|
5932
6071
|
providerId: provider.id,
|
|
5933
|
-
owner: dappImportOwner
|
|
5934
|
-
availability: null
|
|
6072
|
+
owner: dappImportOwner
|
|
5935
6073
|
});
|
|
5936
6074
|
});
|
|
5937
6075
|
}
|
|
5938
6076
|
return () => controller.abort();
|
|
5939
|
-
}, [
|
|
6077
|
+
}, [
|
|
6078
|
+
dappImportOwner,
|
|
6079
|
+
enabledDappImportProviders,
|
|
6080
|
+
dappImportAttemptNonce,
|
|
6081
|
+
storeApi
|
|
6082
|
+
]);
|
|
6083
|
+
_react.useLayoutEffect.call(void 0, () => {
|
|
6084
|
+
if (!initialDappImportProvider) return;
|
|
6085
|
+
if (flowSlice.step !== "connect" || flowSlice.mode !== null || flowSlice.isConnectSelectionConfirmed || flowSlice.hasNavigatedBack) {
|
|
6086
|
+
return;
|
|
6087
|
+
}
|
|
6088
|
+
storeApi.dispatch({
|
|
6089
|
+
type: "dapp-import/boot-requested",
|
|
6090
|
+
providerId: initialDappImportProvider.id
|
|
6091
|
+
});
|
|
6092
|
+
}, [initialDappImportProvider, flowSlice, storeApi]);
|
|
5940
6093
|
const dappImportAvailability = useDepositStore((s) => s.dappImport.availability);
|
|
5941
6094
|
const dappImportAvailabilityOwner = useDepositStore(
|
|
5942
6095
|
(s) => s.dappImport.availabilityOwner
|
|
@@ -5944,48 +6097,19 @@ function DepositFlow({
|
|
|
5944
6097
|
const activeDappImportProviderId = useDepositStore(
|
|
5945
6098
|
(s) => s.dappImport.activeProviderId
|
|
5946
6099
|
);
|
|
6100
|
+
const dappImportBootError = useDepositStore((s) => s.dappImport.bootError);
|
|
5947
6101
|
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
|
-
}),
|
|
6102
|
+
() => enabledDappImportProviders.map((provider) => ({
|
|
6103
|
+
id: provider.id,
|
|
6104
|
+
label: provider.label,
|
|
6105
|
+
icon: provider.icon,
|
|
6106
|
+
status: computeDappImportStatus(provider.id, {
|
|
6107
|
+
owner: dappImportOwner,
|
|
6108
|
+
availability: dappImportAvailability,
|
|
6109
|
+
availabilityOwner: dappImportAvailabilityOwner,
|
|
6110
|
+
setup: setupSlice
|
|
6111
|
+
})
|
|
6112
|
+
})),
|
|
5989
6113
|
[
|
|
5990
6114
|
enabledDappImportProviders,
|
|
5991
6115
|
dappImportAvailability,
|
|
@@ -6002,11 +6126,11 @@ function DepositFlow({
|
|
|
6002
6126
|
}, [activeDappImportProviderId, enabledDappImportProviders]);
|
|
6003
6127
|
const activeDappImportAvailability = _react.useMemo.call(void 0, () => {
|
|
6004
6128
|
if (!activeDappImportProviderId) return null;
|
|
6005
|
-
if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess',
|
|
6129
|
+
if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _196 => _196.toLowerCase, 'call', _197 => _197()]) !== dappImportOwner.toLowerCase()) {
|
|
6006
6130
|
return null;
|
|
6007
6131
|
}
|
|
6008
6132
|
const entry = dappImportAvailability[activeDappImportProviderId];
|
|
6009
|
-
if (!entry || entry === "loading") return null;
|
|
6133
|
+
if (!entry || entry === "loading" || entry === "error") return null;
|
|
6010
6134
|
return entry;
|
|
6011
6135
|
}, [
|
|
6012
6136
|
activeDappImportProviderId,
|
|
@@ -6014,6 +6138,96 @@ function DepositFlow({
|
|
|
6014
6138
|
dappImportAvailabilityOwner,
|
|
6015
6139
|
dappImportOwner
|
|
6016
6140
|
]);
|
|
6141
|
+
const isBootResolving = isDappImportMode && flowSlice.step === "dapp-import-resolving";
|
|
6142
|
+
const [hasResolveDeadlinePassed, setHasResolveDeadlinePassed] = _react.useState.call(void 0, false);
|
|
6143
|
+
_react.useEffect.call(void 0, () => {
|
|
6144
|
+
setHasResolveDeadlinePassed(false);
|
|
6145
|
+
if (!isBootResolving || dappImportBootError) return;
|
|
6146
|
+
const timeout = window.setTimeout(() => {
|
|
6147
|
+
setHasResolveDeadlinePassed(true);
|
|
6148
|
+
}, DAPP_IMPORT_RESOLVE_TIMEOUT_MS);
|
|
6149
|
+
return () => window.clearTimeout(timeout);
|
|
6150
|
+
}, [isBootResolving, dappImportBootError]);
|
|
6151
|
+
_react.useEffect.call(void 0, () => {
|
|
6152
|
+
if (!isBootResolving || dappImportBootError) return;
|
|
6153
|
+
const providerId = activeDappImportProviderId;
|
|
6154
|
+
if (!providerId) return;
|
|
6155
|
+
if (!enabledDappImportProviders.some((p) => p.id === providerId)) {
|
|
6156
|
+
storeApi.dispatch({
|
|
6157
|
+
type: "dapp-import/boot-resolved",
|
|
6158
|
+
providerId,
|
|
6159
|
+
outcome: "unavailable"
|
|
6160
|
+
});
|
|
6161
|
+
return;
|
|
6162
|
+
}
|
|
6163
|
+
const status = computeDappImportStatus(providerId, {
|
|
6164
|
+
owner: dappImportOwner,
|
|
6165
|
+
availability: dappImportAvailability,
|
|
6166
|
+
availabilityOwner: dappImportAvailabilityOwner,
|
|
6167
|
+
setup: setupSlice
|
|
6168
|
+
});
|
|
6169
|
+
const pinnableWallet = dappImportOwner ? _nullishCoalesce(walletOptions.find(
|
|
6170
|
+
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _198 => _198.toLowerCase, 'call', _199 => _199()]) === dappImportOwner.toLowerCase()
|
|
6171
|
+
), () => ( null)) : null;
|
|
6172
|
+
const outcome = resolveBootOutcome({
|
|
6173
|
+
status,
|
|
6174
|
+
setupStatus: readSetupForOwner(setupSlice, dappImportOwner).status,
|
|
6175
|
+
timedOut: hasResolveDeadlinePassed,
|
|
6176
|
+
walletHydrating: isDappImportWalletHydrating,
|
|
6177
|
+
signerAvailable: pinnableWallet !== null
|
|
6178
|
+
});
|
|
6179
|
+
if (outcome === "wait") return;
|
|
6180
|
+
if (outcome === "ready" && pinnableWallet) {
|
|
6181
|
+
storeApi.dispatch({
|
|
6182
|
+
type: "wallet/id-selected",
|
|
6183
|
+
walletId: pinnableWallet.id
|
|
6184
|
+
});
|
|
6185
|
+
}
|
|
6186
|
+
storeApi.dispatch({
|
|
6187
|
+
type: "dapp-import/boot-resolved",
|
|
6188
|
+
providerId,
|
|
6189
|
+
outcome
|
|
6190
|
+
});
|
|
6191
|
+
}, [
|
|
6192
|
+
isBootResolving,
|
|
6193
|
+
dappImportBootError,
|
|
6194
|
+
activeDappImportProviderId,
|
|
6195
|
+
enabledDappImportProviders,
|
|
6196
|
+
dappImportOwner,
|
|
6197
|
+
dappImportAvailability,
|
|
6198
|
+
dappImportAvailabilityOwner,
|
|
6199
|
+
setupSlice,
|
|
6200
|
+
hasResolveDeadlinePassed,
|
|
6201
|
+
isDappImportWalletHydrating,
|
|
6202
|
+
walletOptions,
|
|
6203
|
+
storeApi
|
|
6204
|
+
]);
|
|
6205
|
+
const handleBootRetry = _react.useCallback.call(void 0, () => {
|
|
6206
|
+
const snapshot = storeApi.getState();
|
|
6207
|
+
const providerId = snapshot.dappImport.activeProviderId;
|
|
6208
|
+
if (!providerId) return;
|
|
6209
|
+
if (dappImportOwner) {
|
|
6210
|
+
const plan = bootRetryPlan({
|
|
6211
|
+
setupStatus: readSetupForOwner(snapshot.setup, dappImportOwner).status,
|
|
6212
|
+
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
|
|
6213
|
+
});
|
|
6214
|
+
if (plan.restartSetup) {
|
|
6215
|
+
storeApi.dispatch({
|
|
6216
|
+
type: "setup/retry-requested",
|
|
6217
|
+
owner: dappImportOwner
|
|
6218
|
+
});
|
|
6219
|
+
}
|
|
6220
|
+
if (plan.refetchAvailability) {
|
|
6221
|
+
storeApi.dispatch({
|
|
6222
|
+
type: "dapp-import/availability-retry-requested"
|
|
6223
|
+
});
|
|
6224
|
+
}
|
|
6225
|
+
}
|
|
6226
|
+
storeApi.dispatch({
|
|
6227
|
+
type: "dapp-import/boot-requested",
|
|
6228
|
+
providerId
|
|
6229
|
+
});
|
|
6230
|
+
}, [storeApi, dappImportOwner]);
|
|
6017
6231
|
const handleSelectFiatMethod = _react.useCallback.call(void 0,
|
|
6018
6232
|
(paymentMethod) => {
|
|
6019
6233
|
storeApi.dispatch({
|
|
@@ -6036,7 +6250,7 @@ function DepositFlow({
|
|
|
6036
6250
|
[storeApi]
|
|
6037
6251
|
);
|
|
6038
6252
|
const handleNewDeposit = _react.useCallback.call(void 0, () => {
|
|
6039
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6253
|
+
_optionalChain([onLifecycleRef, 'access', _204 => _204.current, 'optionalCall', _205 => _205({
|
|
6040
6254
|
type: "smart-account-changed",
|
|
6041
6255
|
evm: null,
|
|
6042
6256
|
solana: null
|
|
@@ -6084,13 +6298,13 @@ function DepositFlow({
|
|
|
6084
6298
|
};
|
|
6085
6299
|
push(dappAddress);
|
|
6086
6300
|
push(connectedWalletAddress);
|
|
6087
|
-
push(_optionalChain([reownWallet, 'optionalAccess',
|
|
6301
|
+
push(_optionalChain([reownWallet, 'optionalAccess', _206 => _206.address]));
|
|
6088
6302
|
push(dappImportOwner);
|
|
6089
6303
|
return owners;
|
|
6090
6304
|
}, [
|
|
6091
6305
|
dappAddress,
|
|
6092
6306
|
connectedWalletAddress,
|
|
6093
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
6307
|
+
_optionalChain([reownWallet, 'optionalAccess', _207 => _207.address]),
|
|
6094
6308
|
dappImportOwner
|
|
6095
6309
|
]);
|
|
6096
6310
|
_react.useEffect.call(void 0, () => {
|
|
@@ -6104,7 +6318,7 @@ function DepositFlow({
|
|
|
6104
6318
|
try {
|
|
6105
6319
|
sessionOwner = await resolveSessionOwner(owner);
|
|
6106
6320
|
} catch (error) {
|
|
6107
|
-
|
|
6321
|
+
_chunkOQVLEVNRcjs.debugError.call(void 0,
|
|
6108
6322
|
debug,
|
|
6109
6323
|
"deposit-flow",
|
|
6110
6324
|
"session-owner:resolve-failed",
|
|
@@ -6195,7 +6409,7 @@ function DepositFlow({
|
|
|
6195
6409
|
sourceChain: data.sourceChain,
|
|
6196
6410
|
amount: data.amount
|
|
6197
6411
|
});
|
|
6198
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6412
|
+
_optionalChain([onLifecycleRef, 'access', _208 => _208.current, 'optionalCall', _209 => _209({ type: "submitted", ...data })]);
|
|
6199
6413
|
},
|
|
6200
6414
|
[logFlow, onLifecycleRef]
|
|
6201
6415
|
);
|
|
@@ -6214,8 +6428,8 @@ function DepositFlow({
|
|
|
6214
6428
|
);
|
|
6215
6429
|
const handleSolanaAmountContinue = _react.useCallback.call(void 0,
|
|
6216
6430
|
(token, sourceAmount, inputAmountUsd) => {
|
|
6217
|
-
const targetSym =
|
|
6218
|
-
const isTargetStable =
|
|
6431
|
+
const targetSym = _chunkABVRVW3Pcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
6432
|
+
const isTargetStable = _chunkABVRVW3Pcjs.isStablecoinSymbol.call(void 0, targetSym);
|
|
6219
6433
|
const targetTokenPriceUsd = isTargetStable ? 1 : _nullishCoalesce(getTokenPriceUsd(targetSym), () => ( targetMarketPriceRef.current));
|
|
6220
6434
|
logFlow("solana:amount:continue", {
|
|
6221
6435
|
token: token.symbol,
|
|
@@ -6255,7 +6469,7 @@ function DepositFlow({
|
|
|
6255
6469
|
sourceDecimals: tokenAtSubmit.decimals,
|
|
6256
6470
|
inputAmountUsd: amountUsd
|
|
6257
6471
|
});
|
|
6258
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6472
|
+
_optionalChain([onLifecycleRef, 'access', _210 => _210.current, 'optionalCall', _211 => _211({
|
|
6259
6473
|
type: "submitted",
|
|
6260
6474
|
txHash,
|
|
6261
6475
|
sourceChain: "solana",
|
|
@@ -6268,7 +6482,7 @@ function DepositFlow({
|
|
|
6268
6482
|
);
|
|
6269
6483
|
const handleAssetContinue = _react.useCallback.call(void 0,
|
|
6270
6484
|
(asset) => {
|
|
6271
|
-
_optionalChain([onEventRef, 'access',
|
|
6485
|
+
_optionalChain([onEventRef, 'access', _212 => _212.current, 'optionalCall', _213 => _213({
|
|
6272
6486
|
type: "deposit_modal_connected_wallet_select_source_cta_click",
|
|
6273
6487
|
total_balance_in_external_wallet: totalBalanceUsd,
|
|
6274
6488
|
pred_balance: totalBalanceUsd,
|
|
@@ -6291,8 +6505,8 @@ function DepositFlow({
|
|
|
6291
6505
|
activeOwner
|
|
6292
6506
|
);
|
|
6293
6507
|
if (entry.status !== "ready") return;
|
|
6294
|
-
const targetSym =
|
|
6295
|
-
const isTargetStable =
|
|
6508
|
+
const targetSym = _chunkABVRVW3Pcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
6509
|
+
const isTargetStable = _chunkABVRVW3Pcjs.isStablecoinSymbol.call(void 0, targetSym);
|
|
6296
6510
|
const targetTokenPriceUsd = isTargetStable ? 1 : _nullishCoalesce(getTokenPriceUsd(targetSym), () => ( targetMarketPriceRef.current));
|
|
6297
6511
|
storeApi.dispatch({
|
|
6298
6512
|
type: "amount/entered",
|
|
@@ -6322,8 +6536,8 @@ function DepositFlow({
|
|
|
6322
6536
|
sourceChain: chainId,
|
|
6323
6537
|
sourceToken: token,
|
|
6324
6538
|
amount,
|
|
6325
|
-
sourceSymbol: _optionalChain([asset, 'optionalAccess',
|
|
6326
|
-
sourceDecimals: _optionalChain([asset, 'optionalAccess',
|
|
6539
|
+
sourceSymbol: _optionalChain([asset, 'optionalAccess', _214 => _214.symbol]),
|
|
6540
|
+
sourceDecimals: _optionalChain([asset, 'optionalAccess', _215 => _215.decimals]),
|
|
6327
6541
|
inputAmountUsd: _nullishCoalesce(depositAtSubmit.inputAmountUsd, () => ( void 0)),
|
|
6328
6542
|
directTransfer: !dappImport && isSameRoute2(chainId, token, targetChain, targetToken)
|
|
6329
6543
|
});
|
|
@@ -6346,7 +6560,7 @@ function DepositFlow({
|
|
|
6346
6560
|
sourceSymbol: _nullishCoalesce(info.orderCrypto, () => ( "USDC")),
|
|
6347
6561
|
sourceDecimals: SWAPPED_SOURCE_DECIMALS
|
|
6348
6562
|
});
|
|
6349
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6563
|
+
_optionalChain([onLifecycleRef, 'access', _216 => _216.current, 'optionalCall', _217 => _217({
|
|
6350
6564
|
type: "submitted",
|
|
6351
6565
|
txHash: info.txHash,
|
|
6352
6566
|
sourceChain: SWAPPED_SOURCE_CHAIN,
|
|
@@ -6359,12 +6573,12 @@ function DepositFlow({
|
|
|
6359
6573
|
const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
|
|
6360
6574
|
(txHash, sourceChain, amount) => {
|
|
6361
6575
|
const depositAtSubmit = storeApi.getState().deposit;
|
|
6362
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6576
|
+
_optionalChain([onLifecycleRef, 'access', _218 => _218.current, 'optionalCall', _219 => _219({
|
|
6363
6577
|
type: "submitted",
|
|
6364
6578
|
txHash,
|
|
6365
6579
|
sourceChain,
|
|
6366
6580
|
amount,
|
|
6367
|
-
sourceDecimals: _optionalChain([depositAtSubmit, 'access',
|
|
6581
|
+
sourceDecimals: _optionalChain([depositAtSubmit, 'access', _220 => _220.selectedAsset, 'optionalAccess', _221 => _221.decimals]),
|
|
6368
6582
|
amountUsd: _nullishCoalesce(depositAtSubmit.inputAmountUsd, () => ( void 0))
|
|
6369
6583
|
})]);
|
|
6370
6584
|
},
|
|
@@ -6373,7 +6587,7 @@ function DepositFlow({
|
|
|
6373
6587
|
const handleDepositComplete = _react.useCallback.call(void 0,
|
|
6374
6588
|
(txHash, destinationTxHash, context) => {
|
|
6375
6589
|
logFlow("deposit:complete", { txHash, destinationTxHash, ...context });
|
|
6376
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6590
|
+
_optionalChain([onLifecycleRef, 'access', _222 => _222.current, 'optionalCall', _223 => _223({
|
|
6377
6591
|
type: "complete",
|
|
6378
6592
|
txHash,
|
|
6379
6593
|
destinationTxHash,
|
|
@@ -6385,14 +6599,14 @@ function DepositFlow({
|
|
|
6385
6599
|
const handleDepositFailed = _react.useCallback.call(void 0,
|
|
6386
6600
|
(txHash, error) => {
|
|
6387
6601
|
logFlowError("deposit:failed", error, { txHash });
|
|
6388
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6602
|
+
_optionalChain([onLifecycleRef, 'access', _224 => _224.current, 'optionalCall', _225 => _225({ type: "failed", txHash, error })]);
|
|
6389
6603
|
},
|
|
6390
6604
|
[logFlowError, onLifecycleRef]
|
|
6391
6605
|
);
|
|
6392
6606
|
const handleError = _react.useCallback.call(void 0,
|
|
6393
6607
|
(message, code) => {
|
|
6394
6608
|
logFlowError("flow:error", message, { code });
|
|
6395
|
-
_optionalChain([onErrorRef, 'access',
|
|
6609
|
+
_optionalChain([onErrorRef, 'access', _226 => _226.current, 'optionalCall', _227 => _227({ message, code })]);
|
|
6396
6610
|
},
|
|
6397
6611
|
[logFlowError, onErrorRef]
|
|
6398
6612
|
);
|
|
@@ -6414,10 +6628,17 @@ function DepositFlow({
|
|
|
6414
6628
|
}
|
|
6415
6629
|
}, [walletOptionsKey]);
|
|
6416
6630
|
_react.useEffect.call(void 0, () => {
|
|
6417
|
-
if (!showConnectStep && isConnectSelectionConfirmed && (flowMode === "wallet" || flowMode === "dapp-import") && !signerContext) {
|
|
6631
|
+
if (!showConnectStep && isConnectSelectionConfirmed && (flowMode === "wallet" || flowMode === "dapp-import") && flowSlice.step !== "dapp-import-resolving" && !signerContext) {
|
|
6418
6632
|
storeApi.dispatch({ type: "wallet/cleared" });
|
|
6419
6633
|
}
|
|
6420
|
-
}, [
|
|
6634
|
+
}, [
|
|
6635
|
+
showConnectStep,
|
|
6636
|
+
isConnectSelectionConfirmed,
|
|
6637
|
+
flowMode,
|
|
6638
|
+
flowSlice.step,
|
|
6639
|
+
signerContext,
|
|
6640
|
+
storeApi
|
|
6641
|
+
]);
|
|
6421
6642
|
_react.useEffect.call(void 0, () => {
|
|
6422
6643
|
if (enableSolana || flowMode !== "solana-wallet") {
|
|
6423
6644
|
return;
|
|
@@ -6428,7 +6649,7 @@ function DepositFlow({
|
|
|
6428
6649
|
}
|
|
6429
6650
|
}, [enableSolana, flowMode, storeApi]);
|
|
6430
6651
|
_react.useEffect.call(void 0, () => {
|
|
6431
|
-
if (hasNavigatedBack || isConnectSelectionConfirmed || flowMode || enableFiatOnramp || enableExchangeConnect) {
|
|
6652
|
+
if (hasNavigatedBack || isConnectSelectionConfirmed || flowMode || enableFiatOnramp || enableExchangeConnect || initialDappImportProvider) {
|
|
6432
6653
|
return;
|
|
6433
6654
|
}
|
|
6434
6655
|
if (enableQrTransfer && !hasWalletOptions && dappAddress && !hasReownSession && !dappWalletClient && hasQrAutoAdvanceGraceElapsed) {
|
|
@@ -6444,6 +6665,7 @@ function DepositFlow({
|
|
|
6444
6665
|
hasNavigatedBack,
|
|
6445
6666
|
dappAddress,
|
|
6446
6667
|
dappWalletClient,
|
|
6668
|
+
initialDappImportProvider,
|
|
6447
6669
|
handleSelectTransferCrypto
|
|
6448
6670
|
]);
|
|
6449
6671
|
const walletRows = _react.useMemo.call(void 0, () => {
|
|
@@ -6475,7 +6697,7 @@ function DepositFlow({
|
|
|
6475
6697
|
);
|
|
6476
6698
|
if (showConnectStep) {
|
|
6477
6699
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6478
|
-
|
|
6700
|
+
_chunkOQVLEVNRcjs.ConnectStep,
|
|
6479
6701
|
{
|
|
6480
6702
|
walletRows,
|
|
6481
6703
|
transferCryptoState: dappAddress ? transferCryptoState : void 0,
|
|
@@ -6487,8 +6709,7 @@ function DepositFlow({
|
|
|
6487
6709
|
}
|
|
6488
6710
|
handleSelectTransferCrypto();
|
|
6489
6711
|
} : void 0,
|
|
6490
|
-
|
|
6491
|
-
fiatPaymentMethods: enableFiatOnramp && dappAddress ? fiatOnrampMethods : void 0,
|
|
6712
|
+
fiatPaymentMethods: enableFiatOnramp && dappAddress ? fiatOnrampMethods && fiatOnrampMethods.length > 0 ? fiatOnrampMethods : DEFAULT_FIAT_ONRAMP_METHODS : void 0,
|
|
6492
6713
|
onSelectFiatMethod: enableFiatOnramp && dappAddress ? (method) => handleSelectFiatMethod(method) : void 0,
|
|
6493
6714
|
onSelectFundFromExchange: enableExchangeConnect && dappAddress ? () => handleSelectExchange() : void 0,
|
|
6494
6715
|
onRequestConnect,
|
|
@@ -6508,6 +6729,13 @@ function DepositFlow({
|
|
|
6508
6729
|
},
|
|
6509
6730
|
dappImports: connectStepDappImports,
|
|
6510
6731
|
onSelectDappImport: (providerId) => {
|
|
6732
|
+
const availabilityEntry = dappImportOwner && _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _228 => _228.toLowerCase, 'call', _229 => _229()]) === dappImportOwner.toLowerCase() ? dappImportAvailability[providerId] : void 0;
|
|
6733
|
+
if (availabilityEntry === "error") {
|
|
6734
|
+
storeApi.dispatch({
|
|
6735
|
+
type: "dapp-import/availability-retry-requested"
|
|
6736
|
+
});
|
|
6737
|
+
return;
|
|
6738
|
+
}
|
|
6511
6739
|
const dappImportEntry = readSetupForOwner(
|
|
6512
6740
|
setupSlice,
|
|
6513
6741
|
dappImportOwner
|
|
@@ -6547,15 +6775,15 @@ function DepositFlow({
|
|
|
6547
6775
|
allowedRoutes,
|
|
6548
6776
|
targetChain,
|
|
6549
6777
|
targetToken,
|
|
6550
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
6778
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _230 => _230.length])),
|
|
6551
6779
|
uiConfig,
|
|
6552
6780
|
onDepositSubmitted: handleDepositAddressSubmitted,
|
|
6553
6781
|
onDepositComplete: handleDepositComplete,
|
|
6554
6782
|
onDepositFailed: handleDepositFailed,
|
|
6555
6783
|
onCopyAddress: () => {
|
|
6556
|
-
const chainName =
|
|
6557
|
-
const tokenSymbol =
|
|
6558
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
6784
|
+
const chainName = _chunkABVRVW3Pcjs.getChainName.call(void 0, targetChain);
|
|
6785
|
+
const tokenSymbol = _chunkABVRVW3Pcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
6786
|
+
_optionalChain([onEvent, 'optionalCall', _231 => _231({
|
|
6559
6787
|
type: "deposit_modal_transfer_crypto_cta_click",
|
|
6560
6788
|
default_chain: chainName,
|
|
6561
6789
|
default_token: tokenSymbol,
|
|
@@ -6599,7 +6827,7 @@ function DepositFlow({
|
|
|
6599
6827
|
}
|
|
6600
6828
|
),
|
|
6601
6829
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6602
|
-
|
|
6830
|
+
_chunkOQVLEVNRcjs.ProcessingStep,
|
|
6603
6831
|
{
|
|
6604
6832
|
smartAccount: step.smartAccount,
|
|
6605
6833
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
@@ -6612,7 +6840,7 @@ function DepositFlow({
|
|
|
6612
6840
|
sourceSymbol: step.sourceSymbol,
|
|
6613
6841
|
sourceDecimals: step.sourceDecimals,
|
|
6614
6842
|
amountUsd: step.inputAmountUsd,
|
|
6615
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
6843
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _232 => _232.length])),
|
|
6616
6844
|
service,
|
|
6617
6845
|
directTransfer: step.directTransfer,
|
|
6618
6846
|
isSwappedOrder: true,
|
|
@@ -6666,7 +6894,7 @@ function DepositFlow({
|
|
|
6666
6894
|
}
|
|
6667
6895
|
),
|
|
6668
6896
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6669
|
-
|
|
6897
|
+
_chunkOQVLEVNRcjs.ProcessingStep,
|
|
6670
6898
|
{
|
|
6671
6899
|
smartAccount: step.smartAccount,
|
|
6672
6900
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
@@ -6679,7 +6907,7 @@ function DepositFlow({
|
|
|
6679
6907
|
sourceSymbol: step.sourceSymbol,
|
|
6680
6908
|
sourceDecimals: step.sourceDecimals,
|
|
6681
6909
|
amountUsd: step.inputAmountUsd,
|
|
6682
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
6910
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _233 => _233.length])),
|
|
6683
6911
|
service,
|
|
6684
6912
|
directTransfer: step.directTransfer,
|
|
6685
6913
|
isSwappedOrder: true,
|
|
@@ -6697,8 +6925,8 @@ function DepositFlow({
|
|
|
6697
6925
|
}
|
|
6698
6926
|
if (isSolanaWalletMode) {
|
|
6699
6927
|
if (!dappAddress) return null;
|
|
6700
|
-
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess',
|
|
6701
|
-
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess',
|
|
6928
|
+
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess', _234 => _234.solanaAddress]);
|
|
6929
|
+
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess', _235 => _235.solanaProvider]);
|
|
6702
6930
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
6703
6931
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6704
6932
|
AccountPreparingSkeleton,
|
|
@@ -6730,10 +6958,10 @@ function DepositFlow({
|
|
|
6730
6958
|
defaultAmount: effectiveStep.inputAmountUsd,
|
|
6731
6959
|
uiConfig,
|
|
6732
6960
|
targetChain,
|
|
6733
|
-
targetChainName:
|
|
6734
|
-
targetTokenSymbol:
|
|
6735
|
-
targetTokenIcon:
|
|
6736
|
-
|
|
6961
|
+
targetChainName: _chunkABVRVW3Pcjs.getChainName.call(void 0, targetChain),
|
|
6962
|
+
targetTokenSymbol: _chunkABVRVW3Pcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain),
|
|
6963
|
+
targetTokenIcon: _chunkABVRVW3Pcjs.getTokenIcon.call(void 0,
|
|
6964
|
+
_chunkABVRVW3Pcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain)
|
|
6737
6965
|
),
|
|
6738
6966
|
appBalanceUsd,
|
|
6739
6967
|
onContinue: handleSolanaAmountContinue,
|
|
@@ -6755,7 +6983,7 @@ function DepositFlow({
|
|
|
6755
6983
|
targetToken,
|
|
6756
6984
|
service,
|
|
6757
6985
|
solanaProvider,
|
|
6758
|
-
solanaConnection: _optionalChain([reownWallet, 'optionalAccess',
|
|
6986
|
+
solanaConnection: _optionalChain([reownWallet, 'optionalAccess', _236 => _236.solanaConnection]),
|
|
6759
6987
|
uiConfig,
|
|
6760
6988
|
onConfirm: handleSolanaConfirmed,
|
|
6761
6989
|
onError: handleError,
|
|
@@ -6796,7 +7024,7 @@ function DepositFlow({
|
|
|
6796
7024
|
) })
|
|
6797
7025
|
] }) : null,
|
|
6798
7026
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6799
|
-
|
|
7027
|
+
_chunkOQVLEVNRcjs.ProcessingStep,
|
|
6800
7028
|
{
|
|
6801
7029
|
smartAccount: effectiveStep.smartAccount,
|
|
6802
7030
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
@@ -6809,7 +7037,7 @@ function DepositFlow({
|
|
|
6809
7037
|
sourceSymbol: effectiveStep.sourceSymbol,
|
|
6810
7038
|
sourceDecimals: effectiveStep.sourceDecimals,
|
|
6811
7039
|
amountUsd: effectiveStep.inputAmountUsd,
|
|
6812
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
7040
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _237 => _237.length])),
|
|
6813
7041
|
service,
|
|
6814
7042
|
directTransfer: effectiveStep.directTransfer,
|
|
6815
7043
|
onClose,
|
|
@@ -6822,16 +7050,34 @@ function DepositFlow({
|
|
|
6822
7050
|
)
|
|
6823
7051
|
] });
|
|
6824
7052
|
}
|
|
6825
|
-
if (
|
|
7053
|
+
if (isDappImportMode && effectiveStep.type === "dapp-import-resolving") {
|
|
7054
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7055
|
+
"div",
|
|
7056
|
+
{
|
|
7057
|
+
className: "rs-modal-body",
|
|
7058
|
+
"data-flow-mode": "dapp-import",
|
|
7059
|
+
"data-step-type": effectiveStep.type,
|
|
7060
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7061
|
+
DappImportAssetSelectSkeleton,
|
|
7062
|
+
{
|
|
7063
|
+
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportProvider, 'optionalAccess', _238 => _238.sourceLabel]), () => ( "")),
|
|
7064
|
+
error: dappImportBootError,
|
|
7065
|
+
onRetry: handleBootRetry
|
|
7066
|
+
}
|
|
7067
|
+
)
|
|
7068
|
+
}
|
|
7069
|
+
);
|
|
7070
|
+
}
|
|
7071
|
+
if (!_optionalChain([signerContext, 'optionalAccess', _239 => _239.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _240 => _240.publicClient])) {
|
|
6826
7072
|
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
7073
|
}
|
|
6828
7074
|
const ownerAddress = signerContext.ownerAddress;
|
|
6829
|
-
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access',
|
|
7075
|
+
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
7076
|
const getReadClientForChain = (chainId) => {
|
|
6831
|
-
if (_optionalChain([signerContext, 'access',
|
|
7077
|
+
if (_optionalChain([signerContext, 'access', _247 => _247.publicClient, 'access', _248 => _248.chain, 'optionalAccess', _249 => _249.id]) === chainId) {
|
|
6832
7078
|
return signerContext.publicClient;
|
|
6833
7079
|
}
|
|
6834
|
-
return
|
|
7080
|
+
return _chunkOQVLEVNRcjs.getPublicClient.call(void 0, chainId);
|
|
6835
7081
|
};
|
|
6836
7082
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
6837
7083
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -6862,7 +7108,7 @@ function DepositFlow({
|
|
|
6862
7108
|
effectiveStep.type === "dapp-import-asset-select" && activeDappImportProvider && activeDappImportAvailability && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6863
7109
|
DappImportAssetSelectStep,
|
|
6864
7110
|
{
|
|
6865
|
-
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access',
|
|
7111
|
+
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access', _250 => _250.assets, 'access', _251 => _251[0], 'optionalAccess', _252 => _252.sourceLabel]), () => ( activeDappImportProvider.sourceLabel)),
|
|
6866
7112
|
assets: activeDappImportAvailability.assets,
|
|
6867
7113
|
onSelect: handleDappImportAssetSelected
|
|
6868
7114
|
}
|
|
@@ -6888,8 +7134,8 @@ function DepositFlow({
|
|
|
6888
7134
|
service,
|
|
6889
7135
|
onContinue: handleAmountContinue,
|
|
6890
7136
|
onCtaClick: (ctaName) => {
|
|
6891
|
-
const receiveSymbol =
|
|
6892
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
7137
|
+
const receiveSymbol = _chunkABVRVW3Pcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
7138
|
+
_optionalChain([onEvent, 'optionalCall', _253 => _253({
|
|
6893
7139
|
type: "deposit_modal_connected_wallet_enter_value_cta_click",
|
|
6894
7140
|
send_token: effectiveStep.asset.symbol,
|
|
6895
7141
|
receive_token: receiveSymbol,
|
|
@@ -6941,7 +7187,7 @@ function DepositFlow({
|
|
|
6941
7187
|
}
|
|
6942
7188
|
),
|
|
6943
7189
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6944
|
-
|
|
7190
|
+
_chunkOQVLEVNRcjs.ProcessingStep,
|
|
6945
7191
|
{
|
|
6946
7192
|
smartAccount: effectiveStep.smartAccount,
|
|
6947
7193
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
@@ -6954,7 +7200,7 @@ function DepositFlow({
|
|
|
6954
7200
|
sourceSymbol: effectiveStep.sourceSymbol,
|
|
6955
7201
|
sourceDecimals: effectiveStep.sourceDecimals,
|
|
6956
7202
|
amountUsd: effectiveStep.inputAmountUsd,
|
|
6957
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
7203
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _254 => _254.length])),
|
|
6958
7204
|
service,
|
|
6959
7205
|
directTransfer: effectiveStep.directTransfer,
|
|
6960
7206
|
uiConfig,
|
|
@@ -6986,15 +7232,15 @@ function formatDate(iso) {
|
|
|
6986
7232
|
month: "short",
|
|
6987
7233
|
year: "numeric"
|
|
6988
7234
|
});
|
|
6989
|
-
} catch (
|
|
7235
|
+
} catch (e30) {
|
|
6990
7236
|
return iso;
|
|
6991
7237
|
}
|
|
6992
7238
|
}
|
|
6993
7239
|
function resolveChainId(value) {
|
|
6994
7240
|
if (value === void 0 || value === null) return null;
|
|
6995
7241
|
if (typeof value === "number") return value;
|
|
6996
|
-
if (
|
|
6997
|
-
const parsed =
|
|
7242
|
+
if (_chunkABVRVW3Pcjs.isSolanaCaip2.call(void 0, value) || value === "solana") return "solana";
|
|
7243
|
+
const parsed = _chunkABVRVW3Pcjs.parseEvmChainId.call(void 0, value);
|
|
6998
7244
|
if (parsed !== null) return parsed;
|
|
6999
7245
|
const num = Number(value);
|
|
7000
7246
|
return Number.isFinite(num) ? num : null;
|
|
@@ -7003,7 +7249,7 @@ function resolveTokenSymbol(token, chainId) {
|
|
|
7003
7249
|
if (!token) return "";
|
|
7004
7250
|
if (chainId === "solana") {
|
|
7005
7251
|
const normalized = token.toLowerCase();
|
|
7006
|
-
const matched =
|
|
7252
|
+
const matched = _chunkABVRVW3Pcjs.SOLANA_TOKENS.find(
|
|
7007
7253
|
(entry) => entry.mint.toLowerCase() === normalized
|
|
7008
7254
|
);
|
|
7009
7255
|
if (matched) return matched.symbol;
|
|
@@ -7012,7 +7258,7 @@ function resolveTokenSymbol(token, chainId) {
|
|
|
7012
7258
|
}
|
|
7013
7259
|
}
|
|
7014
7260
|
if (chainId !== null && chainId !== void 0 && chainId !== "solana" && /^0x[a-fA-F0-9]{40}$/.test(token)) {
|
|
7015
|
-
const sym =
|
|
7261
|
+
const sym = _chunkABVRVW3Pcjs.getTokenSymbol.call(void 0, token, chainId);
|
|
7016
7262
|
if (sym !== "Token") return sym;
|
|
7017
7263
|
}
|
|
7018
7264
|
return shortenHash(token);
|
|
@@ -7023,7 +7269,7 @@ function formatAmount(rawAmount, token, chainId) {
|
|
|
7023
7269
|
if (token && chainId !== null && chainId !== void 0) {
|
|
7024
7270
|
if (chainId === "solana") {
|
|
7025
7271
|
const normalized = token.toLowerCase();
|
|
7026
|
-
const matched =
|
|
7272
|
+
const matched = _chunkABVRVW3Pcjs.SOLANA_TOKENS.find(
|
|
7027
7273
|
(entry) => entry.mint.toLowerCase() === normalized
|
|
7028
7274
|
);
|
|
7029
7275
|
if (matched) {
|
|
@@ -7032,7 +7278,7 @@ function formatAmount(rawAmount, token, chainId) {
|
|
|
7032
7278
|
decimals = 9;
|
|
7033
7279
|
}
|
|
7034
7280
|
} else if (/^0x[a-fA-F0-9]{40}$/.test(token)) {
|
|
7035
|
-
decimals =
|
|
7281
|
+
decimals = _chunkABVRVW3Pcjs.getTokenDecimalsByAddress.call(void 0, token, chainId);
|
|
7036
7282
|
}
|
|
7037
7283
|
}
|
|
7038
7284
|
try {
|
|
@@ -7044,13 +7290,13 @@ function formatAmount(rawAmount, token, chainId) {
|
|
|
7044
7290
|
let frac = fracStr.slice(0, 5).replace(/0+$/, "");
|
|
7045
7291
|
if (frac.length < 2) frac = frac.padEnd(2, "0");
|
|
7046
7292
|
return `${whole}.${frac}`;
|
|
7047
|
-
} catch (
|
|
7293
|
+
} catch (e31) {
|
|
7048
7294
|
return rawAmount;
|
|
7049
7295
|
}
|
|
7050
7296
|
}
|
|
7051
7297
|
function getTxExplorerUrl(txHash, chainId) {
|
|
7052
7298
|
if (!chainId) return null;
|
|
7053
|
-
const base2 =
|
|
7299
|
+
const base2 = _chunkABVRVW3Pcjs.getExplorerUrl.call(void 0, chainId);
|
|
7054
7300
|
if (!base2) return null;
|
|
7055
7301
|
return `${base2}/tx/${txHash}`;
|
|
7056
7302
|
}
|
|
@@ -7093,7 +7339,7 @@ function DepositHistoryPanel({
|
|
|
7093
7339
|
);
|
|
7094
7340
|
const visibleDeposits = _react.useMemo.call(void 0, () => {
|
|
7095
7341
|
const sourceHashes = new Set(
|
|
7096
|
-
deposits.map((d) => _optionalChain([d, 'access',
|
|
7342
|
+
deposits.map((d) => _optionalChain([d, 'access', _255 => _255.sourceTxHash, 'optionalAccess', _256 => _256.toLowerCase, 'call', _257 => _257()])).filter((h) => Boolean(h))
|
|
7097
7343
|
);
|
|
7098
7344
|
return deposits.filter(
|
|
7099
7345
|
(d) => !(d.txHash && sourceHashes.has(d.txHash.toLowerCase()))
|
|
@@ -7115,7 +7361,7 @@ function DepositHistoryPanel({
|
|
|
7115
7361
|
className: "rs-modal-header-back",
|
|
7116
7362
|
"aria-label": "Back",
|
|
7117
7363
|
onClick: onClose,
|
|
7118
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7364
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.ChevronLeftIcon, {})
|
|
7119
7365
|
}
|
|
7120
7366
|
) }),
|
|
7121
7367
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: onCloseModal && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -7125,29 +7371,29 @@ function DepositHistoryPanel({
|
|
|
7125
7371
|
className: "rs-modal-close",
|
|
7126
7372
|
"aria-label": "Close",
|
|
7127
7373
|
onClick: onCloseModal,
|
|
7128
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7374
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.CloseIcon, {})
|
|
7129
7375
|
}
|
|
7130
7376
|
) })
|
|
7131
7377
|
] }),
|
|
7132
7378
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen", children: [
|
|
7133
7379
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen-body", children: [
|
|
7134
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7380
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.HistoryIcon, {}), title: "History" }),
|
|
7135
7381
|
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,
|
|
7382
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.HistoryIcon, {}) }),
|
|
7137
7383
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
7138
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7384
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.Spinner, { className: "rs-spinner--sm" }),
|
|
7139
7385
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Loading history\u2026" })
|
|
7140
7386
|
] })
|
|
7141
7387
|
] }),
|
|
7142
7388
|
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,
|
|
7389
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.AlertTriangleIcon, {}) }),
|
|
7144
7390
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
7145
7391
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "Couldn't load history" }),
|
|
7146
7392
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: error })
|
|
7147
7393
|
] })
|
|
7148
7394
|
] }),
|
|
7149
7395
|
!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,
|
|
7396
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.HistoryIcon, {}) }),
|
|
7151
7397
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
7152
7398
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "No deposits yet" }),
|
|
7153
7399
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Your deposit history will appear here" })
|
|
@@ -7167,7 +7413,7 @@ function DepositHistoryPanel({
|
|
|
7167
7413
|
)
|
|
7168
7414
|
] })
|
|
7169
7415
|
] }),
|
|
7170
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7416
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.PoweredBy, {})
|
|
7171
7417
|
] })
|
|
7172
7418
|
]
|
|
7173
7419
|
}
|
|
@@ -7178,12 +7424,12 @@ function HistoryCard({ deposit }) {
|
|
|
7178
7424
|
const status = normalizeStatus(deposit.status, deposit.isSpam);
|
|
7179
7425
|
const sourceChainId = resolveChainId(deposit.chain);
|
|
7180
7426
|
const targetChainId = resolveChainId(deposit.targetChain);
|
|
7181
|
-
const sourceChainName = sourceChainId ?
|
|
7182
|
-
const targetChainName = targetChainId ?
|
|
7183
|
-
const sourceChainIcon = sourceChainId ?
|
|
7184
|
-
const targetChainIcon = targetChainId ?
|
|
7427
|
+
const sourceChainName = sourceChainId ? _chunkABVRVW3Pcjs.getChainName.call(void 0, sourceChainId) : null;
|
|
7428
|
+
const targetChainName = targetChainId ? _chunkABVRVW3Pcjs.getChainName.call(void 0, targetChainId) : null;
|
|
7429
|
+
const sourceChainIcon = sourceChainId ? _chunkABVRVW3Pcjs.getChainIcon.call(void 0, sourceChainId) : void 0;
|
|
7430
|
+
const targetChainIcon = targetChainId ? _chunkABVRVW3Pcjs.getChainIcon.call(void 0, targetChainId) : void 0;
|
|
7185
7431
|
const sourceSymbol = resolveTokenSymbol(deposit.token, sourceChainId);
|
|
7186
|
-
const sourceTokenIcon = sourceSymbol ?
|
|
7432
|
+
const sourceTokenIcon = sourceSymbol ? _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, sourceSymbol) : void 0;
|
|
7187
7433
|
const rawAmount = deposit.sourceAmount && deposit.sourceAmount !== "0" ? deposit.sourceAmount : deposit.amount;
|
|
7188
7434
|
const formattedAmount = rawAmount ? formatAmount(rawAmount, deposit.token, sourceChainId) : null;
|
|
7189
7435
|
const displayAmount = formattedAmount ? sourceSymbol && /^USD/.test(sourceSymbol) ? `$${Number(formattedAmount).toLocaleString("en-US", {
|
|
@@ -7242,7 +7488,7 @@ function HistoryCard({ deposit }) {
|
|
|
7242
7488
|
onClick: (e) => e.stopPropagation(),
|
|
7243
7489
|
children: [
|
|
7244
7490
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: shortenHash(deposit.sourceTxHash) }),
|
|
7245
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7491
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.ArrowUpRightIcon, {})
|
|
7246
7492
|
]
|
|
7247
7493
|
}
|
|
7248
7494
|
)
|
|
@@ -7257,7 +7503,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
|
7257
7503
|
// src/DepositModal.tsx
|
|
7258
7504
|
|
|
7259
7505
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
7260
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
7506
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-KFTMS2WX.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
7261
7507
|
);
|
|
7262
7508
|
function sortByCreatedAtDesc(items) {
|
|
7263
7509
|
return [...items].sort((a, b) => {
|
|
@@ -7306,13 +7552,14 @@ function DepositModalInner({
|
|
|
7306
7552
|
defaultAmount,
|
|
7307
7553
|
recipient,
|
|
7308
7554
|
appBalanceUsd,
|
|
7309
|
-
backendUrl =
|
|
7555
|
+
backendUrl = _chunkABVRVW3Pcjs.DEFAULT_BACKEND_URL,
|
|
7310
7556
|
solanaRpcUrl,
|
|
7311
|
-
signerAddress =
|
|
7557
|
+
signerAddress = _chunkABVRVW3Pcjs.DEFAULT_SIGNER_ADDRESS,
|
|
7312
7558
|
sessionChainIds,
|
|
7313
7559
|
forceRegister = false,
|
|
7314
7560
|
enableSolana = true,
|
|
7315
7561
|
dappImports,
|
|
7562
|
+
initialDappImport,
|
|
7316
7563
|
enableFiatOnramp = false,
|
|
7317
7564
|
enableQrTransfer = true,
|
|
7318
7565
|
fiatOnrampMethods,
|
|
@@ -7335,12 +7582,12 @@ function DepositModalInner({
|
|
|
7335
7582
|
debug
|
|
7336
7583
|
}) {
|
|
7337
7584
|
const modalRef = _react.useRef.call(void 0, null);
|
|
7338
|
-
const onReadyRef =
|
|
7585
|
+
const onReadyRef = _chunkOQVLEVNRcjs.useLatestRef.call(void 0, onReady);
|
|
7339
7586
|
const [currentScreen, setCurrentScreen] = _react.useState.call(void 0, "connect");
|
|
7340
7587
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
7341
7588
|
void 0
|
|
7342
7589
|
);
|
|
7343
|
-
const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
7590
|
+
const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _258 => _258.showHistoryButton]), () => ( false));
|
|
7344
7591
|
const historyButtonVisible = showHistoryButton && (currentScreen === "select-asset" || currentScreen === "deposit-address");
|
|
7345
7592
|
const [historyOpen, setHistoryOpen] = _react.useState.call(void 0, false);
|
|
7346
7593
|
const [historyDeposits, setHistoryDeposits] = _react.useState.call(void 0, []);
|
|
@@ -7351,22 +7598,22 @@ function DepositModalInner({
|
|
|
7351
7598
|
const cursorRef = _react.useRef.call(void 0, null);
|
|
7352
7599
|
const historyStaleRef = _react.useRef.call(void 0, false);
|
|
7353
7600
|
const historyLoadedRef = _react.useRef.call(void 0, false);
|
|
7354
|
-
const targetChain = targetChainProp === "solana" ? "solana" :
|
|
7355
|
-
const sourceChain = sourceChainProp ?
|
|
7601
|
+
const targetChain = targetChainProp === "solana" ? "solana" : _chunkABVRVW3Pcjs.getChainId.call(void 0, targetChainProp);
|
|
7602
|
+
const sourceChain = sourceChainProp ? _chunkABVRVW3Pcjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
7356
7603
|
const [recipientIsContract, setRecipientIsContract] = _react.useState.call(void 0, false);
|
|
7357
|
-
const onErrorRef =
|
|
7604
|
+
const onErrorRef = _chunkOQVLEVNRcjs.useLatestRef.call(void 0, onError);
|
|
7358
7605
|
_react.useEffect.call(void 0, () => {
|
|
7359
|
-
if (targetChain !==
|
|
7606
|
+
if (targetChain !== _chunkABVRVW3Pcjs.HYPERCORE_CHAIN_ID || !_viem.isAddress.call(void 0, recipient, { strict: false })) {
|
|
7360
7607
|
setRecipientIsContract(false);
|
|
7361
7608
|
return;
|
|
7362
7609
|
}
|
|
7363
7610
|
let cancelled = false;
|
|
7364
|
-
|
|
7611
|
+
_chunkOQVLEVNRcjs.getHyperEvmReadClient.call(void 0, ).getCode({ address: recipient }).then((code) => {
|
|
7365
7612
|
if (cancelled) return;
|
|
7366
|
-
const isContract =
|
|
7613
|
+
const isContract = _chunkABVRVW3Pcjs.isContractBytecode.call(void 0, code);
|
|
7367
7614
|
setRecipientIsContract(isContract);
|
|
7368
7615
|
if (isContract) {
|
|
7369
|
-
_optionalChain([onErrorRef, 'access',
|
|
7616
|
+
_optionalChain([onErrorRef, 'access', _259 => _259.current, 'optionalCall', _260 => _260({
|
|
7370
7617
|
message: "HyperCore deposits require an EOA recipient; the configured recipient is a smart contract.",
|
|
7371
7618
|
code: "HYPERCORE_RECIPIENT_NOT_EOA"
|
|
7372
7619
|
})]);
|
|
@@ -7379,7 +7626,7 @@ function DepositModalInner({
|
|
|
7379
7626
|
};
|
|
7380
7627
|
}, [targetChain, recipient, onErrorRef]);
|
|
7381
7628
|
const service = _react.useMemo.call(void 0,
|
|
7382
|
-
() =>
|
|
7629
|
+
() => _chunkOQVLEVNRcjs.createDepositService.call(void 0, backendUrl, {
|
|
7383
7630
|
debug,
|
|
7384
7631
|
debugScope: "service:deposit"
|
|
7385
7632
|
}),
|
|
@@ -7395,7 +7642,7 @@ function DepositModalInner({
|
|
|
7395
7642
|
}, [store, targetChain, targetToken]);
|
|
7396
7643
|
_react.useEffect.call(void 0, () => {
|
|
7397
7644
|
if (isOpen && modalRef.current) {
|
|
7398
|
-
|
|
7645
|
+
_chunkOQVLEVNRcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
7399
7646
|
}
|
|
7400
7647
|
}, [isOpen, theme]);
|
|
7401
7648
|
_react.useEffect.call(void 0, () => {
|
|
@@ -7403,7 +7650,7 @@ function DepositModalInner({
|
|
|
7403
7650
|
}, [solanaRpcUrl]);
|
|
7404
7651
|
_react.useEffect.call(void 0, () => {
|
|
7405
7652
|
if (isOpen) {
|
|
7406
|
-
_optionalChain([onReadyRef, 'access',
|
|
7653
|
+
_optionalChain([onReadyRef, 'access', _261 => _261.current, 'optionalCall', _262 => _262()]);
|
|
7407
7654
|
}
|
|
7408
7655
|
}, [isOpen, onReadyRef]);
|
|
7409
7656
|
const handleStepChange = _react.useCallback.call(void 0,
|
|
@@ -7479,10 +7726,10 @@ function DepositModalInner({
|
|
|
7479
7726
|
fetchHistory("initial");
|
|
7480
7727
|
}
|
|
7481
7728
|
}, [historyOpen, fetchHistory]);
|
|
7482
|
-
const onLifecycleRef =
|
|
7729
|
+
const onLifecycleRef = _chunkOQVLEVNRcjs.useLatestRef.call(void 0, onLifecycle);
|
|
7483
7730
|
const handleLifecycle = _react.useCallback.call(void 0,
|
|
7484
7731
|
(event) => {
|
|
7485
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7732
|
+
_optionalChain([onLifecycleRef, 'access', _263 => _263.current, 'optionalCall', _264 => _264(event)]);
|
|
7486
7733
|
if (event.type === "smart-account-changed" && !event.evm && !event.solana) {
|
|
7487
7734
|
historyStaleRef.current = true;
|
|
7488
7735
|
}
|
|
@@ -7508,10 +7755,10 @@ function DepositModalInner({
|
|
|
7508
7755
|
store.dispatch({ type: "flow/reset" });
|
|
7509
7756
|
}
|
|
7510
7757
|
}, [isOpen, store]);
|
|
7511
|
-
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
7758
|
+
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _265 => _265.showBackButton]), () => ( true));
|
|
7512
7759
|
const canGoBack = backHandler !== void 0;
|
|
7513
7760
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7514
|
-
|
|
7761
|
+
_chunkOQVLEVNRcjs.Modal,
|
|
7515
7762
|
{
|
|
7516
7763
|
isOpen,
|
|
7517
7764
|
onClose,
|
|
@@ -7527,7 +7774,7 @@ function DepositModalInner({
|
|
|
7527
7774
|
className: "rs-modal-header-back",
|
|
7528
7775
|
"aria-label": "Go back",
|
|
7529
7776
|
onClick: backHandler,
|
|
7530
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7777
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.ChevronLeftIcon, {})
|
|
7531
7778
|
}
|
|
7532
7779
|
) }),
|
|
7533
7780
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
|
|
@@ -7539,7 +7786,7 @@ function DepositModalInner({
|
|
|
7539
7786
|
"aria-label": "Deposit history",
|
|
7540
7787
|
onClick: handleHistoryOpen,
|
|
7541
7788
|
disabled: !recipient,
|
|
7542
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7789
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.HistoryIcon, {})
|
|
7543
7790
|
}
|
|
7544
7791
|
),
|
|
7545
7792
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -7549,12 +7796,12 @@ function DepositModalInner({
|
|
|
7549
7796
|
onClick: onClose,
|
|
7550
7797
|
className: "rs-modal-close",
|
|
7551
7798
|
"aria-label": "Close",
|
|
7552
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7799
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.CloseIcon, {})
|
|
7553
7800
|
}
|
|
7554
7801
|
)
|
|
7555
7802
|
] })
|
|
7556
7803
|
] }),
|
|
7557
|
-
recipientIsContract ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7804
|
+
recipientIsContract ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkOQVLEVNRcjs.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
7805
|
DepositFlow,
|
|
7559
7806
|
{
|
|
7560
7807
|
dappWalletClient,
|
|
@@ -7577,6 +7824,7 @@ function DepositModalInner({
|
|
|
7577
7824
|
forceRegister,
|
|
7578
7825
|
enableSolana,
|
|
7579
7826
|
dappImports,
|
|
7827
|
+
initialDappImport,
|
|
7580
7828
|
enableFiatOnramp,
|
|
7581
7829
|
enableQrTransfer,
|
|
7582
7830
|
fiatOnrampMethods,
|