@rhinestone/deposit-modal 0.11.1 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{DepositModalReown-YGB73NMW.cjs → DepositModalReown-CH6FUTCR.cjs} +17 -17
- package/dist/{DepositModalReown-MO5QDLIT.mjs → DepositModalReown-SXAXHYTN.mjs} +7 -7
- package/dist/{chunk-SSQ27YFB.cjs → chunk-2BOEUV6B.cjs} +543 -540
- package/dist/{chunk-CWGUBFJL.mjs → chunk-2K44IE3V.mjs} +18 -23
- package/dist/{chunk-53IFZGSF.mjs → chunk-3STTWRAN.mjs} +0 -10
- package/dist/{chunk-MZ53PDIX.mjs → chunk-4ZXQPFNU.mjs} +1 -1
- package/dist/{chunk-ZQR36NCV.cjs → chunk-65MLWUQD.cjs} +95 -100
- package/dist/{chunk-JPRV36DT.cjs → chunk-75DVGSAX.cjs} +2 -2
- package/dist/{chunk-4FTI3GTB.cjs → chunk-DMYA7U53.cjs} +1 -1
- package/dist/{chunk-HUHBNYD3.cjs → chunk-FKHPVLJY.cjs} +81 -81
- package/dist/{chunk-YELNYILK.mjs → chunk-KPWB2JAX.mjs} +287 -284
- package/dist/{chunk-V6T7LORJ.mjs → chunk-NHGFU3WC.mjs} +1 -1
- package/dist/{chunk-URFSTNRS.mjs → chunk-O2TQLD4I.mjs} +1 -1
- package/dist/{chunk-OWYPKCYD.mjs → chunk-O4AXBFHU.mjs} +4 -4
- package/dist/{chunk-TENL4H64.cjs → chunk-O7BCVQ6L.cjs} +4 -14
- package/dist/{chunk-5746YXKC.mjs → chunk-PVWZN66D.mjs} +6 -6
- package/dist/{chunk-EIWOVX53.mjs → chunk-TQWEGW3A.mjs} +3 -3
- package/dist/{chunk-FVUXJ3RP.cjs → chunk-TYBMAUGH.cjs} +3 -3
- package/dist/{chunk-ZRIRCIQM.cjs → chunk-UGK4JRK6.cjs} +62 -62
- package/dist/{chunk-LQGYPM5B.cjs → chunk-ZLCY33FQ.cjs} +79 -79
- package/dist/claim.cjs +6 -6
- package/dist/claim.d.cts +2 -2
- package/dist/claim.d.ts +2 -2
- package/dist/claim.mjs +5 -5
- package/dist/constants.cjs +3 -3
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.mjs +2 -2
- package/dist/deposit.cjs +8 -8
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +7 -7
- package/dist/index.cjs +10 -10
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +9 -9
- package/dist/polymarket.cjs +5 -5
- package/dist/polymarket.mjs +2 -2
- package/dist/{types-CsGa-HxD.d.cts → types-BO4iP6fG.d.cts} +0 -1
- package/dist/{types-DdS8OySJ.d.ts → types-oFblf65g.d.ts} +0 -1
- package/dist/withdraw.cjs +6 -6
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +5 -5
- package/package.json +1 -1
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkFKHPVLJYcjs = require('./chunk-FKHPVLJY.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
var
|
|
23
|
+
var _chunkTYBMAUGHcjs = require('./chunk-TYBMAUGH.cjs');
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
@@ -86,7 +86,7 @@ var _chunkFVUXJ3RPcjs = require('./chunk-FVUXJ3RP.cjs');
|
|
|
86
86
|
|
|
87
87
|
|
|
88
88
|
|
|
89
|
-
var
|
|
89
|
+
var _chunk65MLWUQDcjs = require('./chunk-65MLWUQD.cjs');
|
|
90
90
|
|
|
91
91
|
|
|
92
92
|
|
|
@@ -97,7 +97,7 @@ var _chunkZQR36NCVcjs = require('./chunk-ZQR36NCV.cjs');
|
|
|
97
97
|
|
|
98
98
|
|
|
99
99
|
|
|
100
|
-
var
|
|
100
|
+
var _chunk75DVGSAXcjs = require('./chunk-75DVGSAX.cjs');
|
|
101
101
|
|
|
102
102
|
|
|
103
103
|
|
|
@@ -129,8 +129,7 @@ var _chunkJPRV36DTcjs = require('./chunk-JPRV36DT.cjs');
|
|
|
129
129
|
|
|
130
130
|
|
|
131
131
|
|
|
132
|
-
|
|
133
|
-
var _chunkTENL4H64cjs = require('./chunk-TENL4H64.cjs');
|
|
132
|
+
var _chunkO7BCVQ6Lcjs = require('./chunk-O7BCVQ6L.cjs');
|
|
134
133
|
|
|
135
134
|
// src/DepositModal.tsx
|
|
136
135
|
|
|
@@ -220,14 +219,14 @@ SegmentedToggle.displayName = "SegmentedToggle";
|
|
|
220
219
|
// src/components/ui/ChainIcon.tsx
|
|
221
220
|
|
|
222
221
|
function ChainIcon({ chainId, className, loading }) {
|
|
223
|
-
const badge =
|
|
224
|
-
const catalogChain =
|
|
225
|
-
const name = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _2 => _2.name]), () => (
|
|
222
|
+
const badge = _chunkO7BCVQ6Lcjs.getChainBadge.call(void 0, chainId);
|
|
223
|
+
const catalogChain = _chunk65MLWUQDcjs.useCatalogChain.call(void 0, _chunk65MLWUQDcjs.catalogKeyForChain.call(void 0, chainId));
|
|
224
|
+
const name = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _2 => _2.name]), () => ( _chunkO7BCVQ6Lcjs.getChainName.call(void 0, chainId)));
|
|
226
225
|
const initial = (_nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _3 => _3.name]), () => ( badge.shortLabel))).charAt(0);
|
|
227
226
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
228
|
-
|
|
227
|
+
_chunk65MLWUQDcjs.CdnIcon,
|
|
229
228
|
{
|
|
230
|
-
src: _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _4 => _4.iconUrl]), () => (
|
|
229
|
+
src: _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _4 => _4.iconUrl]), () => ( _chunkO7BCVQ6Lcjs.getChainIcon.call(void 0, chainId))),
|
|
231
230
|
alt: name,
|
|
232
231
|
className,
|
|
233
232
|
loading,
|
|
@@ -248,16 +247,16 @@ ChainIcon.displayName = "ChainIcon";
|
|
|
248
247
|
// src/components/ui/WalletBadgeIcons/index.tsx
|
|
249
248
|
|
|
250
249
|
function BadgeImage({ src, alt = "" }) {
|
|
251
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
250
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.CdnIcon, { src, alt }) });
|
|
252
251
|
}
|
|
253
252
|
var WALLET_BADGES = ["rabby", "phantom", "walletconnect"];
|
|
254
253
|
function WalletBadgeIcons() {
|
|
255
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-list-row-meta-icons", children: WALLET_BADGES.map((slug) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BadgeImage, { src:
|
|
254
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-list-row-meta-icons", children: WALLET_BADGES.map((slug) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BadgeImage, { src: _chunkO7BCVQ6Lcjs.cdnIconUrl.call(void 0, "wallets", slug) }, slug)) });
|
|
256
255
|
}
|
|
257
256
|
WalletBadgeIcons.displayName = "WalletBadgeIcons";
|
|
258
257
|
var TRANSFER_CHAIN_BADGES = ["mainnet", "solana", "base"];
|
|
259
258
|
function ChainBadgeIcons() {
|
|
260
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-list-row-meta-icons", children: TRANSFER_CHAIN_BADGES.map((slug) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BadgeImage, { src:
|
|
259
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-list-row-meta-icons", children: TRANSFER_CHAIN_BADGES.map((slug) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BadgeImage, { src: _chunkO7BCVQ6Lcjs.cdnIconUrl.call(void 0, "chains", slug) }, slug)) });
|
|
261
260
|
}
|
|
262
261
|
ChainBadgeIcons.displayName = "ChainBadgeIcons";
|
|
263
262
|
var MAX_WALLET_CHAIN_MARKS = 3;
|
|
@@ -277,23 +276,23 @@ var DAPP_IMPORT_CATALOG = [
|
|
|
277
276
|
{
|
|
278
277
|
id: "polymarket",
|
|
279
278
|
label: "Polymarket",
|
|
280
|
-
iconUrl:
|
|
279
|
+
iconUrl: _chunkO7BCVQ6Lcjs.cdnIconUrl.call(void 0, "dapps", "polymarket")
|
|
281
280
|
},
|
|
282
281
|
{
|
|
283
282
|
id: "aave",
|
|
284
283
|
label: "Aave",
|
|
285
|
-
iconUrl:
|
|
284
|
+
iconUrl: _chunkO7BCVQ6Lcjs.cdnIconUrl.call(void 0, "dapps", "aave")
|
|
286
285
|
},
|
|
287
286
|
{
|
|
288
287
|
id: "hyperliquid",
|
|
289
288
|
label: "Hyperliquid",
|
|
290
|
-
iconUrl:
|
|
289
|
+
iconUrl: _chunkO7BCVQ6Lcjs.cdnIconUrl.call(void 0, "dapps", "hyperliquid"),
|
|
291
290
|
comingSoon: true
|
|
292
291
|
},
|
|
293
292
|
{
|
|
294
293
|
id: "morpho",
|
|
295
294
|
label: "Morpho",
|
|
296
|
-
iconUrl:
|
|
295
|
+
iconUrl: _chunkO7BCVQ6Lcjs.cdnIconUrl.call(void 0, "dapps", "morpho"),
|
|
297
296
|
comingSoon: true
|
|
298
297
|
}
|
|
299
298
|
];
|
|
@@ -301,7 +300,7 @@ var DAPP_IMPORT_CATALOG = [
|
|
|
301
300
|
// src/components/ui/BrandIcons.tsx
|
|
302
301
|
|
|
303
302
|
function ExchangeBadgeImage({ name }) {
|
|
304
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
303
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.CdnIcon, { src: _nullishCoalesce(_chunkFKHPVLJYcjs.getExchangeLogoSrc.call(void 0, name), () => ( void 0)) });
|
|
305
304
|
}
|
|
306
305
|
var CARD_NETWORKS = ["amex", "visa", "mastercard"];
|
|
307
306
|
function CardNetworkIcons() {
|
|
@@ -309,7 +308,7 @@ function CardNetworkIcons() {
|
|
|
309
308
|
"span",
|
|
310
309
|
{
|
|
311
310
|
className: `rs-card-network rs-card-network--${network}`,
|
|
312
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
311
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.CdnIcon, { src: _chunkO7BCVQ6Lcjs.cdnIconUrl.call(void 0, "cards", network) })
|
|
313
312
|
},
|
|
314
313
|
network
|
|
315
314
|
)) });
|
|
@@ -328,7 +327,7 @@ function DappBadgeIcons() {
|
|
|
328
327
|
).filter(
|
|
329
328
|
(brand) => Boolean(brand)
|
|
330
329
|
);
|
|
331
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-list-row-meta-icons rs-list-row-meta-icons--exchanges", children: marks.map((brand) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
330
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-list-row-meta-icons rs-list-row-meta-icons--exchanges", children: marks.map((brand) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.CdnIcon, { src: brand.iconUrl, alt: brand.label }) }, brand.id)) });
|
|
332
331
|
}
|
|
333
332
|
DappBadgeIcons.displayName = "DappBadgeIcons";
|
|
334
333
|
var DAPP_BADGE_COUNT = DAPP_BADGE_ORDER.length;
|
|
@@ -348,9 +347,9 @@ function balanceSubtitle(status, balanceUsd, fallback) {
|
|
|
348
347
|
return "No balance";
|
|
349
348
|
}
|
|
350
349
|
function fiatIcon(name) {
|
|
351
|
-
if (name === "apple") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
352
|
-
if (name === "bank") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
353
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
350
|
+
if (name === "apple") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.AppleIcon, {});
|
|
351
|
+
if (name === "bank") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.BankIcon, {});
|
|
352
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.CardIcon, {});
|
|
354
353
|
}
|
|
355
354
|
function FiatMethodIcon({ option }) {
|
|
356
355
|
const [remoteFailed, setRemoteFailed] = _react.useState.call(void 0, false);
|
|
@@ -433,20 +432,20 @@ function renderWalletLeading(row) {
|
|
|
433
432
|
}
|
|
434
433
|
);
|
|
435
434
|
}
|
|
436
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
435
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.WalletIcon, {});
|
|
437
436
|
}
|
|
438
|
-
var TRANSFER_CRYPTO_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
439
|
-
var WALLET_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
440
|
-
var EXCHANGE_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
441
|
-
var MIGRATE_ASSETS_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
442
|
-
var SMALL_SPINNER = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
437
|
+
var TRANSFER_CRYPTO_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.TransferCryptoIcon, {});
|
|
438
|
+
var WALLET_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.WalletIcon, {});
|
|
439
|
+
var EXCHANGE_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.UnplugIcon, {});
|
|
440
|
+
var MIGRATE_ASSETS_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.MigrateAssetsIcon, {});
|
|
441
|
+
var SMALL_SPINNER = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.Spinner, { className: "rs-spinner--sm" });
|
|
443
442
|
var CONNECT_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
444
443
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, WalletBadgeIcons, {}),
|
|
445
444
|
"+100"
|
|
446
445
|
] });
|
|
447
446
|
var EXTRA_EXCHANGE_COUNT = Math.max(
|
|
448
447
|
0,
|
|
449
|
-
|
|
448
|
+
_chunk65MLWUQDcjs.SUPPORTED_CONNECT_EXCHANGE_COUNT - EXCHANGE_BADGE_COUNT
|
|
450
449
|
);
|
|
451
450
|
var EXCHANGE_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
452
451
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExchangeBadgeIcons, {}),
|
|
@@ -460,7 +459,7 @@ var MIGRATE_ASSETS_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxrunt
|
|
|
460
459
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, DappBadgeIcons, {}),
|
|
461
460
|
EXTRA_DAPP_COUNT > 0 ? `+${EXTRA_DAPP_COUNT}` : null
|
|
462
461
|
] });
|
|
463
|
-
var EXTRA_CHAIN_COUNT = Math.max(0,
|
|
462
|
+
var EXTRA_CHAIN_COUNT = Math.max(0, _chunkO7BCVQ6Lcjs.getSupportedChainIds.call(void 0, ).length - 3);
|
|
464
463
|
var CHAIN_BADGE_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
465
464
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChainBadgeIcons, {}),
|
|
466
465
|
EXTRA_CHAIN_COUNT > 0 ? `+${EXTRA_CHAIN_COUNT}` : null
|
|
@@ -504,7 +503,7 @@ function ConnectStep({
|
|
|
504
503
|
if (onSelectTransferCrypto) {
|
|
505
504
|
cryptoRows.push(
|
|
506
505
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
507
|
-
|
|
506
|
+
_chunkTYBMAUGHcjs.ListRow,
|
|
508
507
|
{
|
|
509
508
|
leading: TRANSFER_CRYPTO_LEADING,
|
|
510
509
|
title: "Transfer crypto",
|
|
@@ -525,7 +524,7 @@ function ConnectStep({
|
|
|
525
524
|
);
|
|
526
525
|
cryptoRows.push(
|
|
527
526
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
528
|
-
|
|
527
|
+
_chunkTYBMAUGHcjs.ListRow,
|
|
529
528
|
{
|
|
530
529
|
leading: renderWalletLeading(row),
|
|
531
530
|
title: collapseToExternal ? "External wallet" : row.label,
|
|
@@ -542,7 +541,7 @@ function ConnectStep({
|
|
|
542
541
|
if (!hasReownWallet && handleConnect) {
|
|
543
542
|
cryptoRows.push(
|
|
544
543
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
545
|
-
|
|
544
|
+
_chunkTYBMAUGHcjs.ListRow,
|
|
546
545
|
{
|
|
547
546
|
leading: WALLET_LEADING,
|
|
548
547
|
title: "Connect wallet",
|
|
@@ -557,7 +556,7 @@ function ConnectStep({
|
|
|
557
556
|
if (onSelectFundFromExchange) {
|
|
558
557
|
cryptoRows.push(
|
|
559
558
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
560
|
-
|
|
559
|
+
_chunkTYBMAUGHcjs.ListRow,
|
|
561
560
|
{
|
|
562
561
|
leading: EXCHANGE_LEADING,
|
|
563
562
|
title: "Connect exchange",
|
|
@@ -572,7 +571,7 @@ function ConnectStep({
|
|
|
572
571
|
if (onSelectMigrateAssets) {
|
|
573
572
|
cryptoRows.push(
|
|
574
573
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
575
|
-
|
|
574
|
+
_chunkTYBMAUGHcjs.ListRow,
|
|
576
575
|
{
|
|
577
576
|
leading: MIGRATE_ASSETS_LEADING,
|
|
578
577
|
title: "Migrate assets",
|
|
@@ -593,7 +592,7 @@ function ConnectStep({
|
|
|
593
592
|
for (const opt of fiatPaymentMethods) {
|
|
594
593
|
cashRows.push(
|
|
595
594
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
596
|
-
|
|
595
|
+
_chunkTYBMAUGHcjs.ListRow,
|
|
597
596
|
{
|
|
598
597
|
leading: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FiatMethodIcon, { option: opt }),
|
|
599
598
|
title: opt.label,
|
|
@@ -608,7 +607,7 @@ function ConnectStep({
|
|
|
608
607
|
} else if (fiatLoading) {
|
|
609
608
|
cashRows.push(
|
|
610
609
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
611
|
-
|
|
610
|
+
_chunkTYBMAUGHcjs.ListRow,
|
|
612
611
|
{
|
|
613
612
|
leading: SMALL_SPINNER,
|
|
614
613
|
title: "Loading payment options\u2026",
|
|
@@ -637,9 +636,9 @@ function ConnectStep({
|
|
|
637
636
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
638
637
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
639
638
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
640
|
-
|
|
639
|
+
_chunk65MLWUQDcjs.BodyHeader,
|
|
641
640
|
{
|
|
642
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
641
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.HandCoinsIcon, {}),
|
|
643
642
|
title,
|
|
644
643
|
subtitle: _nullishCoalesce(subtitle, () => ( defaultSubtitle)),
|
|
645
644
|
aside: showToggle ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -675,7 +674,7 @@ function ConnectStep({
|
|
|
675
674
|
children: "Disconnect wallet"
|
|
676
675
|
}
|
|
677
676
|
) }),
|
|
678
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
677
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.PoweredBy, {})
|
|
679
678
|
] });
|
|
680
679
|
}
|
|
681
680
|
ConnectStep.displayName = "ConnectStep";
|
|
@@ -698,17 +697,17 @@ function AssetSelectStep({
|
|
|
698
697
|
const [selectedAssetId, setSelectedAssetId] = _react.useState.call(void 0, null);
|
|
699
698
|
const [loading, setLoading] = _react.useState.call(void 0, true);
|
|
700
699
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
701
|
-
const isDepositChain =
|
|
702
|
-
const { catalog } =
|
|
703
|
-
const chainName =
|
|
700
|
+
const isDepositChain = _chunk65MLWUQDcjs.useIsDepositChain.call(void 0, );
|
|
701
|
+
const { catalog } = _chunk65MLWUQDcjs.useChainCatalog.call(void 0, );
|
|
702
|
+
const chainName = _chunk65MLWUQDcjs.useChainName.call(void 0, );
|
|
704
703
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
705
704
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
706
|
-
return
|
|
705
|
+
return _chunk65MLWUQDcjs.getAssetId.call(void 0, {
|
|
707
706
|
chainId: defaultSourceChain,
|
|
708
707
|
token: defaultSourceToken
|
|
709
708
|
});
|
|
710
709
|
}, [defaultSourceChain, defaultSourceToken]);
|
|
711
|
-
const onTotalBalanceComputedRef =
|
|
710
|
+
const onTotalBalanceComputedRef = _chunk65MLWUQDcjs.useLatestRef.call(void 0, onTotalBalanceComputed);
|
|
712
711
|
_react.useEffect.call(void 0, () => {
|
|
713
712
|
let active = true;
|
|
714
713
|
function emitAssetsUpdate(currentAssets) {
|
|
@@ -728,11 +727,11 @@ function AssetSelectStep({
|
|
|
728
727
|
try {
|
|
729
728
|
const portfolio = await service.fetchPortfolio(address);
|
|
730
729
|
if (!active) return;
|
|
731
|
-
const portfolioAssets =
|
|
730
|
+
const portfolioAssets = _chunk65MLWUQDcjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
732
731
|
setAssets(portfolioAssets);
|
|
733
732
|
emitAssetsUpdate(portfolioAssets);
|
|
734
733
|
const hasNative = portfolioAssets.some(
|
|
735
|
-
(asset) => asset.token.toLowerCase() ===
|
|
734
|
+
(asset) => asset.token.toLowerCase() === _chunkO7BCVQ6Lcjs.NATIVE_TOKEN_ADDRESS
|
|
736
735
|
);
|
|
737
736
|
if (!hasNative) {
|
|
738
737
|
const connectedChainId = _optionalChain([publicClient, 'access', _11 => _11.chain, 'optionalAccess', _12 => _12.id]);
|
|
@@ -779,7 +778,7 @@ function AssetSelectStep({
|
|
|
779
778
|
} catch (e2) {
|
|
780
779
|
return false;
|
|
781
780
|
}
|
|
782
|
-
const isNativeToken = a.token.toLowerCase() ===
|
|
781
|
+
const isNativeToken = a.token.toLowerCase() === _chunkO7BCVQ6Lcjs.NATIVE_TOKEN_ADDRESS;
|
|
783
782
|
if (!isNativeToken && !(typeof a.balanceUsd === "number" && a.balanceUsd >= 0.01))
|
|
784
783
|
return false;
|
|
785
784
|
return true;
|
|
@@ -807,7 +806,7 @@ function AssetSelectStep({
|
|
|
807
806
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
808
807
|
const numeric = Number(raw);
|
|
809
808
|
if (!Number.isFinite(numeric)) return raw;
|
|
810
|
-
return
|
|
809
|
+
return _chunk65MLWUQDcjs.tokenFormatter.format(numeric);
|
|
811
810
|
} catch (e3) {
|
|
812
811
|
return asset.balance;
|
|
813
812
|
}
|
|
@@ -815,20 +814,20 @@ function AssetSelectStep({
|
|
|
815
814
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
816
815
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
817
816
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
818
|
-
|
|
817
|
+
_chunk65MLWUQDcjs.BodyHeader,
|
|
819
818
|
{
|
|
820
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
819
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.WalletIcon, {}),
|
|
821
820
|
title: "Your assets",
|
|
822
821
|
subtitle: "Select source assets to transfer"
|
|
823
822
|
}
|
|
824
823
|
),
|
|
825
824
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
826
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
825
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
827
826
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
828
827
|
] }),
|
|
829
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
828
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.Callout, { variant: "error", children: error }),
|
|
830
829
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
831
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
830
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
832
831
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
833
832
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
834
833
|
address.slice(0, 6),
|
|
@@ -848,8 +847,8 @@ function AssetSelectStep({
|
|
|
848
847
|
!loading && !error && rows.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: rows.map((asset) => {
|
|
849
848
|
const isSelected = selectedAssetId === asset.id;
|
|
850
849
|
const tokenAmount = formatBalance(asset);
|
|
851
|
-
const badge =
|
|
852
|
-
const chainIcon =
|
|
850
|
+
const badge = _chunkO7BCVQ6Lcjs.getChainBadge.call(void 0, asset.chainId);
|
|
851
|
+
const chainIcon = _chunkO7BCVQ6Lcjs.getChainIcon.call(void 0, asset.chainId);
|
|
853
852
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
854
853
|
"button",
|
|
855
854
|
{
|
|
@@ -861,13 +860,13 @@ function AssetSelectStep({
|
|
|
861
860
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
|
|
862
861
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-icon-wrapper", children: [
|
|
863
862
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
864
|
-
|
|
863
|
+
_chunk65MLWUQDcjs.TokenIcon,
|
|
865
864
|
{
|
|
866
865
|
symbol: asset.symbol,
|
|
867
866
|
fallback: asset.symbol.slice(0, 4)
|
|
868
867
|
}
|
|
869
868
|
) }),
|
|
870
|
-
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
869
|
+
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.CdnIcon, { src: chainIcon, alt: chainName(asset.chainId) }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
871
870
|
"span",
|
|
872
871
|
{
|
|
873
872
|
className: "rs-asset-chain-badge",
|
|
@@ -894,14 +893,14 @@ function AssetSelectStep({
|
|
|
894
893
|
] })
|
|
895
894
|
] })
|
|
896
895
|
] }),
|
|
897
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ?
|
|
896
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunk65MLWUQDcjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
898
897
|
]
|
|
899
898
|
},
|
|
900
899
|
asset.id
|
|
901
900
|
);
|
|
902
901
|
}) }),
|
|
903
902
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
904
|
-
|
|
903
|
+
_chunk65MLWUQDcjs.Button,
|
|
905
904
|
{
|
|
906
905
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
907
906
|
disabled: !selectedAsset,
|
|
@@ -910,7 +909,7 @@ function AssetSelectStep({
|
|
|
910
909
|
}
|
|
911
910
|
)
|
|
912
911
|
] }),
|
|
913
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
912
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.PoweredBy, {})
|
|
914
913
|
] });
|
|
915
914
|
}
|
|
916
915
|
async function fetchNativeAssets(address, publicClient, existing, isDepositChain, catalogChain) {
|
|
@@ -918,20 +917,20 @@ async function fetchNativeAssets(address, publicClient, existing, isDepositChain
|
|
|
918
917
|
const connectedChainId = _optionalChain([publicClient, 'access', _16 => _16.chain, 'optionalAccess', _17 => _17.id]);
|
|
919
918
|
if (!connectedChainId) return [];
|
|
920
919
|
if (!isDepositChain(connectedChainId)) return [];
|
|
921
|
-
const id =
|
|
920
|
+
const id = _chunk65MLWUQDcjs.getAssetId.call(void 0, {
|
|
922
921
|
chainId: connectedChainId,
|
|
923
|
-
token:
|
|
922
|
+
token: _chunkO7BCVQ6Lcjs.NATIVE_TOKEN_ADDRESS
|
|
924
923
|
});
|
|
925
924
|
if (existingIds.has(id)) return [];
|
|
926
925
|
try {
|
|
927
926
|
const balance = await publicClient.getBalance({ address });
|
|
928
|
-
const nativeSymbol = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _18 => _18.nativeToken, 'access', _19 => _19.symbol]), () => (
|
|
927
|
+
const nativeSymbol = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _18 => _18.nativeToken, 'access', _19 => _19.symbol]), () => ( _chunkO7BCVQ6Lcjs.getNativeSymbol.call(void 0, connectedChainId)));
|
|
929
928
|
const nativeDecimals = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _20 => _20.nativeToken, 'access', _21 => _21.decimals]), () => ( 18));
|
|
930
929
|
return [
|
|
931
930
|
{
|
|
932
931
|
id,
|
|
933
932
|
chainId: connectedChainId,
|
|
934
|
-
token:
|
|
933
|
+
token: _chunkO7BCVQ6Lcjs.NATIVE_TOKEN_ADDRESS,
|
|
935
934
|
symbol: nativeSymbol,
|
|
936
935
|
name: nativeSymbol,
|
|
937
936
|
decimals: nativeDecimals,
|
|
@@ -1091,9 +1090,9 @@ function AmountStep({
|
|
|
1091
1090
|
const chainMismatch = Boolean(
|
|
1092
1091
|
_optionalChain([walletClient, 'optionalAccess', _26 => _26.chain, 'optionalAccess', _27 => _27.id]) && walletClient.chain.id !== asset.chainId
|
|
1093
1092
|
);
|
|
1094
|
-
const targetChainId =
|
|
1095
|
-
const targetSymbol =
|
|
1096
|
-
const isSourceStablecoin =
|
|
1093
|
+
const targetChainId = _chunkO7BCVQ6Lcjs.targetChainToChainId.call(void 0, targetChain);
|
|
1094
|
+
const targetSymbol = _chunkO7BCVQ6Lcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
1095
|
+
const isSourceStablecoin = _chunkO7BCVQ6Lcjs.isStablecoinSymbol.call(void 0, asset.symbol);
|
|
1097
1096
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
1098
1097
|
if (tokenPriceUsdOverride !== void 0 && tokenPriceUsdOverride > 0)
|
|
1099
1098
|
return tokenPriceUsdOverride;
|
|
@@ -1121,7 +1120,7 @@ function AmountStep({
|
|
|
1121
1120
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
1122
1121
|
if (!balanceTarget || !publicClient) return;
|
|
1123
1122
|
try {
|
|
1124
|
-
const bal =
|
|
1123
|
+
const bal = _chunk65MLWUQDcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
1125
1124
|
address: asset.token,
|
|
1126
1125
|
abi: _viem.erc20Abi,
|
|
1127
1126
|
functionName: "balanceOf",
|
|
@@ -1142,7 +1141,7 @@ function AmountStep({
|
|
|
1142
1141
|
hasAttemptedSwitch.current = true;
|
|
1143
1142
|
switchChain(asset.chainId).catch((err) => {
|
|
1144
1143
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
1145
|
-
setError(
|
|
1144
|
+
setError(_chunk65MLWUQDcjs.formatUserError.call(void 0, raw));
|
|
1146
1145
|
});
|
|
1147
1146
|
}
|
|
1148
1147
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -1195,7 +1194,7 @@ function AmountStep({
|
|
|
1195
1194
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
1196
1195
|
const numeric = Number(raw);
|
|
1197
1196
|
if (!Number.isFinite(numeric)) return raw;
|
|
1198
|
-
return
|
|
1197
|
+
return _chunk65MLWUQDcjs.tokenFormatter.format(numeric);
|
|
1199
1198
|
} catch (e8) {
|
|
1200
1199
|
return "\u2026";
|
|
1201
1200
|
}
|
|
@@ -1214,7 +1213,7 @@ function AmountStep({
|
|
|
1214
1213
|
return null;
|
|
1215
1214
|
}
|
|
1216
1215
|
}, [numericAmount, isSourceStablecoin, hasPricing, tokenPriceUsd, asset.decimals]);
|
|
1217
|
-
const minDepositUsd =
|
|
1216
|
+
const minDepositUsd = _chunkO7BCVQ6Lcjs.isHyperCoreDestination.call(void 0, targetChain) ? Math.max(_chunkO7BCVQ6Lcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _28 => _28.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _29 => _29.minDepositUsd]), () => ( null));
|
|
1218
1217
|
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _30 => _30.maxDepositUsd]), () => ( null));
|
|
1219
1218
|
const isBelowMin = minDepositUsd !== null && numericAmount > 0 && amountUsd < minDepositUsd;
|
|
1220
1219
|
const isAboveMax = maxDepositUsd !== null && amountUsd > maxDepositUsd;
|
|
@@ -1280,12 +1279,12 @@ function AmountStep({
|
|
|
1280
1279
|
};
|
|
1281
1280
|
const continueLabel = exceedsBalance ? "Insufficient balance" : isAboveMax ? "Continue with max allowed deposit" : isBelowMin ? "Continue with minimum deposit" : "Continue";
|
|
1282
1281
|
const continueDisabled = chainMismatch || exceedsBalance || numericAmount === 0 && !isBelowMin || balance === null;
|
|
1283
|
-
const chainName =
|
|
1282
|
+
const chainName = _chunk65MLWUQDcjs.useChainName.call(void 0, );
|
|
1284
1283
|
const sourceChainName = chainName(asset.chainId);
|
|
1285
1284
|
const targetChainName = chainName(targetChainId);
|
|
1286
1285
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
1287
1286
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
1288
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1287
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.WalletIcon, {}), title: "Wallet deposit" }),
|
|
1289
1288
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
1290
1289
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
1291
1290
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1305,13 +1304,13 @@ function AmountStep({
|
|
|
1305
1304
|
" available",
|
|
1306
1305
|
balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1307
1306
|
" (~",
|
|
1308
|
-
|
|
1307
|
+
_chunk65MLWUQDcjs.currencyFormatter.format(balanceUsd),
|
|
1309
1308
|
")"
|
|
1310
1309
|
] })
|
|
1311
1310
|
] }),
|
|
1312
1311
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
1313
1312
|
"Min. deposit ",
|
|
1314
|
-
|
|
1313
|
+
_chunk65MLWUQDcjs.currencyFormatter.format(minDepositUsd)
|
|
1315
1314
|
] })
|
|
1316
1315
|
] })
|
|
1317
1316
|
] }),
|
|
@@ -1336,7 +1335,7 @@ function AmountStep({
|
|
|
1336
1335
|
" ",
|
|
1337
1336
|
asset.symbol
|
|
1338
1337
|
] }),
|
|
1339
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1338
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.TokenIcon, { symbol: asset.symbol }) })
|
|
1340
1339
|
] })
|
|
1341
1340
|
] }),
|
|
1342
1341
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
@@ -1347,17 +1346,17 @@ function AmountStep({
|
|
|
1347
1346
|
" ",
|
|
1348
1347
|
targetSymbol
|
|
1349
1348
|
] }),
|
|
1350
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1349
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.TokenIcon, { symbol: targetSymbol }) })
|
|
1351
1350
|
] })
|
|
1352
1351
|
] }),
|
|
1353
1352
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
1354
1353
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
1355
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
1354
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunk65MLWUQDcjs.currencyFormatter.format(balanceAfterUsd) })
|
|
1356
1355
|
] })
|
|
1357
1356
|
] }),
|
|
1358
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1357
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.Callout, { variant: "error", children: error }),
|
|
1359
1358
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1360
|
-
|
|
1359
|
+
_chunk65MLWUQDcjs.Button,
|
|
1361
1360
|
{
|
|
1362
1361
|
onClick: handleContinue,
|
|
1363
1362
|
fullWidth: true,
|
|
@@ -1366,7 +1365,7 @@ function AmountStep({
|
|
|
1366
1365
|
}
|
|
1367
1366
|
)
|
|
1368
1367
|
] }),
|
|
1369
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1368
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.PoweredBy, {})
|
|
1370
1369
|
] });
|
|
1371
1370
|
}
|
|
1372
1371
|
|
|
@@ -1429,40 +1428,40 @@ function ConfirmStep({
|
|
|
1429
1428
|
recipient
|
|
1430
1429
|
]);
|
|
1431
1430
|
const quote = setupReady && _optionalChain([quoteResult, 'optionalAccess', _35 => _35.requestKey]) === quoteRequestKey ? quoteResult.quote : null;
|
|
1432
|
-
const targetChainId =
|
|
1433
|
-
const targetSymbol = sameRoute ? asset.symbol :
|
|
1434
|
-
const sourceChainName =
|
|
1435
|
-
const targetChainName =
|
|
1436
|
-
const sourceChainIcon =
|
|
1437
|
-
const targetChainIcon =
|
|
1438
|
-
const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? _nullishCoalesce(
|
|
1439
|
-
const mustHaveQuote = !appFeesResolved ||
|
|
1431
|
+
const targetChainId = _chunkO7BCVQ6Lcjs.targetChainToChainId.call(void 0, targetChain);
|
|
1432
|
+
const targetSymbol = sameRoute ? asset.symbol : _chunkO7BCVQ6Lcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
1433
|
+
const sourceChainName = _chunkO7BCVQ6Lcjs.getChainName.call(void 0, asset.chainId);
|
|
1434
|
+
const targetChainName = _chunkO7BCVQ6Lcjs.getChainName.call(void 0, targetChainId);
|
|
1435
|
+
const sourceChainIcon = _chunkO7BCVQ6Lcjs.getChainIcon.call(void 0, asset.chainId);
|
|
1436
|
+
const targetChainIcon = _chunkO7BCVQ6Lcjs.getChainIcon.call(void 0, targetChainId);
|
|
1437
|
+
const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? _nullishCoalesce(_chunk65MLWUQDcjs.formatTokenAmount.call(void 0, Number(amount), asset.symbol), () => ( "0")) : "0";
|
|
1438
|
+
const mustHaveQuote = !appFeesResolved || _chunk65MLWUQDcjs.resolveAppFeeBps.call(void 0,
|
|
1440
1439
|
appFees,
|
|
1441
1440
|
`eip155:${quoteSource.chainId}`,
|
|
1442
1441
|
quoteSource.token
|
|
1443
1442
|
) > 0;
|
|
1444
|
-
const { display: feeDisplay, struck: feesFullySponsored } =
|
|
1443
|
+
const { display: feeDisplay, struck: feesFullySponsored } = _chunk65MLWUQDcjs.quoteFeeRow.call(void 0,
|
|
1445
1444
|
_optionalChain([quote, 'optionalAccess', _36 => _36.fees])
|
|
1446
1445
|
);
|
|
1447
1446
|
const directTransfer = sameRoute && !mustHaveQuote && !executeTransfer;
|
|
1448
1447
|
const receiveDisplay = (() => {
|
|
1449
1448
|
if (directTransfer) return `${formattedSendAmount} ${asset.symbol}`;
|
|
1450
1449
|
if (quote) {
|
|
1451
|
-
const quoted =
|
|
1450
|
+
const quoted = _chunk65MLWUQDcjs.formatQuotedReceive.call(void 0, quote.output, targetSymbol);
|
|
1452
1451
|
if (quoted !== void 0) return quoted;
|
|
1453
1452
|
}
|
|
1454
1453
|
const usdValue = Number(targetAmount);
|
|
1455
1454
|
const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
|
|
1456
|
-
const estimate =
|
|
1455
|
+
const estimate = _chunk65MLWUQDcjs.formatReceiveEstimate.call(void 0, {
|
|
1457
1456
|
sourceAmount: Number.isFinite(Number(amount)) ? Number(amount) : void 0,
|
|
1458
1457
|
sourceSymbol: asset.symbol,
|
|
1459
1458
|
targetSymbol,
|
|
1460
1459
|
sourceAmountUsd,
|
|
1461
|
-
sourceTrusted:
|
|
1460
|
+
sourceTrusted: _chunk65MLWUQDcjs.isRecognizedToken.call(void 0, asset.token, asset.chainId),
|
|
1462
1461
|
// The target is the curated deposit destination, so a stablecoin target
|
|
1463
1462
|
// estimates at $1 when unquoted (DepositFlow skips fetching stablecoin
|
|
1464
1463
|
// target prices). Not applied to the source — that can be a held token.
|
|
1465
|
-
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } :
|
|
1464
|
+
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : _chunk65MLWUQDcjs.isDisplayStablecoinSymbol.call(void 0, targetSymbol) ? { [targetSymbol.toUpperCase()]: 1 } : {}
|
|
1466
1465
|
});
|
|
1467
1466
|
if (estimate !== void 0) return estimate;
|
|
1468
1467
|
return targetSymbol;
|
|
@@ -1473,7 +1472,7 @@ function ConfirmStep({
|
|
|
1473
1472
|
hasAttemptedSwitch.current = true;
|
|
1474
1473
|
switchChain(asset.chainId).catch((err) => {
|
|
1475
1474
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
1476
|
-
setError(
|
|
1475
|
+
setError(_chunk65MLWUQDcjs.formatUserError.call(void 0, raw));
|
|
1477
1476
|
});
|
|
1478
1477
|
}
|
|
1479
1478
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -1562,7 +1561,7 @@ function ConfirmStep({
|
|
|
1562
1561
|
const result = await executeTransfer(amountUnits);
|
|
1563
1562
|
hash = result.txHash;
|
|
1564
1563
|
resolvedSourceToken = result.sourceToken;
|
|
1565
|
-
} else if (
|
|
1564
|
+
} else if (_chunk65MLWUQDcjs.isNativeAsset.call(void 0, asset)) {
|
|
1566
1565
|
hash = await walletClient.sendTransaction({
|
|
1567
1566
|
account,
|
|
1568
1567
|
chain,
|
|
@@ -1593,7 +1592,7 @@ function ConfirmStep({
|
|
|
1593
1592
|
);
|
|
1594
1593
|
} catch (err) {
|
|
1595
1594
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
1596
|
-
const message =
|
|
1595
|
+
const message = _chunk65MLWUQDcjs.formatUserError.call(void 0, raw);
|
|
1597
1596
|
setError(message);
|
|
1598
1597
|
_optionalChain([onError, 'optionalCall', _38 => _38(message, "TRANSFER_ERROR", raw)]);
|
|
1599
1598
|
} finally {
|
|
@@ -1602,20 +1601,20 @@ function ConfirmStep({
|
|
|
1602
1601
|
};
|
|
1603
1602
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
1604
1603
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
1605
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1604
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.WalletIcon, {}), title: "Review deposit" }),
|
|
1606
1605
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
|
|
1607
1606
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1608
1607
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
1609
1608
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1610
1609
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceChainName }),
|
|
1611
|
-
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1610
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.CdnIcon, { src: sourceChainIcon }) })
|
|
1612
1611
|
] })
|
|
1613
1612
|
] }),
|
|
1614
1613
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1615
1614
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
|
|
1616
1615
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1617
1616
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName }),
|
|
1618
|
-
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1617
|
+
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.CdnIcon, { src: targetChainIcon }) })
|
|
1619
1618
|
] })
|
|
1620
1619
|
] }),
|
|
1621
1620
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -1630,14 +1629,14 @@ function ConfirmStep({
|
|
|
1630
1629
|
" ",
|
|
1631
1630
|
asset.symbol
|
|
1632
1631
|
] }),
|
|
1633
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1632
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.TokenIcon, { symbol: asset.symbol }) })
|
|
1634
1633
|
] })
|
|
1635
1634
|
] }),
|
|
1636
1635
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1637
1636
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Receive" }),
|
|
1638
1637
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1639
1638
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: receiveDisplay }),
|
|
1640
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1639
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.TokenIcon, { symbol: targetSymbol }) })
|
|
1641
1640
|
] })
|
|
1642
1641
|
] }),
|
|
1643
1642
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -1657,9 +1656,9 @@ function ConfirmStep({
|
|
|
1657
1656
|
) })
|
|
1658
1657
|
] })
|
|
1659
1658
|
] }),
|
|
1660
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1659
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.Callout, { variant: "error", children: error }),
|
|
1661
1660
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1662
|
-
|
|
1661
|
+
_chunk65MLWUQDcjs.Button,
|
|
1663
1662
|
{
|
|
1664
1663
|
onClick: handleConfirm,
|
|
1665
1664
|
loading: isSubmitting,
|
|
@@ -1673,7 +1672,7 @@ function ConfirmStep({
|
|
|
1673
1672
|
}
|
|
1674
1673
|
)
|
|
1675
1674
|
] }),
|
|
1676
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1675
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.PoweredBy, {})
|
|
1677
1676
|
] });
|
|
1678
1677
|
}
|
|
1679
1678
|
|
|
@@ -1689,6 +1688,117 @@ function ConfirmStep({
|
|
|
1689
1688
|
|
|
1690
1689
|
|
|
1691
1690
|
|
|
1691
|
+
// src/components/steps/DepositAddressSkeleton.tsx
|
|
1692
|
+
|
|
1693
|
+
var BASE_CHAIN_ID = 8453;
|
|
1694
|
+
function DepositAddressSkeleton({
|
|
1695
|
+
uiConfig
|
|
1696
|
+
}) {
|
|
1697
|
+
const evmChainIds = _chunkO7BCVQ6Lcjs.getSupportedChainIds.call(void 0, );
|
|
1698
|
+
const defaultChainId = evmChainIds.includes(BASE_CHAIN_ID) ? BASE_CHAIN_ID : evmChainIds[0];
|
|
1699
|
+
const tokensForChain = _chunkO7BCVQ6Lcjs.getTargetTokenSymbolsForChain.call(void 0, defaultChainId);
|
|
1700
|
+
const defaultToken = tokensForChain.includes("USDC") ? "USDC" : _nullishCoalesce(tokensForChain[0], () => ( "USDC"));
|
|
1701
|
+
const chainName = _chunkO7BCVQ6Lcjs.getChainName.call(void 0, defaultChainId);
|
|
1702
|
+
const chainIcon = _chunkO7BCVQ6Lcjs.getChainIcon.call(void 0, defaultChainId);
|
|
1703
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", "aria-busy": "true", children: [
|
|
1704
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: "Preparing deposit details\u2026" }),
|
|
1705
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
1706
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
1707
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", "aria-hidden": "true", children: [
|
|
1708
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
1709
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
1710
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown-trigger", children: [
|
|
1711
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1712
|
+
_chunk65MLWUQDcjs.CdnIcon,
|
|
1713
|
+
{
|
|
1714
|
+
src: chainIcon,
|
|
1715
|
+
className: "rs-deposit-address-dropdown-icon"
|
|
1716
|
+
}
|
|
1717
|
+
),
|
|
1718
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainName }),
|
|
1719
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
1720
|
+
] })
|
|
1721
|
+
] }),
|
|
1722
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
1723
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown-label rs-deposit-address-dropdown-label--with-min", children: [
|
|
1724
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Supported token" }),
|
|
1725
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
1726
|
+
"Min.$",
|
|
1727
|
+
(_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _39 => _39.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
1728
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFKHPVLJYcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1729
|
+
_chunk65MLWUQDcjs.InfoIcon,
|
|
1730
|
+
{
|
|
1731
|
+
className: "rs-deposit-address-min-icon",
|
|
1732
|
+
"aria-hidden": "true"
|
|
1733
|
+
}
|
|
1734
|
+
) })
|
|
1735
|
+
] })
|
|
1736
|
+
] }),
|
|
1737
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown-trigger", children: [
|
|
1738
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1739
|
+
_chunk65MLWUQDcjs.TokenIcon,
|
|
1740
|
+
{
|
|
1741
|
+
symbol: defaultToken,
|
|
1742
|
+
className: "rs-deposit-address-dropdown-icon"
|
|
1743
|
+
}
|
|
1744
|
+
),
|
|
1745
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: defaultToken }),
|
|
1746
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
1747
|
+
] })
|
|
1748
|
+
] })
|
|
1749
|
+
] }),
|
|
1750
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1751
|
+
"div",
|
|
1752
|
+
{
|
|
1753
|
+
style: { display: "flex", flexDirection: "column", gap: 4, width: "100%" },
|
|
1754
|
+
children: [
|
|
1755
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-well", children: [
|
|
1756
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-qr", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-skeleton rs-skeleton-qr", "aria-hidden": "true" }) }),
|
|
1757
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-skeleton rs-skeleton-address", "aria-hidden": "true" })
|
|
1758
|
+
] }),
|
|
1759
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1760
|
+
"button",
|
|
1761
|
+
{
|
|
1762
|
+
type: "button",
|
|
1763
|
+
className: "rs-deposit-address-copy",
|
|
1764
|
+
disabled: true,
|
|
1765
|
+
"aria-hidden": "true",
|
|
1766
|
+
children: [
|
|
1767
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.CopyIcon, {}),
|
|
1768
|
+
"Copy address"
|
|
1769
|
+
]
|
|
1770
|
+
}
|
|
1771
|
+
)
|
|
1772
|
+
]
|
|
1773
|
+
}
|
|
1774
|
+
),
|
|
1775
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-price-impact", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-header", children: [
|
|
1776
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-header-left", children: [
|
|
1777
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
|
|
1778
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
|
|
1779
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1780
|
+
_chunkFKHPVLJYcjs.Tooltip,
|
|
1781
|
+
{
|
|
1782
|
+
className: "rs-price-impact-info",
|
|
1783
|
+
content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
|
|
1784
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.InfoIcon, { "aria-hidden": "true" })
|
|
1785
|
+
}
|
|
1786
|
+
)
|
|
1787
|
+
] }),
|
|
1788
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1789
|
+
_chunk65MLWUQDcjs.ChevronDownIcon,
|
|
1790
|
+
{
|
|
1791
|
+
className: "rs-price-impact-chevron",
|
|
1792
|
+
"aria-hidden": "true"
|
|
1793
|
+
}
|
|
1794
|
+
)
|
|
1795
|
+
] }) })
|
|
1796
|
+
] }),
|
|
1797
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.PoweredBy, {})
|
|
1798
|
+
] });
|
|
1799
|
+
}
|
|
1800
|
+
DepositAddressSkeleton.displayName = "DepositAddressSkeleton";
|
|
1801
|
+
|
|
1692
1802
|
// src/components/ui/DepositNotification.tsx
|
|
1693
1803
|
|
|
1694
1804
|
|
|
@@ -1696,9 +1806,9 @@ var INITIAL_POLL_INTERVAL = 3e3;
|
|
|
1696
1806
|
var MAX_POLL_INTERVAL = 3e4;
|
|
1697
1807
|
var BACKOFF_MULTIPLIER = 1.5;
|
|
1698
1808
|
function isEventForTx(event, txHash) {
|
|
1699
|
-
const eventTxHash =
|
|
1809
|
+
const eventTxHash = _chunkFKHPVLJYcjs.getEventTxHash.call(void 0, event);
|
|
1700
1810
|
if (!eventTxHash) return false;
|
|
1701
|
-
return
|
|
1811
|
+
return _chunkFKHPVLJYcjs.txRefsMatch.call(void 0, eventTxHash, txHash);
|
|
1702
1812
|
}
|
|
1703
1813
|
function truncateHash(hash) {
|
|
1704
1814
|
return `${hash.slice(0, 4)}\u2026${hash.slice(-4)}`;
|
|
@@ -1728,7 +1838,7 @@ function formatTimestamp(ms) {
|
|
|
1728
1838
|
return `${month} ${day}${suffix} \xB7 ${hours}:${minutes}:${seconds}`;
|
|
1729
1839
|
}
|
|
1730
1840
|
function formatBridgeFailedMessage(event) {
|
|
1731
|
-
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess',
|
|
1841
|
+
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _40 => _40.data]), () => ( {}));
|
|
1732
1842
|
const backendMessage = typeof eventData.message === "string" ? eventData.message.trim() : "";
|
|
1733
1843
|
if (backendMessage.length > 0) {
|
|
1734
1844
|
const lower = backendMessage.toLowerCase();
|
|
@@ -1748,7 +1858,7 @@ function formatBridgeFailedMessage(event) {
|
|
|
1748
1858
|
}
|
|
1749
1859
|
return "Bridge failed";
|
|
1750
1860
|
}
|
|
1751
|
-
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1861
|
+
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.ExternalLinkIcon, { className: "rs-deposit-notification-link-icon" });
|
|
1752
1862
|
function DepositNotification({
|
|
1753
1863
|
deposit,
|
|
1754
1864
|
smartAccount,
|
|
@@ -1782,7 +1892,7 @@ function DepositNotification({
|
|
|
1782
1892
|
const pollIntervalRef = _react.useRef.call(void 0, INITIAL_POLL_INTERVAL);
|
|
1783
1893
|
const pollTimeoutRef = _react.useRef.call(void 0, null);
|
|
1784
1894
|
const completedRef = _react.useRef.call(void 0, _nullishCoalesce(directTransfer, () => ( false)));
|
|
1785
|
-
const depositContextRef =
|
|
1895
|
+
const depositContextRef = _chunk65MLWUQDcjs.useLatestRef.call(void 0, {
|
|
1786
1896
|
amount,
|
|
1787
1897
|
sourceChain,
|
|
1788
1898
|
sourceToken: token,
|
|
@@ -1790,8 +1900,8 @@ function DepositNotification({
|
|
|
1790
1900
|
targetChain,
|
|
1791
1901
|
targetToken
|
|
1792
1902
|
});
|
|
1793
|
-
const onCompleteRef =
|
|
1794
|
-
const onFailedRef =
|
|
1903
|
+
const onCompleteRef = _chunk65MLWUQDcjs.useLatestRef.call(void 0, onComplete);
|
|
1904
|
+
const onFailedRef = _chunk65MLWUQDcjs.useLatestRef.call(void 0, onFailed);
|
|
1795
1905
|
const handleComplete = _react.useCallback.call(void 0,
|
|
1796
1906
|
(destTxHash) => {
|
|
1797
1907
|
if (completedRef.current) return;
|
|
@@ -1800,7 +1910,7 @@ function DepositNotification({
|
|
|
1800
1910
|
setCompletedAt(Date.now());
|
|
1801
1911
|
setStatus("complete");
|
|
1802
1912
|
const context = depositContextRef.current;
|
|
1803
|
-
_optionalChain([onCompleteRef, 'access',
|
|
1913
|
+
_optionalChain([onCompleteRef, 'access', _41 => _41.current, 'optionalCall', _42 => _42(txHash, destTxHash, {
|
|
1804
1914
|
amount: context.amount,
|
|
1805
1915
|
sourceChain: context.sourceChain,
|
|
1806
1916
|
sourceToken: context.sourceToken,
|
|
@@ -1816,7 +1926,7 @@ function DepositNotification({
|
|
|
1816
1926
|
if (completedRef.current) return;
|
|
1817
1927
|
completedRef.current = true;
|
|
1818
1928
|
setStatus("failed");
|
|
1819
|
-
_optionalChain([onFailedRef, 'access',
|
|
1929
|
+
_optionalChain([onFailedRef, 'access', _43 => _43.current, 'optionalCall', _44 => _44(txHash, error)]);
|
|
1820
1930
|
},
|
|
1821
1931
|
[onFailedRef, txHash]
|
|
1822
1932
|
);
|
|
@@ -1834,17 +1944,17 @@ function DepositNotification({
|
|
|
1834
1944
|
if (!isMounted) return;
|
|
1835
1945
|
const lastEvent = data.lastEvent;
|
|
1836
1946
|
const eventForTx = isEventForTx(lastEvent, txHash) ? lastEvent : void 0;
|
|
1837
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
1838
|
-
const destTx = _optionalChain([eventForTx, 'access',
|
|
1947
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _45 => _45.type]) === "bridge-complete") {
|
|
1948
|
+
const destTx = _optionalChain([eventForTx, 'access', _46 => _46.data, 'optionalAccess', _47 => _47.destination, 'optionalAccess', _48 => _48.transactionHash]);
|
|
1839
1949
|
handleComplete(destTx);
|
|
1840
1950
|
return;
|
|
1841
1951
|
}
|
|
1842
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
1952
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _49 => _49.type]) === "bridge-failed") {
|
|
1843
1953
|
handleFailed(formatBridgeFailedMessage(eventForTx));
|
|
1844
1954
|
return;
|
|
1845
1955
|
}
|
|
1846
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
1847
|
-
const errorMessage = _nullishCoalesce(_optionalChain([eventForTx, 'access',
|
|
1956
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _50 => _50.type]) === "error") {
|
|
1957
|
+
const errorMessage = _nullishCoalesce(_optionalChain([eventForTx, 'access', _51 => _51.data, 'optionalAccess', _52 => _52.message]), () => ( "Unknown error"));
|
|
1848
1958
|
handleFailed(errorMessage);
|
|
1849
1959
|
return;
|
|
1850
1960
|
}
|
|
@@ -1882,12 +1992,12 @@ function DepositNotification({
|
|
|
1882
1992
|
status,
|
|
1883
1993
|
txHash
|
|
1884
1994
|
]);
|
|
1885
|
-
const explorerTxUrl =
|
|
1995
|
+
const explorerTxUrl = _chunk65MLWUQDcjs.useExplorerTxUrl.call(void 0, );
|
|
1886
1996
|
const sourceExplorerUrl = sourceChain === "unknown" ? void 0 : explorerTxUrl(sourceChain, txHash);
|
|
1887
|
-
const destExplorerUrl = destinationTxHash ? explorerTxUrl(
|
|
1997
|
+
const destExplorerUrl = destinationTxHash ? explorerTxUrl(_chunkO7BCVQ6Lcjs.targetChainToChainId.call(void 0, targetChain), destinationTxHash) : null;
|
|
1888
1998
|
const title = status === "complete" ? "Deposit completed" : status === "failed" ? "Deposit failed" : "Deposit received and processing\u2026";
|
|
1889
1999
|
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.";
|
|
1890
|
-
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,
|
|
2000
|
+
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, _chunk65MLWUQDcjs.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, _chunk65MLWUQDcjs.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,
|
|
1891
2001
|
"svg",
|
|
1892
2002
|
{
|
|
1893
2003
|
className: "rs-deposit-notification-spinner",
|
|
@@ -1937,7 +2047,7 @@ function DepositNotification({
|
|
|
1937
2047
|
className: "rs-deposit-notification-close",
|
|
1938
2048
|
onClick: () => onDismiss(deposit.id),
|
|
1939
2049
|
"aria-label": "Dismiss",
|
|
1940
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2050
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.CloseIcon, {})
|
|
1941
2051
|
}
|
|
1942
2052
|
)
|
|
1943
2053
|
] }),
|
|
@@ -1953,7 +2063,7 @@ function DepositNotification({
|
|
|
1953
2063
|
"aria-expanded": expanded,
|
|
1954
2064
|
children: [
|
|
1955
2065
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: expanded ? "See less details" : "See more details" }),
|
|
1956
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2066
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.ChevronDownIcon, { className: "rs-deposit-notification-toggle-chevron" })
|
|
1957
2067
|
]
|
|
1958
2068
|
}
|
|
1959
2069
|
),
|
|
@@ -2043,7 +2153,7 @@ function asString(value) {
|
|
|
2043
2153
|
function resolveSolanaTokenMeta(token) {
|
|
2044
2154
|
if (!token) return {};
|
|
2045
2155
|
const normalized = token.toLowerCase();
|
|
2046
|
-
const matched =
|
|
2156
|
+
const matched = _chunkO7BCVQ6Lcjs.SOLANA_TOKENS.find(
|
|
2047
2157
|
(entry) => entry.mint.toLowerCase() === normalized
|
|
2048
2158
|
);
|
|
2049
2159
|
if (matched) {
|
|
@@ -2055,7 +2165,7 @@ function resolveSolanaTokenMeta(token) {
|
|
|
2055
2165
|
return {};
|
|
2056
2166
|
}
|
|
2057
2167
|
function getDepositEventDetails(event) {
|
|
2058
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
2168
|
+
if (!_optionalChain([event, 'optionalAccess', _53 => _53.type]) || !isRecord(event.data)) return {};
|
|
2059
2169
|
if (event.type === "deposit-received") {
|
|
2060
2170
|
const chainId = asChainId(event.data.chain);
|
|
2061
2171
|
const token = asString(event.data.token);
|
|
@@ -2070,12 +2180,12 @@ function getDepositEventDetails(event) {
|
|
|
2070
2180
|
const source = isRecord(event.data.source) ? event.data.source : void 0;
|
|
2071
2181
|
const deposit = isRecord(event.data.deposit) ? event.data.deposit : void 0;
|
|
2072
2182
|
if (source || deposit) {
|
|
2073
|
-
const chainId = _nullishCoalesce(asChainId(_optionalChain([source, 'optionalAccess',
|
|
2074
|
-
const token = _nullishCoalesce(_nullishCoalesce(asString(_optionalChain([source, 'optionalAccess',
|
|
2183
|
+
const chainId = _nullishCoalesce(asChainId(_optionalChain([source, 'optionalAccess', _54 => _54.chain])), () => ( asChainId(_optionalChain([deposit, 'optionalAccess', _55 => _55.chain]))));
|
|
2184
|
+
const token = _nullishCoalesce(_nullishCoalesce(asString(_optionalChain([source, 'optionalAccess', _56 => _56.asset])), () => ( asString(_optionalChain([deposit, 'optionalAccess', _57 => _57.asset])))), () => ( asString(_optionalChain([deposit, 'optionalAccess', _58 => _58.token]))));
|
|
2075
2185
|
const solanaMeta = chainId === "solana" ? resolveSolanaTokenMeta(token) : {};
|
|
2076
2186
|
return {
|
|
2077
2187
|
chainId,
|
|
2078
|
-
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess',
|
|
2188
|
+
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess', _59 => _59.amount])), () => ( asAmount(_optionalChain([deposit, 'optionalAccess', _60 => _60.amount])))),
|
|
2079
2189
|
token,
|
|
2080
2190
|
...solanaMeta
|
|
2081
2191
|
};
|
|
@@ -2086,28 +2196,24 @@ function isSameRoute(sourceChain, sourceToken, targetChain, targetToken) {
|
|
|
2086
2196
|
return sourceChain === targetChain && sourceToken.toLowerCase() === targetToken.toLowerCase();
|
|
2087
2197
|
}
|
|
2088
2198
|
function chainLabel(chainId, catalogChain) {
|
|
2089
|
-
const name = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess',
|
|
2199
|
+
const name = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _61 => _61.name]), () => ( _chunkO7BCVQ6Lcjs.getChainName.call(void 0, chainId)));
|
|
2090
2200
|
return name.replace(/\s+(One|Mainnet|Smart Chain|Chain)$/i, "");
|
|
2091
2201
|
}
|
|
2092
2202
|
function computeTokensForChain(chainId, topTokens, catalogChain) {
|
|
2093
|
-
const fromBackend = _optionalChain([topTokens, 'optionalAccess',
|
|
2203
|
+
const fromBackend = _optionalChain([topTokens, 'optionalAccess', _62 => _62[String(chainId)], 'optionalAccess', _63 => _63.map, 'call', _64 => _64((t) => t.symbol)]);
|
|
2094
2204
|
if (fromBackend) return fromBackend;
|
|
2095
|
-
|
|
2096
|
-
if (chainId === "hypercore") return ["USDC", "USDT0"];
|
|
2097
|
-
const bundled = _chunkTENL4H64cjs.getBundledTargetTokens.call(void 0, chainId).map((t) => t.symbol);
|
|
2098
|
-
if (bundled.length > 0) return bundled;
|
|
2099
|
-
return Array.isArray(_optionalChain([catalogChain, 'optionalAccess', _64 => _64.supportedTokens])) ? catalogChain.supportedTokens.map((t) => t.symbol) : [];
|
|
2205
|
+
return Array.isArray(_optionalChain([catalogChain, 'optionalAccess', _65 => _65.supportedTokens])) ? catalogChain.supportedTokens.map((t) => t.symbol) : [];
|
|
2100
2206
|
}
|
|
2101
2207
|
function resolveSourceTokenAddress(symbol, chainId, topTokens, catalogChain) {
|
|
2102
|
-
const top = _optionalChain([topTokens, 'optionalAccess',
|
|
2103
|
-
if (_optionalChain([top, 'optionalAccess',
|
|
2104
|
-
const fromRegistry =
|
|
2208
|
+
const top = _optionalChain([topTokens, 'optionalAccess', _66 => _66[String(chainId)], 'optionalAccess', _67 => _67.find, 'call', _68 => _68((t) => t.symbol === symbol)]);
|
|
2209
|
+
if (_optionalChain([top, 'optionalAccess', _69 => _69.address])) return top.address;
|
|
2210
|
+
const fromRegistry = _chunkO7BCVQ6Lcjs.getTokenAddress.call(void 0, symbol, chainId);
|
|
2105
2211
|
if (fromRegistry) return fromRegistry;
|
|
2106
|
-
return Array.isArray(_optionalChain([catalogChain, 'optionalAccess',
|
|
2212
|
+
return Array.isArray(_optionalChain([catalogChain, 'optionalAccess', _70 => _70.supportedTokens])) ? _optionalChain([catalogChain, 'access', _71 => _71.supportedTokens, 'access', _72 => _72.find, 'call', _73 => _73((t) => t.symbol === symbol), 'optionalAccess', _74 => _74.address]) : void 0;
|
|
2107
2213
|
}
|
|
2108
2214
|
function TokenGlyph({ symbol }) {
|
|
2109
2215
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2110
|
-
|
|
2216
|
+
_chunk65MLWUQDcjs.TokenIcon,
|
|
2111
2217
|
{
|
|
2112
2218
|
symbol,
|
|
2113
2219
|
className: "rs-deposit-address-dropdown-icon",
|
|
@@ -2141,40 +2247,41 @@ function DepositAddressStep({
|
|
|
2141
2247
|
service.getTopTokens().then((t) => {
|
|
2142
2248
|
if (!active) return;
|
|
2143
2249
|
setTopTokens(t);
|
|
2144
|
-
if (t)
|
|
2250
|
+
if (t) _chunkO7BCVQ6Lcjs.publishShortlistTokens.call(void 0, t);
|
|
2145
2251
|
});
|
|
2146
2252
|
return () => {
|
|
2147
2253
|
active = false;
|
|
2148
2254
|
};
|
|
2149
2255
|
}, [service]);
|
|
2150
2256
|
const BASE_CHAIN_ID2 = 8453;
|
|
2151
|
-
const evmChainIds =
|
|
2152
|
-
const { catalog } =
|
|
2257
|
+
const evmChainIds = _chunk65MLWUQDcjs.useDepositChainIds.call(void 0, );
|
|
2258
|
+
const { catalog, isLoading: catalogLoading } = _chunk65MLWUQDcjs.useChainCatalog.call(void 0, );
|
|
2153
2259
|
const catalogFor = _react.useCallback.call(void 0,
|
|
2154
2260
|
(chain) => {
|
|
2155
2261
|
if (!catalog) return void 0;
|
|
2156
|
-
const key =
|
|
2262
|
+
const key = _chunk65MLWUQDcjs.catalogKeyForChain.call(void 0, chain);
|
|
2157
2263
|
return typeof key === "number" ? catalog.byChainId.get(key) : catalog.byCaip2.get(key);
|
|
2158
2264
|
},
|
|
2159
2265
|
[catalog]
|
|
2160
2266
|
);
|
|
2161
2267
|
const chainOptions = _react.useMemo.call(void 0, () => {
|
|
2162
|
-
const acceptsDeposits = (chain) => _optionalChain([catalogFor, 'call',
|
|
2268
|
+
const acceptsDeposits = (chain) => _optionalChain([catalogFor, 'call', _75 => _75(chain), 'optionalAccess', _76 => _76.deposit]) !== false;
|
|
2163
2269
|
const options = [...evmChainIds];
|
|
2164
2270
|
const extras = [];
|
|
2165
2271
|
if (hasSolana && acceptsDeposits("solana")) extras.push("solana");
|
|
2166
2272
|
if (acceptsDeposits("hypercore")) extras.push("hypercore");
|
|
2167
2273
|
options.splice(1, 0, ...extras);
|
|
2168
2274
|
return options.filter(
|
|
2169
|
-
(chain) => _optionalChain([topTokens, 'optionalAccess',
|
|
2275
|
+
(chain) => _optionalChain([topTokens, 'optionalAccess', _77 => _77[String(chain)], 'optionalAccess', _78 => _78.length]) !== 0 && computeTokensForChain(chain, topTokens, catalogFor(chain)).length > 0
|
|
2170
2276
|
);
|
|
2171
2277
|
}, [evmChainIds, hasSolana, topTokens, catalogFor]);
|
|
2172
2278
|
const preferredChainId = (options) => options.includes(BASE_CHAIN_ID2) ? BASE_CHAIN_ID2 : _nullishCoalesce(options[0], () => ( BASE_CHAIN_ID2));
|
|
2173
2279
|
const [sourceChainId, setSourceChainId] = _react.useState.call(void 0, () => preferredChainId(chainOptions));
|
|
2280
|
+
const chainChosenByUser = _react.useRef.call(void 0, false);
|
|
2174
2281
|
_react.useEffect.call(void 0, () => {
|
|
2175
|
-
if (chainOptions.length
|
|
2176
|
-
|
|
2177
|
-
|
|
2282
|
+
if (chainOptions.length === 0) return;
|
|
2283
|
+
const stale = chainChosenByUser.current ? !chainOptions.includes(sourceChainId) : sourceChainId !== preferredChainId(chainOptions);
|
|
2284
|
+
if (stale) setSourceChainId(preferredChainId(chainOptions));
|
|
2178
2285
|
}, [chainOptions, sourceChainId]);
|
|
2179
2286
|
const isSolana = sourceChainId === "solana";
|
|
2180
2287
|
const isHyperCore = sourceChainId === "hypercore";
|
|
@@ -2223,7 +2330,7 @@ function DepositAddressStep({
|
|
|
2223
2330
|
service.checkLiquidity({
|
|
2224
2331
|
sourceChainId,
|
|
2225
2332
|
sourceToken: sourceTokenAddress,
|
|
2226
|
-
destinationChainId:
|
|
2333
|
+
destinationChainId: _chunkO7BCVQ6Lcjs.targetChainToCaip2.call(void 0, targetChain),
|
|
2227
2334
|
destinationToken: targetToken,
|
|
2228
2335
|
amount: "1"
|
|
2229
2336
|
}).then((result) => {
|
|
@@ -2263,8 +2370,8 @@ function DepositAddressStep({
|
|
|
2263
2370
|
function handlePointerDown(event) {
|
|
2264
2371
|
const target = event.target;
|
|
2265
2372
|
if (!target) return;
|
|
2266
|
-
const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access',
|
|
2267
|
-
const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access',
|
|
2373
|
+
const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access', _79 => _79.current, 'optionalAccess', _80 => _80.contains, 'call', _81 => _81(target)]);
|
|
2374
|
+
const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access', _82 => _82.current, 'optionalAccess', _83 => _83.contains, 'call', _84 => _84(target)]);
|
|
2268
2375
|
if (clickedChainDropdown || clickedTokenDropdown) return;
|
|
2269
2376
|
setChainDropdownOpen(false);
|
|
2270
2377
|
setTokenDropdownOpen(false);
|
|
@@ -2277,7 +2384,7 @@ function DepositAddressStep({
|
|
|
2277
2384
|
};
|
|
2278
2385
|
}, [chainDropdownOpen, tokenDropdownOpen]);
|
|
2279
2386
|
const handleCopy = _react.useCallback.call(void 0, async () => {
|
|
2280
|
-
_optionalChain([onCopyAddress, 'optionalCall',
|
|
2387
|
+
_optionalChain([onCopyAddress, 'optionalCall', _85 => _85()]);
|
|
2281
2388
|
try {
|
|
2282
2389
|
await navigator.clipboard.writeText(displayAddress);
|
|
2283
2390
|
setCopied(true);
|
|
@@ -2302,6 +2409,7 @@ function DepositAddressStep({
|
|
|
2302
2409
|
topTokens,
|
|
2303
2410
|
catalogFor(nextChain)
|
|
2304
2411
|
);
|
|
2412
|
+
chainChosenByUser.current = true;
|
|
2305
2413
|
setSourceChainId(nextChain);
|
|
2306
2414
|
setSourceTokenSymbol(pickFallbackToken(nextTokens, sourceTokenSymbol));
|
|
2307
2415
|
setChainDropdownOpen(false);
|
|
@@ -2360,10 +2468,10 @@ function DepositAddressStep({
|
|
|
2360
2468
|
return;
|
|
2361
2469
|
}
|
|
2362
2470
|
const event = status.lastEvent;
|
|
2363
|
-
const eventTxHash =
|
|
2471
|
+
const eventTxHash = _chunkFKHPVLJYcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkFKHPVLJYcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
2364
2472
|
if (baselineTxHashRef.current === void 0) {
|
|
2365
2473
|
baselineTxHashRef.current = eventTxHash;
|
|
2366
|
-
} else if (eventTxHash && (!baselineTxHashRef.current || !
|
|
2474
|
+
} else if (eventTxHash && (!baselineTxHashRef.current || !_chunkFKHPVLJYcjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
|
|
2367
2475
|
const details = getDepositEventDetails(event);
|
|
2368
2476
|
const chainId = _nullishCoalesce(details.chainId, () => ( "unknown"));
|
|
2369
2477
|
const amount = _nullishCoalesce(details.amount, () => ( "0"));
|
|
@@ -2372,7 +2480,7 @@ function DepositAddressStep({
|
|
|
2372
2480
|
baselineTxHashRef.current = eventTxHash;
|
|
2373
2481
|
isTrackingRef.current = true;
|
|
2374
2482
|
const isEvmToken = token ? /^0x[a-fA-F0-9]{40}$/.test(token) : false;
|
|
2375
|
-
const sourceDecimals = _nullishCoalesce(details.sourceDecimals, () => ( (isEvmToken ?
|
|
2483
|
+
const sourceDecimals = _nullishCoalesce(details.sourceDecimals, () => ( (isEvmToken ? _chunkO7BCVQ6Lcjs.findTokenDecimals.call(void 0,
|
|
2376
2484
|
token,
|
|
2377
2485
|
typeof chainId === "number" ? chainId : void 0
|
|
2378
2486
|
) : void 0)));
|
|
@@ -2395,7 +2503,7 @@ function DepositAddressStep({
|
|
|
2395
2503
|
directTransfer
|
|
2396
2504
|
};
|
|
2397
2505
|
setNotifications((prev) => [notification, ...prev]);
|
|
2398
|
-
_optionalChain([onDepositSubmittedRef, 'access',
|
|
2506
|
+
_optionalChain([onDepositSubmittedRef, 'access', _86 => _86.current, 'optionalCall', _87 => _87({
|
|
2399
2507
|
txHash: eventTxHash,
|
|
2400
2508
|
sourceChain: chainId,
|
|
2401
2509
|
amount,
|
|
@@ -2407,7 +2515,7 @@ function DepositAddressStep({
|
|
|
2407
2515
|
if (!cancelled) {
|
|
2408
2516
|
const msg = err instanceof Error ? err.message : "Failed to check status";
|
|
2409
2517
|
setPollingError(msg);
|
|
2410
|
-
_optionalChain([onErrorRef, 'access',
|
|
2518
|
+
_optionalChain([onErrorRef, 'access', _88 => _88.current, 'optionalCall', _89 => _89(msg, "STATUS_POLL_ERROR")]);
|
|
2411
2519
|
}
|
|
2412
2520
|
}
|
|
2413
2521
|
if (!cancelled) {
|
|
@@ -2423,24 +2531,31 @@ function DepositAddressStep({
|
|
|
2423
2531
|
const handleNotificationComplete = _react.useCallback.call(void 0,
|
|
2424
2532
|
(txHash, destinationTxHash, context) => {
|
|
2425
2533
|
isTrackingRef.current = false;
|
|
2426
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
2534
|
+
_optionalChain([onDepositCompleteRef, 'access', _90 => _90.current, 'optionalCall', _91 => _91(txHash, destinationTxHash, context)]);
|
|
2427
2535
|
},
|
|
2428
2536
|
[]
|
|
2429
2537
|
);
|
|
2430
2538
|
const handleNotificationFailed = _react.useCallback.call(void 0,
|
|
2431
2539
|
(txHash, error) => {
|
|
2432
2540
|
isTrackingRef.current = false;
|
|
2433
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
2541
|
+
_optionalChain([onDepositFailedRef, 'access', _92 => _92.current, 'optionalCall', _93 => _93(txHash, error)]);
|
|
2434
2542
|
},
|
|
2435
2543
|
[]
|
|
2436
2544
|
);
|
|
2437
2545
|
const handleNotificationDismiss = _react.useCallback.call(void 0, (id) => {
|
|
2438
2546
|
setNotifications((prev) => prev.filter((n) => n.id !== id));
|
|
2439
2547
|
}, []);
|
|
2440
|
-
const qrIconSrc = _nullishCoalesce(_optionalChain([catalogFor, 'call',
|
|
2548
|
+
const qrIconSrc = _nullishCoalesce(_optionalChain([catalogFor, 'call', _94 => _94(sourceChainId), 'optionalAccess', _95 => _95.iconUrl]), () => ( _chunkO7BCVQ6Lcjs.getChainIcon.call(void 0, sourceChainId)));
|
|
2549
|
+
if (chainOptions.length === 0) {
|
|
2550
|
+
if (catalogLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositAddressSkeleton, { uiConfig });
|
|
2551
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-screen", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
2552
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
2553
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.Callout, { variant: "error", children: "Supported chains are unavailable right now, so there is no deposit address to show. Close and try again in a moment." })
|
|
2554
|
+
] }) });
|
|
2555
|
+
}
|
|
2441
2556
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-step--with-notifications", children: [
|
|
2442
2557
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
2443
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2558
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
2444
2559
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", children: [
|
|
2445
2560
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", ref: chainDropdownRef, children: [
|
|
2446
2561
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
@@ -2456,14 +2571,14 @@ function DepositAddressStep({
|
|
|
2456
2571
|
},
|
|
2457
2572
|
children: [
|
|
2458
2573
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2459
|
-
|
|
2574
|
+
_chunk65MLWUQDcjs.CdnIcon,
|
|
2460
2575
|
{
|
|
2461
|
-
src: _nullishCoalesce(_optionalChain([catalogFor, 'call',
|
|
2576
|
+
src: _nullishCoalesce(_optionalChain([catalogFor, 'call', _96 => _96(sourceChainId), 'optionalAccess', _97 => _97.iconUrl]), () => ( _chunkO7BCVQ6Lcjs.getChainIcon.call(void 0, sourceChainId))),
|
|
2462
2577
|
className: "rs-deposit-address-dropdown-icon"
|
|
2463
2578
|
}
|
|
2464
2579
|
),
|
|
2465
2580
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainLabel(sourceChainId, catalogFor(sourceChainId)) }),
|
|
2466
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2581
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2467
2582
|
]
|
|
2468
2583
|
}
|
|
2469
2584
|
),
|
|
@@ -2475,9 +2590,9 @@ function DepositAddressStep({
|
|
|
2475
2590
|
onClick: () => handleSelectChain(chainId),
|
|
2476
2591
|
children: [
|
|
2477
2592
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2478
|
-
|
|
2593
|
+
_chunk65MLWUQDcjs.CdnIcon,
|
|
2479
2594
|
{
|
|
2480
|
-
src: _nullishCoalesce(_optionalChain([catalogFor, 'call',
|
|
2595
|
+
src: _nullishCoalesce(_optionalChain([catalogFor, 'call', _98 => _98(chainId), 'optionalAccess', _99 => _99.iconUrl]), () => ( _chunkO7BCVQ6Lcjs.getChainIcon.call(void 0, chainId))),
|
|
2481
2596
|
className: "rs-deposit-address-dropdown-icon"
|
|
2482
2597
|
}
|
|
2483
2598
|
),
|
|
@@ -2492,9 +2607,9 @@ function DepositAddressStep({
|
|
|
2492
2607
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Supported token" }),
|
|
2493
2608
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
2494
2609
|
"Min.$",
|
|
2495
|
-
(
|
|
2496
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2497
|
-
|
|
2610
|
+
(_chunkO7BCVQ6Lcjs.isHyperCoreDestination.call(void 0, targetChain) || isHyperCore ? Math.max(_chunkO7BCVQ6Lcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _100 => _100.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _101 => _101.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
2611
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFKHPVLJYcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2612
|
+
_chunk65MLWUQDcjs.InfoIcon,
|
|
2498
2613
|
{
|
|
2499
2614
|
className: "rs-deposit-address-min-icon",
|
|
2500
2615
|
"aria-hidden": "true"
|
|
@@ -2515,7 +2630,7 @@ function DepositAddressStep({
|
|
|
2515
2630
|
children: [
|
|
2516
2631
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenGlyph, { symbol: sourceTokenSymbol }),
|
|
2517
2632
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceTokenSymbol }),
|
|
2518
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2633
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2519
2634
|
]
|
|
2520
2635
|
}
|
|
2521
2636
|
),
|
|
@@ -2559,7 +2674,7 @@ function DepositAddressStep({
|
|
|
2559
2674
|
className: "rs-deposit-address-copy",
|
|
2560
2675
|
onClick: handleCopy,
|
|
2561
2676
|
children: [
|
|
2562
|
-
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2677
|
+
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.CopyIcon, {}),
|
|
2563
2678
|
copied ? "Copied!" : "Copy address"
|
|
2564
2679
|
]
|
|
2565
2680
|
}
|
|
@@ -2584,16 +2699,16 @@ function DepositAddressStep({
|
|
|
2584
2699
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
|
|
2585
2700
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
|
|
2586
2701
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2587
|
-
|
|
2702
|
+
_chunkFKHPVLJYcjs.Tooltip,
|
|
2588
2703
|
{
|
|
2589
2704
|
className: "rs-price-impact-info",
|
|
2590
2705
|
content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
|
|
2591
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2706
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.InfoIcon, { "aria-hidden": "true" })
|
|
2592
2707
|
}
|
|
2593
2708
|
)
|
|
2594
2709
|
] }),
|
|
2595
2710
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2596
|
-
|
|
2711
|
+
_chunk65MLWUQDcjs.ChevronDownIcon,
|
|
2597
2712
|
{
|
|
2598
2713
|
className: "rs-price-impact-chevron",
|
|
2599
2714
|
"aria-hidden": "true"
|
|
@@ -2604,29 +2719,29 @@ function DepositAddressStep({
|
|
|
2604
2719
|
),
|
|
2605
2720
|
/* @__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: [
|
|
2606
2721
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
2607
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2722
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.PercentIcon, {}) }),
|
|
2608
2723
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
2609
2724
|
"Max slippage: ",
|
|
2610
2725
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.2%" })
|
|
2611
2726
|
] }),
|
|
2612
2727
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2613
|
-
|
|
2728
|
+
_chunkFKHPVLJYcjs.Tooltip,
|
|
2614
2729
|
{
|
|
2615
2730
|
className: "rs-price-impact-info",
|
|
2616
2731
|
content: "Slippage accounts for price changes during execution. Slippage is adjusted per pair to ensure reliable execution.",
|
|
2617
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2732
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.InfoIcon, { "aria-hidden": "true" })
|
|
2618
2733
|
}
|
|
2619
2734
|
)
|
|
2620
2735
|
] }),
|
|
2621
2736
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
2622
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2737
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.ClockIcon, {}) }),
|
|
2623
2738
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
2624
2739
|
"Processing time: ",
|
|
2625
2740
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "< 1 min" })
|
|
2626
2741
|
] })
|
|
2627
2742
|
] }),
|
|
2628
2743
|
liquidityHelper.kind !== "idle" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
2629
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2744
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.PlusCircleIcon, {}) }),
|
|
2630
2745
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
2631
2746
|
"Max deposit:",
|
|
2632
2747
|
" ",
|
|
@@ -2657,7 +2772,7 @@ function DepositAddressStep({
|
|
|
2657
2772
|
},
|
|
2658
2773
|
deposit.id
|
|
2659
2774
|
)) }),
|
|
2660
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2775
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.PoweredBy, {})
|
|
2661
2776
|
] });
|
|
2662
2777
|
}
|
|
2663
2778
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -2705,7 +2820,7 @@ function FinalisingDepositStep() {
|
|
|
2705
2820
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "rs-finalising-subtitle", children: "We are depositing your funds to the application." })
|
|
2706
2821
|
] })
|
|
2707
2822
|
] }),
|
|
2708
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2823
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.PoweredBy, {})
|
|
2709
2824
|
] });
|
|
2710
2825
|
}
|
|
2711
2826
|
FinalisingDepositStep.displayName = "FinalisingDepositStep";
|
|
@@ -2735,7 +2850,7 @@ function SwappedOrderTracker({
|
|
|
2735
2850
|
];
|
|
2736
2851
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-swapped-tracker", children: [
|
|
2737
2852
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2738
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2853
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.HandCoinsIcon, {}), title }),
|
|
2739
2854
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ol", { className: "rs-swapped-tracker-steps", children: labels.map((label, idx) => {
|
|
2740
2855
|
const status = stepStates[idx];
|
|
2741
2856
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
@@ -2749,7 +2864,7 @@ function SwappedOrderTracker({
|
|
|
2749
2864
|
{
|
|
2750
2865
|
className: "rs-swapped-tracker-step-marker",
|
|
2751
2866
|
"aria-hidden": "true",
|
|
2752
|
-
children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2867
|
+
children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.CheckIcon, {}) : status === "failed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.CloseIcon, {}) : status === "active" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.Spinner, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2753
2868
|
"svg",
|
|
2754
2869
|
{
|
|
2755
2870
|
className: "rs-swapped-tracker-step-ring",
|
|
@@ -2784,7 +2899,7 @@ function SwappedOrderTracker({
|
|
|
2784
2899
|
}
|
|
2785
2900
|
)
|
|
2786
2901
|
] }),
|
|
2787
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2902
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.PoweredBy, {})
|
|
2788
2903
|
] });
|
|
2789
2904
|
}
|
|
2790
2905
|
function formatTrackerAmount(amount) {
|
|
@@ -2936,7 +3051,7 @@ function SwappedIframeStep({
|
|
|
2936
3051
|
if (cancelled) return;
|
|
2937
3052
|
const message = err instanceof Error ? err.message : loadErrorFallback;
|
|
2938
3053
|
setLoadError(message);
|
|
2939
|
-
_optionalChain([onErrorRef, 'access',
|
|
3054
|
+
_optionalChain([onErrorRef, 'access', _102 => _102.current, 'optionalCall', _103 => _103(message, loadErrorCode)]);
|
|
2940
3055
|
});
|
|
2941
3056
|
return () => {
|
|
2942
3057
|
cancelled = true;
|
|
@@ -2989,10 +3104,10 @@ function SwappedIframeStep({
|
|
|
2989
3104
|
const status = await service.fetchLatestStatus(smartAccount);
|
|
2990
3105
|
if (cancelled) return;
|
|
2991
3106
|
const event = status.lastEvent;
|
|
2992
|
-
const eventTxHash =
|
|
3107
|
+
const eventTxHash = _chunkFKHPVLJYcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkFKHPVLJYcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
2993
3108
|
if (baselineDepositTxHashRef.current === void 0) {
|
|
2994
3109
|
baselineDepositTxHashRef.current = eventTxHash;
|
|
2995
|
-
} else if (eventTxHash && (!baselineDepositTxHashRef.current || !
|
|
3110
|
+
} else if (eventTxHash && (!baselineDepositTxHashRef.current || !_chunkFKHPVLJYcjs.txRefsMatch.call(void 0, eventTxHash, baselineDepositTxHashRef.current))) {
|
|
2996
3111
|
currentDepositTxHashRef.current = eventTxHash;
|
|
2997
3112
|
setLatestEvent(_nullishCoalesce(event, () => ( null)));
|
|
2998
3113
|
}
|
|
@@ -3017,15 +3132,15 @@ function SwappedIframeStep({
|
|
|
3017
3132
|
}, [service, smartAccount]);
|
|
3018
3133
|
_react.useEffect.call(void 0, () => {
|
|
3019
3134
|
if (fastDepositPollEnabledRef.current) return;
|
|
3020
|
-
const status = _optionalChain([orderState, 'optionalAccess',
|
|
3135
|
+
const status = _optionalChain([orderState, 'optionalAccess', _104 => _104.status]);
|
|
3021
3136
|
if (!status || !SWAPPED_TERMINAL_STATUSES.has(status)) return;
|
|
3022
3137
|
fastDepositPollEnabledRef.current = true;
|
|
3023
|
-
_optionalChain([rescheduleDepositPollRef, 'access',
|
|
3138
|
+
_optionalChain([rescheduleDepositPollRef, 'access', _105 => _105.current, 'optionalCall', _106 => _106(DEPOSIT_POLL_FAST_INITIAL_DELAY_MS)]);
|
|
3024
3139
|
}, [orderState]);
|
|
3025
3140
|
_react.useEffect.call(void 0, () => {
|
|
3026
3141
|
function onMessage(e) {
|
|
3027
3142
|
if (!SWAPPED_IFRAME_ORIGINS.has(e.origin)) return;
|
|
3028
|
-
if (e.source !== _optionalChain([iframeRef, 'access',
|
|
3143
|
+
if (e.source !== _optionalChain([iframeRef, 'access', _107 => _107.current, 'optionalAccess', _108 => _108.contentWindow])) return;
|
|
3029
3144
|
if (isSwappedGoBackMessage(e.data)) {
|
|
3030
3145
|
onGoBackRef.current();
|
|
3031
3146
|
return;
|
|
@@ -3040,16 +3155,16 @@ function SwappedIframeStep({
|
|
|
3040
3155
|
setOrderState((prev) => ({
|
|
3041
3156
|
// Normalise to the uuid the backend poll also keys on, so orderState
|
|
3042
3157
|
// is consistent regardless of which path set it.
|
|
3043
|
-
orderId: _nullishCoalesce(_nullishCoalesce(expectedOrderUuidRef.current, () => ( _optionalChain([prev, 'optionalAccess',
|
|
3158
|
+
orderId: _nullishCoalesce(_nullishCoalesce(expectedOrderUuidRef.current, () => ( _optionalChain([prev, 'optionalAccess', _109 => _109.orderId]))), () => ( ext)),
|
|
3044
3159
|
status: parsed.status,
|
|
3045
|
-
orderCrypto: _nullishCoalesce(_nullishCoalesce(parsed.orderCrypto, () => ( _optionalChain([prev, 'optionalAccess',
|
|
3046
|
-
orderCryptoAmount: _nullishCoalesce(_nullishCoalesce(parsed.orderCryptoAmount, () => ( _optionalChain([prev, 'optionalAccess',
|
|
3047
|
-
transactionId: _nullishCoalesce(_nullishCoalesce(parsed.transactionId, () => ( _optionalChain([prev, 'optionalAccess',
|
|
3160
|
+
orderCrypto: _nullishCoalesce(_nullishCoalesce(parsed.orderCrypto, () => ( _optionalChain([prev, 'optionalAccess', _110 => _110.orderCrypto]))), () => ( null)),
|
|
3161
|
+
orderCryptoAmount: _nullishCoalesce(_nullishCoalesce(parsed.orderCryptoAmount, () => ( _optionalChain([prev, 'optionalAccess', _111 => _111.orderCryptoAmount]))), () => ( null)),
|
|
3162
|
+
transactionId: _nullishCoalesce(_nullishCoalesce(parsed.transactionId, () => ( _optionalChain([prev, 'optionalAccess', _112 => _112.transactionId]))), () => ( null)),
|
|
3048
3163
|
receivedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3049
|
-
paidAmountUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
3050
|
-
paidAmountEur: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
3051
|
-
onrampFeeUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
3052
|
-
paymentMethod: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
3164
|
+
paidAmountUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _113 => _113.paidAmountUsd]), () => ( null)),
|
|
3165
|
+
paidAmountEur: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _114 => _114.paidAmountEur]), () => ( null)),
|
|
3166
|
+
onrampFeeUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _115 => _115.onrampFeeUsd]), () => ( null)),
|
|
3167
|
+
paymentMethod: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _116 => _116.paymentMethod]), () => ( null))
|
|
3053
3168
|
}));
|
|
3054
3169
|
}
|
|
3055
3170
|
window.addEventListener("message", onMessage);
|
|
@@ -3062,17 +3177,17 @@ function SwappedIframeStep({
|
|
|
3062
3177
|
}
|
|
3063
3178
|
}, [phase, orderState, latestEvent, variant]);
|
|
3064
3179
|
const stepStates = _react.useMemo.call(void 0,
|
|
3065
|
-
() => deriveStepStates(_nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
3180
|
+
() => deriveStepStates(_nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _117 => _117.status]), () => ( null)), latestEvent),
|
|
3066
3181
|
[orderState, latestEvent]
|
|
3067
3182
|
);
|
|
3068
3183
|
const terminalState = _react.useMemo.call(void 0, () => {
|
|
3069
|
-
if (
|
|
3184
|
+
if (_chunkFKHPVLJYcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
|
|
3070
3185
|
return {
|
|
3071
3186
|
kind: "failed",
|
|
3072
|
-
message:
|
|
3187
|
+
message: _chunkFKHPVLJYcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
|
|
3073
3188
|
};
|
|
3074
3189
|
}
|
|
3075
|
-
if (_optionalChain([orderState, 'optionalAccess',
|
|
3190
|
+
if (_optionalChain([orderState, 'optionalAccess', _118 => _118.status]) === "order_cancelled") {
|
|
3076
3191
|
const banner = bannerForStatus("order_cancelled", {});
|
|
3077
3192
|
return { kind: "cancelled", message: _nullishCoalesce(banner.detail, () => ( banner.title)) };
|
|
3078
3193
|
}
|
|
@@ -3080,7 +3195,7 @@ function SwappedIframeStep({
|
|
|
3080
3195
|
}, [latestEvent, orderState, bannerForStatus]);
|
|
3081
3196
|
_react.useEffect.call(void 0, () => {
|
|
3082
3197
|
if (completeFiredRef.current || failedFiredRef.current) return;
|
|
3083
|
-
const t = _optionalChain([latestEvent, 'optionalAccess',
|
|
3198
|
+
const t = _optionalChain([latestEvent, 'optionalAccess', _119 => _119.type]);
|
|
3084
3199
|
const isSuccess = t === "bridge-complete";
|
|
3085
3200
|
if (!isSuccess) return;
|
|
3086
3201
|
const txHash = currentDepositTxHashRef.current;
|
|
@@ -3089,10 +3204,10 @@ function SwappedIframeStep({
|
|
|
3089
3204
|
const info = {
|
|
3090
3205
|
smartAccount,
|
|
3091
3206
|
txHash,
|
|
3092
|
-
orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
3207
|
+
orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _120 => _120.orderCrypto]), () => ( null)),
|
|
3093
3208
|
// Base-unit source amount from the deposit row/event, consistent with the
|
|
3094
3209
|
// wallet/QR path. ProcessingStep + onLifecycle expect base units.
|
|
3095
|
-
amount: _nullishCoalesce(
|
|
3210
|
+
amount: _nullishCoalesce(_chunkFKHPVLJYcjs.getEventSourceDetails.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0))).amount, () => ( null)),
|
|
3096
3211
|
expectedOrderUuid: expectedOrderUuidRef.current,
|
|
3097
3212
|
initialEvent: _nullishCoalesce(latestEvent, () => ( void 0))
|
|
3098
3213
|
};
|
|
@@ -3103,21 +3218,21 @@ function SwappedIframeStep({
|
|
|
3103
3218
|
}, [latestEvent, orderState, smartAccount]);
|
|
3104
3219
|
_react.useEffect.call(void 0, () => {
|
|
3105
3220
|
if (failedFiredRef.current || completeFiredRef.current) return;
|
|
3106
|
-
if (!
|
|
3221
|
+
if (!_chunkFKHPVLJYcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) return;
|
|
3107
3222
|
const txHash = currentDepositTxHashRef.current;
|
|
3108
3223
|
if (!txHash) return;
|
|
3109
3224
|
failedFiredRef.current = true;
|
|
3110
3225
|
setPhase("tracker");
|
|
3111
|
-
_optionalChain([onSwappedFailedRef, 'access',
|
|
3226
|
+
_optionalChain([onSwappedFailedRef, 'access', _121 => _121.current, 'optionalCall', _122 => _122(
|
|
3112
3227
|
txHash,
|
|
3113
|
-
|
|
3228
|
+
_chunkFKHPVLJYcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
|
|
3114
3229
|
)]);
|
|
3115
3230
|
}, [latestEvent]);
|
|
3116
3231
|
const immersive = variant === "fiat" && phase === "iframe" && !loadError;
|
|
3117
3232
|
_react.useEffect.call(void 0, () => {
|
|
3118
|
-
_optionalChain([onImmersiveChangeRef, 'access',
|
|
3233
|
+
_optionalChain([onImmersiveChangeRef, 'access', _123 => _123.current, 'optionalCall', _124 => _124(immersive)]);
|
|
3119
3234
|
}, [immersive]);
|
|
3120
|
-
_react.useEffect.call(void 0, () => () => _optionalChain([onImmersiveChangeRef, 'access',
|
|
3235
|
+
_react.useEffect.call(void 0, () => () => _optionalChain([onImmersiveChangeRef, 'access', _125 => _125.current, 'optionalCall', _126 => _126(false)]), []);
|
|
3121
3236
|
const handleRetry = () => {
|
|
3122
3237
|
setIframeSrc(null);
|
|
3123
3238
|
setWidgetUrl(null);
|
|
@@ -3133,8 +3248,8 @@ function SwappedIframeStep({
|
|
|
3133
3248
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3134
3249
|
SwappedOrderTracker,
|
|
3135
3250
|
{
|
|
3136
|
-
amount: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
3137
|
-
currency: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
3251
|
+
amount: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _127 => _127.orderCryptoAmount]), () => ( null)),
|
|
3252
|
+
currency: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _128 => _128.orderCrypto]), () => ( "USDC")),
|
|
3138
3253
|
stepStates,
|
|
3139
3254
|
terminal: terminalState,
|
|
3140
3255
|
onRetry: handleRetry,
|
|
@@ -3156,7 +3271,7 @@ function SwappedIframeStep({
|
|
|
3156
3271
|
}
|
|
3157
3272
|
)
|
|
3158
3273
|
] }),
|
|
3159
|
-
!loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3274
|
+
!loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.Spinner, {}) }),
|
|
3160
3275
|
widgetUrl && !loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3161
3276
|
"iframe",
|
|
3162
3277
|
{
|
|
@@ -3168,7 +3283,7 @@ function SwappedIframeStep({
|
|
|
3168
3283
|
allow: "payment; camera; microphone; clipboard-write; geolocation",
|
|
3169
3284
|
onLoad: () => {
|
|
3170
3285
|
try {
|
|
3171
|
-
if (_optionalChain([iframeRef, 'access',
|
|
3286
|
+
if (_optionalChain([iframeRef, 'access', _129 => _129.current, 'optionalAccess', _130 => _130.contentWindow, 'optionalAccess', _131 => _131.location, 'optionalAccess', _132 => _132.href]) === "about:blank") {
|
|
3172
3287
|
return;
|
|
3173
3288
|
}
|
|
3174
3289
|
} catch (e19) {
|
|
@@ -3179,11 +3294,11 @@ function SwappedIframeStep({
|
|
|
3179
3294
|
retryToken
|
|
3180
3295
|
)
|
|
3181
3296
|
] }) }),
|
|
3182
|
-
loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3297
|
+
loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.PoweredBy, {})
|
|
3183
3298
|
] });
|
|
3184
3299
|
}
|
|
3185
3300
|
function deriveStepStates(swappedStatus, latestEvent) {
|
|
3186
|
-
if (
|
|
3301
|
+
if (_chunkFKHPVLJYcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
|
|
3187
3302
|
return ["complete", "complete", "failed", "pending"];
|
|
3188
3303
|
}
|
|
3189
3304
|
if (swappedStatus === "order_cancelled") {
|
|
@@ -3191,7 +3306,7 @@ function deriveStepStates(swappedStatus, latestEvent) {
|
|
|
3191
3306
|
}
|
|
3192
3307
|
const step1Complete = swappedStatus === "order_completed" || swappedStatus === "order_broadcasted";
|
|
3193
3308
|
const step2Complete = latestEvent !== null || swappedStatus === "order_broadcasted";
|
|
3194
|
-
const step3Complete = _optionalChain([latestEvent, 'optionalAccess',
|
|
3309
|
+
const step3Complete = _optionalChain([latestEvent, 'optionalAccess', _133 => _133.type]) === "bridge-complete";
|
|
3195
3310
|
if (step3Complete) {
|
|
3196
3311
|
return ["complete", "complete", "complete", "complete"];
|
|
3197
3312
|
}
|
|
@@ -3247,7 +3362,7 @@ function FiatOnrampStep({
|
|
|
3247
3362
|
onImmersiveChange
|
|
3248
3363
|
}) {
|
|
3249
3364
|
const loadUrl = _react.useCallback.call(void 0, async () => {
|
|
3250
|
-
const prefetched = _optionalChain([consumePrefetchedUrl, 'optionalCall',
|
|
3365
|
+
const prefetched = _optionalChain([consumePrefetchedUrl, 'optionalCall', _134 => _134(
|
|
3251
3366
|
smartAccount,
|
|
3252
3367
|
paymentMethod,
|
|
3253
3368
|
methodSelectionSource
|
|
@@ -3373,7 +3488,7 @@ ExchangeConnectStep.displayName = "ExchangeConnectStep";
|
|
|
3373
3488
|
function ExchangeLogo({ exchange }) {
|
|
3374
3489
|
const [failed, setFailed] = _react.useState.call(void 0, false);
|
|
3375
3490
|
if (!exchange.logoUrl || failed) {
|
|
3376
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3491
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.BankIcon, {});
|
|
3377
3492
|
}
|
|
3378
3493
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3379
3494
|
"img",
|
|
@@ -3418,7 +3533,7 @@ function ExchangeSelectStep({
|
|
|
3418
3533
|
setExchanges([]);
|
|
3419
3534
|
setExchangeFeeBps(0);
|
|
3420
3535
|
setError(message);
|
|
3421
|
-
_optionalChain([onError, 'optionalCall',
|
|
3536
|
+
_optionalChain([onError, 'optionalCall', _135 => _135(message, "SWAPPED_CONNECT_EXCHANGES_FAILED")]);
|
|
3422
3537
|
}).finally(() => {
|
|
3423
3538
|
if (!cancelled) setLoading(false);
|
|
3424
3539
|
});
|
|
@@ -3444,7 +3559,7 @@ function ExchangeSelectStep({
|
|
|
3444
3559
|
} catch (err) {
|
|
3445
3560
|
const message = err instanceof Error ? err.message : "Failed to prepare Connect";
|
|
3446
3561
|
setSelectionNotice(message);
|
|
3447
|
-
_optionalChain([onError, 'optionalCall',
|
|
3562
|
+
_optionalChain([onError, 'optionalCall', _136 => _136(message, "SWAPPED_CONNECT_URL_FAILED")]);
|
|
3448
3563
|
} finally {
|
|
3449
3564
|
setSelectingConnection(null);
|
|
3450
3565
|
}
|
|
@@ -3454,14 +3569,14 @@ function ExchangeSelectStep({
|
|
|
3454
3569
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-exchange-select", children: [
|
|
3455
3570
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3456
3571
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3457
|
-
|
|
3572
|
+
_chunk65MLWUQDcjs.BodyHeader,
|
|
3458
3573
|
{
|
|
3459
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3574
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.UnplugIcon, {}),
|
|
3460
3575
|
title: "Connect exchange",
|
|
3461
3576
|
subtitle: "Select an exchange to connect"
|
|
3462
3577
|
}
|
|
3463
3578
|
),
|
|
3464
|
-
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3579
|
+
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.Spinner, {}) }),
|
|
3465
3580
|
!loading && error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: [
|
|
3466
3581
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state-title", children: "Couldn\u2019t load exchanges" }),
|
|
3467
3582
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3487,7 +3602,7 @@ function ExchangeSelectStep({
|
|
|
3487
3602
|
)
|
|
3488
3603
|
] }),
|
|
3489
3604
|
!loading && !error && exchanges.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-grid", children: exchanges.map((exchange) => {
|
|
3490
|
-
const brand =
|
|
3605
|
+
const brand = _chunkFKHPVLJYcjs.getExchangeLogo.call(void 0, exchange.name, exchange.connection);
|
|
3491
3606
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3492
3607
|
"button",
|
|
3493
3608
|
{
|
|
@@ -3512,7 +3627,7 @@ function ExchangeSelectStep({
|
|
|
3512
3627
|
);
|
|
3513
3628
|
}) })
|
|
3514
3629
|
] }),
|
|
3515
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3630
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.PoweredBy, {}),
|
|
3516
3631
|
exchangeFeeBps > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "rs-exchange-select-fee-note", children: [
|
|
3517
3632
|
"A ",
|
|
3518
3633
|
formatFeeRate(exchangeFeeBps),
|
|
@@ -3523,117 +3638,6 @@ function ExchangeSelectStep({
|
|
|
3523
3638
|
}
|
|
3524
3639
|
ExchangeSelectStep.displayName = "ExchangeSelectStep";
|
|
3525
3640
|
|
|
3526
|
-
// src/components/steps/DepositAddressSkeleton.tsx
|
|
3527
|
-
|
|
3528
|
-
var BASE_CHAIN_ID = 8453;
|
|
3529
|
-
function DepositAddressSkeleton({
|
|
3530
|
-
uiConfig
|
|
3531
|
-
}) {
|
|
3532
|
-
const evmChainIds = _chunkTENL4H64cjs.getSupportedChainIds.call(void 0, );
|
|
3533
|
-
const defaultChainId = evmChainIds.includes(BASE_CHAIN_ID) ? BASE_CHAIN_ID : evmChainIds[0];
|
|
3534
|
-
const tokensForChain = _chunkTENL4H64cjs.getTargetTokenSymbolsForChain.call(void 0, defaultChainId);
|
|
3535
|
-
const defaultToken = tokensForChain.includes("USDC") ? "USDC" : _nullishCoalesce(tokensForChain[0], () => ( "USDC"));
|
|
3536
|
-
const chainName = _chunkTENL4H64cjs.getChainName.call(void 0, defaultChainId);
|
|
3537
|
-
const chainIcon = _chunkTENL4H64cjs.getChainIcon.call(void 0, defaultChainId);
|
|
3538
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", "aria-busy": "true", children: [
|
|
3539
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: "Preparing deposit details\u2026" }),
|
|
3540
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
3541
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
3542
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", "aria-hidden": "true", children: [
|
|
3543
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
3544
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
3545
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown-trigger", children: [
|
|
3546
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3547
|
-
_chunkZQR36NCVcjs.CdnIcon,
|
|
3548
|
-
{
|
|
3549
|
-
src: chainIcon,
|
|
3550
|
-
className: "rs-deposit-address-dropdown-icon"
|
|
3551
|
-
}
|
|
3552
|
-
),
|
|
3553
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainName }),
|
|
3554
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
3555
|
-
] })
|
|
3556
|
-
] }),
|
|
3557
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
3558
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown-label rs-deposit-address-dropdown-label--with-min", children: [
|
|
3559
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Supported token" }),
|
|
3560
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
3561
|
-
"Min.$",
|
|
3562
|
-
(_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _136 => _136.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
3563
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHUHBNYD3cjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3564
|
-
_chunkZQR36NCVcjs.InfoIcon,
|
|
3565
|
-
{
|
|
3566
|
-
className: "rs-deposit-address-min-icon",
|
|
3567
|
-
"aria-hidden": "true"
|
|
3568
|
-
}
|
|
3569
|
-
) })
|
|
3570
|
-
] })
|
|
3571
|
-
] }),
|
|
3572
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown-trigger", children: [
|
|
3573
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3574
|
-
_chunkZQR36NCVcjs.TokenIcon,
|
|
3575
|
-
{
|
|
3576
|
-
symbol: defaultToken,
|
|
3577
|
-
className: "rs-deposit-address-dropdown-icon"
|
|
3578
|
-
}
|
|
3579
|
-
),
|
|
3580
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: defaultToken }),
|
|
3581
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
3582
|
-
] })
|
|
3583
|
-
] })
|
|
3584
|
-
] }),
|
|
3585
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3586
|
-
"div",
|
|
3587
|
-
{
|
|
3588
|
-
style: { display: "flex", flexDirection: "column", gap: 4, width: "100%" },
|
|
3589
|
-
children: [
|
|
3590
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-well", children: [
|
|
3591
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-qr", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-skeleton rs-skeleton-qr", "aria-hidden": "true" }) }),
|
|
3592
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-skeleton rs-skeleton-address", "aria-hidden": "true" })
|
|
3593
|
-
] }),
|
|
3594
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3595
|
-
"button",
|
|
3596
|
-
{
|
|
3597
|
-
type: "button",
|
|
3598
|
-
className: "rs-deposit-address-copy",
|
|
3599
|
-
disabled: true,
|
|
3600
|
-
"aria-hidden": "true",
|
|
3601
|
-
children: [
|
|
3602
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.CopyIcon, {}),
|
|
3603
|
-
"Copy address"
|
|
3604
|
-
]
|
|
3605
|
-
}
|
|
3606
|
-
)
|
|
3607
|
-
]
|
|
3608
|
-
}
|
|
3609
|
-
),
|
|
3610
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-price-impact", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-header", children: [
|
|
3611
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-header-left", children: [
|
|
3612
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
|
|
3613
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
|
|
3614
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3615
|
-
_chunkHUHBNYD3cjs.Tooltip,
|
|
3616
|
-
{
|
|
3617
|
-
className: "rs-price-impact-info",
|
|
3618
|
-
content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
|
|
3619
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.InfoIcon, { "aria-hidden": "true" })
|
|
3620
|
-
}
|
|
3621
|
-
)
|
|
3622
|
-
] }),
|
|
3623
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3624
|
-
_chunkZQR36NCVcjs.ChevronDownIcon,
|
|
3625
|
-
{
|
|
3626
|
-
className: "rs-price-impact-chevron",
|
|
3627
|
-
"aria-hidden": "true"
|
|
3628
|
-
}
|
|
3629
|
-
)
|
|
3630
|
-
] }) })
|
|
3631
|
-
] }),
|
|
3632
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.PoweredBy, {})
|
|
3633
|
-
] });
|
|
3634
|
-
}
|
|
3635
|
-
DepositAddressSkeleton.displayName = "DepositAddressSkeleton";
|
|
3636
|
-
|
|
3637
3641
|
// src/components/steps/SolanaTokenSelectStep.tsx
|
|
3638
3642
|
|
|
3639
3643
|
|
|
@@ -3661,14 +3665,14 @@ function SolanaTokenSelectStep({
|
|
|
3661
3665
|
setError(null);
|
|
3662
3666
|
const portfolioBySymbol = {};
|
|
3663
3667
|
try {
|
|
3664
|
-
|
|
3668
|
+
_chunk65MLWUQDcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
|
|
3665
3669
|
solanaAddress
|
|
3666
3670
|
});
|
|
3667
3671
|
const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
|
|
3668
3672
|
if (!active) return;
|
|
3669
3673
|
for (const t of portfolio.tokens) {
|
|
3670
3674
|
const symbol = t.symbol.toUpperCase();
|
|
3671
|
-
if (!
|
|
3675
|
+
if (!_chunkO7BCVQ6Lcjs.SOLANA_TOKENS.some((st) => st.symbol === symbol)) continue;
|
|
3672
3676
|
let parsed = 0n;
|
|
3673
3677
|
try {
|
|
3674
3678
|
parsed = BigInt(t.balance || "0");
|
|
@@ -3684,12 +3688,12 @@ function SolanaTokenSelectStep({
|
|
|
3684
3688
|
};
|
|
3685
3689
|
}
|
|
3686
3690
|
}
|
|
3687
|
-
|
|
3691
|
+
_chunk65MLWUQDcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
|
|
3688
3692
|
symbols: Object.keys(portfolioBySymbol)
|
|
3689
3693
|
});
|
|
3690
3694
|
} catch (err) {
|
|
3691
3695
|
if (!active) return;
|
|
3692
|
-
|
|
3696
|
+
_chunk65MLWUQDcjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
|
|
3693
3697
|
solanaAddress
|
|
3694
3698
|
});
|
|
3695
3699
|
setError(
|
|
@@ -3700,7 +3704,7 @@ function SolanaTokenSelectStep({
|
|
|
3700
3704
|
return;
|
|
3701
3705
|
}
|
|
3702
3706
|
const results = [];
|
|
3703
|
-
for (const token of
|
|
3707
|
+
for (const token of _chunkO7BCVQ6Lcjs.SOLANA_TOKENS) {
|
|
3704
3708
|
const fromPortfolio = portfolioBySymbol[token.symbol];
|
|
3705
3709
|
if (fromPortfolio && fromPortfolio.balance > 0n) {
|
|
3706
3710
|
results.push({
|
|
@@ -3736,30 +3740,30 @@ function SolanaTokenSelectStep({
|
|
|
3736
3740
|
const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
|
|
3737
3741
|
const numeric = Number(raw);
|
|
3738
3742
|
if (!Number.isFinite(numeric)) return raw;
|
|
3739
|
-
return
|
|
3743
|
+
return _chunk65MLWUQDcjs.tokenFormatter.format(numeric);
|
|
3740
3744
|
} catch (e22) {
|
|
3741
3745
|
return "--";
|
|
3742
3746
|
}
|
|
3743
3747
|
};
|
|
3744
|
-
const chainIcon =
|
|
3745
|
-
const chainName =
|
|
3748
|
+
const chainIcon = _chunkO7BCVQ6Lcjs.getChainIcon.call(void 0, "solana");
|
|
3749
|
+
const chainName = _chunkO7BCVQ6Lcjs.getChainName.call(void 0, "solana");
|
|
3746
3750
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
3747
3751
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
3748
3752
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3749
|
-
|
|
3753
|
+
_chunk65MLWUQDcjs.BodyHeader,
|
|
3750
3754
|
{
|
|
3751
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3755
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.WalletIcon, {}),
|
|
3752
3756
|
title: "Your assets",
|
|
3753
3757
|
subtitle: "Select source assets to transfer"
|
|
3754
3758
|
}
|
|
3755
3759
|
),
|
|
3756
3760
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
3757
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3761
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
3758
3762
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
3759
3763
|
] }),
|
|
3760
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3764
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.Callout, { variant: "error", children: error }),
|
|
3761
3765
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
3762
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3766
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
3763
3767
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
3764
3768
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
3765
3769
|
solanaAddress.slice(0, 6),
|
|
@@ -3790,13 +3794,13 @@ function SolanaTokenSelectStep({
|
|
|
3790
3794
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
|
|
3791
3795
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-icon-wrapper", children: [
|
|
3792
3796
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3793
|
-
|
|
3797
|
+
_chunk65MLWUQDcjs.TokenIcon,
|
|
3794
3798
|
{
|
|
3795
3799
|
symbol: entry.token.symbol,
|
|
3796
3800
|
fallback: entry.token.symbol.slice(0, 4)
|
|
3797
3801
|
}
|
|
3798
3802
|
) }),
|
|
3799
|
-
chainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3803
|
+
chainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.CdnIcon, { src: chainIcon, alt: chainName }) })
|
|
3800
3804
|
] }),
|
|
3801
3805
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-text", children: [
|
|
3802
3806
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-name-row", children: [
|
|
@@ -3813,14 +3817,14 @@ function SolanaTokenSelectStep({
|
|
|
3813
3817
|
] })
|
|
3814
3818
|
] })
|
|
3815
3819
|
] }),
|
|
3816
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ?
|
|
3820
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunk65MLWUQDcjs.currencyFormatter.format(entry.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${entry.token.symbol}` : "--" })
|
|
3817
3821
|
]
|
|
3818
3822
|
},
|
|
3819
3823
|
entry.token.symbol
|
|
3820
3824
|
);
|
|
3821
3825
|
}) }),
|
|
3822
3826
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3823
|
-
|
|
3827
|
+
_chunk65MLWUQDcjs.Button,
|
|
3824
3828
|
{
|
|
3825
3829
|
onClick: () => selectedEntry && onContinue(
|
|
3826
3830
|
selectedEntry.token,
|
|
@@ -3833,7 +3837,7 @@ function SolanaTokenSelectStep({
|
|
|
3833
3837
|
}
|
|
3834
3838
|
)
|
|
3835
3839
|
] }),
|
|
3836
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3840
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.PoweredBy, {})
|
|
3837
3841
|
] });
|
|
3838
3842
|
}
|
|
3839
3843
|
|
|
@@ -3864,7 +3868,7 @@ function SolanaAmountStep({
|
|
|
3864
3868
|
const [amount, setAmount] = _react.useState.call(void 0, "");
|
|
3865
3869
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
3866
3870
|
const hasAppliedDefaultRef = _react.useRef.call(void 0, false);
|
|
3867
|
-
const isSourceStablecoin =
|
|
3871
|
+
const isSourceStablecoin = _chunkO7BCVQ6Lcjs.isStablecoinSymbol.call(void 0, token.symbol);
|
|
3868
3872
|
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess', _138 => _138.trim, 'call', _139 => _139(), 'access', _140 => _140.toLowerCase, 'call', _141 => _141()]) === "max";
|
|
3869
3873
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
3870
3874
|
if (isSourceStablecoin) return 1;
|
|
@@ -3885,7 +3889,7 @@ function SolanaAmountStep({
|
|
|
3885
3889
|
const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
|
|
3886
3890
|
const numeric = Number(raw);
|
|
3887
3891
|
if (!Number.isFinite(numeric)) return raw;
|
|
3888
|
-
return
|
|
3892
|
+
return _chunk65MLWUQDcjs.tokenFormatter.format(numeric);
|
|
3889
3893
|
} catch (e24) {
|
|
3890
3894
|
return "\u2026";
|
|
3891
3895
|
}
|
|
@@ -3902,7 +3906,7 @@ function SolanaAmountStep({
|
|
|
3902
3906
|
}
|
|
3903
3907
|
}, [balance, token.decimals, tokenPriceUsd, balanceUsd]);
|
|
3904
3908
|
const spendableBalance = _react.useMemo.call(void 0, () => {
|
|
3905
|
-
if (!
|
|
3909
|
+
if (!_chunkO7BCVQ6Lcjs.isNativeSol.call(void 0, token)) return balance;
|
|
3906
3910
|
return balance > SOL_FEE_RESERVE_LAMPORTS ? balance - SOL_FEE_RESERVE_LAMPORTS : 0n;
|
|
3907
3911
|
}, [balance, token]);
|
|
3908
3912
|
const spendableBalanceUsd = _react.useMemo.call(void 0, () => {
|
|
@@ -3967,7 +3971,7 @@ function SolanaAmountStep({
|
|
|
3967
3971
|
return null;
|
|
3968
3972
|
}
|
|
3969
3973
|
}, [numericAmount, isSourceStablecoin, hasPricing, tokenPriceUsd, token.decimals]);
|
|
3970
|
-
const minDepositUsd =
|
|
3974
|
+
const minDepositUsd = _chunkO7BCVQ6Lcjs.isHyperCoreDestination.call(void 0, targetChain) ? Math.max(_chunkO7BCVQ6Lcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _142 => _142.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _143 => _143.minDepositUsd]), () => ( null));
|
|
3971
3975
|
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _144 => _144.maxDepositUsd]), () => ( null));
|
|
3972
3976
|
const isBelowMin = minDepositUsd !== null && numericAmount > 0 && numericAmount < minDepositUsd;
|
|
3973
3977
|
const isAboveMax = maxDepositUsd !== null && numericAmount > maxDepositUsd;
|
|
@@ -3978,7 +3982,7 @@ function SolanaAmountStep({
|
|
|
3978
3982
|
const handlePresetClick = (percentage) => {
|
|
3979
3983
|
const formatted = computePresetAmount(percentage);
|
|
3980
3984
|
if (!formatted) return;
|
|
3981
|
-
|
|
3985
|
+
_chunk65MLWUQDcjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
|
|
3982
3986
|
percentage,
|
|
3983
3987
|
symbol: token.symbol,
|
|
3984
3988
|
formatted
|
|
@@ -4013,7 +4017,7 @@ function SolanaAmountStep({
|
|
|
4013
4017
|
try {
|
|
4014
4018
|
amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
|
|
4015
4019
|
} catch (e29) {
|
|
4016
|
-
|
|
4020
|
+
_chunk65MLWUQDcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
4017
4021
|
amount,
|
|
4018
4022
|
sourceAmount: sourceAmountStr,
|
|
4019
4023
|
reason: "parse-units-failed"
|
|
@@ -4022,13 +4026,13 @@ function SolanaAmountStep({
|
|
|
4022
4026
|
return;
|
|
4023
4027
|
}
|
|
4024
4028
|
if (amountInUnits > spendableBalance) {
|
|
4025
|
-
const isReserveIssue =
|
|
4029
|
+
const isReserveIssue = _chunkO7BCVQ6Lcjs.isNativeSol.call(void 0, token) && amountInUnits <= balance;
|
|
4026
4030
|
setError(
|
|
4027
4031
|
isReserveIssue ? "Use a bit less than your full SOL balance" : "Insufficient balance"
|
|
4028
4032
|
);
|
|
4029
4033
|
return;
|
|
4030
4034
|
}
|
|
4031
|
-
|
|
4035
|
+
_chunk65MLWUQDcjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
|
|
4032
4036
|
symbol: token.symbol,
|
|
4033
4037
|
inputAmountUsd: amount,
|
|
4034
4038
|
sourceAmount: sourceAmountStr,
|
|
@@ -4041,7 +4045,7 @@ function SolanaAmountStep({
|
|
|
4041
4045
|
const continueDisabled = exceedsBalance || numericAmount === 0 && !isBelowMin;
|
|
4042
4046
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
4043
4047
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4044
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4048
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.WalletIcon, {}), title: "Wallet deposit" }),
|
|
4045
4049
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
4046
4050
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
4047
4051
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -4061,13 +4065,13 @@ function SolanaAmountStep({
|
|
|
4061
4065
|
" available",
|
|
4062
4066
|
computedBalanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
4063
4067
|
" (~",
|
|
4064
|
-
|
|
4068
|
+
_chunk65MLWUQDcjs.currencyFormatter.format(computedBalanceUsd),
|
|
4065
4069
|
")"
|
|
4066
4070
|
] })
|
|
4067
4071
|
] }),
|
|
4068
4072
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
4069
4073
|
"Min. deposit ",
|
|
4070
|
-
|
|
4074
|
+
_chunk65MLWUQDcjs.currencyFormatter.format(minDepositUsd)
|
|
4071
4075
|
] })
|
|
4072
4076
|
] })
|
|
4073
4077
|
] }),
|
|
@@ -4090,7 +4094,7 @@ function SolanaAmountStep({
|
|
|
4090
4094
|
"Solana ",
|
|
4091
4095
|
token.symbol
|
|
4092
4096
|
] }),
|
|
4093
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4097
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.TokenIcon, { symbol: token.symbol }) })
|
|
4094
4098
|
] })
|
|
4095
4099
|
] }),
|
|
4096
4100
|
targetChainName && targetTokenSymbol && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
@@ -4101,17 +4105,17 @@ function SolanaAmountStep({
|
|
|
4101
4105
|
" ",
|
|
4102
4106
|
targetTokenSymbol
|
|
4103
4107
|
] }),
|
|
4104
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4108
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.TokenIcon, { symbol: targetTokenSymbol }) })
|
|
4105
4109
|
] })
|
|
4106
4110
|
] }),
|
|
4107
4111
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
4108
4112
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
4109
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
4113
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunk65MLWUQDcjs.currencyFormatter.format(balanceAfterUsd) })
|
|
4110
4114
|
] })
|
|
4111
4115
|
] }),
|
|
4112
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4116
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.Callout, { variant: "error", children: error }),
|
|
4113
4117
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4114
|
-
|
|
4118
|
+
_chunk65MLWUQDcjs.Button,
|
|
4115
4119
|
{
|
|
4116
4120
|
onClick: handleContinue,
|
|
4117
4121
|
fullWidth: true,
|
|
@@ -4120,7 +4124,7 @@ function SolanaAmountStep({
|
|
|
4120
4124
|
}
|
|
4121
4125
|
)
|
|
4122
4126
|
] }),
|
|
4123
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4127
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.PoweredBy, {})
|
|
4124
4128
|
] });
|
|
4125
4129
|
}
|
|
4126
4130
|
|
|
@@ -4143,10 +4147,10 @@ var _spltoken = require('@solana/spl-token');
|
|
|
4143
4147
|
var DEFAULT_SOLANA_RPC_URL = "https://api.mainnet.solana.com";
|
|
4144
4148
|
var cachedConnections = /* @__PURE__ */ new Map();
|
|
4145
4149
|
function getSolanaRpcUrl(rpcUrls) {
|
|
4146
|
-
return _nullishCoalesce(
|
|
4150
|
+
return _nullishCoalesce(_chunk65MLWUQDcjs.rpcUrlFor.call(void 0, rpcUrls, "solana"), () => ( DEFAULT_SOLANA_RPC_URL));
|
|
4147
4151
|
}
|
|
4148
4152
|
function hasConfiguredSolanaRpcUrl(rpcUrls) {
|
|
4149
|
-
return
|
|
4153
|
+
return _chunk65MLWUQDcjs.rpcUrlFor.call(void 0, rpcUrls, "solana") !== void 0;
|
|
4150
4154
|
}
|
|
4151
4155
|
function getSolanaConnection(rpcUrls) {
|
|
4152
4156
|
const rpcUrl = getSolanaRpcUrl(rpcUrls);
|
|
@@ -4248,37 +4252,37 @@ function SolanaConfirmStep({
|
|
|
4248
4252
|
onError,
|
|
4249
4253
|
debug
|
|
4250
4254
|
}) {
|
|
4251
|
-
const rpcUrls =
|
|
4255
|
+
const rpcUrls = _chunk65MLWUQDcjs.useRpcUrls.call(void 0, );
|
|
4252
4256
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
4253
4257
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
4254
|
-
const targetChainId =
|
|
4255
|
-
const targetSymbol =
|
|
4256
|
-
const sourceChainName =
|
|
4257
|
-
const targetChainName =
|
|
4258
|
-
const sourceChainIcon =
|
|
4259
|
-
const targetChainIcon =
|
|
4258
|
+
const targetChainId = _chunkO7BCVQ6Lcjs.targetChainToChainId.call(void 0, targetChain);
|
|
4259
|
+
const targetSymbol = _chunkO7BCVQ6Lcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
4260
|
+
const sourceChainName = _chunkO7BCVQ6Lcjs.getChainName.call(void 0, "solana");
|
|
4261
|
+
const targetChainName = _chunkO7BCVQ6Lcjs.getChainName.call(void 0, targetChainId);
|
|
4262
|
+
const sourceChainIcon = _chunkO7BCVQ6Lcjs.getChainIcon.call(void 0, "solana");
|
|
4263
|
+
const targetChainIcon = _chunkO7BCVQ6Lcjs.getChainIcon.call(void 0, targetChainId);
|
|
4260
4264
|
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _145 => _145.feeSponsored]), () => ( false));
|
|
4261
4265
|
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _146 => _146.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
4262
|
-
const formattedAmount = sourceAmount && Number.isFinite(Number(sourceAmount)) ? _nullishCoalesce(
|
|
4266
|
+
const formattedAmount = sourceAmount && Number.isFinite(Number(sourceAmount)) ? _nullishCoalesce(_chunk65MLWUQDcjs.formatTokenAmount.call(void 0, Number(sourceAmount), token.symbol), () => ( "0")) : "0";
|
|
4263
4267
|
const receiveDisplay = (() => {
|
|
4264
4268
|
const usdValue = Number(targetAmount);
|
|
4265
4269
|
const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
|
|
4266
|
-
const estimate =
|
|
4270
|
+
const estimate = _chunk65MLWUQDcjs.formatReceiveEstimate.call(void 0, {
|
|
4267
4271
|
sourceAmount: Number.isFinite(Number(sourceAmount)) ? Number(sourceAmount) : void 0,
|
|
4268
4272
|
sourceSymbol: token.symbol,
|
|
4269
4273
|
targetSymbol,
|
|
4270
4274
|
sourceAmountUsd,
|
|
4271
|
-
sourceTrusted:
|
|
4275
|
+
sourceTrusted: _chunk65MLWUQDcjs.isRecognizedToken.call(void 0, token.mint, "solana"),
|
|
4272
4276
|
// Curated stablecoin target estimates at $1 when unquoted; never applied
|
|
4273
4277
|
// to the source (a held token). See ConfirmStep for the rationale.
|
|
4274
|
-
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } :
|
|
4278
|
+
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : _chunk65MLWUQDcjs.isDisplayStablecoinSymbol.call(void 0, targetSymbol) ? { [targetSymbol.toUpperCase()]: 1 } : {}
|
|
4275
4279
|
});
|
|
4276
4280
|
if (estimate !== void 0) return estimate;
|
|
4277
4281
|
return targetSymbol;
|
|
4278
4282
|
})();
|
|
4279
4283
|
const handleConfirm = async () => {
|
|
4280
4284
|
if (!solanaProvider) {
|
|
4281
|
-
|
|
4285
|
+
_chunk65MLWUQDcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
4282
4286
|
reason: "missing-provider"
|
|
4283
4287
|
});
|
|
4284
4288
|
setError("Solana wallet not connected");
|
|
@@ -4286,7 +4290,7 @@ function SolanaConfirmStep({
|
|
|
4286
4290
|
}
|
|
4287
4291
|
const parsedAmount = parseFloat(sourceAmount);
|
|
4288
4292
|
if (isNaN(parsedAmount) || parsedAmount <= 0) {
|
|
4289
|
-
|
|
4293
|
+
_chunk65MLWUQDcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
4290
4294
|
reason: "invalid-amount",
|
|
4291
4295
|
sourceAmount
|
|
4292
4296
|
});
|
|
@@ -4295,7 +4299,7 @@ function SolanaConfirmStep({
|
|
|
4295
4299
|
}
|
|
4296
4300
|
setError(null);
|
|
4297
4301
|
setIsSubmitting(true);
|
|
4298
|
-
|
|
4302
|
+
_chunk65MLWUQDcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
|
|
4299
4303
|
smartAccount,
|
|
4300
4304
|
solanaAddress,
|
|
4301
4305
|
solanaDepositAddress,
|
|
@@ -4305,7 +4309,7 @@ function SolanaConfirmStep({
|
|
|
4305
4309
|
});
|
|
4306
4310
|
try {
|
|
4307
4311
|
const check = await service.checkAccount(smartAccount);
|
|
4308
|
-
|
|
4312
|
+
_chunk65MLWUQDcjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
|
|
4309
4313
|
smartAccount,
|
|
4310
4314
|
isRegistered: check.isRegistered,
|
|
4311
4315
|
targetChain: check.targetChain,
|
|
@@ -4318,12 +4322,12 @@ function SolanaConfirmStep({
|
|
|
4318
4322
|
}
|
|
4319
4323
|
const connection = hasConfiguredSolanaRpcUrl(rpcUrls) ? getSolanaConnection(rpcUrls) : _nullishCoalesce(solanaConnection, () => ( getSolanaConnection(rpcUrls)));
|
|
4320
4324
|
const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
|
|
4321
|
-
|
|
4325
|
+
_chunk65MLWUQDcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
|
|
4322
4326
|
token: token.symbol,
|
|
4323
4327
|
sourceAmount,
|
|
4324
4328
|
amountUnits: amountUnits.toString()
|
|
4325
4329
|
});
|
|
4326
|
-
const transaction =
|
|
4330
|
+
const transaction = _chunkO7BCVQ6Lcjs.isNativeSol.call(void 0, token) ? await buildSolTransferTransaction(
|
|
4327
4331
|
connection,
|
|
4328
4332
|
solanaAddress,
|
|
4329
4333
|
solanaDepositAddress,
|
|
@@ -4335,7 +4339,7 @@ function SolanaConfirmStep({
|
|
|
4335
4339
|
token.mint,
|
|
4336
4340
|
amountUnits
|
|
4337
4341
|
);
|
|
4338
|
-
|
|
4342
|
+
_chunk65MLWUQDcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
4339
4343
|
token: token.symbol,
|
|
4340
4344
|
instructionCount: transaction.instructions.length,
|
|
4341
4345
|
feePayer: _optionalChain([transaction, 'access', _147 => _147.feePayer, 'optionalAccess', _148 => _148.toBase58, 'call', _149 => _149()]),
|
|
@@ -4346,7 +4350,7 @@ function SolanaConfirmStep({
|
|
|
4346
4350
|
connection,
|
|
4347
4351
|
transaction
|
|
4348
4352
|
);
|
|
4349
|
-
|
|
4353
|
+
_chunk65MLWUQDcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
|
|
4350
4354
|
txHash,
|
|
4351
4355
|
amountUnits: amountUnits.toString()
|
|
4352
4356
|
});
|
|
@@ -4358,8 +4362,8 @@ function SolanaConfirmStep({
|
|
|
4358
4362
|
});
|
|
4359
4363
|
} catch (err) {
|
|
4360
4364
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
4361
|
-
const message =
|
|
4362
|
-
|
|
4365
|
+
const message = _chunk65MLWUQDcjs.formatUserError.call(void 0, raw);
|
|
4366
|
+
_chunk65MLWUQDcjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
|
|
4363
4367
|
smartAccount,
|
|
4364
4368
|
token: token.symbol,
|
|
4365
4369
|
sourceAmount
|
|
@@ -4372,20 +4376,20 @@ function SolanaConfirmStep({
|
|
|
4372
4376
|
};
|
|
4373
4377
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
4374
4378
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4375
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4379
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.WalletIcon, {}), title: "Review deposit" }),
|
|
4376
4380
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
|
|
4377
4381
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
4378
4382
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
4379
4383
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
4380
4384
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceChainName }),
|
|
4381
|
-
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4385
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.CdnIcon, { src: sourceChainIcon }) })
|
|
4382
4386
|
] })
|
|
4383
4387
|
] }),
|
|
4384
4388
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
4385
4389
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
|
|
4386
4390
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
4387
4391
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName }),
|
|
4388
|
-
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4392
|
+
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.CdnIcon, { src: targetChainIcon }) })
|
|
4389
4393
|
] })
|
|
4390
4394
|
] }),
|
|
4391
4395
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -4400,14 +4404,14 @@ function SolanaConfirmStep({
|
|
|
4400
4404
|
" ",
|
|
4401
4405
|
token.symbol
|
|
4402
4406
|
] }),
|
|
4403
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4407
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.TokenIcon, { symbol: token.symbol }) })
|
|
4404
4408
|
] })
|
|
4405
4409
|
] }),
|
|
4406
4410
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
4407
4411
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Receive" }),
|
|
4408
4412
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
4409
4413
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: receiveDisplay }),
|
|
4410
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4414
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.TokenIcon, { symbol: targetSymbol }) })
|
|
4411
4415
|
] })
|
|
4412
4416
|
] }),
|
|
4413
4417
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -4420,13 +4424,13 @@ function SolanaConfirmStep({
|
|
|
4420
4424
|
children: "$0.04"
|
|
4421
4425
|
}
|
|
4422
4426
|
),
|
|
4423
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4427
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFKHPVLJYcjs.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, _chunk65MLWUQDcjs.InfoIcon, {}) }) })
|
|
4424
4428
|
] })
|
|
4425
4429
|
] })
|
|
4426
4430
|
] }),
|
|
4427
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4431
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.Callout, { variant: "error", children: error }),
|
|
4428
4432
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4429
|
-
|
|
4433
|
+
_chunk65MLWUQDcjs.Button,
|
|
4430
4434
|
{
|
|
4431
4435
|
onClick: handleConfirm,
|
|
4432
4436
|
loading: isSubmitting,
|
|
@@ -4437,7 +4441,7 @@ function SolanaConfirmStep({
|
|
|
4437
4441
|
}
|
|
4438
4442
|
)
|
|
4439
4443
|
] }),
|
|
4440
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4444
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.PoweredBy, {})
|
|
4441
4445
|
] });
|
|
4442
4446
|
}
|
|
4443
4447
|
|
|
@@ -4452,22 +4456,22 @@ function DappImportAssetSelectStep({
|
|
|
4452
4456
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
4453
4457
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4454
4458
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4455
|
-
|
|
4459
|
+
_chunk65MLWUQDcjs.BodyHeader,
|
|
4456
4460
|
{
|
|
4457
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4461
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.WalletIcon, {}),
|
|
4458
4462
|
title: `Transfer from ${sourceLabel}`,
|
|
4459
4463
|
subtitle: "Pick the balance to import"
|
|
4460
4464
|
}
|
|
4461
4465
|
),
|
|
4462
4466
|
incompleteSummary && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-notice", role: "status", children: incompleteSummary }),
|
|
4463
4467
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: assets.map((asset) => {
|
|
4464
|
-
const tokenAmount = asset.balance ?
|
|
4468
|
+
const tokenAmount = asset.balance ? _chunk65MLWUQDcjs.tokenFormatter.format(
|
|
4465
4469
|
Number(asset.balance) / 10 ** asset.decimals
|
|
4466
4470
|
) : "0";
|
|
4467
|
-
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ?
|
|
4471
|
+
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ? _chunk65MLWUQDcjs.currencyFormatter.format(asset.balanceUsd) : `${tokenAmount} ${asset.symbol}`;
|
|
4468
4472
|
const assetIcon = asset.icon;
|
|
4469
|
-
const chainIcon =
|
|
4470
|
-
const badge =
|
|
4473
|
+
const chainIcon = _chunkO7BCVQ6Lcjs.getChainIcon.call(void 0, asset.chainId);
|
|
4474
|
+
const badge = _chunkO7BCVQ6Lcjs.getChainBadge.call(void 0, asset.chainId);
|
|
4471
4475
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4472
4476
|
"button",
|
|
4473
4477
|
{
|
|
@@ -4477,14 +4481,14 @@ function DappImportAssetSelectStep({
|
|
|
4477
4481
|
children: [
|
|
4478
4482
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
|
|
4479
4483
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-icon-wrapper", children: [
|
|
4480
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: assetIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4481
|
-
|
|
4484
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: assetIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.CdnIcon, { src: assetIcon, alt: asset.symbol }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4485
|
+
_chunk65MLWUQDcjs.TokenIcon,
|
|
4482
4486
|
{
|
|
4483
4487
|
symbol: asset.symbol,
|
|
4484
4488
|
fallback: asset.symbol.slice(0, 4)
|
|
4485
4489
|
}
|
|
4486
4490
|
) }),
|
|
4487
|
-
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4491
|
+
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.CdnIcon, { src: chainIcon, alt: _chunkO7BCVQ6Lcjs.getChainName.call(void 0, asset.chainId) }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4488
4492
|
"span",
|
|
4489
4493
|
{
|
|
4490
4494
|
className: "rs-asset-chain-badge",
|
|
@@ -4516,7 +4520,7 @@ function DappImportAssetSelectStep({
|
|
|
4516
4520
|
);
|
|
4517
4521
|
}) })
|
|
4518
4522
|
] }),
|
|
4519
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4523
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.PoweredBy, {})
|
|
4520
4524
|
] });
|
|
4521
4525
|
}
|
|
4522
4526
|
DappImportAssetSelectStep.displayName = "DappImportAssetSelectStep";
|
|
@@ -4538,7 +4542,7 @@ function describeRow(status, comingSoon) {
|
|
|
4538
4542
|
}
|
|
4539
4543
|
if (status.enabled) {
|
|
4540
4544
|
return {
|
|
4541
|
-
subtitle: status.balanceUsd > 0 ?
|
|
4545
|
+
subtitle: status.balanceUsd > 0 ? _chunk65MLWUQDcjs.currencyFormatter.format(status.balanceUsd) : "No balance",
|
|
4542
4546
|
disabled: false,
|
|
4543
4547
|
busy: false
|
|
4544
4548
|
};
|
|
@@ -4561,9 +4565,9 @@ function DappImportSelectStep({
|
|
|
4561
4565
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
4562
4566
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4563
4567
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4564
|
-
|
|
4568
|
+
_chunk65MLWUQDcjs.BodyHeader,
|
|
4565
4569
|
{
|
|
4566
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4570
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.MigrateAssetsIcon, {}),
|
|
4567
4571
|
title: "Migrate assets",
|
|
4568
4572
|
subtitle: "Select a position to migrate"
|
|
4569
4573
|
}
|
|
@@ -4575,13 +4579,13 @@ function DappImportSelectStep({
|
|
|
4575
4579
|
Boolean(brand.comingSoon)
|
|
4576
4580
|
);
|
|
4577
4581
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4578
|
-
|
|
4582
|
+
_chunkTYBMAUGHcjs.ListRow,
|
|
4579
4583
|
{
|
|
4580
4584
|
leadingMedia: brand.iconUrl,
|
|
4581
4585
|
title: brand.label,
|
|
4582
4586
|
subtitle,
|
|
4583
4587
|
disabled,
|
|
4584
|
-
trailing: busy ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4588
|
+
trailing: busy ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.Spinner, { className: "rs-spinner--sm" }) : void 0,
|
|
4585
4589
|
onClick: () => {
|
|
4586
4590
|
if (status === "needs-connect") {
|
|
4587
4591
|
_optionalChain([onRequestConnect, 'optionalCall', _151 => _151()]);
|
|
@@ -4594,7 +4598,7 @@ function DappImportSelectStep({
|
|
|
4594
4598
|
);
|
|
4595
4599
|
}) })
|
|
4596
4600
|
] }),
|
|
4597
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4601
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.PoweredBy, {})
|
|
4598
4602
|
] });
|
|
4599
4603
|
}
|
|
4600
4604
|
DappImportSelectStep.displayName = "DappImportSelectStep";
|
|
@@ -4611,9 +4615,9 @@ function DappImportAssetSelectSkeleton({
|
|
|
4611
4615
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: error ? "Couldn't load balances" : "Loading balances\u2026" }),
|
|
4612
4616
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4613
4617
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4614
|
-
|
|
4618
|
+
_chunk65MLWUQDcjs.BodyHeader,
|
|
4615
4619
|
{
|
|
4616
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4620
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.WalletIcon, {}),
|
|
4617
4621
|
title: `Transfer from ${sourceLabel}`,
|
|
4618
4622
|
subtitle: "Pick the balance to import"
|
|
4619
4623
|
}
|
|
@@ -4651,7 +4655,7 @@ function DappImportAssetSelectSkeleton({
|
|
|
4651
4655
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Try again" })
|
|
4652
4656
|
}
|
|
4653
4657
|
) }),
|
|
4654
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4658
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.PoweredBy, {})
|
|
4655
4659
|
] });
|
|
4656
4660
|
}
|
|
4657
4661
|
DappImportAssetSelectSkeleton.displayName = "DappImportAssetSelectSkeleton";
|
|
@@ -4827,9 +4831,9 @@ var aaveProvider = {
|
|
|
4827
4831
|
function toImportableAssets(positions) {
|
|
4828
4832
|
const assets = [];
|
|
4829
4833
|
for (const position of positions) {
|
|
4830
|
-
const chainId =
|
|
4834
|
+
const chainId = _chunkO7BCVQ6Lcjs.parseEvmChainId.call(void 0, position.chain);
|
|
4831
4835
|
if (chainId === null) continue;
|
|
4832
|
-
if (!
|
|
4836
|
+
if (!_chunkO7BCVQ6Lcjs.CHAIN_BY_ID[chainId]) continue;
|
|
4833
4837
|
if (BigInt(position.maxWithdrawable) <= 0n) continue;
|
|
4834
4838
|
if (position.constraints.some((c) => POLICY_REFUSED.includes(c))) continue;
|
|
4835
4839
|
assets.push(buildAsset(position, chainId));
|
|
@@ -4946,7 +4950,7 @@ async function detectPolymarketWalletKind(params) {
|
|
|
4946
4950
|
contracts: [
|
|
4947
4951
|
{
|
|
4948
4952
|
address: proxyWallet,
|
|
4949
|
-
abi:
|
|
4953
|
+
abi: _chunk75DVGSAXcjs.SAFE_ABI,
|
|
4950
4954
|
functionName: "isOwner",
|
|
4951
4955
|
args: [eoa]
|
|
4952
4956
|
},
|
|
@@ -4979,7 +4983,7 @@ async function buildSignedDepositWalletBatch(params) {
|
|
|
4979
4983
|
if (!account || !chain) {
|
|
4980
4984
|
throw new Error("Wallet not connected");
|
|
4981
4985
|
}
|
|
4982
|
-
if (chain.id !==
|
|
4986
|
+
if (chain.id !== _chunk75DVGSAXcjs.POLYMARKET_POLYGON_CHAIN_ID) {
|
|
4983
4987
|
throw new Error("Switch to Polygon to sign");
|
|
4984
4988
|
}
|
|
4985
4989
|
const owner = await publicClient.readContract({
|
|
@@ -5024,14 +5028,14 @@ async function buildSignedDepositWalletBatch(params) {
|
|
|
5024
5028
|
})),
|
|
5025
5029
|
signature
|
|
5026
5030
|
},
|
|
5027
|
-
sourceToken:
|
|
5031
|
+
sourceToken: _chunk75DVGSAXcjs.POLYMARKET_USDCE_ADDRESS,
|
|
5028
5032
|
sourceSymbol: tokenKind === "pusd" ? "pUSD" : "USDC.e"
|
|
5029
5033
|
};
|
|
5030
5034
|
}
|
|
5031
5035
|
function buildUsdceTransferCalls(recipient, amount) {
|
|
5032
5036
|
return [
|
|
5033
5037
|
{
|
|
5034
|
-
target:
|
|
5038
|
+
target: _chunk75DVGSAXcjs.POLYMARKET_USDCE_ADDRESS,
|
|
5035
5039
|
value: 0n,
|
|
5036
5040
|
data: _viem.encodeFunctionData.call(void 0, {
|
|
5037
5041
|
abi: _viem.erc20Abi,
|
|
@@ -5044,21 +5048,21 @@ function buildUsdceTransferCalls(recipient, amount) {
|
|
|
5044
5048
|
function buildPusdUnwrapCalls(recipient, amount) {
|
|
5045
5049
|
return [
|
|
5046
5050
|
{
|
|
5047
|
-
target:
|
|
5051
|
+
target: _chunk75DVGSAXcjs.POLYMARKET_PUSD_ADDRESS,
|
|
5048
5052
|
value: 0n,
|
|
5049
5053
|
data: _viem.encodeFunctionData.call(void 0, {
|
|
5050
5054
|
abi: _viem.erc20Abi,
|
|
5051
5055
|
functionName: "approve",
|
|
5052
|
-
args: [
|
|
5056
|
+
args: [_chunk75DVGSAXcjs.POLYMARKET_COLLATERAL_OFFRAMP_ADDRESS, amount]
|
|
5053
5057
|
})
|
|
5054
5058
|
},
|
|
5055
5059
|
{
|
|
5056
|
-
target:
|
|
5060
|
+
target: _chunk75DVGSAXcjs.POLYMARKET_COLLATERAL_OFFRAMP_ADDRESS,
|
|
5057
5061
|
value: 0n,
|
|
5058
5062
|
data: _viem.encodeFunctionData.call(void 0, {
|
|
5059
5063
|
abi: COLLATERAL_OFFRAMP_ABI,
|
|
5060
5064
|
functionName: "unwrap",
|
|
5061
|
-
args: [
|
|
5065
|
+
args: [_chunk75DVGSAXcjs.POLYMARKET_USDCE_ADDRESS, recipient, amount]
|
|
5062
5066
|
})
|
|
5063
5067
|
}
|
|
5064
5068
|
];
|
|
@@ -5070,12 +5074,12 @@ var polymarketProvider = {
|
|
|
5070
5074
|
id: PROVIDER_ID2,
|
|
5071
5075
|
sourceLabel: "Polymarket",
|
|
5072
5076
|
async fetchAvailability({ eoa, getPublicClient: getPublicClient2, signal }) {
|
|
5073
|
-
const proxyWallet = await
|
|
5077
|
+
const proxyWallet = await _chunk75DVGSAXcjs.fetchPolymarketProxyWallet.call(void 0, eoa, signal);
|
|
5074
5078
|
if (!proxyWallet) return null;
|
|
5075
5079
|
if (_optionalChain([signal, 'optionalAccess', _153 => _153.aborted])) return null;
|
|
5076
|
-
const polygonClient = getPublicClient2(
|
|
5080
|
+
const polygonClient = getPublicClient2(_chunk75DVGSAXcjs.POLYMARKET_POLYGON_CHAIN_ID);
|
|
5077
5081
|
if (!polygonClient) return null;
|
|
5078
|
-
const balances = await
|
|
5082
|
+
const balances = await _chunk75DVGSAXcjs.readPolymarketBalances.call(void 0, {
|
|
5079
5083
|
publicClient: polygonClient,
|
|
5080
5084
|
proxyWallet
|
|
5081
5085
|
});
|
|
@@ -5133,7 +5137,7 @@ var polymarketProvider = {
|
|
|
5133
5137
|
const { txHash } = await backend.submitPolymarketWithdraw(payload);
|
|
5134
5138
|
return { txHash, sourceToken, sourceSymbol, sourceDecimals: 6 };
|
|
5135
5139
|
}
|
|
5136
|
-
const result = await
|
|
5140
|
+
const result = await _chunk75DVGSAXcjs.executePolymarketSafeTransfer.call(void 0, {
|
|
5137
5141
|
walletClient,
|
|
5138
5142
|
publicClient,
|
|
5139
5143
|
safeAddress: metadata.proxyWallet,
|
|
@@ -5152,17 +5156,17 @@ var polymarketProvider = {
|
|
|
5152
5156
|
function buildAsset2(params) {
|
|
5153
5157
|
const { tokenKind, proxyWallet, walletKind, balance } = params;
|
|
5154
5158
|
const isPusd = tokenKind === "pusd";
|
|
5155
|
-
const tokenAddress = isPusd ?
|
|
5159
|
+
const tokenAddress = isPusd ? _chunk75DVGSAXcjs.POLYMARKET_PUSD_ADDRESS : _chunk75DVGSAXcjs.POLYMARKET_USDCE_ADDRESS;
|
|
5156
5160
|
const symbol = isPusd ? "pUSD" : "USDC.e";
|
|
5157
5161
|
const balanceUsd = Number(_viem.formatUnits.call(void 0, balance, 6));
|
|
5158
5162
|
const metadata = { proxyWallet, tokenKind, walletKind };
|
|
5159
5163
|
return {
|
|
5160
5164
|
id: `polymarket:${tokenKind}`,
|
|
5161
|
-
chainId:
|
|
5165
|
+
chainId: _chunk75DVGSAXcjs.POLYMARKET_POLYGON_CHAIN_ID,
|
|
5162
5166
|
token: tokenAddress,
|
|
5163
5167
|
symbol,
|
|
5164
5168
|
name: isPusd ? "Polymarket USD" : "Polygon USDC.e",
|
|
5165
|
-
icon: isPusd ?
|
|
5169
|
+
icon: isPusd ? _chunk75DVGSAXcjs.POLYMARKET_ICON_URL : void 0,
|
|
5166
5170
|
decimals: 6,
|
|
5167
5171
|
balance: balance.toString(),
|
|
5168
5172
|
balanceUsd: Number.isFinite(balanceUsd) ? balanceUsd : 0,
|
|
@@ -5175,8 +5179,8 @@ function buildAsset2(params) {
|
|
|
5175
5179
|
// pUSD unwraps to USDC.e via the offramp; USDC.e is what actually
|
|
5176
5180
|
// arrives at the smart account, so it's also what the orchestrator
|
|
5177
5181
|
// bridges from.
|
|
5178
|
-
depositToken:
|
|
5179
|
-
depositChainId:
|
|
5182
|
+
depositToken: _chunk75DVGSAXcjs.POLYMARKET_USDCE_ADDRESS,
|
|
5183
|
+
depositChainId: _chunk75DVGSAXcjs.POLYMARKET_POLYGON_CHAIN_ID,
|
|
5180
5184
|
providerMetadata: metadata
|
|
5181
5185
|
};
|
|
5182
5186
|
}
|
|
@@ -6454,11 +6458,11 @@ function DepositFlow({
|
|
|
6454
6458
|
onError,
|
|
6455
6459
|
debug
|
|
6456
6460
|
}) {
|
|
6457
|
-
const rpcUrls =
|
|
6458
|
-
const onStepChangeRef =
|
|
6459
|
-
const onEventRef =
|
|
6460
|
-
const onLifecycleRef =
|
|
6461
|
-
const onErrorRef =
|
|
6461
|
+
const rpcUrls = _chunk65MLWUQDcjs.useRpcUrls.call(void 0, );
|
|
6462
|
+
const onStepChangeRef = _chunk65MLWUQDcjs.useLatestRef.call(void 0, onStepChange);
|
|
6463
|
+
const onEventRef = _chunk65MLWUQDcjs.useLatestRef.call(void 0, onEvent);
|
|
6464
|
+
const onLifecycleRef = _chunk65MLWUQDcjs.useLatestRef.call(void 0, onLifecycle);
|
|
6465
|
+
const onErrorRef = _chunk65MLWUQDcjs.useLatestRef.call(void 0, onError);
|
|
6462
6466
|
const storeApi = useDepositStoreApi();
|
|
6463
6467
|
const flowSlice = useDepositStore((s) => s.flow);
|
|
6464
6468
|
const depositSlice = useDepositStore((s) => s.deposit);
|
|
@@ -6475,13 +6479,13 @@ function DepositFlow({
|
|
|
6475
6479
|
const stableWalletSelectionKeyRef = _react.useRef.call(void 0, null);
|
|
6476
6480
|
const logFlow = _react.useCallback.call(void 0,
|
|
6477
6481
|
(message, data) => {
|
|
6478
|
-
|
|
6482
|
+
_chunk65MLWUQDcjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
|
|
6479
6483
|
},
|
|
6480
6484
|
[debug]
|
|
6481
6485
|
);
|
|
6482
6486
|
const logFlowError = _react.useCallback.call(void 0,
|
|
6483
6487
|
(message, error, data) => {
|
|
6484
|
-
|
|
6488
|
+
_chunk65MLWUQDcjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
|
|
6485
6489
|
},
|
|
6486
6490
|
[debug]
|
|
6487
6491
|
);
|
|
@@ -6603,10 +6607,10 @@ function DepositFlow({
|
|
|
6603
6607
|
isConnectSelectionConfirmed,
|
|
6604
6608
|
selectedWalletId
|
|
6605
6609
|
]);
|
|
6606
|
-
const setupChainId = typeof targetChain === "number" && !
|
|
6607
|
-
const targetChainId =
|
|
6608
|
-
const targetSymbol =
|
|
6609
|
-
const isTargetStablecoin =
|
|
6610
|
+
const setupChainId = typeof targetChain === "number" && !_chunkO7BCVQ6Lcjs.isVirtualDestination.call(void 0, targetChain) ? targetChain : typeof defaultSourceChain === "number" ? defaultSourceChain : _chains.base.id;
|
|
6611
|
+
const targetChainId = _chunkO7BCVQ6Lcjs.targetChainToChainId.call(void 0, targetChain);
|
|
6612
|
+
const targetSymbol = _chunkO7BCVQ6Lcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
6613
|
+
const isTargetStablecoin = _chunkO7BCVQ6Lcjs.isStablecoinSymbol.call(void 0, targetSymbol);
|
|
6610
6614
|
const targetMarketPriceRef = _react.useRef.call(void 0, null);
|
|
6611
6615
|
_react.useEffect.call(void 0, () => {
|
|
6612
6616
|
targetMarketPriceRef.current = null;
|
|
@@ -6614,7 +6618,7 @@ function DepositFlow({
|
|
|
6614
6618
|
return;
|
|
6615
6619
|
}
|
|
6616
6620
|
let cancelled = false;
|
|
6617
|
-
|
|
6621
|
+
_chunkFKHPVLJYcjs.fetchTokenPriceUsd.call(void 0, service, {
|
|
6618
6622
|
chainId: targetChainId,
|
|
6619
6623
|
address: targetToken,
|
|
6620
6624
|
symbol: targetSymbol
|
|
@@ -6635,7 +6639,7 @@ function DepositFlow({
|
|
|
6635
6639
|
return {
|
|
6636
6640
|
ownerAddress: walletClientProp.account.address,
|
|
6637
6641
|
walletClient: walletClientProp,
|
|
6638
|
-
publicClient: _nullishCoalesce(publicClientProp, () => (
|
|
6642
|
+
publicClient: _nullishCoalesce(publicClientProp, () => ( _chunk65MLWUQDcjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
|
|
6639
6643
|
switchChain: dappSwitchChain
|
|
6640
6644
|
};
|
|
6641
6645
|
}
|
|
@@ -6652,7 +6656,7 @@ function DepositFlow({
|
|
|
6652
6656
|
return {
|
|
6653
6657
|
ownerAddress: walletClientProp.account.address,
|
|
6654
6658
|
walletClient: walletClientProp,
|
|
6655
|
-
publicClient: _nullishCoalesce(publicClientProp, () => (
|
|
6659
|
+
publicClient: _nullishCoalesce(publicClientProp, () => ( _chunk65MLWUQDcjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
|
|
6656
6660
|
switchChain: dappSwitchChain
|
|
6657
6661
|
};
|
|
6658
6662
|
}
|
|
@@ -6660,7 +6664,7 @@ function DepositFlow({
|
|
|
6660
6664
|
return {
|
|
6661
6665
|
ownerAddress: reownWallet.address,
|
|
6662
6666
|
walletClient: reownWallet.walletClient,
|
|
6663
|
-
publicClient: _nullishCoalesce(reownWallet.publicClient, () => (
|
|
6667
|
+
publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunk65MLWUQDcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
|
|
6664
6668
|
switchChain: reownWallet.switchChain
|
|
6665
6669
|
};
|
|
6666
6670
|
}
|
|
@@ -6888,8 +6892,8 @@ function DepositFlow({
|
|
|
6888
6892
|
pred_balance: totalBalanceUsd
|
|
6889
6893
|
})]);
|
|
6890
6894
|
} else if (effectiveStep.type === "deposit-address") {
|
|
6891
|
-
const chainName =
|
|
6892
|
-
const tokenSymbol =
|
|
6895
|
+
const chainName = _chunkO7BCVQ6Lcjs.getChainName.call(void 0, targetChainId);
|
|
6896
|
+
const tokenSymbol = _chunkO7BCVQ6Lcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
6893
6897
|
_optionalChain([onEventRef, 'access', _205 => _205.current, 'optionalCall', _206 => _206({
|
|
6894
6898
|
type: "deposit_modal_transfer_crypto_open",
|
|
6895
6899
|
default_chain: chainName,
|
|
@@ -6897,7 +6901,7 @@ function DepositFlow({
|
|
|
6897
6901
|
pred_balance: totalBalanceUsd
|
|
6898
6902
|
})]);
|
|
6899
6903
|
} else if (effectiveStep.type === "amount" && stepSendToken) {
|
|
6900
|
-
const receiveSymbol =
|
|
6904
|
+
const receiveSymbol = _chunkO7BCVQ6Lcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
6901
6905
|
_optionalChain([onEventRef, 'access', _207 => _207.current, 'optionalCall', _208 => _208({
|
|
6902
6906
|
type: "deposit_modal_connected_wallet_enter_value_open",
|
|
6903
6907
|
send_token: stepSendToken,
|
|
@@ -7015,7 +7019,7 @@ function DepositFlow({
|
|
|
7015
7019
|
eoa: dappImportOwner,
|
|
7016
7020
|
getPublicClient: (chainId) => {
|
|
7017
7021
|
try {
|
|
7018
|
-
return
|
|
7022
|
+
return _chunk65MLWUQDcjs.getPublicClient.call(void 0, chainId, rpcUrls);
|
|
7019
7023
|
} catch (e33) {
|
|
7020
7024
|
return null;
|
|
7021
7025
|
}
|
|
@@ -7240,7 +7244,7 @@ function DepositFlow({
|
|
|
7240
7244
|
acceptedExchangeFeeBps: disclosedFeeBps
|
|
7241
7245
|
});
|
|
7242
7246
|
} catch (error) {
|
|
7243
|
-
if (error instanceof
|
|
7247
|
+
if (error instanceof _chunk65MLWUQDcjs.SwappedConnectFeeChangedError) {
|
|
7244
7248
|
return error.exchangeFeeBps;
|
|
7245
7249
|
}
|
|
7246
7250
|
throw error;
|
|
@@ -7491,17 +7495,17 @@ function DepositFlow({
|
|
|
7491
7495
|
forceRegister
|
|
7492
7496
|
]
|
|
7493
7497
|
);
|
|
7494
|
-
const desiredSetupRequestKey =
|
|
7498
|
+
const desiredSetupRequestKey = _chunkFKHPVLJYcjs.computeRequestKey.call(void 0, setupInput);
|
|
7495
7499
|
const setupReady = setupSlice.status === "ready" && setupSlice.requestKey === desiredSetupRequestKey;
|
|
7496
7500
|
_react.useEffect.call(void 0, () => {
|
|
7497
7501
|
void (async () => {
|
|
7498
|
-
const requestKey =
|
|
7499
|
-
const cacheKey =
|
|
7500
|
-
const cacheable =
|
|
7502
|
+
const requestKey = _chunkFKHPVLJYcjs.computeRequestKey.call(void 0, setupInput);
|
|
7503
|
+
const cacheKey = _chunkFKHPVLJYcjs.computeCacheKey.call(void 0, setupInput);
|
|
7504
|
+
const cacheable = _chunkFKHPVLJYcjs.computeIsCacheable.call(void 0, setupInput);
|
|
7501
7505
|
if (storeApi.getState().setup.requestKey === requestKey) {
|
|
7502
7506
|
return;
|
|
7503
7507
|
}
|
|
7504
|
-
const dedupedResult =
|
|
7508
|
+
const dedupedResult = _chunkFKHPVLJYcjs.readDedupedAccountSetupResult.call(void 0, requestKey);
|
|
7505
7509
|
if (dedupedResult) {
|
|
7506
7510
|
storeApi.dispatch({
|
|
7507
7511
|
type: "setup/started",
|
|
@@ -7527,7 +7531,7 @@ function DepositFlow({
|
|
|
7527
7531
|
cacheable
|
|
7528
7532
|
});
|
|
7529
7533
|
try {
|
|
7530
|
-
const result = await
|
|
7534
|
+
const result = await _chunkFKHPVLJYcjs.runAccountSetupDeduped.call(void 0,
|
|
7531
7535
|
setupInput,
|
|
7532
7536
|
{ service, debug },
|
|
7533
7537
|
requestKey
|
|
@@ -7542,7 +7546,7 @@ function DepositFlow({
|
|
|
7542
7546
|
}
|
|
7543
7547
|
});
|
|
7544
7548
|
} catch (error) {
|
|
7545
|
-
const message = error instanceof
|
|
7549
|
+
const message = error instanceof _chunkFKHPVLJYcjs.SetupError ? error.message : "Deposit service is temporarily unavailable. Please try again shortly.";
|
|
7546
7550
|
storeApi.dispatch({
|
|
7547
7551
|
type: "setup/failed",
|
|
7548
7552
|
requestKey,
|
|
@@ -7591,7 +7595,7 @@ function DepositFlow({
|
|
|
7591
7595
|
address,
|
|
7592
7596
|
requestId,
|
|
7593
7597
|
totalUsd: portfolio.totalUsd,
|
|
7594
|
-
chainIds:
|
|
7598
|
+
chainIds: _chunk65MLWUQDcjs.chainIdsByValue.call(void 0, portfolio.tokens)
|
|
7595
7599
|
});
|
|
7596
7600
|
} catch (e34) {
|
|
7597
7601
|
storeApi.dispatch({
|
|
@@ -7630,8 +7634,8 @@ function DepositFlow({
|
|
|
7630
7634
|
);
|
|
7631
7635
|
const handleSolanaAmountContinue = _react.useCallback.call(void 0,
|
|
7632
7636
|
(token, sourceAmount, inputAmountUsd) => {
|
|
7633
|
-
const targetSym =
|
|
7634
|
-
const isTargetStable =
|
|
7637
|
+
const targetSym = _chunkO7BCVQ6Lcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
7638
|
+
const isTargetStable = _chunkO7BCVQ6Lcjs.isStablecoinSymbol.call(void 0, targetSym);
|
|
7635
7639
|
const targetTokenPriceUsd = isTargetStable ? 1 : targetMarketPriceRef.current;
|
|
7636
7640
|
logFlow("solana:amount:continue", {
|
|
7637
7641
|
token: token.symbol,
|
|
@@ -7708,8 +7712,8 @@ function DepositFlow({
|
|
|
7708
7712
|
(amount, targetAmount, balance) => {
|
|
7709
7713
|
const entry = storeApi.getState().setup;
|
|
7710
7714
|
if (entry.status !== "ready") return;
|
|
7711
|
-
const targetSym =
|
|
7712
|
-
const isTargetStable =
|
|
7715
|
+
const targetSym = _chunkO7BCVQ6Lcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
7716
|
+
const isTargetStable = _chunkO7BCVQ6Lcjs.isStablecoinSymbol.call(void 0, targetSym);
|
|
7713
7717
|
const targetTokenPriceUsd = isTargetStable ? 1 : targetMarketPriceRef.current;
|
|
7714
7718
|
storeApi.dispatch({
|
|
7715
7719
|
type: "amount/entered",
|
|
@@ -7984,8 +7988,8 @@ function DepositFlow({
|
|
|
7984
7988
|
onDepositComplete: handleDepositComplete,
|
|
7985
7989
|
onDepositFailed: handleDepositFailed,
|
|
7986
7990
|
onCopyAddress: () => {
|
|
7987
|
-
const chainName =
|
|
7988
|
-
const tokenSymbol =
|
|
7991
|
+
const chainName = _chunkO7BCVQ6Lcjs.getChainName.call(void 0, targetChainId);
|
|
7992
|
+
const tokenSymbol = _chunkO7BCVQ6Lcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
7989
7993
|
_optionalChain([onEvent, 'optionalCall', _256 => _256({
|
|
7990
7994
|
type: "deposit_modal_transfer_crypto_cta_click",
|
|
7991
7995
|
default_chain: chainName,
|
|
@@ -8033,7 +8037,7 @@ function DepositFlow({
|
|
|
8033
8037
|
}
|
|
8034
8038
|
),
|
|
8035
8039
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8036
|
-
|
|
8040
|
+
_chunkFKHPVLJYcjs.ProcessingStep,
|
|
8037
8041
|
{
|
|
8038
8042
|
smartAccount: step.smartAccount,
|
|
8039
8043
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
@@ -8105,7 +8109,7 @@ function DepositFlow({
|
|
|
8105
8109
|
}
|
|
8106
8110
|
),
|
|
8107
8111
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8108
|
-
|
|
8112
|
+
_chunkFKHPVLJYcjs.ProcessingStep,
|
|
8109
8113
|
{
|
|
8110
8114
|
smartAccount: step.smartAccount,
|
|
8111
8115
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
@@ -8171,8 +8175,8 @@ function DepositFlow({
|
|
|
8171
8175
|
defaultAmount: effectiveStep.inputAmountUsd,
|
|
8172
8176
|
uiConfig,
|
|
8173
8177
|
targetChain,
|
|
8174
|
-
targetChainName:
|
|
8175
|
-
targetTokenSymbol:
|
|
8178
|
+
targetChainName: _chunkO7BCVQ6Lcjs.getChainName.call(void 0, targetChainId),
|
|
8179
|
+
targetTokenSymbol: _chunkO7BCVQ6Lcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId),
|
|
8176
8180
|
appBalanceUsd,
|
|
8177
8181
|
onContinue: handleSolanaAmountContinue,
|
|
8178
8182
|
debug
|
|
@@ -8234,7 +8238,7 @@ function DepositFlow({
|
|
|
8234
8238
|
) })
|
|
8235
8239
|
] }) : null,
|
|
8236
8240
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8237
|
-
|
|
8241
|
+
_chunkFKHPVLJYcjs.ProcessingStep,
|
|
8238
8242
|
{
|
|
8239
8243
|
smartAccount: effectiveStep.smartAccount,
|
|
8240
8244
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
@@ -8321,7 +8325,7 @@ function DepositFlow({
|
|
|
8321
8325
|
if (_optionalChain([signerContext, 'access', _271 => _271.publicClient, 'access', _272 => _272.chain, 'optionalAccess', _273 => _273.id]) === chainId) {
|
|
8322
8326
|
return signerContext.publicClient;
|
|
8323
8327
|
}
|
|
8324
|
-
return
|
|
8328
|
+
return _chunk65MLWUQDcjs.getPublicClient.call(void 0, chainId, rpcUrls);
|
|
8325
8329
|
};
|
|
8326
8330
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
8327
8331
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -8373,7 +8377,7 @@ function DepositFlow({
|
|
|
8373
8377
|
service,
|
|
8374
8378
|
onContinue: handleAmountContinue,
|
|
8375
8379
|
onCtaClick: (ctaName) => {
|
|
8376
|
-
const receiveSymbol =
|
|
8380
|
+
const receiveSymbol = _chunkO7BCVQ6Lcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
8377
8381
|
_optionalChain([onEvent, 'optionalCall', _279 => _279({
|
|
8378
8382
|
type: "deposit_modal_connected_wallet_enter_value_cta_click",
|
|
8379
8383
|
send_token: effectiveStep.asset.symbol,
|
|
@@ -8432,7 +8436,7 @@ function DepositFlow({
|
|
|
8432
8436
|
}
|
|
8433
8437
|
),
|
|
8434
8438
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8435
|
-
|
|
8439
|
+
_chunkFKHPVLJYcjs.ProcessingStep,
|
|
8436
8440
|
{
|
|
8437
8441
|
smartAccount: effectiveStep.smartAccount,
|
|
8438
8442
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
@@ -8485,9 +8489,9 @@ function formatDate(iso) {
|
|
|
8485
8489
|
function resolveChainId(value) {
|
|
8486
8490
|
if (value === void 0 || value === null) return null;
|
|
8487
8491
|
if (typeof value === "number") return value;
|
|
8488
|
-
if (
|
|
8489
|
-
if (
|
|
8490
|
-
const parsed =
|
|
8492
|
+
if (_chunkO7BCVQ6Lcjs.isSolanaCaip2.call(void 0, value) || value === "solana") return "solana";
|
|
8493
|
+
if (_chunkO7BCVQ6Lcjs.isHyperCoreCaip2.call(void 0, value) || value === "hypercore") return "hypercore";
|
|
8494
|
+
const parsed = _chunkO7BCVQ6Lcjs.parseEvmChainId.call(void 0, value);
|
|
8491
8495
|
if (parsed !== null) return parsed;
|
|
8492
8496
|
const num = Number(value);
|
|
8493
8497
|
return Number.isFinite(num) ? num : null;
|
|
@@ -8496,7 +8500,7 @@ function resolveTokenSymbol(token, chainId) {
|
|
|
8496
8500
|
if (!token) return "";
|
|
8497
8501
|
if (chainId === "solana") {
|
|
8498
8502
|
const normalized = token.toLowerCase();
|
|
8499
|
-
const matched =
|
|
8503
|
+
const matched = _chunkO7BCVQ6Lcjs.SOLANA_TOKENS.find(
|
|
8500
8504
|
(entry) => entry.mint.toLowerCase() === normalized
|
|
8501
8505
|
);
|
|
8502
8506
|
if (matched) return matched.symbol;
|
|
@@ -8505,8 +8509,8 @@ function resolveTokenSymbol(token, chainId) {
|
|
|
8505
8509
|
}
|
|
8506
8510
|
}
|
|
8507
8511
|
if (chainId !== null && chainId !== void 0 && chainId !== "solana" && /^0x[a-fA-F0-9]{40}$/.test(token)) {
|
|
8508
|
-
const evmChainId = chainId === "hypercore" ?
|
|
8509
|
-
const sym =
|
|
8512
|
+
const evmChainId = chainId === "hypercore" ? _chunkO7BCVQ6Lcjs.HYPERCORE_CHAIN_ID : chainId;
|
|
8513
|
+
const sym = _chunkO7BCVQ6Lcjs.getTokenSymbol.call(void 0, token, evmChainId);
|
|
8510
8514
|
if (sym !== "Token") return sym;
|
|
8511
8515
|
}
|
|
8512
8516
|
return shortenHash(token);
|
|
@@ -8517,7 +8521,7 @@ function formatAmount(rawAmount, token, chainId) {
|
|
|
8517
8521
|
if (token && chainId !== null && chainId !== void 0) {
|
|
8518
8522
|
if (chainId === "solana") {
|
|
8519
8523
|
const normalized = token.toLowerCase();
|
|
8520
|
-
const matched =
|
|
8524
|
+
const matched = _chunkO7BCVQ6Lcjs.SOLANA_TOKENS.find(
|
|
8521
8525
|
(entry) => entry.mint.toLowerCase() === normalized
|
|
8522
8526
|
);
|
|
8523
8527
|
if (matched) {
|
|
@@ -8526,8 +8530,8 @@ function formatAmount(rawAmount, token, chainId) {
|
|
|
8526
8530
|
decimals = 9;
|
|
8527
8531
|
}
|
|
8528
8532
|
} else if (/^0x[a-fA-F0-9]{40}$/.test(token)) {
|
|
8529
|
-
const evmChainId = chainId === "hypercore" ?
|
|
8530
|
-
decimals =
|
|
8533
|
+
const evmChainId = chainId === "hypercore" ? _chunkO7BCVQ6Lcjs.HYPERCORE_CHAIN_ID : chainId;
|
|
8534
|
+
decimals = _chunkO7BCVQ6Lcjs.getTokenDecimalsByAddress.call(void 0, token, evmChainId);
|
|
8531
8535
|
}
|
|
8532
8536
|
}
|
|
8533
8537
|
try {
|
|
@@ -8545,7 +8549,7 @@ function formatAmount(rawAmount, token, chainId) {
|
|
|
8545
8549
|
}
|
|
8546
8550
|
function getTxExplorerUrl(txHash, chainId) {
|
|
8547
8551
|
if (!chainId) return null;
|
|
8548
|
-
const base2 =
|
|
8552
|
+
const base2 = _chunkO7BCVQ6Lcjs.getExplorerUrl.call(void 0, chainId);
|
|
8549
8553
|
if (!base2) return null;
|
|
8550
8554
|
return `${base2}/tx/${txHash}`;
|
|
8551
8555
|
}
|
|
@@ -8610,7 +8614,7 @@ function DepositHistoryPanel({
|
|
|
8610
8614
|
className: "rs-modal-header-back",
|
|
8611
8615
|
"aria-label": "Back",
|
|
8612
8616
|
onClick: onClose,
|
|
8613
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8617
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.ChevronLeftIcon, {})
|
|
8614
8618
|
}
|
|
8615
8619
|
) }),
|
|
8616
8620
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: onCloseModal && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -8620,29 +8624,29 @@ function DepositHistoryPanel({
|
|
|
8620
8624
|
className: "rs-modal-close",
|
|
8621
8625
|
"aria-label": "Close",
|
|
8622
8626
|
onClick: onCloseModal,
|
|
8623
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8627
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.CloseIcon, {})
|
|
8624
8628
|
}
|
|
8625
8629
|
) })
|
|
8626
8630
|
] }),
|
|
8627
8631
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen", children: [
|
|
8628
8632
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen-body", children: [
|
|
8629
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8633
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.HistoryIcon, {}), title: "History" }),
|
|
8630
8634
|
isLoading && deposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
8631
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8635
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.HistoryIcon, {}) }),
|
|
8632
8636
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
8633
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8637
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.Spinner, { className: "rs-spinner--sm" }),
|
|
8634
8638
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Loading history\u2026" })
|
|
8635
8639
|
] })
|
|
8636
8640
|
] }),
|
|
8637
8641
|
error && !isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
8638
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8642
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.AlertTriangleIcon, {}) }),
|
|
8639
8643
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
8640
8644
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "Couldn't load history" }),
|
|
8641
8645
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: error })
|
|
8642
8646
|
] })
|
|
8643
8647
|
] }),
|
|
8644
8648
|
!isLoading && !error && visibleDeposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
8645
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8649
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.HistoryIcon, {}) }),
|
|
8646
8650
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
8647
8651
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "No deposits yet" }),
|
|
8648
8652
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Your deposit history will appear here" })
|
|
@@ -8662,7 +8666,7 @@ function DepositHistoryPanel({
|
|
|
8662
8666
|
)
|
|
8663
8667
|
] })
|
|
8664
8668
|
] }),
|
|
8665
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8669
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.PoweredBy, {})
|
|
8666
8670
|
] })
|
|
8667
8671
|
]
|
|
8668
8672
|
}
|
|
@@ -8673,10 +8677,10 @@ function HistoryCard({ deposit }) {
|
|
|
8673
8677
|
const status = normalizeStatus(deposit.status, deposit.isSpam);
|
|
8674
8678
|
const sourceChainId = resolveChainId(deposit.chain);
|
|
8675
8679
|
const targetChainId = resolveChainId(deposit.targetChain);
|
|
8676
|
-
const sourceChainName = sourceChainId ?
|
|
8677
|
-
const targetChainName = targetChainId ?
|
|
8678
|
-
const sourceChainIcon = sourceChainId ?
|
|
8679
|
-
const targetChainIcon = targetChainId ?
|
|
8680
|
+
const sourceChainName = sourceChainId ? _chunkO7BCVQ6Lcjs.getChainName.call(void 0, sourceChainId) : null;
|
|
8681
|
+
const targetChainName = targetChainId ? _chunkO7BCVQ6Lcjs.getChainName.call(void 0, targetChainId) : null;
|
|
8682
|
+
const sourceChainIcon = sourceChainId ? _chunkO7BCVQ6Lcjs.getChainIcon.call(void 0, sourceChainId) : void 0;
|
|
8683
|
+
const targetChainIcon = targetChainId ? _chunkO7BCVQ6Lcjs.getChainIcon.call(void 0, targetChainId) : void 0;
|
|
8680
8684
|
const sourceSymbol = resolveTokenSymbol(deposit.token, sourceChainId);
|
|
8681
8685
|
const rawAmount = deposit.sourceAmount && deposit.sourceAmount !== "0" ? deposit.sourceAmount : deposit.amount;
|
|
8682
8686
|
const formattedAmount = rawAmount ? formatAmount(rawAmount, deposit.token, sourceChainId) : null;
|
|
@@ -8698,8 +8702,8 @@ function HistoryCard({ deposit }) {
|
|
|
8698
8702
|
children: [
|
|
8699
8703
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-card-row", children: [
|
|
8700
8704
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-card-icons", children: [
|
|
8701
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-token", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8702
|
-
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-chain", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8705
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-token", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.TokenIcon, { symbol: sourceSymbol, fallback: sourceSymbol.slice(0, 2) }) }),
|
|
8706
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-chain", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.CdnIcon, { src: sourceChainIcon }) })
|
|
8703
8707
|
] }),
|
|
8704
8708
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-card-text", children: [
|
|
8705
8709
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-title", children: txTypeLabel }),
|
|
@@ -8715,14 +8719,14 @@ function HistoryCard({ deposit }) {
|
|
|
8715
8719
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
8716
8720
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-detail-value", children: [
|
|
8717
8721
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceChainName }),
|
|
8718
|
-
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8722
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.CdnIcon, { src: sourceChainIcon }) })
|
|
8719
8723
|
] })
|
|
8720
8724
|
] }),
|
|
8721
8725
|
targetChainName && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
8722
8726
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
|
|
8723
8727
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-detail-value", children: [
|
|
8724
8728
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName }),
|
|
8725
|
-
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8729
|
+
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.CdnIcon, { src: targetChainIcon }) })
|
|
8726
8730
|
] })
|
|
8727
8731
|
] }),
|
|
8728
8732
|
srcTxUrl && srcTxHash && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
@@ -8737,7 +8741,7 @@ function HistoryCard({ deposit }) {
|
|
|
8737
8741
|
onClick: (e) => e.stopPropagation(),
|
|
8738
8742
|
children: [
|
|
8739
8743
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: shortenHash(srcTxHash) }),
|
|
8740
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8744
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.ArrowUpRightIcon, {})
|
|
8741
8745
|
]
|
|
8742
8746
|
}
|
|
8743
8747
|
)
|
|
@@ -8752,7 +8756,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
|
8752
8756
|
// src/DepositModal.tsx
|
|
8753
8757
|
|
|
8754
8758
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
8755
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
8759
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-CH6FUTCR.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
8756
8760
|
);
|
|
8757
8761
|
function sortByCreatedAtDesc(items) {
|
|
8758
8762
|
return [...items].sort((a, b) => {
|
|
@@ -8766,8 +8770,8 @@ function hasSuppliedWalletClient(props) {
|
|
|
8766
8770
|
return Object.prototype.hasOwnProperty.call(props, WALLET_CLIENT_PROP);
|
|
8767
8771
|
}
|
|
8768
8772
|
function DepositModal(props) {
|
|
8769
|
-
|
|
8770
|
-
|
|
8773
|
+
_chunkFKHPVLJYcjs.warnRemovedProps.call(void 0, "DepositModal", props);
|
|
8774
|
+
_chunk65MLWUQDcjs.checkBackendUrl.call(void 0, "DepositModal", props.backendUrl);
|
|
8771
8775
|
const needsReown = !!props.reownAppId;
|
|
8772
8776
|
const hasWalletClientProp = hasSuppliedWalletClient(props);
|
|
8773
8777
|
if (needsReown) {
|
|
@@ -8829,14 +8833,13 @@ function DepositModalInner({
|
|
|
8829
8833
|
debug
|
|
8830
8834
|
}) {
|
|
8831
8835
|
const modalRef = _react.useRef.call(void 0, null);
|
|
8832
|
-
const onReadyRef =
|
|
8836
|
+
const onReadyRef = _chunk65MLWUQDcjs.useLatestRef.call(void 0, onReady);
|
|
8833
8837
|
const [currentScreen, setCurrentScreen] = _react.useState.call(void 0, "connect");
|
|
8834
8838
|
const [swappedImmersive, setSwappedImmersive] = _react.useState.call(void 0, false);
|
|
8835
8839
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
8836
8840
|
void 0
|
|
8837
8841
|
);
|
|
8838
|
-
const
|
|
8839
|
-
const historyButtonVisible = showHistoryButton && (currentScreen === "select-asset" || currentScreen === "deposit-address");
|
|
8842
|
+
const historyButtonVisible = currentScreen === "connect";
|
|
8840
8843
|
const [historyOpen, setHistoryOpen] = _react.useState.call(void 0, false);
|
|
8841
8844
|
const [historyDeposits, setHistoryDeposits] = _react.useState.call(void 0, []);
|
|
8842
8845
|
const [hasMoreHistory, setHasMoreHistory] = _react.useState.call(void 0, false);
|
|
@@ -8846,11 +8849,11 @@ function DepositModalInner({
|
|
|
8846
8849
|
const cursorRef = _react.useRef.call(void 0, null);
|
|
8847
8850
|
const historyStaleRef = _react.useRef.call(void 0, false);
|
|
8848
8851
|
const historyLoadedRef = _react.useRef.call(void 0, false);
|
|
8849
|
-
const targetChain = targetChainProp === "solana" || targetChainProp ===
|
|
8850
|
-
const sourceChain = sourceChainProp ?
|
|
8851
|
-
const rpcUrls =
|
|
8852
|
+
const targetChain = targetChainProp === "solana" || targetChainProp === _chunkO7BCVQ6Lcjs.HYPERCORE_SPOT_CAIP2 ? targetChainProp : _chunkO7BCVQ6Lcjs.getChainId.call(void 0, targetChainProp);
|
|
8853
|
+
const sourceChain = sourceChainProp ? _chunkO7BCVQ6Lcjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
8854
|
+
const rpcUrls = _chunk65MLWUQDcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
|
|
8852
8855
|
const service = _react.useMemo.call(void 0,
|
|
8853
|
-
() =>
|
|
8856
|
+
() => _chunk65MLWUQDcjs.createDepositService.call(void 0, backendUrl, {
|
|
8854
8857
|
debug,
|
|
8855
8858
|
debugScope: "service:deposit"
|
|
8856
8859
|
}),
|
|
@@ -8884,12 +8887,12 @@ function DepositModalInner({
|
|
|
8884
8887
|
}, [store, targetChain, targetToken]);
|
|
8885
8888
|
_react.useEffect.call(void 0, () => {
|
|
8886
8889
|
if (isOpen && modalRef.current) {
|
|
8887
|
-
|
|
8890
|
+
_chunk65MLWUQDcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
8888
8891
|
}
|
|
8889
8892
|
}, [isOpen, theme]);
|
|
8890
8893
|
_react.useEffect.call(void 0, () => {
|
|
8891
8894
|
if (isOpen) {
|
|
8892
|
-
_optionalChain([onReadyRef, 'access',
|
|
8895
|
+
_optionalChain([onReadyRef, 'access', _283 => _283.current, 'optionalCall', _284 => _284()]);
|
|
8893
8896
|
}
|
|
8894
8897
|
}, [isOpen, onReadyRef]);
|
|
8895
8898
|
const handleStepChange = _react.useCallback.call(void 0,
|
|
@@ -8965,18 +8968,18 @@ function DepositModalInner({
|
|
|
8965
8968
|
fetchHistory("initial");
|
|
8966
8969
|
}
|
|
8967
8970
|
}, [historyOpen, fetchHistory]);
|
|
8968
|
-
const onLifecycleRef =
|
|
8971
|
+
const onLifecycleRef = _chunk65MLWUQDcjs.useLatestRef.call(void 0, onLifecycle);
|
|
8969
8972
|
const handleLifecycle = _react.useCallback.call(void 0,
|
|
8970
8973
|
(event) => {
|
|
8971
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
8974
|
+
_optionalChain([onLifecycleRef, 'access', _285 => _285.current, 'optionalCall', _286 => _286(event)]);
|
|
8972
8975
|
if (event.type === "smart-account-changed" && !event.evm && !event.solana) {
|
|
8973
8976
|
historyStaleRef.current = true;
|
|
8974
8977
|
}
|
|
8975
|
-
if (
|
|
8978
|
+
if (event.type === "submitted" || event.type === "complete" || event.type === "failed") {
|
|
8976
8979
|
markHistoryStale();
|
|
8977
8980
|
}
|
|
8978
8981
|
},
|
|
8979
|
-
[onLifecycleRef,
|
|
8982
|
+
[onLifecycleRef, markHistoryStale]
|
|
8980
8983
|
);
|
|
8981
8984
|
_react.useEffect.call(void 0, () => {
|
|
8982
8985
|
if (!isOpen) {
|
|
@@ -8997,12 +9000,12 @@ function DepositModalInner({
|
|
|
8997
9000
|
store.dispatch({ type: "flow/reset" });
|
|
8998
9001
|
}
|
|
8999
9002
|
}, [isOpen, store]);
|
|
9000
|
-
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
9003
|
+
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _287 => _287.showBackButton]), () => ( true));
|
|
9001
9004
|
const canGoBack = backHandler !== void 0;
|
|
9002
9005
|
const hideHeaderChrome = swappedImmersive;
|
|
9003
9006
|
const modalClassName = `rs-modal${hideHeaderChrome ? " rs-modal--swapped-iframe" : ""}`;
|
|
9004
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9005
|
-
|
|
9007
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.ChainCatalogProvider, { service, rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9008
|
+
_chunk65MLWUQDcjs.Modal,
|
|
9006
9009
|
{
|
|
9007
9010
|
isOpen,
|
|
9008
9011
|
onClose,
|
|
@@ -9018,7 +9021,7 @@ function DepositModalInner({
|
|
|
9018
9021
|
className: "rs-modal-header-back",
|
|
9019
9022
|
"aria-label": "Go back",
|
|
9020
9023
|
onClick: backHandler,
|
|
9021
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9024
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.ChevronLeftIcon, {})
|
|
9022
9025
|
}
|
|
9023
9026
|
) }),
|
|
9024
9027
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
|
|
@@ -9030,7 +9033,7 @@ function DepositModalInner({
|
|
|
9030
9033
|
"aria-label": "Deposit history",
|
|
9031
9034
|
onClick: handleHistoryOpen,
|
|
9032
9035
|
disabled: !recipient,
|
|
9033
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9036
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.HistoryIcon, {})
|
|
9034
9037
|
}
|
|
9035
9038
|
),
|
|
9036
9039
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -9040,7 +9043,7 @@ function DepositModalInner({
|
|
|
9040
9043
|
onClick: onClose,
|
|
9041
9044
|
className: "rs-modal-close",
|
|
9042
9045
|
"aria-label": "Close",
|
|
9043
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9046
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk65MLWUQDcjs.CloseIcon, {})
|
|
9044
9047
|
}
|
|
9045
9048
|
)
|
|
9046
9049
|
] })
|
|
@@ -9074,7 +9077,7 @@ function DepositModalInner({
|
|
|
9074
9077
|
onDisconnect,
|
|
9075
9078
|
onRequestConnect,
|
|
9076
9079
|
uiConfig,
|
|
9077
|
-
appFees: _optionalChain([clientSetup, 'optionalAccess',
|
|
9080
|
+
appFees: _optionalChain([clientSetup, 'optionalAccess', _288 => _288.appFees]),
|
|
9078
9081
|
appFeesResolved: clientSetup !== null,
|
|
9079
9082
|
onStepChange: handleStepChange,
|
|
9080
9083
|
onSwappedImmersiveChange: setSwappedImmersive,
|
|
@@ -9085,7 +9088,7 @@ function DepositModalInner({
|
|
|
9085
9088
|
debug
|
|
9086
9089
|
}
|
|
9087
9090
|
),
|
|
9088
|
-
|
|
9091
|
+
historyOpen && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9089
9092
|
DepositHistoryPanel,
|
|
9090
9093
|
{
|
|
9091
9094
|
deposits: historyDeposits,
|