@rhinestone/deposit-modal 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -2
- package/bridge-transcript.json +653 -0
- package/dist/ClaimModal-IKTJU43Y.cjs +13 -0
- package/dist/ClaimModal-SEKNWRMA.mjs +13 -0
- package/dist/{DepositModalReown-YNNHLAV2.cjs → DepositModalReown-46LPVFB6.cjs} +16 -15
- package/dist/{DepositModalReown-3H75G3XQ.mjs → DepositModalReown-Q2JMLT47.mjs} +6 -5
- package/dist/WithdrawModal-5ICGD4HJ.mjs +12 -0
- package/dist/WithdrawModal-VP6PMIRO.cjs +12 -0
- package/dist/{chunk-GACIGCSN.cjs → chunk-6KG642KH.cjs} +1 -1
- package/dist/{chunk-RAADLTSW.cjs → chunk-7ICSHJFE.cjs} +179 -138
- package/dist/{chunk-COCBCQQC.mjs → chunk-7SR7ENVJ.mjs} +46 -5
- package/dist/{chunk-OLCD75JK.mjs → chunk-CFKC77SV.mjs} +451 -131
- package/dist/{chunk-EOMT5LKX.mjs → chunk-IN77XSWO.mjs} +526 -3
- package/dist/{chunk-FZ5FZFIG.mjs → chunk-K4H6TGBE.mjs} +1 -1
- package/dist/{chunk-DSIZNRWA.mjs → chunk-KTUVSKR4.mjs} +979 -360
- package/dist/{chunk-HOGZKHHY.cjs → chunk-LZFRL2AL.cjs} +3 -3
- package/dist/{chunk-7N77GIP4.cjs → chunk-MTFJSE52.cjs} +465 -171
- package/dist/{chunk-LTMMETAB.mjs → chunk-PKML3XVS.mjs} +404 -110
- package/dist/{chunk-ZMT4ATHR.cjs → chunk-V2OBGLJD.cjs} +564 -41
- package/dist/{chunk-XYJFEN5D.mjs → chunk-WUJIKCFU.mjs} +1 -1
- package/dist/{chunk-CVGNCUVU.cjs → chunk-X2IPAPXU.cjs} +22 -13
- package/dist/{chunk-2G2EIN4A.cjs → chunk-YCQZJQO6.cjs} +1272 -653
- package/dist/{chunk-5NUIKYSF.cjs → chunk-YWMWI7PZ.cjs} +458 -138
- package/dist/{chunk-YREVFB64.mjs → chunk-ZEO6ADM3.mjs} +16 -7
- package/dist/claim.cjs +6 -6
- package/dist/claim.d.cts +3 -3
- package/dist/claim.d.ts +3 -3
- package/dist/claim.mjs +5 -5
- package/dist/constants.cjs +2 -2
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +6 -6
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +5 -5
- package/dist/embed.cjs +310 -102
- package/dist/embed.d.cts +7 -1
- package/dist/embed.d.ts +7 -1
- package/dist/embed.mjs +285 -77
- package/dist/index.cjs +9 -9
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +8 -8
- package/dist/types-Bho4OA03.d.ts +982 -0
- package/dist/types-DP_3KwlD.d.cts +982 -0
- package/dist/withdraw.cjs +5 -5
- package/dist/withdraw.d.cts +3 -3
- package/dist/withdraw.d.ts +3 -3
- package/dist/withdraw.mjs +4 -4
- package/package.json +28 -7
- package/dist/ClaimModal-CREZO27I.mjs +0 -11
- package/dist/ClaimModal-JRIA32U2.cjs +0 -11
- package/dist/WithdrawModal-NVRX44IZ.mjs +0 -10
- package/dist/WithdrawModal-YYSBPCJJ.cjs +0 -10
- package/dist/types-B89I8_8H.d.ts +0 -638
- package/dist/types-nnDR4tqA.d.cts +0 -638
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var _chunkRAADLTSWcjs = require('./chunk-RAADLTSW.cjs');
|
|
22
21
|
|
|
22
|
+
var _chunk7ICSHJFEcjs = require('./chunk-7ICSHJFE.cjs');
|
|
23
23
|
|
|
24
|
-
var _chunkHOGZKHHYcjs = require('./chunk-HOGZKHHY.cjs');
|
|
25
24
|
|
|
25
|
+
var _chunkLZFRL2ALcjs = require('./chunk-LZFRL2AL.cjs');
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
@@ -85,7 +85,10 @@ var _chunkHOGZKHHYcjs = require('./chunk-HOGZKHHY.cjs');
|
|
|
85
85
|
|
|
86
86
|
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
var _chunkV2OBGLJDcjs = require('./chunk-V2OBGLJD.cjs');
|
|
89
92
|
|
|
90
93
|
|
|
91
94
|
|
|
@@ -123,6 +126,8 @@ var _chunkDW2EQA2Ucjs = require('./chunk-DW2EQA2U.cjs');
|
|
|
123
126
|
|
|
124
127
|
|
|
125
128
|
|
|
129
|
+
|
|
130
|
+
|
|
126
131
|
|
|
127
132
|
|
|
128
133
|
|
|
@@ -217,11 +222,11 @@ SegmentedToggle.displayName = "SegmentedToggle";
|
|
|
217
222
|
|
|
218
223
|
function ChainIcon({ chainId, className, loading }) {
|
|
219
224
|
const badge = _chunk4KCSH4T3cjs.getChainBadge.call(void 0, chainId);
|
|
220
|
-
const catalogChain =
|
|
225
|
+
const catalogChain = _chunkV2OBGLJDcjs.useCatalogChain.call(void 0, _chunkV2OBGLJDcjs.catalogKeyForChain.call(void 0, chainId));
|
|
221
226
|
const name = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _2 => _2.name]), () => ( _chunk4KCSH4T3cjs.getChainName.call(void 0, chainId)));
|
|
222
227
|
const initial = (_nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _3 => _3.name]), () => ( badge.shortLabel))).charAt(0);
|
|
223
228
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
224
|
-
|
|
229
|
+
_chunkV2OBGLJDcjs.CdnIcon,
|
|
225
230
|
{
|
|
226
231
|
src: _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _4 => _4.iconUrl]), () => ( _chunk4KCSH4T3cjs.getChainIcon.call(void 0, chainId))),
|
|
227
232
|
alt: name,
|
|
@@ -244,7 +249,7 @@ ChainIcon.displayName = "ChainIcon";
|
|
|
244
249
|
// src/components/ui/WalletBadgeIcons/index.tsx
|
|
245
250
|
|
|
246
251
|
function BadgeImage({ src, alt = "" }) {
|
|
247
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
252
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CdnIcon, { src, alt }) });
|
|
248
253
|
}
|
|
249
254
|
var WALLET_BADGES = ["rabby", "phantom", "walletconnect"];
|
|
250
255
|
function WalletBadgeIcons() {
|
|
@@ -297,7 +302,7 @@ var DAPP_IMPORT_CATALOG = [
|
|
|
297
302
|
// src/components/ui/BrandIcons.tsx
|
|
298
303
|
|
|
299
304
|
function ExchangeBadgeImage({ name }) {
|
|
300
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
305
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CdnIcon, { src: _nullishCoalesce(_chunk7ICSHJFEcjs.getExchangeLogoSrc.call(void 0, name), () => ( void 0)) });
|
|
301
306
|
}
|
|
302
307
|
var CARD_NETWORKS = ["amex", "visa", "mastercard"];
|
|
303
308
|
function CardNetworkIcons() {
|
|
@@ -305,7 +310,7 @@ function CardNetworkIcons() {
|
|
|
305
310
|
"span",
|
|
306
311
|
{
|
|
307
312
|
className: `rs-card-network rs-card-network--${network}`,
|
|
308
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
313
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CdnIcon, { src: _chunk4KCSH4T3cjs.cdnIconUrl.call(void 0, "cards", network) })
|
|
309
314
|
},
|
|
310
315
|
network
|
|
311
316
|
)) });
|
|
@@ -324,7 +329,7 @@ function DappBadgeIcons() {
|
|
|
324
329
|
).filter(
|
|
325
330
|
(brand) => Boolean(brand)
|
|
326
331
|
);
|
|
327
|
-
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,
|
|
332
|
+
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, _chunkV2OBGLJDcjs.CdnIcon, { src: brand.iconUrl, alt: brand.label }) }, brand.id)) });
|
|
328
333
|
}
|
|
329
334
|
DappBadgeIcons.displayName = "DappBadgeIcons";
|
|
330
335
|
var DAPP_BADGE_COUNT = DAPP_BADGE_ORDER.length;
|
|
@@ -344,9 +349,9 @@ function balanceSubtitle(status, balanceUsd, fallback) {
|
|
|
344
349
|
return "No balance";
|
|
345
350
|
}
|
|
346
351
|
function fiatIcon(name) {
|
|
347
|
-
if (name === "apple") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
348
|
-
if (name === "bank") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
349
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
352
|
+
if (name === "apple") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.AppleIcon, {});
|
|
353
|
+
if (name === "bank") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.BankIcon, {});
|
|
354
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CardIcon, {});
|
|
350
355
|
}
|
|
351
356
|
function FiatMethodIcon({ option }) {
|
|
352
357
|
const [remoteFailed, setRemoteFailed] = _react.useState.call(void 0, false);
|
|
@@ -429,20 +434,20 @@ function renderWalletLeading(row) {
|
|
|
429
434
|
}
|
|
430
435
|
);
|
|
431
436
|
}
|
|
432
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
437
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.WalletIcon, {});
|
|
433
438
|
}
|
|
434
|
-
var TRANSFER_CRYPTO_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
435
|
-
var WALLET_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
436
|
-
var EXCHANGE_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
437
|
-
var MIGRATE_ASSETS_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
438
|
-
var SMALL_SPINNER = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
439
|
+
var TRANSFER_CRYPTO_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.TransferCryptoIcon, {});
|
|
440
|
+
var WALLET_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.WalletIcon, {});
|
|
441
|
+
var EXCHANGE_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.UnplugIcon, {});
|
|
442
|
+
var MIGRATE_ASSETS_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.MigrateAssetsIcon, {});
|
|
443
|
+
var SMALL_SPINNER = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.Spinner, { className: "rs-spinner--sm" });
|
|
439
444
|
var CONNECT_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
440
445
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, WalletBadgeIcons, {}),
|
|
441
446
|
"+100"
|
|
442
447
|
] });
|
|
443
448
|
var EXTRA_EXCHANGE_COUNT = Math.max(
|
|
444
449
|
0,
|
|
445
|
-
|
|
450
|
+
_chunkV2OBGLJDcjs.SUPPORTED_CONNECT_EXCHANGE_COUNT - EXCHANGE_BADGE_COUNT
|
|
446
451
|
);
|
|
447
452
|
var EXCHANGE_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
448
453
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExchangeBadgeIcons, {}),
|
|
@@ -500,7 +505,7 @@ function ConnectStep({
|
|
|
500
505
|
if (onSelectTransferCrypto) {
|
|
501
506
|
cryptoRows.push(
|
|
502
507
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
503
|
-
|
|
508
|
+
_chunkLZFRL2ALcjs.ListRow,
|
|
504
509
|
{
|
|
505
510
|
leading: TRANSFER_CRYPTO_LEADING,
|
|
506
511
|
title: "Transfer crypto",
|
|
@@ -521,7 +526,7 @@ function ConnectStep({
|
|
|
521
526
|
);
|
|
522
527
|
cryptoRows.push(
|
|
523
528
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
524
|
-
|
|
529
|
+
_chunkLZFRL2ALcjs.ListRow,
|
|
525
530
|
{
|
|
526
531
|
leading: renderWalletLeading(row),
|
|
527
532
|
title: collapseToExternal ? "External wallet" : row.label,
|
|
@@ -538,7 +543,7 @@ function ConnectStep({
|
|
|
538
543
|
if (!hasSessionWallet && handleConnect) {
|
|
539
544
|
cryptoRows.push(
|
|
540
545
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
541
|
-
|
|
546
|
+
_chunkLZFRL2ALcjs.ListRow,
|
|
542
547
|
{
|
|
543
548
|
leading: WALLET_LEADING,
|
|
544
549
|
title: "Connect wallet",
|
|
@@ -553,7 +558,7 @@ function ConnectStep({
|
|
|
553
558
|
if (onSelectFundFromExchange) {
|
|
554
559
|
cryptoRows.push(
|
|
555
560
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
556
|
-
|
|
561
|
+
_chunkLZFRL2ALcjs.ListRow,
|
|
557
562
|
{
|
|
558
563
|
leading: EXCHANGE_LEADING,
|
|
559
564
|
title: "Connect exchange",
|
|
@@ -568,7 +573,7 @@ function ConnectStep({
|
|
|
568
573
|
if (onSelectMigrateAssets) {
|
|
569
574
|
cryptoRows.push(
|
|
570
575
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
571
|
-
|
|
576
|
+
_chunkLZFRL2ALcjs.ListRow,
|
|
572
577
|
{
|
|
573
578
|
leading: MIGRATE_ASSETS_LEADING,
|
|
574
579
|
title: "Migrate assets",
|
|
@@ -589,7 +594,7 @@ function ConnectStep({
|
|
|
589
594
|
for (const opt of fiatPaymentMethods) {
|
|
590
595
|
cashRows.push(
|
|
591
596
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
592
|
-
|
|
597
|
+
_chunkLZFRL2ALcjs.ListRow,
|
|
593
598
|
{
|
|
594
599
|
leading: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FiatMethodIcon, { option: opt }),
|
|
595
600
|
title: opt.label,
|
|
@@ -604,7 +609,7 @@ function ConnectStep({
|
|
|
604
609
|
} else if (fiatLoading) {
|
|
605
610
|
cashRows.push(
|
|
606
611
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
607
|
-
|
|
612
|
+
_chunkLZFRL2ALcjs.ListRow,
|
|
608
613
|
{
|
|
609
614
|
leading: SMALL_SPINNER,
|
|
610
615
|
title: "Loading payment options\u2026",
|
|
@@ -633,9 +638,9 @@ function ConnectStep({
|
|
|
633
638
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
634
639
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
635
640
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
636
|
-
|
|
641
|
+
_chunkV2OBGLJDcjs.BodyHeader,
|
|
637
642
|
{
|
|
638
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
643
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.HandCoinsIcon, {}),
|
|
639
644
|
title,
|
|
640
645
|
subtitle: _nullishCoalesce(subtitle, () => ( defaultSubtitle)),
|
|
641
646
|
aside: showToggle ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -671,7 +676,7 @@ function ConnectStep({
|
|
|
671
676
|
children: "Disconnect wallet"
|
|
672
677
|
}
|
|
673
678
|
) }),
|
|
674
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
679
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.PoweredBy, {})
|
|
675
680
|
] });
|
|
676
681
|
}
|
|
677
682
|
ConnectStep.displayName = "ConnectStep";
|
|
@@ -694,17 +699,17 @@ function AssetSelectStep({
|
|
|
694
699
|
const [selectedAssetId, setSelectedAssetId] = _react.useState.call(void 0, null);
|
|
695
700
|
const [loading, setLoading] = _react.useState.call(void 0, true);
|
|
696
701
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
697
|
-
const isDepositChain =
|
|
698
|
-
const { catalog } =
|
|
699
|
-
const chainName =
|
|
702
|
+
const isDepositChain = _chunkV2OBGLJDcjs.useIsDepositChain.call(void 0, );
|
|
703
|
+
const { catalog } = _chunkV2OBGLJDcjs.useChainCatalog.call(void 0, );
|
|
704
|
+
const chainName = _chunkV2OBGLJDcjs.useChainName.call(void 0, );
|
|
700
705
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
701
706
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
702
|
-
return
|
|
707
|
+
return _chunkV2OBGLJDcjs.getAssetId.call(void 0, {
|
|
703
708
|
chainId: defaultSourceChain,
|
|
704
709
|
token: defaultSourceToken
|
|
705
710
|
});
|
|
706
711
|
}, [defaultSourceChain, defaultSourceToken]);
|
|
707
|
-
const onTotalBalanceComputedRef =
|
|
712
|
+
const onTotalBalanceComputedRef = _chunkV2OBGLJDcjs.useLatestRef.call(void 0, onTotalBalanceComputed);
|
|
708
713
|
_react.useEffect.call(void 0, () => {
|
|
709
714
|
let active = true;
|
|
710
715
|
function emitAssetsUpdate(currentAssets) {
|
|
@@ -724,7 +729,7 @@ function AssetSelectStep({
|
|
|
724
729
|
try {
|
|
725
730
|
const portfolio = await service.fetchPortfolio(address);
|
|
726
731
|
if (!active) return;
|
|
727
|
-
const portfolioAssets =
|
|
732
|
+
const portfolioAssets = _chunkV2OBGLJDcjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
728
733
|
setAssets(portfolioAssets);
|
|
729
734
|
emitAssetsUpdate(portfolioAssets);
|
|
730
735
|
const hasNative = portfolioAssets.some(
|
|
@@ -803,7 +808,7 @@ function AssetSelectStep({
|
|
|
803
808
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
804
809
|
const numeric = Number(raw);
|
|
805
810
|
if (!Number.isFinite(numeric)) return raw;
|
|
806
|
-
return
|
|
811
|
+
return _chunkV2OBGLJDcjs.tokenFormatter.format(numeric);
|
|
807
812
|
} catch (e3) {
|
|
808
813
|
return asset.balance;
|
|
809
814
|
}
|
|
@@ -811,20 +816,20 @@ function AssetSelectStep({
|
|
|
811
816
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
812
817
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
813
818
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
814
|
-
|
|
819
|
+
_chunkV2OBGLJDcjs.BodyHeader,
|
|
815
820
|
{
|
|
816
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
821
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.WalletIcon, {}),
|
|
817
822
|
title: "Your assets",
|
|
818
823
|
subtitle: "Select source assets to transfer"
|
|
819
824
|
}
|
|
820
825
|
),
|
|
821
826
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
822
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
827
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
823
828
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
824
829
|
] }),
|
|
825
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
830
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.Callout, { variant: "error", children: error }),
|
|
826
831
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
827
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
832
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
828
833
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
829
834
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
830
835
|
address.slice(0, 6),
|
|
@@ -857,13 +862,13 @@ function AssetSelectStep({
|
|
|
857
862
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
|
|
858
863
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-icon-wrapper", children: [
|
|
859
864
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
860
|
-
|
|
865
|
+
_chunkV2OBGLJDcjs.TokenIcon,
|
|
861
866
|
{
|
|
862
867
|
symbol: asset.symbol,
|
|
863
868
|
fallback: asset.symbol.slice(0, 4)
|
|
864
869
|
}
|
|
865
870
|
) }),
|
|
866
|
-
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
871
|
+
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CdnIcon, { src: chainIcon, alt: chainName(asset.chainId) }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
867
872
|
"span",
|
|
868
873
|
{
|
|
869
874
|
className: "rs-asset-chain-badge",
|
|
@@ -890,14 +895,14 @@ function AssetSelectStep({
|
|
|
890
895
|
] })
|
|
891
896
|
] })
|
|
892
897
|
] }),
|
|
893
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ?
|
|
898
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunkV2OBGLJDcjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
894
899
|
]
|
|
895
900
|
},
|
|
896
901
|
asset.id
|
|
897
902
|
);
|
|
898
903
|
}) }),
|
|
899
904
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
900
|
-
|
|
905
|
+
_chunkV2OBGLJDcjs.Button,
|
|
901
906
|
{
|
|
902
907
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
903
908
|
disabled: !selectedAsset,
|
|
@@ -906,7 +911,7 @@ function AssetSelectStep({
|
|
|
906
911
|
}
|
|
907
912
|
)
|
|
908
913
|
] }),
|
|
909
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
914
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.PoweredBy, {})
|
|
910
915
|
] });
|
|
911
916
|
}
|
|
912
917
|
async function fetchNativeAssets(address, publicClient, existing, isDepositChain, catalogChain) {
|
|
@@ -914,7 +919,7 @@ async function fetchNativeAssets(address, publicClient, existing, isDepositChain
|
|
|
914
919
|
const connectedChainId = _optionalChain([publicClient, 'access', _16 => _16.chain, 'optionalAccess', _17 => _17.id]);
|
|
915
920
|
if (!connectedChainId) return [];
|
|
916
921
|
if (!isDepositChain(connectedChainId)) return [];
|
|
917
|
-
const id =
|
|
922
|
+
const id = _chunkV2OBGLJDcjs.getAssetId.call(void 0, {
|
|
918
923
|
chainId: connectedChainId,
|
|
919
924
|
token: _chunk4KCSH4T3cjs.NATIVE_TOKEN_ADDRESS
|
|
920
925
|
});
|
|
@@ -1120,7 +1125,7 @@ function AmountStep({
|
|
|
1120
1125
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
1121
1126
|
if (!balanceTarget || !publicClient) return;
|
|
1122
1127
|
try {
|
|
1123
|
-
const bal =
|
|
1128
|
+
const bal = _chunkV2OBGLJDcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
1124
1129
|
address: asset.token,
|
|
1125
1130
|
abi: _viem.erc20Abi,
|
|
1126
1131
|
functionName: "balanceOf",
|
|
@@ -1141,7 +1146,7 @@ function AmountStep({
|
|
|
1141
1146
|
hasAttemptedSwitch.current = true;
|
|
1142
1147
|
switchChain(asset.chainId).catch((err) => {
|
|
1143
1148
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
1144
|
-
setError(
|
|
1149
|
+
setError(_chunkV2OBGLJDcjs.formatUserError.call(void 0, raw));
|
|
1145
1150
|
});
|
|
1146
1151
|
}
|
|
1147
1152
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -1194,7 +1199,7 @@ function AmountStep({
|
|
|
1194
1199
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
1195
1200
|
const numeric = Number(raw);
|
|
1196
1201
|
if (!Number.isFinite(numeric)) return raw;
|
|
1197
|
-
return
|
|
1202
|
+
return _chunkV2OBGLJDcjs.tokenFormatter.format(numeric);
|
|
1198
1203
|
} catch (e8) {
|
|
1199
1204
|
return "\u2026";
|
|
1200
1205
|
}
|
|
@@ -1282,12 +1287,12 @@ function AmountStep({
|
|
|
1282
1287
|
const needsPricing = !knowsBalance && !isSourceStablecoin;
|
|
1283
1288
|
const blockedOnPricing = needsPricing && !hasPricing;
|
|
1284
1289
|
const continueDisabled = chainMismatch || exceedsBalance || blockedOnPricing || numericAmount === 0 && !isBelowMin || knowsBalance && balance === null;
|
|
1285
|
-
const chainName =
|
|
1290
|
+
const chainName = _chunkV2OBGLJDcjs.useChainName.call(void 0, );
|
|
1286
1291
|
const sourceChainName = chainName(asset.chainId);
|
|
1287
1292
|
const targetChainName = chainName(targetChainId);
|
|
1288
1293
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
1289
1294
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
1290
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1295
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.WalletIcon, {}), title }),
|
|
1291
1296
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
1292
1297
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
1293
1298
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1307,13 +1312,13 @@ function AmountStep({
|
|
|
1307
1312
|
" available",
|
|
1308
1313
|
balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1309
1314
|
" (~",
|
|
1310
|
-
|
|
1315
|
+
_chunkV2OBGLJDcjs.currencyFormatter.format(balanceUsd),
|
|
1311
1316
|
")"
|
|
1312
1317
|
] })
|
|
1313
1318
|
] }),
|
|
1314
1319
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
1315
1320
|
"Min. deposit ",
|
|
1316
|
-
|
|
1321
|
+
_chunkV2OBGLJDcjs.currencyFormatter.format(minDepositUsd)
|
|
1317
1322
|
] })
|
|
1318
1323
|
] })
|
|
1319
1324
|
] }),
|
|
@@ -1338,7 +1343,7 @@ function AmountStep({
|
|
|
1338
1343
|
" ",
|
|
1339
1344
|
asset.symbol
|
|
1340
1345
|
] }),
|
|
1341
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1346
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.TokenIcon, { symbol: asset.symbol }) })
|
|
1342
1347
|
] })
|
|
1343
1348
|
] }),
|
|
1344
1349
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
@@ -1349,21 +1354,21 @@ function AmountStep({
|
|
|
1349
1354
|
" ",
|
|
1350
1355
|
targetSymbol
|
|
1351
1356
|
] }),
|
|
1352
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1357
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.TokenIcon, { symbol: targetSymbol }) })
|
|
1353
1358
|
] })
|
|
1354
1359
|
] }),
|
|
1355
1360
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
1356
1361
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
1357
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
1362
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkV2OBGLJDcjs.currencyFormatter.format(balanceAfterUsd) })
|
|
1358
1363
|
] })
|
|
1359
1364
|
] }),
|
|
1360
|
-
blockedOnPricing && sourcePriceUnavailable && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1365
|
+
blockedOnPricing && sourcePriceUnavailable && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkV2OBGLJDcjs.Callout, { variant: "error", children: [
|
|
1361
1366
|
asset.symbol,
|
|
1362
1367
|
" can't be priced right now, so this deposit can't be estimated. You can still send any amount to the deposit address."
|
|
1363
1368
|
] }),
|
|
1364
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1369
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.Callout, { variant: "error", children: error }),
|
|
1365
1370
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1366
|
-
|
|
1371
|
+
_chunkV2OBGLJDcjs.Button,
|
|
1367
1372
|
{
|
|
1368
1373
|
onClick: handleContinue,
|
|
1369
1374
|
fullWidth: true,
|
|
@@ -1372,7 +1377,7 @@ function AmountStep({
|
|
|
1372
1377
|
}
|
|
1373
1378
|
)
|
|
1374
1379
|
] }),
|
|
1375
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1380
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.PoweredBy, {})
|
|
1376
1381
|
] });
|
|
1377
1382
|
}
|
|
1378
1383
|
|
|
@@ -1399,14 +1404,14 @@ function ReviewDetails({
|
|
|
1399
1404
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
1400
1405
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1401
1406
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceChainName }),
|
|
1402
|
-
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1407
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CdnIcon, { src: sourceChainIcon }) })
|
|
1403
1408
|
] })
|
|
1404
1409
|
] }),
|
|
1405
1410
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1406
1411
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
|
|
1407
1412
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1408
1413
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName }),
|
|
1409
|
-
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1414
|
+
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CdnIcon, { src: targetChainIcon }) })
|
|
1410
1415
|
] })
|
|
1411
1416
|
] }),
|
|
1412
1417
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -1421,21 +1426,21 @@ function ReviewDetails({
|
|
|
1421
1426
|
" ",
|
|
1422
1427
|
sendSymbol
|
|
1423
1428
|
] }),
|
|
1424
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1429
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.TokenIcon, { symbol: sendSymbol }) })
|
|
1425
1430
|
] })
|
|
1426
1431
|
] }),
|
|
1427
1432
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1428
1433
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Receive" }),
|
|
1429
1434
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1430
1435
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: receiveDisplay }),
|
|
1431
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1436
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.TokenIcon, { symbol: receiveSymbol }) })
|
|
1432
1437
|
] })
|
|
1433
1438
|
] }),
|
|
1434
1439
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1435
1440
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Fees" }),
|
|
1436
1441
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1437
1442
|
fee.display === null ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-skeleton rs-skeleton-fee", "aria-hidden": "true" }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: fee.struck ? { textDecoration: "line-through" } : void 0, children: fee.display }),
|
|
1438
|
-
fee.tooltip !== void 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1443
|
+
fee.tooltip !== void 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7ICSHJFEcjs.Tooltip, { content: fee.tooltip, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-info", "aria-label": "Fee info", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.InfoIcon, {}) }) })
|
|
1439
1444
|
] })
|
|
1440
1445
|
] })
|
|
1441
1446
|
] });
|
|
@@ -1653,17 +1658,17 @@ function ConfirmStep({
|
|
|
1653
1658
|
const targetChainName = _chunk4KCSH4T3cjs.getChainName.call(void 0, targetChainId);
|
|
1654
1659
|
const sourceChainIcon = _chunk4KCSH4T3cjs.getChainIcon.call(void 0, asset.chainId);
|
|
1655
1660
|
const targetChainIcon = _chunk4KCSH4T3cjs.getChainIcon.call(void 0, targetChainId);
|
|
1656
|
-
const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? _nullishCoalesce(
|
|
1657
|
-
const mustHaveQuote = !appFeesResolved ||
|
|
1661
|
+
const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? _nullishCoalesce(_chunkV2OBGLJDcjs.formatTokenAmount.call(void 0, Number(amount), asset.symbol), () => ( "0")) : "0";
|
|
1662
|
+
const mustHaveQuote = !appFeesResolved || _chunkV2OBGLJDcjs.resolveAppFeeBps.call(void 0,
|
|
1658
1663
|
appFees,
|
|
1659
1664
|
`eip155:${quoteSource.chainId}`,
|
|
1660
1665
|
quoteSource.token
|
|
1661
1666
|
) > 0;
|
|
1662
|
-
const { display: feeDisplay, struck: feesFullySponsored } =
|
|
1667
|
+
const { display: feeDisplay, struck: feesFullySponsored } = _chunkV2OBGLJDcjs.quoteFeeRow.call(void 0,
|
|
1663
1668
|
_optionalChain([quote, 'optionalAccess', _67 => _67.fees])
|
|
1664
1669
|
);
|
|
1665
1670
|
const directTransfer = sameRoute && !mustHaveQuote && !executeTransfer;
|
|
1666
|
-
const permitEligible = enableGaslessDeposit && !
|
|
1671
|
+
const permitEligible = enableGaslessDeposit && !_chunkV2OBGLJDcjs.isNativeAsset.call(void 0, asset) && !isDappImportAsset(asset) && !executeTransfer && !directTransfer && asset.chainId !== _chunk4KCSH4T3cjs.HYPERCORE_CHAIN_ID;
|
|
1667
1672
|
const permitRequestKey = JSON.stringify([
|
|
1668
1673
|
smartAccount.toLowerCase(),
|
|
1669
1674
|
asset.chainId,
|
|
@@ -1676,21 +1681,21 @@ function ConfirmStep({
|
|
|
1676
1681
|
const receiveDisplay = (() => {
|
|
1677
1682
|
if (directTransfer) return `${formattedSendAmount} ${asset.symbol}`;
|
|
1678
1683
|
if (quote) {
|
|
1679
|
-
const quoted =
|
|
1684
|
+
const quoted = _chunkV2OBGLJDcjs.formatQuotedReceive.call(void 0, quote.output, targetSymbol);
|
|
1680
1685
|
if (quoted !== void 0) return quoted;
|
|
1681
1686
|
}
|
|
1682
1687
|
const usdValue = Number(targetAmount);
|
|
1683
1688
|
const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
|
|
1684
|
-
const estimate =
|
|
1689
|
+
const estimate = _chunkV2OBGLJDcjs.formatReceiveEstimate.call(void 0, {
|
|
1685
1690
|
sourceAmount: Number.isFinite(Number(amount)) ? Number(amount) : void 0,
|
|
1686
1691
|
sourceSymbol: asset.symbol,
|
|
1687
1692
|
targetSymbol,
|
|
1688
1693
|
sourceAmountUsd,
|
|
1689
|
-
sourceTrusted:
|
|
1694
|
+
sourceTrusted: _chunkV2OBGLJDcjs.isRecognizedToken.call(void 0, asset.token, asset.chainId),
|
|
1690
1695
|
// The target is the curated deposit destination, so a stablecoin target
|
|
1691
1696
|
// estimates at $1 when unquoted (DepositFlow skips fetching stablecoin
|
|
1692
1697
|
// target prices). Not applied to the source — that can be a held token.
|
|
1693
|
-
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } :
|
|
1698
|
+
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : _chunkV2OBGLJDcjs.isDisplayStablecoinSymbol.call(void 0, targetSymbol) ? { [targetSymbol.toUpperCase()]: 1 } : {}
|
|
1694
1699
|
});
|
|
1695
1700
|
if (estimate !== void 0) return estimate;
|
|
1696
1701
|
return targetSymbol;
|
|
@@ -1701,7 +1706,7 @@ function ConfirmStep({
|
|
|
1701
1706
|
hasAttemptedSwitch.current = true;
|
|
1702
1707
|
switchChain(asset.chainId).catch((err) => {
|
|
1703
1708
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
1704
|
-
setError(
|
|
1709
|
+
setError(_chunkV2OBGLJDcjs.formatUserError.call(void 0, raw));
|
|
1705
1710
|
});
|
|
1706
1711
|
}
|
|
1707
1712
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -1882,14 +1887,15 @@ function ConfirmStep({
|
|
|
1882
1887
|
targetChain,
|
|
1883
1888
|
targetToken,
|
|
1884
1889
|
directTransfer: false,
|
|
1885
|
-
sourceTxHashPending: true
|
|
1890
|
+
sourceTxHashPending: true,
|
|
1891
|
+
depositId: submitted.depositId
|
|
1886
1892
|
}
|
|
1887
1893
|
);
|
|
1888
1894
|
} catch (err) {
|
|
1889
1895
|
const raw = err instanceof Error ? err.message : "Signing failed";
|
|
1890
|
-
const safeToTransfer = !submitStarted || err instanceof
|
|
1896
|
+
const safeToTransfer = !submitStarted || err instanceof _chunkV2OBGLJDcjs.PermitDepositSubmitError && err.safeToTransfer;
|
|
1891
1897
|
if (safeToTransfer) setPermitDisabled(true);
|
|
1892
|
-
const message = safeToTransfer ?
|
|
1898
|
+
const message = safeToTransfer ? _chunkV2OBGLJDcjs.formatUserError.call(void 0, raw) : "Deposit submission status is uncertain. Check your activity before trying a transfer.";
|
|
1893
1899
|
setError(message);
|
|
1894
1900
|
_optionalChain([onError, 'optionalCall', _69 => _69(message, "PERMIT_ERROR", raw)]);
|
|
1895
1901
|
} finally {
|
|
@@ -1910,7 +1916,7 @@ function ConfirmStep({
|
|
|
1910
1916
|
const result = await executeTransfer(amountUnits);
|
|
1911
1917
|
hash = result.txHash;
|
|
1912
1918
|
resolvedSourceToken = result.sourceToken;
|
|
1913
|
-
} else if (
|
|
1919
|
+
} else if (_chunkV2OBGLJDcjs.isNativeAsset.call(void 0, asset)) {
|
|
1914
1920
|
hash = await walletClient.sendTransaction({
|
|
1915
1921
|
account,
|
|
1916
1922
|
chain,
|
|
@@ -1941,8 +1947,8 @@ function ConfirmStep({
|
|
|
1941
1947
|
);
|
|
1942
1948
|
} catch (err) {
|
|
1943
1949
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
1944
|
-
const uncertain =
|
|
1945
|
-
const message = uncertain ? "Deposit submission status is uncertain. Check your activity before trying again." :
|
|
1950
|
+
const uncertain = _chunk7ICSHJFEcjs.isSubmissionUncertain.call(void 0, err);
|
|
1951
|
+
const message = uncertain ? "Deposit submission status is uncertain. Check your activity before trying again." : _chunkV2OBGLJDcjs.formatUserError.call(void 0, raw);
|
|
1946
1952
|
if (uncertain) setSubmissionUncertain(true);
|
|
1947
1953
|
setError(message);
|
|
1948
1954
|
_optionalChain([onError, 'optionalCall', _71 => _71(message, "TRANSFER_ERROR", raw)]);
|
|
@@ -1952,7 +1958,7 @@ function ConfirmStep({
|
|
|
1952
1958
|
};
|
|
1953
1959
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
1954
1960
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
1955
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1961
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.WalletIcon, {}), title: "Review deposit" }),
|
|
1956
1962
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1957
1963
|
ReviewDetails,
|
|
1958
1964
|
{
|
|
@@ -1968,9 +1974,9 @@ function ConfirmStep({
|
|
|
1968
1974
|
fee: { display: feeDisplay, struck: feesFullySponsored }
|
|
1969
1975
|
}
|
|
1970
1976
|
),
|
|
1971
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1977
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.Callout, { variant: "error", children: error }),
|
|
1972
1978
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1973
|
-
|
|
1979
|
+
_chunkV2OBGLJDcjs.Button,
|
|
1974
1980
|
{
|
|
1975
1981
|
onClick: handleConfirm,
|
|
1976
1982
|
loading: isSubmitting,
|
|
@@ -1997,7 +2003,7 @@ function ConfirmStep({
|
|
|
1997
2003
|
] }),
|
|
1998
2004
|
!permit && permitEligible && permitUnavailable && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "rs-gasless-note", children: permitUnavailable === "permit2-approval-required" ? "Gasless unavailable until Permit2 is approved; Continue sends a token transaction." : "This wallet/token cannot use gasless authorization; Continue sends a token transaction." })
|
|
1999
2005
|
] }),
|
|
2000
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2006
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.PoweredBy, {})
|
|
2001
2007
|
] });
|
|
2002
2008
|
}
|
|
2003
2009
|
|
|
@@ -2050,29 +2056,29 @@ function QrReviewStep({
|
|
|
2050
2056
|
cancelled = true;
|
|
2051
2057
|
};
|
|
2052
2058
|
}, [service, smartAccount, asset, amount]);
|
|
2053
|
-
const formattedSendAmount = _nullishCoalesce(
|
|
2059
|
+
const formattedSendAmount = _nullishCoalesce(_chunkV2OBGLJDcjs.formatTokenAmount.call(void 0, Number(amount), asset.symbol), () => ( amount));
|
|
2054
2060
|
const receiveDisplay = (() => {
|
|
2055
2061
|
if (quote.value) {
|
|
2056
|
-
const quoted =
|
|
2062
|
+
const quoted = _chunkV2OBGLJDcjs.formatQuotedReceive.call(void 0, quote.value.output, targetSymbol);
|
|
2057
2063
|
if (quoted !== void 0) return quoted;
|
|
2058
2064
|
}
|
|
2059
2065
|
const usdValue = Number(targetAmount);
|
|
2060
|
-
const estimate =
|
|
2066
|
+
const estimate = _chunkV2OBGLJDcjs.formatReceiveEstimate.call(void 0, {
|
|
2061
2067
|
sourceAmount: Number.isFinite(Number(amount)) ? Number(amount) : void 0,
|
|
2062
2068
|
sourceSymbol: asset.symbol,
|
|
2063
2069
|
targetSymbol,
|
|
2064
2070
|
sourceAmountUsd: Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0,
|
|
2065
|
-
sourceTrusted:
|
|
2066
|
-
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } :
|
|
2071
|
+
sourceTrusted: _chunkV2OBGLJDcjs.isRecognizedToken.call(void 0, asset.token, asset.chainId),
|
|
2072
|
+
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : _chunkV2OBGLJDcjs.isDisplayStablecoinSymbol.call(void 0, targetSymbol) ? { [targetSymbol.toUpperCase()]: 1 } : {}
|
|
2067
2073
|
});
|
|
2068
2074
|
return _nullishCoalesce(estimate, () => ( targetSymbol));
|
|
2069
2075
|
})();
|
|
2070
2076
|
const estimatedTime = quote.value && Number.isFinite(quote.value.estimatedFillTimeSeconds) ? quote.value.estimatedFillTimeSeconds < 60 ? "< 1 min" : `~${Math.round(quote.value.estimatedFillTimeSeconds / 60)} min` : quote.state === "loading" ? "\u2026" : "\u2014";
|
|
2071
|
-
const { display: quotedFee, struck } =
|
|
2077
|
+
const { display: quotedFee, struck } = _chunkV2OBGLJDcjs.quoteFeeRow.call(void 0, _optionalChain([quote, 'access', _72 => _72.value, 'optionalAccess', _73 => _73.fees]));
|
|
2072
2078
|
const feeDisplay = quote.state === "unavailable" ? "\u2014" : quotedFee;
|
|
2073
2079
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
2074
2080
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2075
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2081
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.TransferCryptoIcon, {}), title: "Fee estimate" }),
|
|
2076
2082
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2077
2083
|
ReviewDetails,
|
|
2078
2084
|
{
|
|
@@ -2088,9 +2094,9 @@ function QrReviewStep({
|
|
|
2088
2094
|
fee: { display: feeDisplay, struck }
|
|
2089
2095
|
}
|
|
2090
2096
|
),
|
|
2091
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2097
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.Button, { onClick: onClose, fullWidth: true, children: "Close" })
|
|
2092
2098
|
] }),
|
|
2093
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2099
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.PoweredBy, {})
|
|
2094
2100
|
] });
|
|
2095
2101
|
}
|
|
2096
2102
|
QrReviewStep.displayName = "QrReviewStep";
|
|
@@ -2121,20 +2127,20 @@ function DepositAddressSkeleton({
|
|
|
2121
2127
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", "aria-busy": "true", children: [
|
|
2122
2128
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: "Preparing deposit details\u2026" }),
|
|
2123
2129
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
2124
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2130
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
2125
2131
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", "aria-hidden": "true", children: [
|
|
2126
2132
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
2127
2133
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
2128
2134
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown-trigger", children: [
|
|
2129
2135
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2130
|
-
|
|
2136
|
+
_chunkV2OBGLJDcjs.CdnIcon,
|
|
2131
2137
|
{
|
|
2132
2138
|
src: chainIcon,
|
|
2133
2139
|
className: "rs-deposit-address-dropdown-icon"
|
|
2134
2140
|
}
|
|
2135
2141
|
),
|
|
2136
2142
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainName }),
|
|
2137
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2143
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2138
2144
|
] })
|
|
2139
2145
|
] }),
|
|
2140
2146
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
@@ -2143,8 +2149,8 @@ function DepositAddressSkeleton({
|
|
|
2143
2149
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
2144
2150
|
"Min.$",
|
|
2145
2151
|
(_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _74 => _74.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
2146
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2147
|
-
|
|
2152
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7ICSHJFEcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2153
|
+
_chunkV2OBGLJDcjs.InfoIcon,
|
|
2148
2154
|
{
|
|
2149
2155
|
className: "rs-deposit-address-min-icon",
|
|
2150
2156
|
"aria-hidden": "true"
|
|
@@ -2154,14 +2160,14 @@ function DepositAddressSkeleton({
|
|
|
2154
2160
|
] }),
|
|
2155
2161
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown-trigger", children: [
|
|
2156
2162
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2157
|
-
|
|
2163
|
+
_chunkV2OBGLJDcjs.TokenIcon,
|
|
2158
2164
|
{
|
|
2159
2165
|
symbol: defaultToken,
|
|
2160
2166
|
className: "rs-deposit-address-dropdown-icon"
|
|
2161
2167
|
}
|
|
2162
2168
|
),
|
|
2163
2169
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: defaultToken }),
|
|
2164
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2170
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2165
2171
|
] })
|
|
2166
2172
|
] })
|
|
2167
2173
|
] }),
|
|
@@ -2176,7 +2182,7 @@ function DepositAddressSkeleton({
|
|
|
2176
2182
|
] }),
|
|
2177
2183
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-actions", "aria-hidden": "true", children: [
|
|
2178
2184
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "button", { type: "button", className: "rs-deposit-address-copy", disabled: true, children: [
|
|
2179
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2185
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CopyIcon, {}),
|
|
2180
2186
|
"Copy address"
|
|
2181
2187
|
] }),
|
|
2182
2188
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2193,7 +2199,7 @@ function DepositAddressSkeleton({
|
|
|
2193
2199
|
}
|
|
2194
2200
|
)
|
|
2195
2201
|
] }),
|
|
2196
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2202
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.PoweredBy, {})
|
|
2197
2203
|
] });
|
|
2198
2204
|
}
|
|
2199
2205
|
DepositAddressSkeleton.displayName = "DepositAddressSkeleton";
|
|
@@ -2205,9 +2211,9 @@ var INITIAL_POLL_INTERVAL = 3e3;
|
|
|
2205
2211
|
var MAX_POLL_INTERVAL = 3e4;
|
|
2206
2212
|
var BACKOFF_MULTIPLIER = 1.5;
|
|
2207
2213
|
function isEventForTx(event, txHash) {
|
|
2208
|
-
const eventTxHash =
|
|
2214
|
+
const eventTxHash = _chunk7ICSHJFEcjs.getEventTxHash.call(void 0, event);
|
|
2209
2215
|
if (!eventTxHash) return false;
|
|
2210
|
-
return
|
|
2216
|
+
return _chunk7ICSHJFEcjs.txRefsMatch.call(void 0, eventTxHash, txHash);
|
|
2211
2217
|
}
|
|
2212
2218
|
function truncateHash(hash) {
|
|
2213
2219
|
return `${hash.slice(0, 4)}\u2026${hash.slice(-4)}`;
|
|
@@ -2257,7 +2263,7 @@ function formatBridgeFailedMessage(event) {
|
|
|
2257
2263
|
}
|
|
2258
2264
|
return "Bridge failed";
|
|
2259
2265
|
}
|
|
2260
|
-
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2266
|
+
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.ExternalLinkIcon, { className: "rs-deposit-notification-link-icon" });
|
|
2261
2267
|
function DepositNotification({
|
|
2262
2268
|
deposit,
|
|
2263
2269
|
smartAccount,
|
|
@@ -2290,8 +2296,8 @@ function DepositNotification({
|
|
|
2290
2296
|
);
|
|
2291
2297
|
const pollIntervalRef = _react.useRef.call(void 0, INITIAL_POLL_INTERVAL);
|
|
2292
2298
|
const pollTimeoutRef = _react.useRef.call(void 0, null);
|
|
2293
|
-
const completedRef = _react.useRef.call(void 0,
|
|
2294
|
-
const depositContextRef =
|
|
2299
|
+
const completedRef = _react.useRef.call(void 0, false);
|
|
2300
|
+
const depositContextRef = _chunkV2OBGLJDcjs.useLatestRef.call(void 0, {
|
|
2295
2301
|
amount,
|
|
2296
2302
|
sourceChain,
|
|
2297
2303
|
sourceToken: token,
|
|
@@ -2299,8 +2305,8 @@ function DepositNotification({
|
|
|
2299
2305
|
targetChain,
|
|
2300
2306
|
targetToken
|
|
2301
2307
|
});
|
|
2302
|
-
const onCompleteRef =
|
|
2303
|
-
const onFailedRef =
|
|
2308
|
+
const onCompleteRef = _chunkV2OBGLJDcjs.useLatestRef.call(void 0, onComplete);
|
|
2309
|
+
const onFailedRef = _chunkV2OBGLJDcjs.useLatestRef.call(void 0, onFailed);
|
|
2304
2310
|
const handleComplete = _react.useCallback.call(void 0,
|
|
2305
2311
|
(destTxHash) => {
|
|
2306
2312
|
if (completedRef.current) return;
|
|
@@ -2391,12 +2397,12 @@ function DepositNotification({
|
|
|
2391
2397
|
status,
|
|
2392
2398
|
txHash
|
|
2393
2399
|
]);
|
|
2394
|
-
const explorerTxUrl =
|
|
2400
|
+
const explorerTxUrl = _chunkV2OBGLJDcjs.useExplorerTxUrl.call(void 0, );
|
|
2395
2401
|
const sourceExplorerUrl = sourceChain === "unknown" ? void 0 : explorerTxUrl(sourceChain, txHash);
|
|
2396
2402
|
const destExplorerUrl = destinationTxHash ? explorerTxUrl(_chunk4KCSH4T3cjs.targetChainToChainId.call(void 0, targetChain), destinationTxHash) : null;
|
|
2397
2403
|
const title = status === "complete" ? "Deposit completed" : status === "failed" ? "Deposit failed" : "Deposit received and processing\u2026";
|
|
2398
2404
|
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.";
|
|
2399
|
-
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,
|
|
2405
|
+
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, _chunkV2OBGLJDcjs.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, _chunkV2OBGLJDcjs.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,
|
|
2400
2406
|
"svg",
|
|
2401
2407
|
{
|
|
2402
2408
|
className: "rs-deposit-notification-spinner",
|
|
@@ -2446,7 +2452,7 @@ function DepositNotification({
|
|
|
2446
2452
|
className: "rs-deposit-notification-close",
|
|
2447
2453
|
onClick: () => onDismiss(deposit.id),
|
|
2448
2454
|
"aria-label": "Dismiss",
|
|
2449
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2455
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CloseIcon, {})
|
|
2450
2456
|
}
|
|
2451
2457
|
)
|
|
2452
2458
|
] }),
|
|
@@ -2462,7 +2468,7 @@ function DepositNotification({
|
|
|
2462
2468
|
"aria-expanded": expanded,
|
|
2463
2469
|
children: [
|
|
2464
2470
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: expanded ? "See less details" : "See more details" }),
|
|
2465
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2471
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.ChevronDownIcon, { className: "rs-deposit-notification-toggle-chevron" })
|
|
2466
2472
|
]
|
|
2467
2473
|
}
|
|
2468
2474
|
),
|
|
@@ -2513,6 +2519,30 @@ function DepositNotification({
|
|
|
2513
2519
|
);
|
|
2514
2520
|
}
|
|
2515
2521
|
|
|
2522
|
+
// src/core/deposit-source-identity.ts
|
|
2523
|
+
var SOLANA_NATIVE_MINT = "11111111111111111111111111111111";
|
|
2524
|
+
var EVM_ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
2525
|
+
function sourceChainToCaip2(chain) {
|
|
2526
|
+
if (chain === "solana") return _chunk4KCSH4T3cjs.SOLANA_MAINNET_CAIP2;
|
|
2527
|
+
if (chain === "hypercore") return _chunk4KCSH4T3cjs.HYPERCORE_SPOT_CAIP2;
|
|
2528
|
+
return _chunk4KCSH4T3cjs.toEvmCaip2.call(void 0, chain);
|
|
2529
|
+
}
|
|
2530
|
+
function findAddress(tokens, symbol) {
|
|
2531
|
+
return _optionalChain([tokens, 'optionalAccess', _88 => _88.find, 'call', _89 => _89((t) => t.symbol.toLowerCase() === symbol.toLowerCase()), 'optionalAccess', _90 => _90.address]);
|
|
2532
|
+
}
|
|
2533
|
+
function resolveSourceTokenIdentity(input) {
|
|
2534
|
+
const { chain, symbol, shortlist, catalogTokens } = input;
|
|
2535
|
+
if (!symbol) return void 0;
|
|
2536
|
+
const shortlistTokens = _optionalChain([shortlist, 'optionalAccess', _91 => _91[String(chain)]]);
|
|
2537
|
+
const raw = shortlistTokens !== void 0 ? findAddress(shortlistTokens, symbol) : chain === "hypercore" || !Array.isArray(catalogTokens) ? void 0 : findAddress(catalogTokens, symbol);
|
|
2538
|
+
if (!raw) return void 0;
|
|
2539
|
+
if (chain === "solana") {
|
|
2540
|
+
const isNative = raw.toLowerCase() === "native" || raw.toLowerCase() === EVM_ZERO_ADDRESS;
|
|
2541
|
+
return isNative ? SOLANA_NATIVE_MINT : raw;
|
|
2542
|
+
}
|
|
2543
|
+
return raw.toLowerCase();
|
|
2544
|
+
}
|
|
2545
|
+
|
|
2516
2546
|
// src/components/steps/DepositAddressStep.tsx
|
|
2517
2547
|
|
|
2518
2548
|
var QRCode = _react.lazy.call(void 0,
|
|
@@ -2564,7 +2594,7 @@ function resolveSolanaTokenMeta(token) {
|
|
|
2564
2594
|
return {};
|
|
2565
2595
|
}
|
|
2566
2596
|
function getDepositEventDetails(event) {
|
|
2567
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
2597
|
+
if (!_optionalChain([event, 'optionalAccess', _92 => _92.type]) || !isRecord(event.data)) return {};
|
|
2568
2598
|
if (event.type === "deposit-received") {
|
|
2569
2599
|
const chainId = asChainId(event.data.chain);
|
|
2570
2600
|
const token = asString(event.data.token);
|
|
@@ -2579,12 +2609,12 @@ function getDepositEventDetails(event) {
|
|
|
2579
2609
|
const source = isRecord(event.data.source) ? event.data.source : void 0;
|
|
2580
2610
|
const deposit = isRecord(event.data.deposit) ? event.data.deposit : void 0;
|
|
2581
2611
|
if (source || deposit) {
|
|
2582
|
-
const chainId = _nullishCoalesce(asChainId(_optionalChain([source, 'optionalAccess',
|
|
2583
|
-
const token = _nullishCoalesce(_nullishCoalesce(asString(_optionalChain([source, 'optionalAccess',
|
|
2612
|
+
const chainId = _nullishCoalesce(asChainId(_optionalChain([source, 'optionalAccess', _93 => _93.chain])), () => ( asChainId(_optionalChain([deposit, 'optionalAccess', _94 => _94.chain]))));
|
|
2613
|
+
const token = _nullishCoalesce(_nullishCoalesce(asString(_optionalChain([source, 'optionalAccess', _95 => _95.asset])), () => ( asString(_optionalChain([deposit, 'optionalAccess', _96 => _96.asset])))), () => ( asString(_optionalChain([deposit, 'optionalAccess', _97 => _97.token]))));
|
|
2584
2614
|
const solanaMeta = chainId === "solana" ? resolveSolanaTokenMeta(token) : {};
|
|
2585
2615
|
return {
|
|
2586
2616
|
chainId,
|
|
2587
|
-
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess',
|
|
2617
|
+
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess', _98 => _98.amount])), () => ( asAmount(_optionalChain([deposit, 'optionalAccess', _99 => _99.amount])))),
|
|
2588
2618
|
token,
|
|
2589
2619
|
...solanaMeta
|
|
2590
2620
|
};
|
|
@@ -2595,22 +2625,22 @@ function isSameRoute(sourceChain, sourceToken, targetChain, targetToken) {
|
|
|
2595
2625
|
return sourceChain === targetChain && sourceToken.toLowerCase() === targetToken.toLowerCase();
|
|
2596
2626
|
}
|
|
2597
2627
|
function chainLabel(chainId, catalogChain) {
|
|
2598
|
-
const name = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess',
|
|
2628
|
+
const name = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _100 => _100.name]), () => ( _chunk4KCSH4T3cjs.getChainName.call(void 0, chainId)));
|
|
2599
2629
|
return name.replace(/\s+(One|Mainnet|Smart Chain|Chain)$/i, "");
|
|
2600
2630
|
}
|
|
2601
2631
|
function computeTokensForChain(chainId, topTokens, catalogChain) {
|
|
2602
|
-
const fromBackend = _optionalChain([topTokens, 'optionalAccess',
|
|
2632
|
+
const fromBackend = _optionalChain([topTokens, 'optionalAccess', _101 => _101[String(chainId)], 'optionalAccess', _102 => _102.map, 'call', _103 => _103((t) => t.symbol)]);
|
|
2603
2633
|
if (fromBackend) return fromBackend;
|
|
2604
|
-
return Array.isArray(_optionalChain([catalogChain, 'optionalAccess',
|
|
2634
|
+
return Array.isArray(_optionalChain([catalogChain, 'optionalAccess', _104 => _104.supportedTokens])) ? catalogChain.supportedTokens.map((t) => t.symbol) : [];
|
|
2605
2635
|
}
|
|
2606
2636
|
function selectionAsAsset(chainId, symbol, topTokens, catalogChain) {
|
|
2607
2637
|
if (typeof chainId !== "number" || !symbol) return void 0;
|
|
2608
|
-
const fromShortlist = _optionalChain([topTokens, 'optionalAccess',
|
|
2638
|
+
const fromShortlist = _optionalChain([topTokens, 'optionalAccess', _105 => _105[String(chainId)], 'optionalAccess', _106 => _106.find, 'call', _107 => _107(
|
|
2609
2639
|
(t) => t.symbol === symbol
|
|
2610
2640
|
)]);
|
|
2611
|
-
const fromCatalog = Array.isArray(_optionalChain([catalogChain, 'optionalAccess',
|
|
2612
|
-
const address = _nullishCoalesce(_optionalChain([fromShortlist, 'optionalAccess',
|
|
2613
|
-
const decimals = _nullishCoalesce(_optionalChain([fromShortlist, 'optionalAccess',
|
|
2641
|
+
const fromCatalog = Array.isArray(_optionalChain([catalogChain, 'optionalAccess', _108 => _108.supportedTokens])) ? catalogChain.supportedTokens.find((t) => t.symbol === symbol) : void 0;
|
|
2642
|
+
const address = _nullishCoalesce(_optionalChain([fromShortlist, 'optionalAccess', _109 => _109.address]), () => ( _optionalChain([fromCatalog, 'optionalAccess', _110 => _110.address])));
|
|
2643
|
+
const decimals = _nullishCoalesce(_optionalChain([fromShortlist, 'optionalAccess', _111 => _111.decimals]), () => ( _optionalChain([fromCatalog, 'optionalAccess', _112 => _112.decimals])));
|
|
2614
2644
|
if (!address || decimals === void 0) return void 0;
|
|
2615
2645
|
return {
|
|
2616
2646
|
id: `qr-${chainId}-${symbol}`,
|
|
@@ -2623,7 +2653,7 @@ function selectionAsAsset(chainId, symbol, topTokens, catalogChain) {
|
|
|
2623
2653
|
}
|
|
2624
2654
|
function TokenGlyph({ symbol }) {
|
|
2625
2655
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2626
|
-
|
|
2656
|
+
_chunkV2OBGLJDcjs.TokenIcon,
|
|
2627
2657
|
{
|
|
2628
2658
|
symbol,
|
|
2629
2659
|
className: "rs-deposit-address-dropdown-icon",
|
|
@@ -2647,18 +2677,22 @@ function DepositAddressStep({
|
|
|
2647
2677
|
onDepositSubmitted,
|
|
2648
2678
|
onDepositComplete,
|
|
2649
2679
|
onDepositFailed,
|
|
2680
|
+
onAddressShown,
|
|
2650
2681
|
onCopyAddress,
|
|
2651
2682
|
onReviewDeposit,
|
|
2652
2683
|
onError
|
|
2653
2684
|
}) {
|
|
2654
2685
|
const hasSolana = Boolean(solanaDepositAddress);
|
|
2655
2686
|
const [topTokens, setTopTokens] = _react.useState.call(void 0, null);
|
|
2687
|
+
const [topTokensSettled, setTopTokensSettled] = _react.useState.call(void 0, false);
|
|
2656
2688
|
_react.useEffect.call(void 0, () => {
|
|
2657
2689
|
let active = true;
|
|
2658
2690
|
setTopTokens(null);
|
|
2691
|
+
setTopTokensSettled(false);
|
|
2659
2692
|
service.getTopTokens().then((t) => {
|
|
2660
2693
|
if (!active) return;
|
|
2661
2694
|
setTopTokens(t);
|
|
2695
|
+
setTopTokensSettled(true);
|
|
2662
2696
|
if (t) _chunk4KCSH4T3cjs.publishShortlistTokens.call(void 0, t);
|
|
2663
2697
|
});
|
|
2664
2698
|
return () => {
|
|
@@ -2666,38 +2700,38 @@ function DepositAddressStep({
|
|
|
2666
2700
|
};
|
|
2667
2701
|
}, [service]);
|
|
2668
2702
|
const BASE_CHAIN_ID2 = 8453;
|
|
2669
|
-
const evmChainIds =
|
|
2670
|
-
const { catalog, isLoading: catalogLoading } =
|
|
2703
|
+
const evmChainIds = _chunkV2OBGLJDcjs.useDepositChainIds.call(void 0, );
|
|
2704
|
+
const { catalog, isLoading: catalogLoading } = _chunkV2OBGLJDcjs.useChainCatalog.call(void 0, );
|
|
2671
2705
|
const catalogFor = _react.useCallback.call(void 0,
|
|
2672
2706
|
(chain) => {
|
|
2673
2707
|
if (!catalog) return void 0;
|
|
2674
|
-
const key =
|
|
2708
|
+
const key = _chunkV2OBGLJDcjs.catalogKeyForChain.call(void 0, chain);
|
|
2675
2709
|
return typeof key === "number" ? catalog.byChainId.get(key) : catalog.byCaip2.get(key);
|
|
2676
2710
|
},
|
|
2677
2711
|
[catalog]
|
|
2678
2712
|
);
|
|
2679
2713
|
const chainOptions = _react.useMemo.call(void 0, () => {
|
|
2680
|
-
const acceptsDeposits = (chain) => _optionalChain([catalogFor, 'call',
|
|
2714
|
+
const acceptsDeposits = (chain) => _optionalChain([catalogFor, 'call', _113 => _113(chain), 'optionalAccess', _114 => _114.deposit]) !== false;
|
|
2681
2715
|
const options = [...evmChainIds];
|
|
2682
2716
|
const extras = [];
|
|
2683
2717
|
if (hasSolana && acceptsDeposits("solana")) extras.push("solana");
|
|
2684
2718
|
if (acceptsDeposits("hypercore")) extras.push("hypercore");
|
|
2685
2719
|
options.splice(1, 0, ...extras);
|
|
2686
2720
|
return options.filter(
|
|
2687
|
-
(chain) => _optionalChain([topTokens, 'optionalAccess',
|
|
2721
|
+
(chain) => _optionalChain([topTokens, 'optionalAccess', _115 => _115[String(chain)], 'optionalAccess', _116 => _116.length]) !== 0 && computeTokensForChain(chain, topTokens, catalogFor(chain)).length > 0
|
|
2688
2722
|
);
|
|
2689
2723
|
}, [evmChainIds, hasSolana, topTokens, catalogFor]);
|
|
2690
2724
|
const preferredChainId = (options) => options.includes(BASE_CHAIN_ID2) ? BASE_CHAIN_ID2 : _nullishCoalesce(options[0], () => ( BASE_CHAIN_ID2));
|
|
2691
|
-
const [sourceChainId, setSourceChainId] = _react.useState.call(void 0, () => _nullishCoalesce(_optionalChain([initialSource, 'optionalAccess',
|
|
2725
|
+
const [sourceChainId, setSourceChainId] = _react.useState.call(void 0, () => _nullishCoalesce(_optionalChain([initialSource, 'optionalAccess', _117 => _117.chainId]), () => ( preferredChainId(chainOptions))));
|
|
2692
2726
|
const chainChosenByUser = _react.useRef.call(void 0, initialSource !== void 0);
|
|
2693
|
-
const pendingChainRef = _react.useRef.call(void 0, _optionalChain([initialSource, 'optionalAccess',
|
|
2727
|
+
const pendingChainRef = _react.useRef.call(void 0, _optionalChain([initialSource, 'optionalAccess', _118 => _118.chainId]));
|
|
2694
2728
|
_react.useEffect.call(void 0, () => {
|
|
2695
2729
|
if (chainOptions.length === 0) return;
|
|
2696
|
-
const
|
|
2697
|
-
if (
|
|
2698
|
-
if (chainOptions.includes(
|
|
2730
|
+
const pendingChain2 = pendingChainRef.current;
|
|
2731
|
+
if (pendingChain2 !== void 0) {
|
|
2732
|
+
if (chainOptions.includes(pendingChain2)) {
|
|
2699
2733
|
pendingChainRef.current = void 0;
|
|
2700
|
-
setSourceChainId(
|
|
2734
|
+
setSourceChainId(pendingChain2);
|
|
2701
2735
|
return;
|
|
2702
2736
|
}
|
|
2703
2737
|
if (catalogLoading || topTokens === null) return;
|
|
@@ -2714,10 +2748,10 @@ function DepositAddressStep({
|
|
|
2714
2748
|
);
|
|
2715
2749
|
const defaultToken = pickFallbackToken(
|
|
2716
2750
|
tokensForChain,
|
|
2717
|
-
_nullishCoalesce(_optionalChain([initialSource, 'optionalAccess',
|
|
2751
|
+
_nullishCoalesce(_optionalChain([initialSource, 'optionalAccess', _119 => _119.symbol]), () => ( "USDC"))
|
|
2718
2752
|
);
|
|
2719
2753
|
const [sourceTokenSymbol, setSourceTokenSymbol] = _react.useState.call(void 0, defaultToken);
|
|
2720
|
-
const pendingTokenRef = _react.useRef.call(void 0, _optionalChain([initialSource, 'optionalAccess',
|
|
2754
|
+
const pendingTokenRef = _react.useRef.call(void 0, _optionalChain([initialSource, 'optionalAccess', _120 => _120.symbol]));
|
|
2721
2755
|
_react.useEffect.call(void 0, () => {
|
|
2722
2756
|
if (tokensForChain.includes(sourceTokenSymbol)) {
|
|
2723
2757
|
pendingTokenRef.current = void 0;
|
|
@@ -2744,13 +2778,39 @@ function DepositAddressStep({
|
|
|
2744
2778
|
const baselineTxHashRef = _react.useRef.call(void 0, void 0);
|
|
2745
2779
|
const notificationIdRef = _react.useRef.call(void 0, 0);
|
|
2746
2780
|
const displayAddress = isSolana && solanaDepositAddress ? solanaDepositAddress : smartAccount;
|
|
2781
|
+
const sourceTokenIdentity = _react.useMemo.call(void 0,
|
|
2782
|
+
() => resolveSourceTokenIdentity({
|
|
2783
|
+
chain: sourceChainId,
|
|
2784
|
+
symbol: sourceTokenSymbol,
|
|
2785
|
+
shortlist: topTokens,
|
|
2786
|
+
catalogTokens: _optionalChain([catalogFor, 'call', _121 => _121(sourceChainId), 'optionalAccess', _122 => _122.supportedTokens])
|
|
2787
|
+
}),
|
|
2788
|
+
[sourceChainId, sourceTokenSymbol, topTokens, catalogFor]
|
|
2789
|
+
);
|
|
2790
|
+
const pendingChain = pendingChainRef.current;
|
|
2791
|
+
const sourceSelectionSettled = !catalogLoading && topTokensSettled && chainOptions.length > 0 && (pendingChain === void 0 || pendingChain === sourceChainId) && (chainChosenByUser.current ? chainOptions.includes(sourceChainId) : sourceChainId === preferredChainId(chainOptions));
|
|
2792
|
+
_react.useEffect.call(void 0, () => {
|
|
2793
|
+
if (!sourceTokenIdentity) return;
|
|
2794
|
+
if (!sourceSelectionSettled) return;
|
|
2795
|
+
_optionalChain([onAddressShown, 'optionalCall', _123 => _123({
|
|
2796
|
+
address: displayAddress,
|
|
2797
|
+
sourceChainCaip2: sourceChainToCaip2(sourceChainId),
|
|
2798
|
+
sourceTokenIdentity
|
|
2799
|
+
})]);
|
|
2800
|
+
}, [
|
|
2801
|
+
displayAddress,
|
|
2802
|
+
onAddressShown,
|
|
2803
|
+
sourceChainId,
|
|
2804
|
+
sourceTokenIdentity,
|
|
2805
|
+
sourceSelectionSettled
|
|
2806
|
+
]);
|
|
2747
2807
|
_react.useEffect.call(void 0, () => {
|
|
2748
2808
|
if (!chainDropdownOpen && !tokenDropdownOpen) return;
|
|
2749
2809
|
function handlePointerDown(event) {
|
|
2750
2810
|
const target = event.target;
|
|
2751
2811
|
if (!target) return;
|
|
2752
|
-
const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access',
|
|
2753
|
-
const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access',
|
|
2812
|
+
const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access', _124 => _124.current, 'optionalAccess', _125 => _125.contains, 'call', _126 => _126(target)]);
|
|
2813
|
+
const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access', _127 => _127.current, 'optionalAccess', _128 => _128.contains, 'call', _129 => _129(target)]);
|
|
2754
2814
|
if (clickedChainDropdown || clickedTokenDropdown) return;
|
|
2755
2815
|
setChainDropdownOpen(false);
|
|
2756
2816
|
setTokenDropdownOpen(false);
|
|
@@ -2763,10 +2823,10 @@ function DepositAddressStep({
|
|
|
2763
2823
|
};
|
|
2764
2824
|
}, [chainDropdownOpen, tokenDropdownOpen]);
|
|
2765
2825
|
const handleCopy = _react.useCallback.call(void 0, async () => {
|
|
2766
|
-
_optionalChain([onCopyAddress, 'optionalCall', _123 => _123()]);
|
|
2767
2826
|
try {
|
|
2768
2827
|
await navigator.clipboard.writeText(displayAddress);
|
|
2769
2828
|
setCopied(true);
|
|
2829
|
+
_optionalChain([onCopyAddress, 'optionalCall', _130 => _130(true)]);
|
|
2770
2830
|
setTimeout(() => setCopied(false), 2e3);
|
|
2771
2831
|
} catch (e17) {
|
|
2772
2832
|
const textarea = document.createElement("textarea");
|
|
@@ -2775,10 +2835,13 @@ function DepositAddressStep({
|
|
|
2775
2835
|
textarea.style.opacity = "0";
|
|
2776
2836
|
document.body.appendChild(textarea);
|
|
2777
2837
|
textarea.select();
|
|
2778
|
-
document.execCommand("copy");
|
|
2838
|
+
const copiedWithFallback = document.execCommand("copy");
|
|
2779
2839
|
document.body.removeChild(textarea);
|
|
2780
|
-
|
|
2781
|
-
|
|
2840
|
+
if (copiedWithFallback) {
|
|
2841
|
+
setCopied(true);
|
|
2842
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
2843
|
+
}
|
|
2844
|
+
_optionalChain([onCopyAddress, 'optionalCall', _131 => _131(copiedWithFallback)]);
|
|
2782
2845
|
}
|
|
2783
2846
|
}, [displayAddress, onCopyAddress]);
|
|
2784
2847
|
const handleSelectChain = _react.useCallback.call(void 0,
|
|
@@ -2847,10 +2910,10 @@ function DepositAddressStep({
|
|
|
2847
2910
|
return;
|
|
2848
2911
|
}
|
|
2849
2912
|
const event = status.lastEvent;
|
|
2850
|
-
const eventTxHash =
|
|
2913
|
+
const eventTxHash = _chunk7ICSHJFEcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunk7ICSHJFEcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
2851
2914
|
if (baselineTxHashRef.current === void 0) {
|
|
2852
2915
|
baselineTxHashRef.current = eventTxHash;
|
|
2853
|
-
} else if (eventTxHash && (!baselineTxHashRef.current || !
|
|
2916
|
+
} else if (eventTxHash && (!baselineTxHashRef.current || !_chunk7ICSHJFEcjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
|
|
2854
2917
|
const details = getDepositEventDetails(event);
|
|
2855
2918
|
const chainId = _nullishCoalesce(details.chainId, () => ( "unknown"));
|
|
2856
2919
|
const amount = _nullishCoalesce(details.amount, () => ( "0"));
|
|
@@ -2882,7 +2945,7 @@ function DepositAddressStep({
|
|
|
2882
2945
|
directTransfer
|
|
2883
2946
|
};
|
|
2884
2947
|
setNotifications((prev) => [notification, ...prev]);
|
|
2885
|
-
_optionalChain([onDepositSubmittedRef, 'access',
|
|
2948
|
+
_optionalChain([onDepositSubmittedRef, 'access', _132 => _132.current, 'optionalCall', _133 => _133({
|
|
2886
2949
|
txHash: eventTxHash,
|
|
2887
2950
|
sourceChain: chainId,
|
|
2888
2951
|
amount,
|
|
@@ -2894,7 +2957,7 @@ function DepositAddressStep({
|
|
|
2894
2957
|
if (!cancelled) {
|
|
2895
2958
|
const msg = err instanceof Error ? err.message : "Failed to check status";
|
|
2896
2959
|
setPollingError(msg);
|
|
2897
|
-
_optionalChain([onErrorRef, 'access',
|
|
2960
|
+
_optionalChain([onErrorRef, 'access', _134 => _134.current, 'optionalCall', _135 => _135(msg, "STATUS_POLL_ERROR")]);
|
|
2898
2961
|
}
|
|
2899
2962
|
}
|
|
2900
2963
|
if (!cancelled) {
|
|
@@ -2910,21 +2973,21 @@ function DepositAddressStep({
|
|
|
2910
2973
|
const handleNotificationComplete = _react.useCallback.call(void 0,
|
|
2911
2974
|
(txHash, destinationTxHash, context) => {
|
|
2912
2975
|
isTrackingRef.current = false;
|
|
2913
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
2976
|
+
_optionalChain([onDepositCompleteRef, 'access', _136 => _136.current, 'optionalCall', _137 => _137(txHash, destinationTxHash, context)]);
|
|
2914
2977
|
},
|
|
2915
2978
|
[]
|
|
2916
2979
|
);
|
|
2917
2980
|
const handleNotificationFailed = _react.useCallback.call(void 0,
|
|
2918
2981
|
(txHash, error) => {
|
|
2919
2982
|
isTrackingRef.current = false;
|
|
2920
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
2983
|
+
_optionalChain([onDepositFailedRef, 'access', _138 => _138.current, 'optionalCall', _139 => _139(txHash, error)]);
|
|
2921
2984
|
},
|
|
2922
2985
|
[]
|
|
2923
2986
|
);
|
|
2924
2987
|
const handleNotificationDismiss = _react.useCallback.call(void 0, (id) => {
|
|
2925
2988
|
setNotifications((prev) => prev.filter((n) => n.id !== id));
|
|
2926
2989
|
}, []);
|
|
2927
|
-
const qrIconSrc = _nullishCoalesce(_optionalChain([catalogFor, 'call',
|
|
2990
|
+
const qrIconSrc = _nullishCoalesce(_optionalChain([catalogFor, 'call', _140 => _140(sourceChainId), 'optionalAccess', _141 => _141.iconUrl]), () => ( _chunk4KCSH4T3cjs.getChainIcon.call(void 0, sourceChainId)));
|
|
2928
2991
|
const reviewAsset = selectionAsAsset(
|
|
2929
2992
|
sourceChainId,
|
|
2930
2993
|
sourceTokenSymbol,
|
|
@@ -2934,13 +2997,13 @@ function DepositAddressStep({
|
|
|
2934
2997
|
if (chainOptions.length === 0) {
|
|
2935
2998
|
if (catalogLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositAddressSkeleton, { uiConfig });
|
|
2936
2999
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-screen", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
2937
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2938
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3000
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
3001
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.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." })
|
|
2939
3002
|
] }) });
|
|
2940
3003
|
}
|
|
2941
3004
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-step--with-notifications", children: [
|
|
2942
3005
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
2943
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3006
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
2944
3007
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", children: [
|
|
2945
3008
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", ref: chainDropdownRef, children: [
|
|
2946
3009
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
@@ -2956,14 +3019,14 @@ function DepositAddressStep({
|
|
|
2956
3019
|
},
|
|
2957
3020
|
children: [
|
|
2958
3021
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2959
|
-
|
|
3022
|
+
_chunkV2OBGLJDcjs.CdnIcon,
|
|
2960
3023
|
{
|
|
2961
|
-
src: _nullishCoalesce(_optionalChain([catalogFor, 'call',
|
|
3024
|
+
src: _nullishCoalesce(_optionalChain([catalogFor, 'call', _142 => _142(sourceChainId), 'optionalAccess', _143 => _143.iconUrl]), () => ( _chunk4KCSH4T3cjs.getChainIcon.call(void 0, sourceChainId))),
|
|
2962
3025
|
className: "rs-deposit-address-dropdown-icon"
|
|
2963
3026
|
}
|
|
2964
3027
|
),
|
|
2965
3028
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainLabel(sourceChainId, catalogFor(sourceChainId)) }),
|
|
2966
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3029
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2967
3030
|
]
|
|
2968
3031
|
}
|
|
2969
3032
|
),
|
|
@@ -2975,9 +3038,9 @@ function DepositAddressStep({
|
|
|
2975
3038
|
onClick: () => handleSelectChain(chainId),
|
|
2976
3039
|
children: [
|
|
2977
3040
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2978
|
-
|
|
3041
|
+
_chunkV2OBGLJDcjs.CdnIcon,
|
|
2979
3042
|
{
|
|
2980
|
-
src: _nullishCoalesce(_optionalChain([catalogFor, 'call',
|
|
3043
|
+
src: _nullishCoalesce(_optionalChain([catalogFor, 'call', _144 => _144(chainId), 'optionalAccess', _145 => _145.iconUrl]), () => ( _chunk4KCSH4T3cjs.getChainIcon.call(void 0, chainId))),
|
|
2981
3044
|
className: "rs-deposit-address-dropdown-icon"
|
|
2982
3045
|
}
|
|
2983
3046
|
),
|
|
@@ -2992,9 +3055,9 @@ function DepositAddressStep({
|
|
|
2992
3055
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Supported token" }),
|
|
2993
3056
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
2994
3057
|
"Min.$",
|
|
2995
|
-
(_chunk4KCSH4T3cjs.isHyperCoreDestination.call(void 0, targetChain) || isHyperCore ? Math.max(_chunk4KCSH4T3cjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
2996
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2997
|
-
|
|
3058
|
+
(_chunk4KCSH4T3cjs.isHyperCoreDestination.call(void 0, targetChain) || isHyperCore ? Math.max(_chunk4KCSH4T3cjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _146 => _146.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _147 => _147.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
3059
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7ICSHJFEcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3060
|
+
_chunkV2OBGLJDcjs.InfoIcon,
|
|
2998
3061
|
{
|
|
2999
3062
|
className: "rs-deposit-address-min-icon",
|
|
3000
3063
|
"aria-hidden": "true"
|
|
@@ -3015,7 +3078,7 @@ function DepositAddressStep({
|
|
|
3015
3078
|
children: [
|
|
3016
3079
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenGlyph, { symbol: sourceTokenSymbol }),
|
|
3017
3080
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceTokenSymbol }),
|
|
3018
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3081
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
3019
3082
|
]
|
|
3020
3083
|
}
|
|
3021
3084
|
),
|
|
@@ -3060,7 +3123,7 @@ function DepositAddressStep({
|
|
|
3060
3123
|
className: "rs-deposit-address-copy",
|
|
3061
3124
|
onClick: handleCopy,
|
|
3062
3125
|
children: [
|
|
3063
|
-
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3126
|
+
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CopyIcon, {}),
|
|
3064
3127
|
copied ? "Copied!" : "Copy address"
|
|
3065
3128
|
]
|
|
3066
3129
|
}
|
|
@@ -3095,7 +3158,7 @@ function DepositAddressStep({
|
|
|
3095
3158
|
},
|
|
3096
3159
|
deposit.id
|
|
3097
3160
|
)) }),
|
|
3098
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3161
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.PoweredBy, {})
|
|
3099
3162
|
] });
|
|
3100
3163
|
}
|
|
3101
3164
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -3152,7 +3215,7 @@ function FinalisingDepositStep() {
|
|
|
3152
3215
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "rs-finalising-subtitle", children: "We are depositing your funds to the application." })
|
|
3153
3216
|
] })
|
|
3154
3217
|
] }),
|
|
3155
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3218
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.PoweredBy, {})
|
|
3156
3219
|
] });
|
|
3157
3220
|
}
|
|
3158
3221
|
FinalisingDepositStep.displayName = "FinalisingDepositStep";
|
|
@@ -3182,7 +3245,7 @@ function SwappedOrderTracker({
|
|
|
3182
3245
|
];
|
|
3183
3246
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-swapped-tracker", children: [
|
|
3184
3247
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3185
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3248
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.HandCoinsIcon, {}), title }),
|
|
3186
3249
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ol", { className: "rs-swapped-tracker-steps", children: labels.map((label, idx) => {
|
|
3187
3250
|
const status = stepStates[idx];
|
|
3188
3251
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
@@ -3196,7 +3259,7 @@ function SwappedOrderTracker({
|
|
|
3196
3259
|
{
|
|
3197
3260
|
className: "rs-swapped-tracker-step-marker",
|
|
3198
3261
|
"aria-hidden": "true",
|
|
3199
|
-
children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3262
|
+
children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CheckIcon, {}) : status === "failed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CloseIcon, {}) : status === "active" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.Spinner, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3200
3263
|
"svg",
|
|
3201
3264
|
{
|
|
3202
3265
|
className: "rs-swapped-tracker-step-ring",
|
|
@@ -3231,7 +3294,7 @@ function SwappedOrderTracker({
|
|
|
3231
3294
|
}
|
|
3232
3295
|
)
|
|
3233
3296
|
] }),
|
|
3234
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3297
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.PoweredBy, {})
|
|
3235
3298
|
] });
|
|
3236
3299
|
}
|
|
3237
3300
|
function formatTrackerAmount(amount) {
|
|
@@ -3329,6 +3392,10 @@ function SwappedProviderStep({
|
|
|
3329
3392
|
onClose,
|
|
3330
3393
|
onGoBack,
|
|
3331
3394
|
onError,
|
|
3395
|
+
onAttemptConsumed,
|
|
3396
|
+
onProviderHandoff,
|
|
3397
|
+
onRetry,
|
|
3398
|
+
onCancelled,
|
|
3332
3399
|
onImmersiveChange,
|
|
3333
3400
|
openExternally
|
|
3334
3401
|
}) {
|
|
@@ -3344,6 +3411,7 @@ function SwappedProviderStep({
|
|
|
3344
3411
|
const [opening, setOpening] = _react.useState.call(void 0, false);
|
|
3345
3412
|
const iframeRef = _react.useRef.call(void 0, null);
|
|
3346
3413
|
const openedUrlRef = _react.useRef.call(void 0, null);
|
|
3414
|
+
const assignedIframeUrlRef = _react.useRef.call(void 0, null);
|
|
3347
3415
|
const completeFiredRef = _react.useRef.call(void 0, false);
|
|
3348
3416
|
const failedFiredRef = _react.useRef.call(void 0, false);
|
|
3349
3417
|
const completeTimeoutRef = _react.useRef.call(void 0, null);
|
|
@@ -3364,6 +3432,8 @@ function SwappedProviderStep({
|
|
|
3364
3432
|
onSwappedFailedRef.current = onSwappedFailed;
|
|
3365
3433
|
const onErrorRef = _react.useRef.call(void 0, onError);
|
|
3366
3434
|
onErrorRef.current = onError;
|
|
3435
|
+
const onProviderHandoffRef = _react.useRef.call(void 0, onProviderHandoff);
|
|
3436
|
+
onProviderHandoffRef.current = onProviderHandoff;
|
|
3367
3437
|
const onGoBackRef = _react.useRef.call(void 0, onGoBack);
|
|
3368
3438
|
onGoBackRef.current = onGoBack;
|
|
3369
3439
|
const onImmersiveChangeRef = _react.useRef.call(void 0, onImmersiveChange);
|
|
@@ -3382,6 +3452,7 @@ function SwappedProviderStep({
|
|
|
3382
3452
|
setHandoffOpened(false);
|
|
3383
3453
|
setOpening(false);
|
|
3384
3454
|
openedUrlRef.current = null;
|
|
3455
|
+
assignedIframeUrlRef.current = null;
|
|
3385
3456
|
if (completeTimeoutRef.current !== null) {
|
|
3386
3457
|
clearTimeout(completeTimeoutRef.current);
|
|
3387
3458
|
completeTimeoutRef.current = null;
|
|
@@ -3397,18 +3468,19 @@ function SwappedProviderStep({
|
|
|
3397
3468
|
if (cancelled) return;
|
|
3398
3469
|
if (!isTrustedSwappedWidgetUrl(res.url)) {
|
|
3399
3470
|
setLoadError(loadErrorFallback);
|
|
3400
|
-
_optionalChain([onErrorRef, 'access',
|
|
3471
|
+
_optionalChain([onErrorRef, 'access', _148 => _148.current, 'optionalCall', _149 => _149(loadErrorFallback, loadErrorCode)]);
|
|
3401
3472
|
return;
|
|
3402
3473
|
}
|
|
3403
3474
|
setWidgetUrl(res.url);
|
|
3404
3475
|
expectedExternalCustomerIdRef.current = res.externalCustomerId;
|
|
3476
|
+
_optionalChain([onAttemptConsumed, 'optionalCall', _150 => _150(res.externalCustomerId)]);
|
|
3405
3477
|
const sep = res.externalCustomerId.indexOf(":");
|
|
3406
3478
|
expectedOrderUuidRef.current = sep >= 0 ? res.externalCustomerId.slice(sep + 1) : null;
|
|
3407
3479
|
}).catch((err) => {
|
|
3408
3480
|
if (cancelled) return;
|
|
3409
3481
|
const message = err instanceof Error ? err.message : loadErrorFallback;
|
|
3410
3482
|
setLoadError(message);
|
|
3411
|
-
_optionalChain([onErrorRef, 'access',
|
|
3483
|
+
_optionalChain([onErrorRef, 'access', _151 => _151.current, 'optionalCall', _152 => _152(message, loadErrorCode)]);
|
|
3412
3484
|
});
|
|
3413
3485
|
return () => {
|
|
3414
3486
|
cancelled = true;
|
|
@@ -3421,13 +3493,20 @@ function SwappedProviderStep({
|
|
|
3421
3493
|
_react.useEffect.call(void 0, () => {
|
|
3422
3494
|
if (openExternally || !widgetUrl || iframeLoaded || loadError) return;
|
|
3423
3495
|
const timer = setTimeout(() => {
|
|
3424
|
-
|
|
3496
|
+
const message = "Iframe took too long to load.";
|
|
3497
|
+
setLoadError(message);
|
|
3498
|
+
_optionalChain([onErrorRef, 'access', _153 => _153.current, 'optionalCall', _154 => _154(message, "SWAPPED_IFRAME_TIMEOUT")]);
|
|
3425
3499
|
}, IFRAME_LOAD_TIMEOUT_MS);
|
|
3426
3500
|
return () => clearTimeout(timer);
|
|
3427
3501
|
}, [openExternally, widgetUrl, iframeLoaded, loadError]);
|
|
3428
3502
|
_react.useEffect.call(void 0, () => {
|
|
3429
3503
|
if (openExternally) return;
|
|
3430
|
-
|
|
3504
|
+
const nextSrc = widgetUrl && !loadError ? widgetUrl : null;
|
|
3505
|
+
setIframeSrc(nextSrc);
|
|
3506
|
+
if (nextSrc && assignedIframeUrlRef.current !== nextSrc) {
|
|
3507
|
+
assignedIframeUrlRef.current = nextSrc;
|
|
3508
|
+
_optionalChain([onProviderHandoffRef, 'access', _155 => _155.current, 'optionalCall', _156 => _156()]);
|
|
3509
|
+
}
|
|
3431
3510
|
}, [openExternally, widgetUrl, loadError, retryToken]);
|
|
3432
3511
|
const openPaymentPage = async (url) => {
|
|
3433
3512
|
if (!openExternally) return;
|
|
@@ -3436,10 +3515,11 @@ function SwappedProviderStep({
|
|
|
3436
3515
|
try {
|
|
3437
3516
|
await openExternally(url);
|
|
3438
3517
|
setHandoffOpened(true);
|
|
3518
|
+
_optionalChain([onProviderHandoff, 'optionalCall', _157 => _157()]);
|
|
3439
3519
|
} catch (error) {
|
|
3440
3520
|
openedUrlRef.current = null;
|
|
3441
3521
|
setLoadError(OPEN_FAILED_MESSAGE);
|
|
3442
|
-
_optionalChain([onErrorRef, 'access',
|
|
3522
|
+
_optionalChain([onErrorRef, 'access', _158 => _158.current, 'optionalCall', _159 => _159(
|
|
3443
3523
|
error instanceof Error && error.message ? error.message : OPEN_FAILED_MESSAGE,
|
|
3444
3524
|
OPEN_FAILED_CODE
|
|
3445
3525
|
)]);
|
|
@@ -3487,8 +3567,8 @@ function SwappedProviderStep({
|
|
|
3487
3567
|
const doc = globalThis.document;
|
|
3488
3568
|
const onVisible = () => {
|
|
3489
3569
|
if (doc.visibilityState !== "visible") return;
|
|
3490
|
-
_optionalChain([rescheduleStatusPollRef, 'access',
|
|
3491
|
-
_optionalChain([rescheduleDepositPollRef, 'access',
|
|
3570
|
+
_optionalChain([rescheduleStatusPollRef, 'access', _160 => _160.current, 'optionalCall', _161 => _161(0)]);
|
|
3571
|
+
_optionalChain([rescheduleDepositPollRef, 'access', _162 => _162.current, 'optionalCall', _163 => _163(0)]);
|
|
3492
3572
|
};
|
|
3493
3573
|
doc.addEventListener("visibilitychange", onVisible);
|
|
3494
3574
|
return () => doc.removeEventListener("visibilitychange", onVisible);
|
|
@@ -3502,10 +3582,10 @@ function SwappedProviderStep({
|
|
|
3502
3582
|
const status = await service.fetchLatestStatus(smartAccount);
|
|
3503
3583
|
if (cancelled) return;
|
|
3504
3584
|
const event = status.lastEvent;
|
|
3505
|
-
const eventTxHash =
|
|
3585
|
+
const eventTxHash = _chunk7ICSHJFEcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunk7ICSHJFEcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
3506
3586
|
if (baselineDepositTxHashRef.current === void 0) {
|
|
3507
3587
|
baselineDepositTxHashRef.current = eventTxHash;
|
|
3508
|
-
} else if (eventTxHash && (!baselineDepositTxHashRef.current || !
|
|
3588
|
+
} else if (eventTxHash && (!baselineDepositTxHashRef.current || !_chunk7ICSHJFEcjs.txRefsMatch.call(void 0, eventTxHash, baselineDepositTxHashRef.current))) {
|
|
3509
3589
|
currentDepositTxHashRef.current = eventTxHash;
|
|
3510
3590
|
setLatestEvent(_nullishCoalesce(event, () => ( null)));
|
|
3511
3591
|
}
|
|
@@ -3530,16 +3610,16 @@ function SwappedProviderStep({
|
|
|
3530
3610
|
}, [service, smartAccount]);
|
|
3531
3611
|
_react.useEffect.call(void 0, () => {
|
|
3532
3612
|
if (fastDepositPollEnabledRef.current) return;
|
|
3533
|
-
const status = _optionalChain([orderState, 'optionalAccess',
|
|
3613
|
+
const status = _optionalChain([orderState, 'optionalAccess', _164 => _164.status]);
|
|
3534
3614
|
if (!status || !SWAPPED_TERMINAL_STATUSES.has(status)) return;
|
|
3535
3615
|
fastDepositPollEnabledRef.current = true;
|
|
3536
|
-
_optionalChain([rescheduleDepositPollRef, 'access',
|
|
3616
|
+
_optionalChain([rescheduleDepositPollRef, 'access', _165 => _165.current, 'optionalCall', _166 => _166(DEPOSIT_POLL_FAST_INITIAL_DELAY_MS)]);
|
|
3537
3617
|
}, [orderState]);
|
|
3538
3618
|
_react.useEffect.call(void 0, () => {
|
|
3539
3619
|
if (openExternally) return;
|
|
3540
3620
|
function onMessage(e) {
|
|
3541
3621
|
if (!SWAPPED_IFRAME_ORIGINS.has(e.origin)) return;
|
|
3542
|
-
if (e.source !== _optionalChain([iframeRef, 'access',
|
|
3622
|
+
if (e.source !== _optionalChain([iframeRef, 'access', _167 => _167.current, 'optionalAccess', _168 => _168.contentWindow])) return;
|
|
3543
3623
|
if (isSwappedGoBackMessage(e.data)) {
|
|
3544
3624
|
onGoBackRef.current();
|
|
3545
3625
|
return;
|
|
@@ -3554,16 +3634,16 @@ function SwappedProviderStep({
|
|
|
3554
3634
|
setOrderState((prev) => ({
|
|
3555
3635
|
// Normalise to the uuid the backend poll also keys on, so orderState
|
|
3556
3636
|
// is consistent regardless of which path set it.
|
|
3557
|
-
orderId: _nullishCoalesce(_nullishCoalesce(expectedOrderUuidRef.current, () => ( _optionalChain([prev, 'optionalAccess',
|
|
3637
|
+
orderId: _nullishCoalesce(_nullishCoalesce(expectedOrderUuidRef.current, () => ( _optionalChain([prev, 'optionalAccess', _169 => _169.orderId]))), () => ( ext)),
|
|
3558
3638
|
status: parsed.status,
|
|
3559
|
-
orderCrypto: _nullishCoalesce(_nullishCoalesce(parsed.orderCrypto, () => ( _optionalChain([prev, 'optionalAccess',
|
|
3560
|
-
orderCryptoAmount: _nullishCoalesce(_nullishCoalesce(parsed.orderCryptoAmount, () => ( _optionalChain([prev, 'optionalAccess',
|
|
3561
|
-
transactionId: _nullishCoalesce(_nullishCoalesce(parsed.transactionId, () => ( _optionalChain([prev, 'optionalAccess',
|
|
3639
|
+
orderCrypto: _nullishCoalesce(_nullishCoalesce(parsed.orderCrypto, () => ( _optionalChain([prev, 'optionalAccess', _170 => _170.orderCrypto]))), () => ( null)),
|
|
3640
|
+
orderCryptoAmount: _nullishCoalesce(_nullishCoalesce(parsed.orderCryptoAmount, () => ( _optionalChain([prev, 'optionalAccess', _171 => _171.orderCryptoAmount]))), () => ( null)),
|
|
3641
|
+
transactionId: _nullishCoalesce(_nullishCoalesce(parsed.transactionId, () => ( _optionalChain([prev, 'optionalAccess', _172 => _172.transactionId]))), () => ( null)),
|
|
3562
3642
|
receivedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3563
|
-
paidAmountUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
3564
|
-
paidAmountEur: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
3565
|
-
onrampFeeUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
3566
|
-
paymentMethod: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
3643
|
+
paidAmountUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _173 => _173.paidAmountUsd]), () => ( null)),
|
|
3644
|
+
paidAmountEur: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _174 => _174.paidAmountEur]), () => ( null)),
|
|
3645
|
+
onrampFeeUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _175 => _175.onrampFeeUsd]), () => ( null)),
|
|
3646
|
+
paymentMethod: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _176 => _176.paymentMethod]), () => ( null))
|
|
3567
3647
|
}));
|
|
3568
3648
|
}
|
|
3569
3649
|
window.addEventListener("message", onMessage);
|
|
@@ -3576,25 +3656,28 @@ function SwappedProviderStep({
|
|
|
3576
3656
|
}
|
|
3577
3657
|
}, [phase, orderState, latestEvent, variant]);
|
|
3578
3658
|
const stepStates = _react.useMemo.call(void 0,
|
|
3579
|
-
() => deriveStepStates(_nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
3659
|
+
() => deriveStepStates(_nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _177 => _177.status]), () => ( null)), latestEvent),
|
|
3580
3660
|
[orderState, latestEvent]
|
|
3581
3661
|
);
|
|
3582
3662
|
const terminalState = _react.useMemo.call(void 0, () => {
|
|
3583
|
-
if (
|
|
3663
|
+
if (_chunk7ICSHJFEcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
|
|
3584
3664
|
return {
|
|
3585
3665
|
kind: "failed",
|
|
3586
|
-
message:
|
|
3666
|
+
message: _chunk7ICSHJFEcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
|
|
3587
3667
|
};
|
|
3588
3668
|
}
|
|
3589
|
-
if (_optionalChain([orderState, 'optionalAccess',
|
|
3669
|
+
if (_optionalChain([orderState, 'optionalAccess', _178 => _178.status]) === "order_cancelled") {
|
|
3590
3670
|
const banner = bannerForStatus("order_cancelled", {});
|
|
3591
3671
|
return { kind: "cancelled", message: _nullishCoalesce(banner.detail, () => ( banner.title)) };
|
|
3592
3672
|
}
|
|
3593
3673
|
return null;
|
|
3594
3674
|
}, [latestEvent, orderState, bannerForStatus]);
|
|
3675
|
+
_react.useEffect.call(void 0, () => {
|
|
3676
|
+
if (_optionalChain([orderState, 'optionalAccess', _179 => _179.status]) === "order_cancelled") _optionalChain([onCancelled, 'optionalCall', _180 => _180()]);
|
|
3677
|
+
}, [onCancelled, _optionalChain([orderState, 'optionalAccess', _181 => _181.status])]);
|
|
3595
3678
|
_react.useEffect.call(void 0, () => {
|
|
3596
3679
|
if (completeFiredRef.current || failedFiredRef.current) return;
|
|
3597
|
-
const t = _optionalChain([latestEvent, 'optionalAccess',
|
|
3680
|
+
const t = _optionalChain([latestEvent, 'optionalAccess', _182 => _182.type]);
|
|
3598
3681
|
const isSuccess = t === "bridge-complete";
|
|
3599
3682
|
if (!isSuccess) return;
|
|
3600
3683
|
const txHash = currentDepositTxHashRef.current;
|
|
@@ -3603,10 +3686,10 @@ function SwappedProviderStep({
|
|
|
3603
3686
|
const info = {
|
|
3604
3687
|
smartAccount,
|
|
3605
3688
|
txHash,
|
|
3606
|
-
orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
3689
|
+
orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _183 => _183.orderCrypto]), () => ( null)),
|
|
3607
3690
|
// Base-unit source amount from the deposit row/event, consistent with the
|
|
3608
3691
|
// wallet/QR path. ProcessingStep + onLifecycle expect base units.
|
|
3609
|
-
amount: _nullishCoalesce(
|
|
3692
|
+
amount: _nullishCoalesce(_chunk7ICSHJFEcjs.getEventSourceDetails.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0))).amount, () => ( null)),
|
|
3610
3693
|
expectedOrderUuid: expectedOrderUuidRef.current,
|
|
3611
3694
|
initialEvent: _nullishCoalesce(latestEvent, () => ( void 0))
|
|
3612
3695
|
};
|
|
@@ -3617,22 +3700,23 @@ function SwappedProviderStep({
|
|
|
3617
3700
|
}, [latestEvent, orderState, smartAccount]);
|
|
3618
3701
|
_react.useEffect.call(void 0, () => {
|
|
3619
3702
|
if (failedFiredRef.current || completeFiredRef.current) return;
|
|
3620
|
-
if (!
|
|
3703
|
+
if (!_chunk7ICSHJFEcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) return;
|
|
3621
3704
|
const txHash = currentDepositTxHashRef.current;
|
|
3622
3705
|
if (!txHash) return;
|
|
3623
3706
|
failedFiredRef.current = true;
|
|
3624
3707
|
setPhase("tracker");
|
|
3625
|
-
_optionalChain([onSwappedFailedRef, 'access',
|
|
3708
|
+
_optionalChain([onSwappedFailedRef, 'access', _184 => _184.current, 'optionalCall', _185 => _185(
|
|
3626
3709
|
txHash,
|
|
3627
|
-
|
|
3710
|
+
_chunk7ICSHJFEcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
|
|
3628
3711
|
)]);
|
|
3629
3712
|
}, [latestEvent]);
|
|
3630
3713
|
const immersive = !openExternally && variant === "fiat" && phase === "provider" && !loadError;
|
|
3631
3714
|
_react.useEffect.call(void 0, () => {
|
|
3632
|
-
_optionalChain([onImmersiveChangeRef, 'access',
|
|
3715
|
+
_optionalChain([onImmersiveChangeRef, 'access', _186 => _186.current, 'optionalCall', _187 => _187(immersive)]);
|
|
3633
3716
|
}, [immersive]);
|
|
3634
|
-
_react.useEffect.call(void 0, () => () => _optionalChain([onImmersiveChangeRef, 'access',
|
|
3717
|
+
_react.useEffect.call(void 0, () => () => _optionalChain([onImmersiveChangeRef, 'access', _188 => _188.current, 'optionalCall', _189 => _189(false)]), []);
|
|
3635
3718
|
const handleRetry = () => {
|
|
3719
|
+
_optionalChain([onRetry, 'optionalCall', _190 => _190()]);
|
|
3636
3720
|
setIframeSrc(null);
|
|
3637
3721
|
setWidgetUrl(null);
|
|
3638
3722
|
setIframeLoaded(false);
|
|
@@ -3650,8 +3734,8 @@ function SwappedProviderStep({
|
|
|
3650
3734
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3651
3735
|
SwappedOrderTracker,
|
|
3652
3736
|
{
|
|
3653
|
-
amount: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
3654
|
-
currency: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
3737
|
+
amount: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _191 => _191.orderCryptoAmount]), () => ( null)),
|
|
3738
|
+
currency: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _192 => _192.orderCrypto]), () => ( "USDC")),
|
|
3655
3739
|
stepStates,
|
|
3656
3740
|
terminal: terminalState,
|
|
3657
3741
|
onRetry: handleRetry,
|
|
@@ -3673,7 +3757,7 @@ function SwappedProviderStep({
|
|
|
3673
3757
|
}
|
|
3674
3758
|
)
|
|
3675
3759
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
3676
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3760
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.Spinner, {}),
|
|
3677
3761
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-swapped-handoff-text", children: [
|
|
3678
3762
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h2", { className: "rs-swapped-handoff-title", children: handoffOpened ? variant === "fiat" ? "Finish paying in your browser" : "Approve the transfer in your browser" : "Opening your browser\u2026" }),
|
|
3679
3763
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "rs-swapped-handoff-subtitle", children: handoffOpened ? (
|
|
@@ -3697,7 +3781,7 @@ function SwappedProviderStep({
|
|
|
3697
3781
|
}
|
|
3698
3782
|
)
|
|
3699
3783
|
] }) }),
|
|
3700
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3784
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.PoweredBy, {})
|
|
3701
3785
|
] });
|
|
3702
3786
|
}
|
|
3703
3787
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-fiat-onramp", "data-variant": variant, children: [
|
|
@@ -3714,7 +3798,7 @@ function SwappedProviderStep({
|
|
|
3714
3798
|
}
|
|
3715
3799
|
)
|
|
3716
3800
|
] }),
|
|
3717
|
-
!loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3801
|
+
!loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.Spinner, {}) }),
|
|
3718
3802
|
widgetUrl && !loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3719
3803
|
"iframe",
|
|
3720
3804
|
{
|
|
@@ -3726,7 +3810,7 @@ function SwappedProviderStep({
|
|
|
3726
3810
|
allow: "payment; camera; microphone; clipboard-write; geolocation",
|
|
3727
3811
|
onLoad: () => {
|
|
3728
3812
|
try {
|
|
3729
|
-
if (_optionalChain([iframeRef, 'access',
|
|
3813
|
+
if (_optionalChain([iframeRef, 'access', _193 => _193.current, 'optionalAccess', _194 => _194.contentWindow, 'optionalAccess', _195 => _195.location, 'optionalAccess', _196 => _196.href]) === "about:blank") {
|
|
3730
3814
|
return;
|
|
3731
3815
|
}
|
|
3732
3816
|
} catch (e24) {
|
|
@@ -3737,11 +3821,11 @@ function SwappedProviderStep({
|
|
|
3737
3821
|
retryToken
|
|
3738
3822
|
)
|
|
3739
3823
|
] }) }),
|
|
3740
|
-
loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3824
|
+
loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.PoweredBy, {})
|
|
3741
3825
|
] });
|
|
3742
3826
|
}
|
|
3743
3827
|
function deriveStepStates(swappedStatus, latestEvent) {
|
|
3744
|
-
if (
|
|
3828
|
+
if (_chunk7ICSHJFEcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
|
|
3745
3829
|
return ["complete", "complete", "failed", "pending"];
|
|
3746
3830
|
}
|
|
3747
3831
|
if (swappedStatus === "order_cancelled") {
|
|
@@ -3749,7 +3833,7 @@ function deriveStepStates(swappedStatus, latestEvent) {
|
|
|
3749
3833
|
}
|
|
3750
3834
|
const step1Complete = swappedStatus === "order_completed" || swappedStatus === "order_broadcasted";
|
|
3751
3835
|
const step2Complete = latestEvent !== null || swappedStatus === "order_broadcasted";
|
|
3752
|
-
const step3Complete = _optionalChain([latestEvent, 'optionalAccess',
|
|
3836
|
+
const step3Complete = _optionalChain([latestEvent, 'optionalAccess', _197 => _197.type]) === "bridge-complete";
|
|
3753
3837
|
if (step3Complete) {
|
|
3754
3838
|
return ["complete", "complete", "complete", "complete"];
|
|
3755
3839
|
}
|
|
@@ -3802,11 +3886,15 @@ function FiatOnrampStep({
|
|
|
3802
3886
|
onClose,
|
|
3803
3887
|
onGoBack,
|
|
3804
3888
|
onError,
|
|
3889
|
+
onAttemptConsumed,
|
|
3890
|
+
onProviderHandoff,
|
|
3891
|
+
onRetry,
|
|
3892
|
+
onCancelled,
|
|
3805
3893
|
onImmersiveChange,
|
|
3806
3894
|
openExternally
|
|
3807
3895
|
}) {
|
|
3808
3896
|
const loadUrl = _react.useCallback.call(void 0, async () => {
|
|
3809
|
-
const prefetched = _optionalChain([consumePrefetchedUrl, 'optionalCall',
|
|
3897
|
+
const prefetched = _optionalChain([consumePrefetchedUrl, 'optionalCall', _198 => _198(
|
|
3810
3898
|
smartAccount,
|
|
3811
3899
|
paymentMethod,
|
|
3812
3900
|
methodSelectionSource
|
|
@@ -3846,6 +3934,10 @@ function FiatOnrampStep({
|
|
|
3846
3934
|
onClose,
|
|
3847
3935
|
onGoBack,
|
|
3848
3936
|
onError,
|
|
3937
|
+
onAttemptConsumed,
|
|
3938
|
+
onProviderHandoff,
|
|
3939
|
+
onRetry,
|
|
3940
|
+
onCancelled,
|
|
3849
3941
|
onImmersiveChange,
|
|
3850
3942
|
openExternally
|
|
3851
3943
|
}
|
|
@@ -3895,6 +3987,10 @@ function ExchangeConnectStep({
|
|
|
3895
3987
|
onClose,
|
|
3896
3988
|
onGoBack,
|
|
3897
3989
|
onError,
|
|
3990
|
+
onAttemptConsumed,
|
|
3991
|
+
onProviderHandoff,
|
|
3992
|
+
onRetry,
|
|
3993
|
+
onCancelled,
|
|
3898
3994
|
onImmersiveChange,
|
|
3899
3995
|
openExternally
|
|
3900
3996
|
}) {
|
|
@@ -3922,6 +4018,10 @@ function ExchangeConnectStep({
|
|
|
3922
4018
|
onClose,
|
|
3923
4019
|
onGoBack,
|
|
3924
4020
|
onError,
|
|
4021
|
+
onAttemptConsumed,
|
|
4022
|
+
onProviderHandoff,
|
|
4023
|
+
onRetry,
|
|
4024
|
+
onCancelled,
|
|
3925
4025
|
onImmersiveChange,
|
|
3926
4026
|
openExternally
|
|
3927
4027
|
}
|
|
@@ -3935,7 +4035,7 @@ ExchangeConnectStep.displayName = "ExchangeConnectStep";
|
|
|
3935
4035
|
function ExchangeLogo({ exchange }) {
|
|
3936
4036
|
const [failed, setFailed] = _react.useState.call(void 0, false);
|
|
3937
4037
|
if (!exchange.logoUrl || failed) {
|
|
3938
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4038
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.BankIcon, {});
|
|
3939
4039
|
}
|
|
3940
4040
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3941
4041
|
"img",
|
|
@@ -3980,7 +4080,7 @@ function ExchangeSelectStep({
|
|
|
3980
4080
|
setExchanges([]);
|
|
3981
4081
|
setExchangeFeeBps(0);
|
|
3982
4082
|
setError(message);
|
|
3983
|
-
_optionalChain([onError, 'optionalCall',
|
|
4083
|
+
_optionalChain([onError, 'optionalCall', _199 => _199(message, "SWAPPED_CONNECT_EXCHANGES_FAILED")]);
|
|
3984
4084
|
}).finally(() => {
|
|
3985
4085
|
if (!cancelled) setLoading(false);
|
|
3986
4086
|
});
|
|
@@ -4006,7 +4106,7 @@ function ExchangeSelectStep({
|
|
|
4006
4106
|
} catch (err) {
|
|
4007
4107
|
const message = err instanceof Error ? err.message : "Failed to prepare Connect";
|
|
4008
4108
|
setSelectionNotice(message);
|
|
4009
|
-
_optionalChain([onError, 'optionalCall',
|
|
4109
|
+
_optionalChain([onError, 'optionalCall', _200 => _200(message, "SWAPPED_CONNECT_URL_FAILED")]);
|
|
4010
4110
|
} finally {
|
|
4011
4111
|
setSelectingConnection(null);
|
|
4012
4112
|
}
|
|
@@ -4016,14 +4116,14 @@ function ExchangeSelectStep({
|
|
|
4016
4116
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-exchange-select", children: [
|
|
4017
4117
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4018
4118
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4019
|
-
|
|
4119
|
+
_chunkV2OBGLJDcjs.BodyHeader,
|
|
4020
4120
|
{
|
|
4021
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4121
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.UnplugIcon, {}),
|
|
4022
4122
|
title: "Connect exchange",
|
|
4023
4123
|
subtitle: "Select an exchange to connect"
|
|
4024
4124
|
}
|
|
4025
4125
|
),
|
|
4026
|
-
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4126
|
+
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.Spinner, {}) }),
|
|
4027
4127
|
!loading && error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: [
|
|
4028
4128
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state-title", children: "Couldn\u2019t load exchanges" }),
|
|
4029
4129
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -4049,7 +4149,7 @@ function ExchangeSelectStep({
|
|
|
4049
4149
|
)
|
|
4050
4150
|
] }),
|
|
4051
4151
|
!loading && !error && exchanges.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-grid", children: exchanges.map((exchange) => {
|
|
4052
|
-
const brand =
|
|
4152
|
+
const brand = _chunk7ICSHJFEcjs.getExchangeLogo.call(void 0, exchange.name, exchange.connection);
|
|
4053
4153
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4054
4154
|
"button",
|
|
4055
4155
|
{
|
|
@@ -4074,7 +4174,7 @@ function ExchangeSelectStep({
|
|
|
4074
4174
|
);
|
|
4075
4175
|
}) })
|
|
4076
4176
|
] }),
|
|
4077
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4177
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.PoweredBy, {}),
|
|
4078
4178
|
exchangeFeeBps > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "rs-exchange-select-fee-note", children: [
|
|
4079
4179
|
"A ",
|
|
4080
4180
|
formatFeeRate(exchangeFeeBps),
|
|
@@ -4112,7 +4212,7 @@ function SolanaTokenSelectStep({
|
|
|
4112
4212
|
setError(null);
|
|
4113
4213
|
const portfolioBySymbol = {};
|
|
4114
4214
|
try {
|
|
4115
|
-
|
|
4215
|
+
_chunkV2OBGLJDcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
|
|
4116
4216
|
solanaAddress
|
|
4117
4217
|
});
|
|
4118
4218
|
const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
|
|
@@ -4135,12 +4235,12 @@ function SolanaTokenSelectStep({
|
|
|
4135
4235
|
};
|
|
4136
4236
|
}
|
|
4137
4237
|
}
|
|
4138
|
-
|
|
4238
|
+
_chunkV2OBGLJDcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
|
|
4139
4239
|
symbols: Object.keys(portfolioBySymbol)
|
|
4140
4240
|
});
|
|
4141
4241
|
} catch (err) {
|
|
4142
4242
|
if (!active) return;
|
|
4143
|
-
|
|
4243
|
+
_chunkV2OBGLJDcjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
|
|
4144
4244
|
solanaAddress
|
|
4145
4245
|
});
|
|
4146
4246
|
setError(
|
|
@@ -4165,7 +4265,7 @@ function SolanaTokenSelectStep({
|
|
|
4165
4265
|
setTokenBalances(results);
|
|
4166
4266
|
setLoading(false);
|
|
4167
4267
|
const totalUsd = results.reduce((sum, r) => sum + r.balanceUsd, 0);
|
|
4168
|
-
_optionalChain([onTotalBalanceComputed, 'optionalCall',
|
|
4268
|
+
_optionalChain([onTotalBalanceComputed, 'optionalCall', _201 => _201(totalUsd)]);
|
|
4169
4269
|
}
|
|
4170
4270
|
void loadBalances();
|
|
4171
4271
|
return () => {
|
|
@@ -4187,7 +4287,7 @@ function SolanaTokenSelectStep({
|
|
|
4187
4287
|
const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
|
|
4188
4288
|
const numeric = Number(raw);
|
|
4189
4289
|
if (!Number.isFinite(numeric)) return raw;
|
|
4190
|
-
return
|
|
4290
|
+
return _chunkV2OBGLJDcjs.tokenFormatter.format(numeric);
|
|
4191
4291
|
} catch (e27) {
|
|
4192
4292
|
return "--";
|
|
4193
4293
|
}
|
|
@@ -4197,20 +4297,20 @@ function SolanaTokenSelectStep({
|
|
|
4197
4297
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
4198
4298
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
4199
4299
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4200
|
-
|
|
4300
|
+
_chunkV2OBGLJDcjs.BodyHeader,
|
|
4201
4301
|
{
|
|
4202
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4302
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.WalletIcon, {}),
|
|
4203
4303
|
title: "Your assets",
|
|
4204
4304
|
subtitle: "Select source assets to transfer"
|
|
4205
4305
|
}
|
|
4206
4306
|
),
|
|
4207
4307
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
4208
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4308
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
4209
4309
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
4210
4310
|
] }),
|
|
4211
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4311
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.Callout, { variant: "error", children: error }),
|
|
4212
4312
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
4213
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4313
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
4214
4314
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
4215
4315
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
4216
4316
|
solanaAddress.slice(0, 6),
|
|
@@ -4241,13 +4341,13 @@ function SolanaTokenSelectStep({
|
|
|
4241
4341
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
|
|
4242
4342
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-icon-wrapper", children: [
|
|
4243
4343
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4244
|
-
|
|
4344
|
+
_chunkV2OBGLJDcjs.TokenIcon,
|
|
4245
4345
|
{
|
|
4246
4346
|
symbol: entry.token.symbol,
|
|
4247
4347
|
fallback: entry.token.symbol.slice(0, 4)
|
|
4248
4348
|
}
|
|
4249
4349
|
) }),
|
|
4250
|
-
chainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4350
|
+
chainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CdnIcon, { src: chainIcon, alt: chainName }) })
|
|
4251
4351
|
] }),
|
|
4252
4352
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-text", children: [
|
|
4253
4353
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-name-row", children: [
|
|
@@ -4264,14 +4364,14 @@ function SolanaTokenSelectStep({
|
|
|
4264
4364
|
] })
|
|
4265
4365
|
] })
|
|
4266
4366
|
] }),
|
|
4267
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ?
|
|
4367
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunkV2OBGLJDcjs.currencyFormatter.format(entry.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${entry.token.symbol}` : "--" })
|
|
4268
4368
|
]
|
|
4269
4369
|
},
|
|
4270
4370
|
entry.token.symbol
|
|
4271
4371
|
);
|
|
4272
4372
|
}) }),
|
|
4273
4373
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4274
|
-
|
|
4374
|
+
_chunkV2OBGLJDcjs.Button,
|
|
4275
4375
|
{
|
|
4276
4376
|
onClick: () => selectedEntry && onContinue(
|
|
4277
4377
|
selectedEntry.token,
|
|
@@ -4284,7 +4384,7 @@ function SolanaTokenSelectStep({
|
|
|
4284
4384
|
}
|
|
4285
4385
|
)
|
|
4286
4386
|
] }),
|
|
4287
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4387
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.PoweredBy, {})
|
|
4288
4388
|
] });
|
|
4289
4389
|
}
|
|
4290
4390
|
|
|
@@ -4316,7 +4416,7 @@ function SolanaAmountStep({
|
|
|
4316
4416
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
4317
4417
|
const hasAppliedDefaultRef = _react.useRef.call(void 0, false);
|
|
4318
4418
|
const isSourceStablecoin = _chunk4KCSH4T3cjs.isStablecoinSymbol.call(void 0, token.symbol);
|
|
4319
|
-
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess',
|
|
4419
|
+
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess', _202 => _202.trim, 'call', _203 => _203(), 'access', _204 => _204.toLowerCase, 'call', _205 => _205()]) === "max";
|
|
4320
4420
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
4321
4421
|
if (isSourceStablecoin) return 1;
|
|
4322
4422
|
try {
|
|
@@ -4336,7 +4436,7 @@ function SolanaAmountStep({
|
|
|
4336
4436
|
const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
|
|
4337
4437
|
const numeric = Number(raw);
|
|
4338
4438
|
if (!Number.isFinite(numeric)) return raw;
|
|
4339
|
-
return
|
|
4439
|
+
return _chunkV2OBGLJDcjs.tokenFormatter.format(numeric);
|
|
4340
4440
|
} catch (e29) {
|
|
4341
4441
|
return "\u2026";
|
|
4342
4442
|
}
|
|
@@ -4418,8 +4518,8 @@ function SolanaAmountStep({
|
|
|
4418
4518
|
return null;
|
|
4419
4519
|
}
|
|
4420
4520
|
}, [numericAmount, isSourceStablecoin, hasPricing, tokenPriceUsd, token.decimals]);
|
|
4421
|
-
const minDepositUsd = _chunk4KCSH4T3cjs.isHyperCoreDestination.call(void 0, targetChain) ? Math.max(_chunk4KCSH4T3cjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
4422
|
-
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
4521
|
+
const minDepositUsd = _chunk4KCSH4T3cjs.isHyperCoreDestination.call(void 0, targetChain) ? Math.max(_chunk4KCSH4T3cjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _206 => _206.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _207 => _207.minDepositUsd]), () => ( null));
|
|
4522
|
+
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _208 => _208.maxDepositUsd]), () => ( null));
|
|
4423
4523
|
const isBelowMin = minDepositUsd !== null && numericAmount > 0 && numericAmount < minDepositUsd;
|
|
4424
4524
|
const isAboveMax = maxDepositUsd !== null && numericAmount > maxDepositUsd;
|
|
4425
4525
|
const exceedsBalance = Boolean(
|
|
@@ -4429,7 +4529,7 @@ function SolanaAmountStep({
|
|
|
4429
4529
|
const handlePresetClick = (percentage) => {
|
|
4430
4530
|
const formatted = computePresetAmount(percentage);
|
|
4431
4531
|
if (!formatted) return;
|
|
4432
|
-
|
|
4532
|
+
_chunkV2OBGLJDcjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
|
|
4433
4533
|
percentage,
|
|
4434
4534
|
symbol: token.symbol,
|
|
4435
4535
|
formatted
|
|
@@ -4464,7 +4564,7 @@ function SolanaAmountStep({
|
|
|
4464
4564
|
try {
|
|
4465
4565
|
amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
|
|
4466
4566
|
} catch (e34) {
|
|
4467
|
-
|
|
4567
|
+
_chunkV2OBGLJDcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
4468
4568
|
amount,
|
|
4469
4569
|
sourceAmount: sourceAmountStr,
|
|
4470
4570
|
reason: "parse-units-failed"
|
|
@@ -4479,7 +4579,7 @@ function SolanaAmountStep({
|
|
|
4479
4579
|
);
|
|
4480
4580
|
return;
|
|
4481
4581
|
}
|
|
4482
|
-
|
|
4582
|
+
_chunkV2OBGLJDcjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
|
|
4483
4583
|
symbol: token.symbol,
|
|
4484
4584
|
inputAmountUsd: amount,
|
|
4485
4585
|
sourceAmount: sourceAmountStr,
|
|
@@ -4492,7 +4592,7 @@ function SolanaAmountStep({
|
|
|
4492
4592
|
const continueDisabled = exceedsBalance || numericAmount === 0 && !isBelowMin;
|
|
4493
4593
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
4494
4594
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4495
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4595
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.WalletIcon, {}), title: "Wallet deposit" }),
|
|
4496
4596
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
4497
4597
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
4498
4598
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -4512,13 +4612,13 @@ function SolanaAmountStep({
|
|
|
4512
4612
|
" available",
|
|
4513
4613
|
computedBalanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
4514
4614
|
" (~",
|
|
4515
|
-
|
|
4615
|
+
_chunkV2OBGLJDcjs.currencyFormatter.format(computedBalanceUsd),
|
|
4516
4616
|
")"
|
|
4517
4617
|
] })
|
|
4518
4618
|
] }),
|
|
4519
4619
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
4520
4620
|
"Min. deposit ",
|
|
4521
|
-
|
|
4621
|
+
_chunkV2OBGLJDcjs.currencyFormatter.format(minDepositUsd)
|
|
4522
4622
|
] })
|
|
4523
4623
|
] })
|
|
4524
4624
|
] }),
|
|
@@ -4541,7 +4641,7 @@ function SolanaAmountStep({
|
|
|
4541
4641
|
"Solana ",
|
|
4542
4642
|
token.symbol
|
|
4543
4643
|
] }),
|
|
4544
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4644
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.TokenIcon, { symbol: token.symbol }) })
|
|
4545
4645
|
] })
|
|
4546
4646
|
] }),
|
|
4547
4647
|
targetChainName && targetTokenSymbol && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
@@ -4552,17 +4652,17 @@ function SolanaAmountStep({
|
|
|
4552
4652
|
" ",
|
|
4553
4653
|
targetTokenSymbol
|
|
4554
4654
|
] }),
|
|
4555
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4655
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.TokenIcon, { symbol: targetTokenSymbol }) })
|
|
4556
4656
|
] })
|
|
4557
4657
|
] }),
|
|
4558
4658
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
4559
4659
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
4560
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
4660
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkV2OBGLJDcjs.currencyFormatter.format(balanceAfterUsd) })
|
|
4561
4661
|
] })
|
|
4562
4662
|
] }),
|
|
4563
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4663
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.Callout, { variant: "error", children: error }),
|
|
4564
4664
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4565
|
-
|
|
4665
|
+
_chunkV2OBGLJDcjs.Button,
|
|
4566
4666
|
{
|
|
4567
4667
|
onClick: handleContinue,
|
|
4568
4668
|
fullWidth: true,
|
|
@@ -4571,7 +4671,7 @@ function SolanaAmountStep({
|
|
|
4571
4671
|
}
|
|
4572
4672
|
)
|
|
4573
4673
|
] }),
|
|
4574
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4674
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.PoweredBy, {})
|
|
4575
4675
|
] });
|
|
4576
4676
|
}
|
|
4577
4677
|
|
|
@@ -4594,10 +4694,10 @@ var _spltoken = require('@solana/spl-token');
|
|
|
4594
4694
|
var DEFAULT_SOLANA_RPC_URL = "https://api.mainnet.solana.com";
|
|
4595
4695
|
var cachedConnections = /* @__PURE__ */ new Map();
|
|
4596
4696
|
function getSolanaRpcUrl(rpcUrls) {
|
|
4597
|
-
return _nullishCoalesce(
|
|
4697
|
+
return _nullishCoalesce(_chunkV2OBGLJDcjs.rpcUrlFor.call(void 0, rpcUrls, "solana"), () => ( DEFAULT_SOLANA_RPC_URL));
|
|
4598
4698
|
}
|
|
4599
4699
|
function hasConfiguredSolanaRpcUrl(rpcUrls) {
|
|
4600
|
-
return
|
|
4700
|
+
return _chunkV2OBGLJDcjs.rpcUrlFor.call(void 0, rpcUrls, "solana") !== void 0;
|
|
4601
4701
|
}
|
|
4602
4702
|
function getSolanaConnection(rpcUrls) {
|
|
4603
4703
|
const rpcUrl = getSolanaRpcUrl(rpcUrls);
|
|
@@ -4699,7 +4799,7 @@ function SolanaConfirmStep({
|
|
|
4699
4799
|
onError,
|
|
4700
4800
|
debug
|
|
4701
4801
|
}) {
|
|
4702
|
-
const rpcUrls =
|
|
4802
|
+
const rpcUrls = _chunkV2OBGLJDcjs.useRpcUrls.call(void 0, );
|
|
4703
4803
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
4704
4804
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
4705
4805
|
const targetChainId = _chunk4KCSH4T3cjs.targetChainToChainId.call(void 0, targetChain);
|
|
@@ -4708,28 +4808,28 @@ function SolanaConfirmStep({
|
|
|
4708
4808
|
const targetChainName = _chunk4KCSH4T3cjs.getChainName.call(void 0, targetChainId);
|
|
4709
4809
|
const sourceChainIcon = _chunk4KCSH4T3cjs.getChainIcon.call(void 0, "solana");
|
|
4710
4810
|
const targetChainIcon = _chunk4KCSH4T3cjs.getChainIcon.call(void 0, targetChainId);
|
|
4711
|
-
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
4712
|
-
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
4713
|
-
const formattedAmount = sourceAmount && Number.isFinite(Number(sourceAmount)) ? _nullishCoalesce(
|
|
4811
|
+
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _209 => _209.feeSponsored]), () => ( false));
|
|
4812
|
+
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _210 => _210.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
4813
|
+
const formattedAmount = sourceAmount && Number.isFinite(Number(sourceAmount)) ? _nullishCoalesce(_chunkV2OBGLJDcjs.formatTokenAmount.call(void 0, Number(sourceAmount), token.symbol), () => ( "0")) : "0";
|
|
4714
4814
|
const receiveDisplay = (() => {
|
|
4715
4815
|
const usdValue = Number(targetAmount);
|
|
4716
4816
|
const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
|
|
4717
|
-
const estimate =
|
|
4817
|
+
const estimate = _chunkV2OBGLJDcjs.formatReceiveEstimate.call(void 0, {
|
|
4718
4818
|
sourceAmount: Number.isFinite(Number(sourceAmount)) ? Number(sourceAmount) : void 0,
|
|
4719
4819
|
sourceSymbol: token.symbol,
|
|
4720
4820
|
targetSymbol,
|
|
4721
4821
|
sourceAmountUsd,
|
|
4722
|
-
sourceTrusted:
|
|
4822
|
+
sourceTrusted: _chunkV2OBGLJDcjs.isRecognizedToken.call(void 0, token.mint, "solana"),
|
|
4723
4823
|
// Curated stablecoin target estimates at $1 when unquoted; never applied
|
|
4724
4824
|
// to the source (a held token). See ConfirmStep for the rationale.
|
|
4725
|
-
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } :
|
|
4825
|
+
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : _chunkV2OBGLJDcjs.isDisplayStablecoinSymbol.call(void 0, targetSymbol) ? { [targetSymbol.toUpperCase()]: 1 } : {}
|
|
4726
4826
|
});
|
|
4727
4827
|
if (estimate !== void 0) return estimate;
|
|
4728
4828
|
return targetSymbol;
|
|
4729
4829
|
})();
|
|
4730
4830
|
const handleConfirm = async () => {
|
|
4731
4831
|
if (!solanaProvider) {
|
|
4732
|
-
|
|
4832
|
+
_chunkV2OBGLJDcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
4733
4833
|
reason: "missing-provider"
|
|
4734
4834
|
});
|
|
4735
4835
|
setError("Solana wallet not connected");
|
|
@@ -4737,7 +4837,7 @@ function SolanaConfirmStep({
|
|
|
4737
4837
|
}
|
|
4738
4838
|
const parsedAmount = parseFloat(sourceAmount);
|
|
4739
4839
|
if (isNaN(parsedAmount) || parsedAmount <= 0) {
|
|
4740
|
-
|
|
4840
|
+
_chunkV2OBGLJDcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
4741
4841
|
reason: "invalid-amount",
|
|
4742
4842
|
sourceAmount
|
|
4743
4843
|
});
|
|
@@ -4746,7 +4846,7 @@ function SolanaConfirmStep({
|
|
|
4746
4846
|
}
|
|
4747
4847
|
setError(null);
|
|
4748
4848
|
setIsSubmitting(true);
|
|
4749
|
-
|
|
4849
|
+
_chunkV2OBGLJDcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
|
|
4750
4850
|
smartAccount,
|
|
4751
4851
|
solanaAddress,
|
|
4752
4852
|
solanaDepositAddress,
|
|
@@ -4756,7 +4856,7 @@ function SolanaConfirmStep({
|
|
|
4756
4856
|
});
|
|
4757
4857
|
try {
|
|
4758
4858
|
const check = await service.checkAccount(smartAccount);
|
|
4759
|
-
|
|
4859
|
+
_chunkV2OBGLJDcjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
|
|
4760
4860
|
smartAccount,
|
|
4761
4861
|
isRegistered: check.isRegistered,
|
|
4762
4862
|
targetChain: check.targetChain,
|
|
@@ -4769,7 +4869,7 @@ function SolanaConfirmStep({
|
|
|
4769
4869
|
}
|
|
4770
4870
|
const connection = hasConfiguredSolanaRpcUrl(rpcUrls) ? getSolanaConnection(rpcUrls) : _nullishCoalesce(solanaConnection, () => ( getSolanaConnection(rpcUrls)));
|
|
4771
4871
|
const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
|
|
4772
|
-
|
|
4872
|
+
_chunkV2OBGLJDcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
|
|
4773
4873
|
token: token.symbol,
|
|
4774
4874
|
sourceAmount,
|
|
4775
4875
|
amountUnits: amountUnits.toString()
|
|
@@ -4786,10 +4886,10 @@ function SolanaConfirmStep({
|
|
|
4786
4886
|
token.mint,
|
|
4787
4887
|
amountUnits
|
|
4788
4888
|
);
|
|
4789
|
-
|
|
4889
|
+
_chunkV2OBGLJDcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
4790
4890
|
token: token.symbol,
|
|
4791
4891
|
instructionCount: transaction.instructions.length,
|
|
4792
|
-
feePayer: _optionalChain([transaction, 'access',
|
|
4892
|
+
feePayer: _optionalChain([transaction, 'access', _211 => _211.feePayer, 'optionalAccess', _212 => _212.toBase58, 'call', _213 => _213()]),
|
|
4793
4893
|
recentBlockhash: transaction.recentBlockhash
|
|
4794
4894
|
});
|
|
4795
4895
|
const txHash = await sendSolanaTransaction(
|
|
@@ -4797,7 +4897,7 @@ function SolanaConfirmStep({
|
|
|
4797
4897
|
connection,
|
|
4798
4898
|
transaction
|
|
4799
4899
|
);
|
|
4800
|
-
|
|
4900
|
+
_chunkV2OBGLJDcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
|
|
4801
4901
|
txHash,
|
|
4802
4902
|
amountUnits: amountUnits.toString()
|
|
4803
4903
|
});
|
|
@@ -4809,21 +4909,21 @@ function SolanaConfirmStep({
|
|
|
4809
4909
|
});
|
|
4810
4910
|
} catch (err) {
|
|
4811
4911
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
4812
|
-
const message =
|
|
4813
|
-
|
|
4912
|
+
const message = _chunkV2OBGLJDcjs.formatUserError.call(void 0, raw);
|
|
4913
|
+
_chunkV2OBGLJDcjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
|
|
4814
4914
|
smartAccount,
|
|
4815
4915
|
token: token.symbol,
|
|
4816
4916
|
sourceAmount
|
|
4817
4917
|
});
|
|
4818
4918
|
setError(message);
|
|
4819
|
-
_optionalChain([onError, 'optionalCall',
|
|
4919
|
+
_optionalChain([onError, 'optionalCall', _214 => _214(message, "SOLANA_TRANSFER_ERROR", raw)]);
|
|
4820
4920
|
} finally {
|
|
4821
4921
|
setIsSubmitting(false);
|
|
4822
4922
|
}
|
|
4823
4923
|
};
|
|
4824
4924
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
4825
4925
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4826
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4926
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.WalletIcon, {}), title: "Review deposit" }),
|
|
4827
4927
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4828
4928
|
ReviewDetails,
|
|
4829
4929
|
{
|
|
@@ -4839,9 +4939,9 @@ function SolanaConfirmStep({
|
|
|
4839
4939
|
fee: { display: "$0.04", struck: feeSponsored, tooltip: feeTooltip }
|
|
4840
4940
|
}
|
|
4841
4941
|
),
|
|
4842
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4942
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.Callout, { variant: "error", children: error }),
|
|
4843
4943
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4844
|
-
|
|
4944
|
+
_chunkV2OBGLJDcjs.Button,
|
|
4845
4945
|
{
|
|
4846
4946
|
onClick: handleConfirm,
|
|
4847
4947
|
loading: isSubmitting,
|
|
@@ -4852,7 +4952,7 @@ function SolanaConfirmStep({
|
|
|
4852
4952
|
}
|
|
4853
4953
|
)
|
|
4854
4954
|
] }),
|
|
4855
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4955
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.PoweredBy, {})
|
|
4856
4956
|
] });
|
|
4857
4957
|
}
|
|
4858
4958
|
|
|
@@ -4867,19 +4967,19 @@ function DappImportAssetSelectStep({
|
|
|
4867
4967
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
4868
4968
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4869
4969
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4870
|
-
|
|
4970
|
+
_chunkV2OBGLJDcjs.BodyHeader,
|
|
4871
4971
|
{
|
|
4872
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4972
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.WalletIcon, {}),
|
|
4873
4973
|
title: `Transfer from ${sourceLabel}`,
|
|
4874
4974
|
subtitle: "Pick the balance to import"
|
|
4875
4975
|
}
|
|
4876
4976
|
),
|
|
4877
4977
|
incompleteSummary && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-notice", role: "status", children: incompleteSummary }),
|
|
4878
4978
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: assets.map((asset) => {
|
|
4879
|
-
const tokenAmount = asset.balance ?
|
|
4979
|
+
const tokenAmount = asset.balance ? _chunkV2OBGLJDcjs.tokenFormatter.format(
|
|
4880
4980
|
Number(asset.balance) / 10 ** asset.decimals
|
|
4881
4981
|
) : "0";
|
|
4882
|
-
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ?
|
|
4982
|
+
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ? _chunkV2OBGLJDcjs.currencyFormatter.format(asset.balanceUsd) : `${tokenAmount} ${asset.symbol}`;
|
|
4883
4983
|
const assetIcon = asset.icon;
|
|
4884
4984
|
const chainIcon = _chunk4KCSH4T3cjs.getChainIcon.call(void 0, asset.chainId);
|
|
4885
4985
|
const badge = _chunk4KCSH4T3cjs.getChainBadge.call(void 0, asset.chainId);
|
|
@@ -4892,14 +4992,14 @@ function DappImportAssetSelectStep({
|
|
|
4892
4992
|
children: [
|
|
4893
4993
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
|
|
4894
4994
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-icon-wrapper", children: [
|
|
4895
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: assetIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4896
|
-
|
|
4995
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: assetIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CdnIcon, { src: assetIcon, alt: asset.symbol }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4996
|
+
_chunkV2OBGLJDcjs.TokenIcon,
|
|
4897
4997
|
{
|
|
4898
4998
|
symbol: asset.symbol,
|
|
4899
4999
|
fallback: asset.symbol.slice(0, 4)
|
|
4900
5000
|
}
|
|
4901
5001
|
) }),
|
|
4902
|
-
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5002
|
+
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CdnIcon, { src: chainIcon, alt: _chunk4KCSH4T3cjs.getChainName.call(void 0, asset.chainId) }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4903
5003
|
"span",
|
|
4904
5004
|
{
|
|
4905
5005
|
className: "rs-asset-chain-badge",
|
|
@@ -4931,7 +5031,7 @@ function DappImportAssetSelectStep({
|
|
|
4931
5031
|
);
|
|
4932
5032
|
}) })
|
|
4933
5033
|
] }),
|
|
4934
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5034
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.PoweredBy, {})
|
|
4935
5035
|
] });
|
|
4936
5036
|
}
|
|
4937
5037
|
DappImportAssetSelectStep.displayName = "DappImportAssetSelectStep";
|
|
@@ -4953,7 +5053,7 @@ function describeRow(status, comingSoon) {
|
|
|
4953
5053
|
}
|
|
4954
5054
|
if (status.enabled) {
|
|
4955
5055
|
return {
|
|
4956
|
-
subtitle: status.balanceUsd > 0 ?
|
|
5056
|
+
subtitle: status.balanceUsd > 0 ? _chunkV2OBGLJDcjs.currencyFormatter.format(status.balanceUsd) : "No balance",
|
|
4957
5057
|
disabled: false,
|
|
4958
5058
|
busy: false
|
|
4959
5059
|
};
|
|
@@ -4976,9 +5076,9 @@ function DappImportSelectStep({
|
|
|
4976
5076
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
4977
5077
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4978
5078
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4979
|
-
|
|
5079
|
+
_chunkV2OBGLJDcjs.BodyHeader,
|
|
4980
5080
|
{
|
|
4981
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5081
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.MigrateAssetsIcon, {}),
|
|
4982
5082
|
title: "Migrate assets",
|
|
4983
5083
|
subtitle: "Select a position to migrate"
|
|
4984
5084
|
}
|
|
@@ -4990,16 +5090,16 @@ function DappImportSelectStep({
|
|
|
4990
5090
|
Boolean(brand.comingSoon)
|
|
4991
5091
|
);
|
|
4992
5092
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4993
|
-
|
|
5093
|
+
_chunkLZFRL2ALcjs.ListRow,
|
|
4994
5094
|
{
|
|
4995
5095
|
leadingMedia: brand.iconUrl,
|
|
4996
5096
|
title: brand.label,
|
|
4997
5097
|
subtitle,
|
|
4998
5098
|
disabled,
|
|
4999
|
-
trailing: busy ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5099
|
+
trailing: busy ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.Spinner, { className: "rs-spinner--sm" }) : void 0,
|
|
5000
5100
|
onClick: () => {
|
|
5001
5101
|
if (status === "needs-connect") {
|
|
5002
|
-
_optionalChain([onRequestConnect, 'optionalCall',
|
|
5102
|
+
_optionalChain([onRequestConnect, 'optionalCall', _215 => _215()]);
|
|
5003
5103
|
return;
|
|
5004
5104
|
}
|
|
5005
5105
|
onSelect(brand.id);
|
|
@@ -5009,7 +5109,7 @@ function DappImportSelectStep({
|
|
|
5009
5109
|
);
|
|
5010
5110
|
}) })
|
|
5011
5111
|
] }),
|
|
5012
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5112
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.PoweredBy, {})
|
|
5013
5113
|
] });
|
|
5014
5114
|
}
|
|
5015
5115
|
DappImportSelectStep.displayName = "DappImportSelectStep";
|
|
@@ -5026,9 +5126,9 @@ function DappImportAssetSelectSkeleton({
|
|
|
5026
5126
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: error ? "Couldn't load balances" : "Loading balances\u2026" }),
|
|
5027
5127
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
5028
5128
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5029
|
-
|
|
5129
|
+
_chunkV2OBGLJDcjs.BodyHeader,
|
|
5030
5130
|
{
|
|
5031
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5131
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.WalletIcon, {}),
|
|
5032
5132
|
title: `Transfer from ${sourceLabel}`,
|
|
5033
5133
|
subtitle: "Pick the balance to import"
|
|
5034
5134
|
}
|
|
@@ -5066,7 +5166,7 @@ function DappImportAssetSelectSkeleton({
|
|
|
5066
5166
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Try again" })
|
|
5067
5167
|
}
|
|
5068
5168
|
) }),
|
|
5069
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5169
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.PoweredBy, {})
|
|
5070
5170
|
] });
|
|
5071
5171
|
}
|
|
5072
5172
|
DappImportAssetSelectSkeleton.displayName = "DappImportAssetSelectSkeleton";
|
|
@@ -5155,7 +5255,7 @@ var aaveProvider = {
|
|
|
5155
5255
|
throw new Error("Aave positions require a backend connection");
|
|
5156
5256
|
}
|
|
5157
5257
|
const response = await backend.getPositions(eoa);
|
|
5158
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
5258
|
+
if (_optionalChain([signal, 'optionalAccess', _216 => _216.aborted])) return null;
|
|
5159
5259
|
const assets = toImportableAssets(response.positions);
|
|
5160
5260
|
const failures = _nullishCoalesce(response.failures, () => ( []));
|
|
5161
5261
|
if (assets.length === 0) {
|
|
@@ -5488,21 +5588,21 @@ var polymarketProvider = {
|
|
|
5488
5588
|
async fetchAvailability({ eoa, getPublicClient: getPublicClient2, signal }) {
|
|
5489
5589
|
const proxyWallet = await _chunkDW2EQA2Ucjs.fetchPolymarketProxyWallet.call(void 0, eoa, signal);
|
|
5490
5590
|
if (!proxyWallet) return null;
|
|
5491
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
5591
|
+
if (_optionalChain([signal, 'optionalAccess', _217 => _217.aborted])) return null;
|
|
5492
5592
|
const polygonClient = getPublicClient2(_chunkDW2EQA2Ucjs.POLYMARKET_POLYGON_CHAIN_ID);
|
|
5493
5593
|
if (!polygonClient) return null;
|
|
5494
5594
|
const balances = await _chunkDW2EQA2Ucjs.readPolymarketBalances.call(void 0, {
|
|
5495
5595
|
publicClient: polygonClient,
|
|
5496
5596
|
proxyWallet
|
|
5497
5597
|
});
|
|
5498
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
5598
|
+
if (_optionalChain([signal, 'optionalAccess', _218 => _218.aborted])) return null;
|
|
5499
5599
|
if (balances.pusd === 0n && balances.usdce === 0n) return null;
|
|
5500
5600
|
const walletKind = await detectPolymarketWalletKind({
|
|
5501
5601
|
publicClient: polygonClient,
|
|
5502
5602
|
proxyWallet,
|
|
5503
5603
|
eoa
|
|
5504
5604
|
});
|
|
5505
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
5605
|
+
if (_optionalChain([signal, 'optionalAccess', _219 => _219.aborted])) return null;
|
|
5506
5606
|
if (!walletKind) return null;
|
|
5507
5607
|
const assets = [];
|
|
5508
5608
|
if (balances.pusd > 0n) {
|
|
@@ -5613,7 +5713,7 @@ function getEnabledProviders(config) {
|
|
|
5613
5713
|
function computeDappImportStatus(providerId, inputs) {
|
|
5614
5714
|
const { owner, availability, availabilityOwner, setup } = inputs;
|
|
5615
5715
|
if (!owner) return "needs-connect";
|
|
5616
|
-
const entry = _optionalChain([availabilityOwner, 'optionalAccess',
|
|
5716
|
+
const entry = _optionalChain([availabilityOwner, 'optionalAccess', _220 => _220.toLowerCase, 'call', _221 => _221()]) === owner.toLowerCase() ? availability[providerId] : void 0;
|
|
5617
5717
|
if (entry === "loading" || entry === void 0) return "loading";
|
|
5618
5718
|
if (entry === "error") {
|
|
5619
5719
|
return {
|
|
@@ -5659,6 +5759,295 @@ function bootRetryPlan(params) {
|
|
|
5659
5759
|
};
|
|
5660
5760
|
}
|
|
5661
5761
|
|
|
5762
|
+
// src/core/deposit-analytics.tsx
|
|
5763
|
+
|
|
5764
|
+
|
|
5765
|
+
|
|
5766
|
+
|
|
5767
|
+
|
|
5768
|
+
|
|
5769
|
+
function fundingMethodForFlowMode(mode) {
|
|
5770
|
+
switch (mode) {
|
|
5771
|
+
case "wallet":
|
|
5772
|
+
case "solana-wallet":
|
|
5773
|
+
return "wallet";
|
|
5774
|
+
case "deposit-address":
|
|
5775
|
+
return "transfer";
|
|
5776
|
+
case "fiat-onramp":
|
|
5777
|
+
return "fiat_onramp";
|
|
5778
|
+
case "exchange-connect":
|
|
5779
|
+
return "exchange_connect";
|
|
5780
|
+
case "dapp-import":
|
|
5781
|
+
return "asset_migration";
|
|
5782
|
+
default:
|
|
5783
|
+
return null;
|
|
5784
|
+
}
|
|
5785
|
+
}
|
|
5786
|
+
function analyticsStepForFlowStep(method, step) {
|
|
5787
|
+
if (!method) {
|
|
5788
|
+
return step === "setup" ? "account_setup" : "funding_method_home";
|
|
5789
|
+
}
|
|
5790
|
+
switch (step) {
|
|
5791
|
+
case "connect":
|
|
5792
|
+
return method === "wallet" ? "wallet_connect" : "funding_method_home";
|
|
5793
|
+
case "setup":
|
|
5794
|
+
return "account_setup";
|
|
5795
|
+
case "select-asset":
|
|
5796
|
+
return "wallet_source_asset";
|
|
5797
|
+
case "solana-token-select":
|
|
5798
|
+
return "wallet_source_token";
|
|
5799
|
+
case "amount":
|
|
5800
|
+
case "solana-amount":
|
|
5801
|
+
return method === "asset_migration" ? "migration_amount" : "wallet_amount";
|
|
5802
|
+
case "confirm":
|
|
5803
|
+
case "solana-confirm":
|
|
5804
|
+
return method === "asset_migration" ? "migration_review" : "wallet_review";
|
|
5805
|
+
case "processing":
|
|
5806
|
+
return method === "asset_migration" ? "migration_processing" : method === "transfer" ? "transfer_tracking" : method === "fiat_onramp" ? "fiat_receipt" : method === "exchange_connect" ? "exchange_receipt" : "wallet_processing";
|
|
5807
|
+
case "deposit-address":
|
|
5808
|
+
return "transfer_address_shown";
|
|
5809
|
+
case "qr-amount":
|
|
5810
|
+
return "transfer_fee_amount";
|
|
5811
|
+
case "qr-review":
|
|
5812
|
+
return "transfer_fee_review";
|
|
5813
|
+
case "fiat-onramp":
|
|
5814
|
+
return "fiat_provider_handoff";
|
|
5815
|
+
case "exchange-select":
|
|
5816
|
+
return "exchange_selection";
|
|
5817
|
+
case "exchange-connect":
|
|
5818
|
+
return "exchange_provider_handoff";
|
|
5819
|
+
case "dapp-import-resolving":
|
|
5820
|
+
return "migration_boot_resolve";
|
|
5821
|
+
case "dapp-import-select":
|
|
5822
|
+
return "migration_provider_selection";
|
|
5823
|
+
case "dapp-import-asset-select":
|
|
5824
|
+
return "migration_asset_selection";
|
|
5825
|
+
default:
|
|
5826
|
+
return "funding_method_home";
|
|
5827
|
+
}
|
|
5828
|
+
}
|
|
5829
|
+
function failureReasonForCode(code, cause) {
|
|
5830
|
+
const normalized = `${_nullishCoalesce(code, () => ( ""))} ${_nullishCoalesce(cause, () => ( ""))}`.toLowerCase();
|
|
5831
|
+
if (normalized.includes("uncertain")) return "submission_uncertain";
|
|
5832
|
+
if (normalized.includes("reject") && (normalized.includes("sign") || normalized.includes("permit"))) {
|
|
5833
|
+
return "wallet_signature_rejected";
|
|
5834
|
+
}
|
|
5835
|
+
if (normalized.includes("permit")) {
|
|
5836
|
+
return "wallet_permit_preparation_unavailable";
|
|
5837
|
+
}
|
|
5838
|
+
if (normalized.includes("clipboard")) return "transfer_clipboard_failed";
|
|
5839
|
+
if (normalized.includes("switch") && normalized.includes("reject")) {
|
|
5840
|
+
return "wallet_chain_switch_rejected";
|
|
5841
|
+
}
|
|
5842
|
+
if (normalized.includes("reject")) return "submission_rejected";
|
|
5843
|
+
if (normalized.includes("switch")) return "wallet_chain_switch_failed";
|
|
5844
|
+
if (normalized.includes("quote")) return "quote_unavailable";
|
|
5845
|
+
if (normalized.includes("price")) return "quote_source_price_unavailable";
|
|
5846
|
+
if (normalized.includes("iframe_timeout")) return "swapped_iframe_timeout";
|
|
5847
|
+
if (normalized.includes("connect_exchanges") || normalized.includes("exchange_list")) {
|
|
5848
|
+
return "exchange_list_failed";
|
|
5849
|
+
}
|
|
5850
|
+
if (normalized.includes("browser")) return "swapped_browser_open_failed";
|
|
5851
|
+
if (normalized.includes("swapped") || normalized.includes("onramp")) {
|
|
5852
|
+
return "swapped_mint_failed";
|
|
5853
|
+
}
|
|
5854
|
+
if (normalized.includes("solana") || normalized.includes("transfer")) {
|
|
5855
|
+
return "submission_failed";
|
|
5856
|
+
}
|
|
5857
|
+
return "submission_failed";
|
|
5858
|
+
}
|
|
5859
|
+
function correlatorKey(correlator) {
|
|
5860
|
+
return `${correlator.type}:${correlator.value}`;
|
|
5861
|
+
}
|
|
5862
|
+
function createDepositAnalyticsController(emit) {
|
|
5863
|
+
let method = null;
|
|
5864
|
+
let step = null;
|
|
5865
|
+
let afterHandoff = false;
|
|
5866
|
+
let opened = false;
|
|
5867
|
+
let closed = false;
|
|
5868
|
+
const dedupe = /* @__PURE__ */ new Set();
|
|
5869
|
+
const emitOnce = (key, ...args) => {
|
|
5870
|
+
if (dedupe.has(key)) return;
|
|
5871
|
+
dedupe.add(key);
|
|
5872
|
+
emit(...args);
|
|
5873
|
+
};
|
|
5874
|
+
const controller = {
|
|
5875
|
+
emit,
|
|
5876
|
+
openSession() {
|
|
5877
|
+
if (opened) return;
|
|
5878
|
+
opened = true;
|
|
5879
|
+
emit({ type: "deposit_modal_open" }, null);
|
|
5880
|
+
},
|
|
5881
|
+
selectMethod(...args) {
|
|
5882
|
+
const [nextMethod, entrySource, identifiers] = args;
|
|
5883
|
+
controller.openSession();
|
|
5884
|
+
if (method && method !== nextMethod && !afterHandoff) {
|
|
5885
|
+
controller.abandon("method_replacement");
|
|
5886
|
+
}
|
|
5887
|
+
method = nextMethod;
|
|
5888
|
+
step = null;
|
|
5889
|
+
afterHandoff = false;
|
|
5890
|
+
emitOnce(
|
|
5891
|
+
`method:${nextMethod}:${entrySource}:${JSON.stringify(_nullishCoalesce(identifiers, () => ( {})))}`,
|
|
5892
|
+
...[
|
|
5893
|
+
{
|
|
5894
|
+
type: "deposit_modal_method_selected",
|
|
5895
|
+
entry_source: entrySource,
|
|
5896
|
+
...identifiers ? { identifiers } : {}
|
|
5897
|
+
},
|
|
5898
|
+
nextMethod
|
|
5899
|
+
]
|
|
5900
|
+
);
|
|
5901
|
+
},
|
|
5902
|
+
openStep(nextStep) {
|
|
5903
|
+
controller.openSession();
|
|
5904
|
+
if (step === nextStep) return;
|
|
5905
|
+
step = nextStep;
|
|
5906
|
+
emitOnce(
|
|
5907
|
+
`step-open:${_nullishCoalesce(method, () => ( "none"))}:${nextStep}`,
|
|
5908
|
+
{ type: "deposit_modal_step_open", step: nextStep },
|
|
5909
|
+
method
|
|
5910
|
+
);
|
|
5911
|
+
},
|
|
5912
|
+
completeStep(completedStep = _nullishCoalesce(step, () => ( void 0))) {
|
|
5913
|
+
if (!completedStep) return;
|
|
5914
|
+
emitOnce(
|
|
5915
|
+
`step-complete:${_nullishCoalesce(method, () => ( "none"))}:${completedStep}`,
|
|
5916
|
+
{ type: "deposit_modal_step_complete", step: completedStep },
|
|
5917
|
+
method
|
|
5918
|
+
);
|
|
5919
|
+
},
|
|
5920
|
+
friction(reason, eventStep = _nullishCoalesce(step, () => ( void 0))) {
|
|
5921
|
+
if (!eventStep) return;
|
|
5922
|
+
emitOnce(
|
|
5923
|
+
`friction:${method}:${eventStep}:${reason}`,
|
|
5924
|
+
{
|
|
5925
|
+
type: "deposit_modal_friction",
|
|
5926
|
+
step: eventStep,
|
|
5927
|
+
reason
|
|
5928
|
+
},
|
|
5929
|
+
method
|
|
5930
|
+
);
|
|
5931
|
+
},
|
|
5932
|
+
failure(reason, retryable, eventStep = _nullishCoalesce(step, () => ( void 0))) {
|
|
5933
|
+
if (!eventStep) return;
|
|
5934
|
+
emitOnce(
|
|
5935
|
+
`failure:${method}:${eventStep}:${reason}`,
|
|
5936
|
+
{
|
|
5937
|
+
type: "deposit_modal_failure",
|
|
5938
|
+
step: eventStep,
|
|
5939
|
+
reason,
|
|
5940
|
+
retryable
|
|
5941
|
+
},
|
|
5942
|
+
method
|
|
5943
|
+
);
|
|
5944
|
+
},
|
|
5945
|
+
retry(reason, eventStep = _nullishCoalesce(step, () => ( void 0))) {
|
|
5946
|
+
if (!eventStep) return;
|
|
5947
|
+
emit({ type: "deposit_modal_retry", step: eventStep, reason }, method);
|
|
5948
|
+
for (const key of [...dedupe]) {
|
|
5949
|
+
if (key.includes(`:${method}:${eventStep}:`)) dedupe.delete(key);
|
|
5950
|
+
}
|
|
5951
|
+
},
|
|
5952
|
+
handoff(...args) {
|
|
5953
|
+
const [handoffMethod, correlator, eventStep = _nullishCoalesce(step, () => ( void 0)), identifiers] = args;
|
|
5954
|
+
if (!eventStep) return;
|
|
5955
|
+
if (step !== eventStep) controller.openStep(eventStep);
|
|
5956
|
+
afterHandoff = true;
|
|
5957
|
+
emitOnce(
|
|
5958
|
+
`handoff:${correlatorKey(correlator)}:${JSON.stringify(_nullishCoalesce(identifiers, () => ( {})))}`,
|
|
5959
|
+
...[
|
|
5960
|
+
{
|
|
5961
|
+
type: "deposit_modal_handoff",
|
|
5962
|
+
step: eventStep,
|
|
5963
|
+
correlator,
|
|
5964
|
+
...identifiers ? { identifiers } : {}
|
|
5965
|
+
},
|
|
5966
|
+
handoffMethod
|
|
5967
|
+
]
|
|
5968
|
+
);
|
|
5969
|
+
},
|
|
5970
|
+
observeCorrelator(correlator, eventStep = _nullishCoalesce(step, () => ( void 0))) {
|
|
5971
|
+
if (!eventStep) return;
|
|
5972
|
+
const key = `correlator:${correlatorKey(correlator)}`;
|
|
5973
|
+
if (dedupe.has(key)) return;
|
|
5974
|
+
if (step !== eventStep) controller.openStep(eventStep);
|
|
5975
|
+
emitOnce(
|
|
5976
|
+
key,
|
|
5977
|
+
{
|
|
5978
|
+
type: "deposit_modal_correlator_observed",
|
|
5979
|
+
step: eventStep,
|
|
5980
|
+
correlator
|
|
5981
|
+
},
|
|
5982
|
+
method
|
|
5983
|
+
);
|
|
5984
|
+
},
|
|
5985
|
+
outcome(outcome) {
|
|
5986
|
+
if (!step) return;
|
|
5987
|
+
emitOnce(
|
|
5988
|
+
`outcome:${method}:${outcome}`,
|
|
5989
|
+
{ type: "deposit_modal_ui_outcome", step, outcome },
|
|
5990
|
+
method
|
|
5991
|
+
);
|
|
5992
|
+
},
|
|
5993
|
+
abandon(reason) {
|
|
5994
|
+
if (!method || !step || afterHandoff) return;
|
|
5995
|
+
emitOnce(
|
|
5996
|
+
`abandon:${method}:${reason}`,
|
|
5997
|
+
{ type: "deposit_modal_method_abandoned", step, reason },
|
|
5998
|
+
method
|
|
5999
|
+
);
|
|
6000
|
+
},
|
|
6001
|
+
close(source) {
|
|
6002
|
+
if (closed) return;
|
|
6003
|
+
closed = true;
|
|
6004
|
+
emit(
|
|
6005
|
+
{
|
|
6006
|
+
type: "deposit_modal_close",
|
|
6007
|
+
source,
|
|
6008
|
+
step,
|
|
6009
|
+
after_handoff: afterHandoff
|
|
6010
|
+
},
|
|
6011
|
+
method
|
|
6012
|
+
);
|
|
6013
|
+
},
|
|
6014
|
+
resetAttempt(nextMethod = null) {
|
|
6015
|
+
method = nextMethod;
|
|
6016
|
+
step = null;
|
|
6017
|
+
afterHandoff = false;
|
|
6018
|
+
dedupe.clear();
|
|
6019
|
+
},
|
|
6020
|
+
get method() {
|
|
6021
|
+
return method;
|
|
6022
|
+
},
|
|
6023
|
+
get step() {
|
|
6024
|
+
return step;
|
|
6025
|
+
},
|
|
6026
|
+
get afterHandoff() {
|
|
6027
|
+
return afterHandoff;
|
|
6028
|
+
}
|
|
6029
|
+
};
|
|
6030
|
+
return controller;
|
|
6031
|
+
}
|
|
6032
|
+
var DepositAnalyticsControllerContext = _react.createContext.call(void 0, null);
|
|
6033
|
+
var noopController = createDepositAnalyticsController(() => {
|
|
6034
|
+
});
|
|
6035
|
+
function DepositAnalyticsControllerProvider({
|
|
6036
|
+
children,
|
|
6037
|
+
controllerRef
|
|
6038
|
+
}) {
|
|
6039
|
+
const emit = _chunkV2OBGLJDcjs.useDepositAnalyticsEmitter.call(void 0, );
|
|
6040
|
+
const controller = _react.useMemo.call(void 0,
|
|
6041
|
+
() => createDepositAnalyticsController(emit),
|
|
6042
|
+
[emit]
|
|
6043
|
+
);
|
|
6044
|
+
if (controllerRef) controllerRef.current = controller;
|
|
6045
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositAnalyticsControllerContext.Provider, { value: controller, children });
|
|
6046
|
+
}
|
|
6047
|
+
function useDepositAnalyticsController() {
|
|
6048
|
+
return _nullishCoalesce(_react.useContext.call(void 0, DepositAnalyticsControllerContext), () => ( noopController));
|
|
6049
|
+
}
|
|
6050
|
+
|
|
5662
6051
|
// src/store/index.ts
|
|
5663
6052
|
|
|
5664
6053
|
var _zustand = require('zustand');
|
|
@@ -6167,7 +6556,7 @@ function applyAction(state, action) {
|
|
|
6167
6556
|
totalUsd: null,
|
|
6168
6557
|
// Keep any prior chains visible so the cluster does not flicker
|
|
6169
6558
|
// empty across a refresh.
|
|
6170
|
-
chainIds: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
6559
|
+
chainIds: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _222 => _222.chainIds]), () => ( []))
|
|
6171
6560
|
}
|
|
6172
6561
|
}
|
|
6173
6562
|
}
|
|
@@ -6378,7 +6767,7 @@ function applyAction(state, action) {
|
|
|
6378
6767
|
flow: { ...state.flow, step: "processing" }
|
|
6379
6768
|
};
|
|
6380
6769
|
case "processing/quote-loaded":
|
|
6381
|
-
if (state.flow.step !== "processing" || _optionalChain([state, 'access',
|
|
6770
|
+
if (state.flow.step !== "processing" || _optionalChain([state, 'access', _223 => _223.processing, 'access', _224 => _224.txHash, 'optionalAccess', _225 => _225.toLowerCase, 'call', _226 => _226()]) !== action.txHash.toLowerCase()) {
|
|
6382
6771
|
return state;
|
|
6383
6772
|
}
|
|
6384
6773
|
return {
|
|
@@ -6955,6 +7344,7 @@ function DepositFlow({
|
|
|
6955
7344
|
fiatMethods,
|
|
6956
7345
|
enableExchangeConnect = false,
|
|
6957
7346
|
walletSession,
|
|
7347
|
+
walletIntegration,
|
|
6958
7348
|
onConnect,
|
|
6959
7349
|
onDisconnect,
|
|
6960
7350
|
onRequestConnect,
|
|
@@ -6967,15 +7357,14 @@ function DepositFlow({
|
|
|
6967
7357
|
onSubmittingChange,
|
|
6968
7358
|
onClose,
|
|
6969
7359
|
onLifecycle,
|
|
6970
|
-
onEvent,
|
|
6971
7360
|
onError,
|
|
6972
7361
|
debug
|
|
6973
7362
|
}) {
|
|
6974
|
-
const rpcUrls =
|
|
6975
|
-
const onStepChangeRef =
|
|
6976
|
-
const
|
|
6977
|
-
const onLifecycleRef =
|
|
6978
|
-
const onErrorRef =
|
|
7363
|
+
const rpcUrls = _chunkV2OBGLJDcjs.useRpcUrls.call(void 0, );
|
|
7364
|
+
const onStepChangeRef = _chunkV2OBGLJDcjs.useLatestRef.call(void 0, onStepChange);
|
|
7365
|
+
const analytics = useDepositAnalyticsController();
|
|
7366
|
+
const onLifecycleRef = _chunkV2OBGLJDcjs.useLatestRef.call(void 0, onLifecycle);
|
|
7367
|
+
const onErrorRef = _chunkV2OBGLJDcjs.useLatestRef.call(void 0, onError);
|
|
6979
7368
|
const storeApi = useDepositStoreApi();
|
|
6980
7369
|
const flowSlice = useDepositStore((s) => s.flow);
|
|
6981
7370
|
const depositSlice = useDepositStore((s) => s.deposit);
|
|
@@ -6992,13 +7381,13 @@ function DepositFlow({
|
|
|
6992
7381
|
const stableWalletSelectionKeyRef = _react.useRef.call(void 0, null);
|
|
6993
7382
|
const logFlow = _react.useCallback.call(void 0,
|
|
6994
7383
|
(message, data) => {
|
|
6995
|
-
|
|
7384
|
+
_chunkV2OBGLJDcjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
|
|
6996
7385
|
},
|
|
6997
7386
|
[debug]
|
|
6998
7387
|
);
|
|
6999
7388
|
const logFlowError = _react.useCallback.call(void 0,
|
|
7000
7389
|
(message, error, data) => {
|
|
7001
|
-
|
|
7390
|
+
_chunkV2OBGLJDcjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
|
|
7002
7391
|
},
|
|
7003
7392
|
[debug]
|
|
7004
7393
|
);
|
|
@@ -7022,12 +7411,12 @@ function DepositFlow({
|
|
|
7022
7411
|
};
|
|
7023
7412
|
}, [enableSwappedPreconnect]);
|
|
7024
7413
|
const dappSwitchChain = _react.useMemo.call(void 0, () => {
|
|
7025
|
-
if (!_optionalChain([walletClientProp, 'optionalAccess',
|
|
7414
|
+
if (!_optionalChain([walletClientProp, 'optionalAccess', _227 => _227.switchChain])) return void 0;
|
|
7026
7415
|
return async (chainId) => {
|
|
7027
|
-
await _optionalChain([walletClientProp, 'access',
|
|
7416
|
+
await _optionalChain([walletClientProp, 'access', _228 => _228.switchChain, 'optionalCall', _229 => _229({ id: chainId })]);
|
|
7028
7417
|
};
|
|
7029
7418
|
}, [walletClientProp]);
|
|
7030
|
-
const connectedWalletAddress = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess',
|
|
7419
|
+
const connectedWalletAddress = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess', _230 => _230.account, 'optionalAccess', _231 => _231.address]), () => ( null));
|
|
7031
7420
|
const walletOptions = _react.useMemo.call(void 0, () => {
|
|
7032
7421
|
const options = [];
|
|
7033
7422
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -7041,7 +7430,7 @@ function DepositFlow({
|
|
|
7041
7430
|
});
|
|
7042
7431
|
seen.add(id);
|
|
7043
7432
|
}
|
|
7044
|
-
if (_optionalChain([walletSession, 'optionalAccess',
|
|
7433
|
+
if (_optionalChain([walletSession, 'optionalAccess', _232 => _232.isConnected]) && walletSession.isSolana && walletSession.solanaAddress) {
|
|
7045
7434
|
const id = _nullishCoalesce(walletSession.caipAddress, () => ( `solana:${walletSession.solanaAddress}`));
|
|
7046
7435
|
if (!seen.has(id)) {
|
|
7047
7436
|
options.push({
|
|
@@ -7053,7 +7442,7 @@ function DepositFlow({
|
|
|
7053
7442
|
});
|
|
7054
7443
|
seen.add(id);
|
|
7055
7444
|
}
|
|
7056
|
-
} else if (_optionalChain([walletSession, 'optionalAccess',
|
|
7445
|
+
} else if (_optionalChain([walletSession, 'optionalAccess', _233 => _233.address]) && walletSession.isConnected && walletSession.canSignEvm && !seen.has(`evm:${walletSession.address.toLowerCase()}`)) {
|
|
7057
7446
|
const id = `evm:${walletSession.address.toLowerCase()}`;
|
|
7058
7447
|
if (!seen.has(id)) {
|
|
7059
7448
|
options.push({
|
|
@@ -7069,13 +7458,13 @@ function DepositFlow({
|
|
|
7069
7458
|
return options;
|
|
7070
7459
|
}, [
|
|
7071
7460
|
connectedWalletAddress,
|
|
7072
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7073
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7074
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7075
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7076
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7077
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7078
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7461
|
+
_optionalChain([walletSession, 'optionalAccess', _234 => _234.address]),
|
|
7462
|
+
_optionalChain([walletSession, 'optionalAccess', _235 => _235.isConnected]),
|
|
7463
|
+
_optionalChain([walletSession, 'optionalAccess', _236 => _236.canSignEvm]),
|
|
7464
|
+
_optionalChain([walletSession, 'optionalAccess', _237 => _237.icon]),
|
|
7465
|
+
_optionalChain([walletSession, 'optionalAccess', _238 => _238.isSolana]),
|
|
7466
|
+
_optionalChain([walletSession, 'optionalAccess', _239 => _239.solanaAddress]),
|
|
7467
|
+
_optionalChain([walletSession, 'optionalAccess', _240 => _240.caipAddress])
|
|
7079
7468
|
]);
|
|
7080
7469
|
const offeredFiatMethods = _react.useMemo.call(void 0,
|
|
7081
7470
|
() => fiatMethods ? FIAT_ONRAMP_METHODS.filter((m) => fiatMethods[m.method]) : FIAT_ONRAMP_METHODS,
|
|
@@ -7095,11 +7484,11 @@ function DepositFlow({
|
|
|
7095
7484
|
hasEnabledAssetMigration
|
|
7096
7485
|
].filter(Boolean).length;
|
|
7097
7486
|
const canAutoLock = Boolean(
|
|
7098
|
-
enableWallet && _optionalChain([walletClientProp, 'optionalAccess',
|
|
7487
|
+
enableWallet && _optionalChain([walletClientProp, 'optionalAccess', _241 => _241.account]) && !walletSession && enabledFeatureCount === 1
|
|
7099
7488
|
);
|
|
7100
7489
|
const hasWalletOptions = enableWallet && walletOptions.length > 0;
|
|
7101
7490
|
const hasReownSession = Boolean(
|
|
7102
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7491
|
+
_optionalChain([walletSession, 'optionalAccess', _242 => _242.isConnected]) || _optionalChain([walletSession, 'optionalAccess', _243 => _243.address])
|
|
7103
7492
|
);
|
|
7104
7493
|
const isDappImportWalletHydrating = Boolean(
|
|
7105
7494
|
hasWalletClientProp && walletClientProp === void 0 || walletSession && !hasReownSession && !walletSession.isReady
|
|
@@ -7130,7 +7519,7 @@ function DepositFlow({
|
|
|
7130
7519
|
return;
|
|
7131
7520
|
}
|
|
7132
7521
|
let cancelled = false;
|
|
7133
|
-
|
|
7522
|
+
_chunk7ICSHJFEcjs.fetchTokenPriceUsd.call(void 0, service, {
|
|
7134
7523
|
chainId: targetChainId,
|
|
7135
7524
|
address: targetToken,
|
|
7136
7525
|
symbol: targetSymbol
|
|
@@ -7147,11 +7536,11 @@ function DepositFlow({
|
|
|
7147
7536
|
return null;
|
|
7148
7537
|
}
|
|
7149
7538
|
if (canAutoLock) {
|
|
7150
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess',
|
|
7539
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess', _244 => _244.chain, 'optionalAccess', _245 => _245.id]), () => ( setupChainId));
|
|
7151
7540
|
return {
|
|
7152
7541
|
ownerAddress: walletClientProp.account.address,
|
|
7153
7542
|
walletClient: walletClientProp,
|
|
7154
|
-
publicClient: _nullishCoalesce(publicClientProp, () => (
|
|
7543
|
+
publicClient: _nullishCoalesce(publicClientProp, () => ( _chunkV2OBGLJDcjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
|
|
7155
7544
|
switchChain: dappSwitchChain
|
|
7156
7545
|
};
|
|
7157
7546
|
}
|
|
@@ -7163,20 +7552,20 @@ function DepositFlow({
|
|
|
7163
7552
|
if (selectedOption.kind === "solana") {
|
|
7164
7553
|
return null;
|
|
7165
7554
|
}
|
|
7166
|
-
if (selectedOption.kind === "connected" && _optionalChain([walletClientProp, 'optionalAccess',
|
|
7167
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess',
|
|
7555
|
+
if (selectedOption.kind === "connected" && _optionalChain([walletClientProp, 'optionalAccess', _246 => _246.account]) && selectedOption.address && walletClientProp.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
7556
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess', _247 => _247.chain, 'optionalAccess', _248 => _248.id]), () => ( setupChainId));
|
|
7168
7557
|
return {
|
|
7169
7558
|
ownerAddress: walletClientProp.account.address,
|
|
7170
7559
|
walletClient: walletClientProp,
|
|
7171
|
-
publicClient: _nullishCoalesce(publicClientProp, () => (
|
|
7560
|
+
publicClient: _nullishCoalesce(publicClientProp, () => ( _chunkV2OBGLJDcjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
|
|
7172
7561
|
switchChain: dappSwitchChain
|
|
7173
7562
|
};
|
|
7174
7563
|
}
|
|
7175
|
-
if (selectedOption.kind === "external" && _optionalChain([walletSession, 'optionalAccess',
|
|
7564
|
+
if (selectedOption.kind === "external" && _optionalChain([walletSession, 'optionalAccess', _249 => _249.address]) && selectedOption.address && walletSession.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
7176
7565
|
return {
|
|
7177
7566
|
ownerAddress: walletSession.address,
|
|
7178
7567
|
walletClient: walletSession.walletClient,
|
|
7179
|
-
publicClient: _nullishCoalesce(walletSession.publicClient, () => (
|
|
7568
|
+
publicClient: _nullishCoalesce(walletSession.publicClient, () => ( _chunkV2OBGLJDcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
|
|
7180
7569
|
switchChain: walletSession.switchChain
|
|
7181
7570
|
};
|
|
7182
7571
|
}
|
|
@@ -7198,7 +7587,7 @@ function DepositFlow({
|
|
|
7198
7587
|
// nothing else here when the host switches chain, and the context would go
|
|
7199
7588
|
// on holding a client bound to the old one: `chainMismatch` never clears
|
|
7200
7589
|
// and the CTA stays disabled with nothing beside it.
|
|
7201
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7590
|
+
_optionalChain([walletSession, 'optionalAccess', _250 => _250.walletClient]),
|
|
7202
7591
|
setupChainId,
|
|
7203
7592
|
rpcUrls
|
|
7204
7593
|
]);
|
|
@@ -7238,35 +7627,35 @@ function DepositFlow({
|
|
|
7238
7627
|
const selectedEvmWalletOwner = _react.useMemo.call(void 0, () => {
|
|
7239
7628
|
if (!selectedWalletId) return null;
|
|
7240
7629
|
const opt = walletOptions.find((o) => o.id === selectedWalletId);
|
|
7241
|
-
if (_optionalChain([opt, 'optionalAccess',
|
|
7630
|
+
if (_optionalChain([opt, 'optionalAccess', _251 => _251.kind]) === "external" && opt.address) {
|
|
7242
7631
|
return opt.address;
|
|
7243
7632
|
}
|
|
7244
|
-
if (_optionalChain([opt, 'optionalAccess',
|
|
7633
|
+
if (_optionalChain([opt, 'optionalAccess', _252 => _252.kind]) === "connected" && opt.address) {
|
|
7245
7634
|
return opt.address;
|
|
7246
7635
|
}
|
|
7247
7636
|
return null;
|
|
7248
7637
|
}, [selectedWalletId, walletOptions]);
|
|
7249
7638
|
const dappImportOwner = _react.useMemo.call(void 0, () => {
|
|
7250
7639
|
if (selectedEvmWalletOwner) return selectedEvmWalletOwner;
|
|
7251
|
-
if (_optionalChain([walletSession, 'optionalAccess',
|
|
7640
|
+
if (_optionalChain([walletSession, 'optionalAccess', _253 => _253.address]) && walletSession.isConnected) {
|
|
7252
7641
|
return walletSession.address;
|
|
7253
7642
|
}
|
|
7254
7643
|
if (connectedWalletAddress) return connectedWalletAddress;
|
|
7255
7644
|
return null;
|
|
7256
7645
|
}, [
|
|
7257
7646
|
selectedEvmWalletOwner,
|
|
7258
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7259
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7647
|
+
_optionalChain([walletSession, 'optionalAccess', _254 => _254.address]),
|
|
7648
|
+
_optionalChain([walletSession, 'optionalAccess', _255 => _255.isConnected]),
|
|
7260
7649
|
connectedWalletAddress
|
|
7261
7650
|
]);
|
|
7262
7651
|
const activeOwner = _react.useMemo.call(void 0,
|
|
7263
7652
|
() => resolveOwnerForMode(flowMode, {
|
|
7264
|
-
walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess',
|
|
7653
|
+
walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _256 => _256.ownerAddress]), () => ( (canAutoLock ? connectedWalletAddress : selectedEvmWalletOwner))),
|
|
7265
7654
|
dappImportOwner
|
|
7266
7655
|
}),
|
|
7267
7656
|
[
|
|
7268
7657
|
flowMode,
|
|
7269
|
-
_optionalChain([signerContext, 'optionalAccess',
|
|
7658
|
+
_optionalChain([signerContext, 'optionalAccess', _257 => _257.ownerAddress]),
|
|
7270
7659
|
canAutoLock,
|
|
7271
7660
|
connectedWalletAddress,
|
|
7272
7661
|
selectedEvmWalletOwner,
|
|
@@ -7283,7 +7672,7 @@ function DepositFlow({
|
|
|
7283
7672
|
].join(":");
|
|
7284
7673
|
if (lastSmartAccountLifecycleKeyRef.current === lifecycleKey) return;
|
|
7285
7674
|
lastSmartAccountLifecycleKeyRef.current = lifecycleKey;
|
|
7286
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7675
|
+
_optionalChain([onLifecycleRef, 'access', _258 => _258.current, 'optionalCall', _259 => _259({
|
|
7287
7676
|
type: "smart-account-changed",
|
|
7288
7677
|
evm: activeEntry.smartAccount,
|
|
7289
7678
|
solana: _nullishCoalesce(activeEntry.solanaDepositAddress, () => ( null))
|
|
@@ -7311,7 +7700,7 @@ function DepositFlow({
|
|
|
7311
7700
|
return;
|
|
7312
7701
|
}
|
|
7313
7702
|
lastConnectedLifecycleKeyRef.current = lifecycleKey;
|
|
7314
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7703
|
+
_optionalChain([onLifecycleRef, 'access', _260 => _260.current, 'optionalCall', _261 => _261({
|
|
7315
7704
|
type: "connected",
|
|
7316
7705
|
address: activeOwner,
|
|
7317
7706
|
smartAccount: activeEntry.smartAccount
|
|
@@ -7344,11 +7733,52 @@ function DepositFlow({
|
|
|
7344
7733
|
);
|
|
7345
7734
|
const step = effectiveStep;
|
|
7346
7735
|
const handleBack = _react.useCallback.call(void 0, () => {
|
|
7736
|
+
if ([
|
|
7737
|
+
"deposit-address",
|
|
7738
|
+
"select-asset",
|
|
7739
|
+
"solana-token-select",
|
|
7740
|
+
"fiat-onramp",
|
|
7741
|
+
"exchange-select",
|
|
7742
|
+
"exchange-connect",
|
|
7743
|
+
"dapp-import-resolving",
|
|
7744
|
+
"dapp-import-select",
|
|
7745
|
+
"dapp-import-asset-select"
|
|
7746
|
+
].includes(effectiveStep.type)) {
|
|
7747
|
+
analytics.abandon("back");
|
|
7748
|
+
analytics.resetAttempt(
|
|
7749
|
+
effectiveStep.type === "exchange-connect" ? "exchange_connect" : null
|
|
7750
|
+
);
|
|
7751
|
+
}
|
|
7752
|
+
storeApi.dispatch({
|
|
7753
|
+
type: "back/requested",
|
|
7754
|
+
hasWalletOptions: hasWalletOptions || Boolean(walletSession)
|
|
7755
|
+
});
|
|
7756
|
+
}, [
|
|
7757
|
+
analytics,
|
|
7758
|
+
effectiveStep.type,
|
|
7759
|
+
storeApi,
|
|
7760
|
+
hasWalletOptions,
|
|
7761
|
+
walletSession
|
|
7762
|
+
]);
|
|
7763
|
+
const handleProviderBack = _react.useCallback.call(void 0, () => {
|
|
7764
|
+
analytics.abandon("provider_back");
|
|
7765
|
+
analytics.resetAttempt(
|
|
7766
|
+
flowMode === "exchange-connect" ? "exchange_connect" : null
|
|
7767
|
+
);
|
|
7768
|
+
storeApi.dispatch({
|
|
7769
|
+
type: "back/requested",
|
|
7770
|
+
hasWalletOptions: hasWalletOptions || Boolean(walletSession)
|
|
7771
|
+
});
|
|
7772
|
+
}, [analytics, flowMode, storeApi, hasWalletOptions, walletSession]);
|
|
7773
|
+
const handleWalletDisconnect = _react.useCallback.call(void 0, () => {
|
|
7774
|
+
analytics.abandon("wallet_disconnect");
|
|
7775
|
+
analytics.resetAttempt();
|
|
7776
|
+
_optionalChain([onDisconnect, 'optionalCall', _262 => _262()]);
|
|
7347
7777
|
storeApi.dispatch({
|
|
7348
7778
|
type: "back/requested",
|
|
7349
7779
|
hasWalletOptions: hasWalletOptions || Boolean(walletSession)
|
|
7350
7780
|
});
|
|
7351
|
-
}, [
|
|
7781
|
+
}, [analytics, hasWalletOptions, onDisconnect, storeApi, walletSession]);
|
|
7352
7782
|
const qrSourceAsset = effectiveStep.type === "qr-amount" ? effectiveStep.asset : null;
|
|
7353
7783
|
const qrSourceKey = qrSourceAsset ? `${qrSourceAsset.chainId}:${qrSourceAsset.token}` : null;
|
|
7354
7784
|
const [qrSourcePrice, setQrSourcePrice] = _react.useState.call(void 0, { resolved: false, usd: null });
|
|
@@ -7356,7 +7786,7 @@ function DepositFlow({
|
|
|
7356
7786
|
setQrSourcePrice({ resolved: false, usd: null });
|
|
7357
7787
|
if (!qrSourceAsset) return;
|
|
7358
7788
|
let cancelled = false;
|
|
7359
|
-
|
|
7789
|
+
_chunk7ICSHJFEcjs.fetchTokenPriceUsd.call(void 0, service, {
|
|
7360
7790
|
chainId: qrSourceAsset.chainId,
|
|
7361
7791
|
address: qrSourceAsset.token,
|
|
7362
7792
|
symbol: qrSourceAsset.symbol
|
|
@@ -7379,7 +7809,7 @@ function DepositFlow({
|
|
|
7379
7809
|
const currentBackHandler = canGoBackFromHere ? handleBack : void 0;
|
|
7380
7810
|
const currentScreen = showConnectStep ? "connect" : effectiveStep.type;
|
|
7381
7811
|
_react.useEffect.call(void 0, () => {
|
|
7382
|
-
_optionalChain([onStepChangeRef, 'access',
|
|
7812
|
+
_optionalChain([onStepChangeRef, 'access', _263 => _263.current, 'optionalCall', _264 => _264(currentBackHandler, currentScreen)]);
|
|
7383
7813
|
}, [currentBackHandler, currentScreen, onStepChangeRef]);
|
|
7384
7814
|
const lastModalHeightRef = _react.useRef.call(void 0, 0);
|
|
7385
7815
|
const modalContentElRef = _react.useRef.call(void 0, null);
|
|
@@ -7389,7 +7819,7 @@ function DepositFlow({
|
|
|
7389
7819
|
modalContentElRef.current = mc;
|
|
7390
7820
|
const ro = new ResizeObserver((entries) => {
|
|
7391
7821
|
for (const entry of entries) {
|
|
7392
|
-
const border = _optionalChain([entry, 'access',
|
|
7822
|
+
const border = _optionalChain([entry, 'access', _265 => _265.borderBoxSize, 'optionalAccess', _266 => _266[0], 'optionalAccess', _267 => _267.blockSize]);
|
|
7393
7823
|
lastModalHeightRef.current = typeof border === "number" ? border : entry.contentRect.height;
|
|
7394
7824
|
}
|
|
7395
7825
|
});
|
|
@@ -7417,51 +7847,22 @@ function DepositFlow({
|
|
|
7417
7847
|
});
|
|
7418
7848
|
return () => cancelAnimationFrame(rafId);
|
|
7419
7849
|
}, [stepPinKey]);
|
|
7420
|
-
const
|
|
7421
|
-
const
|
|
7422
|
-
|
|
7850
|
+
const analyticsMethod = fundingMethodForFlowMode(flowMode);
|
|
7851
|
+
const analyticsStep = analyticsStepForFlowStep(
|
|
7852
|
+
analyticsMethod,
|
|
7853
|
+
showConnectStep ? "connect" : effectiveStep.type
|
|
7854
|
+
);
|
|
7423
7855
|
_react.useEffect.call(void 0, () => {
|
|
7424
|
-
|
|
7425
|
-
|
|
7426
|
-
|
|
7427
|
-
|
|
7428
|
-
if (
|
|
7429
|
-
|
|
7430
|
-
}
|
|
7431
|
-
|
|
7432
|
-
if (effectiveStep.type === "select-asset") {
|
|
7433
|
-
_optionalChain([onEventRef, 'access', _249 => _249.current, 'optionalCall', _250 => _250({
|
|
7434
|
-
type: "deposit_modal_connected_wallet_select_source_open",
|
|
7435
|
-
total_balance_in_external_wallet: totalBalanceUsd,
|
|
7436
|
-
pred_balance: totalBalanceUsd
|
|
7437
|
-
})]);
|
|
7438
|
-
} else if (effectiveStep.type === "deposit-address") {
|
|
7439
|
-
const chainName = _chunk4KCSH4T3cjs.getChainName.call(void 0, targetChainId);
|
|
7440
|
-
const tokenSymbol = _chunk4KCSH4T3cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
7441
|
-
_optionalChain([onEventRef, 'access', _251 => _251.current, 'optionalCall', _252 => _252({
|
|
7442
|
-
type: "deposit_modal_transfer_crypto_open",
|
|
7443
|
-
default_chain: chainName,
|
|
7444
|
-
default_token: tokenSymbol,
|
|
7445
|
-
pred_balance: totalBalanceUsd
|
|
7446
|
-
})]);
|
|
7447
|
-
} else if (effectiveStep.type === "amount" && stepSendToken) {
|
|
7448
|
-
const receiveSymbol = _chunk4KCSH4T3cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
7449
|
-
_optionalChain([onEventRef, 'access', _253 => _253.current, 'optionalCall', _254 => _254({
|
|
7450
|
-
type: "deposit_modal_connected_wallet_enter_value_open",
|
|
7451
|
-
send_token: stepSendToken,
|
|
7452
|
-
receive_token: receiveSymbol,
|
|
7453
|
-
pred_balance: totalBalanceUsd
|
|
7454
|
-
})]);
|
|
7856
|
+
analytics.openSession();
|
|
7857
|
+
analytics.openStep(analyticsStep);
|
|
7858
|
+
}, [analytics, analyticsStep]);
|
|
7859
|
+
_react.useEffect.call(void 0, () => {
|
|
7860
|
+
if (setupSlice.status === "loading") {
|
|
7861
|
+
analytics.friction("account_setup_pending", "account_setup");
|
|
7862
|
+
} else if (setupSlice.status === "error") {
|
|
7863
|
+
analytics.failure("account_setup_failed", true, "account_setup");
|
|
7455
7864
|
}
|
|
7456
|
-
}, [
|
|
7457
|
-
effectiveStep.type,
|
|
7458
|
-
stepOpenEventKey,
|
|
7459
|
-
stepSendToken,
|
|
7460
|
-
targetChain,
|
|
7461
|
-
targetToken,
|
|
7462
|
-
totalBalanceUsd,
|
|
7463
|
-
onEventRef
|
|
7464
|
-
]);
|
|
7865
|
+
}, [analytics, setupSlice.status]);
|
|
7465
7866
|
_react.useEffect.call(void 0, () => {
|
|
7466
7867
|
logFlow("state:changed", {
|
|
7467
7868
|
step: effectiveStep.type,
|
|
@@ -7479,7 +7880,7 @@ function DepositFlow({
|
|
|
7479
7880
|
targetToken
|
|
7480
7881
|
]);
|
|
7481
7882
|
_react.useEffect.call(void 0, () => {
|
|
7482
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7883
|
+
_optionalChain([onLifecycleRef, 'access', _268 => _268.current, 'optionalCall', _269 => _269({
|
|
7483
7884
|
type: "balance-changed",
|
|
7484
7885
|
totalUsd: totalBalanceUsd
|
|
7485
7886
|
})]);
|
|
@@ -7490,22 +7891,27 @@ function DepositFlow({
|
|
|
7490
7891
|
const isFiatOnrampMode = flowMode === "fiat-onramp";
|
|
7491
7892
|
const isExchangeConnectMode = flowMode === "exchange-connect";
|
|
7492
7893
|
const handleSelectTransferCrypto = _react.useCallback.call(void 0, () => {
|
|
7894
|
+
analytics.selectMethod("transfer", "user");
|
|
7493
7895
|
storeApi.dispatch({ type: "connect/transfer-crypto-selected" });
|
|
7494
|
-
}, [storeApi]);
|
|
7896
|
+
}, [analytics, storeApi]);
|
|
7495
7897
|
const handleConfirmWallet = _react.useCallback.call(void 0,
|
|
7496
7898
|
(walletId) => {
|
|
7497
7899
|
const selectedOption = walletOptions.find((o) => o.id === walletId);
|
|
7498
|
-
const mode = _optionalChain([selectedOption, 'optionalAccess',
|
|
7900
|
+
const mode = _optionalChain([selectedOption, 'optionalAccess', _270 => _270.kind]) === "solana" ? "solana-wallet" : "wallet";
|
|
7901
|
+
analytics.selectMethod("wallet", "user", {
|
|
7902
|
+
network: _optionalChain([selectedOption, 'optionalAccess', _271 => _271.kind]) === "solana" ? "solana" : "evm",
|
|
7903
|
+
integration: _nullishCoalesce(walletIntegration, () => ( "none"))
|
|
7904
|
+
});
|
|
7499
7905
|
storeApi.dispatch({
|
|
7500
7906
|
type: "connect/wallet-confirmed",
|
|
7501
7907
|
walletId,
|
|
7502
7908
|
mode
|
|
7503
7909
|
});
|
|
7504
7910
|
},
|
|
7505
|
-
[walletOptions, storeApi]
|
|
7911
|
+
[analytics, walletIntegration, walletOptions, storeApi]
|
|
7506
7912
|
);
|
|
7507
7913
|
const isSolanaWalletConnected = Boolean(
|
|
7508
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7914
|
+
_optionalChain([walletSession, 'optionalAccess', _272 => _272.isConnected]) && _optionalChain([walletSession, 'optionalAccess', _273 => _273.isSolana])
|
|
7509
7915
|
);
|
|
7510
7916
|
const assetMigrationsKey = assetMigrations ? Object.keys(assetMigrations).filter((k) => assetMigrations[k]).sort().join(",") : "";
|
|
7511
7917
|
const enabledDappImportProviders = _react.useMemo.call(void 0,
|
|
@@ -7522,7 +7928,7 @@ function DepositFlow({
|
|
|
7522
7928
|
const owner = dappImportOwner;
|
|
7523
7929
|
if (owner) {
|
|
7524
7930
|
const wallet = walletOptions.find(
|
|
7525
|
-
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess',
|
|
7931
|
+
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _274 => _274.toLowerCase, 'call', _275 => _275()]) === owner.toLowerCase()
|
|
7526
7932
|
);
|
|
7527
7933
|
if (wallet) {
|
|
7528
7934
|
storeApi.dispatch({
|
|
@@ -7531,12 +7937,15 @@ function DepositFlow({
|
|
|
7531
7937
|
});
|
|
7532
7938
|
}
|
|
7533
7939
|
}
|
|
7940
|
+
analytics.selectMethod("asset_migration", "user", {
|
|
7941
|
+
provider: providerId
|
|
7942
|
+
});
|
|
7534
7943
|
storeApi.dispatch({
|
|
7535
7944
|
type: "dapp-import/provider-selected",
|
|
7536
7945
|
providerId
|
|
7537
7946
|
});
|
|
7538
7947
|
},
|
|
7539
|
-
[storeApi, walletOptions, dappImportOwner]
|
|
7948
|
+
[analytics, storeApi, walletOptions, dappImportOwner]
|
|
7540
7949
|
);
|
|
7541
7950
|
const handleDappImportAssetSelected = _react.useCallback.call(void 0,
|
|
7542
7951
|
(asset) => {
|
|
@@ -7563,7 +7972,7 @@ function DepositFlow({
|
|
|
7563
7972
|
eoa: dappImportOwner,
|
|
7564
7973
|
getPublicClient: (chainId) => {
|
|
7565
7974
|
try {
|
|
7566
|
-
return
|
|
7975
|
+
return _chunkV2OBGLJDcjs.getPublicClient.call(void 0, chainId, rpcUrls);
|
|
7567
7976
|
} catch (e38) {
|
|
7568
7977
|
return null;
|
|
7569
7978
|
}
|
|
@@ -7582,6 +7991,12 @@ function DepositFlow({
|
|
|
7582
7991
|
});
|
|
7583
7992
|
}).catch(() => {
|
|
7584
7993
|
if (controller.signal.aborted) return;
|
|
7994
|
+
if (analytics.method === "asset_migration") {
|
|
7995
|
+
analytics.friction(
|
|
7996
|
+
"migration_availability_failed",
|
|
7997
|
+
"migration_provider_selection"
|
|
7998
|
+
);
|
|
7999
|
+
}
|
|
7585
8000
|
storeApi.dispatch({
|
|
7586
8001
|
type: "dapp-import/availability-failed",
|
|
7587
8002
|
providerId: provider.id,
|
|
@@ -7591,6 +8006,7 @@ function DepositFlow({
|
|
|
7591
8006
|
}
|
|
7592
8007
|
return () => controller.abort();
|
|
7593
8008
|
}, [
|
|
8009
|
+
analytics,
|
|
7594
8010
|
dappImportOwner,
|
|
7595
8011
|
enabledDappImportProviders,
|
|
7596
8012
|
dappImportAttemptNonce,
|
|
@@ -7603,11 +8019,14 @@ function DepositFlow({
|
|
|
7603
8019
|
if (flowSlice.step !== "connect" || flowSlice.mode !== null || flowSlice.isConnectSelectionConfirmed || flowSlice.hasNavigatedBack) {
|
|
7604
8020
|
return;
|
|
7605
8021
|
}
|
|
8022
|
+
analytics.selectMethod("asset_migration", "initial_config", {
|
|
8023
|
+
provider: initialAssetMigrationProvider.id
|
|
8024
|
+
});
|
|
7606
8025
|
storeApi.dispatch({
|
|
7607
8026
|
type: "dapp-import/boot-requested",
|
|
7608
8027
|
providerId: initialAssetMigrationProvider.id
|
|
7609
8028
|
});
|
|
7610
|
-
}, [initialAssetMigrationProvider, flowSlice, storeApi]);
|
|
8029
|
+
}, [analytics, initialAssetMigrationProvider, flowSlice, storeApi]);
|
|
7611
8030
|
const dappImportAvailability = useDepositStore((s) => s.dappImport.availability);
|
|
7612
8031
|
const dappImportAvailabilityOwner = useDepositStore(
|
|
7613
8032
|
(s) => s.dappImport.availabilityOwner
|
|
@@ -7656,7 +8075,7 @@ function DepositFlow({
|
|
|
7656
8075
|
}, [activeDappImportProviderId, enabledDappImportProviders]);
|
|
7657
8076
|
const activeDappImportAvailability = _react.useMemo.call(void 0, () => {
|
|
7658
8077
|
if (!activeDappImportProviderId) return null;
|
|
7659
|
-
if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess',
|
|
8078
|
+
if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _276 => _276.toLowerCase, 'call', _277 => _277()]) !== dappImportOwner.toLowerCase()) {
|
|
7660
8079
|
return null;
|
|
7661
8080
|
}
|
|
7662
8081
|
const entry = dappImportAvailability[activeDappImportProviderId];
|
|
@@ -7683,6 +8102,8 @@ function DepositFlow({
|
|
|
7683
8102
|
const providerId = activeDappImportProviderId;
|
|
7684
8103
|
if (!providerId) return;
|
|
7685
8104
|
if (!enabledDappImportProviders.some((p) => p.id === providerId)) {
|
|
8105
|
+
analytics.abandon("initial_migration_fallback");
|
|
8106
|
+
analytics.resetAttempt();
|
|
7686
8107
|
storeApi.dispatch({
|
|
7687
8108
|
type: "dapp-import/boot-resolved",
|
|
7688
8109
|
providerId,
|
|
@@ -7697,7 +8118,7 @@ function DepositFlow({
|
|
|
7697
8118
|
setup: setupSlice
|
|
7698
8119
|
});
|
|
7699
8120
|
const pinnableWallet = dappImportOwner ? _nullishCoalesce(walletOptions.find(
|
|
7700
|
-
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess',
|
|
8121
|
+
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _278 => _278.toLowerCase, 'call', _279 => _279()]) === dappImportOwner.toLowerCase()
|
|
7701
8122
|
), () => ( null)) : null;
|
|
7702
8123
|
const outcome = resolveBootOutcome({
|
|
7703
8124
|
status,
|
|
@@ -7712,6 +8133,9 @@ function DepositFlow({
|
|
|
7712
8133
|
type: "wallet/id-selected",
|
|
7713
8134
|
walletId: pinnableWallet.id
|
|
7714
8135
|
});
|
|
8136
|
+
} else if (outcome === "unavailable") {
|
|
8137
|
+
analytics.abandon("initial_migration_fallback");
|
|
8138
|
+
analytics.resetAttempt();
|
|
7715
8139
|
}
|
|
7716
8140
|
storeApi.dispatch({
|
|
7717
8141
|
type: "dapp-import/boot-resolved",
|
|
@@ -7730,16 +8154,21 @@ function DepositFlow({
|
|
|
7730
8154
|
hasResolveDeadlinePassed,
|
|
7731
8155
|
isDappImportWalletHydrating,
|
|
7732
8156
|
walletOptions,
|
|
8157
|
+
analytics,
|
|
7733
8158
|
storeApi
|
|
7734
8159
|
]);
|
|
7735
8160
|
const handleBootRetry = _react.useCallback.call(void 0, () => {
|
|
8161
|
+
analytics.retry(
|
|
8162
|
+
"migration_availability_failed",
|
|
8163
|
+
"migration_boot_resolve"
|
|
8164
|
+
);
|
|
7736
8165
|
const snapshot = storeApi.getState();
|
|
7737
8166
|
const providerId = snapshot.dappImport.activeProviderId;
|
|
7738
8167
|
if (!providerId) return;
|
|
7739
8168
|
if (dappImportOwner) {
|
|
7740
8169
|
const plan = bootRetryPlan({
|
|
7741
8170
|
setupStatus: snapshot.setup.status,
|
|
7742
|
-
availabilityEntry: _optionalChain([snapshot, 'access',
|
|
8171
|
+
availabilityEntry: _optionalChain([snapshot, 'access', _280 => _280.dappImport, 'access', _281 => _281.availabilityOwner, 'optionalAccess', _282 => _282.toLowerCase, 'call', _283 => _283()]) === dappImportOwner.toLowerCase() ? snapshot.dappImport.availability[providerId] : void 0
|
|
7743
8172
|
});
|
|
7744
8173
|
if (plan.restartSetup) {
|
|
7745
8174
|
storeApi.dispatch({ type: "setup/retry-requested" });
|
|
@@ -7754,20 +8183,45 @@ function DepositFlow({
|
|
|
7754
8183
|
type: "dapp-import/boot-requested",
|
|
7755
8184
|
providerId
|
|
7756
8185
|
});
|
|
7757
|
-
}, [storeApi, dappImportOwner]);
|
|
8186
|
+
}, [analytics, storeApi, dappImportOwner]);
|
|
7758
8187
|
const handleSelectFiatMethod = _react.useCallback.call(void 0,
|
|
7759
8188
|
(paymentMethod, methodSelectionSource) => {
|
|
8189
|
+
analytics.selectMethod("fiat_onramp", "user", {
|
|
8190
|
+
payment_method: paymentMethod,
|
|
8191
|
+
source: methodSelectionSource
|
|
8192
|
+
});
|
|
7760
8193
|
storeApi.dispatch({
|
|
7761
8194
|
type: "connect/fiat-onramp-selected",
|
|
7762
8195
|
paymentMethod,
|
|
7763
8196
|
methodSelectionSource
|
|
7764
8197
|
});
|
|
7765
8198
|
},
|
|
7766
|
-
[storeApi]
|
|
8199
|
+
[analytics, storeApi]
|
|
7767
8200
|
);
|
|
7768
8201
|
const handleSelectExchange = _react.useCallback.call(void 0, () => {
|
|
8202
|
+
analytics.selectMethod("exchange_connect", "user");
|
|
7769
8203
|
storeApi.dispatch({ type: "connect/exchange-selected" });
|
|
7770
|
-
}, [storeApi]);
|
|
8204
|
+
}, [analytics, storeApi]);
|
|
8205
|
+
const swappedAnalyticsCorrelatorRef = _react.useRef.call(void 0, null);
|
|
8206
|
+
const handleSwappedAttemptConsumed = _react.useCallback.call(void 0, (externalCustomerId) => {
|
|
8207
|
+
swappedAnalyticsCorrelatorRef.current = externalCustomerId;
|
|
8208
|
+
}, []);
|
|
8209
|
+
const handleSwappedProviderHandoff = _react.useCallback.call(void 0, () => {
|
|
8210
|
+
const externalCustomerId = swappedAnalyticsCorrelatorRef.current;
|
|
8211
|
+
if (!externalCustomerId) return;
|
|
8212
|
+
analytics.handoff(
|
|
8213
|
+
flowMode === "exchange-connect" ? "exchange_connect" : "fiat_onramp",
|
|
8214
|
+
{ type: "swapped_external_customer_id", value: externalCustomerId },
|
|
8215
|
+
flowMode === "exchange-connect" ? "exchange_provider_handoff" : "fiat_provider_handoff"
|
|
8216
|
+
);
|
|
8217
|
+
}, [analytics, flowMode]);
|
|
8218
|
+
const handleSwappedRetry = _react.useCallback.call(void 0, () => {
|
|
8219
|
+
analytics.retry(
|
|
8220
|
+
"swapped_mint_failed",
|
|
8221
|
+
flowMode === "exchange-connect" ? "exchange_provider_mint" : "fiat_provider_mint"
|
|
8222
|
+
);
|
|
8223
|
+
swappedAnalyticsCorrelatorRef.current = null;
|
|
8224
|
+
}, [analytics, flowMode]);
|
|
7771
8225
|
const swappedConnectUrlRef = _react.useRef.call(void 0, /* @__PURE__ */ new Map());
|
|
7772
8226
|
const acknowledgedConnectFeeRef = _react.useRef.call(void 0, /* @__PURE__ */ new Map());
|
|
7773
8227
|
const handleSelectExchangeConnection = _react.useCallback.call(void 0,
|
|
@@ -7788,7 +8242,7 @@ function DepositFlow({
|
|
|
7788
8242
|
acceptedExchangeFeeBps: disclosedFeeBps
|
|
7789
8243
|
});
|
|
7790
8244
|
} catch (error) {
|
|
7791
|
-
if (error instanceof
|
|
8245
|
+
if (error instanceof _chunkV2OBGLJDcjs.SwappedConnectFeeChangedError) {
|
|
7792
8246
|
return error.exchangeFeeBps;
|
|
7793
8247
|
}
|
|
7794
8248
|
throw error;
|
|
@@ -7796,7 +8250,7 @@ function DepositFlow({
|
|
|
7796
8250
|
entry = { smartAccount: owner, response };
|
|
7797
8251
|
}
|
|
7798
8252
|
const currentAccount = storeApi.getState().setup.smartAccount;
|
|
7799
|
-
if (_optionalChain([currentAccount, 'optionalAccess',
|
|
8253
|
+
if (_optionalChain([currentAccount, 'optionalAccess', _284 => _284.toLowerCase, 'call', _285 => _285()]) !== owner) {
|
|
7800
8254
|
swappedConnectUrlRef.current.delete(key);
|
|
7801
8255
|
throw new Error("Deposit account changed. Select your exchange again.");
|
|
7802
8256
|
}
|
|
@@ -7808,13 +8262,16 @@ function DepositFlow({
|
|
|
7808
8262
|
}
|
|
7809
8263
|
swappedConnectUrlRef.current.set(key, entry);
|
|
7810
8264
|
acknowledgedConnectFeeRef.current.set(key, actualFeeBps);
|
|
8265
|
+
analytics.selectMethod("exchange_connect", "user", {
|
|
8266
|
+
exchange: connection
|
|
8267
|
+
});
|
|
7811
8268
|
storeApi.dispatch({
|
|
7812
8269
|
type: "exchange/connection-selected",
|
|
7813
8270
|
connection
|
|
7814
8271
|
});
|
|
7815
8272
|
return actualFeeBps;
|
|
7816
8273
|
},
|
|
7817
|
-
[service, setupSlice.status, setupSlice.smartAccount, storeApi]
|
|
8274
|
+
[analytics, service, setupSlice.status, setupSlice.smartAccount, storeApi]
|
|
7818
8275
|
);
|
|
7819
8276
|
const loadSwappedConnectUrl = _react.useCallback.call(void 0,
|
|
7820
8277
|
async (smartAccount, connection) => {
|
|
@@ -7827,7 +8284,7 @@ function DepositFlow({
|
|
|
7827
8284
|
);
|
|
7828
8285
|
}
|
|
7829
8286
|
swappedConnectUrlRef.current.delete(key);
|
|
7830
|
-
const response = _optionalChain([entry, 'optionalAccess',
|
|
8287
|
+
const response = _optionalChain([entry, 'optionalAccess', _286 => _286.smartAccount]) === smartAccount.toLowerCase() ? entry.response : await service.getSwappedConnectUrl({
|
|
7831
8288
|
smartAccount,
|
|
7832
8289
|
connection,
|
|
7833
8290
|
acceptedExchangeFeeBps: expectedFeeBps
|
|
@@ -7916,9 +8373,10 @@ function DepositFlow({
|
|
|
7916
8373
|
recommendedMethod: null
|
|
7917
8374
|
});
|
|
7918
8375
|
let settled = false;
|
|
7919
|
-
const showFallback = () => {
|
|
8376
|
+
const showFallback = (reason) => {
|
|
7920
8377
|
if (cancelled || settled) return;
|
|
7921
8378
|
settled = true;
|
|
8379
|
+
analytics.friction(reason, "fiat_regional_payment_method");
|
|
7922
8380
|
setRegionalMethods({
|
|
7923
8381
|
status: "error",
|
|
7924
8382
|
country: null,
|
|
@@ -7926,7 +8384,10 @@ function DepositFlow({
|
|
|
7926
8384
|
recommendedMethod: null
|
|
7927
8385
|
});
|
|
7928
8386
|
};
|
|
7929
|
-
const timeoutTimer = setTimeout(
|
|
8387
|
+
const timeoutTimer = setTimeout(
|
|
8388
|
+
() => showFallback("regional_methods_timeout"),
|
|
8389
|
+
REGIONAL_METHODS_TIMEOUT_MS
|
|
8390
|
+
);
|
|
7930
8391
|
service.getSwappedPaymentMethods().then((res) => {
|
|
7931
8392
|
if (cancelled || settled) return;
|
|
7932
8393
|
settled = true;
|
|
@@ -7935,13 +8396,13 @@ function DepositFlow({
|
|
|
7935
8396
|
}).catch(() => {
|
|
7936
8397
|
if (cancelled) return;
|
|
7937
8398
|
clearTimeout(timeoutTimer);
|
|
7938
|
-
showFallback();
|
|
8399
|
+
showFallback("regional_methods_failed");
|
|
7939
8400
|
});
|
|
7940
8401
|
return () => {
|
|
7941
8402
|
cancelled = true;
|
|
7942
8403
|
clearTimeout(timeoutTimer);
|
|
7943
8404
|
};
|
|
7944
|
-
}, [fiatEnabled, hasConfiguredFiatMethods, service]);
|
|
8405
|
+
}, [analytics, fiatEnabled, hasConfiguredFiatMethods, service]);
|
|
7945
8406
|
const cashDisplay = _react.useMemo.call(void 0, () => {
|
|
7946
8407
|
if (!fiatEnabled) return { kind: "hidden" };
|
|
7947
8408
|
if (hasConfiguredFiatMethods) {
|
|
@@ -7960,45 +8421,26 @@ function DepositFlow({
|
|
|
7960
8421
|
offeredFiatMethods,
|
|
7961
8422
|
regionalMethods
|
|
7962
8423
|
]);
|
|
7963
|
-
const lastFiatMethodsRenderedEventRef = _react.useRef.call(void 0, null);
|
|
7964
8424
|
_react.useEffect.call(void 0, () => {
|
|
7965
|
-
if (cashDisplay.kind
|
|
7966
|
-
|
|
7967
|
-
|
|
7968
|
-
|
|
7969
|
-
|
|
7970
|
-
|
|
7971
|
-
|
|
7972
|
-
|
|
7973
|
-
|
|
7974
|
-
|
|
7975
|
-
|
|
7976
|
-
|
|
7977
|
-
type: "deposit_modal_fiat_methods_rendered",
|
|
7978
|
-
country: cashDisplay.country,
|
|
7979
|
-
payment_methods: paymentMethods,
|
|
7980
|
-
source: cashDisplay.source
|
|
7981
|
-
});
|
|
7982
|
-
}, [cashDisplay, onEvent, onEventRef]);
|
|
8425
|
+
if (cashDisplay.kind === "hidden" && fiatEnabled) {
|
|
8426
|
+
analytics.friction(
|
|
8427
|
+
"regional_methods_empty",
|
|
8428
|
+
"fiat_regional_payment_method"
|
|
8429
|
+
);
|
|
8430
|
+
} else if (cashDisplay.kind === "list" && cashDisplay.source === "fallback" && !hasConfiguredFiatMethods) {
|
|
8431
|
+
analytics.friction(
|
|
8432
|
+
"regional_methods_fallback",
|
|
8433
|
+
"fiat_regional_payment_method"
|
|
8434
|
+
);
|
|
8435
|
+
}
|
|
8436
|
+
}, [analytics, cashDisplay, fiatEnabled, hasConfiguredFiatMethods]);
|
|
7983
8437
|
const displayedFiatSource = cashDisplay.kind === "list" ? cashDisplay.source : void 0;
|
|
7984
|
-
const displayedFiatCountry = cashDisplay.kind === "list" ? cashDisplay.country : null;
|
|
7985
8438
|
const handleSelectDisplayedFiatMethod = _react.useCallback.call(void 0,
|
|
7986
8439
|
(method) => {
|
|
7987
8440
|
if (!displayedFiatSource) return;
|
|
7988
|
-
_optionalChain([onEventRef, 'access', _273 => _273.current, 'optionalCall', _274 => _274({
|
|
7989
|
-
type: "deposit_modal_fiat_method_click",
|
|
7990
|
-
country: displayedFiatCountry,
|
|
7991
|
-
payment_method: method,
|
|
7992
|
-
source: displayedFiatSource
|
|
7993
|
-
})]);
|
|
7994
8441
|
handleSelectFiatMethod(method, displayedFiatSource);
|
|
7995
8442
|
},
|
|
7996
|
-
[
|
|
7997
|
-
displayedFiatCountry,
|
|
7998
|
-
displayedFiatSource,
|
|
7999
|
-
handleSelectFiatMethod,
|
|
8000
|
-
onEventRef
|
|
8001
|
-
]
|
|
8443
|
+
[displayedFiatSource, handleSelectFiatMethod]
|
|
8002
8444
|
);
|
|
8003
8445
|
const handlePrefetchDisplayedFiatMethod = _react.useCallback.call(void 0,
|
|
8004
8446
|
(method) => {
|
|
@@ -8008,7 +8450,9 @@ function DepositFlow({
|
|
|
8008
8450
|
[displayedFiatSource, handlePrefetchFiatMethod]
|
|
8009
8451
|
);
|
|
8010
8452
|
const handleNewDeposit = _react.useCallback.call(void 0, () => {
|
|
8011
|
-
|
|
8453
|
+
analytics.completeStep();
|
|
8454
|
+
analytics.resetAttempt();
|
|
8455
|
+
_optionalChain([onLifecycleRef, 'access', _287 => _287.current, 'optionalCall', _288 => _288({
|
|
8012
8456
|
type: "smart-account-changed",
|
|
8013
8457
|
evm: null,
|
|
8014
8458
|
solana: null
|
|
@@ -8020,7 +8464,7 @@ function DepositFlow({
|
|
|
8020
8464
|
swappedConnectUrlRef.current.clear();
|
|
8021
8465
|
acknowledgedConnectFeeRef.current.clear();
|
|
8022
8466
|
lastSmartAccountLifecycleKeyRef.current = null;
|
|
8023
|
-
}, [onLifecycleRef, storeApi]);
|
|
8467
|
+
}, [analytics, onLifecycleRef, storeApi]);
|
|
8024
8468
|
const setupInput = _react.useMemo.call(void 0,
|
|
8025
8469
|
() => ({
|
|
8026
8470
|
targetChain,
|
|
@@ -8039,17 +8483,17 @@ function DepositFlow({
|
|
|
8039
8483
|
forceRegister
|
|
8040
8484
|
]
|
|
8041
8485
|
);
|
|
8042
|
-
const desiredSetupRequestKey =
|
|
8486
|
+
const desiredSetupRequestKey = _chunk7ICSHJFEcjs.computeRequestKey.call(void 0, setupInput);
|
|
8043
8487
|
const setupReady = setupSlice.status === "ready" && setupSlice.requestKey === desiredSetupRequestKey;
|
|
8044
8488
|
_react.useEffect.call(void 0, () => {
|
|
8045
8489
|
void (async () => {
|
|
8046
|
-
const requestKey =
|
|
8047
|
-
const cacheKey =
|
|
8048
|
-
const cacheable =
|
|
8490
|
+
const requestKey = _chunk7ICSHJFEcjs.computeRequestKey.call(void 0, setupInput);
|
|
8491
|
+
const cacheKey = _chunk7ICSHJFEcjs.computeCacheKey.call(void 0, setupInput);
|
|
8492
|
+
const cacheable = _chunk7ICSHJFEcjs.computeIsCacheable.call(void 0, setupInput);
|
|
8049
8493
|
if (storeApi.getState().setup.requestKey === requestKey) {
|
|
8050
8494
|
return;
|
|
8051
8495
|
}
|
|
8052
|
-
const dedupedResult =
|
|
8496
|
+
const dedupedResult = _chunk7ICSHJFEcjs.readDedupedAccountSetupResult.call(void 0, requestKey);
|
|
8053
8497
|
if (dedupedResult) {
|
|
8054
8498
|
storeApi.dispatch({
|
|
8055
8499
|
type: "setup/started",
|
|
@@ -8075,7 +8519,7 @@ function DepositFlow({
|
|
|
8075
8519
|
cacheable
|
|
8076
8520
|
});
|
|
8077
8521
|
try {
|
|
8078
|
-
const result = await
|
|
8522
|
+
const result = await _chunk7ICSHJFEcjs.runAccountSetupDeduped.call(void 0,
|
|
8079
8523
|
setupInput,
|
|
8080
8524
|
{ service, debug },
|
|
8081
8525
|
requestKey
|
|
@@ -8090,7 +8534,7 @@ function DepositFlow({
|
|
|
8090
8534
|
}
|
|
8091
8535
|
});
|
|
8092
8536
|
} catch (error) {
|
|
8093
|
-
const message = error instanceof
|
|
8537
|
+
const message = error instanceof _chunk7ICSHJFEcjs.SetupError ? error.message : "Deposit service is temporarily unavailable. Please try again shortly.";
|
|
8094
8538
|
storeApi.dispatch({
|
|
8095
8539
|
type: "setup/failed",
|
|
8096
8540
|
requestKey,
|
|
@@ -8122,11 +8566,11 @@ function DepositFlow({
|
|
|
8122
8566
|
return;
|
|
8123
8567
|
}
|
|
8124
8568
|
storeApi.dispatch({ type: "portfolio/loading", network, address });
|
|
8125
|
-
const requestId = _optionalChain([readPortfolioEntry, 'call',
|
|
8569
|
+
const requestId = _optionalChain([readPortfolioEntry, 'call', _289 => _289(
|
|
8126
8570
|
storeApi.getState().portfolio,
|
|
8127
8571
|
network,
|
|
8128
8572
|
address
|
|
8129
|
-
), 'optionalAccess',
|
|
8573
|
+
), 'optionalAccess', _290 => _290.requestId]);
|
|
8130
8574
|
if (requestId === void 0) return;
|
|
8131
8575
|
void (async () => {
|
|
8132
8576
|
try {
|
|
@@ -8139,7 +8583,7 @@ function DepositFlow({
|
|
|
8139
8583
|
address,
|
|
8140
8584
|
requestId,
|
|
8141
8585
|
totalUsd: portfolio.totalUsd,
|
|
8142
|
-
chainIds:
|
|
8586
|
+
chainIds: _chunkV2OBGLJDcjs.chainIdsByValue.call(void 0, portfolio.tokens)
|
|
8143
8587
|
});
|
|
8144
8588
|
} catch (e39) {
|
|
8145
8589
|
storeApi.dispatch({
|
|
@@ -8159,9 +8603,13 @@ function DepositFlow({
|
|
|
8159
8603
|
sourceChain: data.sourceChain,
|
|
8160
8604
|
amount: data.amount
|
|
8161
8605
|
});
|
|
8162
|
-
|
|
8606
|
+
analytics.observeCorrelator(
|
|
8607
|
+
{ type: "transaction_hash", value: data.txHash },
|
|
8608
|
+
"transfer_tracking"
|
|
8609
|
+
);
|
|
8610
|
+
_optionalChain([onLifecycleRef, 'access', _291 => _291.current, 'optionalCall', _292 => _292({ type: "submitted", ...data })]);
|
|
8163
8611
|
},
|
|
8164
|
-
[logFlow, onLifecycleRef]
|
|
8612
|
+
[analytics, logFlow, onLifecycleRef]
|
|
8165
8613
|
);
|
|
8166
8614
|
const handleSolanaTokenContinue = _react.useCallback.call(void 0,
|
|
8167
8615
|
(token, balance, balanceUsd) => {
|
|
@@ -8209,6 +8657,11 @@ function DepositFlow({
|
|
|
8209
8657
|
amountUnits,
|
|
8210
8658
|
token: tokenAtSubmit.symbol
|
|
8211
8659
|
});
|
|
8660
|
+
analytics.handoff(
|
|
8661
|
+
"wallet",
|
|
8662
|
+
{ type: "transaction_hash", value: txHash },
|
|
8663
|
+
"wallet_submit"
|
|
8664
|
+
);
|
|
8212
8665
|
storeApi.dispatch({
|
|
8213
8666
|
type: "deposit/submitted",
|
|
8214
8667
|
txHash,
|
|
@@ -8223,7 +8676,7 @@ function DepositFlow({
|
|
|
8223
8676
|
sourceDecimals: tokenAtSubmit.decimals,
|
|
8224
8677
|
inputAmountUsd: amountUsd
|
|
8225
8678
|
});
|
|
8226
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
8679
|
+
_optionalChain([onLifecycleRef, 'access', _293 => _293.current, 'optionalCall', _294 => _294({
|
|
8227
8680
|
type: "submitted",
|
|
8228
8681
|
txHash,
|
|
8229
8682
|
sourceChain: "solana",
|
|
@@ -8232,25 +8685,18 @@ function DepositFlow({
|
|
|
8232
8685
|
amountUsd
|
|
8233
8686
|
})]);
|
|
8234
8687
|
},
|
|
8235
|
-
[logFlow, onLifecycleRef, storeApi]
|
|
8688
|
+
[analytics, logFlow, onLifecycleRef, storeApi]
|
|
8236
8689
|
);
|
|
8237
8690
|
const handleAssetContinue = _react.useCallback.call(void 0,
|
|
8238
8691
|
(asset) => {
|
|
8239
|
-
|
|
8240
|
-
type: "deposit_modal_connected_wallet_select_source_cta_click",
|
|
8241
|
-
total_balance_in_external_wallet: totalBalanceUsd,
|
|
8242
|
-
pred_balance: totalBalanceUsd,
|
|
8243
|
-
cta_name: "token_selected",
|
|
8244
|
-
token_name: asset.symbol,
|
|
8245
|
-
token_balance: _nullishCoalesce(asset.balance, () => ( "0"))
|
|
8246
|
-
})]);
|
|
8692
|
+
analytics.completeStep("wallet_source_asset");
|
|
8247
8693
|
storeApi.dispatch({
|
|
8248
8694
|
type: "asset/selected",
|
|
8249
8695
|
asset,
|
|
8250
8696
|
seedAmount: defaultAmount
|
|
8251
8697
|
});
|
|
8252
8698
|
},
|
|
8253
|
-
[
|
|
8699
|
+
[analytics, defaultAmount, storeApi]
|
|
8254
8700
|
);
|
|
8255
8701
|
const handleAmountContinue = _react.useCallback.call(void 0,
|
|
8256
8702
|
(amount, targetAmount, balance) => {
|
|
@@ -8298,6 +8744,21 @@ function DepositFlow({
|
|
|
8298
8744
|
});
|
|
8299
8745
|
const depositAtSubmit = storeApi.getState().deposit;
|
|
8300
8746
|
const asset = depositAtSubmit.selectedAsset;
|
|
8747
|
+
const handoffMethod = flowMode === "dapp-import" ? "asset_migration" : "wallet";
|
|
8748
|
+
const handoffStep = flowMode === "dapp-import" ? "migration_submit" : "wallet_submit";
|
|
8749
|
+
if (routed.depositId) {
|
|
8750
|
+
analytics.handoff(
|
|
8751
|
+
handoffMethod,
|
|
8752
|
+
{ type: "deposit_id", value: routed.depositId },
|
|
8753
|
+
handoffStep
|
|
8754
|
+
);
|
|
8755
|
+
} else if (!routed.sourceTxHashPending) {
|
|
8756
|
+
analytics.handoff(
|
|
8757
|
+
handoffMethod,
|
|
8758
|
+
{ type: "transaction_hash", value: txHash },
|
|
8759
|
+
handoffStep
|
|
8760
|
+
);
|
|
8761
|
+
}
|
|
8301
8762
|
storeApi.dispatch({
|
|
8302
8763
|
type: "deposit/submitted",
|
|
8303
8764
|
txHash,
|
|
@@ -8309,15 +8770,15 @@ function DepositFlow({
|
|
|
8309
8770
|
sourceChain: chainId,
|
|
8310
8771
|
sourceToken: token,
|
|
8311
8772
|
amount,
|
|
8312
|
-
sourceSymbol: _optionalChain([asset, 'optionalAccess',
|
|
8313
|
-
sourceDecimals: _optionalChain([asset, 'optionalAccess',
|
|
8773
|
+
sourceSymbol: _optionalChain([asset, 'optionalAccess', _295 => _295.symbol]),
|
|
8774
|
+
sourceDecimals: _optionalChain([asset, 'optionalAccess', _296 => _296.decimals]),
|
|
8314
8775
|
inputAmountUsd: _nullishCoalesce(depositAtSubmit.inputAmountUsd, () => ( void 0)),
|
|
8315
8776
|
directTransfer: routed.directTransfer,
|
|
8316
8777
|
sourceTxHashPending: routed.sourceTxHashPending,
|
|
8317
8778
|
quote
|
|
8318
8779
|
});
|
|
8319
8780
|
},
|
|
8320
|
-
[logFlow, storeApi]
|
|
8781
|
+
[analytics, flowMode, logFlow, storeApi]
|
|
8321
8782
|
);
|
|
8322
8783
|
const handleSwappedComplete = _react.useCallback.call(void 0,
|
|
8323
8784
|
(info) => {
|
|
@@ -8351,7 +8812,7 @@ function DepositFlow({
|
|
|
8351
8812
|
swappedContext,
|
|
8352
8813
|
initialEvent: info.initialEvent
|
|
8353
8814
|
});
|
|
8354
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
8815
|
+
_optionalChain([onLifecycleRef, 'access', _297 => _297.current, 'optionalCall', _298 => _298({
|
|
8355
8816
|
type: "submitted",
|
|
8356
8817
|
txHash: info.txHash,
|
|
8357
8818
|
sourceChain: SWAPPED_SOURCE_CHAIN,
|
|
@@ -8379,12 +8840,12 @@ function DepositFlow({
|
|
|
8379
8840
|
const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
|
|
8380
8841
|
(txHash, sourceChain, amount) => {
|
|
8381
8842
|
const depositAtSubmit = storeApi.getState().deposit;
|
|
8382
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
8843
|
+
_optionalChain([onLifecycleRef, 'access', _299 => _299.current, 'optionalCall', _300 => _300({
|
|
8383
8844
|
type: "submitted",
|
|
8384
8845
|
txHash,
|
|
8385
8846
|
sourceChain,
|
|
8386
8847
|
amount,
|
|
8387
|
-
sourceDecimals: _optionalChain([depositAtSubmit, 'access',
|
|
8848
|
+
sourceDecimals: _optionalChain([depositAtSubmit, 'access', _301 => _301.selectedAsset, 'optionalAccess', _302 => _302.decimals]),
|
|
8388
8849
|
amountUsd: _nullishCoalesce(depositAtSubmit.inputAmountUsd, () => ( void 0))
|
|
8389
8850
|
})]);
|
|
8390
8851
|
},
|
|
@@ -8393,28 +8854,51 @@ function DepositFlow({
|
|
|
8393
8854
|
const handleDepositComplete = _react.useCallback.call(void 0,
|
|
8394
8855
|
(txHash, destinationTxHash, context) => {
|
|
8395
8856
|
logFlow("deposit:complete", { txHash, destinationTxHash, ...context });
|
|
8396
|
-
|
|
8857
|
+
analytics.openStep(
|
|
8858
|
+
analyticsStepForFlowStep(analyticsMethod, "processing")
|
|
8859
|
+
);
|
|
8860
|
+
analytics.outcome("completed");
|
|
8861
|
+
_optionalChain([onLifecycleRef, 'access', _303 => _303.current, 'optionalCall', _304 => _304({
|
|
8397
8862
|
type: "complete",
|
|
8398
8863
|
txHash,
|
|
8399
8864
|
destinationTxHash,
|
|
8400
8865
|
...context
|
|
8401
8866
|
})]);
|
|
8402
8867
|
},
|
|
8403
|
-
[logFlow, onLifecycleRef]
|
|
8868
|
+
[analytics, analyticsMethod, logFlow, onLifecycleRef]
|
|
8404
8869
|
);
|
|
8405
8870
|
const handleDepositFailed = _react.useCallback.call(void 0,
|
|
8406
8871
|
(txHash, error) => {
|
|
8407
8872
|
logFlowError("deposit:failed", error, { txHash });
|
|
8408
|
-
|
|
8873
|
+
analytics.openStep(
|
|
8874
|
+
analyticsStepForFlowStep(analyticsMethod, "processing")
|
|
8875
|
+
);
|
|
8876
|
+
analytics.outcome("failed");
|
|
8877
|
+
analytics.failure("processor_failed", false);
|
|
8878
|
+
_optionalChain([onLifecycleRef, 'access', _305 => _305.current, 'optionalCall', _306 => _306({ type: "failed", txHash, error })]);
|
|
8409
8879
|
},
|
|
8410
|
-
[logFlowError, onLifecycleRef]
|
|
8880
|
+
[analytics, analyticsMethod, logFlowError, onLifecycleRef]
|
|
8411
8881
|
);
|
|
8412
8882
|
const handleError = _react.useCallback.call(void 0,
|
|
8413
8883
|
(message, code, cause) => {
|
|
8414
8884
|
logFlowError("flow:error", _nullishCoalesce(cause, () => ( message)), { code });
|
|
8415
|
-
|
|
8885
|
+
if (code === "PROCESS_TIMEOUT") {
|
|
8886
|
+
analytics.friction("processor_status_poll_failed");
|
|
8887
|
+
} else {
|
|
8888
|
+
const reason = failureReasonForCode(
|
|
8889
|
+
code,
|
|
8890
|
+
`${message} ${_nullishCoalesce(cause, () => ( ""))}`
|
|
8891
|
+
);
|
|
8892
|
+
const failureStep = code === "SWAPPED_URL_FAILED" ? "fiat_provider_mint" : code === "SWAPPED_CONNECT_URL_FAILED" ? "exchange_provider_mint" : void 0;
|
|
8893
|
+
analytics.failure(
|
|
8894
|
+
reason,
|
|
8895
|
+
reason !== "submission_uncertain",
|
|
8896
|
+
failureStep
|
|
8897
|
+
);
|
|
8898
|
+
}
|
|
8899
|
+
_optionalChain([onErrorRef, 'access', _307 => _307.current, 'optionalCall', _308 => _308({ message, code, cause })]);
|
|
8416
8900
|
},
|
|
8417
|
-
[logFlowError, onErrorRef]
|
|
8901
|
+
[analytics, logFlowError, onErrorRef]
|
|
8418
8902
|
);
|
|
8419
8903
|
const handleTotalBalanceComputed = _react.useCallback.call(void 0, (total) => {
|
|
8420
8904
|
setTotalBalanceUsd(total);
|
|
@@ -8461,17 +8945,18 @@ function DepositFlow({
|
|
|
8461
8945
|
address: _nullishCoalesce(_nullishCoalesce(option.address, () => ( option.solanaAddress)), () => ( option.id)),
|
|
8462
8946
|
state,
|
|
8463
8947
|
errorReason: _nullishCoalesce(entry.message, () => ( void 0)),
|
|
8464
|
-
balanceStatus: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess',
|
|
8465
|
-
balanceUsd: _optionalChain([portfolioEntry, 'optionalAccess',
|
|
8466
|
-
balanceChainIds: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess',
|
|
8948
|
+
balanceStatus: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess', _309 => _309.status]), () => ( "loading")),
|
|
8949
|
+
balanceUsd: _optionalChain([portfolioEntry, 'optionalAccess', _310 => _310.status]) === "ready" ? portfolioEntry.totalUsd : null,
|
|
8950
|
+
balanceChainIds: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess', _311 => _311.chainIds]), () => ( []))
|
|
8467
8951
|
};
|
|
8468
8952
|
});
|
|
8469
8953
|
}, [enableWallet, walletOptions, setupSlice, portfolioSlice]);
|
|
8470
8954
|
const transferCryptoEntry = setupSlice;
|
|
8471
8955
|
const transferCryptoState = transferCryptoEntry.status === "ready" ? "ready" : transferCryptoEntry.status === "error" ? "error" : "loading";
|
|
8472
8956
|
const handleRetrySetup = _react.useCallback.call(void 0, () => {
|
|
8957
|
+
analytics.retry("account_setup_failed", "account_setup");
|
|
8473
8958
|
storeApi.dispatch({ type: "setup/retry-requested" });
|
|
8474
|
-
}, [storeApi]);
|
|
8959
|
+
}, [analytics, storeApi]);
|
|
8475
8960
|
if (showConnectStep) {
|
|
8476
8961
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8477
8962
|
ConnectStep,
|
|
@@ -8518,7 +9003,10 @@ function DepositFlow({
|
|
|
8518
9003
|
// hasn't landed must still surface the row and show it inside the
|
|
8519
9004
|
// picker as "Coming soon" — keying this on implemented providers
|
|
8520
9005
|
// hid the feature entirely for such a config.
|
|
8521
|
-
enabledAssetMigrationIds.length > 0 ? () =>
|
|
9006
|
+
enabledAssetMigrationIds.length > 0 ? () => {
|
|
9007
|
+
analytics.selectMethod("asset_migration", "user");
|
|
9008
|
+
storeApi.dispatch({ type: "dapp-import/picker-opened" });
|
|
9009
|
+
} : void 0
|
|
8522
9010
|
),
|
|
8523
9011
|
migrateAssetsBalanceStatus: dappImportTotal.status,
|
|
8524
9012
|
migrateAssetsBalanceUsd: dappImportTotal.totalUsd
|
|
@@ -8552,16 +9040,31 @@ function DepositFlow({
|
|
|
8552
9040
|
onDepositSubmitted: handleDepositAddressSubmitted,
|
|
8553
9041
|
onDepositComplete: handleDepositComplete,
|
|
8554
9042
|
onDepositFailed: handleDepositFailed,
|
|
8555
|
-
|
|
8556
|
-
|
|
8557
|
-
|
|
8558
|
-
|
|
8559
|
-
|
|
8560
|
-
|
|
8561
|
-
|
|
8562
|
-
|
|
8563
|
-
|
|
8564
|
-
|
|
9043
|
+
onAddressShown: ({
|
|
9044
|
+
address,
|
|
9045
|
+
sourceChainCaip2,
|
|
9046
|
+
sourceTokenIdentity
|
|
9047
|
+
}) => {
|
|
9048
|
+
analytics.handoff(
|
|
9049
|
+
"transfer",
|
|
9050
|
+
{ type: "deposit_address", value: address },
|
|
9051
|
+
"transfer_address_shown",
|
|
9052
|
+
{
|
|
9053
|
+
source_chain: sourceChainCaip2,
|
|
9054
|
+
source_token: sourceTokenIdentity
|
|
9055
|
+
}
|
|
9056
|
+
);
|
|
9057
|
+
},
|
|
9058
|
+
onCopyAddress: (success) => {
|
|
9059
|
+
if (success) {
|
|
9060
|
+
analytics.completeStep("transfer_copy");
|
|
9061
|
+
} else {
|
|
9062
|
+
analytics.failure(
|
|
9063
|
+
"transfer_clipboard_failed",
|
|
9064
|
+
true,
|
|
9065
|
+
"transfer_copy"
|
|
9066
|
+
);
|
|
9067
|
+
}
|
|
8565
9068
|
},
|
|
8566
9069
|
onReviewDeposit: handleQrReviewRequested,
|
|
8567
9070
|
onError: handleError,
|
|
@@ -8625,16 +9128,21 @@ function DepositFlow({
|
|
|
8625
9128
|
consumePrefetchedUrl: consumeSwappedWidgetUrlPrefetch,
|
|
8626
9129
|
onSwappedComplete: handleSwappedComplete,
|
|
8627
9130
|
onSwappedFailed: handleDepositFailed,
|
|
8628
|
-
onClose:
|
|
8629
|
-
|
|
8630
|
-
|
|
9131
|
+
onClose: () => _optionalChain([onClose, 'optionalCall', _312 => _312(
|
|
9132
|
+
openExternally ? "native_dismiss_request" : "header_button"
|
|
9133
|
+
)]),
|
|
9134
|
+
onGoBack: handleProviderBack,
|
|
8631
9135
|
onError: handleError,
|
|
9136
|
+
onAttemptConsumed: handleSwappedAttemptConsumed,
|
|
9137
|
+
onProviderHandoff: handleSwappedProviderHandoff,
|
|
9138
|
+
onRetry: handleSwappedRetry,
|
|
9139
|
+
onCancelled: () => analytics.outcome("cancelled"),
|
|
8632
9140
|
onImmersiveChange: onSwappedImmersiveChange,
|
|
8633
9141
|
openExternally
|
|
8634
9142
|
}
|
|
8635
9143
|
),
|
|
8636
9144
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8637
|
-
|
|
9145
|
+
_chunk7ICSHJFEcjs.ProcessingStep,
|
|
8638
9146
|
{
|
|
8639
9147
|
smartAccount: step.smartAccount,
|
|
8640
9148
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
@@ -8699,16 +9207,21 @@ function DepositFlow({
|
|
|
8699
9207
|
loadUrl: () => loadSwappedConnectUrl(step.smartAccount, step.connection),
|
|
8700
9208
|
onSwappedComplete: handleSwappedComplete,
|
|
8701
9209
|
onSwappedFailed: handleDepositFailed,
|
|
8702
|
-
onClose:
|
|
8703
|
-
|
|
8704
|
-
|
|
9210
|
+
onClose: () => _optionalChain([onClose, 'optionalCall', _313 => _313(
|
|
9211
|
+
openExternally ? "native_dismiss_request" : "header_button"
|
|
9212
|
+
)]),
|
|
9213
|
+
onGoBack: handleProviderBack,
|
|
8705
9214
|
onError: handleError,
|
|
9215
|
+
onAttemptConsumed: handleSwappedAttemptConsumed,
|
|
9216
|
+
onProviderHandoff: handleSwappedProviderHandoff,
|
|
9217
|
+
onRetry: handleSwappedRetry,
|
|
9218
|
+
onCancelled: () => analytics.outcome("cancelled"),
|
|
8706
9219
|
onImmersiveChange: onSwappedImmersiveChange,
|
|
8707
9220
|
openExternally
|
|
8708
9221
|
}
|
|
8709
9222
|
),
|
|
8710
9223
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8711
|
-
|
|
9224
|
+
_chunk7ICSHJFEcjs.ProcessingStep,
|
|
8712
9225
|
{
|
|
8713
9226
|
smartAccount: step.smartAccount,
|
|
8714
9227
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
@@ -8742,8 +9255,8 @@ function DepositFlow({
|
|
|
8742
9255
|
);
|
|
8743
9256
|
}
|
|
8744
9257
|
if (isSolanaWalletMode) {
|
|
8745
|
-
const solanaAddr = _optionalChain([walletSession, 'optionalAccess',
|
|
8746
|
-
const solanaProvider = _optionalChain([walletSession, 'optionalAccess',
|
|
9258
|
+
const solanaAddr = _optionalChain([walletSession, 'optionalAccess', _314 => _314.solanaAddress]);
|
|
9259
|
+
const solanaProvider = _optionalChain([walletSession, 'optionalAccess', _315 => _315.solanaProvider]);
|
|
8747
9260
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
8748
9261
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8749
9262
|
AccountPreparingSkeleton,
|
|
@@ -8759,10 +9272,7 @@ function DepositFlow({
|
|
|
8759
9272
|
service,
|
|
8760
9273
|
onContinue: handleSolanaTokenContinue,
|
|
8761
9274
|
onTotalBalanceComputed: handleTotalBalanceComputed,
|
|
8762
|
-
onDisconnect: onDisconnect ?
|
|
8763
|
-
onDisconnect();
|
|
8764
|
-
handleBack();
|
|
8765
|
-
} : void 0,
|
|
9275
|
+
onDisconnect: onDisconnect ? handleWalletDisconnect : void 0,
|
|
8766
9276
|
debug
|
|
8767
9277
|
}
|
|
8768
9278
|
),
|
|
@@ -8797,7 +9307,7 @@ function DepositFlow({
|
|
|
8797
9307
|
targetToken,
|
|
8798
9308
|
service,
|
|
8799
9309
|
solanaProvider,
|
|
8800
|
-
solanaConnection: _optionalChain([walletSession, 'optionalAccess',
|
|
9310
|
+
solanaConnection: _optionalChain([walletSession, 'optionalAccess', _316 => _316.solanaConnection]),
|
|
8801
9311
|
uiConfig,
|
|
8802
9312
|
onConfirm: handleSolanaConfirmed,
|
|
8803
9313
|
onError: handleError,
|
|
@@ -8838,7 +9348,7 @@ function DepositFlow({
|
|
|
8838
9348
|
) })
|
|
8839
9349
|
] }) : null,
|
|
8840
9350
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8841
|
-
|
|
9351
|
+
_chunk7ICSHJFEcjs.ProcessingStep,
|
|
8842
9352
|
{
|
|
8843
9353
|
smartAccount: effectiveStep.smartAccount,
|
|
8844
9354
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
@@ -8876,7 +9386,7 @@ function DepositFlow({
|
|
|
8876
9386
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8877
9387
|
DappImportAssetSelectSkeleton,
|
|
8878
9388
|
{
|
|
8879
|
-
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportProvider, 'optionalAccess',
|
|
9389
|
+
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportProvider, 'optionalAccess', _317 => _317.sourceLabel]), () => ( "")),
|
|
8880
9390
|
error: dappImportBootError,
|
|
8881
9391
|
onRetry: handleBootRetry
|
|
8882
9392
|
}
|
|
@@ -8898,7 +9408,7 @@ function DepositFlow({
|
|
|
8898
9408
|
rows: dappImportSelectRows,
|
|
8899
9409
|
onRequestConnect: _nullishCoalesce(onConnect, () => ( onRequestConnect)),
|
|
8900
9410
|
onSelect: (providerId) => {
|
|
8901
|
-
const availabilityEntry = dappImportOwner && _optionalChain([dappImportAvailabilityOwner, 'optionalAccess',
|
|
9411
|
+
const availabilityEntry = dappImportOwner && _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _318 => _318.toLowerCase, 'call', _319 => _319()]) === dappImportOwner.toLowerCase() ? dappImportAvailability[providerId] : void 0;
|
|
8902
9412
|
if (availabilityEntry === "error") {
|
|
8903
9413
|
storeApi.dispatch({
|
|
8904
9414
|
type: "dapp-import/availability-retry-requested"
|
|
@@ -8917,16 +9427,16 @@ function DepositFlow({
|
|
|
8917
9427
|
}
|
|
8918
9428
|
);
|
|
8919
9429
|
}
|
|
8920
|
-
if (!_optionalChain([signerContext, 'optionalAccess',
|
|
9430
|
+
if (!_optionalChain([signerContext, 'optionalAccess', _320 => _320.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _321 => _321.publicClient])) {
|
|
8921
9431
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-state", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-text", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-title", children: "Connecting wallet\u2026" }) }) }) }) });
|
|
8922
9432
|
}
|
|
8923
9433
|
const ownerAddress = signerContext.ownerAddress;
|
|
8924
|
-
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access',
|
|
9434
|
+
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _322 => _322.walletClient, 'optionalAccess', _323 => _323.chain, 'optionalAccess', _324 => _324.id]), () => ( _optionalChain([signerContext, 'access', _325 => _325.publicClient, 'access', _326 => _326.chain, 'optionalAccess', _327 => _327.id]))), () => ( setupChainId));
|
|
8925
9435
|
const getReadClientForChain = (chainId) => {
|
|
8926
|
-
if (_optionalChain([signerContext, 'access',
|
|
9436
|
+
if (_optionalChain([signerContext, 'access', _328 => _328.publicClient, 'access', _329 => _329.chain, 'optionalAccess', _330 => _330.id]) === chainId) {
|
|
8927
9437
|
return signerContext.publicClient;
|
|
8928
9438
|
}
|
|
8929
|
-
return
|
|
9439
|
+
return _chunkV2OBGLJDcjs.getPublicClient.call(void 0, chainId, rpcUrls);
|
|
8930
9440
|
};
|
|
8931
9441
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
8932
9442
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -8946,18 +9456,15 @@ function DepositFlow({
|
|
|
8946
9456
|
service,
|
|
8947
9457
|
onContinue: handleAssetContinue,
|
|
8948
9458
|
onTotalBalanceComputed: handleTotalBalanceComputed,
|
|
8949
|
-
onDisconnect: onDisconnect ?
|
|
8950
|
-
onDisconnect();
|
|
8951
|
-
handleBack();
|
|
8952
|
-
} : void 0
|
|
9459
|
+
onDisconnect: onDisconnect ? handleWalletDisconnect : void 0
|
|
8953
9460
|
}
|
|
8954
9461
|
),
|
|
8955
9462
|
effectiveStep.type === "dapp-import-asset-select" && activeDappImportProvider && activeDappImportAvailability && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8956
9463
|
DappImportAssetSelectStep,
|
|
8957
9464
|
{
|
|
8958
|
-
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access',
|
|
9465
|
+
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access', _331 => _331.assets, 'access', _332 => _332[0], 'optionalAccess', _333 => _333.sourceLabel]), () => ( activeDappImportProvider.sourceLabel)),
|
|
8959
9466
|
assets: activeDappImportAvailability.assets,
|
|
8960
|
-
incompleteSummary: _optionalChain([activeDappImportAvailability, 'access',
|
|
9467
|
+
incompleteSummary: _optionalChain([activeDappImportAvailability, 'access', _334 => _334.incomplete, 'optionalAccess', _335 => _335.summary]),
|
|
8961
9468
|
onSelect: handleDappImportAssetSelected
|
|
8962
9469
|
}
|
|
8963
9470
|
),
|
|
@@ -8978,14 +9485,7 @@ function DepositFlow({
|
|
|
8978
9485
|
service,
|
|
8979
9486
|
onContinue: handleAmountContinue,
|
|
8980
9487
|
onCtaClick: (ctaName) => {
|
|
8981
|
-
|
|
8982
|
-
_optionalChain([onEvent, 'optionalCall', _325 => _325({
|
|
8983
|
-
type: "deposit_modal_connected_wallet_enter_value_cta_click",
|
|
8984
|
-
send_token: effectiveStep.asset.symbol,
|
|
8985
|
-
receive_token: receiveSymbol,
|
|
8986
|
-
pred_balance: totalBalanceUsd,
|
|
8987
|
-
cta_name: ctaName
|
|
8988
|
-
})]);
|
|
9488
|
+
if (ctaName === "continue") analytics.completeStep();
|
|
8989
9489
|
}
|
|
8990
9490
|
}
|
|
8991
9491
|
),
|
|
@@ -9039,7 +9539,7 @@ function DepositFlow({
|
|
|
9039
9539
|
}
|
|
9040
9540
|
),
|
|
9041
9541
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9042
|
-
|
|
9542
|
+
_chunk7ICSHJFEcjs.ProcessingStep,
|
|
9043
9543
|
{
|
|
9044
9544
|
smartAccount: effectiveStep.smartAccount,
|
|
9045
9545
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
@@ -9058,6 +9558,10 @@ function DepositFlow({
|
|
|
9058
9558
|
initialEvent: effectiveStep.initialEvent,
|
|
9059
9559
|
quote: effectiveStep.quote,
|
|
9060
9560
|
uiConfig,
|
|
9561
|
+
onSourceTransactionObserved: (txHash) => analytics.observeCorrelator(
|
|
9562
|
+
{ type: "transaction_hash", value: txHash },
|
|
9563
|
+
flowMode === "dapp-import" ? "migration_processing" : "wallet_processing"
|
|
9564
|
+
),
|
|
9061
9565
|
onClose,
|
|
9062
9566
|
onNewDeposit: handleNewDeposit,
|
|
9063
9567
|
onRetry: handleNewDeposit,
|
|
@@ -9190,7 +9694,7 @@ function DepositHistoryPanel({
|
|
|
9190
9694
|
);
|
|
9191
9695
|
const visibleDeposits = _react.useMemo.call(void 0, () => {
|
|
9192
9696
|
const sourceHashes = new Set(
|
|
9193
|
-
deposits.map((d) => _optionalChain([d, 'access',
|
|
9697
|
+
deposits.map((d) => _optionalChain([d, 'access', _336 => _336.sourceTxHash, 'optionalAccess', _337 => _337.toLowerCase, 'call', _338 => _338()])).filter((h) => Boolean(h))
|
|
9194
9698
|
);
|
|
9195
9699
|
return deposits.filter(
|
|
9196
9700
|
(d) => !(d.txHash && sourceHashes.has(d.txHash.toLowerCase()))
|
|
@@ -9212,7 +9716,7 @@ function DepositHistoryPanel({
|
|
|
9212
9716
|
className: "rs-modal-header-back",
|
|
9213
9717
|
"aria-label": "Back",
|
|
9214
9718
|
onClick: onClose,
|
|
9215
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9719
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.ChevronLeftIcon, {})
|
|
9216
9720
|
}
|
|
9217
9721
|
) }),
|
|
9218
9722
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: onCloseModal && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -9222,29 +9726,29 @@ function DepositHistoryPanel({
|
|
|
9222
9726
|
className: "rs-modal-close",
|
|
9223
9727
|
"aria-label": "Close",
|
|
9224
9728
|
onClick: onCloseModal,
|
|
9225
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9729
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CloseIcon, {})
|
|
9226
9730
|
}
|
|
9227
9731
|
) })
|
|
9228
9732
|
] }),
|
|
9229
9733
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen", children: [
|
|
9230
9734
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen-body", children: [
|
|
9231
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9735
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.HistoryIcon, {}), title: "History" }),
|
|
9232
9736
|
isLoading && deposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
9233
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9737
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.HistoryIcon, {}) }),
|
|
9234
9738
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
9235
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9739
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.Spinner, { className: "rs-spinner--sm" }),
|
|
9236
9740
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Loading history\u2026" })
|
|
9237
9741
|
] })
|
|
9238
9742
|
] }),
|
|
9239
9743
|
error && !isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
9240
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9744
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.AlertTriangleIcon, {}) }),
|
|
9241
9745
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
9242
9746
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "Couldn't load history" }),
|
|
9243
9747
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: error })
|
|
9244
9748
|
] })
|
|
9245
9749
|
] }),
|
|
9246
9750
|
!isLoading && !error && visibleDeposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
9247
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9751
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.HistoryIcon, {}) }),
|
|
9248
9752
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
9249
9753
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "No deposits yet" }),
|
|
9250
9754
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Your deposit history will appear here" })
|
|
@@ -9264,14 +9768,14 @@ function DepositHistoryPanel({
|
|
|
9264
9768
|
)
|
|
9265
9769
|
] })
|
|
9266
9770
|
] }),
|
|
9267
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9771
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.PoweredBy, {})
|
|
9268
9772
|
] })
|
|
9269
9773
|
]
|
|
9270
9774
|
}
|
|
9271
9775
|
);
|
|
9272
9776
|
}
|
|
9273
9777
|
function HistoryCard({ deposit }) {
|
|
9274
|
-
const explorerTxUrl =
|
|
9778
|
+
const explorerTxUrl = _chunkV2OBGLJDcjs.useExplorerTxUrl.call(void 0, );
|
|
9275
9779
|
const [expanded, setExpanded] = _react.useState.call(void 0, false);
|
|
9276
9780
|
const status = normalizeStatus(deposit.status, deposit.isSpam);
|
|
9277
9781
|
const sourceChainId = resolveChainId(deposit.chain);
|
|
@@ -9301,8 +9805,8 @@ function HistoryCard({ deposit }) {
|
|
|
9301
9805
|
children: [
|
|
9302
9806
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-card-row", children: [
|
|
9303
9807
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-card-icons", children: [
|
|
9304
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-token", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9305
|
-
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-chain", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9808
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-token", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.TokenIcon, { symbol: sourceSymbol, fallback: sourceSymbol.slice(0, 2) }) }),
|
|
9809
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-chain", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CdnIcon, { src: sourceChainIcon }) })
|
|
9306
9810
|
] }),
|
|
9307
9811
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-card-text", children: [
|
|
9308
9812
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-title", children: txTypeLabel }),
|
|
@@ -9318,14 +9822,14 @@ function HistoryCard({ deposit }) {
|
|
|
9318
9822
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
9319
9823
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-detail-value", children: [
|
|
9320
9824
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceChainName }),
|
|
9321
|
-
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9825
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CdnIcon, { src: sourceChainIcon }) })
|
|
9322
9826
|
] })
|
|
9323
9827
|
] }),
|
|
9324
9828
|
targetChainName && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
9325
9829
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
|
|
9326
9830
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-detail-value", children: [
|
|
9327
9831
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName }),
|
|
9328
|
-
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9832
|
+
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CdnIcon, { src: targetChainIcon }) })
|
|
9329
9833
|
] })
|
|
9330
9834
|
] }),
|
|
9331
9835
|
srcTxUrl && srcTxHash && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
@@ -9340,7 +9844,7 @@ function HistoryCard({ deposit }) {
|
|
|
9340
9844
|
onClick: (e) => e.stopPropagation(),
|
|
9341
9845
|
children: [
|
|
9342
9846
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: shortenHash(srcTxHash) }),
|
|
9343
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9847
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.ArrowUpRightIcon, {})
|
|
9344
9848
|
]
|
|
9345
9849
|
}
|
|
9346
9850
|
)
|
|
@@ -9355,7 +9859,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
|
9355
9859
|
// src/DepositModal.tsx
|
|
9356
9860
|
|
|
9357
9861
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
9358
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
9862
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-46LPVFB6.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
9359
9863
|
);
|
|
9360
9864
|
function sortByCreatedAtDesc(items) {
|
|
9361
9865
|
return [...items].sort((a, b) => {
|
|
@@ -9364,13 +9868,62 @@ function sortByCreatedAtDesc(items) {
|
|
|
9364
9868
|
return bt - at;
|
|
9365
9869
|
});
|
|
9366
9870
|
}
|
|
9871
|
+
function buildDepositAnalyticsSessionProperties({
|
|
9872
|
+
enableWallet = true,
|
|
9873
|
+
enableFiatOnramp = false,
|
|
9874
|
+
enableQrTransfer = true,
|
|
9875
|
+
enableGaslessDeposit = false,
|
|
9876
|
+
enableExchangeConnect = false,
|
|
9877
|
+
fiatMethods,
|
|
9878
|
+
assetMigrations,
|
|
9879
|
+
initialAssetMigration,
|
|
9880
|
+
inline = false,
|
|
9881
|
+
closeOnOverlayClick = false,
|
|
9882
|
+
sourceChain,
|
|
9883
|
+
sourceToken,
|
|
9884
|
+
defaultAmount,
|
|
9885
|
+
walletIntegration,
|
|
9886
|
+
targetChain,
|
|
9887
|
+
targetToken
|
|
9888
|
+
}) {
|
|
9889
|
+
const configuredFiatIdentifiers = fiatMethods ? Object.entries(fiatMethods).filter(([, enabled]) => enabled === true).map(([identifier]) => identifier).sort() : null;
|
|
9890
|
+
const migrationProviders = Object.entries(_nullishCoalesce(assetMigrations, () => ( {}))).filter(([, enabled]) => enabled === true).map(([identifier]) => identifier).sort();
|
|
9891
|
+
const safeInitialMigration = initialAssetMigration && migrationProviders.includes(initialAssetMigration) ? initialAssetMigration : null;
|
|
9892
|
+
const enabledFundingMethods = [];
|
|
9893
|
+
if (enableWallet && walletIntegration !== "none") {
|
|
9894
|
+
enabledFundingMethods.push("wallet");
|
|
9895
|
+
}
|
|
9896
|
+
if (enableQrTransfer) enabledFundingMethods.push("transfer");
|
|
9897
|
+
if (enableFiatOnramp && _optionalChain([configuredFiatIdentifiers, 'optionalAccess', _339 => _339.length]) !== 0) {
|
|
9898
|
+
enabledFundingMethods.push("fiat_onramp");
|
|
9899
|
+
}
|
|
9900
|
+
if (enableExchangeConnect) enabledFundingMethods.push("exchange_connect");
|
|
9901
|
+
if (migrationProviders.length > 0) enabledFundingMethods.push("asset_migration");
|
|
9902
|
+
return {
|
|
9903
|
+
enabled_funding_methods: enabledFundingMethods,
|
|
9904
|
+
wallet_integration: walletIntegration,
|
|
9905
|
+
fiat_methods: configuredFiatIdentifiers === null ? { source: "backend_resolved" } : { source: "configured", identifiers: configuredFiatIdentifiers },
|
|
9906
|
+
asset_migration_providers: migrationProviders,
|
|
9907
|
+
initial_asset_migration: safeInitialMigration,
|
|
9908
|
+
gasless_wallet_flow_enabled: enableGaslessDeposit,
|
|
9909
|
+
presentation: inline ? "inline" : "overlay",
|
|
9910
|
+
overlay_close_enabled: !inline && closeOnOverlayClick,
|
|
9911
|
+
prefills: {
|
|
9912
|
+
source_chain: sourceChain !== void 0,
|
|
9913
|
+
source_token: sourceToken !== void 0,
|
|
9914
|
+
amount: defaultAmount !== void 0,
|
|
9915
|
+
initial_asset_migration: initialAssetMigration !== void 0
|
|
9916
|
+
},
|
|
9917
|
+
..._chunk7ICSHJFEcjs.analyticsTargetProperties.call(void 0, { targetChain, targetToken })
|
|
9918
|
+
};
|
|
9919
|
+
}
|
|
9367
9920
|
var WALLET_CLIENT_PROP = "walletClient";
|
|
9368
9921
|
function hasSuppliedWalletClient(props) {
|
|
9369
9922
|
return Object.prototype.hasOwnProperty.call(props, WALLET_CLIENT_PROP);
|
|
9370
9923
|
}
|
|
9371
9924
|
function DepositModal(props) {
|
|
9372
|
-
|
|
9373
|
-
|
|
9925
|
+
_chunk7ICSHJFEcjs.warnRemovedProps.call(void 0, "DepositModal", props);
|
|
9926
|
+
_chunkV2OBGLJDcjs.checkBackendUrl.call(void 0, "DepositModal", props.backendUrl);
|
|
9374
9927
|
const needsReown = !!props.reownAppId;
|
|
9375
9928
|
const hasWalletClientProp = hasSuppliedWalletClient(props);
|
|
9376
9929
|
if (needsReown) {
|
|
@@ -9430,13 +9983,18 @@ function DepositModalInner({
|
|
|
9430
9983
|
onLifecycle,
|
|
9431
9984
|
onEvent,
|
|
9432
9985
|
onError,
|
|
9986
|
+
enableAnalyticsIngest,
|
|
9987
|
+
analyticsIngestUrl,
|
|
9433
9988
|
onUiState,
|
|
9434
9989
|
openExternally,
|
|
9990
|
+
walletIntegration: walletIntegrationProp,
|
|
9435
9991
|
debug
|
|
9436
9992
|
}) {
|
|
9437
9993
|
const modalRef = _react.useRef.call(void 0, null);
|
|
9438
|
-
const
|
|
9439
|
-
const
|
|
9994
|
+
const analyticsControllerRef = _react.useRef.call(void 0, null);
|
|
9995
|
+
const previousOpenRef = _react.useRef.call(void 0, isOpen);
|
|
9996
|
+
const onReadyRef = _chunkV2OBGLJDcjs.useLatestRef.call(void 0, onReady);
|
|
9997
|
+
const onUiStateRef = _chunkV2OBGLJDcjs.useLatestRef.call(void 0, onUiState);
|
|
9440
9998
|
const [currentScreen, setCurrentScreen] = _react.useState.call(void 0, "connect");
|
|
9441
9999
|
const [swappedImmersive, setSwappedImmersive] = _react.useState.call(void 0, false);
|
|
9442
10000
|
const [submitting, setSubmitting] = _react.useState.call(void 0, false);
|
|
@@ -9455,9 +10013,9 @@ function DepositModalInner({
|
|
|
9455
10013
|
const historyLoadedRef = _react.useRef.call(void 0, false);
|
|
9456
10014
|
const targetChain = targetChainProp === "solana" || targetChainProp === _chunk4KCSH4T3cjs.HYPERCORE_SPOT_CAIP2 ? targetChainProp : _chunk4KCSH4T3cjs.getChainId.call(void 0, targetChainProp);
|
|
9457
10015
|
const sourceChain = sourceChainProp ? _chunk4KCSH4T3cjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
9458
|
-
const rpcUrls =
|
|
10016
|
+
const rpcUrls = _chunkV2OBGLJDcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
|
|
9459
10017
|
const service = _react.useMemo.call(void 0,
|
|
9460
|
-
() =>
|
|
10018
|
+
() => _chunkV2OBGLJDcjs.createDepositService.call(void 0, backendUrl, {
|
|
9461
10019
|
debug,
|
|
9462
10020
|
debugScope: "service:deposit"
|
|
9463
10021
|
}),
|
|
@@ -9491,15 +10049,15 @@ function DepositModalInner({
|
|
|
9491
10049
|
}, [store, targetChain, targetToken]);
|
|
9492
10050
|
_react.useEffect.call(void 0, () => {
|
|
9493
10051
|
if (!isOpen || !modalRef.current) return;
|
|
9494
|
-
return
|
|
10052
|
+
return _chunkV2OBGLJDcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
9495
10053
|
}, [isOpen, theme]);
|
|
9496
10054
|
_react.useEffect.call(void 0, () => {
|
|
9497
10055
|
if (isOpen) {
|
|
9498
|
-
_optionalChain([onReadyRef, 'access',
|
|
10056
|
+
_optionalChain([onReadyRef, 'access', _340 => _340.current, 'optionalCall', _341 => _341()]);
|
|
9499
10057
|
}
|
|
9500
10058
|
}, [isOpen, onReadyRef]);
|
|
9501
10059
|
_react.useEffect.call(void 0, () => {
|
|
9502
|
-
_optionalChain([onUiStateRef, 'access',
|
|
10060
|
+
_optionalChain([onUiStateRef, 'access', _342 => _342.current, 'optionalCall', _343 => _343({
|
|
9503
10061
|
screen: currentScreen,
|
|
9504
10062
|
back: backHandler,
|
|
9505
10063
|
submitting
|
|
@@ -9578,10 +10136,10 @@ function DepositModalInner({
|
|
|
9578
10136
|
fetchHistory("initial");
|
|
9579
10137
|
}
|
|
9580
10138
|
}, [historyOpen, fetchHistory]);
|
|
9581
|
-
const onLifecycleRef =
|
|
10139
|
+
const onLifecycleRef = _chunkV2OBGLJDcjs.useLatestRef.call(void 0, onLifecycle);
|
|
9582
10140
|
const handleLifecycle = _react.useCallback.call(void 0,
|
|
9583
10141
|
(event) => {
|
|
9584
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
10142
|
+
_optionalChain([onLifecycleRef, 'access', _344 => _344.current, 'optionalCall', _345 => _345(event)]);
|
|
9585
10143
|
if (event.type === "smart-account-changed" && !event.evm && !event.solana) {
|
|
9586
10144
|
historyStaleRef.current = true;
|
|
9587
10145
|
}
|
|
@@ -9591,6 +10149,31 @@ function DepositModalInner({
|
|
|
9591
10149
|
},
|
|
9592
10150
|
[onLifecycleRef, markHistoryStale]
|
|
9593
10151
|
);
|
|
10152
|
+
const closeWithSource = _react.useCallback.call(void 0,
|
|
10153
|
+
(source) => {
|
|
10154
|
+
const analytics = analyticsControllerRef.current;
|
|
10155
|
+
_optionalChain([analytics, 'optionalAccess', _346 => _346.abandon, 'call', _347 => _347(source === "provider_back" ? "provider_back" : "modal_close")]);
|
|
10156
|
+
_optionalChain([analytics, 'optionalAccess', _348 => _348.close, 'call', _349 => _349(source)]);
|
|
10157
|
+
onClose();
|
|
10158
|
+
},
|
|
10159
|
+
[onClose]
|
|
10160
|
+
);
|
|
10161
|
+
const handleModalDismiss = _react.useCallback.call(void 0,
|
|
10162
|
+
(reason) => {
|
|
10163
|
+
closeWithSource(
|
|
10164
|
+
reason === "escape" ? "escape" : reason === "overlay" ? "overlay" : "header_button"
|
|
10165
|
+
);
|
|
10166
|
+
},
|
|
10167
|
+
[closeWithSource]
|
|
10168
|
+
);
|
|
10169
|
+
_react.useEffect.call(void 0, () => {
|
|
10170
|
+
if (previousOpenRef.current && !isOpen) {
|
|
10171
|
+
const analytics = analyticsControllerRef.current;
|
|
10172
|
+
_optionalChain([analytics, 'optionalAccess', _350 => _350.abandon, 'call', _351 => _351("modal_close")]);
|
|
10173
|
+
_optionalChain([analytics, 'optionalAccess', _352 => _352.close, 'call', _353 => _353("host_controlled")]);
|
|
10174
|
+
}
|
|
10175
|
+
previousOpenRef.current = isOpen;
|
|
10176
|
+
}, [isOpen]);
|
|
9594
10177
|
_react.useEffect.call(void 0, () => {
|
|
9595
10178
|
if (!isOpen) {
|
|
9596
10179
|
setHistoryOpen(false);
|
|
@@ -9611,111 +10194,147 @@ function DepositModalInner({
|
|
|
9611
10194
|
store.dispatch({ type: "flow/reset" });
|
|
9612
10195
|
}
|
|
9613
10196
|
}, [isOpen, store]);
|
|
9614
|
-
const
|
|
10197
|
+
const walletIntegration = _nullishCoalesce(walletIntegrationProp, () => ( (hasWalletClientProp || walletSession || onRequestConnect ? "host_supplied" : "none")));
|
|
10198
|
+
const analyticsSessionProperties = buildDepositAnalyticsSessionProperties({
|
|
10199
|
+
enableWallet,
|
|
10200
|
+
enableFiatOnramp,
|
|
10201
|
+
enableQrTransfer,
|
|
10202
|
+
enableGaslessDeposit,
|
|
10203
|
+
enableExchangeConnect,
|
|
10204
|
+
fiatMethods,
|
|
10205
|
+
assetMigrations,
|
|
10206
|
+
initialAssetMigration,
|
|
10207
|
+
inline,
|
|
10208
|
+
closeOnOverlayClick,
|
|
10209
|
+
sourceChain: sourceChainProp,
|
|
10210
|
+
sourceToken,
|
|
10211
|
+
defaultAmount,
|
|
10212
|
+
walletIntegration,
|
|
10213
|
+
targetChain,
|
|
10214
|
+
targetToken
|
|
10215
|
+
});
|
|
10216
|
+
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _354 => _354.showBackButton]), () => ( true));
|
|
9615
10217
|
const canGoBack = backHandler !== void 0;
|
|
9616
10218
|
const hideHeaderChrome = swappedImmersive;
|
|
9617
10219
|
const modalClassName = `rs-modal${hideHeaderChrome ? " rs-modal--swapped-iframe" : ""}`;
|
|
9618
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9619
|
-
|
|
10220
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.ChainCatalogProvider, { service, rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
10221
|
+
_chunkV2OBGLJDcjs.Modal,
|
|
9620
10222
|
{
|
|
9621
10223
|
isOpen,
|
|
9622
|
-
onClose,
|
|
10224
|
+
onClose: handleModalDismiss,
|
|
9623
10225
|
className,
|
|
9624
10226
|
inline,
|
|
9625
10227
|
closeOnOverlayClick,
|
|
9626
|
-
children: /* @__PURE__ */ _jsxruntime.
|
|
9627
|
-
|
|
9628
|
-
|
|
9629
|
-
|
|
10228
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
10229
|
+
_chunkV2OBGLJDcjs.AnalyticsSession,
|
|
10230
|
+
{
|
|
10231
|
+
modal: "deposit",
|
|
10232
|
+
sessionProperties: analyticsSessionProperties,
|
|
10233
|
+
onEvent,
|
|
10234
|
+
backendUrl,
|
|
10235
|
+
enableIngest: enableAnalyticsIngest,
|
|
10236
|
+
ingestUrl: analyticsIngestUrl,
|
|
10237
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
10238
|
+
DepositAnalyticsControllerProvider,
|
|
9630
10239
|
{
|
|
9631
|
-
|
|
9632
|
-
|
|
9633
|
-
|
|
9634
|
-
|
|
9635
|
-
|
|
10240
|
+
controllerRef: analyticsControllerRef,
|
|
10241
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { ref: modalRef, className: modalClassName, children: [
|
|
10242
|
+
!hideHeaderChrome && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header--redesigned", children: [
|
|
10243
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-left", children: showBackButton && canGoBack && backHandler && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
10244
|
+
"button",
|
|
10245
|
+
{
|
|
10246
|
+
type: "button",
|
|
10247
|
+
className: "rs-modal-header-back",
|
|
10248
|
+
"aria-label": "Go back",
|
|
10249
|
+
onClick: backHandler,
|
|
10250
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.ChevronLeftIcon, {})
|
|
10251
|
+
}
|
|
10252
|
+
) }),
|
|
10253
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
|
|
10254
|
+
historyButtonVisible && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
10255
|
+
"button",
|
|
10256
|
+
{
|
|
10257
|
+
type: "button",
|
|
10258
|
+
className: "rs-modal-header-history",
|
|
10259
|
+
"aria-label": "Deposit history",
|
|
10260
|
+
onClick: handleHistoryOpen,
|
|
10261
|
+
disabled: !recipient,
|
|
10262
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.HistoryIcon, {})
|
|
10263
|
+
}
|
|
10264
|
+
),
|
|
10265
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
10266
|
+
"button",
|
|
10267
|
+
{
|
|
10268
|
+
type: "button",
|
|
10269
|
+
onClick: () => closeWithSource("header_button"),
|
|
10270
|
+
className: "rs-modal-close",
|
|
10271
|
+
"aria-label": "Close",
|
|
10272
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CloseIcon, {})
|
|
10273
|
+
}
|
|
10274
|
+
)
|
|
10275
|
+
] })
|
|
10276
|
+
] }),
|
|
10277
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
10278
|
+
DepositFlow,
|
|
10279
|
+
{
|
|
10280
|
+
walletClientProp,
|
|
10281
|
+
publicClientProp,
|
|
10282
|
+
hasWalletClientProp,
|
|
10283
|
+
targetChain,
|
|
10284
|
+
targetToken,
|
|
10285
|
+
service,
|
|
10286
|
+
sourceChain,
|
|
10287
|
+
sourceToken,
|
|
10288
|
+
amount: defaultAmount,
|
|
10289
|
+
recipient,
|
|
10290
|
+
appBalanceUsd,
|
|
10291
|
+
outputTokenRules,
|
|
10292
|
+
rejectUnmapped,
|
|
10293
|
+
forceRegister,
|
|
10294
|
+
assetMigrations,
|
|
10295
|
+
initialAssetMigration,
|
|
10296
|
+
enableFiatOnramp,
|
|
10297
|
+
enableQrTransfer,
|
|
10298
|
+
enableGaslessDeposit,
|
|
10299
|
+
fiatMethods,
|
|
10300
|
+
enableWallet,
|
|
10301
|
+
enableExchangeConnect,
|
|
10302
|
+
walletSession,
|
|
10303
|
+
walletIntegration,
|
|
10304
|
+
onConnect,
|
|
10305
|
+
onDisconnect,
|
|
10306
|
+
onRequestConnect,
|
|
10307
|
+
uiConfig,
|
|
10308
|
+
appFees: _optionalChain([clientSetup, 'optionalAccess', _355 => _355.appFees]),
|
|
10309
|
+
appFeesResolved: clientSetup !== null,
|
|
10310
|
+
onStepChange: handleStepChange,
|
|
10311
|
+
onSwappedImmersiveChange: setSwappedImmersive,
|
|
10312
|
+
openExternally,
|
|
10313
|
+
onSubmittingChange: setSubmitting,
|
|
10314
|
+
onClose: (source) => closeWithSource(_nullishCoalesce(source, () => ( "header_button"))),
|
|
10315
|
+
onLifecycle: handleLifecycle,
|
|
10316
|
+
onError,
|
|
10317
|
+
debug
|
|
10318
|
+
}
|
|
10319
|
+
),
|
|
10320
|
+
historyOpen && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
10321
|
+
DepositHistoryPanel,
|
|
10322
|
+
{
|
|
10323
|
+
deposits: historyDeposits,
|
|
10324
|
+
isLoading: historyLoading,
|
|
10325
|
+
error: historyError,
|
|
10326
|
+
hasMore: hasMoreHistory,
|
|
10327
|
+
isLoadingMore: historyLoadingMore,
|
|
10328
|
+
onLoadMore: handleHistoryLoadMore,
|
|
10329
|
+
onClose: handleHistoryClose,
|
|
10330
|
+
onCloseModal: () => closeWithSource("header_button")
|
|
10331
|
+
}
|
|
10332
|
+
)
|
|
10333
|
+
] })
|
|
9636
10334
|
}
|
|
9637
|
-
)
|
|
9638
|
-
|
|
9639
|
-
|
|
9640
|
-
"button",
|
|
9641
|
-
{
|
|
9642
|
-
type: "button",
|
|
9643
|
-
className: "rs-modal-header-history",
|
|
9644
|
-
"aria-label": "Deposit history",
|
|
9645
|
-
onClick: handleHistoryOpen,
|
|
9646
|
-
disabled: !recipient,
|
|
9647
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.HistoryIcon, {})
|
|
9648
|
-
}
|
|
9649
|
-
),
|
|
9650
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9651
|
-
"button",
|
|
9652
|
-
{
|
|
9653
|
-
type: "button",
|
|
9654
|
-
onClick: onClose,
|
|
9655
|
-
className: "rs-modal-close",
|
|
9656
|
-
"aria-label": "Close",
|
|
9657
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZMT4ATHRcjs.CloseIcon, {})
|
|
9658
|
-
}
|
|
9659
|
-
)
|
|
9660
|
-
] })
|
|
9661
|
-
] }),
|
|
9662
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9663
|
-
DepositFlow,
|
|
9664
|
-
{
|
|
9665
|
-
walletClientProp,
|
|
9666
|
-
publicClientProp,
|
|
9667
|
-
hasWalletClientProp,
|
|
9668
|
-
targetChain,
|
|
9669
|
-
targetToken,
|
|
9670
|
-
service,
|
|
9671
|
-
sourceChain,
|
|
9672
|
-
sourceToken,
|
|
9673
|
-
amount: defaultAmount,
|
|
9674
|
-
recipient,
|
|
9675
|
-
appBalanceUsd,
|
|
9676
|
-
outputTokenRules,
|
|
9677
|
-
rejectUnmapped,
|
|
9678
|
-
forceRegister,
|
|
9679
|
-
assetMigrations,
|
|
9680
|
-
initialAssetMigration,
|
|
9681
|
-
enableFiatOnramp,
|
|
9682
|
-
enableQrTransfer,
|
|
9683
|
-
enableGaslessDeposit,
|
|
9684
|
-
fiatMethods,
|
|
9685
|
-
enableWallet,
|
|
9686
|
-
enableExchangeConnect,
|
|
9687
|
-
walletSession,
|
|
9688
|
-
onConnect,
|
|
9689
|
-
onDisconnect,
|
|
9690
|
-
onRequestConnect,
|
|
9691
|
-
uiConfig,
|
|
9692
|
-
appFees: _optionalChain([clientSetup, 'optionalAccess', _336 => _336.appFees]),
|
|
9693
|
-
appFeesResolved: clientSetup !== null,
|
|
9694
|
-
onStepChange: handleStepChange,
|
|
9695
|
-
onSwappedImmersiveChange: setSwappedImmersive,
|
|
9696
|
-
openExternally,
|
|
9697
|
-
onSubmittingChange: setSubmitting,
|
|
9698
|
-
onClose,
|
|
9699
|
-
onLifecycle: handleLifecycle,
|
|
9700
|
-
onEvent,
|
|
9701
|
-
onError,
|
|
9702
|
-
debug
|
|
9703
|
-
}
|
|
9704
|
-
),
|
|
9705
|
-
historyOpen && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9706
|
-
DepositHistoryPanel,
|
|
9707
|
-
{
|
|
9708
|
-
deposits: historyDeposits,
|
|
9709
|
-
isLoading: historyLoading,
|
|
9710
|
-
error: historyError,
|
|
9711
|
-
hasMore: hasMoreHistory,
|
|
9712
|
-
isLoadingMore: historyLoadingMore,
|
|
9713
|
-
onLoadMore: handleHistoryLoadMore,
|
|
9714
|
-
onClose: handleHistoryClose,
|
|
9715
|
-
onCloseModal: onClose
|
|
9716
|
-
}
|
|
9717
|
-
)
|
|
9718
|
-
] })
|
|
10335
|
+
)
|
|
10336
|
+
}
|
|
10337
|
+
)
|
|
9719
10338
|
}
|
|
9720
10339
|
) }) }) });
|
|
9721
10340
|
}
|