@rhinestone/deposit-modal 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{DepositModalReown-IFN6YLZJ.cjs → DepositModalReown-6CXXGQ7X.cjs} +16 -16
- package/dist/{DepositModalReown-R7UROJPJ.mjs → DepositModalReown-ELDSTIME.mjs} +3 -3
- package/dist/WithdrawModal-QB2U756L.cjs +11 -0
- package/dist/{WithdrawModal-XKSSHVEJ.mjs → WithdrawModal-QRMDR5T4.mjs} +3 -3
- package/dist/{chunk-24N4KMJX.cjs → chunk-2W4BJ5I3.cjs} +71 -71
- package/dist/{chunk-F6ROQ6RJ.mjs → chunk-H66WM5AO.mjs} +7 -4
- package/dist/{chunk-5CM3ZQ5U.cjs → chunk-JCWJ6HW7.cjs} +1 -1
- package/dist/{chunk-H4O22O7Y.cjs → chunk-QGNJFDEO.cjs} +362 -181
- package/dist/{chunk-EA5CE2UZ.mjs → chunk-QMGEK623.mjs} +210 -29
- package/dist/{chunk-3HCCR54R.mjs → chunk-XCBDJPBD.mjs} +1 -1
- package/dist/{chunk-V466XQSG.cjs → chunk-XJMDCBHS.cjs} +444 -441
- package/dist/{chunk-HMB2XQGD.mjs → chunk-ZHX4QROC.mjs} +1 -1
- 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 +4 -4
- package/dist/deposit.mjs +3 -3
- package/dist/embed.cjs +14 -14
- package/dist/embed.mjs +4 -4
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +4 -4
- package/dist/styles.css +22 -0
- package/dist/withdraw.cjs +4 -4
- package/dist/withdraw.mjs +3 -3
- package/package.json +4 -4
- package/dist/WithdrawModal-SZEAI473.cjs +0 -11
|
@@ -86,7 +86,8 @@
|
|
|
86
86
|
|
|
87
87
|
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
|
|
90
|
+
var _chunkQGNJFDEOcjs = require('./chunk-QGNJFDEO.cjs');
|
|
90
91
|
|
|
91
92
|
|
|
92
93
|
|
|
@@ -244,11 +245,11 @@ SegmentedToggle.displayName = "SegmentedToggle";
|
|
|
244
245
|
|
|
245
246
|
function ChainIcon({ chainId, className, loading }) {
|
|
246
247
|
const badge = _chunkOY5N3E6Lcjs.getChainBadge.call(void 0, chainId);
|
|
247
|
-
const catalogChain =
|
|
248
|
+
const catalogChain = _chunkQGNJFDEOcjs.useCatalogChain.call(void 0, _chunkQGNJFDEOcjs.catalogKeyForChain.call(void 0, chainId));
|
|
248
249
|
const name = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _2 => _2.name]), () => ( _chunkOY5N3E6Lcjs.getChainName.call(void 0, chainId)));
|
|
249
250
|
const initial = (_nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _3 => _3.name]), () => ( badge.shortLabel))).charAt(0);
|
|
250
251
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
251
|
-
|
|
252
|
+
_chunkQGNJFDEOcjs.CdnIcon,
|
|
252
253
|
{
|
|
253
254
|
src: _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _4 => _4.iconUrl]), () => ( _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, chainId))),
|
|
254
255
|
alt: name,
|
|
@@ -271,7 +272,7 @@ ChainIcon.displayName = "ChainIcon";
|
|
|
271
272
|
// src/components/ui/WalletBadgeIcons/index.tsx
|
|
272
273
|
|
|
273
274
|
function BadgeImage({ src, alt = "" }) {
|
|
274
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
275
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.CdnIcon, { src, alt }) });
|
|
275
276
|
}
|
|
276
277
|
var WALLET_BADGES = ["rabby", "phantom", "walletconnect"];
|
|
277
278
|
function WalletBadgeIcons() {
|
|
@@ -324,7 +325,7 @@ var DAPP_IMPORT_CATALOG = [
|
|
|
324
325
|
// src/components/ui/BrandIcons.tsx
|
|
325
326
|
|
|
326
327
|
function ExchangeBadgeImage({ name }) {
|
|
327
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
328
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.CdnIcon, { src: _nullishCoalesce(_chunkQGNJFDEOcjs.getExchangeLogoSrc.call(void 0, name), () => ( void 0)) });
|
|
328
329
|
}
|
|
329
330
|
var CARD_NETWORKS = ["amex", "visa", "mastercard"];
|
|
330
331
|
function CardNetworkIcons() {
|
|
@@ -332,7 +333,7 @@ function CardNetworkIcons() {
|
|
|
332
333
|
"span",
|
|
333
334
|
{
|
|
334
335
|
className: `rs-card-network rs-card-network--${network}`,
|
|
335
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
336
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.CdnIcon, { src: _chunkOY5N3E6Lcjs.cdnIconUrl.call(void 0, "cards", network) })
|
|
336
337
|
},
|
|
337
338
|
network
|
|
338
339
|
)) });
|
|
@@ -351,7 +352,7 @@ function DappBadgeIcons() {
|
|
|
351
352
|
).filter(
|
|
352
353
|
(brand) => Boolean(brand)
|
|
353
354
|
);
|
|
354
|
-
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,
|
|
355
|
+
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, _chunkQGNJFDEOcjs.CdnIcon, { src: brand.iconUrl, alt: brand.label }) }, brand.id)) });
|
|
355
356
|
}
|
|
356
357
|
DappBadgeIcons.displayName = "DappBadgeIcons";
|
|
357
358
|
var DAPP_BADGE_COUNT = DAPP_BADGE_ORDER.length;
|
|
@@ -371,9 +372,9 @@ function balanceSubtitle(status, balanceUsd, fallback) {
|
|
|
371
372
|
return "No balance";
|
|
372
373
|
}
|
|
373
374
|
function fiatIcon(name) {
|
|
374
|
-
if (name === "apple") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
375
|
-
if (name === "bank") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
376
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
375
|
+
if (name === "apple") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.AppleIcon, {});
|
|
376
|
+
if (name === "bank") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.BankIcon, {});
|
|
377
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.CardIcon, {});
|
|
377
378
|
}
|
|
378
379
|
function FiatMethodIcon({ option }) {
|
|
379
380
|
const [remoteFailed, setRemoteFailed] = _react.useState.call(void 0, false);
|
|
@@ -456,20 +457,20 @@ function renderWalletLeading(row) {
|
|
|
456
457
|
}
|
|
457
458
|
);
|
|
458
459
|
}
|
|
459
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
460
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.WalletIcon, {});
|
|
460
461
|
}
|
|
461
|
-
var TRANSFER_CRYPTO_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
462
|
-
var WALLET_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
463
|
-
var EXCHANGE_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
464
|
-
var MIGRATE_ASSETS_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
465
|
-
var SMALL_SPINNER = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
462
|
+
var TRANSFER_CRYPTO_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.TransferCryptoIcon, {});
|
|
463
|
+
var WALLET_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.WalletIcon, {});
|
|
464
|
+
var EXCHANGE_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.UnplugIcon, {});
|
|
465
|
+
var MIGRATE_ASSETS_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.MigrateAssetsIcon, {});
|
|
466
|
+
var SMALL_SPINNER = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.Spinner, { className: "rs-spinner--sm" });
|
|
466
467
|
var CONNECT_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
467
468
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, WalletBadgeIcons, {}),
|
|
468
469
|
"+100"
|
|
469
470
|
] });
|
|
470
471
|
var EXTRA_EXCHANGE_COUNT = Math.max(
|
|
471
472
|
0,
|
|
472
|
-
|
|
473
|
+
_chunkQGNJFDEOcjs.SUPPORTED_CONNECT_EXCHANGE_COUNT - EXCHANGE_BADGE_COUNT
|
|
473
474
|
);
|
|
474
475
|
var EXCHANGE_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
475
476
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExchangeBadgeIcons, {}),
|
|
@@ -527,7 +528,7 @@ function ConnectStep({
|
|
|
527
528
|
if (onSelectTransferCrypto) {
|
|
528
529
|
cryptoRows.push(
|
|
529
530
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
530
|
-
|
|
531
|
+
_chunkQGNJFDEOcjs.ListRow,
|
|
531
532
|
{
|
|
532
533
|
leading: TRANSFER_CRYPTO_LEADING,
|
|
533
534
|
title: "Transfer crypto",
|
|
@@ -548,7 +549,7 @@ function ConnectStep({
|
|
|
548
549
|
);
|
|
549
550
|
cryptoRows.push(
|
|
550
551
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
551
|
-
|
|
552
|
+
_chunkQGNJFDEOcjs.ListRow,
|
|
552
553
|
{
|
|
553
554
|
leading: renderWalletLeading(row),
|
|
554
555
|
title: collapseToExternal ? "External wallet" : row.label,
|
|
@@ -565,7 +566,7 @@ function ConnectStep({
|
|
|
565
566
|
if (!hasSessionWallet && handleConnect) {
|
|
566
567
|
cryptoRows.push(
|
|
567
568
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
568
|
-
|
|
569
|
+
_chunkQGNJFDEOcjs.ListRow,
|
|
569
570
|
{
|
|
570
571
|
leading: WALLET_LEADING,
|
|
571
572
|
title: "Connect wallet",
|
|
@@ -580,7 +581,7 @@ function ConnectStep({
|
|
|
580
581
|
if (onSelectFundFromExchange) {
|
|
581
582
|
cryptoRows.push(
|
|
582
583
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
583
|
-
|
|
584
|
+
_chunkQGNJFDEOcjs.ListRow,
|
|
584
585
|
{
|
|
585
586
|
leading: EXCHANGE_LEADING,
|
|
586
587
|
title: "Connect exchange",
|
|
@@ -595,7 +596,7 @@ function ConnectStep({
|
|
|
595
596
|
if (onSelectMigrateAssets) {
|
|
596
597
|
cryptoRows.push(
|
|
597
598
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
598
|
-
|
|
599
|
+
_chunkQGNJFDEOcjs.ListRow,
|
|
599
600
|
{
|
|
600
601
|
leading: MIGRATE_ASSETS_LEADING,
|
|
601
602
|
title: "Migrate assets",
|
|
@@ -616,7 +617,7 @@ function ConnectStep({
|
|
|
616
617
|
for (const opt of fiatPaymentMethods) {
|
|
617
618
|
cashRows.push(
|
|
618
619
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
619
|
-
|
|
620
|
+
_chunkQGNJFDEOcjs.ListRow,
|
|
620
621
|
{
|
|
621
622
|
leading: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FiatMethodIcon, { option: opt }),
|
|
622
623
|
title: opt.label,
|
|
@@ -631,7 +632,7 @@ function ConnectStep({
|
|
|
631
632
|
} else if (fiatLoading) {
|
|
632
633
|
cashRows.push(
|
|
633
634
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
634
|
-
|
|
635
|
+
_chunkQGNJFDEOcjs.ListRow,
|
|
635
636
|
{
|
|
636
637
|
leading: SMALL_SPINNER,
|
|
637
638
|
title: "Loading payment options\u2026",
|
|
@@ -660,9 +661,9 @@ function ConnectStep({
|
|
|
660
661
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
661
662
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
662
663
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
663
|
-
|
|
664
|
+
_chunkQGNJFDEOcjs.BodyHeader,
|
|
664
665
|
{
|
|
665
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
666
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.HandCoinsIcon, {}),
|
|
666
667
|
title,
|
|
667
668
|
subtitle: _nullishCoalesce(subtitle, () => ( defaultSubtitle)),
|
|
668
669
|
aside: showToggle ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -698,7 +699,7 @@ function ConnectStep({
|
|
|
698
699
|
children: "Disconnect wallet"
|
|
699
700
|
}
|
|
700
701
|
) }),
|
|
701
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
702
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.PoweredBy, {})
|
|
702
703
|
] });
|
|
703
704
|
}
|
|
704
705
|
ConnectStep.displayName = "ConnectStep";
|
|
@@ -721,17 +722,17 @@ function AssetSelectStep({
|
|
|
721
722
|
const [selectedAssetId, setSelectedAssetId] = _react.useState.call(void 0, null);
|
|
722
723
|
const [loading, setLoading] = _react.useState.call(void 0, true);
|
|
723
724
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
724
|
-
const isDepositChain =
|
|
725
|
-
const { catalog } =
|
|
726
|
-
const chainName =
|
|
725
|
+
const isDepositChain = _chunkQGNJFDEOcjs.useIsDepositChain.call(void 0, );
|
|
726
|
+
const { catalog } = _chunkQGNJFDEOcjs.useChainCatalog.call(void 0, );
|
|
727
|
+
const chainName = _chunkQGNJFDEOcjs.useChainName.call(void 0, );
|
|
727
728
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
728
729
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
729
|
-
return
|
|
730
|
+
return _chunkQGNJFDEOcjs.getAssetId.call(void 0, {
|
|
730
731
|
chainId: defaultSourceChain,
|
|
731
732
|
token: defaultSourceToken
|
|
732
733
|
});
|
|
733
734
|
}, [defaultSourceChain, defaultSourceToken]);
|
|
734
|
-
const onTotalBalanceComputedRef =
|
|
735
|
+
const onTotalBalanceComputedRef = _chunkQGNJFDEOcjs.useLatestRef.call(void 0, onTotalBalanceComputed);
|
|
735
736
|
_react.useEffect.call(void 0, () => {
|
|
736
737
|
let active = true;
|
|
737
738
|
function emitAssetsUpdate(currentAssets) {
|
|
@@ -751,7 +752,7 @@ function AssetSelectStep({
|
|
|
751
752
|
try {
|
|
752
753
|
const portfolio = await service.fetchPortfolio(address);
|
|
753
754
|
if (!active) return;
|
|
754
|
-
const portfolioAssets =
|
|
755
|
+
const portfolioAssets = _chunkQGNJFDEOcjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
755
756
|
setAssets(portfolioAssets);
|
|
756
757
|
emitAssetsUpdate(portfolioAssets);
|
|
757
758
|
const hasNative = portfolioAssets.some(
|
|
@@ -830,7 +831,7 @@ function AssetSelectStep({
|
|
|
830
831
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
831
832
|
const numeric = Number(raw);
|
|
832
833
|
if (!Number.isFinite(numeric)) return raw;
|
|
833
|
-
return
|
|
834
|
+
return _chunkQGNJFDEOcjs.tokenFormatter.format(numeric);
|
|
834
835
|
} catch (e3) {
|
|
835
836
|
return asset.balance;
|
|
836
837
|
}
|
|
@@ -838,20 +839,20 @@ function AssetSelectStep({
|
|
|
838
839
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
839
840
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
840
841
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
841
|
-
|
|
842
|
+
_chunkQGNJFDEOcjs.BodyHeader,
|
|
842
843
|
{
|
|
843
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
844
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.WalletIcon, {}),
|
|
844
845
|
title: "Your assets",
|
|
845
846
|
subtitle: "Select source assets to transfer"
|
|
846
847
|
}
|
|
847
848
|
),
|
|
848
849
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
849
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
850
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
850
851
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
851
852
|
] }),
|
|
852
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
853
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.Callout, { variant: "error", children: error }),
|
|
853
854
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
854
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
855
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
855
856
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
856
857
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
857
858
|
address.slice(0, 6),
|
|
@@ -884,13 +885,13 @@ function AssetSelectStep({
|
|
|
884
885
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
|
|
885
886
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-icon-wrapper", children: [
|
|
886
887
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
887
|
-
|
|
888
|
+
_chunkQGNJFDEOcjs.TokenIcon,
|
|
888
889
|
{
|
|
889
890
|
symbol: asset.symbol,
|
|
890
891
|
fallback: asset.symbol.slice(0, 4)
|
|
891
892
|
}
|
|
892
893
|
) }),
|
|
893
|
-
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
894
|
+
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.CdnIcon, { src: chainIcon, alt: chainName(asset.chainId) }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
894
895
|
"span",
|
|
895
896
|
{
|
|
896
897
|
className: "rs-asset-chain-badge",
|
|
@@ -917,14 +918,14 @@ function AssetSelectStep({
|
|
|
917
918
|
] })
|
|
918
919
|
] })
|
|
919
920
|
] }),
|
|
920
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ?
|
|
921
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunkQGNJFDEOcjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
921
922
|
]
|
|
922
923
|
},
|
|
923
924
|
asset.id
|
|
924
925
|
);
|
|
925
926
|
}) }),
|
|
926
927
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
927
|
-
|
|
928
|
+
_chunkQGNJFDEOcjs.Button,
|
|
928
929
|
{
|
|
929
930
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
930
931
|
disabled: !selectedAsset,
|
|
@@ -933,7 +934,7 @@ function AssetSelectStep({
|
|
|
933
934
|
}
|
|
934
935
|
)
|
|
935
936
|
] }),
|
|
936
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
937
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.PoweredBy, {})
|
|
937
938
|
] });
|
|
938
939
|
}
|
|
939
940
|
async function fetchNativeAssets(address, publicClient, existing, isDepositChain, catalogChain) {
|
|
@@ -941,7 +942,7 @@ async function fetchNativeAssets(address, publicClient, existing, isDepositChain
|
|
|
941
942
|
const connectedChainId = _optionalChain([publicClient, 'access', _16 => _16.chain, 'optionalAccess', _17 => _17.id]);
|
|
942
943
|
if (!connectedChainId) return [];
|
|
943
944
|
if (!isDepositChain(connectedChainId)) return [];
|
|
944
|
-
const id =
|
|
945
|
+
const id = _chunkQGNJFDEOcjs.getAssetId.call(void 0, {
|
|
945
946
|
chainId: connectedChainId,
|
|
946
947
|
token: _chunkOY5N3E6Lcjs.NATIVE_TOKEN_ADDRESS
|
|
947
948
|
});
|
|
@@ -1147,7 +1148,7 @@ function AmountStep({
|
|
|
1147
1148
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
1148
1149
|
if (!balanceTarget || !publicClient) return;
|
|
1149
1150
|
try {
|
|
1150
|
-
const bal =
|
|
1151
|
+
const bal = _chunkQGNJFDEOcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
1151
1152
|
address: asset.token,
|
|
1152
1153
|
abi: _viem.erc20Abi,
|
|
1153
1154
|
functionName: "balanceOf",
|
|
@@ -1168,7 +1169,7 @@ function AmountStep({
|
|
|
1168
1169
|
hasAttemptedSwitch.current = true;
|
|
1169
1170
|
switchChain(asset.chainId).catch((err) => {
|
|
1170
1171
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
1171
|
-
setError(
|
|
1172
|
+
setError(_chunkQGNJFDEOcjs.formatUserError.call(void 0, raw));
|
|
1172
1173
|
});
|
|
1173
1174
|
}
|
|
1174
1175
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -1221,7 +1222,7 @@ function AmountStep({
|
|
|
1221
1222
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
1222
1223
|
const numeric = Number(raw);
|
|
1223
1224
|
if (!Number.isFinite(numeric)) return raw;
|
|
1224
|
-
return
|
|
1225
|
+
return _chunkQGNJFDEOcjs.tokenFormatter.format(numeric);
|
|
1225
1226
|
} catch (e8) {
|
|
1226
1227
|
return "\u2026";
|
|
1227
1228
|
}
|
|
@@ -1309,12 +1310,12 @@ function AmountStep({
|
|
|
1309
1310
|
const needsPricing = !knowsBalance && !isSourceStablecoin;
|
|
1310
1311
|
const blockedOnPricing = needsPricing && !hasPricing;
|
|
1311
1312
|
const continueDisabled = chainMismatch || exceedsBalance || blockedOnPricing || numericAmount === 0 && !isBelowMin || knowsBalance && balance === null;
|
|
1312
|
-
const chainName =
|
|
1313
|
+
const chainName = _chunkQGNJFDEOcjs.useChainName.call(void 0, );
|
|
1313
1314
|
const sourceChainName = chainName(asset.chainId);
|
|
1314
1315
|
const targetChainName = chainName(targetChainId);
|
|
1315
1316
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
1316
1317
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
1317
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1318
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.WalletIcon, {}), title }),
|
|
1318
1319
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
1319
1320
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
1320
1321
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1334,13 +1335,13 @@ function AmountStep({
|
|
|
1334
1335
|
" available",
|
|
1335
1336
|
balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1336
1337
|
" (~",
|
|
1337
|
-
|
|
1338
|
+
_chunkQGNJFDEOcjs.currencyFormatter.format(balanceUsd),
|
|
1338
1339
|
")"
|
|
1339
1340
|
] })
|
|
1340
1341
|
] }),
|
|
1341
1342
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
1342
1343
|
"Min. deposit ",
|
|
1343
|
-
|
|
1344
|
+
_chunkQGNJFDEOcjs.currencyFormatter.format(minDepositUsd)
|
|
1344
1345
|
] })
|
|
1345
1346
|
] })
|
|
1346
1347
|
] }),
|
|
@@ -1365,7 +1366,7 @@ function AmountStep({
|
|
|
1365
1366
|
" ",
|
|
1366
1367
|
asset.symbol
|
|
1367
1368
|
] }),
|
|
1368
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1369
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.TokenIcon, { symbol: asset.symbol }) })
|
|
1369
1370
|
] })
|
|
1370
1371
|
] }),
|
|
1371
1372
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
@@ -1376,21 +1377,21 @@ function AmountStep({
|
|
|
1376
1377
|
" ",
|
|
1377
1378
|
targetSymbol
|
|
1378
1379
|
] }),
|
|
1379
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1380
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.TokenIcon, { symbol: targetSymbol }) })
|
|
1380
1381
|
] })
|
|
1381
1382
|
] }),
|
|
1382
1383
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
1383
1384
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
1384
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
1385
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkQGNJFDEOcjs.currencyFormatter.format(balanceAfterUsd) })
|
|
1385
1386
|
] })
|
|
1386
1387
|
] }),
|
|
1387
|
-
blockedOnPricing && sourcePriceUnavailable && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1388
|
+
blockedOnPricing && sourcePriceUnavailable && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkQGNJFDEOcjs.Callout, { variant: "error", children: [
|
|
1388
1389
|
asset.symbol,
|
|
1389
1390
|
" can't be priced right now, so this deposit can't be estimated. You can still send any amount to the deposit address."
|
|
1390
1391
|
] }),
|
|
1391
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1392
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.Callout, { variant: "error", children: error }),
|
|
1392
1393
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1393
|
-
|
|
1394
|
+
_chunkQGNJFDEOcjs.Button,
|
|
1394
1395
|
{
|
|
1395
1396
|
onClick: handleContinue,
|
|
1396
1397
|
fullWidth: true,
|
|
@@ -1399,7 +1400,7 @@ function AmountStep({
|
|
|
1399
1400
|
}
|
|
1400
1401
|
)
|
|
1401
1402
|
] }),
|
|
1402
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1403
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.PoweredBy, {})
|
|
1403
1404
|
] });
|
|
1404
1405
|
}
|
|
1405
1406
|
|
|
@@ -1426,14 +1427,14 @@ function ReviewDetails({
|
|
|
1426
1427
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
1427
1428
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1428
1429
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceChainName }),
|
|
1429
|
-
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1430
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.CdnIcon, { src: sourceChainIcon }) })
|
|
1430
1431
|
] })
|
|
1431
1432
|
] }),
|
|
1432
1433
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1433
1434
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
|
|
1434
1435
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1435
1436
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName }),
|
|
1436
|
-
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1437
|
+
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.CdnIcon, { src: targetChainIcon }) })
|
|
1437
1438
|
] })
|
|
1438
1439
|
] }),
|
|
1439
1440
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -1448,21 +1449,21 @@ function ReviewDetails({
|
|
|
1448
1449
|
" ",
|
|
1449
1450
|
sendSymbol
|
|
1450
1451
|
] }),
|
|
1451
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1452
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.TokenIcon, { symbol: sendSymbol }) })
|
|
1452
1453
|
] })
|
|
1453
1454
|
] }),
|
|
1454
1455
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1455
1456
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Receive" }),
|
|
1456
1457
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1457
1458
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: receiveDisplay }),
|
|
1458
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1459
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.TokenIcon, { symbol: receiveSymbol }) })
|
|
1459
1460
|
] })
|
|
1460
1461
|
] }),
|
|
1461
1462
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1462
1463
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Fees" }),
|
|
1463
1464
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1464
1465
|
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 }),
|
|
1465
|
-
fee.tooltip !== void 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1466
|
+
fee.tooltip !== void 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.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, _chunkQGNJFDEOcjs.InfoIcon, {}) }) })
|
|
1466
1467
|
] })
|
|
1467
1468
|
] })
|
|
1468
1469
|
] });
|
|
@@ -1680,17 +1681,17 @@ function ConfirmStep({
|
|
|
1680
1681
|
const targetChainName = _chunkOY5N3E6Lcjs.getChainName.call(void 0, targetChainId);
|
|
1681
1682
|
const sourceChainIcon = _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, asset.chainId);
|
|
1682
1683
|
const targetChainIcon = _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, targetChainId);
|
|
1683
|
-
const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? _nullishCoalesce(
|
|
1684
|
-
const mustHaveQuote = !appFeesResolved ||
|
|
1684
|
+
const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? _nullishCoalesce(_chunkQGNJFDEOcjs.formatTokenAmount.call(void 0, Number(amount), asset.symbol), () => ( "0")) : "0";
|
|
1685
|
+
const mustHaveQuote = !appFeesResolved || _chunkQGNJFDEOcjs.resolveAppFeeBps.call(void 0,
|
|
1685
1686
|
appFees,
|
|
1686
1687
|
`eip155:${quoteSource.chainId}`,
|
|
1687
1688
|
quoteSource.token
|
|
1688
1689
|
) > 0;
|
|
1689
|
-
const { display: feeDisplay, struck: feesFullySponsored } =
|
|
1690
|
+
const { display: feeDisplay, struck: feesFullySponsored } = _chunkQGNJFDEOcjs.quoteFeeRow.call(void 0,
|
|
1690
1691
|
_optionalChain([quote, 'optionalAccess', _67 => _67.fees])
|
|
1691
1692
|
);
|
|
1692
1693
|
const directTransfer = sameRoute && !mustHaveQuote && !executeTransfer;
|
|
1693
|
-
const permitEligible = enableGaslessDeposit && !
|
|
1694
|
+
const permitEligible = enableGaslessDeposit && !_chunkQGNJFDEOcjs.isNativeAsset.call(void 0, asset) && !isDappImportAsset(asset) && !executeTransfer && !directTransfer && asset.chainId !== _chunkOY5N3E6Lcjs.HYPERCORE_CHAIN_ID;
|
|
1694
1695
|
const permitRequestKey = JSON.stringify([
|
|
1695
1696
|
smartAccount.toLowerCase(),
|
|
1696
1697
|
asset.chainId,
|
|
@@ -1703,32 +1704,33 @@ function ConfirmStep({
|
|
|
1703
1704
|
const receiveDisplay = (() => {
|
|
1704
1705
|
if (directTransfer) return `${formattedSendAmount} ${asset.symbol}`;
|
|
1705
1706
|
if (quote) {
|
|
1706
|
-
const quoted =
|
|
1707
|
+
const quoted = _chunkQGNJFDEOcjs.formatQuotedReceive.call(void 0, quote.output, targetSymbol);
|
|
1707
1708
|
if (quoted !== void 0) return quoted;
|
|
1708
1709
|
}
|
|
1709
1710
|
const usdValue = Number(targetAmount);
|
|
1710
1711
|
const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
|
|
1711
|
-
const estimate =
|
|
1712
|
+
const estimate = _chunkQGNJFDEOcjs.formatReceiveEstimate.call(void 0, {
|
|
1712
1713
|
sourceAmount: Number.isFinite(Number(amount)) ? Number(amount) : void 0,
|
|
1713
1714
|
sourceSymbol: asset.symbol,
|
|
1714
1715
|
targetSymbol,
|
|
1715
1716
|
sourceAmountUsd,
|
|
1716
|
-
sourceTrusted:
|
|
1717
|
+
sourceTrusted: _chunkQGNJFDEOcjs.isRecognizedToken.call(void 0, asset.token, asset.chainId),
|
|
1717
1718
|
// The target is the curated deposit destination, so a stablecoin target
|
|
1718
1719
|
// estimates at $1 when unquoted (DepositFlow skips fetching stablecoin
|
|
1719
1720
|
// target prices). Not applied to the source — that can be a held token.
|
|
1720
|
-
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } :
|
|
1721
|
+
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : _chunkQGNJFDEOcjs.isDisplayStablecoinSymbol.call(void 0, targetSymbol) ? { [targetSymbol.toUpperCase()]: 1 } : {}
|
|
1721
1722
|
});
|
|
1722
1723
|
if (estimate !== void 0) return estimate;
|
|
1723
1724
|
return targetSymbol;
|
|
1724
1725
|
})();
|
|
1725
|
-
const
|
|
1726
|
+
const servedExpectedSeconds = _nullishCoalesce(_optionalChain([quote, 'optionalAccess', _69 => _69.timing, 'optionalAccess', _70 => _70.expectedSeconds]), () => ( (quote && Number.isFinite(quote.estimatedFillTimeSeconds) ? quote.estimatedFillTimeSeconds : void 0)));
|
|
1727
|
+
const estimatedTimeDisplay = servedExpectedSeconds !== void 0 ? _chunkQGNJFDEOcjs.formatExpectedDuration.call(void 0, servedExpectedSeconds) : estimatedTime;
|
|
1726
1728
|
_react.useEffect.call(void 0, () => {
|
|
1727
1729
|
if (chainMismatch && switchChain && !hasAttemptedSwitch.current) {
|
|
1728
1730
|
hasAttemptedSwitch.current = true;
|
|
1729
1731
|
switchChain(asset.chainId).catch((err) => {
|
|
1730
1732
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
1731
|
-
setError(
|
|
1733
|
+
setError(_chunkQGNJFDEOcjs.formatUserError.call(void 0, raw));
|
|
1732
1734
|
});
|
|
1733
1735
|
}
|
|
1734
1736
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -1915,11 +1917,11 @@ function ConfirmStep({
|
|
|
1915
1917
|
);
|
|
1916
1918
|
} catch (err) {
|
|
1917
1919
|
const raw = err instanceof Error ? err.message : "Signing failed";
|
|
1918
|
-
const safeToTransfer = !submitStarted || err instanceof
|
|
1920
|
+
const safeToTransfer = !submitStarted || err instanceof _chunkQGNJFDEOcjs.PermitDepositSubmitError && err.safeToTransfer;
|
|
1919
1921
|
if (safeToTransfer) setPermitDisabled(true);
|
|
1920
|
-
const message = safeToTransfer ?
|
|
1922
|
+
const message = safeToTransfer ? _chunkQGNJFDEOcjs.formatUserError.call(void 0, raw) : "Deposit submission status is uncertain. Check your activity before trying a transfer.";
|
|
1921
1923
|
setError(message);
|
|
1922
|
-
_optionalChain([onError, 'optionalCall',
|
|
1924
|
+
_optionalChain([onError, 'optionalCall', _71 => _71(message, "PERMIT_ERROR", raw)]);
|
|
1923
1925
|
} finally {
|
|
1924
1926
|
setIsSubmitting(false);
|
|
1925
1927
|
}
|
|
@@ -1938,7 +1940,7 @@ function ConfirmStep({
|
|
|
1938
1940
|
const result = await executeTransfer(amountUnits);
|
|
1939
1941
|
hash = result.txHash;
|
|
1940
1942
|
resolvedSourceToken = result.sourceToken;
|
|
1941
|
-
} else if (
|
|
1943
|
+
} else if (_chunkQGNJFDEOcjs.isNativeAsset.call(void 0, asset)) {
|
|
1942
1944
|
hash = await walletClient.sendTransaction({
|
|
1943
1945
|
account,
|
|
1944
1946
|
chain,
|
|
@@ -1955,7 +1957,7 @@ function ConfirmStep({
|
|
|
1955
1957
|
args: [transferTo, amountUnits]
|
|
1956
1958
|
});
|
|
1957
1959
|
}
|
|
1958
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
1960
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _72 => _72(hash, asset.chainId, amountUnits.toString())]);
|
|
1959
1961
|
onConfirm(
|
|
1960
1962
|
hash,
|
|
1961
1963
|
asset.chainId,
|
|
@@ -1969,18 +1971,18 @@ function ConfirmStep({
|
|
|
1969
1971
|
);
|
|
1970
1972
|
} catch (err) {
|
|
1971
1973
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
1972
|
-
const uncertain =
|
|
1973
|
-
const message = uncertain ? "Deposit submission status is uncertain. Check your activity before trying again." :
|
|
1974
|
+
const uncertain = _chunkQGNJFDEOcjs.isSubmissionUncertain.call(void 0, err);
|
|
1975
|
+
const message = uncertain ? "Deposit submission status is uncertain. Check your activity before trying again." : _chunkQGNJFDEOcjs.formatUserError.call(void 0, raw);
|
|
1974
1976
|
if (uncertain) setSubmissionUncertain(true);
|
|
1975
1977
|
setError(message);
|
|
1976
|
-
_optionalChain([onError, 'optionalCall',
|
|
1978
|
+
_optionalChain([onError, 'optionalCall', _73 => _73(message, "TRANSFER_ERROR", raw)]);
|
|
1977
1979
|
} finally {
|
|
1978
1980
|
setIsSubmitting(false);
|
|
1979
1981
|
}
|
|
1980
1982
|
};
|
|
1981
1983
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
1982
1984
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
1983
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1985
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.WalletIcon, {}), title: "Review deposit" }),
|
|
1984
1986
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1985
1987
|
ReviewDetails,
|
|
1986
1988
|
{
|
|
@@ -1996,9 +1998,9 @@ function ConfirmStep({
|
|
|
1996
1998
|
fee: { display: feeDisplay, struck: feesFullySponsored }
|
|
1997
1999
|
}
|
|
1998
2000
|
),
|
|
1999
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2001
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.Callout, { variant: "error", children: error }),
|
|
2000
2002
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2001
|
-
|
|
2003
|
+
_chunkQGNJFDEOcjs.Button,
|
|
2002
2004
|
{
|
|
2003
2005
|
onClick: handleConfirm,
|
|
2004
2006
|
loading: isSubmitting,
|
|
@@ -2025,7 +2027,7 @@ function ConfirmStep({
|
|
|
2025
2027
|
] }),
|
|
2026
2028
|
!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." })
|
|
2027
2029
|
] }),
|
|
2028
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2030
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.PoweredBy, {})
|
|
2029
2031
|
] });
|
|
2030
2032
|
}
|
|
2031
2033
|
|
|
@@ -2078,29 +2080,30 @@ function QrReviewStep({
|
|
|
2078
2080
|
cancelled = true;
|
|
2079
2081
|
};
|
|
2080
2082
|
}, [service, smartAccount, asset, amount]);
|
|
2081
|
-
const formattedSendAmount = _nullishCoalesce(
|
|
2083
|
+
const formattedSendAmount = _nullishCoalesce(_chunkQGNJFDEOcjs.formatTokenAmount.call(void 0, Number(amount), asset.symbol), () => ( amount));
|
|
2082
2084
|
const receiveDisplay = (() => {
|
|
2083
2085
|
if (quote.value) {
|
|
2084
|
-
const quoted =
|
|
2086
|
+
const quoted = _chunkQGNJFDEOcjs.formatQuotedReceive.call(void 0, quote.value.output, targetSymbol);
|
|
2085
2087
|
if (quoted !== void 0) return quoted;
|
|
2086
2088
|
}
|
|
2087
2089
|
const usdValue = Number(targetAmount);
|
|
2088
|
-
const estimate =
|
|
2090
|
+
const estimate = _chunkQGNJFDEOcjs.formatReceiveEstimate.call(void 0, {
|
|
2089
2091
|
sourceAmount: Number.isFinite(Number(amount)) ? Number(amount) : void 0,
|
|
2090
2092
|
sourceSymbol: asset.symbol,
|
|
2091
2093
|
targetSymbol,
|
|
2092
2094
|
sourceAmountUsd: Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0,
|
|
2093
|
-
sourceTrusted:
|
|
2094
|
-
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } :
|
|
2095
|
+
sourceTrusted: _chunkQGNJFDEOcjs.isRecognizedToken.call(void 0, asset.token, asset.chainId),
|
|
2096
|
+
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : _chunkQGNJFDEOcjs.isDisplayStablecoinSymbol.call(void 0, targetSymbol) ? { [targetSymbol.toUpperCase()]: 1 } : {}
|
|
2095
2097
|
});
|
|
2096
2098
|
return _nullishCoalesce(estimate, () => ( targetSymbol));
|
|
2097
2099
|
})();
|
|
2098
|
-
const
|
|
2099
|
-
const
|
|
2100
|
+
const expectedSeconds = _nullishCoalesce(_optionalChain([quote, 'access', _74 => _74.value, 'optionalAccess', _75 => _75.timing, 'optionalAccess', _76 => _76.expectedSeconds]), () => ( (quote.value && Number.isFinite(quote.value.estimatedFillTimeSeconds) ? quote.value.estimatedFillTimeSeconds : void 0)));
|
|
2101
|
+
const estimatedTime = expectedSeconds !== void 0 ? _chunkQGNJFDEOcjs.formatExpectedDuration.call(void 0, expectedSeconds) : quote.state === "loading" ? "\u2026" : "\u2014";
|
|
2102
|
+
const { display: quotedFee, struck } = _chunkQGNJFDEOcjs.quoteFeeRow.call(void 0, _optionalChain([quote, 'access', _77 => _77.value, 'optionalAccess', _78 => _78.fees]));
|
|
2100
2103
|
const feeDisplay = quote.state === "unavailable" ? "\u2014" : quotedFee;
|
|
2101
2104
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
2102
2105
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2103
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2106
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.TransferCryptoIcon, {}), title: "Fee estimate" }),
|
|
2104
2107
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2105
2108
|
ReviewDetails,
|
|
2106
2109
|
{
|
|
@@ -2116,9 +2119,9 @@ function QrReviewStep({
|
|
|
2116
2119
|
fee: { display: feeDisplay, struck }
|
|
2117
2120
|
}
|
|
2118
2121
|
),
|
|
2119
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2122
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.Button, { onClick: onClose, fullWidth: true, children: "Close" })
|
|
2120
2123
|
] }),
|
|
2121
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2124
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.PoweredBy, {})
|
|
2122
2125
|
] });
|
|
2123
2126
|
}
|
|
2124
2127
|
QrReviewStep.displayName = "QrReviewStep";
|
|
@@ -2149,20 +2152,20 @@ function DepositAddressSkeleton({
|
|
|
2149
2152
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", "aria-busy": "true", children: [
|
|
2150
2153
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: "Preparing deposit details\u2026" }),
|
|
2151
2154
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
2152
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2155
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
2153
2156
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", "aria-hidden": "true", children: [
|
|
2154
2157
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
2155
2158
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
2156
2159
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown-trigger", children: [
|
|
2157
2160
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2158
|
-
|
|
2161
|
+
_chunkQGNJFDEOcjs.CdnIcon,
|
|
2159
2162
|
{
|
|
2160
2163
|
src: chainIcon,
|
|
2161
2164
|
className: "rs-deposit-address-dropdown-icon"
|
|
2162
2165
|
}
|
|
2163
2166
|
),
|
|
2164
2167
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainName }),
|
|
2165
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2168
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2166
2169
|
] })
|
|
2167
2170
|
] }),
|
|
2168
2171
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
@@ -2170,9 +2173,9 @@ function DepositAddressSkeleton({
|
|
|
2170
2173
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Supported token" }),
|
|
2171
2174
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
2172
2175
|
"Min.$",
|
|
2173
|
-
(_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
2174
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2175
|
-
|
|
2176
|
+
(_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _79 => _79.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
2177
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2178
|
+
_chunkQGNJFDEOcjs.InfoIcon,
|
|
2176
2179
|
{
|
|
2177
2180
|
className: "rs-deposit-address-min-icon",
|
|
2178
2181
|
"aria-hidden": "true"
|
|
@@ -2182,14 +2185,14 @@ function DepositAddressSkeleton({
|
|
|
2182
2185
|
] }),
|
|
2183
2186
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown-trigger", children: [
|
|
2184
2187
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2185
|
-
|
|
2188
|
+
_chunkQGNJFDEOcjs.TokenIcon,
|
|
2186
2189
|
{
|
|
2187
2190
|
symbol: defaultToken,
|
|
2188
2191
|
className: "rs-deposit-address-dropdown-icon"
|
|
2189
2192
|
}
|
|
2190
2193
|
),
|
|
2191
2194
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: defaultToken }),
|
|
2192
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2195
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2193
2196
|
] })
|
|
2194
2197
|
] })
|
|
2195
2198
|
] }),
|
|
@@ -2204,7 +2207,7 @@ function DepositAddressSkeleton({
|
|
|
2204
2207
|
] }),
|
|
2205
2208
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-actions", "aria-hidden": "true", children: [
|
|
2206
2209
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "button", { type: "button", className: "rs-deposit-address-copy", disabled: true, children: [
|
|
2207
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2210
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.CopyIcon, {}),
|
|
2208
2211
|
"Copy address"
|
|
2209
2212
|
] }),
|
|
2210
2213
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2221,7 +2224,7 @@ function DepositAddressSkeleton({
|
|
|
2221
2224
|
}
|
|
2222
2225
|
)
|
|
2223
2226
|
] }),
|
|
2224
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2227
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.PoweredBy, {})
|
|
2225
2228
|
] });
|
|
2226
2229
|
}
|
|
2227
2230
|
DepositAddressSkeleton.displayName = "DepositAddressSkeleton";
|
|
@@ -2233,9 +2236,9 @@ var INITIAL_POLL_INTERVAL = 3e3;
|
|
|
2233
2236
|
var MAX_POLL_INTERVAL = 3e4;
|
|
2234
2237
|
var BACKOFF_MULTIPLIER = 1.5;
|
|
2235
2238
|
function isEventForTx(event, txHash) {
|
|
2236
|
-
const eventTxHash =
|
|
2239
|
+
const eventTxHash = _chunkQGNJFDEOcjs.getEventTxHash.call(void 0, event);
|
|
2237
2240
|
if (!eventTxHash) return false;
|
|
2238
|
-
return
|
|
2241
|
+
return _chunkQGNJFDEOcjs.txRefsMatch.call(void 0, eventTxHash, txHash);
|
|
2239
2242
|
}
|
|
2240
2243
|
function truncateHash(hash) {
|
|
2241
2244
|
return `${hash.slice(0, 4)}\u2026${hash.slice(-4)}`;
|
|
@@ -2265,7 +2268,7 @@ function formatTimestamp(ms) {
|
|
|
2265
2268
|
return `${month} ${day}${suffix} \xB7 ${hours}:${minutes}:${seconds}`;
|
|
2266
2269
|
}
|
|
2267
2270
|
function formatBridgeFailedMessage(event) {
|
|
2268
|
-
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess',
|
|
2271
|
+
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _80 => _80.data]), () => ( {}));
|
|
2269
2272
|
const backendMessage = typeof eventData.message === "string" ? eventData.message.trim() : "";
|
|
2270
2273
|
if (backendMessage.length > 0) {
|
|
2271
2274
|
const lower = backendMessage.toLowerCase();
|
|
@@ -2285,7 +2288,7 @@ function formatBridgeFailedMessage(event) {
|
|
|
2285
2288
|
}
|
|
2286
2289
|
return "Bridge failed";
|
|
2287
2290
|
}
|
|
2288
|
-
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2291
|
+
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.ExternalLinkIcon, { className: "rs-deposit-notification-link-icon" });
|
|
2289
2292
|
function DepositNotification({
|
|
2290
2293
|
deposit,
|
|
2291
2294
|
smartAccount,
|
|
@@ -2319,7 +2322,7 @@ function DepositNotification({
|
|
|
2319
2322
|
const pollIntervalRef = _react.useRef.call(void 0, INITIAL_POLL_INTERVAL);
|
|
2320
2323
|
const pollTimeoutRef = _react.useRef.call(void 0, null);
|
|
2321
2324
|
const completedRef = _react.useRef.call(void 0, false);
|
|
2322
|
-
const depositContextRef =
|
|
2325
|
+
const depositContextRef = _chunkQGNJFDEOcjs.useLatestRef.call(void 0, {
|
|
2323
2326
|
amount,
|
|
2324
2327
|
sourceChain,
|
|
2325
2328
|
sourceToken: token,
|
|
@@ -2327,8 +2330,8 @@ function DepositNotification({
|
|
|
2327
2330
|
targetChain,
|
|
2328
2331
|
targetToken
|
|
2329
2332
|
});
|
|
2330
|
-
const onCompleteRef =
|
|
2331
|
-
const onFailedRef =
|
|
2333
|
+
const onCompleteRef = _chunkQGNJFDEOcjs.useLatestRef.call(void 0, onComplete);
|
|
2334
|
+
const onFailedRef = _chunkQGNJFDEOcjs.useLatestRef.call(void 0, onFailed);
|
|
2332
2335
|
const handleComplete = _react.useCallback.call(void 0,
|
|
2333
2336
|
(destTxHash) => {
|
|
2334
2337
|
if (completedRef.current) return;
|
|
@@ -2337,7 +2340,7 @@ function DepositNotification({
|
|
|
2337
2340
|
setCompletedAt(Date.now());
|
|
2338
2341
|
setStatus("complete");
|
|
2339
2342
|
const context = depositContextRef.current;
|
|
2340
|
-
_optionalChain([onCompleteRef, 'access',
|
|
2343
|
+
_optionalChain([onCompleteRef, 'access', _81 => _81.current, 'optionalCall', _82 => _82(txHash, destTxHash, {
|
|
2341
2344
|
amount: context.amount,
|
|
2342
2345
|
sourceChain: context.sourceChain,
|
|
2343
2346
|
sourceToken: context.sourceToken,
|
|
@@ -2353,7 +2356,7 @@ function DepositNotification({
|
|
|
2353
2356
|
if (completedRef.current) return;
|
|
2354
2357
|
completedRef.current = true;
|
|
2355
2358
|
setStatus("failed");
|
|
2356
|
-
_optionalChain([onFailedRef, 'access',
|
|
2359
|
+
_optionalChain([onFailedRef, 'access', _83 => _83.current, 'optionalCall', _84 => _84(txHash, error)]);
|
|
2357
2360
|
},
|
|
2358
2361
|
[onFailedRef, txHash]
|
|
2359
2362
|
);
|
|
@@ -2371,17 +2374,17 @@ function DepositNotification({
|
|
|
2371
2374
|
if (!isMounted) return;
|
|
2372
2375
|
const lastEvent = data.lastEvent;
|
|
2373
2376
|
const eventForTx = isEventForTx(lastEvent, txHash) ? lastEvent : void 0;
|
|
2374
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
2375
|
-
const destTx = _optionalChain([eventForTx, 'access',
|
|
2377
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _85 => _85.type]) === "bridge-complete") {
|
|
2378
|
+
const destTx = _optionalChain([eventForTx, 'access', _86 => _86.data, 'optionalAccess', _87 => _87.destination, 'optionalAccess', _88 => _88.transactionHash]);
|
|
2376
2379
|
handleComplete(destTx);
|
|
2377
2380
|
return;
|
|
2378
2381
|
}
|
|
2379
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
2382
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _89 => _89.type]) === "bridge-failed") {
|
|
2380
2383
|
handleFailed(formatBridgeFailedMessage(eventForTx));
|
|
2381
2384
|
return;
|
|
2382
2385
|
}
|
|
2383
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
2384
|
-
const errorMessage = _nullishCoalesce(_optionalChain([eventForTx, 'access',
|
|
2386
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _90 => _90.type]) === "error") {
|
|
2387
|
+
const errorMessage = _nullishCoalesce(_optionalChain([eventForTx, 'access', _91 => _91.data, 'optionalAccess', _92 => _92.message]), () => ( "Unknown error"));
|
|
2385
2388
|
handleFailed(errorMessage);
|
|
2386
2389
|
return;
|
|
2387
2390
|
}
|
|
@@ -2419,12 +2422,12 @@ function DepositNotification({
|
|
|
2419
2422
|
status,
|
|
2420
2423
|
txHash
|
|
2421
2424
|
]);
|
|
2422
|
-
const explorerTxUrl =
|
|
2425
|
+
const explorerTxUrl = _chunkQGNJFDEOcjs.useExplorerTxUrl.call(void 0, );
|
|
2423
2426
|
const sourceExplorerUrl = sourceChain === "unknown" ? void 0 : explorerTxUrl(sourceChain, txHash);
|
|
2424
2427
|
const destExplorerUrl = destinationTxHash ? explorerTxUrl(_chunkOY5N3E6Lcjs.targetChainToChainId.call(void 0, targetChain), destinationTxHash) : null;
|
|
2425
2428
|
const title = status === "complete" ? "Deposit completed" : status === "failed" ? "Deposit failed" : "Deposit received and processing\u2026";
|
|
2426
2429
|
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.";
|
|
2427
|
-
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,
|
|
2430
|
+
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, _chunkQGNJFDEOcjs.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, _chunkQGNJFDEOcjs.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,
|
|
2428
2431
|
"svg",
|
|
2429
2432
|
{
|
|
2430
2433
|
className: "rs-deposit-notification-spinner",
|
|
@@ -2474,7 +2477,7 @@ function DepositNotification({
|
|
|
2474
2477
|
className: "rs-deposit-notification-close",
|
|
2475
2478
|
onClick: () => onDismiss(deposit.id),
|
|
2476
2479
|
"aria-label": "Dismiss",
|
|
2477
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2480
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.CloseIcon, {})
|
|
2478
2481
|
}
|
|
2479
2482
|
)
|
|
2480
2483
|
] }),
|
|
@@ -2490,7 +2493,7 @@ function DepositNotification({
|
|
|
2490
2493
|
"aria-expanded": expanded,
|
|
2491
2494
|
children: [
|
|
2492
2495
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: expanded ? "See less details" : "See more details" }),
|
|
2493
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2496
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.ChevronDownIcon, { className: "rs-deposit-notification-toggle-chevron" })
|
|
2494
2497
|
]
|
|
2495
2498
|
}
|
|
2496
2499
|
),
|
|
@@ -2550,12 +2553,12 @@ function sourceChainToCaip2(chain) {
|
|
|
2550
2553
|
return _chunkOY5N3E6Lcjs.toEvmCaip2.call(void 0, chain);
|
|
2551
2554
|
}
|
|
2552
2555
|
function findAddress(tokens, symbol) {
|
|
2553
|
-
return _optionalChain([tokens, 'optionalAccess',
|
|
2556
|
+
return _optionalChain([tokens, 'optionalAccess', _93 => _93.find, 'call', _94 => _94((t) => t.symbol.toLowerCase() === symbol.toLowerCase()), 'optionalAccess', _95 => _95.address]);
|
|
2554
2557
|
}
|
|
2555
2558
|
function resolveSourceTokenIdentity(input) {
|
|
2556
2559
|
const { chain, symbol, shortlist, catalogTokens } = input;
|
|
2557
2560
|
if (!symbol) return void 0;
|
|
2558
|
-
const shortlistTokens = _optionalChain([shortlist, 'optionalAccess',
|
|
2561
|
+
const shortlistTokens = _optionalChain([shortlist, 'optionalAccess', _96 => _96[String(chain)]]);
|
|
2559
2562
|
const raw = shortlistTokens !== void 0 ? findAddress(shortlistTokens, symbol) : chain === "hypercore" || !Array.isArray(catalogTokens) ? void 0 : findAddress(catalogTokens, symbol);
|
|
2560
2563
|
if (!raw) return void 0;
|
|
2561
2564
|
if (chain === "solana") {
|
|
@@ -2616,7 +2619,7 @@ function resolveSolanaTokenMeta(token) {
|
|
|
2616
2619
|
return {};
|
|
2617
2620
|
}
|
|
2618
2621
|
function getDepositEventDetails(event) {
|
|
2619
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
2622
|
+
if (!_optionalChain([event, 'optionalAccess', _97 => _97.type]) || !isRecord(event.data)) return {};
|
|
2620
2623
|
if (event.type === "deposit-received") {
|
|
2621
2624
|
const chainId = asChainId(event.data.chain);
|
|
2622
2625
|
const token = asString(event.data.token);
|
|
@@ -2631,12 +2634,12 @@ function getDepositEventDetails(event) {
|
|
|
2631
2634
|
const source = isRecord(event.data.source) ? event.data.source : void 0;
|
|
2632
2635
|
const deposit = isRecord(event.data.deposit) ? event.data.deposit : void 0;
|
|
2633
2636
|
if (source || deposit) {
|
|
2634
|
-
const chainId = _nullishCoalesce(asChainId(_optionalChain([source, 'optionalAccess',
|
|
2635
|
-
const token = _nullishCoalesce(_nullishCoalesce(asString(_optionalChain([source, 'optionalAccess',
|
|
2637
|
+
const chainId = _nullishCoalesce(asChainId(_optionalChain([source, 'optionalAccess', _98 => _98.chain])), () => ( asChainId(_optionalChain([deposit, 'optionalAccess', _99 => _99.chain]))));
|
|
2638
|
+
const token = _nullishCoalesce(_nullishCoalesce(asString(_optionalChain([source, 'optionalAccess', _100 => _100.asset])), () => ( asString(_optionalChain([deposit, 'optionalAccess', _101 => _101.asset])))), () => ( asString(_optionalChain([deposit, 'optionalAccess', _102 => _102.token]))));
|
|
2636
2639
|
const solanaMeta = chainId === "solana" ? resolveSolanaTokenMeta(token) : {};
|
|
2637
2640
|
return {
|
|
2638
2641
|
chainId,
|
|
2639
|
-
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess',
|
|
2642
|
+
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess', _103 => _103.amount])), () => ( asAmount(_optionalChain([deposit, 'optionalAccess', _104 => _104.amount])))),
|
|
2640
2643
|
token,
|
|
2641
2644
|
...solanaMeta
|
|
2642
2645
|
};
|
|
@@ -2647,22 +2650,22 @@ function isSameRoute(sourceChain, sourceToken, targetChain, targetToken) {
|
|
|
2647
2650
|
return sourceChain === targetChain && sourceToken.toLowerCase() === targetToken.toLowerCase();
|
|
2648
2651
|
}
|
|
2649
2652
|
function chainLabel(chainId, catalogChain) {
|
|
2650
|
-
const name = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess',
|
|
2653
|
+
const name = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _105 => _105.name]), () => ( _chunkOY5N3E6Lcjs.getChainName.call(void 0, chainId)));
|
|
2651
2654
|
return name.replace(/\s+(One|Mainnet|Smart Chain|Chain)$/i, "");
|
|
2652
2655
|
}
|
|
2653
2656
|
function computeTokensForChain(chainId, topTokens, catalogChain) {
|
|
2654
|
-
const fromBackend = _optionalChain([topTokens, 'optionalAccess',
|
|
2657
|
+
const fromBackend = _optionalChain([topTokens, 'optionalAccess', _106 => _106[String(chainId)], 'optionalAccess', _107 => _107.map, 'call', _108 => _108((t) => t.symbol)]);
|
|
2655
2658
|
if (fromBackend) return fromBackend;
|
|
2656
|
-
return Array.isArray(_optionalChain([catalogChain, 'optionalAccess',
|
|
2659
|
+
return Array.isArray(_optionalChain([catalogChain, 'optionalAccess', _109 => _109.supportedTokens])) ? catalogChain.supportedTokens.map((t) => t.symbol) : [];
|
|
2657
2660
|
}
|
|
2658
2661
|
function selectionAsAsset(chainId, symbol, topTokens, catalogChain) {
|
|
2659
2662
|
if (typeof chainId !== "number" || !symbol) return void 0;
|
|
2660
|
-
const fromShortlist = _optionalChain([topTokens, 'optionalAccess',
|
|
2663
|
+
const fromShortlist = _optionalChain([topTokens, 'optionalAccess', _110 => _110[String(chainId)], 'optionalAccess', _111 => _111.find, 'call', _112 => _112(
|
|
2661
2664
|
(t) => t.symbol === symbol
|
|
2662
2665
|
)]);
|
|
2663
|
-
const fromCatalog = Array.isArray(_optionalChain([catalogChain, 'optionalAccess',
|
|
2664
|
-
const address = _nullishCoalesce(_optionalChain([fromShortlist, 'optionalAccess',
|
|
2665
|
-
const decimals = _nullishCoalesce(_optionalChain([fromShortlist, 'optionalAccess',
|
|
2666
|
+
const fromCatalog = Array.isArray(_optionalChain([catalogChain, 'optionalAccess', _113 => _113.supportedTokens])) ? catalogChain.supportedTokens.find((t) => t.symbol === symbol) : void 0;
|
|
2667
|
+
const address = _nullishCoalesce(_optionalChain([fromShortlist, 'optionalAccess', _114 => _114.address]), () => ( _optionalChain([fromCatalog, 'optionalAccess', _115 => _115.address])));
|
|
2668
|
+
const decimals = _nullishCoalesce(_optionalChain([fromShortlist, 'optionalAccess', _116 => _116.decimals]), () => ( _optionalChain([fromCatalog, 'optionalAccess', _117 => _117.decimals])));
|
|
2666
2669
|
if (!address || decimals === void 0) return void 0;
|
|
2667
2670
|
return {
|
|
2668
2671
|
id: `qr-${chainId}-${symbol}`,
|
|
@@ -2675,7 +2678,7 @@ function selectionAsAsset(chainId, symbol, topTokens, catalogChain) {
|
|
|
2675
2678
|
}
|
|
2676
2679
|
function TokenGlyph({ symbol }) {
|
|
2677
2680
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2678
|
-
|
|
2681
|
+
_chunkQGNJFDEOcjs.TokenIcon,
|
|
2679
2682
|
{
|
|
2680
2683
|
symbol,
|
|
2681
2684
|
className: "rs-deposit-address-dropdown-icon",
|
|
@@ -2722,31 +2725,31 @@ function DepositAddressStep({
|
|
|
2722
2725
|
};
|
|
2723
2726
|
}, [service]);
|
|
2724
2727
|
const BASE_CHAIN_ID2 = 8453;
|
|
2725
|
-
const evmChainIds =
|
|
2726
|
-
const { catalog, isLoading: catalogLoading } =
|
|
2728
|
+
const evmChainIds = _chunkQGNJFDEOcjs.useDepositChainIds.call(void 0, );
|
|
2729
|
+
const { catalog, isLoading: catalogLoading } = _chunkQGNJFDEOcjs.useChainCatalog.call(void 0, );
|
|
2727
2730
|
const catalogFor = _react.useCallback.call(void 0,
|
|
2728
2731
|
(chain) => {
|
|
2729
2732
|
if (!catalog) return void 0;
|
|
2730
|
-
const key =
|
|
2733
|
+
const key = _chunkQGNJFDEOcjs.catalogKeyForChain.call(void 0, chain);
|
|
2731
2734
|
return typeof key === "number" ? catalog.byChainId.get(key) : catalog.byCaip2.get(key);
|
|
2732
2735
|
},
|
|
2733
2736
|
[catalog]
|
|
2734
2737
|
);
|
|
2735
2738
|
const chainOptions = _react.useMemo.call(void 0, () => {
|
|
2736
|
-
const acceptsDeposits = (chain) => _optionalChain([catalogFor, 'call',
|
|
2739
|
+
const acceptsDeposits = (chain) => _optionalChain([catalogFor, 'call', _118 => _118(chain), 'optionalAccess', _119 => _119.deposit]) !== false;
|
|
2737
2740
|
const options = [...evmChainIds];
|
|
2738
2741
|
const extras = [];
|
|
2739
2742
|
if (hasSolana && acceptsDeposits("solana")) extras.push("solana");
|
|
2740
2743
|
if (acceptsDeposits("hypercore")) extras.push("hypercore");
|
|
2741
2744
|
options.splice(1, 0, ...extras);
|
|
2742
2745
|
return options.filter(
|
|
2743
|
-
(chain) => _optionalChain([topTokens, 'optionalAccess',
|
|
2746
|
+
(chain) => _optionalChain([topTokens, 'optionalAccess', _120 => _120[String(chain)], 'optionalAccess', _121 => _121.length]) !== 0 && computeTokensForChain(chain, topTokens, catalogFor(chain)).length > 0
|
|
2744
2747
|
);
|
|
2745
2748
|
}, [evmChainIds, hasSolana, topTokens, catalogFor]);
|
|
2746
2749
|
const preferredChainId = (options) => options.includes(BASE_CHAIN_ID2) ? BASE_CHAIN_ID2 : _nullishCoalesce(options[0], () => ( BASE_CHAIN_ID2));
|
|
2747
|
-
const [sourceChainId, setSourceChainId] = _react.useState.call(void 0, () => _nullishCoalesce(_optionalChain([initialSource, 'optionalAccess',
|
|
2750
|
+
const [sourceChainId, setSourceChainId] = _react.useState.call(void 0, () => _nullishCoalesce(_optionalChain([initialSource, 'optionalAccess', _122 => _122.chainId]), () => ( preferredChainId(chainOptions))));
|
|
2748
2751
|
const chainChosenByUser = _react.useRef.call(void 0, initialSource !== void 0);
|
|
2749
|
-
const pendingChainRef = _react.useRef.call(void 0, _optionalChain([initialSource, 'optionalAccess',
|
|
2752
|
+
const pendingChainRef = _react.useRef.call(void 0, _optionalChain([initialSource, 'optionalAccess', _123 => _123.chainId]));
|
|
2750
2753
|
_react.useEffect.call(void 0, () => {
|
|
2751
2754
|
if (chainOptions.length === 0) return;
|
|
2752
2755
|
const pendingChain2 = pendingChainRef.current;
|
|
@@ -2770,10 +2773,10 @@ function DepositAddressStep({
|
|
|
2770
2773
|
);
|
|
2771
2774
|
const defaultToken = pickFallbackToken(
|
|
2772
2775
|
tokensForChain,
|
|
2773
|
-
_nullishCoalesce(_optionalChain([initialSource, 'optionalAccess',
|
|
2776
|
+
_nullishCoalesce(_optionalChain([initialSource, 'optionalAccess', _124 => _124.symbol]), () => ( "USDC"))
|
|
2774
2777
|
);
|
|
2775
2778
|
const [sourceTokenSymbol, setSourceTokenSymbol] = _react.useState.call(void 0, defaultToken);
|
|
2776
|
-
const pendingTokenRef = _react.useRef.call(void 0, _optionalChain([initialSource, 'optionalAccess',
|
|
2779
|
+
const pendingTokenRef = _react.useRef.call(void 0, _optionalChain([initialSource, 'optionalAccess', _125 => _125.symbol]));
|
|
2777
2780
|
_react.useEffect.call(void 0, () => {
|
|
2778
2781
|
if (tokensForChain.includes(sourceTokenSymbol)) {
|
|
2779
2782
|
pendingTokenRef.current = void 0;
|
|
@@ -2805,7 +2808,7 @@ function DepositAddressStep({
|
|
|
2805
2808
|
chain: sourceChainId,
|
|
2806
2809
|
symbol: sourceTokenSymbol,
|
|
2807
2810
|
shortlist: topTokens,
|
|
2808
|
-
catalogTokens: _optionalChain([catalogFor, 'call',
|
|
2811
|
+
catalogTokens: _optionalChain([catalogFor, 'call', _126 => _126(sourceChainId), 'optionalAccess', _127 => _127.supportedTokens])
|
|
2809
2812
|
}),
|
|
2810
2813
|
[sourceChainId, sourceTokenSymbol, topTokens, catalogFor]
|
|
2811
2814
|
);
|
|
@@ -2814,7 +2817,7 @@ function DepositAddressStep({
|
|
|
2814
2817
|
_react.useEffect.call(void 0, () => {
|
|
2815
2818
|
if (!sourceTokenIdentity) return;
|
|
2816
2819
|
if (!sourceSelectionSettled) return;
|
|
2817
|
-
_optionalChain([onAddressShown, 'optionalCall',
|
|
2820
|
+
_optionalChain([onAddressShown, 'optionalCall', _128 => _128({
|
|
2818
2821
|
address: displayAddress,
|
|
2819
2822
|
sourceChainCaip2: sourceChainToCaip2(sourceChainId),
|
|
2820
2823
|
sourceTokenIdentity
|
|
@@ -2831,8 +2834,8 @@ function DepositAddressStep({
|
|
|
2831
2834
|
function handlePointerDown(event) {
|
|
2832
2835
|
const target = event.target;
|
|
2833
2836
|
if (!target) return;
|
|
2834
|
-
const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access',
|
|
2835
|
-
const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access',
|
|
2837
|
+
const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access', _129 => _129.current, 'optionalAccess', _130 => _130.contains, 'call', _131 => _131(target)]);
|
|
2838
|
+
const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access', _132 => _132.current, 'optionalAccess', _133 => _133.contains, 'call', _134 => _134(target)]);
|
|
2836
2839
|
if (clickedChainDropdown || clickedTokenDropdown) return;
|
|
2837
2840
|
setChainDropdownOpen(false);
|
|
2838
2841
|
setTokenDropdownOpen(false);
|
|
@@ -2848,7 +2851,7 @@ function DepositAddressStep({
|
|
|
2848
2851
|
try {
|
|
2849
2852
|
await navigator.clipboard.writeText(displayAddress);
|
|
2850
2853
|
setCopied(true);
|
|
2851
|
-
_optionalChain([onCopyAddress, 'optionalCall',
|
|
2854
|
+
_optionalChain([onCopyAddress, 'optionalCall', _135 => _135(true)]);
|
|
2852
2855
|
setTimeout(() => setCopied(false), 2e3);
|
|
2853
2856
|
} catch (e17) {
|
|
2854
2857
|
const textarea = document.createElement("textarea");
|
|
@@ -2863,7 +2866,7 @@ function DepositAddressStep({
|
|
|
2863
2866
|
setCopied(true);
|
|
2864
2867
|
setTimeout(() => setCopied(false), 2e3);
|
|
2865
2868
|
}
|
|
2866
|
-
_optionalChain([onCopyAddress, 'optionalCall',
|
|
2869
|
+
_optionalChain([onCopyAddress, 'optionalCall', _136 => _136(copiedWithFallback)]);
|
|
2867
2870
|
}
|
|
2868
2871
|
}, [displayAddress, onCopyAddress]);
|
|
2869
2872
|
const handleSelectChain = _react.useCallback.call(void 0,
|
|
@@ -2932,10 +2935,10 @@ function DepositAddressStep({
|
|
|
2932
2935
|
return;
|
|
2933
2936
|
}
|
|
2934
2937
|
const event = status.lastEvent;
|
|
2935
|
-
const eventTxHash =
|
|
2938
|
+
const eventTxHash = _chunkQGNJFDEOcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkQGNJFDEOcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
2936
2939
|
if (baselineTxHashRef.current === void 0) {
|
|
2937
2940
|
baselineTxHashRef.current = eventTxHash;
|
|
2938
|
-
} else if (eventTxHash && (!baselineTxHashRef.current || !
|
|
2941
|
+
} else if (eventTxHash && (!baselineTxHashRef.current || !_chunkQGNJFDEOcjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
|
|
2939
2942
|
const details = getDepositEventDetails(event);
|
|
2940
2943
|
const chainId = _nullishCoalesce(details.chainId, () => ( "unknown"));
|
|
2941
2944
|
const amount = _nullishCoalesce(details.amount, () => ( "0"));
|
|
@@ -2967,7 +2970,7 @@ function DepositAddressStep({
|
|
|
2967
2970
|
directTransfer
|
|
2968
2971
|
};
|
|
2969
2972
|
setNotifications((prev) => [notification, ...prev]);
|
|
2970
|
-
_optionalChain([onDepositSubmittedRef, 'access',
|
|
2973
|
+
_optionalChain([onDepositSubmittedRef, 'access', _137 => _137.current, 'optionalCall', _138 => _138({
|
|
2971
2974
|
txHash: eventTxHash,
|
|
2972
2975
|
sourceChain: chainId,
|
|
2973
2976
|
amount,
|
|
@@ -2979,7 +2982,7 @@ function DepositAddressStep({
|
|
|
2979
2982
|
if (!cancelled) {
|
|
2980
2983
|
const msg = err instanceof Error ? err.message : "Failed to check status";
|
|
2981
2984
|
setPollingError(msg);
|
|
2982
|
-
_optionalChain([onErrorRef, 'access',
|
|
2985
|
+
_optionalChain([onErrorRef, 'access', _139 => _139.current, 'optionalCall', _140 => _140(msg, "STATUS_POLL_ERROR")]);
|
|
2983
2986
|
}
|
|
2984
2987
|
}
|
|
2985
2988
|
if (!cancelled) {
|
|
@@ -2995,21 +2998,21 @@ function DepositAddressStep({
|
|
|
2995
2998
|
const handleNotificationComplete = _react.useCallback.call(void 0,
|
|
2996
2999
|
(txHash, destinationTxHash, context) => {
|
|
2997
3000
|
isTrackingRef.current = false;
|
|
2998
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
3001
|
+
_optionalChain([onDepositCompleteRef, 'access', _141 => _141.current, 'optionalCall', _142 => _142(txHash, destinationTxHash, context)]);
|
|
2999
3002
|
},
|
|
3000
3003
|
[]
|
|
3001
3004
|
);
|
|
3002
3005
|
const handleNotificationFailed = _react.useCallback.call(void 0,
|
|
3003
3006
|
(txHash, error) => {
|
|
3004
3007
|
isTrackingRef.current = false;
|
|
3005
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
3008
|
+
_optionalChain([onDepositFailedRef, 'access', _143 => _143.current, 'optionalCall', _144 => _144(txHash, error)]);
|
|
3006
3009
|
},
|
|
3007
3010
|
[]
|
|
3008
3011
|
);
|
|
3009
3012
|
const handleNotificationDismiss = _react.useCallback.call(void 0, (id) => {
|
|
3010
3013
|
setNotifications((prev) => prev.filter((n) => n.id !== id));
|
|
3011
3014
|
}, []);
|
|
3012
|
-
const qrIconSrc = _nullishCoalesce(_optionalChain([catalogFor, 'call',
|
|
3015
|
+
const qrIconSrc = _nullishCoalesce(_optionalChain([catalogFor, 'call', _145 => _145(sourceChainId), 'optionalAccess', _146 => _146.iconUrl]), () => ( _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, sourceChainId)));
|
|
3013
3016
|
const reviewAsset = selectionAsAsset(
|
|
3014
3017
|
sourceChainId,
|
|
3015
3018
|
sourceTokenSymbol,
|
|
@@ -3019,13 +3022,13 @@ function DepositAddressStep({
|
|
|
3019
3022
|
if (chainOptions.length === 0) {
|
|
3020
3023
|
if (catalogLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositAddressSkeleton, { uiConfig });
|
|
3021
3024
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-screen", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
3022
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3023
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3025
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
3026
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.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." })
|
|
3024
3027
|
] }) });
|
|
3025
3028
|
}
|
|
3026
3029
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-step--with-notifications", children: [
|
|
3027
3030
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
3028
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3031
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
3029
3032
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", children: [
|
|
3030
3033
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", ref: chainDropdownRef, children: [
|
|
3031
3034
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
@@ -3041,14 +3044,14 @@ function DepositAddressStep({
|
|
|
3041
3044
|
},
|
|
3042
3045
|
children: [
|
|
3043
3046
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3044
|
-
|
|
3047
|
+
_chunkQGNJFDEOcjs.CdnIcon,
|
|
3045
3048
|
{
|
|
3046
|
-
src: _nullishCoalesce(_optionalChain([catalogFor, 'call',
|
|
3049
|
+
src: _nullishCoalesce(_optionalChain([catalogFor, 'call', _147 => _147(sourceChainId), 'optionalAccess', _148 => _148.iconUrl]), () => ( _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, sourceChainId))),
|
|
3047
3050
|
className: "rs-deposit-address-dropdown-icon"
|
|
3048
3051
|
}
|
|
3049
3052
|
),
|
|
3050
3053
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainLabel(sourceChainId, catalogFor(sourceChainId)) }),
|
|
3051
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3054
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
3052
3055
|
]
|
|
3053
3056
|
}
|
|
3054
3057
|
),
|
|
@@ -3060,9 +3063,9 @@ function DepositAddressStep({
|
|
|
3060
3063
|
onClick: () => handleSelectChain(chainId),
|
|
3061
3064
|
children: [
|
|
3062
3065
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3063
|
-
|
|
3066
|
+
_chunkQGNJFDEOcjs.CdnIcon,
|
|
3064
3067
|
{
|
|
3065
|
-
src: _nullishCoalesce(_optionalChain([catalogFor, 'call',
|
|
3068
|
+
src: _nullishCoalesce(_optionalChain([catalogFor, 'call', _149 => _149(chainId), 'optionalAccess', _150 => _150.iconUrl]), () => ( _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, chainId))),
|
|
3066
3069
|
className: "rs-deposit-address-dropdown-icon"
|
|
3067
3070
|
}
|
|
3068
3071
|
),
|
|
@@ -3077,9 +3080,9 @@ function DepositAddressStep({
|
|
|
3077
3080
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Supported token" }),
|
|
3078
3081
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
3079
3082
|
"Min.$",
|
|
3080
|
-
(_chunkOY5N3E6Lcjs.isHyperCoreDestination.call(void 0, targetChain) || isHyperCore ? Math.max(_chunkOY5N3E6Lcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3081
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3082
|
-
|
|
3083
|
+
(_chunkOY5N3E6Lcjs.isHyperCoreDestination.call(void 0, targetChain) || isHyperCore ? Math.max(_chunkOY5N3E6Lcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _151 => _151.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _152 => _152.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
3084
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3085
|
+
_chunkQGNJFDEOcjs.InfoIcon,
|
|
3083
3086
|
{
|
|
3084
3087
|
className: "rs-deposit-address-min-icon",
|
|
3085
3088
|
"aria-hidden": "true"
|
|
@@ -3100,7 +3103,7 @@ function DepositAddressStep({
|
|
|
3100
3103
|
children: [
|
|
3101
3104
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenGlyph, { symbol: sourceTokenSymbol }),
|
|
3102
3105
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceTokenSymbol }),
|
|
3103
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3106
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
3104
3107
|
]
|
|
3105
3108
|
}
|
|
3106
3109
|
),
|
|
@@ -3145,7 +3148,7 @@ function DepositAddressStep({
|
|
|
3145
3148
|
className: "rs-deposit-address-copy",
|
|
3146
3149
|
onClick: handleCopy,
|
|
3147
3150
|
children: [
|
|
3148
|
-
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3151
|
+
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.CopyIcon, {}),
|
|
3149
3152
|
copied ? "Copied!" : "Copy address"
|
|
3150
3153
|
]
|
|
3151
3154
|
}
|
|
@@ -3180,7 +3183,7 @@ function DepositAddressStep({
|
|
|
3180
3183
|
},
|
|
3181
3184
|
deposit.id
|
|
3182
3185
|
)) }),
|
|
3183
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3186
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.PoweredBy, {})
|
|
3184
3187
|
] });
|
|
3185
3188
|
}
|
|
3186
3189
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -3237,7 +3240,7 @@ function FinalisingDepositStep() {
|
|
|
3237
3240
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "rs-finalising-subtitle", children: "We are depositing your funds to the application." })
|
|
3238
3241
|
] })
|
|
3239
3242
|
] }),
|
|
3240
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3243
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.PoweredBy, {})
|
|
3241
3244
|
] });
|
|
3242
3245
|
}
|
|
3243
3246
|
FinalisingDepositStep.displayName = "FinalisingDepositStep";
|
|
@@ -3267,7 +3270,7 @@ function SwappedOrderTracker({
|
|
|
3267
3270
|
];
|
|
3268
3271
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-swapped-tracker", children: [
|
|
3269
3272
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3270
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3273
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.HandCoinsIcon, {}), title }),
|
|
3271
3274
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ol", { className: "rs-swapped-tracker-steps", children: labels.map((label, idx) => {
|
|
3272
3275
|
const status = stepStates[idx];
|
|
3273
3276
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
@@ -3281,7 +3284,7 @@ function SwappedOrderTracker({
|
|
|
3281
3284
|
{
|
|
3282
3285
|
className: "rs-swapped-tracker-step-marker",
|
|
3283
3286
|
"aria-hidden": "true",
|
|
3284
|
-
children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3287
|
+
children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.CheckIcon, {}) : status === "failed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.CloseIcon, {}) : status === "active" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.Spinner, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3285
3288
|
"svg",
|
|
3286
3289
|
{
|
|
3287
3290
|
className: "rs-swapped-tracker-step-ring",
|
|
@@ -3316,7 +3319,7 @@ function SwappedOrderTracker({
|
|
|
3316
3319
|
}
|
|
3317
3320
|
)
|
|
3318
3321
|
] }),
|
|
3319
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3322
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.PoweredBy, {})
|
|
3320
3323
|
] });
|
|
3321
3324
|
}
|
|
3322
3325
|
function formatTrackerAmount(amount) {
|
|
@@ -3490,19 +3493,19 @@ function SwappedProviderStep({
|
|
|
3490
3493
|
if (cancelled) return;
|
|
3491
3494
|
if (!isTrustedSwappedWidgetUrl(res.url)) {
|
|
3492
3495
|
setLoadError(loadErrorFallback);
|
|
3493
|
-
_optionalChain([onErrorRef, 'access',
|
|
3496
|
+
_optionalChain([onErrorRef, 'access', _153 => _153.current, 'optionalCall', _154 => _154(loadErrorFallback, loadErrorCode)]);
|
|
3494
3497
|
return;
|
|
3495
3498
|
}
|
|
3496
3499
|
setWidgetUrl(res.url);
|
|
3497
3500
|
expectedExternalCustomerIdRef.current = res.externalCustomerId;
|
|
3498
|
-
_optionalChain([onAttemptConsumed, 'optionalCall',
|
|
3501
|
+
_optionalChain([onAttemptConsumed, 'optionalCall', _155 => _155(res.externalCustomerId)]);
|
|
3499
3502
|
const sep = res.externalCustomerId.indexOf(":");
|
|
3500
3503
|
expectedOrderUuidRef.current = sep >= 0 ? res.externalCustomerId.slice(sep + 1) : null;
|
|
3501
3504
|
}).catch((err) => {
|
|
3502
3505
|
if (cancelled) return;
|
|
3503
3506
|
const message = err instanceof Error ? err.message : loadErrorFallback;
|
|
3504
3507
|
setLoadError(message);
|
|
3505
|
-
_optionalChain([onErrorRef, 'access',
|
|
3508
|
+
_optionalChain([onErrorRef, 'access', _156 => _156.current, 'optionalCall', _157 => _157(message, loadErrorCode)]);
|
|
3506
3509
|
});
|
|
3507
3510
|
return () => {
|
|
3508
3511
|
cancelled = true;
|
|
@@ -3517,7 +3520,7 @@ function SwappedProviderStep({
|
|
|
3517
3520
|
const timer = setTimeout(() => {
|
|
3518
3521
|
const message = "Iframe took too long to load.";
|
|
3519
3522
|
setLoadError(message);
|
|
3520
|
-
_optionalChain([onErrorRef, 'access',
|
|
3523
|
+
_optionalChain([onErrorRef, 'access', _158 => _158.current, 'optionalCall', _159 => _159(message, "SWAPPED_IFRAME_TIMEOUT")]);
|
|
3521
3524
|
}, IFRAME_LOAD_TIMEOUT_MS);
|
|
3522
3525
|
return () => clearTimeout(timer);
|
|
3523
3526
|
}, [openExternally, widgetUrl, iframeLoaded, loadError]);
|
|
@@ -3527,7 +3530,7 @@ function SwappedProviderStep({
|
|
|
3527
3530
|
setIframeSrc(nextSrc);
|
|
3528
3531
|
if (nextSrc && assignedIframeUrlRef.current !== nextSrc) {
|
|
3529
3532
|
assignedIframeUrlRef.current = nextSrc;
|
|
3530
|
-
_optionalChain([onProviderHandoffRef, 'access',
|
|
3533
|
+
_optionalChain([onProviderHandoffRef, 'access', _160 => _160.current, 'optionalCall', _161 => _161()]);
|
|
3531
3534
|
}
|
|
3532
3535
|
}, [openExternally, widgetUrl, loadError, retryToken]);
|
|
3533
3536
|
const openPaymentPage = async (url) => {
|
|
@@ -3537,11 +3540,11 @@ function SwappedProviderStep({
|
|
|
3537
3540
|
try {
|
|
3538
3541
|
await openExternally(url);
|
|
3539
3542
|
setHandoffOpened(true);
|
|
3540
|
-
_optionalChain([onProviderHandoff, 'optionalCall',
|
|
3543
|
+
_optionalChain([onProviderHandoff, 'optionalCall', _162 => _162()]);
|
|
3541
3544
|
} catch (error) {
|
|
3542
3545
|
openedUrlRef.current = null;
|
|
3543
3546
|
setLoadError(OPEN_FAILED_MESSAGE);
|
|
3544
|
-
_optionalChain([onErrorRef, 'access',
|
|
3547
|
+
_optionalChain([onErrorRef, 'access', _163 => _163.current, 'optionalCall', _164 => _164(
|
|
3545
3548
|
error instanceof Error && error.message ? error.message : OPEN_FAILED_MESSAGE,
|
|
3546
3549
|
OPEN_FAILED_CODE
|
|
3547
3550
|
)]);
|
|
@@ -3589,8 +3592,8 @@ function SwappedProviderStep({
|
|
|
3589
3592
|
const doc = globalThis.document;
|
|
3590
3593
|
const onVisible = () => {
|
|
3591
3594
|
if (doc.visibilityState !== "visible") return;
|
|
3592
|
-
_optionalChain([rescheduleStatusPollRef, 'access',
|
|
3593
|
-
_optionalChain([rescheduleDepositPollRef, 'access',
|
|
3595
|
+
_optionalChain([rescheduleStatusPollRef, 'access', _165 => _165.current, 'optionalCall', _166 => _166(0)]);
|
|
3596
|
+
_optionalChain([rescheduleDepositPollRef, 'access', _167 => _167.current, 'optionalCall', _168 => _168(0)]);
|
|
3594
3597
|
};
|
|
3595
3598
|
doc.addEventListener("visibilitychange", onVisible);
|
|
3596
3599
|
return () => doc.removeEventListener("visibilitychange", onVisible);
|
|
@@ -3604,10 +3607,10 @@ function SwappedProviderStep({
|
|
|
3604
3607
|
const status = await service.fetchLatestStatus(smartAccount);
|
|
3605
3608
|
if (cancelled) return;
|
|
3606
3609
|
const event = status.lastEvent;
|
|
3607
|
-
const eventTxHash =
|
|
3610
|
+
const eventTxHash = _chunkQGNJFDEOcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkQGNJFDEOcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
3608
3611
|
if (baselineDepositTxHashRef.current === void 0) {
|
|
3609
3612
|
baselineDepositTxHashRef.current = eventTxHash;
|
|
3610
|
-
} else if (eventTxHash && (!baselineDepositTxHashRef.current || !
|
|
3613
|
+
} else if (eventTxHash && (!baselineDepositTxHashRef.current || !_chunkQGNJFDEOcjs.txRefsMatch.call(void 0, eventTxHash, baselineDepositTxHashRef.current))) {
|
|
3611
3614
|
currentDepositTxHashRef.current = eventTxHash;
|
|
3612
3615
|
setLatestEvent(_nullishCoalesce(event, () => ( null)));
|
|
3613
3616
|
}
|
|
@@ -3632,16 +3635,16 @@ function SwappedProviderStep({
|
|
|
3632
3635
|
}, [service, smartAccount]);
|
|
3633
3636
|
_react.useEffect.call(void 0, () => {
|
|
3634
3637
|
if (fastDepositPollEnabledRef.current) return;
|
|
3635
|
-
const status = _optionalChain([orderState, 'optionalAccess',
|
|
3638
|
+
const status = _optionalChain([orderState, 'optionalAccess', _169 => _169.status]);
|
|
3636
3639
|
if (!status || !SWAPPED_TERMINAL_STATUSES.has(status)) return;
|
|
3637
3640
|
fastDepositPollEnabledRef.current = true;
|
|
3638
|
-
_optionalChain([rescheduleDepositPollRef, 'access',
|
|
3641
|
+
_optionalChain([rescheduleDepositPollRef, 'access', _170 => _170.current, 'optionalCall', _171 => _171(DEPOSIT_POLL_FAST_INITIAL_DELAY_MS)]);
|
|
3639
3642
|
}, [orderState]);
|
|
3640
3643
|
_react.useEffect.call(void 0, () => {
|
|
3641
3644
|
if (openExternally) return;
|
|
3642
3645
|
function onMessage(e) {
|
|
3643
3646
|
if (!SWAPPED_IFRAME_ORIGINS.has(e.origin)) return;
|
|
3644
|
-
if (e.source !== _optionalChain([iframeRef, 'access',
|
|
3647
|
+
if (e.source !== _optionalChain([iframeRef, 'access', _172 => _172.current, 'optionalAccess', _173 => _173.contentWindow])) return;
|
|
3645
3648
|
if (isSwappedGoBackMessage(e.data)) {
|
|
3646
3649
|
onGoBackRef.current();
|
|
3647
3650
|
return;
|
|
@@ -3656,16 +3659,16 @@ function SwappedProviderStep({
|
|
|
3656
3659
|
setOrderState((prev) => ({
|
|
3657
3660
|
// Normalise to the uuid the backend poll also keys on, so orderState
|
|
3658
3661
|
// is consistent regardless of which path set it.
|
|
3659
|
-
orderId: _nullishCoalesce(_nullishCoalesce(expectedOrderUuidRef.current, () => ( _optionalChain([prev, 'optionalAccess',
|
|
3662
|
+
orderId: _nullishCoalesce(_nullishCoalesce(expectedOrderUuidRef.current, () => ( _optionalChain([prev, 'optionalAccess', _174 => _174.orderId]))), () => ( ext)),
|
|
3660
3663
|
status: parsed.status,
|
|
3661
|
-
orderCrypto: _nullishCoalesce(_nullishCoalesce(parsed.orderCrypto, () => ( _optionalChain([prev, 'optionalAccess',
|
|
3662
|
-
orderCryptoAmount: _nullishCoalesce(_nullishCoalesce(parsed.orderCryptoAmount, () => ( _optionalChain([prev, 'optionalAccess',
|
|
3663
|
-
transactionId: _nullishCoalesce(_nullishCoalesce(parsed.transactionId, () => ( _optionalChain([prev, 'optionalAccess',
|
|
3664
|
+
orderCrypto: _nullishCoalesce(_nullishCoalesce(parsed.orderCrypto, () => ( _optionalChain([prev, 'optionalAccess', _175 => _175.orderCrypto]))), () => ( null)),
|
|
3665
|
+
orderCryptoAmount: _nullishCoalesce(_nullishCoalesce(parsed.orderCryptoAmount, () => ( _optionalChain([prev, 'optionalAccess', _176 => _176.orderCryptoAmount]))), () => ( null)),
|
|
3666
|
+
transactionId: _nullishCoalesce(_nullishCoalesce(parsed.transactionId, () => ( _optionalChain([prev, 'optionalAccess', _177 => _177.transactionId]))), () => ( null)),
|
|
3664
3667
|
receivedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3665
|
-
paidAmountUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
3666
|
-
paidAmountEur: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
3667
|
-
onrampFeeUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
3668
|
-
paymentMethod: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
3668
|
+
paidAmountUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _178 => _178.paidAmountUsd]), () => ( null)),
|
|
3669
|
+
paidAmountEur: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _179 => _179.paidAmountEur]), () => ( null)),
|
|
3670
|
+
onrampFeeUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _180 => _180.onrampFeeUsd]), () => ( null)),
|
|
3671
|
+
paymentMethod: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _181 => _181.paymentMethod]), () => ( null))
|
|
3669
3672
|
}));
|
|
3670
3673
|
}
|
|
3671
3674
|
window.addEventListener("message", onMessage);
|
|
@@ -3678,28 +3681,28 @@ function SwappedProviderStep({
|
|
|
3678
3681
|
}
|
|
3679
3682
|
}, [phase, orderState, latestEvent, variant]);
|
|
3680
3683
|
const stepStates = _react.useMemo.call(void 0,
|
|
3681
|
-
() => deriveStepStates(_nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
3684
|
+
() => deriveStepStates(_nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _182 => _182.status]), () => ( null)), latestEvent),
|
|
3682
3685
|
[orderState, latestEvent]
|
|
3683
3686
|
);
|
|
3684
3687
|
const terminalState = _react.useMemo.call(void 0, () => {
|
|
3685
|
-
if (
|
|
3688
|
+
if (_chunkQGNJFDEOcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
|
|
3686
3689
|
return {
|
|
3687
3690
|
kind: "failed",
|
|
3688
|
-
message:
|
|
3691
|
+
message: _chunkQGNJFDEOcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
|
|
3689
3692
|
};
|
|
3690
3693
|
}
|
|
3691
|
-
if (_optionalChain([orderState, 'optionalAccess',
|
|
3694
|
+
if (_optionalChain([orderState, 'optionalAccess', _183 => _183.status]) === "order_cancelled") {
|
|
3692
3695
|
const banner = bannerForStatus("order_cancelled", {});
|
|
3693
3696
|
return { kind: "cancelled", message: _nullishCoalesce(banner.detail, () => ( banner.title)) };
|
|
3694
3697
|
}
|
|
3695
3698
|
return null;
|
|
3696
3699
|
}, [latestEvent, orderState, bannerForStatus]);
|
|
3697
3700
|
_react.useEffect.call(void 0, () => {
|
|
3698
|
-
if (_optionalChain([orderState, 'optionalAccess',
|
|
3699
|
-
}, [onCancelled, _optionalChain([orderState, 'optionalAccess',
|
|
3701
|
+
if (_optionalChain([orderState, 'optionalAccess', _184 => _184.status]) === "order_cancelled") _optionalChain([onCancelled, 'optionalCall', _185 => _185()]);
|
|
3702
|
+
}, [onCancelled, _optionalChain([orderState, 'optionalAccess', _186 => _186.status])]);
|
|
3700
3703
|
_react.useEffect.call(void 0, () => {
|
|
3701
3704
|
if (completeFiredRef.current || failedFiredRef.current) return;
|
|
3702
|
-
const t = _optionalChain([latestEvent, 'optionalAccess',
|
|
3705
|
+
const t = _optionalChain([latestEvent, 'optionalAccess', _187 => _187.type]);
|
|
3703
3706
|
const isSuccess = t === "bridge-complete";
|
|
3704
3707
|
if (!isSuccess) return;
|
|
3705
3708
|
const txHash = currentDepositTxHashRef.current;
|
|
@@ -3708,10 +3711,10 @@ function SwappedProviderStep({
|
|
|
3708
3711
|
const info = {
|
|
3709
3712
|
smartAccount,
|
|
3710
3713
|
txHash,
|
|
3711
|
-
orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
3714
|
+
orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _188 => _188.orderCrypto]), () => ( null)),
|
|
3712
3715
|
// Base-unit source amount from the deposit row/event, consistent with the
|
|
3713
3716
|
// wallet/QR path. ProcessingStep + onLifecycle expect base units.
|
|
3714
|
-
amount: _nullishCoalesce(
|
|
3717
|
+
amount: _nullishCoalesce(_chunkQGNJFDEOcjs.getEventSourceDetails.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0))).amount, () => ( null)),
|
|
3715
3718
|
expectedOrderUuid: expectedOrderUuidRef.current,
|
|
3716
3719
|
initialEvent: _nullishCoalesce(latestEvent, () => ( void 0))
|
|
3717
3720
|
};
|
|
@@ -3722,23 +3725,23 @@ function SwappedProviderStep({
|
|
|
3722
3725
|
}, [latestEvent, orderState, smartAccount]);
|
|
3723
3726
|
_react.useEffect.call(void 0, () => {
|
|
3724
3727
|
if (failedFiredRef.current || completeFiredRef.current) return;
|
|
3725
|
-
if (!
|
|
3728
|
+
if (!_chunkQGNJFDEOcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) return;
|
|
3726
3729
|
const txHash = currentDepositTxHashRef.current;
|
|
3727
3730
|
if (!txHash) return;
|
|
3728
3731
|
failedFiredRef.current = true;
|
|
3729
3732
|
setPhase("tracker");
|
|
3730
|
-
_optionalChain([onSwappedFailedRef, 'access',
|
|
3733
|
+
_optionalChain([onSwappedFailedRef, 'access', _189 => _189.current, 'optionalCall', _190 => _190(
|
|
3731
3734
|
txHash,
|
|
3732
|
-
|
|
3735
|
+
_chunkQGNJFDEOcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
|
|
3733
3736
|
)]);
|
|
3734
3737
|
}, [latestEvent]);
|
|
3735
3738
|
const immersive = !openExternally && variant === "fiat" && phase === "provider" && !loadError;
|
|
3736
3739
|
_react.useEffect.call(void 0, () => {
|
|
3737
|
-
_optionalChain([onImmersiveChangeRef, 'access',
|
|
3740
|
+
_optionalChain([onImmersiveChangeRef, 'access', _191 => _191.current, 'optionalCall', _192 => _192(immersive)]);
|
|
3738
3741
|
}, [immersive]);
|
|
3739
|
-
_react.useEffect.call(void 0, () => () => _optionalChain([onImmersiveChangeRef, 'access',
|
|
3742
|
+
_react.useEffect.call(void 0, () => () => _optionalChain([onImmersiveChangeRef, 'access', _193 => _193.current, 'optionalCall', _194 => _194(false)]), []);
|
|
3740
3743
|
const handleRetry = () => {
|
|
3741
|
-
_optionalChain([onRetry, 'optionalCall',
|
|
3744
|
+
_optionalChain([onRetry, 'optionalCall', _195 => _195()]);
|
|
3742
3745
|
setIframeSrc(null);
|
|
3743
3746
|
setWidgetUrl(null);
|
|
3744
3747
|
setIframeLoaded(false);
|
|
@@ -3756,8 +3759,8 @@ function SwappedProviderStep({
|
|
|
3756
3759
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3757
3760
|
SwappedOrderTracker,
|
|
3758
3761
|
{
|
|
3759
|
-
amount: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
3760
|
-
currency: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
3762
|
+
amount: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _196 => _196.orderCryptoAmount]), () => ( null)),
|
|
3763
|
+
currency: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _197 => _197.orderCrypto]), () => ( "USDC")),
|
|
3761
3764
|
stepStates,
|
|
3762
3765
|
terminal: terminalState,
|
|
3763
3766
|
onRetry: handleRetry,
|
|
@@ -3779,7 +3782,7 @@ function SwappedProviderStep({
|
|
|
3779
3782
|
}
|
|
3780
3783
|
)
|
|
3781
3784
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
3782
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3785
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.Spinner, {}),
|
|
3783
3786
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-swapped-handoff-text", children: [
|
|
3784
3787
|
/* @__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" }),
|
|
3785
3788
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "rs-swapped-handoff-subtitle", children: handoffOpened ? (
|
|
@@ -3803,7 +3806,7 @@ function SwappedProviderStep({
|
|
|
3803
3806
|
}
|
|
3804
3807
|
)
|
|
3805
3808
|
] }) }),
|
|
3806
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3809
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.PoweredBy, {})
|
|
3807
3810
|
] });
|
|
3808
3811
|
}
|
|
3809
3812
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-fiat-onramp", "data-variant": variant, children: [
|
|
@@ -3820,7 +3823,7 @@ function SwappedProviderStep({
|
|
|
3820
3823
|
}
|
|
3821
3824
|
)
|
|
3822
3825
|
] }),
|
|
3823
|
-
!loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3826
|
+
!loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.Spinner, {}) }),
|
|
3824
3827
|
widgetUrl && !loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3825
3828
|
"iframe",
|
|
3826
3829
|
{
|
|
@@ -3832,7 +3835,7 @@ function SwappedProviderStep({
|
|
|
3832
3835
|
allow: "payment; camera; microphone; clipboard-write; geolocation",
|
|
3833
3836
|
onLoad: () => {
|
|
3834
3837
|
try {
|
|
3835
|
-
if (_optionalChain([iframeRef, 'access',
|
|
3838
|
+
if (_optionalChain([iframeRef, 'access', _198 => _198.current, 'optionalAccess', _199 => _199.contentWindow, 'optionalAccess', _200 => _200.location, 'optionalAccess', _201 => _201.href]) === "about:blank") {
|
|
3836
3839
|
return;
|
|
3837
3840
|
}
|
|
3838
3841
|
} catch (e24) {
|
|
@@ -3843,11 +3846,11 @@ function SwappedProviderStep({
|
|
|
3843
3846
|
retryToken
|
|
3844
3847
|
)
|
|
3845
3848
|
] }) }),
|
|
3846
|
-
loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3849
|
+
loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.PoweredBy, {})
|
|
3847
3850
|
] });
|
|
3848
3851
|
}
|
|
3849
3852
|
function deriveStepStates(swappedStatus, latestEvent) {
|
|
3850
|
-
if (
|
|
3853
|
+
if (_chunkQGNJFDEOcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
|
|
3851
3854
|
return ["complete", "complete", "failed", "pending"];
|
|
3852
3855
|
}
|
|
3853
3856
|
if (swappedStatus === "order_cancelled") {
|
|
@@ -3855,7 +3858,7 @@ function deriveStepStates(swappedStatus, latestEvent) {
|
|
|
3855
3858
|
}
|
|
3856
3859
|
const step1Complete = swappedStatus === "order_completed" || swappedStatus === "order_broadcasted";
|
|
3857
3860
|
const step2Complete = latestEvent !== null || swappedStatus === "order_broadcasted";
|
|
3858
|
-
const step3Complete = _optionalChain([latestEvent, 'optionalAccess',
|
|
3861
|
+
const step3Complete = _optionalChain([latestEvent, 'optionalAccess', _202 => _202.type]) === "bridge-complete";
|
|
3859
3862
|
if (step3Complete) {
|
|
3860
3863
|
return ["complete", "complete", "complete", "complete"];
|
|
3861
3864
|
}
|
|
@@ -3916,7 +3919,7 @@ function FiatOnrampStep({
|
|
|
3916
3919
|
openExternally
|
|
3917
3920
|
}) {
|
|
3918
3921
|
const loadUrl = _react.useCallback.call(void 0, async () => {
|
|
3919
|
-
const prefetched = _optionalChain([consumePrefetchedUrl, 'optionalCall',
|
|
3922
|
+
const prefetched = _optionalChain([consumePrefetchedUrl, 'optionalCall', _203 => _203(
|
|
3920
3923
|
smartAccount,
|
|
3921
3924
|
paymentMethod,
|
|
3922
3925
|
methodSelectionSource
|
|
@@ -4057,7 +4060,7 @@ ExchangeConnectStep.displayName = "ExchangeConnectStep";
|
|
|
4057
4060
|
function ExchangeLogo({ exchange }) {
|
|
4058
4061
|
const [failed, setFailed] = _react.useState.call(void 0, false);
|
|
4059
4062
|
if (!exchange.logoUrl || failed) {
|
|
4060
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4063
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.BankIcon, {});
|
|
4061
4064
|
}
|
|
4062
4065
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4063
4066
|
"img",
|
|
@@ -4102,7 +4105,7 @@ function ExchangeSelectStep({
|
|
|
4102
4105
|
setExchanges([]);
|
|
4103
4106
|
setExchangeFeeBps(0);
|
|
4104
4107
|
setError(message);
|
|
4105
|
-
_optionalChain([onError, 'optionalCall',
|
|
4108
|
+
_optionalChain([onError, 'optionalCall', _204 => _204(message, "SWAPPED_CONNECT_EXCHANGES_FAILED")]);
|
|
4106
4109
|
}).finally(() => {
|
|
4107
4110
|
if (!cancelled) setLoading(false);
|
|
4108
4111
|
});
|
|
@@ -4128,7 +4131,7 @@ function ExchangeSelectStep({
|
|
|
4128
4131
|
} catch (err) {
|
|
4129
4132
|
const message = err instanceof Error ? err.message : "Failed to prepare Connect";
|
|
4130
4133
|
setSelectionNotice(message);
|
|
4131
|
-
_optionalChain([onError, 'optionalCall',
|
|
4134
|
+
_optionalChain([onError, 'optionalCall', _205 => _205(message, "SWAPPED_CONNECT_URL_FAILED")]);
|
|
4132
4135
|
} finally {
|
|
4133
4136
|
setSelectingConnection(null);
|
|
4134
4137
|
}
|
|
@@ -4138,14 +4141,14 @@ function ExchangeSelectStep({
|
|
|
4138
4141
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-exchange-select", children: [
|
|
4139
4142
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4140
4143
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4141
|
-
|
|
4144
|
+
_chunkQGNJFDEOcjs.BodyHeader,
|
|
4142
4145
|
{
|
|
4143
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4146
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.UnplugIcon, {}),
|
|
4144
4147
|
title: "Connect exchange",
|
|
4145
4148
|
subtitle: "Select an exchange to connect"
|
|
4146
4149
|
}
|
|
4147
4150
|
),
|
|
4148
|
-
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4151
|
+
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.Spinner, {}) }),
|
|
4149
4152
|
!loading && error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: [
|
|
4150
4153
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state-title", children: "Couldn\u2019t load exchanges" }),
|
|
4151
4154
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -4171,7 +4174,7 @@ function ExchangeSelectStep({
|
|
|
4171
4174
|
)
|
|
4172
4175
|
] }),
|
|
4173
4176
|
!loading && !error && exchanges.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-grid", children: exchanges.map((exchange) => {
|
|
4174
|
-
const brand =
|
|
4177
|
+
const brand = _chunkQGNJFDEOcjs.getExchangeLogo.call(void 0, exchange.name, exchange.connection);
|
|
4175
4178
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4176
4179
|
"button",
|
|
4177
4180
|
{
|
|
@@ -4196,7 +4199,7 @@ function ExchangeSelectStep({
|
|
|
4196
4199
|
);
|
|
4197
4200
|
}) })
|
|
4198
4201
|
] }),
|
|
4199
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4202
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.PoweredBy, {}),
|
|
4200
4203
|
exchangeFeeBps > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "rs-exchange-select-fee-note", children: [
|
|
4201
4204
|
"A ",
|
|
4202
4205
|
formatFeeRate(exchangeFeeBps),
|
|
@@ -4234,7 +4237,7 @@ function SolanaTokenSelectStep({
|
|
|
4234
4237
|
setError(null);
|
|
4235
4238
|
const portfolioBySymbol = {};
|
|
4236
4239
|
try {
|
|
4237
|
-
|
|
4240
|
+
_chunkQGNJFDEOcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
|
|
4238
4241
|
solanaAddress
|
|
4239
4242
|
});
|
|
4240
4243
|
const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
|
|
@@ -4257,12 +4260,12 @@ function SolanaTokenSelectStep({
|
|
|
4257
4260
|
};
|
|
4258
4261
|
}
|
|
4259
4262
|
}
|
|
4260
|
-
|
|
4263
|
+
_chunkQGNJFDEOcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
|
|
4261
4264
|
symbols: Object.keys(portfolioBySymbol)
|
|
4262
4265
|
});
|
|
4263
4266
|
} catch (err) {
|
|
4264
4267
|
if (!active) return;
|
|
4265
|
-
|
|
4268
|
+
_chunkQGNJFDEOcjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
|
|
4266
4269
|
solanaAddress
|
|
4267
4270
|
});
|
|
4268
4271
|
setError(
|
|
@@ -4287,7 +4290,7 @@ function SolanaTokenSelectStep({
|
|
|
4287
4290
|
setTokenBalances(results);
|
|
4288
4291
|
setLoading(false);
|
|
4289
4292
|
const totalUsd = results.reduce((sum, r) => sum + r.balanceUsd, 0);
|
|
4290
|
-
_optionalChain([onTotalBalanceComputed, 'optionalCall',
|
|
4293
|
+
_optionalChain([onTotalBalanceComputed, 'optionalCall', _206 => _206(totalUsd)]);
|
|
4291
4294
|
}
|
|
4292
4295
|
void loadBalances();
|
|
4293
4296
|
return () => {
|
|
@@ -4309,7 +4312,7 @@ function SolanaTokenSelectStep({
|
|
|
4309
4312
|
const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
|
|
4310
4313
|
const numeric = Number(raw);
|
|
4311
4314
|
if (!Number.isFinite(numeric)) return raw;
|
|
4312
|
-
return
|
|
4315
|
+
return _chunkQGNJFDEOcjs.tokenFormatter.format(numeric);
|
|
4313
4316
|
} catch (e27) {
|
|
4314
4317
|
return "--";
|
|
4315
4318
|
}
|
|
@@ -4319,20 +4322,20 @@ function SolanaTokenSelectStep({
|
|
|
4319
4322
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
4320
4323
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
4321
4324
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4322
|
-
|
|
4325
|
+
_chunkQGNJFDEOcjs.BodyHeader,
|
|
4323
4326
|
{
|
|
4324
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4327
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.WalletIcon, {}),
|
|
4325
4328
|
title: "Your assets",
|
|
4326
4329
|
subtitle: "Select source assets to transfer"
|
|
4327
4330
|
}
|
|
4328
4331
|
),
|
|
4329
4332
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
4330
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4333
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
4331
4334
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
4332
4335
|
] }),
|
|
4333
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4336
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.Callout, { variant: "error", children: error }),
|
|
4334
4337
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
4335
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4338
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
4336
4339
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
4337
4340
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
4338
4341
|
solanaAddress.slice(0, 6),
|
|
@@ -4363,13 +4366,13 @@ function SolanaTokenSelectStep({
|
|
|
4363
4366
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
|
|
4364
4367
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-icon-wrapper", children: [
|
|
4365
4368
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4366
|
-
|
|
4369
|
+
_chunkQGNJFDEOcjs.TokenIcon,
|
|
4367
4370
|
{
|
|
4368
4371
|
symbol: entry.token.symbol,
|
|
4369
4372
|
fallback: entry.token.symbol.slice(0, 4)
|
|
4370
4373
|
}
|
|
4371
4374
|
) }),
|
|
4372
|
-
chainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4375
|
+
chainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.CdnIcon, { src: chainIcon, alt: chainName }) })
|
|
4373
4376
|
] }),
|
|
4374
4377
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-text", children: [
|
|
4375
4378
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-name-row", children: [
|
|
@@ -4386,14 +4389,14 @@ function SolanaTokenSelectStep({
|
|
|
4386
4389
|
] })
|
|
4387
4390
|
] })
|
|
4388
4391
|
] }),
|
|
4389
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ?
|
|
4392
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunkQGNJFDEOcjs.currencyFormatter.format(entry.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${entry.token.symbol}` : "--" })
|
|
4390
4393
|
]
|
|
4391
4394
|
},
|
|
4392
4395
|
entry.token.symbol
|
|
4393
4396
|
);
|
|
4394
4397
|
}) }),
|
|
4395
4398
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4396
|
-
|
|
4399
|
+
_chunkQGNJFDEOcjs.Button,
|
|
4397
4400
|
{
|
|
4398
4401
|
onClick: () => selectedEntry && onContinue(
|
|
4399
4402
|
selectedEntry.token,
|
|
@@ -4406,7 +4409,7 @@ function SolanaTokenSelectStep({
|
|
|
4406
4409
|
}
|
|
4407
4410
|
)
|
|
4408
4411
|
] }),
|
|
4409
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4412
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.PoweredBy, {})
|
|
4410
4413
|
] });
|
|
4411
4414
|
}
|
|
4412
4415
|
|
|
@@ -4438,7 +4441,7 @@ function SolanaAmountStep({
|
|
|
4438
4441
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
4439
4442
|
const hasAppliedDefaultRef = _react.useRef.call(void 0, false);
|
|
4440
4443
|
const isSourceStablecoin = _chunkOY5N3E6Lcjs.isStablecoinSymbol.call(void 0, token.symbol);
|
|
4441
|
-
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess',
|
|
4444
|
+
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess', _207 => _207.trim, 'call', _208 => _208(), 'access', _209 => _209.toLowerCase, 'call', _210 => _210()]) === "max";
|
|
4442
4445
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
4443
4446
|
if (isSourceStablecoin) return 1;
|
|
4444
4447
|
try {
|
|
@@ -4458,7 +4461,7 @@ function SolanaAmountStep({
|
|
|
4458
4461
|
const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
|
|
4459
4462
|
const numeric = Number(raw);
|
|
4460
4463
|
if (!Number.isFinite(numeric)) return raw;
|
|
4461
|
-
return
|
|
4464
|
+
return _chunkQGNJFDEOcjs.tokenFormatter.format(numeric);
|
|
4462
4465
|
} catch (e29) {
|
|
4463
4466
|
return "\u2026";
|
|
4464
4467
|
}
|
|
@@ -4540,8 +4543,8 @@ function SolanaAmountStep({
|
|
|
4540
4543
|
return null;
|
|
4541
4544
|
}
|
|
4542
4545
|
}, [numericAmount, isSourceStablecoin, hasPricing, tokenPriceUsd, token.decimals]);
|
|
4543
|
-
const minDepositUsd = _chunkOY5N3E6Lcjs.isHyperCoreDestination.call(void 0, targetChain) ? Math.max(_chunkOY5N3E6Lcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
4544
|
-
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
4546
|
+
const minDepositUsd = _chunkOY5N3E6Lcjs.isHyperCoreDestination.call(void 0, targetChain) ? Math.max(_chunkOY5N3E6Lcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _211 => _211.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _212 => _212.minDepositUsd]), () => ( null));
|
|
4547
|
+
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _213 => _213.maxDepositUsd]), () => ( null));
|
|
4545
4548
|
const isBelowMin = minDepositUsd !== null && numericAmount > 0 && numericAmount < minDepositUsd;
|
|
4546
4549
|
const isAboveMax = maxDepositUsd !== null && numericAmount > maxDepositUsd;
|
|
4547
4550
|
const exceedsBalance = Boolean(
|
|
@@ -4551,7 +4554,7 @@ function SolanaAmountStep({
|
|
|
4551
4554
|
const handlePresetClick = (percentage) => {
|
|
4552
4555
|
const formatted = computePresetAmount(percentage);
|
|
4553
4556
|
if (!formatted) return;
|
|
4554
|
-
|
|
4557
|
+
_chunkQGNJFDEOcjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
|
|
4555
4558
|
percentage,
|
|
4556
4559
|
symbol: token.symbol,
|
|
4557
4560
|
formatted
|
|
@@ -4586,7 +4589,7 @@ function SolanaAmountStep({
|
|
|
4586
4589
|
try {
|
|
4587
4590
|
amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
|
|
4588
4591
|
} catch (e34) {
|
|
4589
|
-
|
|
4592
|
+
_chunkQGNJFDEOcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
4590
4593
|
amount,
|
|
4591
4594
|
sourceAmount: sourceAmountStr,
|
|
4592
4595
|
reason: "parse-units-failed"
|
|
@@ -4601,7 +4604,7 @@ function SolanaAmountStep({
|
|
|
4601
4604
|
);
|
|
4602
4605
|
return;
|
|
4603
4606
|
}
|
|
4604
|
-
|
|
4607
|
+
_chunkQGNJFDEOcjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
|
|
4605
4608
|
symbol: token.symbol,
|
|
4606
4609
|
inputAmountUsd: amount,
|
|
4607
4610
|
sourceAmount: sourceAmountStr,
|
|
@@ -4614,7 +4617,7 @@ function SolanaAmountStep({
|
|
|
4614
4617
|
const continueDisabled = exceedsBalance || numericAmount === 0 && !isBelowMin;
|
|
4615
4618
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
4616
4619
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4617
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4620
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.WalletIcon, {}), title: "Wallet deposit" }),
|
|
4618
4621
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
4619
4622
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
4620
4623
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -4634,13 +4637,13 @@ function SolanaAmountStep({
|
|
|
4634
4637
|
" available",
|
|
4635
4638
|
computedBalanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
4636
4639
|
" (~",
|
|
4637
|
-
|
|
4640
|
+
_chunkQGNJFDEOcjs.currencyFormatter.format(computedBalanceUsd),
|
|
4638
4641
|
")"
|
|
4639
4642
|
] })
|
|
4640
4643
|
] }),
|
|
4641
4644
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
4642
4645
|
"Min. deposit ",
|
|
4643
|
-
|
|
4646
|
+
_chunkQGNJFDEOcjs.currencyFormatter.format(minDepositUsd)
|
|
4644
4647
|
] })
|
|
4645
4648
|
] })
|
|
4646
4649
|
] }),
|
|
@@ -4663,7 +4666,7 @@ function SolanaAmountStep({
|
|
|
4663
4666
|
"Solana ",
|
|
4664
4667
|
token.symbol
|
|
4665
4668
|
] }),
|
|
4666
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4669
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.TokenIcon, { symbol: token.symbol }) })
|
|
4667
4670
|
] })
|
|
4668
4671
|
] }),
|
|
4669
4672
|
targetChainName && targetTokenSymbol && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
@@ -4674,17 +4677,17 @@ function SolanaAmountStep({
|
|
|
4674
4677
|
" ",
|
|
4675
4678
|
targetTokenSymbol
|
|
4676
4679
|
] }),
|
|
4677
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4680
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.TokenIcon, { symbol: targetTokenSymbol }) })
|
|
4678
4681
|
] })
|
|
4679
4682
|
] }),
|
|
4680
4683
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
4681
4684
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
4682
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
4685
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkQGNJFDEOcjs.currencyFormatter.format(balanceAfterUsd) })
|
|
4683
4686
|
] })
|
|
4684
4687
|
] }),
|
|
4685
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4688
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.Callout, { variant: "error", children: error }),
|
|
4686
4689
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4687
|
-
|
|
4690
|
+
_chunkQGNJFDEOcjs.Button,
|
|
4688
4691
|
{
|
|
4689
4692
|
onClick: handleContinue,
|
|
4690
4693
|
fullWidth: true,
|
|
@@ -4693,7 +4696,7 @@ function SolanaAmountStep({
|
|
|
4693
4696
|
}
|
|
4694
4697
|
)
|
|
4695
4698
|
] }),
|
|
4696
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4699
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.PoweredBy, {})
|
|
4697
4700
|
] });
|
|
4698
4701
|
}
|
|
4699
4702
|
|
|
@@ -4713,10 +4716,10 @@ function loadSolanaDependencies() {
|
|
|
4713
4716
|
return dependenciesPromise2;
|
|
4714
4717
|
}
|
|
4715
4718
|
function getSolanaRpcUrl(rpcUrls) {
|
|
4716
|
-
return _nullishCoalesce(
|
|
4719
|
+
return _nullishCoalesce(_chunkQGNJFDEOcjs.rpcUrlFor.call(void 0, rpcUrls, "solana"), () => ( DEFAULT_SOLANA_RPC_URL));
|
|
4717
4720
|
}
|
|
4718
4721
|
function hasConfiguredSolanaRpcUrl(rpcUrls) {
|
|
4719
|
-
return
|
|
4722
|
+
return _chunkQGNJFDEOcjs.rpcUrlFor.call(void 0, rpcUrls, "solana") !== void 0;
|
|
4720
4723
|
}
|
|
4721
4724
|
async function getSolanaConnection(rpcUrls) {
|
|
4722
4725
|
const rpcUrl = getSolanaRpcUrl(rpcUrls);
|
|
@@ -4833,14 +4836,14 @@ function SolanaConfirmStep({
|
|
|
4833
4836
|
onSubmittingChange,
|
|
4834
4837
|
debug
|
|
4835
4838
|
}) {
|
|
4836
|
-
const rpcUrls =
|
|
4839
|
+
const rpcUrls = _chunkQGNJFDEOcjs.useRpcUrls.call(void 0, );
|
|
4837
4840
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
4838
4841
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
4839
4842
|
const onSubmittingChangeRef = _react.useRef.call(void 0, onSubmittingChange);
|
|
4840
4843
|
onSubmittingChangeRef.current = onSubmittingChange;
|
|
4841
4844
|
_react.useEffect.call(void 0, () => {
|
|
4842
|
-
_optionalChain([onSubmittingChangeRef, 'access',
|
|
4843
|
-
return () => _optionalChain([onSubmittingChangeRef, 'access',
|
|
4845
|
+
_optionalChain([onSubmittingChangeRef, 'access', _214 => _214.current, 'optionalCall', _215 => _215(isSubmitting)]);
|
|
4846
|
+
return () => _optionalChain([onSubmittingChangeRef, 'access', _216 => _216.current, 'optionalCall', _217 => _217(false)]);
|
|
4844
4847
|
}, [isSubmitting]);
|
|
4845
4848
|
const targetChainId = _chunkOY5N3E6Lcjs.targetChainToChainId.call(void 0, targetChain);
|
|
4846
4849
|
const targetSymbol = _chunkOY5N3E6Lcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
@@ -4848,28 +4851,28 @@ function SolanaConfirmStep({
|
|
|
4848
4851
|
const targetChainName = _chunkOY5N3E6Lcjs.getChainName.call(void 0, targetChainId);
|
|
4849
4852
|
const sourceChainIcon = _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, "solana");
|
|
4850
4853
|
const targetChainIcon = _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, targetChainId);
|
|
4851
|
-
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
4852
|
-
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
4853
|
-
const formattedAmount = sourceAmount && Number.isFinite(Number(sourceAmount)) ? _nullishCoalesce(
|
|
4854
|
+
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _218 => _218.feeSponsored]), () => ( false));
|
|
4855
|
+
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _219 => _219.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
4856
|
+
const formattedAmount = sourceAmount && Number.isFinite(Number(sourceAmount)) ? _nullishCoalesce(_chunkQGNJFDEOcjs.formatTokenAmount.call(void 0, Number(sourceAmount), token.symbol), () => ( "0")) : "0";
|
|
4854
4857
|
const receiveDisplay = (() => {
|
|
4855
4858
|
const usdValue = Number(targetAmount);
|
|
4856
4859
|
const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
|
|
4857
|
-
const estimate =
|
|
4860
|
+
const estimate = _chunkQGNJFDEOcjs.formatReceiveEstimate.call(void 0, {
|
|
4858
4861
|
sourceAmount: Number.isFinite(Number(sourceAmount)) ? Number(sourceAmount) : void 0,
|
|
4859
4862
|
sourceSymbol: token.symbol,
|
|
4860
4863
|
targetSymbol,
|
|
4861
4864
|
sourceAmountUsd,
|
|
4862
|
-
sourceTrusted:
|
|
4865
|
+
sourceTrusted: _chunkQGNJFDEOcjs.isRecognizedToken.call(void 0, token.mint, "solana"),
|
|
4863
4866
|
// Curated stablecoin target estimates at $1 when unquoted; never applied
|
|
4864
4867
|
// to the source (a held token). See ConfirmStep for the rationale.
|
|
4865
|
-
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } :
|
|
4868
|
+
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : _chunkQGNJFDEOcjs.isDisplayStablecoinSymbol.call(void 0, targetSymbol) ? { [targetSymbol.toUpperCase()]: 1 } : {}
|
|
4866
4869
|
});
|
|
4867
4870
|
if (estimate !== void 0) return estimate;
|
|
4868
4871
|
return targetSymbol;
|
|
4869
4872
|
})();
|
|
4870
4873
|
const handleConfirm = async () => {
|
|
4871
4874
|
if (!solanaProvider) {
|
|
4872
|
-
|
|
4875
|
+
_chunkQGNJFDEOcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
4873
4876
|
reason: "missing-provider"
|
|
4874
4877
|
});
|
|
4875
4878
|
setError("Solana wallet not connected");
|
|
@@ -4877,7 +4880,7 @@ function SolanaConfirmStep({
|
|
|
4877
4880
|
}
|
|
4878
4881
|
const parsedAmount = parseFloat(sourceAmount);
|
|
4879
4882
|
if (isNaN(parsedAmount) || parsedAmount <= 0) {
|
|
4880
|
-
|
|
4883
|
+
_chunkQGNJFDEOcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
4881
4884
|
reason: "invalid-amount",
|
|
4882
4885
|
sourceAmount
|
|
4883
4886
|
});
|
|
@@ -4886,7 +4889,7 @@ function SolanaConfirmStep({
|
|
|
4886
4889
|
}
|
|
4887
4890
|
setError(null);
|
|
4888
4891
|
setIsSubmitting(true);
|
|
4889
|
-
|
|
4892
|
+
_chunkQGNJFDEOcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
|
|
4890
4893
|
smartAccount,
|
|
4891
4894
|
solanaAddress,
|
|
4892
4895
|
solanaDepositAddress,
|
|
@@ -4896,7 +4899,7 @@ function SolanaConfirmStep({
|
|
|
4896
4899
|
});
|
|
4897
4900
|
try {
|
|
4898
4901
|
const check = await service.checkAccount(smartAccount);
|
|
4899
|
-
|
|
4902
|
+
_chunkQGNJFDEOcjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
|
|
4900
4903
|
smartAccount,
|
|
4901
4904
|
isRegistered: check.isRegistered,
|
|
4902
4905
|
targetChain: check.targetChain,
|
|
@@ -4909,7 +4912,7 @@ function SolanaConfirmStep({
|
|
|
4909
4912
|
}
|
|
4910
4913
|
const connection = await (hasConfiguredSolanaRpcUrl(rpcUrls) ? getSolanaConnection(rpcUrls) : _nullishCoalesce(solanaConnection, () => ( getSolanaConnection(rpcUrls))));
|
|
4911
4914
|
const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
|
|
4912
|
-
|
|
4915
|
+
_chunkQGNJFDEOcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
|
|
4913
4916
|
token: token.symbol,
|
|
4914
4917
|
sourceAmount,
|
|
4915
4918
|
amountUnits: amountUnits.toString()
|
|
@@ -4926,10 +4929,10 @@ function SolanaConfirmStep({
|
|
|
4926
4929
|
token.mint,
|
|
4927
4930
|
amountUnits
|
|
4928
4931
|
);
|
|
4929
|
-
|
|
4932
|
+
_chunkQGNJFDEOcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
4930
4933
|
token: token.symbol,
|
|
4931
4934
|
instructionCount: transaction.instructions.length,
|
|
4932
|
-
feePayer: _optionalChain([transaction, 'access',
|
|
4935
|
+
feePayer: _optionalChain([transaction, 'access', _220 => _220.feePayer, 'optionalAccess', _221 => _221.toBase58, 'call', _222 => _222()]),
|
|
4933
4936
|
recentBlockhash: transaction.recentBlockhash
|
|
4934
4937
|
});
|
|
4935
4938
|
const txHash = await sendSolanaTransaction(
|
|
@@ -4937,7 +4940,7 @@ function SolanaConfirmStep({
|
|
|
4937
4940
|
connection,
|
|
4938
4941
|
transaction
|
|
4939
4942
|
);
|
|
4940
|
-
|
|
4943
|
+
_chunkQGNJFDEOcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
|
|
4941
4944
|
txHash,
|
|
4942
4945
|
amountUnits: amountUnits.toString()
|
|
4943
4946
|
});
|
|
@@ -4949,21 +4952,21 @@ function SolanaConfirmStep({
|
|
|
4949
4952
|
});
|
|
4950
4953
|
} catch (err) {
|
|
4951
4954
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
4952
|
-
const message =
|
|
4953
|
-
|
|
4955
|
+
const message = _chunkQGNJFDEOcjs.formatUserError.call(void 0, raw);
|
|
4956
|
+
_chunkQGNJFDEOcjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
|
|
4954
4957
|
smartAccount,
|
|
4955
4958
|
token: token.symbol,
|
|
4956
4959
|
sourceAmount
|
|
4957
4960
|
});
|
|
4958
4961
|
setError(message);
|
|
4959
|
-
_optionalChain([onError, 'optionalCall',
|
|
4962
|
+
_optionalChain([onError, 'optionalCall', _223 => _223(message, "SOLANA_TRANSFER_ERROR", raw)]);
|
|
4960
4963
|
} finally {
|
|
4961
4964
|
setIsSubmitting(false);
|
|
4962
4965
|
}
|
|
4963
4966
|
};
|
|
4964
4967
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
4965
4968
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4966
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4969
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.WalletIcon, {}), title: "Review deposit" }),
|
|
4967
4970
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4968
4971
|
ReviewDetails,
|
|
4969
4972
|
{
|
|
@@ -4979,9 +4982,9 @@ function SolanaConfirmStep({
|
|
|
4979
4982
|
fee: { display: "$0.04", struck: feeSponsored, tooltip: feeTooltip }
|
|
4980
4983
|
}
|
|
4981
4984
|
),
|
|
4982
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4985
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.Callout, { variant: "error", children: error }),
|
|
4983
4986
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4984
|
-
|
|
4987
|
+
_chunkQGNJFDEOcjs.Button,
|
|
4985
4988
|
{
|
|
4986
4989
|
onClick: handleConfirm,
|
|
4987
4990
|
loading: isSubmitting,
|
|
@@ -4992,7 +4995,7 @@ function SolanaConfirmStep({
|
|
|
4992
4995
|
}
|
|
4993
4996
|
)
|
|
4994
4997
|
] }),
|
|
4995
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4998
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.PoweredBy, {})
|
|
4996
4999
|
] });
|
|
4997
5000
|
}
|
|
4998
5001
|
|
|
@@ -5007,19 +5010,19 @@ function DappImportAssetSelectStep({
|
|
|
5007
5010
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
5008
5011
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
5009
5012
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5010
|
-
|
|
5013
|
+
_chunkQGNJFDEOcjs.BodyHeader,
|
|
5011
5014
|
{
|
|
5012
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5015
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.WalletIcon, {}),
|
|
5013
5016
|
title: `Transfer from ${sourceLabel}`,
|
|
5014
5017
|
subtitle: "Pick the balance to import"
|
|
5015
5018
|
}
|
|
5016
5019
|
),
|
|
5017
5020
|
incompleteSummary && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-notice", role: "status", children: incompleteSummary }),
|
|
5018
5021
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: assets.map((asset) => {
|
|
5019
|
-
const tokenAmount = asset.balance ?
|
|
5022
|
+
const tokenAmount = asset.balance ? _chunkQGNJFDEOcjs.tokenFormatter.format(
|
|
5020
5023
|
Number(asset.balance) / 10 ** asset.decimals
|
|
5021
5024
|
) : "0";
|
|
5022
|
-
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ?
|
|
5025
|
+
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ? _chunkQGNJFDEOcjs.currencyFormatter.format(asset.balanceUsd) : `${tokenAmount} ${asset.symbol}`;
|
|
5023
5026
|
const assetIcon = asset.icon;
|
|
5024
5027
|
const chainIcon = _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, asset.chainId);
|
|
5025
5028
|
const badge = _chunkOY5N3E6Lcjs.getChainBadge.call(void 0, asset.chainId);
|
|
@@ -5032,14 +5035,14 @@ function DappImportAssetSelectStep({
|
|
|
5032
5035
|
children: [
|
|
5033
5036
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
|
|
5034
5037
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-icon-wrapper", children: [
|
|
5035
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: assetIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5036
|
-
|
|
5038
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: assetIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.CdnIcon, { src: assetIcon, alt: asset.symbol }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5039
|
+
_chunkQGNJFDEOcjs.TokenIcon,
|
|
5037
5040
|
{
|
|
5038
5041
|
symbol: asset.symbol,
|
|
5039
5042
|
fallback: asset.symbol.slice(0, 4)
|
|
5040
5043
|
}
|
|
5041
5044
|
) }),
|
|
5042
|
-
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5045
|
+
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.CdnIcon, { src: chainIcon, alt: _chunkOY5N3E6Lcjs.getChainName.call(void 0, asset.chainId) }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5043
5046
|
"span",
|
|
5044
5047
|
{
|
|
5045
5048
|
className: "rs-asset-chain-badge",
|
|
@@ -5071,7 +5074,7 @@ function DappImportAssetSelectStep({
|
|
|
5071
5074
|
);
|
|
5072
5075
|
}) })
|
|
5073
5076
|
] }),
|
|
5074
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5077
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.PoweredBy, {})
|
|
5075
5078
|
] });
|
|
5076
5079
|
}
|
|
5077
5080
|
DappImportAssetSelectStep.displayName = "DappImportAssetSelectStep";
|
|
@@ -5093,7 +5096,7 @@ function describeRow(status, comingSoon) {
|
|
|
5093
5096
|
}
|
|
5094
5097
|
if (status.enabled) {
|
|
5095
5098
|
return {
|
|
5096
|
-
subtitle: status.balanceUsd > 0 ?
|
|
5099
|
+
subtitle: status.balanceUsd > 0 ? _chunkQGNJFDEOcjs.currencyFormatter.format(status.balanceUsd) : "No balance",
|
|
5097
5100
|
disabled: false,
|
|
5098
5101
|
busy: false
|
|
5099
5102
|
};
|
|
@@ -5116,9 +5119,9 @@ function DappImportSelectStep({
|
|
|
5116
5119
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
5117
5120
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
5118
5121
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5119
|
-
|
|
5122
|
+
_chunkQGNJFDEOcjs.BodyHeader,
|
|
5120
5123
|
{
|
|
5121
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5124
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.MigrateAssetsIcon, {}),
|
|
5122
5125
|
title: "Migrate assets",
|
|
5123
5126
|
subtitle: "Select a position to migrate"
|
|
5124
5127
|
}
|
|
@@ -5130,16 +5133,16 @@ function DappImportSelectStep({
|
|
|
5130
5133
|
Boolean(brand.comingSoon)
|
|
5131
5134
|
);
|
|
5132
5135
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5133
|
-
|
|
5136
|
+
_chunkQGNJFDEOcjs.ListRow,
|
|
5134
5137
|
{
|
|
5135
5138
|
leadingMedia: brand.iconUrl,
|
|
5136
5139
|
title: brand.label,
|
|
5137
5140
|
subtitle,
|
|
5138
5141
|
disabled,
|
|
5139
|
-
trailing: busy ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5142
|
+
trailing: busy ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.Spinner, { className: "rs-spinner--sm" }) : void 0,
|
|
5140
5143
|
onClick: () => {
|
|
5141
5144
|
if (status === "needs-connect") {
|
|
5142
|
-
_optionalChain([onRequestConnect, 'optionalCall',
|
|
5145
|
+
_optionalChain([onRequestConnect, 'optionalCall', _224 => _224()]);
|
|
5143
5146
|
return;
|
|
5144
5147
|
}
|
|
5145
5148
|
onSelect(brand.id);
|
|
@@ -5149,7 +5152,7 @@ function DappImportSelectStep({
|
|
|
5149
5152
|
);
|
|
5150
5153
|
}) })
|
|
5151
5154
|
] }),
|
|
5152
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5155
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.PoweredBy, {})
|
|
5153
5156
|
] });
|
|
5154
5157
|
}
|
|
5155
5158
|
DappImportSelectStep.displayName = "DappImportSelectStep";
|
|
@@ -5166,9 +5169,9 @@ function DappImportAssetSelectSkeleton({
|
|
|
5166
5169
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: error ? "Couldn't load balances" : "Loading balances\u2026" }),
|
|
5167
5170
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
5168
5171
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5169
|
-
|
|
5172
|
+
_chunkQGNJFDEOcjs.BodyHeader,
|
|
5170
5173
|
{
|
|
5171
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5174
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.WalletIcon, {}),
|
|
5172
5175
|
title: `Transfer from ${sourceLabel}`,
|
|
5173
5176
|
subtitle: "Pick the balance to import"
|
|
5174
5177
|
}
|
|
@@ -5206,7 +5209,7 @@ function DappImportAssetSelectSkeleton({
|
|
|
5206
5209
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Try again" })
|
|
5207
5210
|
}
|
|
5208
5211
|
) }),
|
|
5209
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5212
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.PoweredBy, {})
|
|
5210
5213
|
] });
|
|
5211
5214
|
}
|
|
5212
5215
|
DappImportAssetSelectSkeleton.displayName = "DappImportAssetSelectSkeleton";
|
|
@@ -5295,7 +5298,7 @@ var aaveProvider = {
|
|
|
5295
5298
|
throw new Error("Aave positions require a backend connection");
|
|
5296
5299
|
}
|
|
5297
5300
|
const response = await backend.getPositions(eoa);
|
|
5298
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
5301
|
+
if (_optionalChain([signal, 'optionalAccess', _225 => _225.aborted])) return null;
|
|
5299
5302
|
const assets = toImportableAssets(response.positions);
|
|
5300
5303
|
const failures = _nullishCoalesce(response.failures, () => ( []));
|
|
5301
5304
|
if (assets.length === 0) {
|
|
@@ -5628,21 +5631,21 @@ var polymarketProvider = {
|
|
|
5628
5631
|
async fetchAvailability({ eoa, getPublicClient: getPublicClient2, signal }) {
|
|
5629
5632
|
const proxyWallet = await _chunkLVCD6RHFcjs.fetchPolymarketProxyWallet.call(void 0, eoa, signal);
|
|
5630
5633
|
if (!proxyWallet) return null;
|
|
5631
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
5634
|
+
if (_optionalChain([signal, 'optionalAccess', _226 => _226.aborted])) return null;
|
|
5632
5635
|
const polygonClient = getPublicClient2(_chunkLVCD6RHFcjs.POLYMARKET_POLYGON_CHAIN_ID);
|
|
5633
5636
|
if (!polygonClient) return null;
|
|
5634
5637
|
const balances = await _chunkLVCD6RHFcjs.readPolymarketBalances.call(void 0, {
|
|
5635
5638
|
publicClient: polygonClient,
|
|
5636
5639
|
proxyWallet
|
|
5637
5640
|
});
|
|
5638
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
5641
|
+
if (_optionalChain([signal, 'optionalAccess', _227 => _227.aborted])) return null;
|
|
5639
5642
|
if (balances.pusd === 0n && balances.usdce === 0n) return null;
|
|
5640
5643
|
const walletKind = await detectPolymarketWalletKind({
|
|
5641
5644
|
publicClient: polygonClient,
|
|
5642
5645
|
proxyWallet,
|
|
5643
5646
|
eoa
|
|
5644
5647
|
});
|
|
5645
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
5648
|
+
if (_optionalChain([signal, 'optionalAccess', _228 => _228.aborted])) return null;
|
|
5646
5649
|
if (!walletKind) return null;
|
|
5647
5650
|
const assets = [];
|
|
5648
5651
|
if (balances.pusd > 0n) {
|
|
@@ -5753,7 +5756,7 @@ function getEnabledProviders(config) {
|
|
|
5753
5756
|
function computeDappImportStatus(providerId, inputs) {
|
|
5754
5757
|
const { owner, availability, availabilityOwner, setup } = inputs;
|
|
5755
5758
|
if (!owner) return "needs-connect";
|
|
5756
|
-
const entry = _optionalChain([availabilityOwner, 'optionalAccess',
|
|
5759
|
+
const entry = _optionalChain([availabilityOwner, 'optionalAccess', _229 => _229.toLowerCase, 'call', _230 => _230()]) === owner.toLowerCase() ? availability[providerId] : void 0;
|
|
5757
5760
|
if (entry === "loading" || entry === void 0) return "loading";
|
|
5758
5761
|
if (entry === "error") {
|
|
5759
5762
|
return {
|
|
@@ -6095,7 +6098,7 @@ function DepositAnalyticsControllerProvider({
|
|
|
6095
6098
|
children,
|
|
6096
6099
|
controllerRef
|
|
6097
6100
|
}) {
|
|
6098
|
-
const emit =
|
|
6101
|
+
const emit = _chunkQGNJFDEOcjs.useDepositAnalyticsEmitter.call(void 0, );
|
|
6099
6102
|
const controller = _react.useMemo.call(void 0,
|
|
6100
6103
|
() => createDepositAnalyticsController(emit),
|
|
6101
6104
|
[emit]
|
|
@@ -6615,7 +6618,7 @@ function applyAction(state, action) {
|
|
|
6615
6618
|
totalUsd: null,
|
|
6616
6619
|
// Keep any prior chains visible so the cluster does not flicker
|
|
6617
6620
|
// empty across a refresh.
|
|
6618
|
-
chainIds: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
6621
|
+
chainIds: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _231 => _231.chainIds]), () => ( []))
|
|
6619
6622
|
}
|
|
6620
6623
|
}
|
|
6621
6624
|
}
|
|
@@ -6826,7 +6829,7 @@ function applyAction(state, action) {
|
|
|
6826
6829
|
flow: { ...state.flow, step: "processing" }
|
|
6827
6830
|
};
|
|
6828
6831
|
case "processing/quote-loaded":
|
|
6829
|
-
if (state.flow.step !== "processing" || _optionalChain([state, 'access',
|
|
6832
|
+
if (state.flow.step !== "processing" || _optionalChain([state, 'access', _232 => _232.processing, 'access', _233 => _233.txHash, 'optionalAccess', _234 => _234.toLowerCase, 'call', _235 => _235()]) !== action.txHash.toLowerCase()) {
|
|
6830
6833
|
return state;
|
|
6831
6834
|
}
|
|
6832
6835
|
return {
|
|
@@ -7420,11 +7423,11 @@ function DepositFlow({
|
|
|
7420
7423
|
onError,
|
|
7421
7424
|
debug
|
|
7422
7425
|
}) {
|
|
7423
|
-
const rpcUrls =
|
|
7424
|
-
const onStepChangeRef =
|
|
7426
|
+
const rpcUrls = _chunkQGNJFDEOcjs.useRpcUrls.call(void 0, );
|
|
7427
|
+
const onStepChangeRef = _chunkQGNJFDEOcjs.useLatestRef.call(void 0, onStepChange);
|
|
7425
7428
|
const analytics = useDepositAnalyticsController();
|
|
7426
|
-
const onLifecycleRef =
|
|
7427
|
-
const onErrorRef =
|
|
7429
|
+
const onLifecycleRef = _chunkQGNJFDEOcjs.useLatestRef.call(void 0, onLifecycle);
|
|
7430
|
+
const onErrorRef = _chunkQGNJFDEOcjs.useLatestRef.call(void 0, onError);
|
|
7428
7431
|
const storeApi = useDepositStoreApi();
|
|
7429
7432
|
const flowSlice = useDepositStore((s) => s.flow);
|
|
7430
7433
|
const depositSlice = useDepositStore((s) => s.deposit);
|
|
@@ -7441,13 +7444,13 @@ function DepositFlow({
|
|
|
7441
7444
|
const stableWalletSelectionKeyRef = _react.useRef.call(void 0, null);
|
|
7442
7445
|
const logFlow = _react.useCallback.call(void 0,
|
|
7443
7446
|
(message, data) => {
|
|
7444
|
-
|
|
7447
|
+
_chunkQGNJFDEOcjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
|
|
7445
7448
|
},
|
|
7446
7449
|
[debug]
|
|
7447
7450
|
);
|
|
7448
7451
|
const logFlowError = _react.useCallback.call(void 0,
|
|
7449
7452
|
(message, error, data) => {
|
|
7450
|
-
|
|
7453
|
+
_chunkQGNJFDEOcjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
|
|
7451
7454
|
},
|
|
7452
7455
|
[debug]
|
|
7453
7456
|
);
|
|
@@ -7471,12 +7474,12 @@ function DepositFlow({
|
|
|
7471
7474
|
};
|
|
7472
7475
|
}, [enableSwappedPreconnect]);
|
|
7473
7476
|
const dappSwitchChain = _react.useMemo.call(void 0, () => {
|
|
7474
|
-
if (!_optionalChain([walletClientProp, 'optionalAccess',
|
|
7477
|
+
if (!_optionalChain([walletClientProp, 'optionalAccess', _236 => _236.switchChain])) return void 0;
|
|
7475
7478
|
return async (chainId) => {
|
|
7476
|
-
await _optionalChain([walletClientProp, 'access',
|
|
7479
|
+
await _optionalChain([walletClientProp, 'access', _237 => _237.switchChain, 'optionalCall', _238 => _238({ id: chainId })]);
|
|
7477
7480
|
};
|
|
7478
7481
|
}, [walletClientProp]);
|
|
7479
|
-
const connectedWalletAddress = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess',
|
|
7482
|
+
const connectedWalletAddress = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess', _239 => _239.account, 'optionalAccess', _240 => _240.address]), () => ( null));
|
|
7480
7483
|
const walletOptions = _react.useMemo.call(void 0, () => {
|
|
7481
7484
|
const options = [];
|
|
7482
7485
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -7490,7 +7493,7 @@ function DepositFlow({
|
|
|
7490
7493
|
});
|
|
7491
7494
|
seen.add(id);
|
|
7492
7495
|
}
|
|
7493
|
-
if (_optionalChain([walletSession, 'optionalAccess',
|
|
7496
|
+
if (_optionalChain([walletSession, 'optionalAccess', _241 => _241.isConnected]) && walletSession.isSolana && walletSession.solanaAddress) {
|
|
7494
7497
|
const id = _nullishCoalesce(walletSession.caipAddress, () => ( `solana:${walletSession.solanaAddress}`));
|
|
7495
7498
|
if (!seen.has(id)) {
|
|
7496
7499
|
options.push({
|
|
@@ -7502,7 +7505,7 @@ function DepositFlow({
|
|
|
7502
7505
|
});
|
|
7503
7506
|
seen.add(id);
|
|
7504
7507
|
}
|
|
7505
|
-
} else if (_optionalChain([walletSession, 'optionalAccess',
|
|
7508
|
+
} else if (_optionalChain([walletSession, 'optionalAccess', _242 => _242.address]) && walletSession.isConnected && walletSession.canSignEvm && !seen.has(`evm:${walletSession.address.toLowerCase()}`)) {
|
|
7506
7509
|
const id = `evm:${walletSession.address.toLowerCase()}`;
|
|
7507
7510
|
if (!seen.has(id)) {
|
|
7508
7511
|
options.push({
|
|
@@ -7518,13 +7521,13 @@ function DepositFlow({
|
|
|
7518
7521
|
return options;
|
|
7519
7522
|
}, [
|
|
7520
7523
|
connectedWalletAddress,
|
|
7521
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7522
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7523
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7524
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7525
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7526
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7527
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7524
|
+
_optionalChain([walletSession, 'optionalAccess', _243 => _243.address]),
|
|
7525
|
+
_optionalChain([walletSession, 'optionalAccess', _244 => _244.isConnected]),
|
|
7526
|
+
_optionalChain([walletSession, 'optionalAccess', _245 => _245.canSignEvm]),
|
|
7527
|
+
_optionalChain([walletSession, 'optionalAccess', _246 => _246.icon]),
|
|
7528
|
+
_optionalChain([walletSession, 'optionalAccess', _247 => _247.isSolana]),
|
|
7529
|
+
_optionalChain([walletSession, 'optionalAccess', _248 => _248.solanaAddress]),
|
|
7530
|
+
_optionalChain([walletSession, 'optionalAccess', _249 => _249.caipAddress])
|
|
7528
7531
|
]);
|
|
7529
7532
|
const offeredFiatMethods = _react.useMemo.call(void 0,
|
|
7530
7533
|
() => fiatMethods ? FIAT_ONRAMP_METHODS.filter((m) => fiatMethods[m.method]) : FIAT_ONRAMP_METHODS,
|
|
@@ -7544,11 +7547,11 @@ function DepositFlow({
|
|
|
7544
7547
|
hasEnabledAssetMigration
|
|
7545
7548
|
].filter(Boolean).length;
|
|
7546
7549
|
const canAutoLock = Boolean(
|
|
7547
|
-
enableWallet && _optionalChain([walletClientProp, 'optionalAccess',
|
|
7550
|
+
enableWallet && _optionalChain([walletClientProp, 'optionalAccess', _250 => _250.account]) && !walletSession && enabledFeatureCount === 1
|
|
7548
7551
|
);
|
|
7549
7552
|
const hasWalletOptions = enableWallet && walletOptions.length > 0;
|
|
7550
7553
|
const hasReownSession = Boolean(
|
|
7551
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7554
|
+
_optionalChain([walletSession, 'optionalAccess', _251 => _251.isConnected]) || _optionalChain([walletSession, 'optionalAccess', _252 => _252.address])
|
|
7552
7555
|
);
|
|
7553
7556
|
const isDappImportWalletHydrating = Boolean(
|
|
7554
7557
|
hasWalletClientProp && walletClientProp === void 0 || walletSession && !hasReownSession && !walletSession.isReady
|
|
@@ -7579,7 +7582,7 @@ function DepositFlow({
|
|
|
7579
7582
|
return;
|
|
7580
7583
|
}
|
|
7581
7584
|
let cancelled = false;
|
|
7582
|
-
|
|
7585
|
+
_chunkQGNJFDEOcjs.fetchTokenPriceUsd.call(void 0, service, {
|
|
7583
7586
|
chainId: targetChainId,
|
|
7584
7587
|
address: targetToken,
|
|
7585
7588
|
symbol: targetSymbol
|
|
@@ -7596,11 +7599,11 @@ function DepositFlow({
|
|
|
7596
7599
|
return null;
|
|
7597
7600
|
}
|
|
7598
7601
|
if (canAutoLock) {
|
|
7599
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess',
|
|
7602
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess', _253 => _253.chain, 'optionalAccess', _254 => _254.id]), () => ( setupChainId));
|
|
7600
7603
|
return {
|
|
7601
7604
|
ownerAddress: walletClientProp.account.address,
|
|
7602
7605
|
walletClient: walletClientProp,
|
|
7603
|
-
publicClient: _nullishCoalesce(publicClientProp, () => (
|
|
7606
|
+
publicClient: _nullishCoalesce(publicClientProp, () => ( _chunkQGNJFDEOcjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
|
|
7604
7607
|
switchChain: dappSwitchChain
|
|
7605
7608
|
};
|
|
7606
7609
|
}
|
|
@@ -7612,20 +7615,20 @@ function DepositFlow({
|
|
|
7612
7615
|
if (selectedOption.kind === "solana") {
|
|
7613
7616
|
return null;
|
|
7614
7617
|
}
|
|
7615
|
-
if (selectedOption.kind === "connected" && _optionalChain([walletClientProp, 'optionalAccess',
|
|
7616
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess',
|
|
7618
|
+
if (selectedOption.kind === "connected" && _optionalChain([walletClientProp, 'optionalAccess', _255 => _255.account]) && selectedOption.address && walletClientProp.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
7619
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess', _256 => _256.chain, 'optionalAccess', _257 => _257.id]), () => ( setupChainId));
|
|
7617
7620
|
return {
|
|
7618
7621
|
ownerAddress: walletClientProp.account.address,
|
|
7619
7622
|
walletClient: walletClientProp,
|
|
7620
|
-
publicClient: _nullishCoalesce(publicClientProp, () => (
|
|
7623
|
+
publicClient: _nullishCoalesce(publicClientProp, () => ( _chunkQGNJFDEOcjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
|
|
7621
7624
|
switchChain: dappSwitchChain
|
|
7622
7625
|
};
|
|
7623
7626
|
}
|
|
7624
|
-
if (selectedOption.kind === "external" && _optionalChain([walletSession, 'optionalAccess',
|
|
7627
|
+
if (selectedOption.kind === "external" && _optionalChain([walletSession, 'optionalAccess', _258 => _258.address]) && selectedOption.address && walletSession.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
7625
7628
|
return {
|
|
7626
7629
|
ownerAddress: walletSession.address,
|
|
7627
7630
|
walletClient: walletSession.walletClient,
|
|
7628
|
-
publicClient: _nullishCoalesce(walletSession.publicClient, () => (
|
|
7631
|
+
publicClient: _nullishCoalesce(walletSession.publicClient, () => ( _chunkQGNJFDEOcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
|
|
7629
7632
|
switchChain: walletSession.switchChain
|
|
7630
7633
|
};
|
|
7631
7634
|
}
|
|
@@ -7647,7 +7650,7 @@ function DepositFlow({
|
|
|
7647
7650
|
// nothing else here when the host switches chain, and the context would go
|
|
7648
7651
|
// on holding a client bound to the old one: `chainMismatch` never clears
|
|
7649
7652
|
// and the CTA stays disabled with nothing beside it.
|
|
7650
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7653
|
+
_optionalChain([walletSession, 'optionalAccess', _259 => _259.walletClient]),
|
|
7651
7654
|
setupChainId,
|
|
7652
7655
|
rpcUrls
|
|
7653
7656
|
]);
|
|
@@ -7687,35 +7690,35 @@ function DepositFlow({
|
|
|
7687
7690
|
const selectedEvmWalletOwner = _react.useMemo.call(void 0, () => {
|
|
7688
7691
|
if (!selectedWalletId) return null;
|
|
7689
7692
|
const opt = walletOptions.find((o) => o.id === selectedWalletId);
|
|
7690
|
-
if (_optionalChain([opt, 'optionalAccess',
|
|
7693
|
+
if (_optionalChain([opt, 'optionalAccess', _260 => _260.kind]) === "external" && opt.address) {
|
|
7691
7694
|
return opt.address;
|
|
7692
7695
|
}
|
|
7693
|
-
if (_optionalChain([opt, 'optionalAccess',
|
|
7696
|
+
if (_optionalChain([opt, 'optionalAccess', _261 => _261.kind]) === "connected" && opt.address) {
|
|
7694
7697
|
return opt.address;
|
|
7695
7698
|
}
|
|
7696
7699
|
return null;
|
|
7697
7700
|
}, [selectedWalletId, walletOptions]);
|
|
7698
7701
|
const dappImportOwner = _react.useMemo.call(void 0, () => {
|
|
7699
7702
|
if (selectedEvmWalletOwner) return selectedEvmWalletOwner;
|
|
7700
|
-
if (_optionalChain([walletSession, 'optionalAccess',
|
|
7703
|
+
if (_optionalChain([walletSession, 'optionalAccess', _262 => _262.address]) && walletSession.isConnected) {
|
|
7701
7704
|
return walletSession.address;
|
|
7702
7705
|
}
|
|
7703
7706
|
if (connectedWalletAddress) return connectedWalletAddress;
|
|
7704
7707
|
return null;
|
|
7705
7708
|
}, [
|
|
7706
7709
|
selectedEvmWalletOwner,
|
|
7707
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7708
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7710
|
+
_optionalChain([walletSession, 'optionalAccess', _263 => _263.address]),
|
|
7711
|
+
_optionalChain([walletSession, 'optionalAccess', _264 => _264.isConnected]),
|
|
7709
7712
|
connectedWalletAddress
|
|
7710
7713
|
]);
|
|
7711
7714
|
const activeOwner = _react.useMemo.call(void 0,
|
|
7712
7715
|
() => resolveOwnerForMode(flowMode, {
|
|
7713
|
-
walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess',
|
|
7716
|
+
walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _265 => _265.ownerAddress]), () => ( (canAutoLock ? connectedWalletAddress : selectedEvmWalletOwner))),
|
|
7714
7717
|
dappImportOwner
|
|
7715
7718
|
}),
|
|
7716
7719
|
[
|
|
7717
7720
|
flowMode,
|
|
7718
|
-
_optionalChain([signerContext, 'optionalAccess',
|
|
7721
|
+
_optionalChain([signerContext, 'optionalAccess', _266 => _266.ownerAddress]),
|
|
7719
7722
|
canAutoLock,
|
|
7720
7723
|
connectedWalletAddress,
|
|
7721
7724
|
selectedEvmWalletOwner,
|
|
@@ -7732,7 +7735,7 @@ function DepositFlow({
|
|
|
7732
7735
|
].join(":");
|
|
7733
7736
|
if (lastSmartAccountLifecycleKeyRef.current === lifecycleKey) return;
|
|
7734
7737
|
lastSmartAccountLifecycleKeyRef.current = lifecycleKey;
|
|
7735
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7738
|
+
_optionalChain([onLifecycleRef, 'access', _267 => _267.current, 'optionalCall', _268 => _268({
|
|
7736
7739
|
type: "smart-account-changed",
|
|
7737
7740
|
evm: activeEntry.smartAccount,
|
|
7738
7741
|
solana: _nullishCoalesce(activeEntry.solanaDepositAddress, () => ( null))
|
|
@@ -7760,7 +7763,7 @@ function DepositFlow({
|
|
|
7760
7763
|
return;
|
|
7761
7764
|
}
|
|
7762
7765
|
lastConnectedLifecycleKeyRef.current = lifecycleKey;
|
|
7763
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7766
|
+
_optionalChain([onLifecycleRef, 'access', _269 => _269.current, 'optionalCall', _270 => _270({
|
|
7764
7767
|
type: "connected",
|
|
7765
7768
|
address: activeOwner,
|
|
7766
7769
|
smartAccount: activeEntry.smartAccount
|
|
@@ -7833,7 +7836,7 @@ function DepositFlow({
|
|
|
7833
7836
|
const handleWalletDisconnect = _react.useCallback.call(void 0, () => {
|
|
7834
7837
|
analytics.abandon("wallet_disconnect");
|
|
7835
7838
|
analytics.resetAttempt();
|
|
7836
|
-
_optionalChain([onDisconnect, 'optionalCall',
|
|
7839
|
+
_optionalChain([onDisconnect, 'optionalCall', _271 => _271()]);
|
|
7837
7840
|
storeApi.dispatch({
|
|
7838
7841
|
type: "back/requested",
|
|
7839
7842
|
hasWalletOptions: hasWalletOptions || Boolean(walletSession)
|
|
@@ -7846,7 +7849,7 @@ function DepositFlow({
|
|
|
7846
7849
|
setQrSourcePrice({ resolved: false, usd: null });
|
|
7847
7850
|
if (!qrSourceAsset) return;
|
|
7848
7851
|
let cancelled = false;
|
|
7849
|
-
|
|
7852
|
+
_chunkQGNJFDEOcjs.fetchTokenPriceUsd.call(void 0, service, {
|
|
7850
7853
|
chainId: qrSourceAsset.chainId,
|
|
7851
7854
|
address: qrSourceAsset.token,
|
|
7852
7855
|
symbol: qrSourceAsset.symbol
|
|
@@ -7869,7 +7872,7 @@ function DepositFlow({
|
|
|
7869
7872
|
const currentBackHandler = canGoBackFromHere ? handleBack : void 0;
|
|
7870
7873
|
const currentScreen = showConnectStep ? "connect" : effectiveStep.type;
|
|
7871
7874
|
_react.useEffect.call(void 0, () => {
|
|
7872
|
-
_optionalChain([onStepChangeRef, 'access',
|
|
7875
|
+
_optionalChain([onStepChangeRef, 'access', _272 => _272.current, 'optionalCall', _273 => _273(currentBackHandler, currentScreen)]);
|
|
7873
7876
|
}, [currentBackHandler, currentScreen, onStepChangeRef]);
|
|
7874
7877
|
const lastModalHeightRef = _react.useRef.call(void 0, 0);
|
|
7875
7878
|
const modalContentElRef = _react.useRef.call(void 0, null);
|
|
@@ -7879,7 +7882,7 @@ function DepositFlow({
|
|
|
7879
7882
|
modalContentElRef.current = mc;
|
|
7880
7883
|
const ro = new ResizeObserver((entries) => {
|
|
7881
7884
|
for (const entry of entries) {
|
|
7882
|
-
const border = _optionalChain([entry, 'access',
|
|
7885
|
+
const border = _optionalChain([entry, 'access', _274 => _274.borderBoxSize, 'optionalAccess', _275 => _275[0], 'optionalAccess', _276 => _276.blockSize]);
|
|
7883
7886
|
lastModalHeightRef.current = typeof border === "number" ? border : entry.contentRect.height;
|
|
7884
7887
|
}
|
|
7885
7888
|
});
|
|
@@ -7940,7 +7943,7 @@ function DepositFlow({
|
|
|
7940
7943
|
targetToken
|
|
7941
7944
|
]);
|
|
7942
7945
|
_react.useEffect.call(void 0, () => {
|
|
7943
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7946
|
+
_optionalChain([onLifecycleRef, 'access', _277 => _277.current, 'optionalCall', _278 => _278({
|
|
7944
7947
|
type: "balance-changed",
|
|
7945
7948
|
totalUsd: totalBalanceUsd
|
|
7946
7949
|
})]);
|
|
@@ -7957,9 +7960,9 @@ function DepositFlow({
|
|
|
7957
7960
|
const handleConfirmWallet = _react.useCallback.call(void 0,
|
|
7958
7961
|
(walletId) => {
|
|
7959
7962
|
const selectedOption = walletOptions.find((o) => o.id === walletId);
|
|
7960
|
-
const mode = _optionalChain([selectedOption, 'optionalAccess',
|
|
7963
|
+
const mode = _optionalChain([selectedOption, 'optionalAccess', _279 => _279.kind]) === "solana" ? "solana-wallet" : "wallet";
|
|
7961
7964
|
analytics.selectMethod("wallet", "user", {
|
|
7962
|
-
network: _optionalChain([selectedOption, 'optionalAccess',
|
|
7965
|
+
network: _optionalChain([selectedOption, 'optionalAccess', _280 => _280.kind]) === "solana" ? "solana" : "evm",
|
|
7963
7966
|
integration: _nullishCoalesce(walletIntegration, () => ( "none"))
|
|
7964
7967
|
});
|
|
7965
7968
|
storeApi.dispatch({
|
|
@@ -7971,7 +7974,7 @@ function DepositFlow({
|
|
|
7971
7974
|
[analytics, walletIntegration, walletOptions, storeApi]
|
|
7972
7975
|
);
|
|
7973
7976
|
const isSolanaWalletConnected = Boolean(
|
|
7974
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7977
|
+
_optionalChain([walletSession, 'optionalAccess', _281 => _281.isConnected]) && _optionalChain([walletSession, 'optionalAccess', _282 => _282.isSolana])
|
|
7975
7978
|
);
|
|
7976
7979
|
const assetMigrationsKey = assetMigrations ? Object.keys(assetMigrations).filter((k) => assetMigrations[k]).sort().join(",") : "";
|
|
7977
7980
|
const enabledDappImportProviders = _react.useMemo.call(void 0,
|
|
@@ -7988,7 +7991,7 @@ function DepositFlow({
|
|
|
7988
7991
|
const owner = dappImportOwner;
|
|
7989
7992
|
if (owner) {
|
|
7990
7993
|
const wallet = walletOptions.find(
|
|
7991
|
-
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess',
|
|
7994
|
+
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _283 => _283.toLowerCase, 'call', _284 => _284()]) === owner.toLowerCase()
|
|
7992
7995
|
);
|
|
7993
7996
|
if (wallet) {
|
|
7994
7997
|
storeApi.dispatch({
|
|
@@ -8032,7 +8035,7 @@ function DepositFlow({
|
|
|
8032
8035
|
eoa: dappImportOwner,
|
|
8033
8036
|
getPublicClient: (chainId) => {
|
|
8034
8037
|
try {
|
|
8035
|
-
return
|
|
8038
|
+
return _chunkQGNJFDEOcjs.getPublicClient.call(void 0, chainId, rpcUrls);
|
|
8036
8039
|
} catch (e38) {
|
|
8037
8040
|
return null;
|
|
8038
8041
|
}
|
|
@@ -8135,7 +8138,7 @@ function DepositFlow({
|
|
|
8135
8138
|
}, [activeDappImportProviderId, enabledDappImportProviders]);
|
|
8136
8139
|
const activeDappImportAvailability = _react.useMemo.call(void 0, () => {
|
|
8137
8140
|
if (!activeDappImportProviderId) return null;
|
|
8138
|
-
if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess',
|
|
8141
|
+
if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _285 => _285.toLowerCase, 'call', _286 => _286()]) !== dappImportOwner.toLowerCase()) {
|
|
8139
8142
|
return null;
|
|
8140
8143
|
}
|
|
8141
8144
|
const entry = dappImportAvailability[activeDappImportProviderId];
|
|
@@ -8178,7 +8181,7 @@ function DepositFlow({
|
|
|
8178
8181
|
setup: setupSlice
|
|
8179
8182
|
});
|
|
8180
8183
|
const pinnableWallet = dappImportOwner ? _nullishCoalesce(walletOptions.find(
|
|
8181
|
-
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess',
|
|
8184
|
+
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _287 => _287.toLowerCase, 'call', _288 => _288()]) === dappImportOwner.toLowerCase()
|
|
8182
8185
|
), () => ( null)) : null;
|
|
8183
8186
|
const outcome = resolveBootOutcome({
|
|
8184
8187
|
status,
|
|
@@ -8228,7 +8231,7 @@ function DepositFlow({
|
|
|
8228
8231
|
if (dappImportOwner) {
|
|
8229
8232
|
const plan = bootRetryPlan({
|
|
8230
8233
|
setupStatus: snapshot.setup.status,
|
|
8231
|
-
availabilityEntry: _optionalChain([snapshot, 'access',
|
|
8234
|
+
availabilityEntry: _optionalChain([snapshot, 'access', _289 => _289.dappImport, 'access', _290 => _290.availabilityOwner, 'optionalAccess', _291 => _291.toLowerCase, 'call', _292 => _292()]) === dappImportOwner.toLowerCase() ? snapshot.dappImport.availability[providerId] : void 0
|
|
8232
8235
|
});
|
|
8233
8236
|
if (plan.restartSetup) {
|
|
8234
8237
|
storeApi.dispatch({ type: "setup/retry-requested" });
|
|
@@ -8302,7 +8305,7 @@ function DepositFlow({
|
|
|
8302
8305
|
acceptedExchangeFeeBps: disclosedFeeBps
|
|
8303
8306
|
});
|
|
8304
8307
|
} catch (error) {
|
|
8305
|
-
if (error instanceof
|
|
8308
|
+
if (error instanceof _chunkQGNJFDEOcjs.SwappedConnectFeeChangedError) {
|
|
8306
8309
|
return error.exchangeFeeBps;
|
|
8307
8310
|
}
|
|
8308
8311
|
throw error;
|
|
@@ -8310,7 +8313,7 @@ function DepositFlow({
|
|
|
8310
8313
|
entry = { smartAccount: owner, response };
|
|
8311
8314
|
}
|
|
8312
8315
|
const currentAccount = storeApi.getState().setup.smartAccount;
|
|
8313
|
-
if (_optionalChain([currentAccount, 'optionalAccess',
|
|
8316
|
+
if (_optionalChain([currentAccount, 'optionalAccess', _293 => _293.toLowerCase, 'call', _294 => _294()]) !== owner) {
|
|
8314
8317
|
swappedConnectUrlRef.current.delete(key);
|
|
8315
8318
|
throw new Error("Deposit account changed. Select your exchange again.");
|
|
8316
8319
|
}
|
|
@@ -8344,7 +8347,7 @@ function DepositFlow({
|
|
|
8344
8347
|
);
|
|
8345
8348
|
}
|
|
8346
8349
|
swappedConnectUrlRef.current.delete(key);
|
|
8347
|
-
const response = _optionalChain([entry, 'optionalAccess',
|
|
8350
|
+
const response = _optionalChain([entry, 'optionalAccess', _295 => _295.smartAccount]) === smartAccount.toLowerCase() ? entry.response : await service.getSwappedConnectUrl({
|
|
8348
8351
|
smartAccount,
|
|
8349
8352
|
connection,
|
|
8350
8353
|
acceptedExchangeFeeBps: expectedFeeBps
|
|
@@ -8512,7 +8515,7 @@ function DepositFlow({
|
|
|
8512
8515
|
const handleNewDeposit = _react.useCallback.call(void 0, () => {
|
|
8513
8516
|
analytics.completeStep();
|
|
8514
8517
|
analytics.resetAttempt();
|
|
8515
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
8518
|
+
_optionalChain([onLifecycleRef, 'access', _296 => _296.current, 'optionalCall', _297 => _297({
|
|
8516
8519
|
type: "smart-account-changed",
|
|
8517
8520
|
evm: null,
|
|
8518
8521
|
solana: null
|
|
@@ -8543,17 +8546,17 @@ function DepositFlow({
|
|
|
8543
8546
|
forceRegister
|
|
8544
8547
|
]
|
|
8545
8548
|
);
|
|
8546
|
-
const desiredSetupRequestKey =
|
|
8549
|
+
const desiredSetupRequestKey = _chunkQGNJFDEOcjs.computeRequestKey.call(void 0, setupInput);
|
|
8547
8550
|
const setupReady = setupSlice.status === "ready" && setupSlice.requestKey === desiredSetupRequestKey;
|
|
8548
8551
|
_react.useEffect.call(void 0, () => {
|
|
8549
8552
|
void (async () => {
|
|
8550
|
-
const requestKey =
|
|
8551
|
-
const cacheKey =
|
|
8552
|
-
const cacheable =
|
|
8553
|
+
const requestKey = _chunkQGNJFDEOcjs.computeRequestKey.call(void 0, setupInput);
|
|
8554
|
+
const cacheKey = _chunkQGNJFDEOcjs.computeCacheKey.call(void 0, setupInput);
|
|
8555
|
+
const cacheable = _chunkQGNJFDEOcjs.computeIsCacheable.call(void 0, setupInput);
|
|
8553
8556
|
if (storeApi.getState().setup.requestKey === requestKey) {
|
|
8554
8557
|
return;
|
|
8555
8558
|
}
|
|
8556
|
-
const dedupedResult =
|
|
8559
|
+
const dedupedResult = _chunkQGNJFDEOcjs.readDedupedAccountSetupResult.call(void 0, requestKey);
|
|
8557
8560
|
if (dedupedResult) {
|
|
8558
8561
|
storeApi.dispatch({
|
|
8559
8562
|
type: "setup/started",
|
|
@@ -8579,7 +8582,7 @@ function DepositFlow({
|
|
|
8579
8582
|
cacheable
|
|
8580
8583
|
});
|
|
8581
8584
|
try {
|
|
8582
|
-
const result = await
|
|
8585
|
+
const result = await _chunkQGNJFDEOcjs.runAccountSetupDeduped.call(void 0,
|
|
8583
8586
|
setupInput,
|
|
8584
8587
|
{ service, debug },
|
|
8585
8588
|
requestKey
|
|
@@ -8594,7 +8597,7 @@ function DepositFlow({
|
|
|
8594
8597
|
}
|
|
8595
8598
|
});
|
|
8596
8599
|
} catch (error) {
|
|
8597
|
-
const message = error instanceof
|
|
8600
|
+
const message = error instanceof _chunkQGNJFDEOcjs.SetupError ? error.message : "Deposit service is temporarily unavailable. Please try again shortly.";
|
|
8598
8601
|
storeApi.dispatch({
|
|
8599
8602
|
type: "setup/failed",
|
|
8600
8603
|
requestKey,
|
|
@@ -8626,11 +8629,11 @@ function DepositFlow({
|
|
|
8626
8629
|
return;
|
|
8627
8630
|
}
|
|
8628
8631
|
storeApi.dispatch({ type: "portfolio/loading", network, address });
|
|
8629
|
-
const requestId = _optionalChain([readPortfolioEntry, 'call',
|
|
8632
|
+
const requestId = _optionalChain([readPortfolioEntry, 'call', _298 => _298(
|
|
8630
8633
|
storeApi.getState().portfolio,
|
|
8631
8634
|
network,
|
|
8632
8635
|
address
|
|
8633
|
-
), 'optionalAccess',
|
|
8636
|
+
), 'optionalAccess', _299 => _299.requestId]);
|
|
8634
8637
|
if (requestId === void 0) return;
|
|
8635
8638
|
void (async () => {
|
|
8636
8639
|
try {
|
|
@@ -8643,7 +8646,7 @@ function DepositFlow({
|
|
|
8643
8646
|
address,
|
|
8644
8647
|
requestId,
|
|
8645
8648
|
totalUsd: portfolio.totalUsd,
|
|
8646
|
-
chainIds:
|
|
8649
|
+
chainIds: _chunkQGNJFDEOcjs.chainIdsByValue.call(void 0, portfolio.tokens)
|
|
8647
8650
|
});
|
|
8648
8651
|
} catch (e39) {
|
|
8649
8652
|
storeApi.dispatch({
|
|
@@ -8667,7 +8670,7 @@ function DepositFlow({
|
|
|
8667
8670
|
{ type: "transaction_hash", value: data.txHash },
|
|
8668
8671
|
"transfer_tracking"
|
|
8669
8672
|
);
|
|
8670
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
8673
|
+
_optionalChain([onLifecycleRef, 'access', _300 => _300.current, 'optionalCall', _301 => _301({ type: "submitted", ...data })]);
|
|
8671
8674
|
},
|
|
8672
8675
|
[analytics, logFlow, onLifecycleRef]
|
|
8673
8676
|
);
|
|
@@ -8736,7 +8739,7 @@ function DepositFlow({
|
|
|
8736
8739
|
sourceDecimals: tokenAtSubmit.decimals,
|
|
8737
8740
|
inputAmountUsd: amountUsd
|
|
8738
8741
|
});
|
|
8739
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
8742
|
+
_optionalChain([onLifecycleRef, 'access', _302 => _302.current, 'optionalCall', _303 => _303({
|
|
8740
8743
|
type: "submitted",
|
|
8741
8744
|
txHash,
|
|
8742
8745
|
sourceChain: "solana",
|
|
@@ -8830,8 +8833,8 @@ function DepositFlow({
|
|
|
8830
8833
|
sourceChain: chainId,
|
|
8831
8834
|
sourceToken: token,
|
|
8832
8835
|
amount,
|
|
8833
|
-
sourceSymbol: _optionalChain([asset, 'optionalAccess',
|
|
8834
|
-
sourceDecimals: _optionalChain([asset, 'optionalAccess',
|
|
8836
|
+
sourceSymbol: _optionalChain([asset, 'optionalAccess', _304 => _304.symbol]),
|
|
8837
|
+
sourceDecimals: _optionalChain([asset, 'optionalAccess', _305 => _305.decimals]),
|
|
8835
8838
|
inputAmountUsd: _nullishCoalesce(depositAtSubmit.inputAmountUsd, () => ( void 0)),
|
|
8836
8839
|
directTransfer: routed.directTransfer,
|
|
8837
8840
|
sourceTxHashPending: routed.sourceTxHashPending,
|
|
@@ -8872,7 +8875,7 @@ function DepositFlow({
|
|
|
8872
8875
|
swappedContext,
|
|
8873
8876
|
initialEvent: info.initialEvent
|
|
8874
8877
|
});
|
|
8875
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
8878
|
+
_optionalChain([onLifecycleRef, 'access', _306 => _306.current, 'optionalCall', _307 => _307({
|
|
8876
8879
|
type: "submitted",
|
|
8877
8880
|
txHash: info.txHash,
|
|
8878
8881
|
sourceChain: SWAPPED_SOURCE_CHAIN,
|
|
@@ -8900,12 +8903,12 @@ function DepositFlow({
|
|
|
8900
8903
|
const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
|
|
8901
8904
|
(txHash, sourceChain, amount) => {
|
|
8902
8905
|
const depositAtSubmit = storeApi.getState().deposit;
|
|
8903
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
8906
|
+
_optionalChain([onLifecycleRef, 'access', _308 => _308.current, 'optionalCall', _309 => _309({
|
|
8904
8907
|
type: "submitted",
|
|
8905
8908
|
txHash,
|
|
8906
8909
|
sourceChain,
|
|
8907
8910
|
amount,
|
|
8908
|
-
sourceDecimals: _optionalChain([depositAtSubmit, 'access',
|
|
8911
|
+
sourceDecimals: _optionalChain([depositAtSubmit, 'access', _310 => _310.selectedAsset, 'optionalAccess', _311 => _311.decimals]),
|
|
8909
8912
|
amountUsd: _nullishCoalesce(depositAtSubmit.inputAmountUsd, () => ( void 0))
|
|
8910
8913
|
})]);
|
|
8911
8914
|
},
|
|
@@ -8918,7 +8921,7 @@ function DepositFlow({
|
|
|
8918
8921
|
analyticsStepForFlowStep(analyticsMethod, "processing")
|
|
8919
8922
|
);
|
|
8920
8923
|
analytics.outcome("completed");
|
|
8921
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
8924
|
+
_optionalChain([onLifecycleRef, 'access', _312 => _312.current, 'optionalCall', _313 => _313({
|
|
8922
8925
|
type: "complete",
|
|
8923
8926
|
txHash,
|
|
8924
8927
|
destinationTxHash,
|
|
@@ -8935,7 +8938,7 @@ function DepositFlow({
|
|
|
8935
8938
|
);
|
|
8936
8939
|
analytics.outcome("failed");
|
|
8937
8940
|
analytics.failure("processor_failed", false);
|
|
8938
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
8941
|
+
_optionalChain([onLifecycleRef, 'access', _314 => _314.current, 'optionalCall', _315 => _315({ type: "failed", txHash, error })]);
|
|
8939
8942
|
},
|
|
8940
8943
|
[analytics, analyticsMethod, logFlowError, onLifecycleRef]
|
|
8941
8944
|
);
|
|
@@ -8956,7 +8959,7 @@ function DepositFlow({
|
|
|
8956
8959
|
failureStep
|
|
8957
8960
|
);
|
|
8958
8961
|
}
|
|
8959
|
-
_optionalChain([onErrorRef, 'access',
|
|
8962
|
+
_optionalChain([onErrorRef, 'access', _316 => _316.current, 'optionalCall', _317 => _317({ message, code, cause })]);
|
|
8960
8963
|
},
|
|
8961
8964
|
[analytics, logFlowError, onErrorRef]
|
|
8962
8965
|
);
|
|
@@ -9005,9 +9008,9 @@ function DepositFlow({
|
|
|
9005
9008
|
address: _nullishCoalesce(_nullishCoalesce(option.address, () => ( option.solanaAddress)), () => ( option.id)),
|
|
9006
9009
|
state,
|
|
9007
9010
|
errorReason: _nullishCoalesce(entry.message, () => ( void 0)),
|
|
9008
|
-
balanceStatus: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess',
|
|
9009
|
-
balanceUsd: _optionalChain([portfolioEntry, 'optionalAccess',
|
|
9010
|
-
balanceChainIds: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess',
|
|
9011
|
+
balanceStatus: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess', _318 => _318.status]), () => ( "loading")),
|
|
9012
|
+
balanceUsd: _optionalChain([portfolioEntry, 'optionalAccess', _319 => _319.status]) === "ready" ? portfolioEntry.totalUsd : null,
|
|
9013
|
+
balanceChainIds: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess', _320 => _320.chainIds]), () => ( []))
|
|
9011
9014
|
};
|
|
9012
9015
|
});
|
|
9013
9016
|
}, [enableWallet, walletOptions, setupSlice, portfolioSlice]);
|
|
@@ -9188,7 +9191,7 @@ function DepositFlow({
|
|
|
9188
9191
|
consumePrefetchedUrl: consumeSwappedWidgetUrlPrefetch,
|
|
9189
9192
|
onSwappedComplete: handleSwappedComplete,
|
|
9190
9193
|
onSwappedFailed: handleDepositFailed,
|
|
9191
|
-
onClose: () => _optionalChain([onClose, 'optionalCall',
|
|
9194
|
+
onClose: () => _optionalChain([onClose, 'optionalCall', _321 => _321(
|
|
9192
9195
|
openExternally ? "native_dismiss_request" : "header_button"
|
|
9193
9196
|
)]),
|
|
9194
9197
|
onGoBack: handleProviderBack,
|
|
@@ -9202,7 +9205,7 @@ function DepositFlow({
|
|
|
9202
9205
|
}
|
|
9203
9206
|
),
|
|
9204
9207
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9205
|
-
|
|
9208
|
+
_chunkQGNJFDEOcjs.ProcessingStep,
|
|
9206
9209
|
{
|
|
9207
9210
|
smartAccount: step.smartAccount,
|
|
9208
9211
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
@@ -9268,7 +9271,7 @@ function DepositFlow({
|
|
|
9268
9271
|
loadUrl: () => loadSwappedConnectUrl(step.smartAccount, step.connection),
|
|
9269
9272
|
onSwappedComplete: handleSwappedComplete,
|
|
9270
9273
|
onSwappedFailed: handleDepositFailed,
|
|
9271
|
-
onClose: () => _optionalChain([onClose, 'optionalCall',
|
|
9274
|
+
onClose: () => _optionalChain([onClose, 'optionalCall', _322 => _322(
|
|
9272
9275
|
openExternally ? "native_dismiss_request" : "header_button"
|
|
9273
9276
|
)]),
|
|
9274
9277
|
onGoBack: handleProviderBack,
|
|
@@ -9282,7 +9285,7 @@ function DepositFlow({
|
|
|
9282
9285
|
}
|
|
9283
9286
|
),
|
|
9284
9287
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9285
|
-
|
|
9288
|
+
_chunkQGNJFDEOcjs.ProcessingStep,
|
|
9286
9289
|
{
|
|
9287
9290
|
smartAccount: step.smartAccount,
|
|
9288
9291
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
@@ -9317,8 +9320,8 @@ function DepositFlow({
|
|
|
9317
9320
|
);
|
|
9318
9321
|
}
|
|
9319
9322
|
if (isSolanaWalletMode) {
|
|
9320
|
-
const solanaAddr = _optionalChain([walletSession, 'optionalAccess',
|
|
9321
|
-
const solanaProvider = _optionalChain([walletSession, 'optionalAccess',
|
|
9323
|
+
const solanaAddr = _optionalChain([walletSession, 'optionalAccess', _323 => _323.solanaAddress]);
|
|
9324
|
+
const solanaProvider = _optionalChain([walletSession, 'optionalAccess', _324 => _324.solanaProvider]);
|
|
9322
9325
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
9323
9326
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9324
9327
|
AccountPreparingSkeleton,
|
|
@@ -9369,7 +9372,7 @@ function DepositFlow({
|
|
|
9369
9372
|
targetToken,
|
|
9370
9373
|
service,
|
|
9371
9374
|
solanaProvider,
|
|
9372
|
-
solanaConnection: _optionalChain([walletSession, 'optionalAccess',
|
|
9375
|
+
solanaConnection: _optionalChain([walletSession, 'optionalAccess', _325 => _325.solanaConnection]),
|
|
9373
9376
|
uiConfig,
|
|
9374
9377
|
onConfirm: handleSolanaConfirmed,
|
|
9375
9378
|
onError: handleError,
|
|
@@ -9411,7 +9414,7 @@ function DepositFlow({
|
|
|
9411
9414
|
) })
|
|
9412
9415
|
] }) : null,
|
|
9413
9416
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9414
|
-
|
|
9417
|
+
_chunkQGNJFDEOcjs.ProcessingStep,
|
|
9415
9418
|
{
|
|
9416
9419
|
smartAccount: effectiveStep.smartAccount,
|
|
9417
9420
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
@@ -9450,7 +9453,7 @@ function DepositFlow({
|
|
|
9450
9453
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9451
9454
|
DappImportAssetSelectSkeleton,
|
|
9452
9455
|
{
|
|
9453
|
-
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportProvider, 'optionalAccess',
|
|
9456
|
+
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportProvider, 'optionalAccess', _326 => _326.sourceLabel]), () => ( "")),
|
|
9454
9457
|
error: dappImportBootError,
|
|
9455
9458
|
onRetry: handleBootRetry
|
|
9456
9459
|
}
|
|
@@ -9472,7 +9475,7 @@ function DepositFlow({
|
|
|
9472
9475
|
rows: dappImportSelectRows,
|
|
9473
9476
|
onRequestConnect: _nullishCoalesce(onConnect, () => ( onRequestConnect)),
|
|
9474
9477
|
onSelect: (providerId) => {
|
|
9475
|
-
const availabilityEntry = dappImportOwner && _optionalChain([dappImportAvailabilityOwner, 'optionalAccess',
|
|
9478
|
+
const availabilityEntry = dappImportOwner && _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _327 => _327.toLowerCase, 'call', _328 => _328()]) === dappImportOwner.toLowerCase() ? dappImportAvailability[providerId] : void 0;
|
|
9476
9479
|
if (availabilityEntry === "error") {
|
|
9477
9480
|
storeApi.dispatch({
|
|
9478
9481
|
type: "dapp-import/availability-retry-requested"
|
|
@@ -9491,16 +9494,16 @@ function DepositFlow({
|
|
|
9491
9494
|
}
|
|
9492
9495
|
);
|
|
9493
9496
|
}
|
|
9494
|
-
if (!_optionalChain([signerContext, 'optionalAccess',
|
|
9497
|
+
if (!_optionalChain([signerContext, 'optionalAccess', _329 => _329.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _330 => _330.publicClient])) {
|
|
9495
9498
|
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" }) }) }) }) });
|
|
9496
9499
|
}
|
|
9497
9500
|
const ownerAddress = signerContext.ownerAddress;
|
|
9498
|
-
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access',
|
|
9501
|
+
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _331 => _331.walletClient, 'optionalAccess', _332 => _332.chain, 'optionalAccess', _333 => _333.id]), () => ( _optionalChain([signerContext, 'access', _334 => _334.publicClient, 'access', _335 => _335.chain, 'optionalAccess', _336 => _336.id]))), () => ( setupChainId));
|
|
9499
9502
|
const getReadClientForChain = (chainId) => {
|
|
9500
|
-
if (_optionalChain([signerContext, 'access',
|
|
9503
|
+
if (_optionalChain([signerContext, 'access', _337 => _337.publicClient, 'access', _338 => _338.chain, 'optionalAccess', _339 => _339.id]) === chainId) {
|
|
9501
9504
|
return signerContext.publicClient;
|
|
9502
9505
|
}
|
|
9503
|
-
return
|
|
9506
|
+
return _chunkQGNJFDEOcjs.getPublicClient.call(void 0, chainId, rpcUrls);
|
|
9504
9507
|
};
|
|
9505
9508
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
9506
9509
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -9526,9 +9529,9 @@ function DepositFlow({
|
|
|
9526
9529
|
effectiveStep.type === "dapp-import-asset-select" && activeDappImportProvider && activeDappImportAvailability && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9527
9530
|
DappImportAssetSelectStep,
|
|
9528
9531
|
{
|
|
9529
|
-
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access',
|
|
9532
|
+
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access', _340 => _340.assets, 'access', _341 => _341[0], 'optionalAccess', _342 => _342.sourceLabel]), () => ( activeDappImportProvider.sourceLabel)),
|
|
9530
9533
|
assets: activeDappImportAvailability.assets,
|
|
9531
|
-
incompleteSummary: _optionalChain([activeDappImportAvailability, 'access',
|
|
9534
|
+
incompleteSummary: _optionalChain([activeDappImportAvailability, 'access', _343 => _343.incomplete, 'optionalAccess', _344 => _344.summary]),
|
|
9532
9535
|
onSelect: handleDappImportAssetSelected
|
|
9533
9536
|
}
|
|
9534
9537
|
),
|
|
@@ -9603,7 +9606,7 @@ function DepositFlow({
|
|
|
9603
9606
|
}
|
|
9604
9607
|
),
|
|
9605
9608
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9606
|
-
|
|
9609
|
+
_chunkQGNJFDEOcjs.ProcessingStep,
|
|
9607
9610
|
{
|
|
9608
9611
|
smartAccount: effectiveStep.smartAccount,
|
|
9609
9612
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
@@ -9643,7 +9646,7 @@ function DepositFlow({
|
|
|
9643
9646
|
|
|
9644
9647
|
var ReownDepositInner = _react.lazy.call(void 0, async () => {
|
|
9645
9648
|
await loadReownDependencies();
|
|
9646
|
-
const module = await Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
9649
|
+
const module = await Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-6CXXGQ7X.cjs")));
|
|
9647
9650
|
return { default: module.DepositModalReown };
|
|
9648
9651
|
});
|
|
9649
9652
|
function buildDepositAnalyticsSessionProperties({
|
|
@@ -9672,7 +9675,7 @@ function buildDepositAnalyticsSessionProperties({
|
|
|
9672
9675
|
enabledFundingMethods.push("wallet");
|
|
9673
9676
|
}
|
|
9674
9677
|
if (enableQrTransfer) enabledFundingMethods.push("transfer");
|
|
9675
|
-
if (enableFiatOnramp && _optionalChain([configuredFiatIdentifiers, 'optionalAccess',
|
|
9678
|
+
if (enableFiatOnramp && _optionalChain([configuredFiatIdentifiers, 'optionalAccess', _345 => _345.length]) !== 0) {
|
|
9676
9679
|
enabledFundingMethods.push("fiat_onramp");
|
|
9677
9680
|
}
|
|
9678
9681
|
if (enableExchangeConnect) enabledFundingMethods.push("exchange_connect");
|
|
@@ -9692,7 +9695,7 @@ function buildDepositAnalyticsSessionProperties({
|
|
|
9692
9695
|
amount: defaultAmount !== void 0,
|
|
9693
9696
|
initial_asset_migration: initialAssetMigration !== void 0
|
|
9694
9697
|
},
|
|
9695
|
-
...
|
|
9698
|
+
..._chunkQGNJFDEOcjs.analyticsTargetProperties.call(void 0, { targetChain, targetToken })
|
|
9696
9699
|
};
|
|
9697
9700
|
}
|
|
9698
9701
|
var WALLET_CLIENT_PROP = "walletClient";
|
|
@@ -9700,8 +9703,8 @@ function hasSuppliedWalletClient(props) {
|
|
|
9700
9703
|
return Object.prototype.hasOwnProperty.call(props, WALLET_CLIENT_PROP);
|
|
9701
9704
|
}
|
|
9702
9705
|
function DepositModal(props) {
|
|
9703
|
-
|
|
9704
|
-
|
|
9706
|
+
_chunkQGNJFDEOcjs.warnRemovedProps.call(void 0, "DepositModal", props);
|
|
9707
|
+
_chunkQGNJFDEOcjs.checkBackendUrl.call(void 0, "DepositModal", props.backendUrl);
|
|
9705
9708
|
const needsReown = !!props.reownAppId;
|
|
9706
9709
|
const hasWalletClientProp = hasSuppliedWalletClient(props);
|
|
9707
9710
|
if (needsReown) {
|
|
@@ -9773,8 +9776,8 @@ function DepositModalInner({
|
|
|
9773
9776
|
const analyticsControllerRef = _react.useRef.call(void 0, null);
|
|
9774
9777
|
const analyticsSessionIdRef = _react.useRef.call(void 0, null);
|
|
9775
9778
|
const previousOpenRef = _react.useRef.call(void 0, isOpen);
|
|
9776
|
-
const onReadyRef =
|
|
9777
|
-
const onUiStateRef =
|
|
9779
|
+
const onReadyRef = _chunkQGNJFDEOcjs.useLatestRef.call(void 0, onReady);
|
|
9780
|
+
const onUiStateRef = _chunkQGNJFDEOcjs.useLatestRef.call(void 0, onUiState);
|
|
9778
9781
|
const [currentScreen, setCurrentScreen] = _react.useState.call(void 0, "connect");
|
|
9779
9782
|
const [swappedImmersive, setSwappedImmersive] = _react.useState.call(void 0, false);
|
|
9780
9783
|
const [submitting, setSubmitting] = _react.useState.call(void 0, false);
|
|
@@ -9782,30 +9785,30 @@ function DepositModalInner({
|
|
|
9782
9785
|
void 0
|
|
9783
9786
|
);
|
|
9784
9787
|
const [processingSettled, setProcessingSettled] = _react.useState.call(void 0, false);
|
|
9785
|
-
const historyButtonVisible =
|
|
9788
|
+
const historyButtonVisible = _chunkQGNJFDEOcjs.isHistoryEntryVisible.call(void 0, {
|
|
9786
9789
|
screen: currentScreen,
|
|
9787
9790
|
submitting,
|
|
9788
9791
|
settled: processingSettled
|
|
9789
9792
|
});
|
|
9790
9793
|
const targetChain = typeof targetChainProp === "string" ? targetChainProp : _chunkOY5N3E6Lcjs.getChainId.call(void 0, targetChainProp);
|
|
9791
9794
|
const sourceChain = sourceChainProp ? _chunkOY5N3E6Lcjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
9792
|
-
const rpcUrls =
|
|
9795
|
+
const rpcUrls = _chunkQGNJFDEOcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
|
|
9793
9796
|
const service = _react.useMemo.call(void 0,
|
|
9794
|
-
() =>
|
|
9797
|
+
() => _chunkQGNJFDEOcjs.createDepositService.call(void 0, backendUrl, {
|
|
9795
9798
|
debug,
|
|
9796
9799
|
debugScope: "service:deposit"
|
|
9797
9800
|
}),
|
|
9798
9801
|
[backendUrl, debug]
|
|
9799
9802
|
);
|
|
9800
9803
|
const historyAnalytics = _react.useMemo.call(void 0,
|
|
9801
|
-
() =>
|
|
9804
|
+
() => _chunkQGNJFDEOcjs.createHistoryAnalytics.call(void 0, {
|
|
9802
9805
|
modal: "deposit",
|
|
9803
9806
|
controllerRef: analyticsControllerRef,
|
|
9804
9807
|
sessionIdRef: analyticsSessionIdRef
|
|
9805
9808
|
}),
|
|
9806
9809
|
[]
|
|
9807
9810
|
);
|
|
9808
|
-
const history =
|
|
9811
|
+
const history = _chunkQGNJFDEOcjs.useHistoryPanel.call(void 0, {
|
|
9809
9812
|
isOpen,
|
|
9810
9813
|
recipient,
|
|
9811
9814
|
service,
|
|
@@ -9845,15 +9848,15 @@ function DepositModalInner({
|
|
|
9845
9848
|
}, [store, targetChain, targetToken]);
|
|
9846
9849
|
_react.useEffect.call(void 0, () => {
|
|
9847
9850
|
if (!isOpen || !modalRef.current) return;
|
|
9848
|
-
return
|
|
9851
|
+
return _chunkQGNJFDEOcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
9849
9852
|
}, [isOpen, theme]);
|
|
9850
9853
|
_react.useEffect.call(void 0, () => {
|
|
9851
9854
|
if (isOpen) {
|
|
9852
|
-
_optionalChain([onReadyRef, 'access',
|
|
9855
|
+
_optionalChain([onReadyRef, 'access', _346 => _346.current, 'optionalCall', _347 => _347()]);
|
|
9853
9856
|
}
|
|
9854
9857
|
}, [isOpen, onReadyRef]);
|
|
9855
9858
|
_react.useEffect.call(void 0, () => {
|
|
9856
|
-
_optionalChain([onUiStateRef, 'access',
|
|
9859
|
+
_optionalChain([onUiStateRef, 'access', _348 => _348.current, 'optionalCall', _349 => _349({
|
|
9857
9860
|
screen: currentScreen,
|
|
9858
9861
|
back: backHandler,
|
|
9859
9862
|
// A recovery in flight is a submission whose outcome is unknown, so a
|
|
@@ -9874,10 +9877,10 @@ function DepositModalInner({
|
|
|
9874
9877
|
},
|
|
9875
9878
|
[]
|
|
9876
9879
|
);
|
|
9877
|
-
const onLifecycleRef =
|
|
9880
|
+
const onLifecycleRef = _chunkQGNJFDEOcjs.useLatestRef.call(void 0, onLifecycle);
|
|
9878
9881
|
const handleLifecycle = _react.useCallback.call(void 0,
|
|
9879
9882
|
(event) => {
|
|
9880
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
9883
|
+
_optionalChain([onLifecycleRef, 'access', _350 => _350.current, 'optionalCall', _351 => _351(event)]);
|
|
9881
9884
|
if (event.type === "smart-account-changed" && !event.evm && !event.solana) {
|
|
9882
9885
|
invalidateHistory();
|
|
9883
9886
|
}
|
|
@@ -9891,8 +9894,8 @@ function DepositModalInner({
|
|
|
9891
9894
|
(source) => {
|
|
9892
9895
|
if (recoverySubmitting) return;
|
|
9893
9896
|
const analytics = analyticsControllerRef.current;
|
|
9894
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
9895
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
9897
|
+
_optionalChain([analytics, 'optionalAccess', _352 => _352.abandon, 'call', _353 => _353(source === "provider_back" ? "provider_back" : "modal_close")]);
|
|
9898
|
+
_optionalChain([analytics, 'optionalAccess', _354 => _354.close, 'call', _355 => _355(source)]);
|
|
9896
9899
|
onClose();
|
|
9897
9900
|
},
|
|
9898
9901
|
[onClose, recoverySubmitting]
|
|
@@ -9908,8 +9911,8 @@ function DepositModalInner({
|
|
|
9908
9911
|
_react.useEffect.call(void 0, () => {
|
|
9909
9912
|
if (previousOpenRef.current && !isOpen) {
|
|
9910
9913
|
const analytics = analyticsControllerRef.current;
|
|
9911
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
9912
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
9914
|
+
_optionalChain([analytics, 'optionalAccess', _356 => _356.abandon, 'call', _357 => _357("modal_close")]);
|
|
9915
|
+
_optionalChain([analytics, 'optionalAccess', _358 => _358.close, 'call', _359 => _359("host_controlled")]);
|
|
9913
9916
|
}
|
|
9914
9917
|
previousOpenRef.current = isOpen;
|
|
9915
9918
|
}, [isOpen]);
|
|
@@ -9946,12 +9949,12 @@ function DepositModalInner({
|
|
|
9946
9949
|
targetChain,
|
|
9947
9950
|
targetToken
|
|
9948
9951
|
});
|
|
9949
|
-
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
9952
|
+
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _360 => _360.showBackButton]), () => ( true));
|
|
9950
9953
|
const canGoBack = backHandler !== void 0;
|
|
9951
9954
|
const hideHeaderChrome = swappedImmersive;
|
|
9952
9955
|
const modalClassName = `rs-modal${hideHeaderChrome ? " rs-modal--swapped-iframe" : ""}`;
|
|
9953
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9954
|
-
|
|
9956
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.ChainCatalogProvider, { service, rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9957
|
+
_chunkQGNJFDEOcjs.Modal,
|
|
9955
9958
|
{
|
|
9956
9959
|
isOpen,
|
|
9957
9960
|
onClose: handleModalDismiss,
|
|
@@ -9960,7 +9963,7 @@ function DepositModalInner({
|
|
|
9960
9963
|
closeOnOverlayClick,
|
|
9961
9964
|
ariaLabel: "Deposit",
|
|
9962
9965
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9963
|
-
|
|
9966
|
+
_chunkQGNJFDEOcjs.AnalyticsSession,
|
|
9964
9967
|
{
|
|
9965
9968
|
modal: "deposit",
|
|
9966
9969
|
sessionProperties: analyticsSessionProperties,
|
|
@@ -9982,12 +9985,12 @@ function DepositModalInner({
|
|
|
9982
9985
|
className: "rs-modal-header-back",
|
|
9983
9986
|
"aria-label": "Go back",
|
|
9984
9987
|
onClick: backHandler,
|
|
9985
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9988
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.ChevronLeftIcon, {})
|
|
9986
9989
|
}
|
|
9987
9990
|
) }),
|
|
9988
9991
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
|
|
9989
9992
|
historyButtonVisible && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9990
|
-
|
|
9993
|
+
_chunkQGNJFDEOcjs.HistoryEntryButton,
|
|
9991
9994
|
{
|
|
9992
9995
|
badge: history.badge,
|
|
9993
9996
|
onClick: history.openPanel,
|
|
@@ -10001,7 +10004,7 @@ function DepositModalInner({
|
|
|
10001
10004
|
onClick: () => closeWithSource("header_button"),
|
|
10002
10005
|
className: "rs-modal-close",
|
|
10003
10006
|
"aria-label": "Close",
|
|
10004
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
10007
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQGNJFDEOcjs.CloseIcon, {})
|
|
10005
10008
|
}
|
|
10006
10009
|
)
|
|
10007
10010
|
] })
|
|
@@ -10037,7 +10040,7 @@ function DepositModalInner({
|
|
|
10037
10040
|
onDisconnect,
|
|
10038
10041
|
onRequestConnect,
|
|
10039
10042
|
uiConfig,
|
|
10040
|
-
appFees: _optionalChain([clientSetup, 'optionalAccess',
|
|
10043
|
+
appFees: _optionalChain([clientSetup, 'optionalAccess', _361 => _361.appFees]),
|
|
10041
10044
|
appFeesResolved: clientSetup !== null,
|
|
10042
10045
|
onStepChange: handleStepChange,
|
|
10043
10046
|
onSwappedImmersiveChange: setSwappedImmersive,
|
|
@@ -10051,7 +10054,7 @@ function DepositModalInner({
|
|
|
10051
10054
|
}
|
|
10052
10055
|
),
|
|
10053
10056
|
history.isPanelOpen && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
10054
|
-
|
|
10057
|
+
_chunkQGNJFDEOcjs.HistoryOverlay,
|
|
10055
10058
|
{
|
|
10056
10059
|
controller: history,
|
|
10057
10060
|
backLabel: "Deposit",
|