@rhinestone/deposit-modal 0.17.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +109 -0
- package/dist/{DepositModalReown-6CXXGQ7X.cjs → DepositModalReown-UITYXJ6W.cjs} +17 -17
- package/dist/{DepositModalReown-ELDSTIME.mjs → DepositModalReown-XBNY6QCI.mjs} +4 -4
- package/dist/{WithdrawModal-QRMDR5T4.mjs → WithdrawModal-DY6A55OA.mjs} +3 -3
- package/dist/WithdrawModal-V42OK7L3.cjs +11 -0
- package/dist/bearer-transport-CVHNBgoV.d.cts +14 -0
- package/dist/bearer-transport-CVHNBgoV.d.ts +14 -0
- package/dist/{chunk-QMGEK623.mjs → chunk-5NWLS5BQ.mjs} +536 -225
- package/dist/chunk-ADEWTBSN.cjs +19 -0
- package/dist/{chunk-ZHX4QROC.mjs → chunk-BIL4ENC3.mjs} +1 -1
- package/dist/{chunk-2W4BJ5I3.cjs → chunk-EG4H7OMC.cjs} +71 -71
- package/dist/{chunk-QGNJFDEO.cjs → chunk-HMUGY66O.cjs} +690 -379
- package/dist/chunk-ISLVD5HQ.cjs +41 -0
- package/dist/{chunk-H66WM5AO.mjs → chunk-NITKDXHR.mjs} +388 -95
- package/dist/{chunk-XJMDCBHS.cjs → chunk-OCWSMLOP.cjs} +862 -569
- package/dist/chunk-PP4QE32S.mjs +19 -0
- package/dist/{chunk-JCWJ6HW7.cjs → chunk-PYOC6K24.cjs} +1 -1
- package/dist/{chunk-XCBDJPBD.mjs → chunk-X6N2XPTO.mjs} +1 -1
- package/dist/chunk-ZGHVJ2XM.mjs +41 -0
- package/dist/compliance.cjs +14 -0
- package/dist/compliance.d.cts +10 -0
- package/dist/compliance.d.ts +10 -0
- package/dist/compliance.mjs +14 -0
- package/dist/constants.cjs +3 -3
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.mjs +3 -3
- package/dist/deposit.cjs +4 -4
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +3 -3
- package/dist/embed.cjs +16 -16
- package/dist/embed.d.cts +1 -1
- package/dist/embed.d.ts +1 -1
- package/dist/embed.mjs +8 -8
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +4 -4
- package/dist/offramp.cjs +25 -0
- package/dist/offramp.d.cts +28 -0
- package/dist/offramp.d.ts +28 -0
- package/dist/offramp.mjs +25 -0
- package/dist/onramp.cjs +40 -0
- package/dist/onramp.d.cts +55 -0
- package/dist/onramp.d.ts +55 -0
- package/dist/onramp.mjs +40 -0
- package/dist/ramp-types-C6aUz4SZ.d.cts +43 -0
- package/dist/ramp-types-C6aUz4SZ.d.ts +43 -0
- package/dist/server.cjs +54 -2
- package/dist/server.d.cts +13 -1
- package/dist/server.d.ts +13 -1
- package/dist/server.mjs +52 -0
- package/dist/styles.css +25 -0
- package/dist/{types-B9SbZQIG.d.ts → types-BOxa1DE-.d.ts} +40 -4
- package/dist/{types-SwGGf0eH.d.cts → types-BShYNpvO.d.cts} +40 -4
- package/dist/withdraw.cjs +4 -4
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +3 -3
- package/package.json +35 -5
- package/dist/WithdrawModal-QB2U756L.cjs +0 -11
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
+
var _chunkLVCD6RHFcjs = require('./chunk-LVCD6RHF.cjs');
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
12
16
|
|
|
13
17
|
|
|
14
18
|
|
|
@@ -87,7 +91,6 @@
|
|
|
87
91
|
|
|
88
92
|
|
|
89
93
|
|
|
90
|
-
var _chunkQGNJFDEOcjs = require('./chunk-QGNJFDEO.cjs');
|
|
91
94
|
|
|
92
95
|
|
|
93
96
|
|
|
@@ -99,10 +102,12 @@ var _chunkQGNJFDEOcjs = require('./chunk-QGNJFDEO.cjs');
|
|
|
99
102
|
|
|
100
103
|
|
|
101
104
|
|
|
102
|
-
var _chunkLVCD6RHFcjs = require('./chunk-LVCD6RHF.cjs');
|
|
103
105
|
|
|
104
106
|
|
|
105
107
|
|
|
108
|
+
var _chunkHMUGY66Ocjs = require('./chunk-HMUGY66O.cjs');
|
|
109
|
+
|
|
110
|
+
|
|
106
111
|
|
|
107
112
|
|
|
108
113
|
|
|
@@ -245,11 +250,11 @@ SegmentedToggle.displayName = "SegmentedToggle";
|
|
|
245
250
|
|
|
246
251
|
function ChainIcon({ chainId, className, loading }) {
|
|
247
252
|
const badge = _chunkOY5N3E6Lcjs.getChainBadge.call(void 0, chainId);
|
|
248
|
-
const catalogChain =
|
|
253
|
+
const catalogChain = _chunkHMUGY66Ocjs.useCatalogChain.call(void 0, _chunkHMUGY66Ocjs.catalogKeyForChain.call(void 0, chainId));
|
|
249
254
|
const name = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _2 => _2.name]), () => ( _chunkOY5N3E6Lcjs.getChainName.call(void 0, chainId)));
|
|
250
255
|
const initial = (_nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _3 => _3.name]), () => ( badge.shortLabel))).charAt(0);
|
|
251
256
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
252
|
-
|
|
257
|
+
_chunkHMUGY66Ocjs.CdnIcon,
|
|
253
258
|
{
|
|
254
259
|
src: _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _4 => _4.iconUrl]), () => ( _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, chainId))),
|
|
255
260
|
alt: name,
|
|
@@ -272,7 +277,7 @@ ChainIcon.displayName = "ChainIcon";
|
|
|
272
277
|
// src/components/ui/WalletBadgeIcons/index.tsx
|
|
273
278
|
|
|
274
279
|
function BadgeImage({ src, alt = "" }) {
|
|
275
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
280
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.CdnIcon, { src, alt }) });
|
|
276
281
|
}
|
|
277
282
|
var WALLET_BADGES = ["rabby", "phantom", "walletconnect"];
|
|
278
283
|
function WalletBadgeIcons() {
|
|
@@ -325,7 +330,7 @@ var DAPP_IMPORT_CATALOG = [
|
|
|
325
330
|
// src/components/ui/BrandIcons.tsx
|
|
326
331
|
|
|
327
332
|
function ExchangeBadgeImage({ name }) {
|
|
328
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
333
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.CdnIcon, { src: _nullishCoalesce(_chunkHMUGY66Ocjs.getExchangeLogoSrc.call(void 0, name), () => ( void 0)) });
|
|
329
334
|
}
|
|
330
335
|
var CARD_NETWORKS = ["amex", "visa", "mastercard"];
|
|
331
336
|
function CardNetworkIcons() {
|
|
@@ -333,7 +338,7 @@ function CardNetworkIcons() {
|
|
|
333
338
|
"span",
|
|
334
339
|
{
|
|
335
340
|
className: `rs-card-network rs-card-network--${network}`,
|
|
336
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
341
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.CdnIcon, { src: _chunkOY5N3E6Lcjs.cdnIconUrl.call(void 0, "cards", network) })
|
|
337
342
|
},
|
|
338
343
|
network
|
|
339
344
|
)) });
|
|
@@ -352,7 +357,7 @@ function DappBadgeIcons() {
|
|
|
352
357
|
).filter(
|
|
353
358
|
(brand) => Boolean(brand)
|
|
354
359
|
);
|
|
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,
|
|
360
|
+
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, _chunkHMUGY66Ocjs.CdnIcon, { src: brand.iconUrl, alt: brand.label }) }, brand.id)) });
|
|
356
361
|
}
|
|
357
362
|
DappBadgeIcons.displayName = "DappBadgeIcons";
|
|
358
363
|
var DAPP_BADGE_COUNT = DAPP_BADGE_ORDER.length;
|
|
@@ -372,9 +377,9 @@ function balanceSubtitle(status, balanceUsd, fallback) {
|
|
|
372
377
|
return "No balance";
|
|
373
378
|
}
|
|
374
379
|
function fiatIcon(name) {
|
|
375
|
-
if (name === "apple") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
376
|
-
if (name === "bank") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
377
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
380
|
+
if (name === "apple") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.AppleIcon, {});
|
|
381
|
+
if (name === "bank") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.BankIcon, {});
|
|
382
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.CardIcon, {});
|
|
378
383
|
}
|
|
379
384
|
function FiatMethodIcon({ option }) {
|
|
380
385
|
const [remoteFailed, setRemoteFailed] = _react.useState.call(void 0, false);
|
|
@@ -457,20 +462,20 @@ function renderWalletLeading(row) {
|
|
|
457
462
|
}
|
|
458
463
|
);
|
|
459
464
|
}
|
|
460
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
465
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.WalletIcon, {});
|
|
461
466
|
}
|
|
462
|
-
var TRANSFER_CRYPTO_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
463
|
-
var WALLET_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
464
|
-
var EXCHANGE_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
465
|
-
var MIGRATE_ASSETS_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
466
|
-
var SMALL_SPINNER = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
467
|
+
var TRANSFER_CRYPTO_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.TransferCryptoIcon, {});
|
|
468
|
+
var WALLET_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.WalletIcon, {});
|
|
469
|
+
var EXCHANGE_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.UnplugIcon, {});
|
|
470
|
+
var MIGRATE_ASSETS_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.MigrateAssetsIcon, {});
|
|
471
|
+
var SMALL_SPINNER = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.Spinner, { className: "rs-spinner--sm" });
|
|
467
472
|
var CONNECT_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
468
473
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, WalletBadgeIcons, {}),
|
|
469
474
|
"+100"
|
|
470
475
|
] });
|
|
471
476
|
var EXTRA_EXCHANGE_COUNT = Math.max(
|
|
472
477
|
0,
|
|
473
|
-
|
|
478
|
+
_chunkHMUGY66Ocjs.SUPPORTED_CONNECT_EXCHANGE_COUNT - EXCHANGE_BADGE_COUNT
|
|
474
479
|
);
|
|
475
480
|
var EXCHANGE_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
476
481
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExchangeBadgeIcons, {}),
|
|
@@ -528,7 +533,7 @@ function ConnectStep({
|
|
|
528
533
|
if (onSelectTransferCrypto) {
|
|
529
534
|
cryptoRows.push(
|
|
530
535
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
531
|
-
|
|
536
|
+
_chunkHMUGY66Ocjs.ListRow,
|
|
532
537
|
{
|
|
533
538
|
leading: TRANSFER_CRYPTO_LEADING,
|
|
534
539
|
title: "Transfer crypto",
|
|
@@ -549,7 +554,7 @@ function ConnectStep({
|
|
|
549
554
|
);
|
|
550
555
|
cryptoRows.push(
|
|
551
556
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
552
|
-
|
|
557
|
+
_chunkHMUGY66Ocjs.ListRow,
|
|
553
558
|
{
|
|
554
559
|
leading: renderWalletLeading(row),
|
|
555
560
|
title: collapseToExternal ? "External wallet" : row.label,
|
|
@@ -566,7 +571,7 @@ function ConnectStep({
|
|
|
566
571
|
if (!hasSessionWallet && handleConnect) {
|
|
567
572
|
cryptoRows.push(
|
|
568
573
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
569
|
-
|
|
574
|
+
_chunkHMUGY66Ocjs.ListRow,
|
|
570
575
|
{
|
|
571
576
|
leading: WALLET_LEADING,
|
|
572
577
|
title: "Connect wallet",
|
|
@@ -581,7 +586,7 @@ function ConnectStep({
|
|
|
581
586
|
if (onSelectFundFromExchange) {
|
|
582
587
|
cryptoRows.push(
|
|
583
588
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
584
|
-
|
|
589
|
+
_chunkHMUGY66Ocjs.ListRow,
|
|
585
590
|
{
|
|
586
591
|
leading: EXCHANGE_LEADING,
|
|
587
592
|
title: "Connect exchange",
|
|
@@ -596,7 +601,7 @@ function ConnectStep({
|
|
|
596
601
|
if (onSelectMigrateAssets) {
|
|
597
602
|
cryptoRows.push(
|
|
598
603
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
599
|
-
|
|
604
|
+
_chunkHMUGY66Ocjs.ListRow,
|
|
600
605
|
{
|
|
601
606
|
leading: MIGRATE_ASSETS_LEADING,
|
|
602
607
|
title: "Migrate assets",
|
|
@@ -617,7 +622,7 @@ function ConnectStep({
|
|
|
617
622
|
for (const opt of fiatPaymentMethods) {
|
|
618
623
|
cashRows.push(
|
|
619
624
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
620
|
-
|
|
625
|
+
_chunkHMUGY66Ocjs.ListRow,
|
|
621
626
|
{
|
|
622
627
|
leading: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FiatMethodIcon, { option: opt }),
|
|
623
628
|
title: opt.label,
|
|
@@ -632,7 +637,7 @@ function ConnectStep({
|
|
|
632
637
|
} else if (fiatLoading) {
|
|
633
638
|
cashRows.push(
|
|
634
639
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
635
|
-
|
|
640
|
+
_chunkHMUGY66Ocjs.ListRow,
|
|
636
641
|
{
|
|
637
642
|
leading: SMALL_SPINNER,
|
|
638
643
|
title: "Loading payment options\u2026",
|
|
@@ -661,9 +666,9 @@ function ConnectStep({
|
|
|
661
666
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
662
667
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
663
668
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
664
|
-
|
|
669
|
+
_chunkHMUGY66Ocjs.BodyHeader,
|
|
665
670
|
{
|
|
666
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
671
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.HandCoinsIcon, {}),
|
|
667
672
|
title,
|
|
668
673
|
subtitle: _nullishCoalesce(subtitle, () => ( defaultSubtitle)),
|
|
669
674
|
aside: showToggle ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -699,7 +704,7 @@ function ConnectStep({
|
|
|
699
704
|
children: "Disconnect wallet"
|
|
700
705
|
}
|
|
701
706
|
) }),
|
|
702
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
707
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.PoweredBy, {})
|
|
703
708
|
] });
|
|
704
709
|
}
|
|
705
710
|
ConnectStep.displayName = "ConnectStep";
|
|
@@ -722,17 +727,18 @@ function AssetSelectStep({
|
|
|
722
727
|
const [selectedAssetId, setSelectedAssetId] = _react.useState.call(void 0, null);
|
|
723
728
|
const [loading, setLoading] = _react.useState.call(void 0, true);
|
|
724
729
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
725
|
-
const isDepositChain =
|
|
726
|
-
const
|
|
727
|
-
const
|
|
730
|
+
const isDepositChain = _chunkHMUGY66Ocjs.useIsDepositChain.call(void 0, );
|
|
731
|
+
const isExcludedByRestrictedList = _chunkHMUGY66Ocjs.useRestrictedListExclusion.call(void 0, );
|
|
732
|
+
const { catalog } = _chunkHMUGY66Ocjs.useChainCatalog.call(void 0, );
|
|
733
|
+
const chainName = _chunkHMUGY66Ocjs.useChainName.call(void 0, );
|
|
728
734
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
729
735
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
730
|
-
return
|
|
736
|
+
return _chunkHMUGY66Ocjs.getAssetId.call(void 0, {
|
|
731
737
|
chainId: defaultSourceChain,
|
|
732
738
|
token: defaultSourceToken
|
|
733
739
|
});
|
|
734
740
|
}, [defaultSourceChain, defaultSourceToken]);
|
|
735
|
-
const onTotalBalanceComputedRef =
|
|
741
|
+
const onTotalBalanceComputedRef = _chunkHMUGY66Ocjs.useLatestRef.call(void 0, onTotalBalanceComputed);
|
|
736
742
|
_react.useEffect.call(void 0, () => {
|
|
737
743
|
let active = true;
|
|
738
744
|
function emitAssetsUpdate(currentAssets) {
|
|
@@ -752,7 +758,7 @@ function AssetSelectStep({
|
|
|
752
758
|
try {
|
|
753
759
|
const portfolio = await service.fetchPortfolio(address);
|
|
754
760
|
if (!active) return;
|
|
755
|
-
const portfolioAssets =
|
|
761
|
+
const portfolioAssets = _chunkHMUGY66Ocjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
756
762
|
setAssets(portfolioAssets);
|
|
757
763
|
emitAssetsUpdate(portfolioAssets);
|
|
758
764
|
const hasNative = portfolioAssets.some(
|
|
@@ -804,6 +810,9 @@ function AssetSelectStep({
|
|
|
804
810
|
return false;
|
|
805
811
|
}
|
|
806
812
|
const isNativeToken = a.token.toLowerCase() === _chunkOY5N3E6Lcjs.NATIVE_TOKEN_ADDRESS;
|
|
813
|
+
if (isNativeToken && isExcludedByRestrictedList(a.chainId, a.token)) {
|
|
814
|
+
return false;
|
|
815
|
+
}
|
|
807
816
|
if (!isNativeToken && !(typeof a.balanceUsd === "number" && a.balanceUsd >= 0.01))
|
|
808
817
|
return false;
|
|
809
818
|
return true;
|
|
@@ -817,7 +826,7 @@ function AssetSelectStep({
|
|
|
817
826
|
if (balB < balA) return -1;
|
|
818
827
|
return 0;
|
|
819
828
|
});
|
|
820
|
-
}, [assets, isDepositChain]);
|
|
829
|
+
}, [assets, isDepositChain, isExcludedByRestrictedList]);
|
|
821
830
|
_react.useEffect.call(void 0, () => {
|
|
822
831
|
if (!defaultAssetId || selectedAssetId) return;
|
|
823
832
|
if (rows.some((asset) => asset.id === defaultAssetId)) {
|
|
@@ -831,7 +840,7 @@ function AssetSelectStep({
|
|
|
831
840
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
832
841
|
const numeric = Number(raw);
|
|
833
842
|
if (!Number.isFinite(numeric)) return raw;
|
|
834
|
-
return
|
|
843
|
+
return _chunkHMUGY66Ocjs.tokenFormatter.format(numeric);
|
|
835
844
|
} catch (e3) {
|
|
836
845
|
return asset.balance;
|
|
837
846
|
}
|
|
@@ -839,20 +848,20 @@ function AssetSelectStep({
|
|
|
839
848
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
840
849
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
841
850
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
842
|
-
|
|
851
|
+
_chunkHMUGY66Ocjs.BodyHeader,
|
|
843
852
|
{
|
|
844
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
853
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.WalletIcon, {}),
|
|
845
854
|
title: "Your assets",
|
|
846
855
|
subtitle: "Select source assets to transfer"
|
|
847
856
|
}
|
|
848
857
|
),
|
|
849
858
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
850
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
859
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.Spinner, { className: "rs-text-tertiary" }),
|
|
851
860
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
852
861
|
] }),
|
|
853
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
862
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.Callout, { variant: "error", children: error }),
|
|
854
863
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
855
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
864
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
856
865
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
857
866
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
858
867
|
address.slice(0, 6),
|
|
@@ -885,13 +894,13 @@ function AssetSelectStep({
|
|
|
885
894
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
|
|
886
895
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-icon-wrapper", children: [
|
|
887
896
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
888
|
-
|
|
897
|
+
_chunkHMUGY66Ocjs.TokenIcon,
|
|
889
898
|
{
|
|
890
899
|
symbol: asset.symbol,
|
|
891
900
|
fallback: asset.symbol.slice(0, 4)
|
|
892
901
|
}
|
|
893
902
|
) }),
|
|
894
|
-
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
903
|
+
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.CdnIcon, { src: chainIcon, alt: chainName(asset.chainId) }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
895
904
|
"span",
|
|
896
905
|
{
|
|
897
906
|
className: "rs-asset-chain-badge",
|
|
@@ -918,14 +927,14 @@ function AssetSelectStep({
|
|
|
918
927
|
] })
|
|
919
928
|
] })
|
|
920
929
|
] }),
|
|
921
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ?
|
|
930
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunkHMUGY66Ocjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
922
931
|
]
|
|
923
932
|
},
|
|
924
933
|
asset.id
|
|
925
934
|
);
|
|
926
935
|
}) }),
|
|
927
936
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
928
|
-
|
|
937
|
+
_chunkHMUGY66Ocjs.Button,
|
|
929
938
|
{
|
|
930
939
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
931
940
|
disabled: !selectedAsset,
|
|
@@ -934,7 +943,7 @@ function AssetSelectStep({
|
|
|
934
943
|
}
|
|
935
944
|
)
|
|
936
945
|
] }),
|
|
937
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
946
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.PoweredBy, {})
|
|
938
947
|
] });
|
|
939
948
|
}
|
|
940
949
|
async function fetchNativeAssets(address, publicClient, existing, isDepositChain, catalogChain) {
|
|
@@ -942,7 +951,7 @@ async function fetchNativeAssets(address, publicClient, existing, isDepositChain
|
|
|
942
951
|
const connectedChainId = _optionalChain([publicClient, 'access', _16 => _16.chain, 'optionalAccess', _17 => _17.id]);
|
|
943
952
|
if (!connectedChainId) return [];
|
|
944
953
|
if (!isDepositChain(connectedChainId)) return [];
|
|
945
|
-
const id =
|
|
954
|
+
const id = _chunkHMUGY66Ocjs.getAssetId.call(void 0, {
|
|
946
955
|
chainId: connectedChainId,
|
|
947
956
|
token: _chunkOY5N3E6Lcjs.NATIVE_TOKEN_ADDRESS
|
|
948
957
|
});
|
|
@@ -1074,6 +1083,16 @@ function AnimatedAmountInput({
|
|
|
1074
1083
|
|
|
1075
1084
|
// src/components/steps/AmountStep.tsx
|
|
1076
1085
|
|
|
1086
|
+
function requiredSourceAmount(quote, decimals) {
|
|
1087
|
+
const raw = _optionalChain([quote, 'optionalAccess', _22 => _22.input, 'optionalAccess', _23 => _23.amount]);
|
|
1088
|
+
if (raw === void 0) return null;
|
|
1089
|
+
try {
|
|
1090
|
+
return _viem.formatUnits.call(void 0, BigInt(raw), decimals);
|
|
1091
|
+
} catch (e5) {
|
|
1092
|
+
return null;
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
var PAYMENT_QUOTE_REFRESH_MS = 3e4;
|
|
1077
1096
|
var PRESETS = [
|
|
1078
1097
|
{ value: 25, label: "25%" },
|
|
1079
1098
|
{ value: 50, label: "50%" },
|
|
@@ -1104,6 +1123,8 @@ function AmountStep({
|
|
|
1104
1123
|
sourcePriceUnavailable = false,
|
|
1105
1124
|
appBalanceUsd,
|
|
1106
1125
|
title = "Wallet deposit",
|
|
1126
|
+
payment,
|
|
1127
|
+
account,
|
|
1107
1128
|
onContinue,
|
|
1108
1129
|
onCtaClick,
|
|
1109
1130
|
service
|
|
@@ -1111,11 +1132,12 @@ function AmountStep({
|
|
|
1111
1132
|
const [amount, setAmount] = _react.useState.call(void 0, "");
|
|
1112
1133
|
const [balance, setBalance] = _react.useState.call(void 0, null);
|
|
1113
1134
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
1135
|
+
const [paymentQuote, setPaymentQuote] = _react.useState.call(void 0, "loading");
|
|
1114
1136
|
const hasAttemptedSwitch = _react.useRef.call(void 0, false);
|
|
1115
1137
|
const hasAppliedDefaultRef = _react.useRef.call(void 0, false);
|
|
1116
|
-
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess',
|
|
1138
|
+
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess', _24 => _24.trim, 'call', _25 => _25(), 'access', _26 => _26.toLowerCase, 'call', _27 => _27()]) === "max";
|
|
1117
1139
|
const chainMismatch = Boolean(
|
|
1118
|
-
_optionalChain([walletClient, 'optionalAccess',
|
|
1140
|
+
_optionalChain([walletClient, 'optionalAccess', _28 => _28.chain, 'optionalAccess', _29 => _29.id]) && walletClient.chain.id !== asset.chainId
|
|
1119
1141
|
);
|
|
1120
1142
|
const targetChainId = _chunkOY5N3E6Lcjs.targetChainToChainId.call(void 0, targetChain);
|
|
1121
1143
|
const targetSymbol = _chunkOY5N3E6Lcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
@@ -1132,7 +1154,7 @@ function AmountStep({
|
|
|
1132
1154
|
if (!Number.isFinite(balanceUnits) || balanceUnits <= 0) return null;
|
|
1133
1155
|
const price = asset.balanceUsd / balanceUnits;
|
|
1134
1156
|
return price > 0 ? price : null;
|
|
1135
|
-
} catch (
|
|
1157
|
+
} catch (e6) {
|
|
1136
1158
|
return null;
|
|
1137
1159
|
}
|
|
1138
1160
|
}, [tokenPriceUsdOverride, asset.balanceUsd, asset.balance, asset.decimals]);
|
|
@@ -1148,14 +1170,14 @@ function AmountStep({
|
|
|
1148
1170
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
1149
1171
|
if (!balanceTarget || !publicClient) return;
|
|
1150
1172
|
try {
|
|
1151
|
-
const bal =
|
|
1173
|
+
const bal = _chunkHMUGY66Ocjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
1152
1174
|
address: asset.token,
|
|
1153
1175
|
abi: _viem.erc20Abi,
|
|
1154
1176
|
functionName: "balanceOf",
|
|
1155
1177
|
args: [balanceTarget]
|
|
1156
1178
|
});
|
|
1157
1179
|
if (active) setBalance(bal);
|
|
1158
|
-
} catch (
|
|
1180
|
+
} catch (e7) {
|
|
1159
1181
|
if (active) setBalance(null);
|
|
1160
1182
|
}
|
|
1161
1183
|
}
|
|
@@ -1169,7 +1191,7 @@ function AmountStep({
|
|
|
1169
1191
|
hasAttemptedSwitch.current = true;
|
|
1170
1192
|
switchChain(asset.chainId).catch((err) => {
|
|
1171
1193
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
1172
|
-
setError(
|
|
1194
|
+
setError(_chunkHMUGY66Ocjs.formatUserError.call(void 0, raw));
|
|
1173
1195
|
});
|
|
1174
1196
|
}
|
|
1175
1197
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -1182,7 +1204,7 @@ function AmountStep({
|
|
|
1182
1204
|
const balanceUnits = Number(_viem.formatUnits.call(void 0, balance, asset.decimals));
|
|
1183
1205
|
if (!Number.isFinite(balanceUnits)) return null;
|
|
1184
1206
|
return balanceUnits * tokenPriceUsd;
|
|
1185
|
-
} catch (
|
|
1207
|
+
} catch (e8) {
|
|
1186
1208
|
return null;
|
|
1187
1209
|
}
|
|
1188
1210
|
}, [balance, tokenPriceUsd, asset.decimals]);
|
|
@@ -1222,8 +1244,8 @@ function AmountStep({
|
|
|
1222
1244
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
1223
1245
|
const numeric = Number(raw);
|
|
1224
1246
|
if (!Number.isFinite(numeric)) return raw;
|
|
1225
|
-
return
|
|
1226
|
-
} catch (
|
|
1247
|
+
return _chunkHMUGY66Ocjs.tokenFormatter.format(numeric);
|
|
1248
|
+
} catch (e9) {
|
|
1227
1249
|
return "\u2026";
|
|
1228
1250
|
}
|
|
1229
1251
|
}, [balance, asset.decimals]);
|
|
@@ -1232,26 +1254,76 @@ function AmountStep({
|
|
|
1232
1254
|
return Number.isFinite(parsed) && parsed > 0 ? parsed : 0;
|
|
1233
1255
|
}, [amount]);
|
|
1234
1256
|
const amountUsd = numericAmount;
|
|
1257
|
+
const lockedAmount = payment && typeof paymentQuote !== "string" ? requiredSourceAmount(paymentQuote, asset.decimals) : null;
|
|
1235
1258
|
const sourceAmountUnits = _react.useMemo.call(void 0, () => {
|
|
1259
|
+
if (lockedAmount !== null) {
|
|
1260
|
+
try {
|
|
1261
|
+
return _viem.parseUnits.call(void 0, lockedAmount, asset.decimals);
|
|
1262
|
+
} catch (e10) {
|
|
1263
|
+
return null;
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1236
1266
|
if (numericAmount <= 0) return null;
|
|
1237
1267
|
const raw = isSourceStablecoin || !hasPricing ? numericAmount : numericAmount / (_nullishCoalesce(tokenPriceUsd, () => ( 1)));
|
|
1238
1268
|
try {
|
|
1239
1269
|
return _viem.parseUnits.call(void 0, raw.toString(), asset.decimals);
|
|
1240
|
-
} catch (
|
|
1270
|
+
} catch (e11) {
|
|
1241
1271
|
return null;
|
|
1242
1272
|
}
|
|
1243
|
-
}, [
|
|
1244
|
-
|
|
1245
|
-
|
|
1273
|
+
}, [
|
|
1274
|
+
lockedAmount,
|
|
1275
|
+
numericAmount,
|
|
1276
|
+
isSourceStablecoin,
|
|
1277
|
+
hasPricing,
|
|
1278
|
+
tokenPriceUsd,
|
|
1279
|
+
asset.decimals
|
|
1280
|
+
]);
|
|
1281
|
+
const minDepositUsd = _chunkOY5N3E6Lcjs.isHyperCoreDestination.call(void 0, targetChain) ? Math.max(_chunkOY5N3E6Lcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _30 => _30.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _31 => _31.minDepositUsd]), () => ( null));
|
|
1282
|
+
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _32 => _32.maxDepositUsd]), () => ( null));
|
|
1246
1283
|
const isBelowMin = minDepositUsd !== null && numericAmount > 0 && amountUsd < minDepositUsd;
|
|
1247
1284
|
const isAboveMax = maxDepositUsd !== null && amountUsd > maxDepositUsd;
|
|
1248
1285
|
const exceedsBalance = Boolean(
|
|
1249
1286
|
sourceAmountUnits !== null && balance !== null && sourceAmountUnits > balance
|
|
1250
1287
|
);
|
|
1288
|
+
const boundsFor = _chunkHMUGY66Ocjs.useDepositBounds.call(void 0, );
|
|
1289
|
+
const boundViolation = _chunkHMUGY66Ocjs.depositBoundsViolation.call(void 0,
|
|
1290
|
+
boundsFor(asset.chainId, asset.token),
|
|
1291
|
+
sourceAmountUnits
|
|
1292
|
+
);
|
|
1251
1293
|
const balanceAfterUsd = appBalanceUsd !== void 0 ? appBalanceUsd + numericAmount : null;
|
|
1294
|
+
_react.useEffect.call(void 0, () => {
|
|
1295
|
+
if (!payment || !account) return;
|
|
1296
|
+
let active = true;
|
|
1297
|
+
setPaymentQuote("loading");
|
|
1298
|
+
const load = async () => {
|
|
1299
|
+
const result = await service.getQuotePreview({
|
|
1300
|
+
account,
|
|
1301
|
+
sourceChainId: asset.chainId,
|
|
1302
|
+
sourceToken: asset.token,
|
|
1303
|
+
direction: "exactOut",
|
|
1304
|
+
amountOut: payment.amount
|
|
1305
|
+
});
|
|
1306
|
+
if (!active) return;
|
|
1307
|
+
setPaymentQuote(
|
|
1308
|
+
result && "output" in result && result.input ? result : "unavailable"
|
|
1309
|
+
);
|
|
1310
|
+
};
|
|
1311
|
+
void load();
|
|
1312
|
+
const timer = setInterval(load, PAYMENT_QUOTE_REFRESH_MS);
|
|
1313
|
+
return () => {
|
|
1314
|
+
active = false;
|
|
1315
|
+
clearInterval(timer);
|
|
1316
|
+
};
|
|
1317
|
+
}, [
|
|
1318
|
+
payment,
|
|
1319
|
+
account,
|
|
1320
|
+
asset.chainId,
|
|
1321
|
+
asset.token,
|
|
1322
|
+
service
|
|
1323
|
+
]);
|
|
1252
1324
|
const handlePresetClick = (percentage) => {
|
|
1253
1325
|
if (balance === null) return;
|
|
1254
|
-
_optionalChain([onCtaClick, 'optionalCall',
|
|
1326
|
+
_optionalChain([onCtaClick, 'optionalCall', _33 => _33(percentage === 100 ? "Max" : `${percentage}%`)]);
|
|
1255
1327
|
const next = formatAmountFromBalance(
|
|
1256
1328
|
balance,
|
|
1257
1329
|
asset.decimals,
|
|
@@ -1271,7 +1343,20 @@ function AmountStep({
|
|
|
1271
1343
|
if (error) setError(null);
|
|
1272
1344
|
};
|
|
1273
1345
|
const handleContinue = async () => {
|
|
1274
|
-
if (chainMismatch) return;
|
|
1346
|
+
if (chainMismatch || boundViolation) return;
|
|
1347
|
+
if (payment) {
|
|
1348
|
+
if (!lockedAmount) return;
|
|
1349
|
+
if (balance !== null && _viem.parseUnits.call(void 0, lockedAmount, asset.decimals) > balance) {
|
|
1350
|
+
setError("Insufficient balance");
|
|
1351
|
+
return;
|
|
1352
|
+
}
|
|
1353
|
+
setError(null);
|
|
1354
|
+
_optionalChain([onCtaClick, 'optionalCall', _34 => _34("continue")]);
|
|
1355
|
+
const lockedUnits = Number(lockedAmount);
|
|
1356
|
+
const usd = isSourceStablecoin || !hasPricing ? lockedUnits : lockedUnits * (_nullishCoalesce(tokenPriceUsd, () => ( 1)));
|
|
1357
|
+
onContinue(lockedAmount, usd.toString(), _nullishCoalesce(balance, () => ( void 0)));
|
|
1358
|
+
return;
|
|
1359
|
+
}
|
|
1275
1360
|
let effectiveAmount = numericAmount;
|
|
1276
1361
|
if (isBelowMin && minDepositUsd !== null) {
|
|
1277
1362
|
effectiveAmount = minDepositUsd;
|
|
@@ -1289,7 +1374,7 @@ function AmountStep({
|
|
|
1289
1374
|
let amountInUnits;
|
|
1290
1375
|
try {
|
|
1291
1376
|
amountInUnits = _viem.parseUnits.call(void 0, sourceAmount.toString(), asset.decimals);
|
|
1292
|
-
} catch (
|
|
1377
|
+
} catch (e12) {
|
|
1293
1378
|
setError("Please enter a valid amount");
|
|
1294
1379
|
return;
|
|
1295
1380
|
}
|
|
@@ -1298,27 +1383,33 @@ function AmountStep({
|
|
|
1298
1383
|
return;
|
|
1299
1384
|
}
|
|
1300
1385
|
setError(null);
|
|
1301
|
-
_optionalChain([onCtaClick, 'optionalCall',
|
|
1386
|
+
_optionalChain([onCtaClick, 'optionalCall', _35 => _35("continue")]);
|
|
1302
1387
|
onContinue(
|
|
1303
1388
|
sourceAmount.toString(),
|
|
1304
1389
|
effectiveAmount.toString(),
|
|
1305
1390
|
_nullishCoalesce(balance, () => ( void 0))
|
|
1306
1391
|
);
|
|
1307
1392
|
};
|
|
1308
|
-
const continueLabel = exceedsBalance ? "Insufficient balance" : isAboveMax ? "Continue with max allowed deposit" : isBelowMin ? "Continue with minimum deposit" : "Continue";
|
|
1393
|
+
const continueLabel = exceedsBalance ? "Insufficient balance" : _nullishCoalesce(boundViolation, () => ( (isAboveMax ? "Continue with max allowed deposit" : isBelowMin ? "Continue with minimum deposit" : "Continue")));
|
|
1309
1394
|
const knowsBalance = address !== void 0;
|
|
1310
1395
|
const needsPricing = !knowsBalance && !isSourceStablecoin;
|
|
1311
1396
|
const blockedOnPricing = needsPricing && !hasPricing;
|
|
1312
|
-
const continueDisabled =
|
|
1313
|
-
|
|
1397
|
+
const continueDisabled = payment ? (
|
|
1398
|
+
// No input to validate — only whether the quote resolved and whether the
|
|
1399
|
+
// payer can cover it. Bounds still apply: they are the project's ingest
|
|
1400
|
+
// limits, so an invoice under a chain's minimum genuinely cannot be paid
|
|
1401
|
+
// that way and the payer has to be told, not left on a dead button.
|
|
1402
|
+
chainMismatch || lockedAmount === null || exceedsBalance || boundViolation !== null || knowsBalance && balance === null
|
|
1403
|
+
) : chainMismatch || exceedsBalance || boundViolation !== null || blockedOnPricing || numericAmount === 0 && !isBelowMin || knowsBalance && balance === null;
|
|
1404
|
+
const chainName = _chunkHMUGY66Ocjs.useChainName.call(void 0, );
|
|
1314
1405
|
const sourceChainName = chainName(asset.chainId);
|
|
1315
1406
|
const targetChainName = chainName(targetChainId);
|
|
1316
1407
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
1317
1408
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
1318
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1409
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.WalletIcon, {}), title }),
|
|
1319
1410
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
1320
1411
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
1321
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1412
|
+
payment ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-amount-fixed", "aria-label": "Amount to pay", children: lockedAmount ? `${_chunkHMUGY66Ocjs.tokenFormatter.format(Number(lockedAmount))} ${asset.symbol}` : "\u2014" }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1322
1413
|
AnimatedAmountInput,
|
|
1323
1414
|
{
|
|
1324
1415
|
value: amount,
|
|
@@ -1335,17 +1426,17 @@ function AmountStep({
|
|
|
1335
1426
|
" available",
|
|
1336
1427
|
balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1337
1428
|
" (~",
|
|
1338
|
-
|
|
1429
|
+
_chunkHMUGY66Ocjs.currencyFormatter.format(balanceUsd),
|
|
1339
1430
|
")"
|
|
1340
1431
|
] })
|
|
1341
1432
|
] }),
|
|
1342
1433
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
1343
1434
|
"Min. deposit ",
|
|
1344
|
-
|
|
1435
|
+
_chunkHMUGY66Ocjs.currencyFormatter.format(minDepositUsd)
|
|
1345
1436
|
] })
|
|
1346
1437
|
] })
|
|
1347
1438
|
] }),
|
|
1348
|
-
knowsBalance && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-amount-presets", children: PRESETS.map((preset) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1439
|
+
knowsBalance && !payment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-amount-presets", children: PRESETS.map((preset) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1349
1440
|
"button",
|
|
1350
1441
|
{
|
|
1351
1442
|
type: "button",
|
|
@@ -1366,7 +1457,7 @@ function AmountStep({
|
|
|
1366
1457
|
" ",
|
|
1367
1458
|
asset.symbol
|
|
1368
1459
|
] }),
|
|
1369
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1460
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.TokenIcon, { symbol: asset.symbol }) })
|
|
1370
1461
|
] })
|
|
1371
1462
|
] }),
|
|
1372
1463
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
@@ -1377,21 +1468,29 @@ function AmountStep({
|
|
|
1377
1468
|
" ",
|
|
1378
1469
|
targetSymbol
|
|
1379
1470
|
] }),
|
|
1380
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1471
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.TokenIcon, { symbol: targetSymbol }) })
|
|
1381
1472
|
] })
|
|
1382
1473
|
] }),
|
|
1383
1474
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
1384
1475
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
1385
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
1476
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkHMUGY66Ocjs.currencyFormatter.format(balanceAfterUsd) })
|
|
1386
1477
|
] })
|
|
1387
1478
|
] }),
|
|
1388
|
-
|
|
1479
|
+
payment && paymentQuote === "unavailable" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkHMUGY66Ocjs.Callout, { variant: "error", children: [
|
|
1480
|
+
"This payment can't be priced from ",
|
|
1481
|
+
asset.symbol,
|
|
1482
|
+
" on",
|
|
1483
|
+
" ",
|
|
1484
|
+
sourceChainName,
|
|
1485
|
+
" right now. Try another asset."
|
|
1486
|
+
] }),
|
|
1487
|
+
blockedOnPricing && sourcePriceUnavailable && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkHMUGY66Ocjs.Callout, { variant: "error", children: [
|
|
1389
1488
|
asset.symbol,
|
|
1390
1489
|
" can't be priced right now, so this deposit can't be estimated. You can still send any amount to the deposit address."
|
|
1391
1490
|
] }),
|
|
1392
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1491
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.Callout, { variant: "error", children: error }),
|
|
1393
1492
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1394
|
-
|
|
1493
|
+
_chunkHMUGY66Ocjs.Button,
|
|
1395
1494
|
{
|
|
1396
1495
|
onClick: handleContinue,
|
|
1397
1496
|
fullWidth: true,
|
|
@@ -1400,7 +1499,7 @@ function AmountStep({
|
|
|
1400
1499
|
}
|
|
1401
1500
|
)
|
|
1402
1501
|
] }),
|
|
1403
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1502
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.PoweredBy, {})
|
|
1404
1503
|
] });
|
|
1405
1504
|
}
|
|
1406
1505
|
|
|
@@ -1427,14 +1526,14 @@ function ReviewDetails({
|
|
|
1427
1526
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
1428
1527
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1429
1528
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceChainName }),
|
|
1430
|
-
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1529
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.CdnIcon, { src: sourceChainIcon }) })
|
|
1431
1530
|
] })
|
|
1432
1531
|
] }),
|
|
1433
1532
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1434
1533
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
|
|
1435
1534
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1436
1535
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName }),
|
|
1437
|
-
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1536
|
+
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.CdnIcon, { src: targetChainIcon }) })
|
|
1438
1537
|
] })
|
|
1439
1538
|
] }),
|
|
1440
1539
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -1449,21 +1548,21 @@ function ReviewDetails({
|
|
|
1449
1548
|
" ",
|
|
1450
1549
|
sendSymbol
|
|
1451
1550
|
] }),
|
|
1452
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1551
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.TokenIcon, { symbol: sendSymbol }) })
|
|
1453
1552
|
] })
|
|
1454
1553
|
] }),
|
|
1455
1554
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1456
1555
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Receive" }),
|
|
1457
1556
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1458
1557
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: receiveDisplay }),
|
|
1459
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1558
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.TokenIcon, { symbol: receiveSymbol }) })
|
|
1460
1559
|
] })
|
|
1461
1560
|
] }),
|
|
1462
1561
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1463
1562
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Fees" }),
|
|
1464
1563
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1465
1564
|
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 }),
|
|
1466
|
-
fee.tooltip !== void 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1565
|
+
fee.tooltip !== void 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.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, _chunkHMUGY66Ocjs.InfoIcon, {}) }) })
|
|
1467
1566
|
] })
|
|
1468
1567
|
] })
|
|
1469
1568
|
] });
|
|
@@ -1483,7 +1582,7 @@ function toBigInt(value) {
|
|
|
1483
1582
|
if (typeof value === "string" && value.length > 0) {
|
|
1484
1583
|
try {
|
|
1485
1584
|
return BigInt(value);
|
|
1486
|
-
} catch (
|
|
1585
|
+
} catch (e13) {
|
|
1487
1586
|
return null;
|
|
1488
1587
|
}
|
|
1489
1588
|
}
|
|
@@ -1497,45 +1596,45 @@ function validatePermitTypedData(typedData, expected) {
|
|
|
1497
1596
|
};
|
|
1498
1597
|
}
|
|
1499
1598
|
const { domain, message } = typedData;
|
|
1500
|
-
if (!sameAddress(_optionalChain([domain, 'optionalAccess',
|
|
1599
|
+
if (!sameAddress(_optionalChain([domain, 'optionalAccess', _36 => _36.verifyingContract]), PERMIT2_ADDRESS)) {
|
|
1501
1600
|
return {
|
|
1502
1601
|
ok: false,
|
|
1503
1602
|
reason: `verifyingContract ${String(
|
|
1504
|
-
_optionalChain([domain, 'optionalAccess',
|
|
1603
|
+
_optionalChain([domain, 'optionalAccess', _37 => _37.verifyingContract])
|
|
1505
1604
|
)} is not the canonical Permit2`
|
|
1506
1605
|
};
|
|
1507
1606
|
}
|
|
1508
|
-
const domainChainId = toBigInt(_optionalChain([domain, 'optionalAccess',
|
|
1607
|
+
const domainChainId = toBigInt(_optionalChain([domain, 'optionalAccess', _38 => _38.chainId]));
|
|
1509
1608
|
if (domainChainId === null || domainChainId !== BigInt(expected.chainId)) {
|
|
1510
1609
|
return {
|
|
1511
1610
|
ok: false,
|
|
1512
1611
|
reason: `domain.chainId ${String(
|
|
1513
|
-
_optionalChain([domain, 'optionalAccess',
|
|
1612
|
+
_optionalChain([domain, 'optionalAccess', _39 => _39.chainId])
|
|
1514
1613
|
)} does not match source chain ${expected.chainId}`
|
|
1515
1614
|
};
|
|
1516
1615
|
}
|
|
1517
|
-
if (!sameAddress(_optionalChain([message, 'optionalAccess',
|
|
1616
|
+
if (!sameAddress(_optionalChain([message, 'optionalAccess', _40 => _40.spender]), expected.spender)) {
|
|
1518
1617
|
return {
|
|
1519
1618
|
ok: false,
|
|
1520
|
-
reason: `spender ${String(_optionalChain([message, 'optionalAccess',
|
|
1619
|
+
reason: `spender ${String(_optionalChain([message, 'optionalAccess', _41 => _41.spender]))} is not the deposit account`
|
|
1521
1620
|
};
|
|
1522
1621
|
}
|
|
1523
|
-
const permitted = _optionalChain([message, 'optionalAccess',
|
|
1524
|
-
if (!sameAddress(_optionalChain([permitted, 'optionalAccess',
|
|
1622
|
+
const permitted = _optionalChain([message, 'optionalAccess', _42 => _42.permitted]);
|
|
1623
|
+
if (!sameAddress(_optionalChain([permitted, 'optionalAccess', _43 => _43.token]), expected.token)) {
|
|
1525
1624
|
return {
|
|
1526
1625
|
ok: false,
|
|
1527
1626
|
reason: `permitted.token ${String(
|
|
1528
|
-
_optionalChain([permitted, 'optionalAccess',
|
|
1627
|
+
_optionalChain([permitted, 'optionalAccess', _44 => _44.token])
|
|
1529
1628
|
)} is not the confirmed token`
|
|
1530
1629
|
};
|
|
1531
1630
|
}
|
|
1532
|
-
const permittedAmount = toBigInt(_optionalChain([permitted, 'optionalAccess',
|
|
1631
|
+
const permittedAmount = toBigInt(_optionalChain([permitted, 'optionalAccess', _45 => _45.amount]));
|
|
1533
1632
|
const expectedAmount = toBigInt(expected.amount);
|
|
1534
1633
|
if (permittedAmount === null || expectedAmount === null || permittedAmount !== expectedAmount) {
|
|
1535
1634
|
return {
|
|
1536
1635
|
ok: false,
|
|
1537
1636
|
reason: `permitted.amount ${String(
|
|
1538
|
-
_optionalChain([permitted, 'optionalAccess',
|
|
1637
|
+
_optionalChain([permitted, 'optionalAccess', _46 => _46.amount])
|
|
1539
1638
|
)} does not match the confirmed amount ${expected.amount}`
|
|
1540
1639
|
};
|
|
1541
1640
|
}
|
|
@@ -1549,24 +1648,24 @@ function sameInteger(a, b) {
|
|
|
1549
1648
|
function validatePreparedAuthorization(authorization, expected) {
|
|
1550
1649
|
const { typedData } = authorization;
|
|
1551
1650
|
const { domain, message } = typedData;
|
|
1552
|
-
const domainChainId = toBigInt(_optionalChain([domain, 'optionalAccess',
|
|
1651
|
+
const domainChainId = toBigInt(_optionalChain([domain, 'optionalAccess', _47 => _47.chainId]));
|
|
1553
1652
|
if (domainChainId === null || domainChainId !== BigInt(expected.chainId)) {
|
|
1554
1653
|
return {
|
|
1555
1654
|
ok: false,
|
|
1556
1655
|
reason: `domain.chainId ${String(
|
|
1557
|
-
_optionalChain([domain, 'optionalAccess',
|
|
1656
|
+
_optionalChain([domain, 'optionalAccess', _48 => _48.chainId])
|
|
1558
1657
|
)} does not match source chain ${expected.chainId}`
|
|
1559
1658
|
};
|
|
1560
1659
|
}
|
|
1561
1660
|
if (authorization.kind === "permit2") {
|
|
1562
1661
|
const verdict = validatePermitTypedData(typedData, expected);
|
|
1563
1662
|
if (!verdict.ok) return verdict;
|
|
1564
|
-
if (!sameInteger(_optionalChain([message, 'optionalAccess',
|
|
1663
|
+
if (!sameInteger(_optionalChain([message, 'optionalAccess', _49 => _49.nonce]), authorization.nonce) || !sameInteger(_optionalChain([message, 'optionalAccess', _50 => _50.deadline]), authorization.deadline)) {
|
|
1565
1664
|
return { ok: false, reason: "Permit2 nonce or deadline mismatch" };
|
|
1566
1665
|
}
|
|
1567
1666
|
return { ok: true };
|
|
1568
1667
|
}
|
|
1569
|
-
if (!sameAddress(_optionalChain([domain, 'optionalAccess',
|
|
1668
|
+
if (!sameAddress(_optionalChain([domain, 'optionalAccess', _51 => _51.verifyingContract]), expected.token)) {
|
|
1570
1669
|
return {
|
|
1571
1670
|
ok: false,
|
|
1572
1671
|
reason: "token-native authorization verifies against the wrong token"
|
|
@@ -1576,10 +1675,10 @@ function validatePreparedAuthorization(authorization, expected) {
|
|
|
1576
1675
|
if (typedData.primaryType !== "ReceiveWithAuthorization") {
|
|
1577
1676
|
return { ok: false, reason: "unexpected ERC-3009 primaryType" };
|
|
1578
1677
|
}
|
|
1579
|
-
if (!sameAddress(_optionalChain([message, 'optionalAccess',
|
|
1678
|
+
if (!sameAddress(_optionalChain([message, 'optionalAccess', _52 => _52.from]), expected.owner) || !sameAddress(_optionalChain([message, 'optionalAccess', _53 => _53.to]), expected.spender) || !sameInteger(_optionalChain([message, 'optionalAccess', _54 => _54.value]), expected.amount)) {
|
|
1580
1679
|
return { ok: false, reason: "ERC-3009 transfer terms do not match" };
|
|
1581
1680
|
}
|
|
1582
|
-
if (typeof _optionalChain([message, 'optionalAccess',
|
|
1681
|
+
if (typeof _optionalChain([message, 'optionalAccess', _55 => _55.nonce]) !== "string" || message.nonce.toLowerCase() !== authorization.nonce.toLowerCase() || !sameInteger(_optionalChain([message, 'optionalAccess', _56 => _56.validAfter]), authorization.validAfter) || !sameInteger(_optionalChain([message, 'optionalAccess', _57 => _57.validBefore]), authorization.validBefore)) {
|
|
1583
1682
|
return {
|
|
1584
1683
|
ok: false,
|
|
1585
1684
|
reason: "ERC-3009 nonce or validity window mismatch"
|
|
@@ -1590,10 +1689,10 @@ function validatePreparedAuthorization(authorization, expected) {
|
|
|
1590
1689
|
if (typedData.primaryType !== "Permit") {
|
|
1591
1690
|
return { ok: false, reason: "unexpected ERC-2612 primaryType" };
|
|
1592
1691
|
}
|
|
1593
|
-
if (!sameAddress(_optionalChain([message, 'optionalAccess',
|
|
1692
|
+
if (!sameAddress(_optionalChain([message, 'optionalAccess', _58 => _58.owner]), expected.owner) || !sameAddress(_optionalChain([message, 'optionalAccess', _59 => _59.spender]), expected.spender) || !sameInteger(_optionalChain([message, 'optionalAccess', _60 => _60.value]), expected.amount)) {
|
|
1594
1693
|
return { ok: false, reason: "ERC-2612 permit terms do not match" };
|
|
1595
1694
|
}
|
|
1596
|
-
if (!sameInteger(_optionalChain([message, 'optionalAccess',
|
|
1695
|
+
if (!sameInteger(_optionalChain([message, 'optionalAccess', _61 => _61.nonce]), authorization.nonce) || !sameInteger(_optionalChain([message, 'optionalAccess', _62 => _62.deadline]), authorization.deadline)) {
|
|
1597
1696
|
return { ok: false, reason: "ERC-2612 nonce or deadline mismatch" };
|
|
1598
1697
|
}
|
|
1599
1698
|
return { ok: true };
|
|
@@ -1642,7 +1741,9 @@ function ConfirmStep({
|
|
|
1642
1741
|
onError,
|
|
1643
1742
|
onDepositSubmitted,
|
|
1644
1743
|
onSubmittingChange,
|
|
1645
|
-
executeTransfer
|
|
1744
|
+
executeTransfer,
|
|
1745
|
+
title = "Review deposit",
|
|
1746
|
+
routeThroughAccount = false
|
|
1646
1747
|
}) {
|
|
1647
1748
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
1648
1749
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
@@ -1651,15 +1752,23 @@ function ConfirmStep({
|
|
|
1651
1752
|
const [permitUnavailable, setPermitUnavailable] = _react.useState.call(void 0, null);
|
|
1652
1753
|
const [permitDisabled, setPermitDisabled] = _react.useState.call(void 0, false);
|
|
1653
1754
|
const [submissionUncertain, setSubmissionUncertain] = _react.useState.call(void 0, false);
|
|
1755
|
+
const [previewRefusal, setPreviewRefusal] = _react.useState.call(void 0, null);
|
|
1756
|
+
const [permitRefusal, setPermitRefusal] = _react.useState.call(void 0, null);
|
|
1757
|
+
const [previewSettledKey, setPreviewSettledKey] = _react.useState.call(void 0,
|
|
1758
|
+
null
|
|
1759
|
+
);
|
|
1760
|
+
const [permitSettledKey, setPermitSettledKey] = _react.useState.call(void 0,
|
|
1761
|
+
null
|
|
1762
|
+
);
|
|
1654
1763
|
const hasAttemptedSwitch = _react.useRef.call(void 0, false);
|
|
1655
1764
|
const onSubmittingChangeRef = _react.useRef.call(void 0, onSubmittingChange);
|
|
1656
1765
|
onSubmittingChangeRef.current = onSubmittingChange;
|
|
1657
1766
|
_react.useEffect.call(void 0, () => {
|
|
1658
|
-
_optionalChain([onSubmittingChangeRef, 'access',
|
|
1659
|
-
return () => _optionalChain([onSubmittingChangeRef, 'access',
|
|
1767
|
+
_optionalChain([onSubmittingChangeRef, 'access', _63 => _63.current, 'optionalCall', _64 => _64(isSubmitting)]);
|
|
1768
|
+
return () => _optionalChain([onSubmittingChangeRef, 'access', _65 => _65.current, 'optionalCall', _66 => _66(false)]);
|
|
1660
1769
|
}, [isSubmitting]);
|
|
1661
1770
|
const chainMismatch = Boolean(
|
|
1662
|
-
_optionalChain([walletClient, 'optionalAccess',
|
|
1771
|
+
_optionalChain([walletClient, 'optionalAccess', _67 => _67.chain, 'optionalAccess', _68 => _68.id]) && walletClient.chain.id !== asset.chainId
|
|
1663
1772
|
);
|
|
1664
1773
|
const sameRoute = targetChain === asset.chainId && targetToken.toLowerCase() === asset.token.toLowerCase();
|
|
1665
1774
|
const quoteSource = isDappImportAsset(asset) ? { chainId: asset.depositChainId, token: asset.depositToken } : { chainId: asset.chainId, token: asset.token };
|
|
@@ -1674,24 +1783,24 @@ function ConfirmStep({
|
|
|
1674
1783
|
targetToken,
|
|
1675
1784
|
recipient
|
|
1676
1785
|
]);
|
|
1677
|
-
const quote = setupReady && _optionalChain([quoteResult, 'optionalAccess',
|
|
1786
|
+
const quote = setupReady && _optionalChain([quoteResult, 'optionalAccess', _69 => _69.requestKey]) === quoteRequestKey ? quoteResult.quote : null;
|
|
1678
1787
|
const targetChainId = _chunkOY5N3E6Lcjs.targetChainToChainId.call(void 0, targetChain);
|
|
1679
1788
|
const targetSymbol = sameRoute ? asset.symbol : _chunkOY5N3E6Lcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
1680
1789
|
const sourceChainName = _chunkOY5N3E6Lcjs.getChainName.call(void 0, asset.chainId);
|
|
1681
1790
|
const targetChainName = _chunkOY5N3E6Lcjs.getChainName.call(void 0, targetChainId);
|
|
1682
1791
|
const sourceChainIcon = _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, asset.chainId);
|
|
1683
1792
|
const targetChainIcon = _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, targetChainId);
|
|
1684
|
-
const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? _nullishCoalesce(
|
|
1685
|
-
const mustHaveQuote = !appFeesResolved ||
|
|
1793
|
+
const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? _nullishCoalesce(_chunkHMUGY66Ocjs.formatTokenAmount.call(void 0, Number(amount), asset.symbol), () => ( "0")) : "0";
|
|
1794
|
+
const mustHaveQuote = !appFeesResolved || _chunkHMUGY66Ocjs.resolveAppFeeBps.call(void 0,
|
|
1686
1795
|
appFees,
|
|
1687
1796
|
`eip155:${quoteSource.chainId}`,
|
|
1688
1797
|
quoteSource.token
|
|
1689
1798
|
) > 0;
|
|
1690
|
-
const { display: feeDisplay, struck: feesFullySponsored } =
|
|
1691
|
-
_optionalChain([quote, 'optionalAccess',
|
|
1799
|
+
const { display: feeDisplay, struck: feesFullySponsored } = _chunkHMUGY66Ocjs.quoteFeeRow.call(void 0,
|
|
1800
|
+
_optionalChain([quote, 'optionalAccess', _70 => _70.fees])
|
|
1692
1801
|
);
|
|
1693
|
-
const directTransfer = sameRoute && !mustHaveQuote && !executeTransfer;
|
|
1694
|
-
const permitEligible = enableGaslessDeposit && !
|
|
1802
|
+
const directTransfer = sameRoute && !mustHaveQuote && !executeTransfer && !routeThroughAccount;
|
|
1803
|
+
const permitEligible = enableGaslessDeposit && !_chunkHMUGY66Ocjs.isNativeAsset.call(void 0, asset) && !isDappImportAsset(asset) && !executeTransfer && !directTransfer && asset.chainId !== _chunkOY5N3E6Lcjs.HYPERCORE_CHAIN_ID;
|
|
1695
1804
|
const permitRequestKey = JSON.stringify([
|
|
1696
1805
|
smartAccount.toLowerCase(),
|
|
1697
1806
|
asset.chainId,
|
|
@@ -1700,37 +1809,52 @@ function ConfirmStep({
|
|
|
1700
1809
|
amount,
|
|
1701
1810
|
address.toLowerCase()
|
|
1702
1811
|
]);
|
|
1703
|
-
const permit = permitEligible && !permitDisabled && _optionalChain([permitResult, 'optionalAccess',
|
|
1812
|
+
const permit = permitEligible && !permitDisabled && _optionalChain([permitResult, 'optionalAccess', _71 => _71.requestKey]) === permitRequestKey ? permitResult.prepared : null;
|
|
1813
|
+
const boundsFor = _chunkHMUGY66Ocjs.useDepositBounds.call(void 0, );
|
|
1814
|
+
const activeRefusal = _nullishCoalesce((_optionalChain([previewRefusal, 'optionalAccess', _72 => _72.requestKey]) === quoteRequestKey ? previewRefusal.refusal : null), () => ( (_optionalChain([permitRefusal, 'optionalAccess', _73 => _73.requestKey]) === permitRequestKey ? permitRefusal.refusal : null)));
|
|
1815
|
+
const blockedReason = activeRefusal ? _chunkHMUGY66Ocjs.describePolicyRefusal.call(void 0,
|
|
1816
|
+
activeRefusal,
|
|
1817
|
+
boundsFor(quoteSource.chainId, quoteSource.token)
|
|
1818
|
+
) : null;
|
|
1819
|
+
const requestsAmount = (() => {
|
|
1820
|
+
try {
|
|
1821
|
+
return _viem.parseUnits.call(void 0, amount, asset.decimals) > 0n;
|
|
1822
|
+
} catch (e14) {
|
|
1823
|
+
return false;
|
|
1824
|
+
}
|
|
1825
|
+
})();
|
|
1826
|
+
const previewPending = setupReady && requestsAmount && previewSettledKey !== quoteRequestKey;
|
|
1827
|
+
const permitPending = permitEligible && !permitDisabled && requestsAmount && permitSettledKey !== permitRequestKey;
|
|
1704
1828
|
const receiveDisplay = (() => {
|
|
1705
1829
|
if (directTransfer) return `${formattedSendAmount} ${asset.symbol}`;
|
|
1706
1830
|
if (quote) {
|
|
1707
|
-
const quoted =
|
|
1831
|
+
const quoted = _chunkHMUGY66Ocjs.formatQuotedReceive.call(void 0, quote.output, targetSymbol);
|
|
1708
1832
|
if (quoted !== void 0) return quoted;
|
|
1709
1833
|
}
|
|
1710
1834
|
const usdValue = Number(targetAmount);
|
|
1711
1835
|
const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
|
|
1712
|
-
const estimate =
|
|
1836
|
+
const estimate = _chunkHMUGY66Ocjs.formatReceiveEstimate.call(void 0, {
|
|
1713
1837
|
sourceAmount: Number.isFinite(Number(amount)) ? Number(amount) : void 0,
|
|
1714
1838
|
sourceSymbol: asset.symbol,
|
|
1715
1839
|
targetSymbol,
|
|
1716
1840
|
sourceAmountUsd,
|
|
1717
|
-
sourceTrusted:
|
|
1841
|
+
sourceTrusted: _chunkHMUGY66Ocjs.isRecognizedToken.call(void 0, asset.token, asset.chainId),
|
|
1718
1842
|
// The target is the curated deposit destination, so a stablecoin target
|
|
1719
1843
|
// estimates at $1 when unquoted (DepositFlow skips fetching stablecoin
|
|
1720
1844
|
// target prices). Not applied to the source — that can be a held token.
|
|
1721
|
-
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } :
|
|
1845
|
+
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : _chunkHMUGY66Ocjs.isDisplayStablecoinSymbol.call(void 0, targetSymbol) ? { [targetSymbol.toUpperCase()]: 1 } : {}
|
|
1722
1846
|
});
|
|
1723
1847
|
if (estimate !== void 0) return estimate;
|
|
1724
1848
|
return targetSymbol;
|
|
1725
1849
|
})();
|
|
1726
|
-
const servedExpectedSeconds = _nullishCoalesce(_optionalChain([quote, 'optionalAccess',
|
|
1727
|
-
const estimatedTimeDisplay = servedExpectedSeconds !== void 0 ?
|
|
1850
|
+
const servedExpectedSeconds = _nullishCoalesce(_optionalChain([quote, 'optionalAccess', _74 => _74.timing, 'optionalAccess', _75 => _75.expectedSeconds]), () => ( (quote && Number.isFinite(quote.estimatedFillTimeSeconds) ? quote.estimatedFillTimeSeconds : void 0)));
|
|
1851
|
+
const estimatedTimeDisplay = servedExpectedSeconds !== void 0 ? _chunkHMUGY66Ocjs.formatExpectedDuration.call(void 0, servedExpectedSeconds) : estimatedTime;
|
|
1728
1852
|
_react.useEffect.call(void 0, () => {
|
|
1729
1853
|
if (chainMismatch && switchChain && !hasAttemptedSwitch.current) {
|
|
1730
1854
|
hasAttemptedSwitch.current = true;
|
|
1731
1855
|
switchChain(asset.chainId).catch((err) => {
|
|
1732
1856
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
1733
|
-
setError(
|
|
1857
|
+
setError(_chunkHMUGY66Ocjs.formatUserError.call(void 0, raw));
|
|
1734
1858
|
});
|
|
1735
1859
|
}
|
|
1736
1860
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -1746,7 +1870,7 @@ function ConfirmStep({
|
|
|
1746
1870
|
let units;
|
|
1747
1871
|
try {
|
|
1748
1872
|
units = _viem.parseUnits.call(void 0, amount, asset.decimals);
|
|
1749
|
-
} catch (
|
|
1873
|
+
} catch (e15) {
|
|
1750
1874
|
return;
|
|
1751
1875
|
}
|
|
1752
1876
|
if (units <= 0n) return;
|
|
@@ -1757,11 +1881,22 @@ function ConfirmStep({
|
|
|
1757
1881
|
amount: units.toString()
|
|
1758
1882
|
}).then((result) => {
|
|
1759
1883
|
if (cancelled) return;
|
|
1884
|
+
setPreviewSettledKey(quoteRequestKey);
|
|
1885
|
+
if (_chunkHMUGY66Ocjs.isDepositPolicyRefusal.call(void 0, result)) {
|
|
1886
|
+
setQuoteResult(null);
|
|
1887
|
+
setPreviewRefusal({
|
|
1888
|
+
requestKey: quoteRequestKey,
|
|
1889
|
+
refusal: result.policyRefusal
|
|
1890
|
+
});
|
|
1891
|
+
return;
|
|
1892
|
+
}
|
|
1893
|
+
setPreviewRefusal(null);
|
|
1760
1894
|
setQuoteResult(
|
|
1761
1895
|
result === null ? null : { requestKey: quoteRequestKey, quote: result }
|
|
1762
1896
|
);
|
|
1763
1897
|
}).catch(() => {
|
|
1764
1898
|
if (cancelled) return;
|
|
1899
|
+
setPreviewSettledKey(quoteRequestKey);
|
|
1765
1900
|
setQuoteResult(null);
|
|
1766
1901
|
});
|
|
1767
1902
|
return () => {
|
|
@@ -1783,7 +1918,7 @@ function ConfirmStep({
|
|
|
1783
1918
|
let units;
|
|
1784
1919
|
try {
|
|
1785
1920
|
units = _viem.parseUnits.call(void 0, amount, asset.decimals);
|
|
1786
|
-
} catch (
|
|
1921
|
+
} catch (e16) {
|
|
1787
1922
|
return;
|
|
1788
1923
|
}
|
|
1789
1924
|
if (units <= 0n) return;
|
|
@@ -1794,7 +1929,16 @@ function ConfirmStep({
|
|
|
1794
1929
|
amount: units.toString(),
|
|
1795
1930
|
owner: address
|
|
1796
1931
|
}).then((prepared) => {
|
|
1797
|
-
if (cancelled
|
|
1932
|
+
if (cancelled) return;
|
|
1933
|
+
setPermitSettledKey(permitRequestKey);
|
|
1934
|
+
if (prepared === null) return;
|
|
1935
|
+
if (_chunkHMUGY66Ocjs.isDepositPolicyRefusal.call(void 0, prepared)) {
|
|
1936
|
+
setPermitRefusal({
|
|
1937
|
+
requestKey: permitRequestKey,
|
|
1938
|
+
refusal: prepared.policyRefusal
|
|
1939
|
+
});
|
|
1940
|
+
return;
|
|
1941
|
+
}
|
|
1798
1942
|
if (!prepared.available) {
|
|
1799
1943
|
setPermitUnavailable(prepared.reason);
|
|
1800
1944
|
return;
|
|
@@ -1819,6 +1963,7 @@ function ConfirmStep({
|
|
|
1819
1963
|
prepared: authorization
|
|
1820
1964
|
});
|
|
1821
1965
|
}).catch(() => {
|
|
1966
|
+
if (!cancelled) setPermitSettledKey(permitRequestKey);
|
|
1822
1967
|
});
|
|
1823
1968
|
return () => {
|
|
1824
1969
|
cancelled = true;
|
|
@@ -1852,7 +1997,7 @@ function ConfirmStep({
|
|
|
1852
1997
|
let amountUnits;
|
|
1853
1998
|
try {
|
|
1854
1999
|
amountUnits = _viem.parseUnits.call(void 0, amount, asset.decimals);
|
|
1855
|
-
} catch (
|
|
2000
|
+
} catch (e17) {
|
|
1856
2001
|
setError("Please enter a valid amount");
|
|
1857
2002
|
return;
|
|
1858
2003
|
}
|
|
@@ -1860,6 +2005,11 @@ function ConfirmStep({
|
|
|
1860
2005
|
setError("Insufficient balance");
|
|
1861
2006
|
return;
|
|
1862
2007
|
}
|
|
2008
|
+
if (previewPending || permitPending) return;
|
|
2009
|
+
if (blockedReason) {
|
|
2010
|
+
setError(blockedReason);
|
|
2011
|
+
return;
|
|
2012
|
+
}
|
|
1863
2013
|
if (!quote && mustHaveQuote) {
|
|
1864
2014
|
setError("Quote unavailable \u2014 please try again");
|
|
1865
2015
|
return;
|
|
@@ -1917,11 +2067,11 @@ function ConfirmStep({
|
|
|
1917
2067
|
);
|
|
1918
2068
|
} catch (err) {
|
|
1919
2069
|
const raw = err instanceof Error ? err.message : "Signing failed";
|
|
1920
|
-
const safeToTransfer = !submitStarted || err instanceof
|
|
2070
|
+
const safeToTransfer = !submitStarted || err instanceof _chunkHMUGY66Ocjs.PermitDepositSubmitError && err.safeToTransfer;
|
|
1921
2071
|
if (safeToTransfer) setPermitDisabled(true);
|
|
1922
|
-
const message = safeToTransfer ?
|
|
2072
|
+
const message = safeToTransfer ? _chunkHMUGY66Ocjs.formatUserError.call(void 0, raw) : "Deposit submission status is uncertain. Check your activity before trying a transfer.";
|
|
1923
2073
|
setError(message);
|
|
1924
|
-
_optionalChain([onError, 'optionalCall',
|
|
2074
|
+
_optionalChain([onError, 'optionalCall', _76 => _76(message, "PERMIT_ERROR", raw)]);
|
|
1925
2075
|
} finally {
|
|
1926
2076
|
setIsSubmitting(false);
|
|
1927
2077
|
}
|
|
@@ -1940,7 +2090,7 @@ function ConfirmStep({
|
|
|
1940
2090
|
const result = await executeTransfer(amountUnits);
|
|
1941
2091
|
hash = result.txHash;
|
|
1942
2092
|
resolvedSourceToken = result.sourceToken;
|
|
1943
|
-
} else if (
|
|
2093
|
+
} else if (_chunkHMUGY66Ocjs.isNativeAsset.call(void 0, asset)) {
|
|
1944
2094
|
hash = await walletClient.sendTransaction({
|
|
1945
2095
|
account,
|
|
1946
2096
|
chain,
|
|
@@ -1957,7 +2107,7 @@ function ConfirmStep({
|
|
|
1957
2107
|
args: [transferTo, amountUnits]
|
|
1958
2108
|
});
|
|
1959
2109
|
}
|
|
1960
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
2110
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _77 => _77(hash, asset.chainId, amountUnits.toString())]);
|
|
1961
2111
|
onConfirm(
|
|
1962
2112
|
hash,
|
|
1963
2113
|
asset.chainId,
|
|
@@ -1971,18 +2121,18 @@ function ConfirmStep({
|
|
|
1971
2121
|
);
|
|
1972
2122
|
} catch (err) {
|
|
1973
2123
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
1974
|
-
const uncertain =
|
|
1975
|
-
const message = uncertain ? "Deposit submission status is uncertain. Check your activity before trying again." :
|
|
2124
|
+
const uncertain = _chunkHMUGY66Ocjs.isSubmissionUncertain.call(void 0, err);
|
|
2125
|
+
const message = uncertain ? "Deposit submission status is uncertain. Check your activity before trying again." : _chunkHMUGY66Ocjs.formatUserError.call(void 0, raw);
|
|
1976
2126
|
if (uncertain) setSubmissionUncertain(true);
|
|
1977
2127
|
setError(message);
|
|
1978
|
-
_optionalChain([onError, 'optionalCall',
|
|
2128
|
+
_optionalChain([onError, 'optionalCall', _78 => _78(message, "TRANSFER_ERROR", raw)]);
|
|
1979
2129
|
} finally {
|
|
1980
2130
|
setIsSubmitting(false);
|
|
1981
2131
|
}
|
|
1982
2132
|
};
|
|
1983
2133
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
1984
2134
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
1985
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2135
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.WalletIcon, {}), title }),
|
|
1986
2136
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1987
2137
|
ReviewDetails,
|
|
1988
2138
|
{
|
|
@@ -1998,16 +2148,18 @@ function ConfirmStep({
|
|
|
1998
2148
|
fee: { display: feeDisplay, struck: feesFullySponsored }
|
|
1999
2149
|
}
|
|
2000
2150
|
),
|
|
2001
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2151
|
+
(_nullishCoalesce(error, () => ( blockedReason))) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.Callout, { variant: "error", children: _nullishCoalesce(error, () => ( blockedReason)) }),
|
|
2002
2152
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2003
|
-
|
|
2153
|
+
_chunkHMUGY66Ocjs.Button,
|
|
2004
2154
|
{
|
|
2005
2155
|
onClick: handleConfirm,
|
|
2006
2156
|
loading: isSubmitting,
|
|
2007
2157
|
loadingText: permit ? "Waiting for signature..." : "Submitting transaction...",
|
|
2008
2158
|
disabled: (
|
|
2009
2159
|
// An earlier send whose outcome is unknown. Never re-offered.
|
|
2010
|
-
submissionUncertain || //
|
|
2160
|
+
submissionUncertain || // The deposit on screen would be rejected at ingest.
|
|
2161
|
+
blockedReason !== null || // A refusal for what is on screen may still be in flight.
|
|
2162
|
+
previewPending || permitPending || // Signing is off-chain, so a chain mismatch only blocks the
|
|
2011
2163
|
// transfer path.
|
|
2012
2164
|
chainMismatch && !permit || !amount || Number(amount) <= 0 || // Fee-charging route: block until the authoritative quote resolves
|
|
2013
2165
|
// (covers both loading and an unavailable preview). Fee-free routes
|
|
@@ -2027,7 +2179,7 @@ function ConfirmStep({
|
|
|
2027
2179
|
] }),
|
|
2028
2180
|
!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." })
|
|
2029
2181
|
] }),
|
|
2030
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2182
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.PoweredBy, {})
|
|
2031
2183
|
] });
|
|
2032
2184
|
}
|
|
2033
2185
|
|
|
@@ -2049,12 +2201,13 @@ function QrReviewStep({
|
|
|
2049
2201
|
const [quote, setQuote] = _react.useState.call(void 0, { state: "loading", value: null });
|
|
2050
2202
|
const targetChainId = _chunkOY5N3E6Lcjs.targetChainToChainId.call(void 0, targetChain);
|
|
2051
2203
|
const targetSymbol = _chunkOY5N3E6Lcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
2204
|
+
const boundsFor = _chunkHMUGY66Ocjs.useDepositBounds.call(void 0, );
|
|
2052
2205
|
_react.useEffect.call(void 0, () => {
|
|
2053
2206
|
let cancelled = false;
|
|
2054
2207
|
let units;
|
|
2055
2208
|
try {
|
|
2056
2209
|
units = _viem.parseUnits.call(void 0, amount, asset.decimals);
|
|
2057
|
-
} catch (
|
|
2210
|
+
} catch (e18) {
|
|
2058
2211
|
setQuote({ state: "unavailable", value: null });
|
|
2059
2212
|
return;
|
|
2060
2213
|
}
|
|
@@ -2070,6 +2223,14 @@ function QrReviewStep({
|
|
|
2070
2223
|
amount: units.toString()
|
|
2071
2224
|
}).then((result) => {
|
|
2072
2225
|
if (cancelled) return;
|
|
2226
|
+
if (_chunkHMUGY66Ocjs.isDepositPolicyRefusal.call(void 0, result)) {
|
|
2227
|
+
setQuote({
|
|
2228
|
+
state: "refused",
|
|
2229
|
+
value: null,
|
|
2230
|
+
refusal: result.policyRefusal
|
|
2231
|
+
});
|
|
2232
|
+
return;
|
|
2233
|
+
}
|
|
2073
2234
|
setQuote(
|
|
2074
2235
|
result ? { state: "ready", value: result } : { state: "unavailable", value: null }
|
|
2075
2236
|
);
|
|
@@ -2080,30 +2241,30 @@ function QrReviewStep({
|
|
|
2080
2241
|
cancelled = true;
|
|
2081
2242
|
};
|
|
2082
2243
|
}, [service, smartAccount, asset, amount]);
|
|
2083
|
-
const formattedSendAmount = _nullishCoalesce(
|
|
2244
|
+
const formattedSendAmount = _nullishCoalesce(_chunkHMUGY66Ocjs.formatTokenAmount.call(void 0, Number(amount), asset.symbol), () => ( amount));
|
|
2084
2245
|
const receiveDisplay = (() => {
|
|
2085
2246
|
if (quote.value) {
|
|
2086
|
-
const quoted =
|
|
2247
|
+
const quoted = _chunkHMUGY66Ocjs.formatQuotedReceive.call(void 0, quote.value.output, targetSymbol);
|
|
2087
2248
|
if (quoted !== void 0) return quoted;
|
|
2088
2249
|
}
|
|
2089
2250
|
const usdValue = Number(targetAmount);
|
|
2090
|
-
const estimate =
|
|
2251
|
+
const estimate = _chunkHMUGY66Ocjs.formatReceiveEstimate.call(void 0, {
|
|
2091
2252
|
sourceAmount: Number.isFinite(Number(amount)) ? Number(amount) : void 0,
|
|
2092
2253
|
sourceSymbol: asset.symbol,
|
|
2093
2254
|
targetSymbol,
|
|
2094
2255
|
sourceAmountUsd: Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0,
|
|
2095
|
-
sourceTrusted:
|
|
2096
|
-
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } :
|
|
2256
|
+
sourceTrusted: _chunkHMUGY66Ocjs.isRecognizedToken.call(void 0, asset.token, asset.chainId),
|
|
2257
|
+
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : _chunkHMUGY66Ocjs.isDisplayStablecoinSymbol.call(void 0, targetSymbol) ? { [targetSymbol.toUpperCase()]: 1 } : {}
|
|
2097
2258
|
});
|
|
2098
2259
|
return _nullishCoalesce(estimate, () => ( targetSymbol));
|
|
2099
2260
|
})();
|
|
2100
|
-
const expectedSeconds = _nullishCoalesce(_optionalChain([quote, 'access',
|
|
2101
|
-
const estimatedTime = expectedSeconds !== void 0 ?
|
|
2102
|
-
const { display: quotedFee, struck } =
|
|
2103
|
-
const feeDisplay = quote.state === "unavailable" ? "\u2014" : quotedFee;
|
|
2261
|
+
const expectedSeconds = _nullishCoalesce(_optionalChain([quote, 'access', _79 => _79.value, 'optionalAccess', _80 => _80.timing, 'optionalAccess', _81 => _81.expectedSeconds]), () => ( (quote.value && Number.isFinite(quote.value.estimatedFillTimeSeconds) ? quote.value.estimatedFillTimeSeconds : void 0)));
|
|
2262
|
+
const estimatedTime = expectedSeconds !== void 0 ? _chunkHMUGY66Ocjs.formatExpectedDuration.call(void 0, expectedSeconds) : quote.state === "loading" ? "\u2026" : "\u2014";
|
|
2263
|
+
const { display: quotedFee, struck } = _chunkHMUGY66Ocjs.quoteFeeRow.call(void 0, _optionalChain([quote, 'access', _82 => _82.value, 'optionalAccess', _83 => _83.fees]));
|
|
2264
|
+
const feeDisplay = quote.state === "unavailable" || quote.state === "refused" ? "\u2014" : quotedFee;
|
|
2104
2265
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
2105
2266
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2106
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2267
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.TransferCryptoIcon, {}), title: "Fee estimate" }),
|
|
2107
2268
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2108
2269
|
ReviewDetails,
|
|
2109
2270
|
{
|
|
@@ -2119,9 +2280,13 @@ function QrReviewStep({
|
|
|
2119
2280
|
fee: { display: feeDisplay, struck }
|
|
2120
2281
|
}
|
|
2121
2282
|
),
|
|
2122
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2283
|
+
quote.state === "refused" && quote.refusal && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.Callout, { variant: "error", children: _chunkHMUGY66Ocjs.describePolicyRefusal.call(void 0,
|
|
2284
|
+
quote.refusal,
|
|
2285
|
+
boundsFor(asset.chainId, asset.token)
|
|
2286
|
+
) }),
|
|
2287
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.Button, { onClick: onClose, fullWidth: true, children: "Close" })
|
|
2123
2288
|
] }),
|
|
2124
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2289
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.PoweredBy, {})
|
|
2125
2290
|
] });
|
|
2126
2291
|
}
|
|
2127
2292
|
QrReviewStep.displayName = "QrReviewStep";
|
|
@@ -2137,6 +2302,7 @@ QrReviewStep.displayName = "QrReviewStep";
|
|
|
2137
2302
|
|
|
2138
2303
|
|
|
2139
2304
|
|
|
2305
|
+
|
|
2140
2306
|
// src/components/steps/DepositAddressSkeleton.tsx
|
|
2141
2307
|
|
|
2142
2308
|
var BASE_CHAIN_ID = 8453;
|
|
@@ -2152,20 +2318,20 @@ function DepositAddressSkeleton({
|
|
|
2152
2318
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", "aria-busy": "true", children: [
|
|
2153
2319
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: "Preparing deposit details\u2026" }),
|
|
2154
2320
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
2155
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2321
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
2156
2322
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", "aria-hidden": "true", children: [
|
|
2157
2323
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
2158
2324
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
2159
2325
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown-trigger", children: [
|
|
2160
2326
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2161
|
-
|
|
2327
|
+
_chunkHMUGY66Ocjs.CdnIcon,
|
|
2162
2328
|
{
|
|
2163
2329
|
src: chainIcon,
|
|
2164
2330
|
className: "rs-deposit-address-dropdown-icon"
|
|
2165
2331
|
}
|
|
2166
2332
|
),
|
|
2167
2333
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainName }),
|
|
2168
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2334
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2169
2335
|
] })
|
|
2170
2336
|
] }),
|
|
2171
2337
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
@@ -2173,9 +2339,9 @@ function DepositAddressSkeleton({
|
|
|
2173
2339
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Supported token" }),
|
|
2174
2340
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
2175
2341
|
"Min.$",
|
|
2176
|
-
(_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
2177
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2178
|
-
|
|
2342
|
+
(_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _84 => _84.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
2343
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2344
|
+
_chunkHMUGY66Ocjs.InfoIcon,
|
|
2179
2345
|
{
|
|
2180
2346
|
className: "rs-deposit-address-min-icon",
|
|
2181
2347
|
"aria-hidden": "true"
|
|
@@ -2185,14 +2351,14 @@ function DepositAddressSkeleton({
|
|
|
2185
2351
|
] }),
|
|
2186
2352
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown-trigger", children: [
|
|
2187
2353
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2188
|
-
|
|
2354
|
+
_chunkHMUGY66Ocjs.TokenIcon,
|
|
2189
2355
|
{
|
|
2190
2356
|
symbol: defaultToken,
|
|
2191
2357
|
className: "rs-deposit-address-dropdown-icon"
|
|
2192
2358
|
}
|
|
2193
2359
|
),
|
|
2194
2360
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: defaultToken }),
|
|
2195
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2361
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2196
2362
|
] })
|
|
2197
2363
|
] })
|
|
2198
2364
|
] }),
|
|
@@ -2207,7 +2373,7 @@ function DepositAddressSkeleton({
|
|
|
2207
2373
|
] }),
|
|
2208
2374
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-actions", "aria-hidden": "true", children: [
|
|
2209
2375
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "button", { type: "button", className: "rs-deposit-address-copy", disabled: true, children: [
|
|
2210
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2376
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.CopyIcon, {}),
|
|
2211
2377
|
"Copy address"
|
|
2212
2378
|
] }),
|
|
2213
2379
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2224,7 +2390,7 @@ function DepositAddressSkeleton({
|
|
|
2224
2390
|
}
|
|
2225
2391
|
)
|
|
2226
2392
|
] }),
|
|
2227
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2393
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.PoweredBy, {})
|
|
2228
2394
|
] });
|
|
2229
2395
|
}
|
|
2230
2396
|
DepositAddressSkeleton.displayName = "DepositAddressSkeleton";
|
|
@@ -2236,9 +2402,9 @@ var INITIAL_POLL_INTERVAL = 3e3;
|
|
|
2236
2402
|
var MAX_POLL_INTERVAL = 3e4;
|
|
2237
2403
|
var BACKOFF_MULTIPLIER = 1.5;
|
|
2238
2404
|
function isEventForTx(event, txHash) {
|
|
2239
|
-
const eventTxHash =
|
|
2405
|
+
const eventTxHash = _chunkHMUGY66Ocjs.getEventTxHash.call(void 0, event);
|
|
2240
2406
|
if (!eventTxHash) return false;
|
|
2241
|
-
return
|
|
2407
|
+
return _chunkHMUGY66Ocjs.txRefsMatch.call(void 0, eventTxHash, txHash);
|
|
2242
2408
|
}
|
|
2243
2409
|
function truncateHash(hash) {
|
|
2244
2410
|
return `${hash.slice(0, 4)}\u2026${hash.slice(-4)}`;
|
|
@@ -2268,7 +2434,7 @@ function formatTimestamp(ms) {
|
|
|
2268
2434
|
return `${month} ${day}${suffix} \xB7 ${hours}:${minutes}:${seconds}`;
|
|
2269
2435
|
}
|
|
2270
2436
|
function formatBridgeFailedMessage(event) {
|
|
2271
|
-
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess',
|
|
2437
|
+
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _85 => _85.data]), () => ( {}));
|
|
2272
2438
|
const backendMessage = typeof eventData.message === "string" ? eventData.message.trim() : "";
|
|
2273
2439
|
if (backendMessage.length > 0) {
|
|
2274
2440
|
const lower = backendMessage.toLowerCase();
|
|
@@ -2288,7 +2454,7 @@ function formatBridgeFailedMessage(event) {
|
|
|
2288
2454
|
}
|
|
2289
2455
|
return "Bridge failed";
|
|
2290
2456
|
}
|
|
2291
|
-
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2457
|
+
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.ExternalLinkIcon, { className: "rs-deposit-notification-link-icon" });
|
|
2292
2458
|
function DepositNotification({
|
|
2293
2459
|
deposit,
|
|
2294
2460
|
smartAccount,
|
|
@@ -2322,7 +2488,7 @@ function DepositNotification({
|
|
|
2322
2488
|
const pollIntervalRef = _react.useRef.call(void 0, INITIAL_POLL_INTERVAL);
|
|
2323
2489
|
const pollTimeoutRef = _react.useRef.call(void 0, null);
|
|
2324
2490
|
const completedRef = _react.useRef.call(void 0, false);
|
|
2325
|
-
const depositContextRef =
|
|
2491
|
+
const depositContextRef = _chunkHMUGY66Ocjs.useLatestRef.call(void 0, {
|
|
2326
2492
|
amount,
|
|
2327
2493
|
sourceChain,
|
|
2328
2494
|
sourceToken: token,
|
|
@@ -2330,23 +2496,24 @@ function DepositNotification({
|
|
|
2330
2496
|
targetChain,
|
|
2331
2497
|
targetToken
|
|
2332
2498
|
});
|
|
2333
|
-
const onCompleteRef =
|
|
2334
|
-
const onFailedRef =
|
|
2499
|
+
const onCompleteRef = _chunkHMUGY66Ocjs.useLatestRef.call(void 0, onComplete);
|
|
2500
|
+
const onFailedRef = _chunkHMUGY66Ocjs.useLatestRef.call(void 0, onFailed);
|
|
2335
2501
|
const handleComplete = _react.useCallback.call(void 0,
|
|
2336
|
-
(destTxHash) => {
|
|
2502
|
+
(destTxHash, destAmount) => {
|
|
2337
2503
|
if (completedRef.current) return;
|
|
2338
2504
|
completedRef.current = true;
|
|
2339
2505
|
setDestinationTxHash(_nullishCoalesce(destTxHash, () => ( null)));
|
|
2340
2506
|
setCompletedAt(Date.now());
|
|
2341
2507
|
setStatus("complete");
|
|
2342
2508
|
const context = depositContextRef.current;
|
|
2343
|
-
_optionalChain([onCompleteRef, 'access',
|
|
2509
|
+
_optionalChain([onCompleteRef, 'access', _86 => _86.current, 'optionalCall', _87 => _87(txHash, destTxHash, {
|
|
2344
2510
|
amount: context.amount,
|
|
2345
2511
|
sourceChain: context.sourceChain,
|
|
2346
2512
|
sourceToken: context.sourceToken,
|
|
2347
2513
|
sourceDecimals: context.sourceDecimals,
|
|
2348
2514
|
targetChain: context.targetChain,
|
|
2349
|
-
targetToken: context.targetToken
|
|
2515
|
+
targetToken: context.targetToken,
|
|
2516
|
+
destinationAmount: destAmount
|
|
2350
2517
|
})]);
|
|
2351
2518
|
},
|
|
2352
2519
|
[depositContextRef, onCompleteRef, txHash]
|
|
@@ -2356,7 +2523,7 @@ function DepositNotification({
|
|
|
2356
2523
|
if (completedRef.current) return;
|
|
2357
2524
|
completedRef.current = true;
|
|
2358
2525
|
setStatus("failed");
|
|
2359
|
-
_optionalChain([onFailedRef, 'access',
|
|
2526
|
+
_optionalChain([onFailedRef, 'access', _88 => _88.current, 'optionalCall', _89 => _89(txHash, error)]);
|
|
2360
2527
|
},
|
|
2361
2528
|
[onFailedRef, txHash]
|
|
2362
2529
|
);
|
|
@@ -2374,22 +2541,25 @@ function DepositNotification({
|
|
|
2374
2541
|
if (!isMounted) return;
|
|
2375
2542
|
const lastEvent = data.lastEvent;
|
|
2376
2543
|
const eventForTx = isEventForTx(lastEvent, txHash) ? lastEvent : void 0;
|
|
2377
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
2378
|
-
const
|
|
2379
|
-
handleComplete(
|
|
2544
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _90 => _90.type]) === "bridge-complete") {
|
|
2545
|
+
const destination = _optionalChain([eventForTx, 'access', _91 => _91.data, 'optionalAccess', _92 => _92.destination]);
|
|
2546
|
+
handleComplete(
|
|
2547
|
+
_optionalChain([destination, 'optionalAccess', _93 => _93.transactionHash]),
|
|
2548
|
+
typeof _optionalChain([destination, 'optionalAccess', _94 => _94.amount]) === "string" ? destination.amount : void 0
|
|
2549
|
+
);
|
|
2380
2550
|
return;
|
|
2381
2551
|
}
|
|
2382
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
2552
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _95 => _95.type]) === "bridge-failed") {
|
|
2383
2553
|
handleFailed(formatBridgeFailedMessage(eventForTx));
|
|
2384
2554
|
return;
|
|
2385
2555
|
}
|
|
2386
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
2387
|
-
const errorMessage = _nullishCoalesce(_optionalChain([eventForTx, 'access',
|
|
2556
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _96 => _96.type]) === "error") {
|
|
2557
|
+
const errorMessage = _nullishCoalesce(_optionalChain([eventForTx, 'access', _97 => _97.data, 'optionalAccess', _98 => _98.message]), () => ( "Unknown error"));
|
|
2388
2558
|
handleFailed(errorMessage);
|
|
2389
2559
|
return;
|
|
2390
2560
|
}
|
|
2391
2561
|
scheduleNextPoll();
|
|
2392
|
-
} catch (
|
|
2562
|
+
} catch (e19) {
|
|
2393
2563
|
scheduleNextPoll();
|
|
2394
2564
|
}
|
|
2395
2565
|
}
|
|
@@ -2422,12 +2592,12 @@ function DepositNotification({
|
|
|
2422
2592
|
status,
|
|
2423
2593
|
txHash
|
|
2424
2594
|
]);
|
|
2425
|
-
const explorerTxUrl =
|
|
2595
|
+
const explorerTxUrl = _chunkHMUGY66Ocjs.useExplorerTxUrl.call(void 0, );
|
|
2426
2596
|
const sourceExplorerUrl = sourceChain === "unknown" ? void 0 : explorerTxUrl(sourceChain, txHash);
|
|
2427
2597
|
const destExplorerUrl = destinationTxHash ? explorerTxUrl(_chunkOY5N3E6Lcjs.targetChainToChainId.call(void 0, targetChain), destinationTxHash) : null;
|
|
2428
2598
|
const title = status === "complete" ? "Deposit completed" : status === "failed" ? "Deposit failed" : "Deposit received and processing\u2026";
|
|
2429
2599
|
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.";
|
|
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,
|
|
2600
|
+
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, _chunkHMUGY66Ocjs.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, _chunkHMUGY66Ocjs.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,
|
|
2431
2601
|
"svg",
|
|
2432
2602
|
{
|
|
2433
2603
|
className: "rs-deposit-notification-spinner",
|
|
@@ -2477,7 +2647,7 @@ function DepositNotification({
|
|
|
2477
2647
|
className: "rs-deposit-notification-close",
|
|
2478
2648
|
onClick: () => onDismiss(deposit.id),
|
|
2479
2649
|
"aria-label": "Dismiss",
|
|
2480
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2650
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.CloseIcon, {})
|
|
2481
2651
|
}
|
|
2482
2652
|
)
|
|
2483
2653
|
] }),
|
|
@@ -2493,7 +2663,7 @@ function DepositNotification({
|
|
|
2493
2663
|
"aria-expanded": expanded,
|
|
2494
2664
|
children: [
|
|
2495
2665
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: expanded ? "See less details" : "See more details" }),
|
|
2496
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2666
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.ChevronDownIcon, { className: "rs-deposit-notification-toggle-chevron" })
|
|
2497
2667
|
]
|
|
2498
2668
|
}
|
|
2499
2669
|
),
|
|
@@ -2544,6 +2714,15 @@ function DepositNotification({
|
|
|
2544
2714
|
);
|
|
2545
2715
|
}
|
|
2546
2716
|
|
|
2717
|
+
// src/core/payment-uri.ts
|
|
2718
|
+
function paymentRequestUri(input) {
|
|
2719
|
+
const { to, chainId, token, amount } = input;
|
|
2720
|
+
if (token.toLowerCase() === _chunkOY5N3E6Lcjs.NATIVE_TOKEN_ADDRESS.toLowerCase() || token.toLowerCase() === "0x0") {
|
|
2721
|
+
return `ethereum:${to}@${chainId}?value=${amount}`;
|
|
2722
|
+
}
|
|
2723
|
+
return `ethereum:${token}@${chainId}/transfer?address=${to}&uint256=${amount}`;
|
|
2724
|
+
}
|
|
2725
|
+
|
|
2547
2726
|
// src/core/deposit-source-identity.ts
|
|
2548
2727
|
var SOLANA_NATIVE_MINT = "11111111111111111111111111111111";
|
|
2549
2728
|
var EVM_ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
@@ -2553,18 +2732,19 @@ function sourceChainToCaip2(chain) {
|
|
|
2553
2732
|
return _chunkOY5N3E6Lcjs.toEvmCaip2.call(void 0, chain);
|
|
2554
2733
|
}
|
|
2555
2734
|
function findAddress(tokens, symbol) {
|
|
2556
|
-
return _optionalChain([tokens, 'optionalAccess',
|
|
2735
|
+
return _optionalChain([tokens, 'optionalAccess', _99 => _99.find, 'call', _100 => _100((t) => t.symbol.toLowerCase() === symbol.toLowerCase()), 'optionalAccess', _101 => _101.address]);
|
|
2557
2736
|
}
|
|
2558
2737
|
function resolveSourceTokenIdentity(input) {
|
|
2559
2738
|
const { chain, symbol, shortlist, catalogTokens } = input;
|
|
2560
2739
|
if (!symbol) return void 0;
|
|
2561
|
-
const shortlistTokens = _optionalChain([shortlist, 'optionalAccess',
|
|
2740
|
+
const shortlistTokens = _optionalChain([shortlist, 'optionalAccess', _102 => _102[String(chain)]]);
|
|
2562
2741
|
const raw = shortlistTokens !== void 0 ? findAddress(shortlistTokens, symbol) : chain === "hypercore" || !Array.isArray(catalogTokens) ? void 0 : findAddress(catalogTokens, symbol);
|
|
2563
2742
|
if (!raw) return void 0;
|
|
2564
2743
|
if (chain === "solana") {
|
|
2565
2744
|
const isNative = raw.toLowerCase() === "native" || raw.toLowerCase() === EVM_ZERO_ADDRESS;
|
|
2566
2745
|
return isNative ? SOLANA_NATIVE_MINT : raw;
|
|
2567
2746
|
}
|
|
2747
|
+
if (raw.toLowerCase() === "0x0") return EVM_ZERO_ADDRESS;
|
|
2568
2748
|
return raw.toLowerCase();
|
|
2569
2749
|
}
|
|
2570
2750
|
|
|
@@ -2574,6 +2754,7 @@ var QRCode = _react.lazy.call(void 0,
|
|
|
2574
2754
|
() => Promise.resolve().then(() => _interopRequireWildcard(require("./QRCode-JKXG4RHN.cjs"))).then((m) => ({ default: m.QRCode }))
|
|
2575
2755
|
);
|
|
2576
2756
|
var POLL_INTERVAL_MS = 4e3;
|
|
2757
|
+
var PAYMENT_QUOTE_REFRESH_MS2 = 3e4;
|
|
2577
2758
|
function isRecord(value) {
|
|
2578
2759
|
return typeof value === "object" && value !== null;
|
|
2579
2760
|
}
|
|
@@ -2619,7 +2800,7 @@ function resolveSolanaTokenMeta(token) {
|
|
|
2619
2800
|
return {};
|
|
2620
2801
|
}
|
|
2621
2802
|
function getDepositEventDetails(event) {
|
|
2622
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
2803
|
+
if (!_optionalChain([event, 'optionalAccess', _103 => _103.type]) || !isRecord(event.data)) return {};
|
|
2623
2804
|
if (event.type === "deposit-received") {
|
|
2624
2805
|
const chainId = asChainId(event.data.chain);
|
|
2625
2806
|
const token = asString(event.data.token);
|
|
@@ -2634,12 +2815,12 @@ function getDepositEventDetails(event) {
|
|
|
2634
2815
|
const source = isRecord(event.data.source) ? event.data.source : void 0;
|
|
2635
2816
|
const deposit = isRecord(event.data.deposit) ? event.data.deposit : void 0;
|
|
2636
2817
|
if (source || deposit) {
|
|
2637
|
-
const chainId = _nullishCoalesce(asChainId(_optionalChain([source, 'optionalAccess',
|
|
2638
|
-
const token = _nullishCoalesce(_nullishCoalesce(asString(_optionalChain([source, 'optionalAccess',
|
|
2818
|
+
const chainId = _nullishCoalesce(asChainId(_optionalChain([source, 'optionalAccess', _104 => _104.chain])), () => ( asChainId(_optionalChain([deposit, 'optionalAccess', _105 => _105.chain]))));
|
|
2819
|
+
const token = _nullishCoalesce(_nullishCoalesce(asString(_optionalChain([source, 'optionalAccess', _106 => _106.asset])), () => ( asString(_optionalChain([deposit, 'optionalAccess', _107 => _107.asset])))), () => ( asString(_optionalChain([deposit, 'optionalAccess', _108 => _108.token]))));
|
|
2639
2820
|
const solanaMeta = chainId === "solana" ? resolveSolanaTokenMeta(token) : {};
|
|
2640
2821
|
return {
|
|
2641
2822
|
chainId,
|
|
2642
|
-
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess',
|
|
2823
|
+
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess', _109 => _109.amount])), () => ( asAmount(_optionalChain([deposit, 'optionalAccess', _110 => _110.amount])))),
|
|
2643
2824
|
token,
|
|
2644
2825
|
...solanaMeta
|
|
2645
2826
|
};
|
|
@@ -2650,22 +2831,20 @@ function isSameRoute(sourceChain, sourceToken, targetChain, targetToken) {
|
|
|
2650
2831
|
return sourceChain === targetChain && sourceToken.toLowerCase() === targetToken.toLowerCase();
|
|
2651
2832
|
}
|
|
2652
2833
|
function chainLabel(chainId, catalogChain) {
|
|
2653
|
-
const name = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess',
|
|
2834
|
+
const name = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _111 => _111.name]), () => ( _chunkOY5N3E6Lcjs.getChainName.call(void 0, chainId)));
|
|
2654
2835
|
return name.replace(/\s+(One|Mainnet|Smart Chain|Chain)$/i, "");
|
|
2655
2836
|
}
|
|
2656
|
-
function computeTokensForChain(chainId,
|
|
2657
|
-
const
|
|
2658
|
-
if (
|
|
2659
|
-
return Array.isArray(_optionalChain([catalogChain, 'optionalAccess',
|
|
2837
|
+
function computeTokensForChain(chainId, offer, catalogChain) {
|
|
2838
|
+
const listed = _optionalChain([offer, 'access', _112 => _112.tokensFor, 'call', _113 => _113(chainId), 'optionalAccess', _114 => _114.map, 'call', _115 => _115((t) => t.symbol)]);
|
|
2839
|
+
if (listed) return listed;
|
|
2840
|
+
return Array.isArray(_optionalChain([catalogChain, 'optionalAccess', _116 => _116.supportedTokens])) ? catalogChain.supportedTokens.map((t) => t.symbol) : [];
|
|
2660
2841
|
}
|
|
2661
|
-
function selectionAsAsset(chainId, symbol,
|
|
2842
|
+
function selectionAsAsset(chainId, symbol, offer, catalogChain) {
|
|
2662
2843
|
if (typeof chainId !== "number" || !symbol) return void 0;
|
|
2663
|
-
const fromShortlist = _optionalChain([
|
|
2664
|
-
|
|
2665
|
-
)]);
|
|
2666
|
-
const
|
|
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])));
|
|
2844
|
+
const fromShortlist = _optionalChain([offer, 'access', _117 => _117.tokensFor, 'call', _118 => _118(chainId), 'optionalAccess', _119 => _119.find, 'call', _120 => _120((t) => t.symbol === symbol)]);
|
|
2845
|
+
const fromCatalog = !offer.restricted && Array.isArray(_optionalChain([catalogChain, 'optionalAccess', _121 => _121.supportedTokens])) ? catalogChain.supportedTokens.find((t) => t.symbol === symbol) : void 0;
|
|
2846
|
+
const address = _nullishCoalesce(_optionalChain([fromShortlist, 'optionalAccess', _122 => _122.address]), () => ( _optionalChain([fromCatalog, 'optionalAccess', _123 => _123.address])));
|
|
2847
|
+
const decimals = _nullishCoalesce(_optionalChain([fromShortlist, 'optionalAccess', _124 => _124.decimals]), () => ( _optionalChain([fromCatalog, 'optionalAccess', _125 => _125.decimals])));
|
|
2669
2848
|
if (!address || decimals === void 0) return void 0;
|
|
2670
2849
|
return {
|
|
2671
2850
|
id: `qr-${chainId}-${symbol}`,
|
|
@@ -2678,7 +2857,7 @@ function selectionAsAsset(chainId, symbol, topTokens, catalogChain) {
|
|
|
2678
2857
|
}
|
|
2679
2858
|
function TokenGlyph({ symbol }) {
|
|
2680
2859
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2681
|
-
|
|
2860
|
+
_chunkHMUGY66Ocjs.TokenIcon,
|
|
2682
2861
|
{
|
|
2683
2862
|
symbol,
|
|
2684
2863
|
className: "rs-deposit-address-dropdown-icon",
|
|
@@ -2703,53 +2882,39 @@ function DepositAddressStep({
|
|
|
2703
2882
|
onDepositComplete,
|
|
2704
2883
|
onDepositFailed,
|
|
2705
2884
|
onAddressShown,
|
|
2885
|
+
payment,
|
|
2706
2886
|
onCopyAddress,
|
|
2707
2887
|
onReviewDeposit,
|
|
2708
2888
|
onError
|
|
2709
2889
|
}) {
|
|
2710
2890
|
const hasSolana = Boolean(solanaDepositAddress);
|
|
2711
|
-
const
|
|
2712
|
-
const [topTokensSettled, setTopTokensSettled] = _react.useState.call(void 0, false);
|
|
2713
|
-
_react.useEffect.call(void 0, () => {
|
|
2714
|
-
let active = true;
|
|
2715
|
-
setTopTokens(null);
|
|
2716
|
-
setTopTokensSettled(false);
|
|
2717
|
-
service.getTopTokens().then((t) => {
|
|
2718
|
-
if (!active) return;
|
|
2719
|
-
setTopTokens(t);
|
|
2720
|
-
setTopTokensSettled(true);
|
|
2721
|
-
if (t) _chunkOY5N3E6Lcjs.publishShortlistTokens.call(void 0, t);
|
|
2722
|
-
});
|
|
2723
|
-
return () => {
|
|
2724
|
-
active = false;
|
|
2725
|
-
};
|
|
2726
|
-
}, [service]);
|
|
2891
|
+
const offer = _chunkHMUGY66Ocjs.useDepositOffer.call(void 0, );
|
|
2727
2892
|
const BASE_CHAIN_ID2 = 8453;
|
|
2728
|
-
const evmChainIds =
|
|
2729
|
-
const { catalog, isLoading: catalogLoading } =
|
|
2893
|
+
const evmChainIds = _chunkHMUGY66Ocjs.useDepositChainIds.call(void 0, );
|
|
2894
|
+
const { catalog, isLoading: catalogLoading, shortlist } = _chunkHMUGY66Ocjs.useChainCatalog.call(void 0, );
|
|
2730
2895
|
const catalogFor = _react.useCallback.call(void 0,
|
|
2731
2896
|
(chain) => {
|
|
2732
2897
|
if (!catalog) return void 0;
|
|
2733
|
-
const key =
|
|
2898
|
+
const key = _chunkHMUGY66Ocjs.catalogKeyForChain.call(void 0, chain);
|
|
2734
2899
|
return typeof key === "number" ? catalog.byChainId.get(key) : catalog.byCaip2.get(key);
|
|
2735
2900
|
},
|
|
2736
2901
|
[catalog]
|
|
2737
2902
|
);
|
|
2738
2903
|
const chainOptions = _react.useMemo.call(void 0, () => {
|
|
2739
|
-
const acceptsDeposits = (chain) => _optionalChain([catalogFor, 'call',
|
|
2904
|
+
const acceptsDeposits = (chain) => _optionalChain([catalogFor, 'call', _126 => _126(chain), 'optionalAccess', _127 => _127.deposit]) !== false;
|
|
2740
2905
|
const options = [...evmChainIds];
|
|
2741
2906
|
const extras = [];
|
|
2742
2907
|
if (hasSolana && acceptsDeposits("solana")) extras.push("solana");
|
|
2743
2908
|
if (acceptsDeposits("hypercore")) extras.push("hypercore");
|
|
2744
2909
|
options.splice(1, 0, ...extras);
|
|
2745
2910
|
return options.filter(
|
|
2746
|
-
(chain) =>
|
|
2911
|
+
(chain) => offer.isChainOffered(chain) && computeTokensForChain(chain, offer, catalogFor(chain)).length > 0
|
|
2747
2912
|
);
|
|
2748
|
-
}, [evmChainIds, hasSolana,
|
|
2913
|
+
}, [evmChainIds, hasSolana, offer, catalogFor]);
|
|
2749
2914
|
const preferredChainId = (options) => options.includes(BASE_CHAIN_ID2) ? BASE_CHAIN_ID2 : _nullishCoalesce(options[0], () => ( BASE_CHAIN_ID2));
|
|
2750
|
-
const [sourceChainId, setSourceChainId] = _react.useState.call(void 0, () => _nullishCoalesce(_optionalChain([initialSource, 'optionalAccess',
|
|
2915
|
+
const [sourceChainId, setSourceChainId] = _react.useState.call(void 0, () => _nullishCoalesce(_optionalChain([initialSource, 'optionalAccess', _128 => _128.chainId]), () => ( preferredChainId(chainOptions))));
|
|
2751
2916
|
const chainChosenByUser = _react.useRef.call(void 0, initialSource !== void 0);
|
|
2752
|
-
const pendingChainRef = _react.useRef.call(void 0, _optionalChain([initialSource, 'optionalAccess',
|
|
2917
|
+
const pendingChainRef = _react.useRef.call(void 0, _optionalChain([initialSource, 'optionalAccess', _129 => _129.chainId]));
|
|
2753
2918
|
_react.useEffect.call(void 0, () => {
|
|
2754
2919
|
if (chainOptions.length === 0) return;
|
|
2755
2920
|
const pendingChain2 = pendingChainRef.current;
|
|
@@ -2759,24 +2924,24 @@ function DepositAddressStep({
|
|
|
2759
2924
|
setSourceChainId(pendingChain2);
|
|
2760
2925
|
return;
|
|
2761
2926
|
}
|
|
2762
|
-
if (catalogLoading ||
|
|
2927
|
+
if (catalogLoading || offer.status !== "ready") return;
|
|
2763
2928
|
pendingChainRef.current = void 0;
|
|
2764
2929
|
}
|
|
2765
2930
|
const stale = chainChosenByUser.current ? !chainOptions.includes(sourceChainId) : sourceChainId !== preferredChainId(chainOptions);
|
|
2766
2931
|
if (stale) setSourceChainId(preferredChainId(chainOptions));
|
|
2767
|
-
}, [chainOptions, sourceChainId, catalogLoading,
|
|
2932
|
+
}, [chainOptions, sourceChainId, catalogLoading, offer.status]);
|
|
2768
2933
|
const isSolana = sourceChainId === "solana";
|
|
2769
2934
|
const isHyperCore = sourceChainId === "hypercore";
|
|
2770
2935
|
const tokensForChain = _react.useMemo.call(void 0,
|
|
2771
|
-
() => computeTokensForChain(sourceChainId,
|
|
2772
|
-
[sourceChainId,
|
|
2936
|
+
() => computeTokensForChain(sourceChainId, offer, catalogFor(sourceChainId)),
|
|
2937
|
+
[sourceChainId, offer, catalogFor]
|
|
2773
2938
|
);
|
|
2774
2939
|
const defaultToken = pickFallbackToken(
|
|
2775
2940
|
tokensForChain,
|
|
2776
|
-
_nullishCoalesce(_optionalChain([initialSource, 'optionalAccess',
|
|
2941
|
+
_nullishCoalesce(_optionalChain([initialSource, 'optionalAccess', _130 => _130.symbol]), () => ( "USDC"))
|
|
2777
2942
|
);
|
|
2778
2943
|
const [sourceTokenSymbol, setSourceTokenSymbol] = _react.useState.call(void 0, defaultToken);
|
|
2779
|
-
const pendingTokenRef = _react.useRef.call(void 0, _optionalChain([initialSource, 'optionalAccess',
|
|
2944
|
+
const pendingTokenRef = _react.useRef.call(void 0, _optionalChain([initialSource, 'optionalAccess', _131 => _131.symbol]));
|
|
2780
2945
|
_react.useEffect.call(void 0, () => {
|
|
2781
2946
|
if (tokensForChain.includes(sourceTokenSymbol)) {
|
|
2782
2947
|
pendingTokenRef.current = void 0;
|
|
@@ -2803,21 +2968,60 @@ function DepositAddressStep({
|
|
|
2803
2968
|
const baselineTxHashRef = _react.useRef.call(void 0, void 0);
|
|
2804
2969
|
const notificationIdRef = _react.useRef.call(void 0, 0);
|
|
2805
2970
|
const displayAddress = isSolana && solanaDepositAddress ? solanaDepositAddress : smartAccount;
|
|
2971
|
+
const [paymentUnits, setPaymentUnits] = _react.useState.call(void 0, "loading");
|
|
2806
2972
|
const sourceTokenIdentity = _react.useMemo.call(void 0,
|
|
2807
2973
|
() => resolveSourceTokenIdentity({
|
|
2808
2974
|
chain: sourceChainId,
|
|
2809
2975
|
symbol: sourceTokenSymbol,
|
|
2810
|
-
shortlist
|
|
2811
|
-
catalogTokens: _optionalChain([catalogFor, 'call',
|
|
2976
|
+
shortlist,
|
|
2977
|
+
catalogTokens: offer.restricted ? void 0 : _optionalChain([catalogFor, 'call', _132 => _132(sourceChainId), 'optionalAccess', _133 => _133.supportedTokens])
|
|
2812
2978
|
}),
|
|
2813
|
-
[sourceChainId, sourceTokenSymbol,
|
|
2979
|
+
[sourceChainId, sourceTokenSymbol, shortlist, offer.restricted, catalogFor]
|
|
2814
2980
|
);
|
|
2981
|
+
_react.useEffect.call(void 0, () => {
|
|
2982
|
+
if (!payment) return;
|
|
2983
|
+
if (typeof sourceChainId !== "number" || !sourceTokenIdentity) {
|
|
2984
|
+
setPaymentUnits("unavailable");
|
|
2985
|
+
return;
|
|
2986
|
+
}
|
|
2987
|
+
setPaymentUnits("loading");
|
|
2988
|
+
let active = true;
|
|
2989
|
+
const load = async () => {
|
|
2990
|
+
const quote = await service.getQuotePreview({
|
|
2991
|
+
account: smartAccount,
|
|
2992
|
+
sourceChainId,
|
|
2993
|
+
sourceToken: sourceTokenIdentity,
|
|
2994
|
+
direction: "exactOut",
|
|
2995
|
+
amountOut: payment.amount
|
|
2996
|
+
});
|
|
2997
|
+
if (!active) return;
|
|
2998
|
+
const answered = quote && "output" in quote ? _optionalChain([quote, 'access', _134 => _134.input, 'optionalAccess', _135 => _135.amount]) : void 0;
|
|
2999
|
+
setPaymentUnits(_nullishCoalesce(answered, () => ( "unavailable")));
|
|
3000
|
+
};
|
|
3001
|
+
void load();
|
|
3002
|
+
const timer = setInterval(load, PAYMENT_QUOTE_REFRESH_MS2);
|
|
3003
|
+
return () => {
|
|
3004
|
+
active = false;
|
|
3005
|
+
clearInterval(timer);
|
|
3006
|
+
};
|
|
3007
|
+
}, [payment, sourceChainId, sourceTokenIdentity, smartAccount, service]);
|
|
3008
|
+
const paymentDecimals = typeof sourceChainId === "number" && sourceTokenIdentity ? _chunkOY5N3E6Lcjs.findTokenDecimals.call(void 0, sourceTokenIdentity, sourceChainId) : void 0;
|
|
3009
|
+
const paymentAmountUnits = payment && paymentUnits !== "loading" && paymentUnits !== "unavailable" ? paymentUnits : null;
|
|
3010
|
+
const paymentDisplay = paymentAmountUnits !== null && paymentDecimals !== void 0 ? _viem.formatUnits.call(void 0, BigInt(paymentAmountUnits), paymentDecimals) : null;
|
|
3011
|
+
const qrValue = paymentAmountUnits !== null && typeof sourceChainId === "number" && sourceTokenIdentity ? paymentRequestUri({
|
|
3012
|
+
to: displayAddress,
|
|
3013
|
+
chainId: sourceChainId,
|
|
3014
|
+
token: sourceTokenIdentity,
|
|
3015
|
+
amount: paymentAmountUnits
|
|
3016
|
+
}) : displayAddress;
|
|
3017
|
+
const withholdPaymentQr = Boolean(payment) && paymentAmountUnits === null;
|
|
3018
|
+
const paymentUnquotable = Boolean(payment) && paymentUnits === "unavailable";
|
|
2815
3019
|
const pendingChain = pendingChainRef.current;
|
|
2816
|
-
const sourceSelectionSettled = !catalogLoading &&
|
|
3020
|
+
const sourceSelectionSettled = !catalogLoading && offer.status === "ready" && chainOptions.length > 0 && (pendingChain === void 0 || pendingChain === sourceChainId) && (chainChosenByUser.current ? chainOptions.includes(sourceChainId) : sourceChainId === preferredChainId(chainOptions));
|
|
2817
3021
|
_react.useEffect.call(void 0, () => {
|
|
2818
3022
|
if (!sourceTokenIdentity) return;
|
|
2819
3023
|
if (!sourceSelectionSettled) return;
|
|
2820
|
-
_optionalChain([onAddressShown, 'optionalCall',
|
|
3024
|
+
_optionalChain([onAddressShown, 'optionalCall', _136 => _136({
|
|
2821
3025
|
address: displayAddress,
|
|
2822
3026
|
sourceChainCaip2: sourceChainToCaip2(sourceChainId),
|
|
2823
3027
|
sourceTokenIdentity
|
|
@@ -2834,8 +3038,8 @@ function DepositAddressStep({
|
|
|
2834
3038
|
function handlePointerDown(event) {
|
|
2835
3039
|
const target = event.target;
|
|
2836
3040
|
if (!target) return;
|
|
2837
|
-
const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access',
|
|
2838
|
-
const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access',
|
|
3041
|
+
const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access', _137 => _137.current, 'optionalAccess', _138 => _138.contains, 'call', _139 => _139(target)]);
|
|
3042
|
+
const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access', _140 => _140.current, 'optionalAccess', _141 => _141.contains, 'call', _142 => _142(target)]);
|
|
2839
3043
|
if (clickedChainDropdown || clickedTokenDropdown) return;
|
|
2840
3044
|
setChainDropdownOpen(false);
|
|
2841
3045
|
setTokenDropdownOpen(false);
|
|
@@ -2851,9 +3055,9 @@ function DepositAddressStep({
|
|
|
2851
3055
|
try {
|
|
2852
3056
|
await navigator.clipboard.writeText(displayAddress);
|
|
2853
3057
|
setCopied(true);
|
|
2854
|
-
_optionalChain([onCopyAddress, 'optionalCall',
|
|
3058
|
+
_optionalChain([onCopyAddress, 'optionalCall', _143 => _143(true)]);
|
|
2855
3059
|
setTimeout(() => setCopied(false), 2e3);
|
|
2856
|
-
} catch (
|
|
3060
|
+
} catch (e20) {
|
|
2857
3061
|
const textarea = document.createElement("textarea");
|
|
2858
3062
|
textarea.value = displayAddress;
|
|
2859
3063
|
textarea.style.position = "fixed";
|
|
@@ -2866,14 +3070,14 @@ function DepositAddressStep({
|
|
|
2866
3070
|
setCopied(true);
|
|
2867
3071
|
setTimeout(() => setCopied(false), 2e3);
|
|
2868
3072
|
}
|
|
2869
|
-
_optionalChain([onCopyAddress, 'optionalCall',
|
|
3073
|
+
_optionalChain([onCopyAddress, 'optionalCall', _144 => _144(copiedWithFallback)]);
|
|
2870
3074
|
}
|
|
2871
3075
|
}, [displayAddress, onCopyAddress]);
|
|
2872
3076
|
const handleSelectChain = _react.useCallback.call(void 0,
|
|
2873
3077
|
(nextChain) => {
|
|
2874
3078
|
const nextTokens = computeTokensForChain(
|
|
2875
3079
|
nextChain,
|
|
2876
|
-
|
|
3080
|
+
offer,
|
|
2877
3081
|
catalogFor(nextChain)
|
|
2878
3082
|
);
|
|
2879
3083
|
chainChosenByUser.current = true;
|
|
@@ -2883,7 +3087,7 @@ function DepositAddressStep({
|
|
|
2883
3087
|
setTokenDropdownOpen(false);
|
|
2884
3088
|
setCopied(false);
|
|
2885
3089
|
},
|
|
2886
|
-
[sourceTokenSymbol,
|
|
3090
|
+
[sourceTokenSymbol, offer, catalogFor]
|
|
2887
3091
|
);
|
|
2888
3092
|
const onDepositSubmittedRef = _react.useRef.call(void 0, onDepositSubmitted);
|
|
2889
3093
|
onDepositSubmittedRef.current = onDepositSubmitted;
|
|
@@ -2935,10 +3139,10 @@ function DepositAddressStep({
|
|
|
2935
3139
|
return;
|
|
2936
3140
|
}
|
|
2937
3141
|
const event = status.lastEvent;
|
|
2938
|
-
const eventTxHash =
|
|
3142
|
+
const eventTxHash = _chunkHMUGY66Ocjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkHMUGY66Ocjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
2939
3143
|
if (baselineTxHashRef.current === void 0) {
|
|
2940
3144
|
baselineTxHashRef.current = eventTxHash;
|
|
2941
|
-
} else if (eventTxHash && (!baselineTxHashRef.current || !
|
|
3145
|
+
} else if (eventTxHash && (!baselineTxHashRef.current || !_chunkHMUGY66Ocjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
|
|
2942
3146
|
const details = getDepositEventDetails(event);
|
|
2943
3147
|
const chainId = _nullishCoalesce(details.chainId, () => ( "unknown"));
|
|
2944
3148
|
const amount = _nullishCoalesce(details.amount, () => ( "0"));
|
|
@@ -2970,7 +3174,7 @@ function DepositAddressStep({
|
|
|
2970
3174
|
directTransfer
|
|
2971
3175
|
};
|
|
2972
3176
|
setNotifications((prev) => [notification, ...prev]);
|
|
2973
|
-
_optionalChain([onDepositSubmittedRef, 'access',
|
|
3177
|
+
_optionalChain([onDepositSubmittedRef, 'access', _145 => _145.current, 'optionalCall', _146 => _146({
|
|
2974
3178
|
txHash: eventTxHash,
|
|
2975
3179
|
sourceChain: chainId,
|
|
2976
3180
|
amount,
|
|
@@ -2982,7 +3186,7 @@ function DepositAddressStep({
|
|
|
2982
3186
|
if (!cancelled) {
|
|
2983
3187
|
const msg = err instanceof Error ? err.message : "Failed to check status";
|
|
2984
3188
|
setPollingError(msg);
|
|
2985
|
-
_optionalChain([onErrorRef, 'access',
|
|
3189
|
+
_optionalChain([onErrorRef, 'access', _147 => _147.current, 'optionalCall', _148 => _148(msg, "STATUS_POLL_ERROR")]);
|
|
2986
3190
|
}
|
|
2987
3191
|
}
|
|
2988
3192
|
if (!cancelled) {
|
|
@@ -2998,37 +3202,46 @@ function DepositAddressStep({
|
|
|
2998
3202
|
const handleNotificationComplete = _react.useCallback.call(void 0,
|
|
2999
3203
|
(txHash, destinationTxHash, context) => {
|
|
3000
3204
|
isTrackingRef.current = false;
|
|
3001
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
3205
|
+
_optionalChain([onDepositCompleteRef, 'access', _149 => _149.current, 'optionalCall', _150 => _150(txHash, destinationTxHash, context)]);
|
|
3002
3206
|
},
|
|
3003
3207
|
[]
|
|
3004
3208
|
);
|
|
3005
3209
|
const handleNotificationFailed = _react.useCallback.call(void 0,
|
|
3006
3210
|
(txHash, error) => {
|
|
3007
3211
|
isTrackingRef.current = false;
|
|
3008
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
3212
|
+
_optionalChain([onDepositFailedRef, 'access', _151 => _151.current, 'optionalCall', _152 => _152(txHash, error)]);
|
|
3009
3213
|
},
|
|
3010
3214
|
[]
|
|
3011
3215
|
);
|
|
3012
3216
|
const handleNotificationDismiss = _react.useCallback.call(void 0, (id) => {
|
|
3013
3217
|
setNotifications((prev) => prev.filter((n) => n.id !== id));
|
|
3014
3218
|
}, []);
|
|
3015
|
-
const qrIconSrc = _nullishCoalesce(_optionalChain([catalogFor, 'call',
|
|
3219
|
+
const qrIconSrc = _nullishCoalesce(_optionalChain([catalogFor, 'call', _153 => _153(sourceChainId), 'optionalAccess', _154 => _154.iconUrl]), () => ( _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, sourceChainId)));
|
|
3016
3220
|
const reviewAsset = selectionAsAsset(
|
|
3017
3221
|
sourceChainId,
|
|
3018
3222
|
sourceTokenSymbol,
|
|
3019
|
-
|
|
3223
|
+
offer,
|
|
3020
3224
|
catalogFor(sourceChainId)
|
|
3021
3225
|
);
|
|
3226
|
+
if (offer.status === "error") {
|
|
3227
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-screen", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
3228
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
3229
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.Callout, { variant: "error", children: "The tokens this app accepts could not be loaded, so there is no deposit address to show." }),
|
|
3230
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.Button, { onClick: offer.retry, fullWidth: true, children: "Try again" })
|
|
3231
|
+
] }) });
|
|
3232
|
+
}
|
|
3022
3233
|
if (chainOptions.length === 0) {
|
|
3023
|
-
if (catalogLoading
|
|
3234
|
+
if (catalogLoading || offer.status === "loading") {
|
|
3235
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositAddressSkeleton, { uiConfig });
|
|
3236
|
+
}
|
|
3024
3237
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-screen", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
3025
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3026
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3238
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
3239
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.Callout, { variant: "error", children: catalog ? "This app does not accept deposits from any chain available here." : "Supported chains are unavailable right now, so there is no deposit address to show. Close and try again in a moment." })
|
|
3027
3240
|
] }) });
|
|
3028
3241
|
}
|
|
3029
3242
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-step--with-notifications", children: [
|
|
3030
3243
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
3031
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3244
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
3032
3245
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", children: [
|
|
3033
3246
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", ref: chainDropdownRef, children: [
|
|
3034
3247
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
@@ -3044,14 +3257,14 @@ function DepositAddressStep({
|
|
|
3044
3257
|
},
|
|
3045
3258
|
children: [
|
|
3046
3259
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3047
|
-
|
|
3260
|
+
_chunkHMUGY66Ocjs.CdnIcon,
|
|
3048
3261
|
{
|
|
3049
|
-
src: _nullishCoalesce(_optionalChain([catalogFor, 'call',
|
|
3262
|
+
src: _nullishCoalesce(_optionalChain([catalogFor, 'call', _155 => _155(sourceChainId), 'optionalAccess', _156 => _156.iconUrl]), () => ( _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, sourceChainId))),
|
|
3050
3263
|
className: "rs-deposit-address-dropdown-icon"
|
|
3051
3264
|
}
|
|
3052
3265
|
),
|
|
3053
3266
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainLabel(sourceChainId, catalogFor(sourceChainId)) }),
|
|
3054
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3267
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
3055
3268
|
]
|
|
3056
3269
|
}
|
|
3057
3270
|
),
|
|
@@ -3063,9 +3276,9 @@ function DepositAddressStep({
|
|
|
3063
3276
|
onClick: () => handleSelectChain(chainId),
|
|
3064
3277
|
children: [
|
|
3065
3278
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3066
|
-
|
|
3279
|
+
_chunkHMUGY66Ocjs.CdnIcon,
|
|
3067
3280
|
{
|
|
3068
|
-
src: _nullishCoalesce(_optionalChain([catalogFor, 'call',
|
|
3281
|
+
src: _nullishCoalesce(_optionalChain([catalogFor, 'call', _157 => _157(chainId), 'optionalAccess', _158 => _158.iconUrl]), () => ( _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, chainId))),
|
|
3069
3282
|
className: "rs-deposit-address-dropdown-icon"
|
|
3070
3283
|
}
|
|
3071
3284
|
),
|
|
@@ -3080,9 +3293,9 @@ function DepositAddressStep({
|
|
|
3080
3293
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Supported token" }),
|
|
3081
3294
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
3082
3295
|
"Min.$",
|
|
3083
|
-
(_chunkOY5N3E6Lcjs.isHyperCoreDestination.call(void 0, targetChain) || isHyperCore ? Math.max(_chunkOY5N3E6Lcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3084
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3085
|
-
|
|
3296
|
+
(_chunkOY5N3E6Lcjs.isHyperCoreDestination.call(void 0, targetChain) || isHyperCore ? Math.max(_chunkOY5N3E6Lcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _159 => _159.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _160 => _160.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
3297
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3298
|
+
_chunkHMUGY66Ocjs.InfoIcon,
|
|
3086
3299
|
{
|
|
3087
3300
|
className: "rs-deposit-address-min-icon",
|
|
3088
3301
|
"aria-hidden": "true"
|
|
@@ -3103,7 +3316,7 @@ function DepositAddressStep({
|
|
|
3103
3316
|
children: [
|
|
3104
3317
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenGlyph, { symbol: sourceTokenSymbol }),
|
|
3105
3318
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceTokenSymbol }),
|
|
3106
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3319
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
3107
3320
|
]
|
|
3108
3321
|
}
|
|
3109
3322
|
),
|
|
@@ -3131,14 +3344,34 @@ function DepositAddressStep({
|
|
|
3131
3344
|
style: { display: "flex", flexDirection: "column", gap: 4, width: "100%" },
|
|
3132
3345
|
children: [
|
|
3133
3346
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-well", children: [
|
|
3134
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-qr", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3347
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-qr", children: withholdPaymentQr ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-skeleton rs-skeleton-qr", "aria-hidden": "true" }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3135
3348
|
_react.Suspense,
|
|
3136
3349
|
{
|
|
3137
|
-
fallback: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3138
|
-
|
|
3350
|
+
fallback: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3351
|
+
"div",
|
|
3352
|
+
{
|
|
3353
|
+
className: "rs-skeleton rs-skeleton-qr",
|
|
3354
|
+
"aria-hidden": "true"
|
|
3355
|
+
}
|
|
3356
|
+
),
|
|
3357
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, QRCode, { value: qrValue, size: 190, iconSrc: qrIconSrc })
|
|
3139
3358
|
}
|
|
3140
3359
|
) }),
|
|
3141
|
-
/* @__PURE__ */ _jsxruntime.
|
|
3360
|
+
payment && paymentDisplay && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-amount", children: [
|
|
3361
|
+
"Send exactly ",
|
|
3362
|
+
paymentDisplay,
|
|
3363
|
+
" ",
|
|
3364
|
+
sourceTokenSymbol
|
|
3365
|
+
] }),
|
|
3366
|
+
!withholdPaymentQr && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-value", children: displayAddress })
|
|
3367
|
+
] }),
|
|
3368
|
+
paymentUnquotable && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkHMUGY66Ocjs.Callout, { variant: "error", children: [
|
|
3369
|
+
"This payment can't be priced from ",
|
|
3370
|
+
sourceTokenSymbol,
|
|
3371
|
+
" on",
|
|
3372
|
+
" ",
|
|
3373
|
+
chainLabel(sourceChainId, catalogFor(sourceChainId)),
|
|
3374
|
+
" right now. Pick another chain or token."
|
|
3142
3375
|
] }),
|
|
3143
3376
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-actions", children: [
|
|
3144
3377
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
@@ -3147,8 +3380,9 @@ function DepositAddressStep({
|
|
|
3147
3380
|
type: "button",
|
|
3148
3381
|
className: "rs-deposit-address-copy",
|
|
3149
3382
|
onClick: handleCopy,
|
|
3383
|
+
disabled: withholdPaymentQr,
|
|
3150
3384
|
children: [
|
|
3151
|
-
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3385
|
+
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.CopyIcon, {}),
|
|
3152
3386
|
copied ? "Copied!" : "Copy address"
|
|
3153
3387
|
]
|
|
3154
3388
|
}
|
|
@@ -3183,7 +3417,7 @@ function DepositAddressStep({
|
|
|
3183
3417
|
},
|
|
3184
3418
|
deposit.id
|
|
3185
3419
|
)) }),
|
|
3186
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3420
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.PoweredBy, {})
|
|
3187
3421
|
] });
|
|
3188
3422
|
}
|
|
3189
3423
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -3201,7 +3435,7 @@ function isTrustedSwappedWidgetUrl(url) {
|
|
|
3201
3435
|
let parsed;
|
|
3202
3436
|
try {
|
|
3203
3437
|
parsed = new URL(url);
|
|
3204
|
-
} catch (
|
|
3438
|
+
} catch (e21) {
|
|
3205
3439
|
return false;
|
|
3206
3440
|
}
|
|
3207
3441
|
return SWAPPED_ORIGINS.includes(parsed.origin);
|
|
@@ -3240,7 +3474,7 @@ function FinalisingDepositStep() {
|
|
|
3240
3474
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "rs-finalising-subtitle", children: "We are depositing your funds to the application." })
|
|
3241
3475
|
] })
|
|
3242
3476
|
] }),
|
|
3243
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3477
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.PoweredBy, {})
|
|
3244
3478
|
] });
|
|
3245
3479
|
}
|
|
3246
3480
|
FinalisingDepositStep.displayName = "FinalisingDepositStep";
|
|
@@ -3270,7 +3504,7 @@ function SwappedOrderTracker({
|
|
|
3270
3504
|
];
|
|
3271
3505
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-swapped-tracker", children: [
|
|
3272
3506
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3273
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3507
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.HandCoinsIcon, {}), title }),
|
|
3274
3508
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ol", { className: "rs-swapped-tracker-steps", children: labels.map((label, idx) => {
|
|
3275
3509
|
const status = stepStates[idx];
|
|
3276
3510
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
@@ -3284,7 +3518,7 @@ function SwappedOrderTracker({
|
|
|
3284
3518
|
{
|
|
3285
3519
|
className: "rs-swapped-tracker-step-marker",
|
|
3286
3520
|
"aria-hidden": "true",
|
|
3287
|
-
children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3521
|
+
children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.CheckIcon, {}) : status === "failed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.CloseIcon, {}) : status === "active" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.Spinner, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3288
3522
|
"svg",
|
|
3289
3523
|
{
|
|
3290
3524
|
className: "rs-swapped-tracker-step-ring",
|
|
@@ -3319,7 +3553,7 @@ function SwappedOrderTracker({
|
|
|
3319
3553
|
}
|
|
3320
3554
|
)
|
|
3321
3555
|
] }),
|
|
3322
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3556
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.PoweredBy, {})
|
|
3323
3557
|
] });
|
|
3324
3558
|
}
|
|
3325
3559
|
function formatTrackerAmount(amount) {
|
|
@@ -3356,14 +3590,14 @@ function hostnameOf(url) {
|
|
|
3356
3590
|
if (!url) return "the payment provider";
|
|
3357
3591
|
try {
|
|
3358
3592
|
return new URL(url).hostname;
|
|
3359
|
-
} catch (
|
|
3593
|
+
} catch (e22) {
|
|
3360
3594
|
return "the payment provider";
|
|
3361
3595
|
}
|
|
3362
3596
|
}
|
|
3363
3597
|
function parseMaybeJsonString(raw) {
|
|
3364
3598
|
try {
|
|
3365
3599
|
return JSON.parse(raw);
|
|
3366
|
-
} catch (
|
|
3600
|
+
} catch (e23) {
|
|
3367
3601
|
return raw;
|
|
3368
3602
|
}
|
|
3369
3603
|
}
|
|
@@ -3382,7 +3616,7 @@ function parseSwappedIframeMessage(raw) {
|
|
|
3382
3616
|
if (typeof data === "string") {
|
|
3383
3617
|
try {
|
|
3384
3618
|
data = JSON.parse(data);
|
|
3385
|
-
} catch (
|
|
3619
|
+
} catch (e24) {
|
|
3386
3620
|
return null;
|
|
3387
3621
|
}
|
|
3388
3622
|
}
|
|
@@ -3493,19 +3727,19 @@ function SwappedProviderStep({
|
|
|
3493
3727
|
if (cancelled) return;
|
|
3494
3728
|
if (!isTrustedSwappedWidgetUrl(res.url)) {
|
|
3495
3729
|
setLoadError(loadErrorFallback);
|
|
3496
|
-
_optionalChain([onErrorRef, 'access',
|
|
3730
|
+
_optionalChain([onErrorRef, 'access', _161 => _161.current, 'optionalCall', _162 => _162(loadErrorFallback, loadErrorCode)]);
|
|
3497
3731
|
return;
|
|
3498
3732
|
}
|
|
3499
3733
|
setWidgetUrl(res.url);
|
|
3500
3734
|
expectedExternalCustomerIdRef.current = res.externalCustomerId;
|
|
3501
|
-
_optionalChain([onAttemptConsumed, 'optionalCall',
|
|
3735
|
+
_optionalChain([onAttemptConsumed, 'optionalCall', _163 => _163(res.externalCustomerId)]);
|
|
3502
3736
|
const sep = res.externalCustomerId.indexOf(":");
|
|
3503
3737
|
expectedOrderUuidRef.current = sep >= 0 ? res.externalCustomerId.slice(sep + 1) : null;
|
|
3504
3738
|
}).catch((err) => {
|
|
3505
3739
|
if (cancelled) return;
|
|
3506
3740
|
const message = err instanceof Error ? err.message : loadErrorFallback;
|
|
3507
3741
|
setLoadError(message);
|
|
3508
|
-
_optionalChain([onErrorRef, 'access',
|
|
3742
|
+
_optionalChain([onErrorRef, 'access', _164 => _164.current, 'optionalCall', _165 => _165(message, loadErrorCode)]);
|
|
3509
3743
|
});
|
|
3510
3744
|
return () => {
|
|
3511
3745
|
cancelled = true;
|
|
@@ -3520,7 +3754,7 @@ function SwappedProviderStep({
|
|
|
3520
3754
|
const timer = setTimeout(() => {
|
|
3521
3755
|
const message = "Iframe took too long to load.";
|
|
3522
3756
|
setLoadError(message);
|
|
3523
|
-
_optionalChain([onErrorRef, 'access',
|
|
3757
|
+
_optionalChain([onErrorRef, 'access', _166 => _166.current, 'optionalCall', _167 => _167(message, "SWAPPED_IFRAME_TIMEOUT")]);
|
|
3524
3758
|
}, IFRAME_LOAD_TIMEOUT_MS);
|
|
3525
3759
|
return () => clearTimeout(timer);
|
|
3526
3760
|
}, [openExternally, widgetUrl, iframeLoaded, loadError]);
|
|
@@ -3530,7 +3764,7 @@ function SwappedProviderStep({
|
|
|
3530
3764
|
setIframeSrc(nextSrc);
|
|
3531
3765
|
if (nextSrc && assignedIframeUrlRef.current !== nextSrc) {
|
|
3532
3766
|
assignedIframeUrlRef.current = nextSrc;
|
|
3533
|
-
_optionalChain([onProviderHandoffRef, 'access',
|
|
3767
|
+
_optionalChain([onProviderHandoffRef, 'access', _168 => _168.current, 'optionalCall', _169 => _169()]);
|
|
3534
3768
|
}
|
|
3535
3769
|
}, [openExternally, widgetUrl, loadError, retryToken]);
|
|
3536
3770
|
const openPaymentPage = async (url) => {
|
|
@@ -3540,11 +3774,11 @@ function SwappedProviderStep({
|
|
|
3540
3774
|
try {
|
|
3541
3775
|
await openExternally(url);
|
|
3542
3776
|
setHandoffOpened(true);
|
|
3543
|
-
_optionalChain([onProviderHandoff, 'optionalCall',
|
|
3777
|
+
_optionalChain([onProviderHandoff, 'optionalCall', _170 => _170()]);
|
|
3544
3778
|
} catch (error) {
|
|
3545
3779
|
openedUrlRef.current = null;
|
|
3546
3780
|
setLoadError(OPEN_FAILED_MESSAGE);
|
|
3547
|
-
_optionalChain([onErrorRef, 'access',
|
|
3781
|
+
_optionalChain([onErrorRef, 'access', _171 => _171.current, 'optionalCall', _172 => _172(
|
|
3548
3782
|
error instanceof Error && error.message ? error.message : OPEN_FAILED_MESSAGE,
|
|
3549
3783
|
OPEN_FAILED_CODE
|
|
3550
3784
|
)]);
|
|
@@ -3569,7 +3803,7 @@ function SwappedProviderStep({
|
|
|
3569
3803
|
if (isCurrentOrder) {
|
|
3570
3804
|
setOrderState(res);
|
|
3571
3805
|
}
|
|
3572
|
-
} catch (
|
|
3806
|
+
} catch (e25) {
|
|
3573
3807
|
}
|
|
3574
3808
|
if (!cancelled) {
|
|
3575
3809
|
timeoutId = setTimeout(poll, STATUS_POLL_INTERVAL_MS);
|
|
@@ -3592,8 +3826,8 @@ function SwappedProviderStep({
|
|
|
3592
3826
|
const doc = globalThis.document;
|
|
3593
3827
|
const onVisible = () => {
|
|
3594
3828
|
if (doc.visibilityState !== "visible") return;
|
|
3595
|
-
_optionalChain([rescheduleStatusPollRef, 'access',
|
|
3596
|
-
_optionalChain([rescheduleDepositPollRef, 'access',
|
|
3829
|
+
_optionalChain([rescheduleStatusPollRef, 'access', _173 => _173.current, 'optionalCall', _174 => _174(0)]);
|
|
3830
|
+
_optionalChain([rescheduleDepositPollRef, 'access', _175 => _175.current, 'optionalCall', _176 => _176(0)]);
|
|
3597
3831
|
};
|
|
3598
3832
|
doc.addEventListener("visibilitychange", onVisible);
|
|
3599
3833
|
return () => doc.removeEventListener("visibilitychange", onVisible);
|
|
@@ -3607,14 +3841,14 @@ function SwappedProviderStep({
|
|
|
3607
3841
|
const status = await service.fetchLatestStatus(smartAccount);
|
|
3608
3842
|
if (cancelled) return;
|
|
3609
3843
|
const event = status.lastEvent;
|
|
3610
|
-
const eventTxHash =
|
|
3844
|
+
const eventTxHash = _chunkHMUGY66Ocjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkHMUGY66Ocjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
3611
3845
|
if (baselineDepositTxHashRef.current === void 0) {
|
|
3612
3846
|
baselineDepositTxHashRef.current = eventTxHash;
|
|
3613
|
-
} else if (eventTxHash && (!baselineDepositTxHashRef.current || !
|
|
3847
|
+
} else if (eventTxHash && (!baselineDepositTxHashRef.current || !_chunkHMUGY66Ocjs.txRefsMatch.call(void 0, eventTxHash, baselineDepositTxHashRef.current))) {
|
|
3614
3848
|
currentDepositTxHashRef.current = eventTxHash;
|
|
3615
3849
|
setLatestEvent(_nullishCoalesce(event, () => ( null)));
|
|
3616
3850
|
}
|
|
3617
|
-
} catch (
|
|
3851
|
+
} catch (e26) {
|
|
3618
3852
|
}
|
|
3619
3853
|
if (!cancelled) {
|
|
3620
3854
|
const nextInterval = fastDepositPollEnabledRef.current ? DEPOSIT_POLL_FAST_INTERVAL_MS : DEPOSIT_POLL_INTERVAL_MS;
|
|
@@ -3635,16 +3869,16 @@ function SwappedProviderStep({
|
|
|
3635
3869
|
}, [service, smartAccount]);
|
|
3636
3870
|
_react.useEffect.call(void 0, () => {
|
|
3637
3871
|
if (fastDepositPollEnabledRef.current) return;
|
|
3638
|
-
const status = _optionalChain([orderState, 'optionalAccess',
|
|
3872
|
+
const status = _optionalChain([orderState, 'optionalAccess', _177 => _177.status]);
|
|
3639
3873
|
if (!status || !SWAPPED_TERMINAL_STATUSES.has(status)) return;
|
|
3640
3874
|
fastDepositPollEnabledRef.current = true;
|
|
3641
|
-
_optionalChain([rescheduleDepositPollRef, 'access',
|
|
3875
|
+
_optionalChain([rescheduleDepositPollRef, 'access', _178 => _178.current, 'optionalCall', _179 => _179(DEPOSIT_POLL_FAST_INITIAL_DELAY_MS)]);
|
|
3642
3876
|
}, [orderState]);
|
|
3643
3877
|
_react.useEffect.call(void 0, () => {
|
|
3644
3878
|
if (openExternally) return;
|
|
3645
3879
|
function onMessage(e) {
|
|
3646
3880
|
if (!SWAPPED_IFRAME_ORIGINS.has(e.origin)) return;
|
|
3647
|
-
if (e.source !== _optionalChain([iframeRef, 'access',
|
|
3881
|
+
if (e.source !== _optionalChain([iframeRef, 'access', _180 => _180.current, 'optionalAccess', _181 => _181.contentWindow])) return;
|
|
3648
3882
|
if (isSwappedGoBackMessage(e.data)) {
|
|
3649
3883
|
onGoBackRef.current();
|
|
3650
3884
|
return;
|
|
@@ -3659,16 +3893,16 @@ function SwappedProviderStep({
|
|
|
3659
3893
|
setOrderState((prev) => ({
|
|
3660
3894
|
// Normalise to the uuid the backend poll also keys on, so orderState
|
|
3661
3895
|
// is consistent regardless of which path set it.
|
|
3662
|
-
orderId: _nullishCoalesce(_nullishCoalesce(expectedOrderUuidRef.current, () => ( _optionalChain([prev, 'optionalAccess',
|
|
3896
|
+
orderId: _nullishCoalesce(_nullishCoalesce(expectedOrderUuidRef.current, () => ( _optionalChain([prev, 'optionalAccess', _182 => _182.orderId]))), () => ( ext)),
|
|
3663
3897
|
status: parsed.status,
|
|
3664
|
-
orderCrypto: _nullishCoalesce(_nullishCoalesce(parsed.orderCrypto, () => ( _optionalChain([prev, 'optionalAccess',
|
|
3665
|
-
orderCryptoAmount: _nullishCoalesce(_nullishCoalesce(parsed.orderCryptoAmount, () => ( _optionalChain([prev, 'optionalAccess',
|
|
3666
|
-
transactionId: _nullishCoalesce(_nullishCoalesce(parsed.transactionId, () => ( _optionalChain([prev, 'optionalAccess',
|
|
3898
|
+
orderCrypto: _nullishCoalesce(_nullishCoalesce(parsed.orderCrypto, () => ( _optionalChain([prev, 'optionalAccess', _183 => _183.orderCrypto]))), () => ( null)),
|
|
3899
|
+
orderCryptoAmount: _nullishCoalesce(_nullishCoalesce(parsed.orderCryptoAmount, () => ( _optionalChain([prev, 'optionalAccess', _184 => _184.orderCryptoAmount]))), () => ( null)),
|
|
3900
|
+
transactionId: _nullishCoalesce(_nullishCoalesce(parsed.transactionId, () => ( _optionalChain([prev, 'optionalAccess', _185 => _185.transactionId]))), () => ( null)),
|
|
3667
3901
|
receivedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3668
|
-
paidAmountUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
3669
|
-
paidAmountEur: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
3670
|
-
onrampFeeUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
3671
|
-
paymentMethod: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
3902
|
+
paidAmountUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _186 => _186.paidAmountUsd]), () => ( null)),
|
|
3903
|
+
paidAmountEur: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _187 => _187.paidAmountEur]), () => ( null)),
|
|
3904
|
+
onrampFeeUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _188 => _188.onrampFeeUsd]), () => ( null)),
|
|
3905
|
+
paymentMethod: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _189 => _189.paymentMethod]), () => ( null))
|
|
3672
3906
|
}));
|
|
3673
3907
|
}
|
|
3674
3908
|
window.addEventListener("message", onMessage);
|
|
@@ -3681,28 +3915,28 @@ function SwappedProviderStep({
|
|
|
3681
3915
|
}
|
|
3682
3916
|
}, [phase, orderState, latestEvent, variant]);
|
|
3683
3917
|
const stepStates = _react.useMemo.call(void 0,
|
|
3684
|
-
() => deriveStepStates(_nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
3918
|
+
() => deriveStepStates(_nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _190 => _190.status]), () => ( null)), latestEvent),
|
|
3685
3919
|
[orderState, latestEvent]
|
|
3686
3920
|
);
|
|
3687
3921
|
const terminalState = _react.useMemo.call(void 0, () => {
|
|
3688
|
-
if (
|
|
3922
|
+
if (_chunkHMUGY66Ocjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
|
|
3689
3923
|
return {
|
|
3690
3924
|
kind: "failed",
|
|
3691
|
-
message:
|
|
3925
|
+
message: _chunkHMUGY66Ocjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
|
|
3692
3926
|
};
|
|
3693
3927
|
}
|
|
3694
|
-
if (_optionalChain([orderState, 'optionalAccess',
|
|
3928
|
+
if (_optionalChain([orderState, 'optionalAccess', _191 => _191.status]) === "order_cancelled") {
|
|
3695
3929
|
const banner = bannerForStatus("order_cancelled", {});
|
|
3696
3930
|
return { kind: "cancelled", message: _nullishCoalesce(banner.detail, () => ( banner.title)) };
|
|
3697
3931
|
}
|
|
3698
3932
|
return null;
|
|
3699
3933
|
}, [latestEvent, orderState, bannerForStatus]);
|
|
3700
3934
|
_react.useEffect.call(void 0, () => {
|
|
3701
|
-
if (_optionalChain([orderState, 'optionalAccess',
|
|
3702
|
-
}, [onCancelled, _optionalChain([orderState, 'optionalAccess',
|
|
3935
|
+
if (_optionalChain([orderState, 'optionalAccess', _192 => _192.status]) === "order_cancelled") _optionalChain([onCancelled, 'optionalCall', _193 => _193()]);
|
|
3936
|
+
}, [onCancelled, _optionalChain([orderState, 'optionalAccess', _194 => _194.status])]);
|
|
3703
3937
|
_react.useEffect.call(void 0, () => {
|
|
3704
3938
|
if (completeFiredRef.current || failedFiredRef.current) return;
|
|
3705
|
-
const t = _optionalChain([latestEvent, 'optionalAccess',
|
|
3939
|
+
const t = _optionalChain([latestEvent, 'optionalAccess', _195 => _195.type]);
|
|
3706
3940
|
const isSuccess = t === "bridge-complete";
|
|
3707
3941
|
if (!isSuccess) return;
|
|
3708
3942
|
const txHash = currentDepositTxHashRef.current;
|
|
@@ -3711,10 +3945,10 @@ function SwappedProviderStep({
|
|
|
3711
3945
|
const info = {
|
|
3712
3946
|
smartAccount,
|
|
3713
3947
|
txHash,
|
|
3714
|
-
orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
3948
|
+
orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _196 => _196.orderCrypto]), () => ( null)),
|
|
3715
3949
|
// Base-unit source amount from the deposit row/event, consistent with the
|
|
3716
3950
|
// wallet/QR path. ProcessingStep + onLifecycle expect base units.
|
|
3717
|
-
amount: _nullishCoalesce(
|
|
3951
|
+
amount: _nullishCoalesce(_chunkHMUGY66Ocjs.getEventSourceDetails.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0))).amount, () => ( null)),
|
|
3718
3952
|
expectedOrderUuid: expectedOrderUuidRef.current,
|
|
3719
3953
|
initialEvent: _nullishCoalesce(latestEvent, () => ( void 0))
|
|
3720
3954
|
};
|
|
@@ -3725,23 +3959,23 @@ function SwappedProviderStep({
|
|
|
3725
3959
|
}, [latestEvent, orderState, smartAccount]);
|
|
3726
3960
|
_react.useEffect.call(void 0, () => {
|
|
3727
3961
|
if (failedFiredRef.current || completeFiredRef.current) return;
|
|
3728
|
-
if (!
|
|
3962
|
+
if (!_chunkHMUGY66Ocjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) return;
|
|
3729
3963
|
const txHash = currentDepositTxHashRef.current;
|
|
3730
3964
|
if (!txHash) return;
|
|
3731
3965
|
failedFiredRef.current = true;
|
|
3732
3966
|
setPhase("tracker");
|
|
3733
|
-
_optionalChain([onSwappedFailedRef, 'access',
|
|
3967
|
+
_optionalChain([onSwappedFailedRef, 'access', _197 => _197.current, 'optionalCall', _198 => _198(
|
|
3734
3968
|
txHash,
|
|
3735
|
-
|
|
3969
|
+
_chunkHMUGY66Ocjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
|
|
3736
3970
|
)]);
|
|
3737
3971
|
}, [latestEvent]);
|
|
3738
3972
|
const immersive = !openExternally && variant === "fiat" && phase === "provider" && !loadError;
|
|
3739
3973
|
_react.useEffect.call(void 0, () => {
|
|
3740
|
-
_optionalChain([onImmersiveChangeRef, 'access',
|
|
3974
|
+
_optionalChain([onImmersiveChangeRef, 'access', _199 => _199.current, 'optionalCall', _200 => _200(immersive)]);
|
|
3741
3975
|
}, [immersive]);
|
|
3742
|
-
_react.useEffect.call(void 0, () => () => _optionalChain([onImmersiveChangeRef, 'access',
|
|
3976
|
+
_react.useEffect.call(void 0, () => () => _optionalChain([onImmersiveChangeRef, 'access', _201 => _201.current, 'optionalCall', _202 => _202(false)]), []);
|
|
3743
3977
|
const handleRetry = () => {
|
|
3744
|
-
_optionalChain([onRetry, 'optionalCall',
|
|
3978
|
+
_optionalChain([onRetry, 'optionalCall', _203 => _203()]);
|
|
3745
3979
|
setIframeSrc(null);
|
|
3746
3980
|
setWidgetUrl(null);
|
|
3747
3981
|
setIframeLoaded(false);
|
|
@@ -3759,8 +3993,8 @@ function SwappedProviderStep({
|
|
|
3759
3993
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3760
3994
|
SwappedOrderTracker,
|
|
3761
3995
|
{
|
|
3762
|
-
amount: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
3763
|
-
currency: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
3996
|
+
amount: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _204 => _204.orderCryptoAmount]), () => ( null)),
|
|
3997
|
+
currency: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _205 => _205.orderCrypto]), () => ( "USDC")),
|
|
3764
3998
|
stepStates,
|
|
3765
3999
|
terminal: terminalState,
|
|
3766
4000
|
onRetry: handleRetry,
|
|
@@ -3782,7 +4016,7 @@ function SwappedProviderStep({
|
|
|
3782
4016
|
}
|
|
3783
4017
|
)
|
|
3784
4018
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
3785
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4019
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.Spinner, {}),
|
|
3786
4020
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-swapped-handoff-text", children: [
|
|
3787
4021
|
/* @__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" }),
|
|
3788
4022
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "rs-swapped-handoff-subtitle", children: handoffOpened ? (
|
|
@@ -3806,7 +4040,7 @@ function SwappedProviderStep({
|
|
|
3806
4040
|
}
|
|
3807
4041
|
)
|
|
3808
4042
|
] }) }),
|
|
3809
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4043
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.PoweredBy, {})
|
|
3810
4044
|
] });
|
|
3811
4045
|
}
|
|
3812
4046
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-fiat-onramp", "data-variant": variant, children: [
|
|
@@ -3823,7 +4057,7 @@ function SwappedProviderStep({
|
|
|
3823
4057
|
}
|
|
3824
4058
|
)
|
|
3825
4059
|
] }),
|
|
3826
|
-
!loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4060
|
+
!loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.Spinner, {}) }),
|
|
3827
4061
|
widgetUrl && !loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3828
4062
|
"iframe",
|
|
3829
4063
|
{
|
|
@@ -3835,10 +4069,10 @@ function SwappedProviderStep({
|
|
|
3835
4069
|
allow: "payment; camera; microphone; clipboard-write; geolocation",
|
|
3836
4070
|
onLoad: () => {
|
|
3837
4071
|
try {
|
|
3838
|
-
if (_optionalChain([iframeRef, 'access',
|
|
4072
|
+
if (_optionalChain([iframeRef, 'access', _206 => _206.current, 'optionalAccess', _207 => _207.contentWindow, 'optionalAccess', _208 => _208.location, 'optionalAccess', _209 => _209.href]) === "about:blank") {
|
|
3839
4073
|
return;
|
|
3840
4074
|
}
|
|
3841
|
-
} catch (
|
|
4075
|
+
} catch (e27) {
|
|
3842
4076
|
}
|
|
3843
4077
|
setIframeLoaded(true);
|
|
3844
4078
|
}
|
|
@@ -3846,11 +4080,11 @@ function SwappedProviderStep({
|
|
|
3846
4080
|
retryToken
|
|
3847
4081
|
)
|
|
3848
4082
|
] }) }),
|
|
3849
|
-
loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4083
|
+
loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.PoweredBy, {})
|
|
3850
4084
|
] });
|
|
3851
4085
|
}
|
|
3852
4086
|
function deriveStepStates(swappedStatus, latestEvent) {
|
|
3853
|
-
if (
|
|
4087
|
+
if (_chunkHMUGY66Ocjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
|
|
3854
4088
|
return ["complete", "complete", "failed", "pending"];
|
|
3855
4089
|
}
|
|
3856
4090
|
if (swappedStatus === "order_cancelled") {
|
|
@@ -3858,7 +4092,7 @@ function deriveStepStates(swappedStatus, latestEvent) {
|
|
|
3858
4092
|
}
|
|
3859
4093
|
const step1Complete = swappedStatus === "order_completed" || swappedStatus === "order_broadcasted";
|
|
3860
4094
|
const step2Complete = latestEvent !== null || swappedStatus === "order_broadcasted";
|
|
3861
|
-
const step3Complete = _optionalChain([latestEvent, 'optionalAccess',
|
|
4095
|
+
const step3Complete = _optionalChain([latestEvent, 'optionalAccess', _210 => _210.type]) === "bridge-complete";
|
|
3862
4096
|
if (step3Complete) {
|
|
3863
4097
|
return ["complete", "complete", "complete", "complete"];
|
|
3864
4098
|
}
|
|
@@ -3919,7 +4153,7 @@ function FiatOnrampStep({
|
|
|
3919
4153
|
openExternally
|
|
3920
4154
|
}) {
|
|
3921
4155
|
const loadUrl = _react.useCallback.call(void 0, async () => {
|
|
3922
|
-
const prefetched = _optionalChain([consumePrefetchedUrl, 'optionalCall',
|
|
4156
|
+
const prefetched = _optionalChain([consumePrefetchedUrl, 'optionalCall', _211 => _211(
|
|
3923
4157
|
smartAccount,
|
|
3924
4158
|
paymentMethod,
|
|
3925
4159
|
methodSelectionSource
|
|
@@ -3928,7 +4162,7 @@ function FiatOnrampStep({
|
|
|
3928
4162
|
try {
|
|
3929
4163
|
const cached = await prefetched;
|
|
3930
4164
|
if (isSwappedWidgetUrlFresh(cached)) return cached;
|
|
3931
|
-
} catch (
|
|
4165
|
+
} catch (e28) {
|
|
3932
4166
|
}
|
|
3933
4167
|
}
|
|
3934
4168
|
return service.getSwappedWidgetUrl({
|
|
@@ -4060,7 +4294,7 @@ ExchangeConnectStep.displayName = "ExchangeConnectStep";
|
|
|
4060
4294
|
function ExchangeLogo({ exchange }) {
|
|
4061
4295
|
const [failed, setFailed] = _react.useState.call(void 0, false);
|
|
4062
4296
|
if (!exchange.logoUrl || failed) {
|
|
4063
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4297
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.BankIcon, {});
|
|
4064
4298
|
}
|
|
4065
4299
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4066
4300
|
"img",
|
|
@@ -4105,7 +4339,7 @@ function ExchangeSelectStep({
|
|
|
4105
4339
|
setExchanges([]);
|
|
4106
4340
|
setExchangeFeeBps(0);
|
|
4107
4341
|
setError(message);
|
|
4108
|
-
_optionalChain([onError, 'optionalCall',
|
|
4342
|
+
_optionalChain([onError, 'optionalCall', _212 => _212(message, "SWAPPED_CONNECT_EXCHANGES_FAILED")]);
|
|
4109
4343
|
}).finally(() => {
|
|
4110
4344
|
if (!cancelled) setLoading(false);
|
|
4111
4345
|
});
|
|
@@ -4131,7 +4365,7 @@ function ExchangeSelectStep({
|
|
|
4131
4365
|
} catch (err) {
|
|
4132
4366
|
const message = err instanceof Error ? err.message : "Failed to prepare Connect";
|
|
4133
4367
|
setSelectionNotice(message);
|
|
4134
|
-
_optionalChain([onError, 'optionalCall',
|
|
4368
|
+
_optionalChain([onError, 'optionalCall', _213 => _213(message, "SWAPPED_CONNECT_URL_FAILED")]);
|
|
4135
4369
|
} finally {
|
|
4136
4370
|
setSelectingConnection(null);
|
|
4137
4371
|
}
|
|
@@ -4141,14 +4375,14 @@ function ExchangeSelectStep({
|
|
|
4141
4375
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-exchange-select", children: [
|
|
4142
4376
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4143
4377
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4144
|
-
|
|
4378
|
+
_chunkHMUGY66Ocjs.BodyHeader,
|
|
4145
4379
|
{
|
|
4146
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4380
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.UnplugIcon, {}),
|
|
4147
4381
|
title: "Connect exchange",
|
|
4148
4382
|
subtitle: "Select an exchange to connect"
|
|
4149
4383
|
}
|
|
4150
4384
|
),
|
|
4151
|
-
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4385
|
+
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.Spinner, {}) }),
|
|
4152
4386
|
!loading && error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: [
|
|
4153
4387
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state-title", children: "Couldn\u2019t load exchanges" }),
|
|
4154
4388
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -4174,7 +4408,7 @@ function ExchangeSelectStep({
|
|
|
4174
4408
|
)
|
|
4175
4409
|
] }),
|
|
4176
4410
|
!loading && !error && exchanges.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-grid", children: exchanges.map((exchange) => {
|
|
4177
|
-
const brand =
|
|
4411
|
+
const brand = _chunkHMUGY66Ocjs.getExchangeLogo.call(void 0, exchange.name, exchange.connection);
|
|
4178
4412
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4179
4413
|
"button",
|
|
4180
4414
|
{
|
|
@@ -4199,7 +4433,7 @@ function ExchangeSelectStep({
|
|
|
4199
4433
|
);
|
|
4200
4434
|
}) })
|
|
4201
4435
|
] }),
|
|
4202
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4436
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.PoweredBy, {}),
|
|
4203
4437
|
exchangeFeeBps > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "rs-exchange-select-fee-note", children: [
|
|
4204
4438
|
"A ",
|
|
4205
4439
|
formatFeeRate(exchangeFeeBps),
|
|
@@ -4237,7 +4471,7 @@ function SolanaTokenSelectStep({
|
|
|
4237
4471
|
setError(null);
|
|
4238
4472
|
const portfolioBySymbol = {};
|
|
4239
4473
|
try {
|
|
4240
|
-
|
|
4474
|
+
_chunkHMUGY66Ocjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
|
|
4241
4475
|
solanaAddress
|
|
4242
4476
|
});
|
|
4243
4477
|
const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
|
|
@@ -4248,7 +4482,7 @@ function SolanaTokenSelectStep({
|
|
|
4248
4482
|
let parsed = 0n;
|
|
4249
4483
|
try {
|
|
4250
4484
|
parsed = BigInt(t.balance || "0");
|
|
4251
|
-
} catch (
|
|
4485
|
+
} catch (e29) {
|
|
4252
4486
|
parsed = 0n;
|
|
4253
4487
|
}
|
|
4254
4488
|
if (parsed <= 0n) continue;
|
|
@@ -4260,12 +4494,12 @@ function SolanaTokenSelectStep({
|
|
|
4260
4494
|
};
|
|
4261
4495
|
}
|
|
4262
4496
|
}
|
|
4263
|
-
|
|
4497
|
+
_chunkHMUGY66Ocjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
|
|
4264
4498
|
symbols: Object.keys(portfolioBySymbol)
|
|
4265
4499
|
});
|
|
4266
4500
|
} catch (err) {
|
|
4267
4501
|
if (!active) return;
|
|
4268
|
-
|
|
4502
|
+
_chunkHMUGY66Ocjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
|
|
4269
4503
|
solanaAddress
|
|
4270
4504
|
});
|
|
4271
4505
|
setError(
|
|
@@ -4290,7 +4524,7 @@ function SolanaTokenSelectStep({
|
|
|
4290
4524
|
setTokenBalances(results);
|
|
4291
4525
|
setLoading(false);
|
|
4292
4526
|
const totalUsd = results.reduce((sum, r) => sum + r.balanceUsd, 0);
|
|
4293
|
-
_optionalChain([onTotalBalanceComputed, 'optionalCall',
|
|
4527
|
+
_optionalChain([onTotalBalanceComputed, 'optionalCall', _214 => _214(totalUsd)]);
|
|
4294
4528
|
}
|
|
4295
4529
|
void loadBalances();
|
|
4296
4530
|
return () => {
|
|
@@ -4312,8 +4546,8 @@ function SolanaTokenSelectStep({
|
|
|
4312
4546
|
const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
|
|
4313
4547
|
const numeric = Number(raw);
|
|
4314
4548
|
if (!Number.isFinite(numeric)) return raw;
|
|
4315
|
-
return
|
|
4316
|
-
} catch (
|
|
4549
|
+
return _chunkHMUGY66Ocjs.tokenFormatter.format(numeric);
|
|
4550
|
+
} catch (e30) {
|
|
4317
4551
|
return "--";
|
|
4318
4552
|
}
|
|
4319
4553
|
};
|
|
@@ -4322,20 +4556,20 @@ function SolanaTokenSelectStep({
|
|
|
4322
4556
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
4323
4557
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
4324
4558
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4325
|
-
|
|
4559
|
+
_chunkHMUGY66Ocjs.BodyHeader,
|
|
4326
4560
|
{
|
|
4327
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4561
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.WalletIcon, {}),
|
|
4328
4562
|
title: "Your assets",
|
|
4329
4563
|
subtitle: "Select source assets to transfer"
|
|
4330
4564
|
}
|
|
4331
4565
|
),
|
|
4332
4566
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
4333
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4567
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.Spinner, { className: "rs-text-tertiary" }),
|
|
4334
4568
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
4335
4569
|
] }),
|
|
4336
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4570
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.Callout, { variant: "error", children: error }),
|
|
4337
4571
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
4338
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4572
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
4339
4573
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
4340
4574
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
4341
4575
|
solanaAddress.slice(0, 6),
|
|
@@ -4366,13 +4600,13 @@ function SolanaTokenSelectStep({
|
|
|
4366
4600
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
|
|
4367
4601
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-icon-wrapper", children: [
|
|
4368
4602
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4369
|
-
|
|
4603
|
+
_chunkHMUGY66Ocjs.TokenIcon,
|
|
4370
4604
|
{
|
|
4371
4605
|
symbol: entry.token.symbol,
|
|
4372
4606
|
fallback: entry.token.symbol.slice(0, 4)
|
|
4373
4607
|
}
|
|
4374
4608
|
) }),
|
|
4375
|
-
chainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4609
|
+
chainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.CdnIcon, { src: chainIcon, alt: chainName }) })
|
|
4376
4610
|
] }),
|
|
4377
4611
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-text", children: [
|
|
4378
4612
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-name-row", children: [
|
|
@@ -4389,14 +4623,14 @@ function SolanaTokenSelectStep({
|
|
|
4389
4623
|
] })
|
|
4390
4624
|
] })
|
|
4391
4625
|
] }),
|
|
4392
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ?
|
|
4626
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunkHMUGY66Ocjs.currencyFormatter.format(entry.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${entry.token.symbol}` : "--" })
|
|
4393
4627
|
]
|
|
4394
4628
|
},
|
|
4395
4629
|
entry.token.symbol
|
|
4396
4630
|
);
|
|
4397
4631
|
}) }),
|
|
4398
4632
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4399
|
-
|
|
4633
|
+
_chunkHMUGY66Ocjs.Button,
|
|
4400
4634
|
{
|
|
4401
4635
|
onClick: () => selectedEntry && onContinue(
|
|
4402
4636
|
selectedEntry.token,
|
|
@@ -4409,7 +4643,7 @@ function SolanaTokenSelectStep({
|
|
|
4409
4643
|
}
|
|
4410
4644
|
)
|
|
4411
4645
|
] }),
|
|
4412
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4646
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.PoweredBy, {})
|
|
4413
4647
|
] });
|
|
4414
4648
|
}
|
|
4415
4649
|
|
|
@@ -4441,7 +4675,7 @@ function SolanaAmountStep({
|
|
|
4441
4675
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
4442
4676
|
const hasAppliedDefaultRef = _react.useRef.call(void 0, false);
|
|
4443
4677
|
const isSourceStablecoin = _chunkOY5N3E6Lcjs.isStablecoinSymbol.call(void 0, token.symbol);
|
|
4444
|
-
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess',
|
|
4678
|
+
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess', _215 => _215.trim, 'call', _216 => _216(), 'access', _217 => _217.toLowerCase, 'call', _218 => _218()]) === "max";
|
|
4445
4679
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
4446
4680
|
if (isSourceStablecoin) return 1;
|
|
4447
4681
|
try {
|
|
@@ -4451,7 +4685,7 @@ function SolanaAmountStep({
|
|
|
4451
4685
|
}
|
|
4452
4686
|
const price = balanceUsd / balanceUnits;
|
|
4453
4687
|
return price > 0 ? price : null;
|
|
4454
|
-
} catch (
|
|
4688
|
+
} catch (e31) {
|
|
4455
4689
|
return null;
|
|
4456
4690
|
}
|
|
4457
4691
|
}, [isSourceStablecoin, balance, token.decimals, balanceUsd]);
|
|
@@ -4461,8 +4695,8 @@ function SolanaAmountStep({
|
|
|
4461
4695
|
const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
|
|
4462
4696
|
const numeric = Number(raw);
|
|
4463
4697
|
if (!Number.isFinite(numeric)) return raw;
|
|
4464
|
-
return
|
|
4465
|
-
} catch (
|
|
4698
|
+
return _chunkHMUGY66Ocjs.tokenFormatter.format(numeric);
|
|
4699
|
+
} catch (e32) {
|
|
4466
4700
|
return "\u2026";
|
|
4467
4701
|
}
|
|
4468
4702
|
}, [balance, token.decimals]);
|
|
@@ -4473,7 +4707,7 @@ function SolanaAmountStep({
|
|
|
4473
4707
|
if (tokenPriceUsd !== null) return balanceUnits * tokenPriceUsd;
|
|
4474
4708
|
if (Number.isFinite(balanceUsd) && balanceUsd > 0) return balanceUsd;
|
|
4475
4709
|
return null;
|
|
4476
|
-
} catch (
|
|
4710
|
+
} catch (e33) {
|
|
4477
4711
|
return null;
|
|
4478
4712
|
}
|
|
4479
4713
|
}, [balance, token.decimals, tokenPriceUsd, balanceUsd]);
|
|
@@ -4487,7 +4721,7 @@ function SolanaAmountStep({
|
|
|
4487
4721
|
if (!Number.isFinite(spendableUnits) || spendableUnits < 0) return null;
|
|
4488
4722
|
if (tokenPriceUsd !== null) return spendableUnits * tokenPriceUsd;
|
|
4489
4723
|
return null;
|
|
4490
|
-
} catch (
|
|
4724
|
+
} catch (e34) {
|
|
4491
4725
|
return null;
|
|
4492
4726
|
}
|
|
4493
4727
|
}, [spendableBalance, token.decimals, tokenPriceUsd]);
|
|
@@ -4502,7 +4736,7 @@ function SolanaAmountStep({
|
|
|
4502
4736
|
const factor = 1e3;
|
|
4503
4737
|
const truncated = Math.floor(value * factor) / factor;
|
|
4504
4738
|
return truncated.toFixed(3).replace(/\.?0+$/, "");
|
|
4505
|
-
} catch (
|
|
4739
|
+
} catch (e35) {
|
|
4506
4740
|
return "";
|
|
4507
4741
|
}
|
|
4508
4742
|
},
|
|
@@ -4539,22 +4773,27 @@ function SolanaAmountStep({
|
|
|
4539
4773
|
const raw = isSourceStablecoin || !hasPricing ? numericAmount : numericAmount / (_nullishCoalesce(tokenPriceUsd, () => ( 1)));
|
|
4540
4774
|
try {
|
|
4541
4775
|
return _viem.parseUnits.call(void 0, raw.toString(), token.decimals);
|
|
4542
|
-
} catch (
|
|
4776
|
+
} catch (e36) {
|
|
4543
4777
|
return null;
|
|
4544
4778
|
}
|
|
4545
4779
|
}, [numericAmount, isSourceStablecoin, hasPricing, tokenPriceUsd, token.decimals]);
|
|
4546
|
-
const minDepositUsd = _chunkOY5N3E6Lcjs.isHyperCoreDestination.call(void 0, targetChain) ? Math.max(_chunkOY5N3E6Lcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
4547
|
-
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
4780
|
+
const minDepositUsd = _chunkOY5N3E6Lcjs.isHyperCoreDestination.call(void 0, targetChain) ? Math.max(_chunkOY5N3E6Lcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _219 => _219.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _220 => _220.minDepositUsd]), () => ( null));
|
|
4781
|
+
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _221 => _221.maxDepositUsd]), () => ( null));
|
|
4548
4782
|
const isBelowMin = minDepositUsd !== null && numericAmount > 0 && numericAmount < minDepositUsd;
|
|
4549
4783
|
const isAboveMax = maxDepositUsd !== null && numericAmount > maxDepositUsd;
|
|
4550
4784
|
const exceedsBalance = Boolean(
|
|
4551
4785
|
sourceAmountUnits !== null && sourceAmountUnits > spendableBalance
|
|
4552
4786
|
);
|
|
4787
|
+
const boundsFor = _chunkHMUGY66Ocjs.useDepositBounds.call(void 0, );
|
|
4788
|
+
const boundViolation = _chunkHMUGY66Ocjs.depositBoundsViolation.call(void 0,
|
|
4789
|
+
boundsFor("solana", token.mint),
|
|
4790
|
+
sourceAmountUnits
|
|
4791
|
+
);
|
|
4553
4792
|
const balanceAfterUsd = appBalanceUsd !== void 0 ? appBalanceUsd + numericAmount : null;
|
|
4554
4793
|
const handlePresetClick = (percentage) => {
|
|
4555
4794
|
const formatted = computePresetAmount(percentage);
|
|
4556
4795
|
if (!formatted) return;
|
|
4557
|
-
|
|
4796
|
+
_chunkHMUGY66Ocjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
|
|
4558
4797
|
percentage,
|
|
4559
4798
|
symbol: token.symbol,
|
|
4560
4799
|
formatted
|
|
@@ -4570,6 +4809,7 @@ function SolanaAmountStep({
|
|
|
4570
4809
|
if (error) setError(null);
|
|
4571
4810
|
};
|
|
4572
4811
|
const handleContinue = () => {
|
|
4812
|
+
if (boundViolation) return;
|
|
4573
4813
|
let effective = numericAmount;
|
|
4574
4814
|
if (isBelowMin && minDepositUsd !== null) {
|
|
4575
4815
|
effective = minDepositUsd;
|
|
@@ -4588,8 +4828,8 @@ function SolanaAmountStep({
|
|
|
4588
4828
|
let amountInUnits;
|
|
4589
4829
|
try {
|
|
4590
4830
|
amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
|
|
4591
|
-
} catch (
|
|
4592
|
-
|
|
4831
|
+
} catch (e37) {
|
|
4832
|
+
_chunkHMUGY66Ocjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
4593
4833
|
amount,
|
|
4594
4834
|
sourceAmount: sourceAmountStr,
|
|
4595
4835
|
reason: "parse-units-failed"
|
|
@@ -4604,7 +4844,7 @@ function SolanaAmountStep({
|
|
|
4604
4844
|
);
|
|
4605
4845
|
return;
|
|
4606
4846
|
}
|
|
4607
|
-
|
|
4847
|
+
_chunkHMUGY66Ocjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
|
|
4608
4848
|
symbol: token.symbol,
|
|
4609
4849
|
inputAmountUsd: amount,
|
|
4610
4850
|
sourceAmount: sourceAmountStr,
|
|
@@ -4613,11 +4853,11 @@ function SolanaAmountStep({
|
|
|
4613
4853
|
setError(null);
|
|
4614
4854
|
onContinue(token, sourceAmountStr, effective.toString());
|
|
4615
4855
|
};
|
|
4616
|
-
const continueLabel = exceedsBalance ? "Insufficient balance" : isAboveMax ? "Continue with max allowed deposit" : isBelowMin ? "Continue with minimum deposit" : "Continue";
|
|
4617
|
-
const continueDisabled = exceedsBalance || numericAmount === 0 && !isBelowMin;
|
|
4856
|
+
const continueLabel = exceedsBalance ? "Insufficient balance" : _nullishCoalesce(boundViolation, () => ( (isAboveMax ? "Continue with max allowed deposit" : isBelowMin ? "Continue with minimum deposit" : "Continue")));
|
|
4857
|
+
const continueDisabled = exceedsBalance || boundViolation !== null || numericAmount === 0 && !isBelowMin;
|
|
4618
4858
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
4619
4859
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4620
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4860
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.WalletIcon, {}), title: "Wallet deposit" }),
|
|
4621
4861
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
4622
4862
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
4623
4863
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -4637,13 +4877,13 @@ function SolanaAmountStep({
|
|
|
4637
4877
|
" available",
|
|
4638
4878
|
computedBalanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
4639
4879
|
" (~",
|
|
4640
|
-
|
|
4880
|
+
_chunkHMUGY66Ocjs.currencyFormatter.format(computedBalanceUsd),
|
|
4641
4881
|
")"
|
|
4642
4882
|
] })
|
|
4643
4883
|
] }),
|
|
4644
4884
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
4645
4885
|
"Min. deposit ",
|
|
4646
|
-
|
|
4886
|
+
_chunkHMUGY66Ocjs.currencyFormatter.format(minDepositUsd)
|
|
4647
4887
|
] })
|
|
4648
4888
|
] })
|
|
4649
4889
|
] }),
|
|
@@ -4666,7 +4906,7 @@ function SolanaAmountStep({
|
|
|
4666
4906
|
"Solana ",
|
|
4667
4907
|
token.symbol
|
|
4668
4908
|
] }),
|
|
4669
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4909
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.TokenIcon, { symbol: token.symbol }) })
|
|
4670
4910
|
] })
|
|
4671
4911
|
] }),
|
|
4672
4912
|
targetChainName && targetTokenSymbol && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
@@ -4677,17 +4917,17 @@ function SolanaAmountStep({
|
|
|
4677
4917
|
" ",
|
|
4678
4918
|
targetTokenSymbol
|
|
4679
4919
|
] }),
|
|
4680
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4920
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.TokenIcon, { symbol: targetTokenSymbol }) })
|
|
4681
4921
|
] })
|
|
4682
4922
|
] }),
|
|
4683
4923
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
4684
4924
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
4685
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
4925
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkHMUGY66Ocjs.currencyFormatter.format(balanceAfterUsd) })
|
|
4686
4926
|
] })
|
|
4687
4927
|
] }),
|
|
4688
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4928
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.Callout, { variant: "error", children: error }),
|
|
4689
4929
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4690
|
-
|
|
4930
|
+
_chunkHMUGY66Ocjs.Button,
|
|
4691
4931
|
{
|
|
4692
4932
|
onClick: handleContinue,
|
|
4693
4933
|
fullWidth: true,
|
|
@@ -4696,7 +4936,7 @@ function SolanaAmountStep({
|
|
|
4696
4936
|
}
|
|
4697
4937
|
)
|
|
4698
4938
|
] }),
|
|
4699
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4939
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.PoweredBy, {})
|
|
4700
4940
|
] });
|
|
4701
4941
|
}
|
|
4702
4942
|
|
|
@@ -4716,10 +4956,10 @@ function loadSolanaDependencies() {
|
|
|
4716
4956
|
return dependenciesPromise2;
|
|
4717
4957
|
}
|
|
4718
4958
|
function getSolanaRpcUrl(rpcUrls) {
|
|
4719
|
-
return _nullishCoalesce(
|
|
4959
|
+
return _nullishCoalesce(_chunkHMUGY66Ocjs.rpcUrlFor.call(void 0, rpcUrls, "solana"), () => ( DEFAULT_SOLANA_RPC_URL));
|
|
4720
4960
|
}
|
|
4721
4961
|
function hasConfiguredSolanaRpcUrl(rpcUrls) {
|
|
4722
|
-
return
|
|
4962
|
+
return _chunkHMUGY66Ocjs.rpcUrlFor.call(void 0, rpcUrls, "solana") !== void 0;
|
|
4723
4963
|
}
|
|
4724
4964
|
async function getSolanaConnection(rpcUrls) {
|
|
4725
4965
|
const rpcUrl = getSolanaRpcUrl(rpcUrls);
|
|
@@ -4836,14 +5076,14 @@ function SolanaConfirmStep({
|
|
|
4836
5076
|
onSubmittingChange,
|
|
4837
5077
|
debug
|
|
4838
5078
|
}) {
|
|
4839
|
-
const rpcUrls =
|
|
5079
|
+
const rpcUrls = _chunkHMUGY66Ocjs.useRpcUrls.call(void 0, );
|
|
4840
5080
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
4841
5081
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
4842
5082
|
const onSubmittingChangeRef = _react.useRef.call(void 0, onSubmittingChange);
|
|
4843
5083
|
onSubmittingChangeRef.current = onSubmittingChange;
|
|
4844
5084
|
_react.useEffect.call(void 0, () => {
|
|
4845
|
-
_optionalChain([onSubmittingChangeRef, 'access',
|
|
4846
|
-
return () => _optionalChain([onSubmittingChangeRef, 'access',
|
|
5085
|
+
_optionalChain([onSubmittingChangeRef, 'access', _222 => _222.current, 'optionalCall', _223 => _223(isSubmitting)]);
|
|
5086
|
+
return () => _optionalChain([onSubmittingChangeRef, 'access', _224 => _224.current, 'optionalCall', _225 => _225(false)]);
|
|
4847
5087
|
}, [isSubmitting]);
|
|
4848
5088
|
const targetChainId = _chunkOY5N3E6Lcjs.targetChainToChainId.call(void 0, targetChain);
|
|
4849
5089
|
const targetSymbol = _chunkOY5N3E6Lcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
@@ -4851,28 +5091,28 @@ function SolanaConfirmStep({
|
|
|
4851
5091
|
const targetChainName = _chunkOY5N3E6Lcjs.getChainName.call(void 0, targetChainId);
|
|
4852
5092
|
const sourceChainIcon = _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, "solana");
|
|
4853
5093
|
const targetChainIcon = _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, targetChainId);
|
|
4854
|
-
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
4855
|
-
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
4856
|
-
const formattedAmount = sourceAmount && Number.isFinite(Number(sourceAmount)) ? _nullishCoalesce(
|
|
5094
|
+
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _226 => _226.feeSponsored]), () => ( false));
|
|
5095
|
+
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _227 => _227.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
5096
|
+
const formattedAmount = sourceAmount && Number.isFinite(Number(sourceAmount)) ? _nullishCoalesce(_chunkHMUGY66Ocjs.formatTokenAmount.call(void 0, Number(sourceAmount), token.symbol), () => ( "0")) : "0";
|
|
4857
5097
|
const receiveDisplay = (() => {
|
|
4858
5098
|
const usdValue = Number(targetAmount);
|
|
4859
5099
|
const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
|
|
4860
|
-
const estimate =
|
|
5100
|
+
const estimate = _chunkHMUGY66Ocjs.formatReceiveEstimate.call(void 0, {
|
|
4861
5101
|
sourceAmount: Number.isFinite(Number(sourceAmount)) ? Number(sourceAmount) : void 0,
|
|
4862
5102
|
sourceSymbol: token.symbol,
|
|
4863
5103
|
targetSymbol,
|
|
4864
5104
|
sourceAmountUsd,
|
|
4865
|
-
sourceTrusted:
|
|
5105
|
+
sourceTrusted: _chunkHMUGY66Ocjs.isRecognizedToken.call(void 0, token.mint, "solana"),
|
|
4866
5106
|
// Curated stablecoin target estimates at $1 when unquoted; never applied
|
|
4867
5107
|
// to the source (a held token). See ConfirmStep for the rationale.
|
|
4868
|
-
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } :
|
|
5108
|
+
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : _chunkHMUGY66Ocjs.isDisplayStablecoinSymbol.call(void 0, targetSymbol) ? { [targetSymbol.toUpperCase()]: 1 } : {}
|
|
4869
5109
|
});
|
|
4870
5110
|
if (estimate !== void 0) return estimate;
|
|
4871
5111
|
return targetSymbol;
|
|
4872
5112
|
})();
|
|
4873
5113
|
const handleConfirm = async () => {
|
|
4874
5114
|
if (!solanaProvider) {
|
|
4875
|
-
|
|
5115
|
+
_chunkHMUGY66Ocjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
4876
5116
|
reason: "missing-provider"
|
|
4877
5117
|
});
|
|
4878
5118
|
setError("Solana wallet not connected");
|
|
@@ -4880,7 +5120,7 @@ function SolanaConfirmStep({
|
|
|
4880
5120
|
}
|
|
4881
5121
|
const parsedAmount = parseFloat(sourceAmount);
|
|
4882
5122
|
if (isNaN(parsedAmount) || parsedAmount <= 0) {
|
|
4883
|
-
|
|
5123
|
+
_chunkHMUGY66Ocjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
4884
5124
|
reason: "invalid-amount",
|
|
4885
5125
|
sourceAmount
|
|
4886
5126
|
});
|
|
@@ -4889,7 +5129,7 @@ function SolanaConfirmStep({
|
|
|
4889
5129
|
}
|
|
4890
5130
|
setError(null);
|
|
4891
5131
|
setIsSubmitting(true);
|
|
4892
|
-
|
|
5132
|
+
_chunkHMUGY66Ocjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
|
|
4893
5133
|
smartAccount,
|
|
4894
5134
|
solanaAddress,
|
|
4895
5135
|
solanaDepositAddress,
|
|
@@ -4899,7 +5139,7 @@ function SolanaConfirmStep({
|
|
|
4899
5139
|
});
|
|
4900
5140
|
try {
|
|
4901
5141
|
const check = await service.checkAccount(smartAccount);
|
|
4902
|
-
|
|
5142
|
+
_chunkHMUGY66Ocjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
|
|
4903
5143
|
smartAccount,
|
|
4904
5144
|
isRegistered: check.isRegistered,
|
|
4905
5145
|
targetChain: check.targetChain,
|
|
@@ -4912,7 +5152,7 @@ function SolanaConfirmStep({
|
|
|
4912
5152
|
}
|
|
4913
5153
|
const connection = await (hasConfiguredSolanaRpcUrl(rpcUrls) ? getSolanaConnection(rpcUrls) : _nullishCoalesce(solanaConnection, () => ( getSolanaConnection(rpcUrls))));
|
|
4914
5154
|
const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
|
|
4915
|
-
|
|
5155
|
+
_chunkHMUGY66Ocjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
|
|
4916
5156
|
token: token.symbol,
|
|
4917
5157
|
sourceAmount,
|
|
4918
5158
|
amountUnits: amountUnits.toString()
|
|
@@ -4929,10 +5169,10 @@ function SolanaConfirmStep({
|
|
|
4929
5169
|
token.mint,
|
|
4930
5170
|
amountUnits
|
|
4931
5171
|
);
|
|
4932
|
-
|
|
5172
|
+
_chunkHMUGY66Ocjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
4933
5173
|
token: token.symbol,
|
|
4934
5174
|
instructionCount: transaction.instructions.length,
|
|
4935
|
-
feePayer: _optionalChain([transaction, 'access',
|
|
5175
|
+
feePayer: _optionalChain([transaction, 'access', _228 => _228.feePayer, 'optionalAccess', _229 => _229.toBase58, 'call', _230 => _230()]),
|
|
4936
5176
|
recentBlockhash: transaction.recentBlockhash
|
|
4937
5177
|
});
|
|
4938
5178
|
const txHash = await sendSolanaTransaction(
|
|
@@ -4940,7 +5180,7 @@ function SolanaConfirmStep({
|
|
|
4940
5180
|
connection,
|
|
4941
5181
|
transaction
|
|
4942
5182
|
);
|
|
4943
|
-
|
|
5183
|
+
_chunkHMUGY66Ocjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
|
|
4944
5184
|
txHash,
|
|
4945
5185
|
amountUnits: amountUnits.toString()
|
|
4946
5186
|
});
|
|
@@ -4952,21 +5192,21 @@ function SolanaConfirmStep({
|
|
|
4952
5192
|
});
|
|
4953
5193
|
} catch (err) {
|
|
4954
5194
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
4955
|
-
const message =
|
|
4956
|
-
|
|
5195
|
+
const message = _chunkHMUGY66Ocjs.formatUserError.call(void 0, raw);
|
|
5196
|
+
_chunkHMUGY66Ocjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
|
|
4957
5197
|
smartAccount,
|
|
4958
5198
|
token: token.symbol,
|
|
4959
5199
|
sourceAmount
|
|
4960
5200
|
});
|
|
4961
5201
|
setError(message);
|
|
4962
|
-
_optionalChain([onError, 'optionalCall',
|
|
5202
|
+
_optionalChain([onError, 'optionalCall', _231 => _231(message, "SOLANA_TRANSFER_ERROR", raw)]);
|
|
4963
5203
|
} finally {
|
|
4964
5204
|
setIsSubmitting(false);
|
|
4965
5205
|
}
|
|
4966
5206
|
};
|
|
4967
5207
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
4968
5208
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4969
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5209
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.WalletIcon, {}), title: "Review deposit" }),
|
|
4970
5210
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4971
5211
|
ReviewDetails,
|
|
4972
5212
|
{
|
|
@@ -4982,9 +5222,9 @@ function SolanaConfirmStep({
|
|
|
4982
5222
|
fee: { display: "$0.04", struck: feeSponsored, tooltip: feeTooltip }
|
|
4983
5223
|
}
|
|
4984
5224
|
),
|
|
4985
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5225
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.Callout, { variant: "error", children: error }),
|
|
4986
5226
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4987
|
-
|
|
5227
|
+
_chunkHMUGY66Ocjs.Button,
|
|
4988
5228
|
{
|
|
4989
5229
|
onClick: handleConfirm,
|
|
4990
5230
|
loading: isSubmitting,
|
|
@@ -4995,7 +5235,7 @@ function SolanaConfirmStep({
|
|
|
4995
5235
|
}
|
|
4996
5236
|
)
|
|
4997
5237
|
] }),
|
|
4998
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5238
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.PoweredBy, {})
|
|
4999
5239
|
] });
|
|
5000
5240
|
}
|
|
5001
5241
|
|
|
@@ -5010,19 +5250,19 @@ function DappImportAssetSelectStep({
|
|
|
5010
5250
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
5011
5251
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
5012
5252
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5013
|
-
|
|
5253
|
+
_chunkHMUGY66Ocjs.BodyHeader,
|
|
5014
5254
|
{
|
|
5015
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5255
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.WalletIcon, {}),
|
|
5016
5256
|
title: `Transfer from ${sourceLabel}`,
|
|
5017
5257
|
subtitle: "Pick the balance to import"
|
|
5018
5258
|
}
|
|
5019
5259
|
),
|
|
5020
5260
|
incompleteSummary && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-notice", role: "status", children: incompleteSummary }),
|
|
5021
5261
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: assets.map((asset) => {
|
|
5022
|
-
const tokenAmount = asset.balance ?
|
|
5262
|
+
const tokenAmount = asset.balance ? _chunkHMUGY66Ocjs.tokenFormatter.format(
|
|
5023
5263
|
Number(asset.balance) / 10 ** asset.decimals
|
|
5024
5264
|
) : "0";
|
|
5025
|
-
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ?
|
|
5265
|
+
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ? _chunkHMUGY66Ocjs.currencyFormatter.format(asset.balanceUsd) : `${tokenAmount} ${asset.symbol}`;
|
|
5026
5266
|
const assetIcon = asset.icon;
|
|
5027
5267
|
const chainIcon = _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, asset.chainId);
|
|
5028
5268
|
const badge = _chunkOY5N3E6Lcjs.getChainBadge.call(void 0, asset.chainId);
|
|
@@ -5035,14 +5275,14 @@ function DappImportAssetSelectStep({
|
|
|
5035
5275
|
children: [
|
|
5036
5276
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
|
|
5037
5277
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-icon-wrapper", children: [
|
|
5038
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: assetIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5039
|
-
|
|
5278
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: assetIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.CdnIcon, { src: assetIcon, alt: asset.symbol }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5279
|
+
_chunkHMUGY66Ocjs.TokenIcon,
|
|
5040
5280
|
{
|
|
5041
5281
|
symbol: asset.symbol,
|
|
5042
5282
|
fallback: asset.symbol.slice(0, 4)
|
|
5043
5283
|
}
|
|
5044
5284
|
) }),
|
|
5045
|
-
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5285
|
+
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.CdnIcon, { src: chainIcon, alt: _chunkOY5N3E6Lcjs.getChainName.call(void 0, asset.chainId) }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5046
5286
|
"span",
|
|
5047
5287
|
{
|
|
5048
5288
|
className: "rs-asset-chain-badge",
|
|
@@ -5074,7 +5314,7 @@ function DappImportAssetSelectStep({
|
|
|
5074
5314
|
);
|
|
5075
5315
|
}) })
|
|
5076
5316
|
] }),
|
|
5077
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5317
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.PoweredBy, {})
|
|
5078
5318
|
] });
|
|
5079
5319
|
}
|
|
5080
5320
|
DappImportAssetSelectStep.displayName = "DappImportAssetSelectStep";
|
|
@@ -5096,7 +5336,7 @@ function describeRow(status, comingSoon) {
|
|
|
5096
5336
|
}
|
|
5097
5337
|
if (status.enabled) {
|
|
5098
5338
|
return {
|
|
5099
|
-
subtitle: status.balanceUsd > 0 ?
|
|
5339
|
+
subtitle: status.balanceUsd > 0 ? _chunkHMUGY66Ocjs.currencyFormatter.format(status.balanceUsd) : "No balance",
|
|
5100
5340
|
disabled: false,
|
|
5101
5341
|
busy: false
|
|
5102
5342
|
};
|
|
@@ -5119,9 +5359,9 @@ function DappImportSelectStep({
|
|
|
5119
5359
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
5120
5360
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
5121
5361
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5122
|
-
|
|
5362
|
+
_chunkHMUGY66Ocjs.BodyHeader,
|
|
5123
5363
|
{
|
|
5124
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5364
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.MigrateAssetsIcon, {}),
|
|
5125
5365
|
title: "Migrate assets",
|
|
5126
5366
|
subtitle: "Select a position to migrate"
|
|
5127
5367
|
}
|
|
@@ -5133,16 +5373,16 @@ function DappImportSelectStep({
|
|
|
5133
5373
|
Boolean(brand.comingSoon)
|
|
5134
5374
|
);
|
|
5135
5375
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5136
|
-
|
|
5376
|
+
_chunkHMUGY66Ocjs.ListRow,
|
|
5137
5377
|
{
|
|
5138
5378
|
leadingMedia: brand.iconUrl,
|
|
5139
5379
|
title: brand.label,
|
|
5140
5380
|
subtitle,
|
|
5141
5381
|
disabled,
|
|
5142
|
-
trailing: busy ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5382
|
+
trailing: busy ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.Spinner, { className: "rs-spinner--sm" }) : void 0,
|
|
5143
5383
|
onClick: () => {
|
|
5144
5384
|
if (status === "needs-connect") {
|
|
5145
|
-
_optionalChain([onRequestConnect, 'optionalCall',
|
|
5385
|
+
_optionalChain([onRequestConnect, 'optionalCall', _232 => _232()]);
|
|
5146
5386
|
return;
|
|
5147
5387
|
}
|
|
5148
5388
|
onSelect(brand.id);
|
|
@@ -5152,7 +5392,7 @@ function DappImportSelectStep({
|
|
|
5152
5392
|
);
|
|
5153
5393
|
}) })
|
|
5154
5394
|
] }),
|
|
5155
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5395
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.PoweredBy, {})
|
|
5156
5396
|
] });
|
|
5157
5397
|
}
|
|
5158
5398
|
DappImportSelectStep.displayName = "DappImportSelectStep";
|
|
@@ -5169,9 +5409,9 @@ function DappImportAssetSelectSkeleton({
|
|
|
5169
5409
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: error ? "Couldn't load balances" : "Loading balances\u2026" }),
|
|
5170
5410
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
5171
5411
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5172
|
-
|
|
5412
|
+
_chunkHMUGY66Ocjs.BodyHeader,
|
|
5173
5413
|
{
|
|
5174
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5414
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.WalletIcon, {}),
|
|
5175
5415
|
title: `Transfer from ${sourceLabel}`,
|
|
5176
5416
|
subtitle: "Pick the balance to import"
|
|
5177
5417
|
}
|
|
@@ -5209,7 +5449,7 @@ function DappImportAssetSelectSkeleton({
|
|
|
5209
5449
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Try again" })
|
|
5210
5450
|
}
|
|
5211
5451
|
) }),
|
|
5212
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5452
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.PoweredBy, {})
|
|
5213
5453
|
] });
|
|
5214
5454
|
}
|
|
5215
5455
|
DappImportAssetSelectSkeleton.displayName = "DappImportAssetSelectSkeleton";
|
|
@@ -5278,7 +5518,7 @@ function dappImportBalanceSource(asset) {
|
|
|
5278
5518
|
if (asset.balance === void 0) return {};
|
|
5279
5519
|
try {
|
|
5280
5520
|
return { declaredBalance: BigInt(asset.balance) };
|
|
5281
|
-
} catch (
|
|
5521
|
+
} catch (e38) {
|
|
5282
5522
|
return {};
|
|
5283
5523
|
}
|
|
5284
5524
|
}
|
|
@@ -5298,7 +5538,7 @@ var aaveProvider = {
|
|
|
5298
5538
|
throw new Error("Aave positions require a backend connection");
|
|
5299
5539
|
}
|
|
5300
5540
|
const response = await backend.getPositions(eoa);
|
|
5301
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
5541
|
+
if (_optionalChain([signal, 'optionalAccess', _233 => _233.aborted])) return null;
|
|
5302
5542
|
const assets = toImportableAssets(response.positions);
|
|
5303
5543
|
const failures = _nullishCoalesce(response.failures, () => ( []));
|
|
5304
5544
|
if (assets.length === 0) {
|
|
@@ -5631,21 +5871,21 @@ var polymarketProvider = {
|
|
|
5631
5871
|
async fetchAvailability({ eoa, getPublicClient: getPublicClient2, signal }) {
|
|
5632
5872
|
const proxyWallet = await _chunkLVCD6RHFcjs.fetchPolymarketProxyWallet.call(void 0, eoa, signal);
|
|
5633
5873
|
if (!proxyWallet) return null;
|
|
5634
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
5874
|
+
if (_optionalChain([signal, 'optionalAccess', _234 => _234.aborted])) return null;
|
|
5635
5875
|
const polygonClient = getPublicClient2(_chunkLVCD6RHFcjs.POLYMARKET_POLYGON_CHAIN_ID);
|
|
5636
5876
|
if (!polygonClient) return null;
|
|
5637
5877
|
const balances = await _chunkLVCD6RHFcjs.readPolymarketBalances.call(void 0, {
|
|
5638
5878
|
publicClient: polygonClient,
|
|
5639
5879
|
proxyWallet
|
|
5640
5880
|
});
|
|
5641
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
5881
|
+
if (_optionalChain([signal, 'optionalAccess', _235 => _235.aborted])) return null;
|
|
5642
5882
|
if (balances.pusd === 0n && balances.usdce === 0n) return null;
|
|
5643
5883
|
const walletKind = await detectPolymarketWalletKind({
|
|
5644
5884
|
publicClient: polygonClient,
|
|
5645
5885
|
proxyWallet,
|
|
5646
5886
|
eoa
|
|
5647
5887
|
});
|
|
5648
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
5888
|
+
if (_optionalChain([signal, 'optionalAccess', _236 => _236.aborted])) return null;
|
|
5649
5889
|
if (!walletKind) return null;
|
|
5650
5890
|
const assets = [];
|
|
5651
5891
|
if (balances.pusd > 0n) {
|
|
@@ -5753,10 +5993,37 @@ function getEnabledProviders(config) {
|
|
|
5753
5993
|
}
|
|
5754
5994
|
|
|
5755
5995
|
// src/core/dapp-imports/status.ts
|
|
5996
|
+
function narrowDappImportAvailability(availability, isExcluded) {
|
|
5997
|
+
let changed = false;
|
|
5998
|
+
const narrowed = {};
|
|
5999
|
+
for (const [providerId, entry] of Object.entries(availability)) {
|
|
6000
|
+
if (!entry || entry === "loading" || entry === "error") {
|
|
6001
|
+
narrowed[providerId] = entry;
|
|
6002
|
+
continue;
|
|
6003
|
+
}
|
|
6004
|
+
const assets = entry.assets.filter(
|
|
6005
|
+
(asset) => !isExcluded(asset.depositChainId, asset.depositToken)
|
|
6006
|
+
);
|
|
6007
|
+
if (assets.length === entry.assets.length) {
|
|
6008
|
+
narrowed[providerId] = entry;
|
|
6009
|
+
continue;
|
|
6010
|
+
}
|
|
6011
|
+
changed = true;
|
|
6012
|
+
narrowed[providerId] = assets.length === 0 ? null : {
|
|
6013
|
+
...entry,
|
|
6014
|
+
assets,
|
|
6015
|
+
totalUsd: assets.reduce(
|
|
6016
|
+
(sum, asset) => sum + (_nullishCoalesce(asset.balanceUsd, () => ( 0))),
|
|
6017
|
+
0
|
|
6018
|
+
)
|
|
6019
|
+
};
|
|
6020
|
+
}
|
|
6021
|
+
return changed ? narrowed : availability;
|
|
6022
|
+
}
|
|
5756
6023
|
function computeDappImportStatus(providerId, inputs) {
|
|
5757
6024
|
const { owner, availability, availabilityOwner, setup } = inputs;
|
|
5758
6025
|
if (!owner) return "needs-connect";
|
|
5759
|
-
const entry = _optionalChain([availabilityOwner, 'optionalAccess',
|
|
6026
|
+
const entry = _optionalChain([availabilityOwner, 'optionalAccess', _237 => _237.toLowerCase, 'call', _238 => _238()]) === owner.toLowerCase() ? availability[providerId] : void 0;
|
|
5760
6027
|
if (entry === "loading" || entry === void 0) return "loading";
|
|
5761
6028
|
if (entry === "error") {
|
|
5762
6029
|
return {
|
|
@@ -6098,7 +6365,7 @@ function DepositAnalyticsControllerProvider({
|
|
|
6098
6365
|
children,
|
|
6099
6366
|
controllerRef
|
|
6100
6367
|
}) {
|
|
6101
|
-
const emit =
|
|
6368
|
+
const emit = _chunkHMUGY66Ocjs.useDepositAnalyticsEmitter.call(void 0, );
|
|
6102
6369
|
const controller = _react.useMemo.call(void 0,
|
|
6103
6370
|
() => createDepositAnalyticsController(emit),
|
|
6104
6371
|
[emit]
|
|
@@ -6618,7 +6885,7 @@ function applyAction(state, action) {
|
|
|
6618
6885
|
totalUsd: null,
|
|
6619
6886
|
// Keep any prior chains visible so the cluster does not flicker
|
|
6620
6887
|
// empty across a refresh.
|
|
6621
|
-
chainIds: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
6888
|
+
chainIds: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _239 => _239.chainIds]), () => ( []))
|
|
6622
6889
|
}
|
|
6623
6890
|
}
|
|
6624
6891
|
}
|
|
@@ -6829,7 +7096,7 @@ function applyAction(state, action) {
|
|
|
6829
7096
|
flow: { ...state.flow, step: "processing" }
|
|
6830
7097
|
};
|
|
6831
7098
|
case "processing/quote-loaded":
|
|
6832
|
-
if (state.flow.step !== "processing" || _optionalChain([state, 'access',
|
|
7099
|
+
if (state.flow.step !== "processing" || _optionalChain([state, 'access', _240 => _240.processing, 'access', _241 => _241.txHash, 'optionalAccess', _242 => _242.toLowerCase, 'call', _243 => _243()]) !== action.txHash.toLowerCase()) {
|
|
6833
7100
|
return state;
|
|
6834
7101
|
}
|
|
6835
7102
|
return {
|
|
@@ -7164,7 +7431,7 @@ var SWAPPED_QUOTE_FEE_TIMEOUT_MS = 2500;
|
|
|
7164
7431
|
async function fetchPinnedQuote(params) {
|
|
7165
7432
|
try {
|
|
7166
7433
|
if (BigInt(params.amount) <= 0n) return void 0;
|
|
7167
|
-
} catch (
|
|
7434
|
+
} catch (e39) {
|
|
7168
7435
|
return void 0;
|
|
7169
7436
|
}
|
|
7170
7437
|
let timeoutId;
|
|
@@ -7180,8 +7447,8 @@ async function fetchPinnedQuote(params) {
|
|
|
7180
7447
|
timeoutId = setTimeout(resolve, SWAPPED_QUOTE_FEE_TIMEOUT_MS, null);
|
|
7181
7448
|
})
|
|
7182
7449
|
]);
|
|
7183
|
-
return
|
|
7184
|
-
} catch (
|
|
7450
|
+
return quote && !_chunkHMUGY66Ocjs.isDepositPolicyRefusal.call(void 0, quote) ? quote : void 0;
|
|
7451
|
+
} catch (e40) {
|
|
7185
7452
|
return void 0;
|
|
7186
7453
|
} finally {
|
|
7187
7454
|
if (timeoutId !== void 0) clearTimeout(timeoutId);
|
|
@@ -7393,6 +7660,7 @@ function DepositFlow({
|
|
|
7393
7660
|
sourceToken: defaultSourceToken,
|
|
7394
7661
|
amount: defaultAmount,
|
|
7395
7662
|
recipient,
|
|
7663
|
+
payment,
|
|
7396
7664
|
appBalanceUsd,
|
|
7397
7665
|
outputTokenRules,
|
|
7398
7666
|
rejectUnmapped,
|
|
@@ -7423,11 +7691,11 @@ function DepositFlow({
|
|
|
7423
7691
|
onError,
|
|
7424
7692
|
debug
|
|
7425
7693
|
}) {
|
|
7426
|
-
const rpcUrls =
|
|
7427
|
-
const onStepChangeRef =
|
|
7694
|
+
const rpcUrls = _chunkHMUGY66Ocjs.useRpcUrls.call(void 0, );
|
|
7695
|
+
const onStepChangeRef = _chunkHMUGY66Ocjs.useLatestRef.call(void 0, onStepChange);
|
|
7428
7696
|
const analytics = useDepositAnalyticsController();
|
|
7429
|
-
const onLifecycleRef =
|
|
7430
|
-
const onErrorRef =
|
|
7697
|
+
const onLifecycleRef = _chunkHMUGY66Ocjs.useLatestRef.call(void 0, onLifecycle);
|
|
7698
|
+
const onErrorRef = _chunkHMUGY66Ocjs.useLatestRef.call(void 0, onError);
|
|
7431
7699
|
const storeApi = useDepositStoreApi();
|
|
7432
7700
|
const flowSlice = useDepositStore((s) => s.flow);
|
|
7433
7701
|
const depositSlice = useDepositStore((s) => s.deposit);
|
|
@@ -7444,13 +7712,13 @@ function DepositFlow({
|
|
|
7444
7712
|
const stableWalletSelectionKeyRef = _react.useRef.call(void 0, null);
|
|
7445
7713
|
const logFlow = _react.useCallback.call(void 0,
|
|
7446
7714
|
(message, data) => {
|
|
7447
|
-
|
|
7715
|
+
_chunkHMUGY66Ocjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
|
|
7448
7716
|
},
|
|
7449
7717
|
[debug]
|
|
7450
7718
|
);
|
|
7451
7719
|
const logFlowError = _react.useCallback.call(void 0,
|
|
7452
7720
|
(message, error, data) => {
|
|
7453
|
-
|
|
7721
|
+
_chunkHMUGY66Ocjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
|
|
7454
7722
|
},
|
|
7455
7723
|
[debug]
|
|
7456
7724
|
);
|
|
@@ -7474,12 +7742,12 @@ function DepositFlow({
|
|
|
7474
7742
|
};
|
|
7475
7743
|
}, [enableSwappedPreconnect]);
|
|
7476
7744
|
const dappSwitchChain = _react.useMemo.call(void 0, () => {
|
|
7477
|
-
if (!_optionalChain([walletClientProp, 'optionalAccess',
|
|
7745
|
+
if (!_optionalChain([walletClientProp, 'optionalAccess', _244 => _244.switchChain])) return void 0;
|
|
7478
7746
|
return async (chainId) => {
|
|
7479
|
-
await _optionalChain([walletClientProp, 'access',
|
|
7747
|
+
await _optionalChain([walletClientProp, 'access', _245 => _245.switchChain, 'optionalCall', _246 => _246({ id: chainId })]);
|
|
7480
7748
|
};
|
|
7481
7749
|
}, [walletClientProp]);
|
|
7482
|
-
const connectedWalletAddress = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess',
|
|
7750
|
+
const connectedWalletAddress = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess', _247 => _247.account, 'optionalAccess', _248 => _248.address]), () => ( null));
|
|
7483
7751
|
const walletOptions = _react.useMemo.call(void 0, () => {
|
|
7484
7752
|
const options = [];
|
|
7485
7753
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -7493,7 +7761,7 @@ function DepositFlow({
|
|
|
7493
7761
|
});
|
|
7494
7762
|
seen.add(id);
|
|
7495
7763
|
}
|
|
7496
|
-
if (_optionalChain([walletSession, 'optionalAccess',
|
|
7764
|
+
if (_optionalChain([walletSession, 'optionalAccess', _249 => _249.isConnected]) && walletSession.isSolana && walletSession.solanaAddress) {
|
|
7497
7765
|
const id = _nullishCoalesce(walletSession.caipAddress, () => ( `solana:${walletSession.solanaAddress}`));
|
|
7498
7766
|
if (!seen.has(id)) {
|
|
7499
7767
|
options.push({
|
|
@@ -7505,7 +7773,7 @@ function DepositFlow({
|
|
|
7505
7773
|
});
|
|
7506
7774
|
seen.add(id);
|
|
7507
7775
|
}
|
|
7508
|
-
} else if (_optionalChain([walletSession, 'optionalAccess',
|
|
7776
|
+
} else if (_optionalChain([walletSession, 'optionalAccess', _250 => _250.address]) && walletSession.isConnected && walletSession.canSignEvm && !seen.has(`evm:${walletSession.address.toLowerCase()}`)) {
|
|
7509
7777
|
const id = `evm:${walletSession.address.toLowerCase()}`;
|
|
7510
7778
|
if (!seen.has(id)) {
|
|
7511
7779
|
options.push({
|
|
@@ -7521,13 +7789,13 @@ function DepositFlow({
|
|
|
7521
7789
|
return options;
|
|
7522
7790
|
}, [
|
|
7523
7791
|
connectedWalletAddress,
|
|
7524
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7525
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7526
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7527
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7528
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7529
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7530
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7792
|
+
_optionalChain([walletSession, 'optionalAccess', _251 => _251.address]),
|
|
7793
|
+
_optionalChain([walletSession, 'optionalAccess', _252 => _252.isConnected]),
|
|
7794
|
+
_optionalChain([walletSession, 'optionalAccess', _253 => _253.canSignEvm]),
|
|
7795
|
+
_optionalChain([walletSession, 'optionalAccess', _254 => _254.icon]),
|
|
7796
|
+
_optionalChain([walletSession, 'optionalAccess', _255 => _255.isSolana]),
|
|
7797
|
+
_optionalChain([walletSession, 'optionalAccess', _256 => _256.solanaAddress]),
|
|
7798
|
+
_optionalChain([walletSession, 'optionalAccess', _257 => _257.caipAddress])
|
|
7531
7799
|
]);
|
|
7532
7800
|
const offeredFiatMethods = _react.useMemo.call(void 0,
|
|
7533
7801
|
() => fiatMethods ? FIAT_ONRAMP_METHODS.filter((m) => fiatMethods[m.method]) : FIAT_ONRAMP_METHODS,
|
|
@@ -7547,11 +7815,11 @@ function DepositFlow({
|
|
|
7547
7815
|
hasEnabledAssetMigration
|
|
7548
7816
|
].filter(Boolean).length;
|
|
7549
7817
|
const canAutoLock = Boolean(
|
|
7550
|
-
enableWallet && _optionalChain([walletClientProp, 'optionalAccess',
|
|
7818
|
+
enableWallet && _optionalChain([walletClientProp, 'optionalAccess', _258 => _258.account]) && !walletSession && enabledFeatureCount === 1
|
|
7551
7819
|
);
|
|
7552
7820
|
const hasWalletOptions = enableWallet && walletOptions.length > 0;
|
|
7553
7821
|
const hasReownSession = Boolean(
|
|
7554
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7822
|
+
_optionalChain([walletSession, 'optionalAccess', _259 => _259.isConnected]) || _optionalChain([walletSession, 'optionalAccess', _260 => _260.address])
|
|
7555
7823
|
);
|
|
7556
7824
|
const isDappImportWalletHydrating = Boolean(
|
|
7557
7825
|
hasWalletClientProp && walletClientProp === void 0 || walletSession && !hasReownSession && !walletSession.isReady
|
|
@@ -7582,7 +7850,7 @@ function DepositFlow({
|
|
|
7582
7850
|
return;
|
|
7583
7851
|
}
|
|
7584
7852
|
let cancelled = false;
|
|
7585
|
-
|
|
7853
|
+
_chunkHMUGY66Ocjs.fetchTokenPriceUsd.call(void 0, service, {
|
|
7586
7854
|
chainId: targetChainId,
|
|
7587
7855
|
address: targetToken,
|
|
7588
7856
|
symbol: targetSymbol
|
|
@@ -7599,11 +7867,11 @@ function DepositFlow({
|
|
|
7599
7867
|
return null;
|
|
7600
7868
|
}
|
|
7601
7869
|
if (canAutoLock) {
|
|
7602
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess',
|
|
7870
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess', _261 => _261.chain, 'optionalAccess', _262 => _262.id]), () => ( setupChainId));
|
|
7603
7871
|
return {
|
|
7604
7872
|
ownerAddress: walletClientProp.account.address,
|
|
7605
7873
|
walletClient: walletClientProp,
|
|
7606
|
-
publicClient: _nullishCoalesce(publicClientProp, () => (
|
|
7874
|
+
publicClient: _nullishCoalesce(publicClientProp, () => ( _chunkHMUGY66Ocjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
|
|
7607
7875
|
switchChain: dappSwitchChain
|
|
7608
7876
|
};
|
|
7609
7877
|
}
|
|
@@ -7615,20 +7883,20 @@ function DepositFlow({
|
|
|
7615
7883
|
if (selectedOption.kind === "solana") {
|
|
7616
7884
|
return null;
|
|
7617
7885
|
}
|
|
7618
|
-
if (selectedOption.kind === "connected" && _optionalChain([walletClientProp, 'optionalAccess',
|
|
7619
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess',
|
|
7886
|
+
if (selectedOption.kind === "connected" && _optionalChain([walletClientProp, 'optionalAccess', _263 => _263.account]) && selectedOption.address && walletClientProp.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
7887
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess', _264 => _264.chain, 'optionalAccess', _265 => _265.id]), () => ( setupChainId));
|
|
7620
7888
|
return {
|
|
7621
7889
|
ownerAddress: walletClientProp.account.address,
|
|
7622
7890
|
walletClient: walletClientProp,
|
|
7623
|
-
publicClient: _nullishCoalesce(publicClientProp, () => (
|
|
7891
|
+
publicClient: _nullishCoalesce(publicClientProp, () => ( _chunkHMUGY66Ocjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
|
|
7624
7892
|
switchChain: dappSwitchChain
|
|
7625
7893
|
};
|
|
7626
7894
|
}
|
|
7627
|
-
if (selectedOption.kind === "external" && _optionalChain([walletSession, 'optionalAccess',
|
|
7895
|
+
if (selectedOption.kind === "external" && _optionalChain([walletSession, 'optionalAccess', _266 => _266.address]) && selectedOption.address && walletSession.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
7628
7896
|
return {
|
|
7629
7897
|
ownerAddress: walletSession.address,
|
|
7630
7898
|
walletClient: walletSession.walletClient,
|
|
7631
|
-
publicClient: _nullishCoalesce(walletSession.publicClient, () => (
|
|
7899
|
+
publicClient: _nullishCoalesce(walletSession.publicClient, () => ( _chunkHMUGY66Ocjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
|
|
7632
7900
|
switchChain: walletSession.switchChain
|
|
7633
7901
|
};
|
|
7634
7902
|
}
|
|
@@ -7650,7 +7918,7 @@ function DepositFlow({
|
|
|
7650
7918
|
// nothing else here when the host switches chain, and the context would go
|
|
7651
7919
|
// on holding a client bound to the old one: `chainMismatch` never clears
|
|
7652
7920
|
// and the CTA stays disabled with nothing beside it.
|
|
7653
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7921
|
+
_optionalChain([walletSession, 'optionalAccess', _267 => _267.walletClient]),
|
|
7654
7922
|
setupChainId,
|
|
7655
7923
|
rpcUrls
|
|
7656
7924
|
]);
|
|
@@ -7690,35 +7958,35 @@ function DepositFlow({
|
|
|
7690
7958
|
const selectedEvmWalletOwner = _react.useMemo.call(void 0, () => {
|
|
7691
7959
|
if (!selectedWalletId) return null;
|
|
7692
7960
|
const opt = walletOptions.find((o) => o.id === selectedWalletId);
|
|
7693
|
-
if (_optionalChain([opt, 'optionalAccess',
|
|
7961
|
+
if (_optionalChain([opt, 'optionalAccess', _268 => _268.kind]) === "external" && opt.address) {
|
|
7694
7962
|
return opt.address;
|
|
7695
7963
|
}
|
|
7696
|
-
if (_optionalChain([opt, 'optionalAccess',
|
|
7964
|
+
if (_optionalChain([opt, 'optionalAccess', _269 => _269.kind]) === "connected" && opt.address) {
|
|
7697
7965
|
return opt.address;
|
|
7698
7966
|
}
|
|
7699
7967
|
return null;
|
|
7700
7968
|
}, [selectedWalletId, walletOptions]);
|
|
7701
7969
|
const dappImportOwner = _react.useMemo.call(void 0, () => {
|
|
7702
7970
|
if (selectedEvmWalletOwner) return selectedEvmWalletOwner;
|
|
7703
|
-
if (_optionalChain([walletSession, 'optionalAccess',
|
|
7971
|
+
if (_optionalChain([walletSession, 'optionalAccess', _270 => _270.address]) && walletSession.isConnected) {
|
|
7704
7972
|
return walletSession.address;
|
|
7705
7973
|
}
|
|
7706
7974
|
if (connectedWalletAddress) return connectedWalletAddress;
|
|
7707
7975
|
return null;
|
|
7708
7976
|
}, [
|
|
7709
7977
|
selectedEvmWalletOwner,
|
|
7710
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7711
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7978
|
+
_optionalChain([walletSession, 'optionalAccess', _271 => _271.address]),
|
|
7979
|
+
_optionalChain([walletSession, 'optionalAccess', _272 => _272.isConnected]),
|
|
7712
7980
|
connectedWalletAddress
|
|
7713
7981
|
]);
|
|
7714
7982
|
const activeOwner = _react.useMemo.call(void 0,
|
|
7715
7983
|
() => resolveOwnerForMode(flowMode, {
|
|
7716
|
-
walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess',
|
|
7984
|
+
walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _273 => _273.ownerAddress]), () => ( (canAutoLock ? connectedWalletAddress : selectedEvmWalletOwner))),
|
|
7717
7985
|
dappImportOwner
|
|
7718
7986
|
}),
|
|
7719
7987
|
[
|
|
7720
7988
|
flowMode,
|
|
7721
|
-
_optionalChain([signerContext, 'optionalAccess',
|
|
7989
|
+
_optionalChain([signerContext, 'optionalAccess', _274 => _274.ownerAddress]),
|
|
7722
7990
|
canAutoLock,
|
|
7723
7991
|
connectedWalletAddress,
|
|
7724
7992
|
selectedEvmWalletOwner,
|
|
@@ -7735,7 +8003,7 @@ function DepositFlow({
|
|
|
7735
8003
|
].join(":");
|
|
7736
8004
|
if (lastSmartAccountLifecycleKeyRef.current === lifecycleKey) return;
|
|
7737
8005
|
lastSmartAccountLifecycleKeyRef.current = lifecycleKey;
|
|
7738
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
8006
|
+
_optionalChain([onLifecycleRef, 'access', _275 => _275.current, 'optionalCall', _276 => _276({
|
|
7739
8007
|
type: "smart-account-changed",
|
|
7740
8008
|
evm: activeEntry.smartAccount,
|
|
7741
8009
|
solana: _nullishCoalesce(activeEntry.solanaDepositAddress, () => ( null))
|
|
@@ -7763,7 +8031,7 @@ function DepositFlow({
|
|
|
7763
8031
|
return;
|
|
7764
8032
|
}
|
|
7765
8033
|
lastConnectedLifecycleKeyRef.current = lifecycleKey;
|
|
7766
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
8034
|
+
_optionalChain([onLifecycleRef, 'access', _277 => _277.current, 'optionalCall', _278 => _278({
|
|
7767
8035
|
type: "connected",
|
|
7768
8036
|
address: activeOwner,
|
|
7769
8037
|
smartAccount: activeEntry.smartAccount
|
|
@@ -7836,7 +8104,7 @@ function DepositFlow({
|
|
|
7836
8104
|
const handleWalletDisconnect = _react.useCallback.call(void 0, () => {
|
|
7837
8105
|
analytics.abandon("wallet_disconnect");
|
|
7838
8106
|
analytics.resetAttempt();
|
|
7839
|
-
_optionalChain([onDisconnect, 'optionalCall',
|
|
8107
|
+
_optionalChain([onDisconnect, 'optionalCall', _279 => _279()]);
|
|
7840
8108
|
storeApi.dispatch({
|
|
7841
8109
|
type: "back/requested",
|
|
7842
8110
|
hasWalletOptions: hasWalletOptions || Boolean(walletSession)
|
|
@@ -7849,7 +8117,7 @@ function DepositFlow({
|
|
|
7849
8117
|
setQrSourcePrice({ resolved: false, usd: null });
|
|
7850
8118
|
if (!qrSourceAsset) return;
|
|
7851
8119
|
let cancelled = false;
|
|
7852
|
-
|
|
8120
|
+
_chunkHMUGY66Ocjs.fetchTokenPriceUsd.call(void 0, service, {
|
|
7853
8121
|
chainId: qrSourceAsset.chainId,
|
|
7854
8122
|
address: qrSourceAsset.token,
|
|
7855
8123
|
symbol: qrSourceAsset.symbol
|
|
@@ -7872,7 +8140,7 @@ function DepositFlow({
|
|
|
7872
8140
|
const currentBackHandler = canGoBackFromHere ? handleBack : void 0;
|
|
7873
8141
|
const currentScreen = showConnectStep ? "connect" : effectiveStep.type;
|
|
7874
8142
|
_react.useEffect.call(void 0, () => {
|
|
7875
|
-
_optionalChain([onStepChangeRef, 'access',
|
|
8143
|
+
_optionalChain([onStepChangeRef, 'access', _280 => _280.current, 'optionalCall', _281 => _281(currentBackHandler, currentScreen)]);
|
|
7876
8144
|
}, [currentBackHandler, currentScreen, onStepChangeRef]);
|
|
7877
8145
|
const lastModalHeightRef = _react.useRef.call(void 0, 0);
|
|
7878
8146
|
const modalContentElRef = _react.useRef.call(void 0, null);
|
|
@@ -7882,7 +8150,7 @@ function DepositFlow({
|
|
|
7882
8150
|
modalContentElRef.current = mc;
|
|
7883
8151
|
const ro = new ResizeObserver((entries) => {
|
|
7884
8152
|
for (const entry of entries) {
|
|
7885
|
-
const border = _optionalChain([entry, 'access',
|
|
8153
|
+
const border = _optionalChain([entry, 'access', _282 => _282.borderBoxSize, 'optionalAccess', _283 => _283[0], 'optionalAccess', _284 => _284.blockSize]);
|
|
7886
8154
|
lastModalHeightRef.current = typeof border === "number" ? border : entry.contentRect.height;
|
|
7887
8155
|
}
|
|
7888
8156
|
});
|
|
@@ -7943,7 +8211,7 @@ function DepositFlow({
|
|
|
7943
8211
|
targetToken
|
|
7944
8212
|
]);
|
|
7945
8213
|
_react.useEffect.call(void 0, () => {
|
|
7946
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
8214
|
+
_optionalChain([onLifecycleRef, 'access', _285 => _285.current, 'optionalCall', _286 => _286({
|
|
7947
8215
|
type: "balance-changed",
|
|
7948
8216
|
totalUsd: totalBalanceUsd
|
|
7949
8217
|
})]);
|
|
@@ -7960,9 +8228,9 @@ function DepositFlow({
|
|
|
7960
8228
|
const handleConfirmWallet = _react.useCallback.call(void 0,
|
|
7961
8229
|
(walletId) => {
|
|
7962
8230
|
const selectedOption = walletOptions.find((o) => o.id === walletId);
|
|
7963
|
-
const mode = _optionalChain([selectedOption, 'optionalAccess',
|
|
8231
|
+
const mode = _optionalChain([selectedOption, 'optionalAccess', _287 => _287.kind]) === "solana" ? "solana-wallet" : "wallet";
|
|
7964
8232
|
analytics.selectMethod("wallet", "user", {
|
|
7965
|
-
network: _optionalChain([selectedOption, 'optionalAccess',
|
|
8233
|
+
network: _optionalChain([selectedOption, 'optionalAccess', _288 => _288.kind]) === "solana" ? "solana" : "evm",
|
|
7966
8234
|
integration: _nullishCoalesce(walletIntegration, () => ( "none"))
|
|
7967
8235
|
});
|
|
7968
8236
|
storeApi.dispatch({
|
|
@@ -7974,7 +8242,7 @@ function DepositFlow({
|
|
|
7974
8242
|
[analytics, walletIntegration, walletOptions, storeApi]
|
|
7975
8243
|
);
|
|
7976
8244
|
const isSolanaWalletConnected = Boolean(
|
|
7977
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
8245
|
+
_optionalChain([walletSession, 'optionalAccess', _289 => _289.isConnected]) && _optionalChain([walletSession, 'optionalAccess', _290 => _290.isSolana])
|
|
7978
8246
|
);
|
|
7979
8247
|
const assetMigrationsKey = assetMigrations ? Object.keys(assetMigrations).filter((k) => assetMigrations[k]).sort().join(",") : "";
|
|
7980
8248
|
const enabledDappImportProviders = _react.useMemo.call(void 0,
|
|
@@ -7991,7 +8259,7 @@ function DepositFlow({
|
|
|
7991
8259
|
const owner = dappImportOwner;
|
|
7992
8260
|
if (owner) {
|
|
7993
8261
|
const wallet = walletOptions.find(
|
|
7994
|
-
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess',
|
|
8262
|
+
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _291 => _291.toLowerCase, 'call', _292 => _292()]) === owner.toLowerCase()
|
|
7995
8263
|
);
|
|
7996
8264
|
if (wallet) {
|
|
7997
8265
|
storeApi.dispatch({
|
|
@@ -8035,8 +8303,8 @@ function DepositFlow({
|
|
|
8035
8303
|
eoa: dappImportOwner,
|
|
8036
8304
|
getPublicClient: (chainId) => {
|
|
8037
8305
|
try {
|
|
8038
|
-
return
|
|
8039
|
-
} catch (
|
|
8306
|
+
return _chunkHMUGY66Ocjs.getPublicClient.call(void 0, chainId, rpcUrls);
|
|
8307
|
+
} catch (e41) {
|
|
8040
8308
|
return null;
|
|
8041
8309
|
}
|
|
8042
8310
|
},
|
|
@@ -8090,7 +8358,17 @@ function DepositFlow({
|
|
|
8090
8358
|
providerId: initialAssetMigrationProvider.id
|
|
8091
8359
|
});
|
|
8092
8360
|
}, [analytics, initialAssetMigrationProvider, flowSlice, storeApi]);
|
|
8093
|
-
const
|
|
8361
|
+
const storedDappImportAvailability = useDepositStore(
|
|
8362
|
+
(s) => s.dappImport.availability
|
|
8363
|
+
);
|
|
8364
|
+
const isExcludedByRestrictedList = _chunkHMUGY66Ocjs.useRestrictedListExclusion.call(void 0, );
|
|
8365
|
+
const dappImportAvailability = _react.useMemo.call(void 0,
|
|
8366
|
+
() => narrowDappImportAvailability(
|
|
8367
|
+
storedDappImportAvailability,
|
|
8368
|
+
isExcludedByRestrictedList
|
|
8369
|
+
),
|
|
8370
|
+
[storedDappImportAvailability, isExcludedByRestrictedList]
|
|
8371
|
+
);
|
|
8094
8372
|
const dappImportAvailabilityOwner = useDepositStore(
|
|
8095
8373
|
(s) => s.dappImport.availabilityOwner
|
|
8096
8374
|
);
|
|
@@ -8138,7 +8416,7 @@ function DepositFlow({
|
|
|
8138
8416
|
}, [activeDappImportProviderId, enabledDappImportProviders]);
|
|
8139
8417
|
const activeDappImportAvailability = _react.useMemo.call(void 0, () => {
|
|
8140
8418
|
if (!activeDappImportProviderId) return null;
|
|
8141
|
-
if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess',
|
|
8419
|
+
if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _293 => _293.toLowerCase, 'call', _294 => _294()]) !== dappImportOwner.toLowerCase()) {
|
|
8142
8420
|
return null;
|
|
8143
8421
|
}
|
|
8144
8422
|
const entry = dappImportAvailability[activeDappImportProviderId];
|
|
@@ -8181,7 +8459,7 @@ function DepositFlow({
|
|
|
8181
8459
|
setup: setupSlice
|
|
8182
8460
|
});
|
|
8183
8461
|
const pinnableWallet = dappImportOwner ? _nullishCoalesce(walletOptions.find(
|
|
8184
|
-
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess',
|
|
8462
|
+
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _295 => _295.toLowerCase, 'call', _296 => _296()]) === dappImportOwner.toLowerCase()
|
|
8185
8463
|
), () => ( null)) : null;
|
|
8186
8464
|
const outcome = resolveBootOutcome({
|
|
8187
8465
|
status,
|
|
@@ -8231,7 +8509,7 @@ function DepositFlow({
|
|
|
8231
8509
|
if (dappImportOwner) {
|
|
8232
8510
|
const plan = bootRetryPlan({
|
|
8233
8511
|
setupStatus: snapshot.setup.status,
|
|
8234
|
-
availabilityEntry: _optionalChain([snapshot, 'access',
|
|
8512
|
+
availabilityEntry: _optionalChain([snapshot, 'access', _297 => _297.dappImport, 'access', _298 => _298.availabilityOwner, 'optionalAccess', _299 => _299.toLowerCase, 'call', _300 => _300()]) === dappImportOwner.toLowerCase() ? snapshot.dappImport.availability[providerId] : void 0
|
|
8235
8513
|
});
|
|
8236
8514
|
if (plan.restartSetup) {
|
|
8237
8515
|
storeApi.dispatch({ type: "setup/retry-requested" });
|
|
@@ -8305,7 +8583,7 @@ function DepositFlow({
|
|
|
8305
8583
|
acceptedExchangeFeeBps: disclosedFeeBps
|
|
8306
8584
|
});
|
|
8307
8585
|
} catch (error) {
|
|
8308
|
-
if (error instanceof
|
|
8586
|
+
if (error instanceof _chunkHMUGY66Ocjs.SwappedConnectFeeChangedError) {
|
|
8309
8587
|
return error.exchangeFeeBps;
|
|
8310
8588
|
}
|
|
8311
8589
|
throw error;
|
|
@@ -8313,7 +8591,7 @@ function DepositFlow({
|
|
|
8313
8591
|
entry = { smartAccount: owner, response };
|
|
8314
8592
|
}
|
|
8315
8593
|
const currentAccount = storeApi.getState().setup.smartAccount;
|
|
8316
|
-
if (_optionalChain([currentAccount, 'optionalAccess',
|
|
8594
|
+
if (_optionalChain([currentAccount, 'optionalAccess', _301 => _301.toLowerCase, 'call', _302 => _302()]) !== owner) {
|
|
8317
8595
|
swappedConnectUrlRef.current.delete(key);
|
|
8318
8596
|
throw new Error("Deposit account changed. Select your exchange again.");
|
|
8319
8597
|
}
|
|
@@ -8347,7 +8625,7 @@ function DepositFlow({
|
|
|
8347
8625
|
);
|
|
8348
8626
|
}
|
|
8349
8627
|
swappedConnectUrlRef.current.delete(key);
|
|
8350
|
-
const response = _optionalChain([entry, 'optionalAccess',
|
|
8628
|
+
const response = _optionalChain([entry, 'optionalAccess', _303 => _303.smartAccount]) === smartAccount.toLowerCase() ? entry.response : await service.getSwappedConnectUrl({
|
|
8351
8629
|
smartAccount,
|
|
8352
8630
|
connection,
|
|
8353
8631
|
acceptedExchangeFeeBps: expectedFeeBps
|
|
@@ -8515,7 +8793,7 @@ function DepositFlow({
|
|
|
8515
8793
|
const handleNewDeposit = _react.useCallback.call(void 0, () => {
|
|
8516
8794
|
analytics.completeStep();
|
|
8517
8795
|
analytics.resetAttempt();
|
|
8518
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
8796
|
+
_optionalChain([onLifecycleRef, 'access', _304 => _304.current, 'optionalCall', _305 => _305({
|
|
8519
8797
|
type: "smart-account-changed",
|
|
8520
8798
|
evm: null,
|
|
8521
8799
|
solana: null
|
|
@@ -8535,7 +8813,8 @@ function DepositFlow({
|
|
|
8535
8813
|
recipient,
|
|
8536
8814
|
outputTokenRules,
|
|
8537
8815
|
rejectUnmapped,
|
|
8538
|
-
forceRegister
|
|
8816
|
+
forceRegister,
|
|
8817
|
+
...payment ? { salt: payment.salt } : {}
|
|
8539
8818
|
}),
|
|
8540
8819
|
[
|
|
8541
8820
|
targetChain,
|
|
@@ -8543,20 +8822,21 @@ function DepositFlow({
|
|
|
8543
8822
|
recipient,
|
|
8544
8823
|
outputTokenRules,
|
|
8545
8824
|
rejectUnmapped,
|
|
8546
|
-
forceRegister
|
|
8825
|
+
forceRegister,
|
|
8826
|
+
payment
|
|
8547
8827
|
]
|
|
8548
8828
|
);
|
|
8549
|
-
const desiredSetupRequestKey =
|
|
8829
|
+
const desiredSetupRequestKey = _chunkHMUGY66Ocjs.computeRequestKey.call(void 0, setupInput);
|
|
8550
8830
|
const setupReady = setupSlice.status === "ready" && setupSlice.requestKey === desiredSetupRequestKey;
|
|
8551
8831
|
_react.useEffect.call(void 0, () => {
|
|
8552
8832
|
void (async () => {
|
|
8553
|
-
const requestKey =
|
|
8554
|
-
const cacheKey =
|
|
8555
|
-
const cacheable =
|
|
8833
|
+
const requestKey = _chunkHMUGY66Ocjs.computeRequestKey.call(void 0, setupInput);
|
|
8834
|
+
const cacheKey = _chunkHMUGY66Ocjs.computeCacheKey.call(void 0, setupInput);
|
|
8835
|
+
const cacheable = _chunkHMUGY66Ocjs.computeIsCacheable.call(void 0, setupInput);
|
|
8556
8836
|
if (storeApi.getState().setup.requestKey === requestKey) {
|
|
8557
8837
|
return;
|
|
8558
8838
|
}
|
|
8559
|
-
const dedupedResult =
|
|
8839
|
+
const dedupedResult = _chunkHMUGY66Ocjs.readDedupedAccountSetupResult.call(void 0, requestKey);
|
|
8560
8840
|
if (dedupedResult) {
|
|
8561
8841
|
storeApi.dispatch({
|
|
8562
8842
|
type: "setup/started",
|
|
@@ -8582,7 +8862,7 @@ function DepositFlow({
|
|
|
8582
8862
|
cacheable
|
|
8583
8863
|
});
|
|
8584
8864
|
try {
|
|
8585
|
-
const result = await
|
|
8865
|
+
const result = await _chunkHMUGY66Ocjs.runAccountSetupDeduped.call(void 0,
|
|
8586
8866
|
setupInput,
|
|
8587
8867
|
{ service, debug },
|
|
8588
8868
|
requestKey
|
|
@@ -8597,7 +8877,7 @@ function DepositFlow({
|
|
|
8597
8877
|
}
|
|
8598
8878
|
});
|
|
8599
8879
|
} catch (error) {
|
|
8600
|
-
const message = error instanceof
|
|
8880
|
+
const message = error instanceof _chunkHMUGY66Ocjs.SetupError ? error.message : "Deposit service is temporarily unavailable. Please try again shortly.";
|
|
8601
8881
|
storeApi.dispatch({
|
|
8602
8882
|
type: "setup/failed",
|
|
8603
8883
|
requestKey,
|
|
@@ -8629,11 +8909,11 @@ function DepositFlow({
|
|
|
8629
8909
|
return;
|
|
8630
8910
|
}
|
|
8631
8911
|
storeApi.dispatch({ type: "portfolio/loading", network, address });
|
|
8632
|
-
const requestId = _optionalChain([readPortfolioEntry, 'call',
|
|
8912
|
+
const requestId = _optionalChain([readPortfolioEntry, 'call', _306 => _306(
|
|
8633
8913
|
storeApi.getState().portfolio,
|
|
8634
8914
|
network,
|
|
8635
8915
|
address
|
|
8636
|
-
), 'optionalAccess',
|
|
8916
|
+
), 'optionalAccess', _307 => _307.requestId]);
|
|
8637
8917
|
if (requestId === void 0) return;
|
|
8638
8918
|
void (async () => {
|
|
8639
8919
|
try {
|
|
@@ -8646,9 +8926,9 @@ function DepositFlow({
|
|
|
8646
8926
|
address,
|
|
8647
8927
|
requestId,
|
|
8648
8928
|
totalUsd: portfolio.totalUsd,
|
|
8649
|
-
chainIds:
|
|
8929
|
+
chainIds: _chunkHMUGY66Ocjs.chainIdsByValue.call(void 0, portfolio.tokens)
|
|
8650
8930
|
});
|
|
8651
|
-
} catch (
|
|
8931
|
+
} catch (e42) {
|
|
8652
8932
|
storeApi.dispatch({
|
|
8653
8933
|
type: "portfolio/failed",
|
|
8654
8934
|
network,
|
|
@@ -8670,7 +8950,7 @@ function DepositFlow({
|
|
|
8670
8950
|
{ type: "transaction_hash", value: data.txHash },
|
|
8671
8951
|
"transfer_tracking"
|
|
8672
8952
|
);
|
|
8673
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
8953
|
+
_optionalChain([onLifecycleRef, 'access', _308 => _308.current, 'optionalCall', _309 => _309({ type: "submitted", ...data })]);
|
|
8674
8954
|
},
|
|
8675
8955
|
[analytics, logFlow, onLifecycleRef]
|
|
8676
8956
|
);
|
|
@@ -8739,7 +9019,7 @@ function DepositFlow({
|
|
|
8739
9019
|
sourceDecimals: tokenAtSubmit.decimals,
|
|
8740
9020
|
inputAmountUsd: amountUsd
|
|
8741
9021
|
});
|
|
8742
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
9022
|
+
_optionalChain([onLifecycleRef, 'access', _310 => _310.current, 'optionalCall', _311 => _311({
|
|
8743
9023
|
type: "submitted",
|
|
8744
9024
|
txHash,
|
|
8745
9025
|
sourceChain: "solana",
|
|
@@ -8833,8 +9113,8 @@ function DepositFlow({
|
|
|
8833
9113
|
sourceChain: chainId,
|
|
8834
9114
|
sourceToken: token,
|
|
8835
9115
|
amount,
|
|
8836
|
-
sourceSymbol: _optionalChain([asset, 'optionalAccess',
|
|
8837
|
-
sourceDecimals: _optionalChain([asset, 'optionalAccess',
|
|
9116
|
+
sourceSymbol: _optionalChain([asset, 'optionalAccess', _312 => _312.symbol]),
|
|
9117
|
+
sourceDecimals: _optionalChain([asset, 'optionalAccess', _313 => _313.decimals]),
|
|
8838
9118
|
inputAmountUsd: _nullishCoalesce(depositAtSubmit.inputAmountUsd, () => ( void 0)),
|
|
8839
9119
|
directTransfer: routed.directTransfer,
|
|
8840
9120
|
sourceTxHashPending: routed.sourceTxHashPending,
|
|
@@ -8875,7 +9155,7 @@ function DepositFlow({
|
|
|
8875
9155
|
swappedContext,
|
|
8876
9156
|
initialEvent: info.initialEvent
|
|
8877
9157
|
});
|
|
8878
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
9158
|
+
_optionalChain([onLifecycleRef, 'access', _314 => _314.current, 'optionalCall', _315 => _315({
|
|
8879
9159
|
type: "submitted",
|
|
8880
9160
|
txHash: info.txHash,
|
|
8881
9161
|
sourceChain: SWAPPED_SOURCE_CHAIN,
|
|
@@ -8903,12 +9183,12 @@ function DepositFlow({
|
|
|
8903
9183
|
const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
|
|
8904
9184
|
(txHash, sourceChain, amount) => {
|
|
8905
9185
|
const depositAtSubmit = storeApi.getState().deposit;
|
|
8906
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
9186
|
+
_optionalChain([onLifecycleRef, 'access', _316 => _316.current, 'optionalCall', _317 => _317({
|
|
8907
9187
|
type: "submitted",
|
|
8908
9188
|
txHash,
|
|
8909
9189
|
sourceChain,
|
|
8910
9190
|
amount,
|
|
8911
|
-
sourceDecimals: _optionalChain([depositAtSubmit, 'access',
|
|
9191
|
+
sourceDecimals: _optionalChain([depositAtSubmit, 'access', _318 => _318.selectedAsset, 'optionalAccess', _319 => _319.decimals]),
|
|
8912
9192
|
amountUsd: _nullishCoalesce(depositAtSubmit.inputAmountUsd, () => ( void 0))
|
|
8913
9193
|
})]);
|
|
8914
9194
|
},
|
|
@@ -8921,7 +9201,7 @@ function DepositFlow({
|
|
|
8921
9201
|
analyticsStepForFlowStep(analyticsMethod, "processing")
|
|
8922
9202
|
);
|
|
8923
9203
|
analytics.outcome("completed");
|
|
8924
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
9204
|
+
_optionalChain([onLifecycleRef, 'access', _320 => _320.current, 'optionalCall', _321 => _321({
|
|
8925
9205
|
type: "complete",
|
|
8926
9206
|
txHash,
|
|
8927
9207
|
destinationTxHash,
|
|
@@ -8938,7 +9218,7 @@ function DepositFlow({
|
|
|
8938
9218
|
);
|
|
8939
9219
|
analytics.outcome("failed");
|
|
8940
9220
|
analytics.failure("processor_failed", false);
|
|
8941
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
9221
|
+
_optionalChain([onLifecycleRef, 'access', _322 => _322.current, 'optionalCall', _323 => _323({ type: "failed", txHash, error })]);
|
|
8942
9222
|
},
|
|
8943
9223
|
[analytics, analyticsMethod, logFlowError, onLifecycleRef]
|
|
8944
9224
|
);
|
|
@@ -8959,7 +9239,7 @@ function DepositFlow({
|
|
|
8959
9239
|
failureStep
|
|
8960
9240
|
);
|
|
8961
9241
|
}
|
|
8962
|
-
_optionalChain([onErrorRef, 'access',
|
|
9242
|
+
_optionalChain([onErrorRef, 'access', _324 => _324.current, 'optionalCall', _325 => _325({ message, code, cause })]);
|
|
8963
9243
|
},
|
|
8964
9244
|
[analytics, logFlowError, onErrorRef]
|
|
8965
9245
|
);
|
|
@@ -9008,9 +9288,9 @@ function DepositFlow({
|
|
|
9008
9288
|
address: _nullishCoalesce(_nullishCoalesce(option.address, () => ( option.solanaAddress)), () => ( option.id)),
|
|
9009
9289
|
state,
|
|
9010
9290
|
errorReason: _nullishCoalesce(entry.message, () => ( void 0)),
|
|
9011
|
-
balanceStatus: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess',
|
|
9012
|
-
balanceUsd: _optionalChain([portfolioEntry, 'optionalAccess',
|
|
9013
|
-
balanceChainIds: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess',
|
|
9291
|
+
balanceStatus: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess', _326 => _326.status]), () => ( "loading")),
|
|
9292
|
+
balanceUsd: _optionalChain([portfolioEntry, 'optionalAccess', _327 => _327.status]) === "ready" ? portfolioEntry.totalUsd : null,
|
|
9293
|
+
balanceChainIds: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess', _328 => _328.chainIds]), () => ( []))
|
|
9014
9294
|
};
|
|
9015
9295
|
});
|
|
9016
9296
|
}, [enableWallet, walletOptions, setupSlice, portfolioSlice]);
|
|
@@ -9024,6 +9304,7 @@ function DepositFlow({
|
|
|
9024
9304
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9025
9305
|
ConnectStep,
|
|
9026
9306
|
{
|
|
9307
|
+
title: payment ? "Pay" : void 0,
|
|
9027
9308
|
walletRows,
|
|
9028
9309
|
defaultMethodTab: flowSlice.methodTab,
|
|
9029
9310
|
onMethodTabChange: (tab) => storeApi.dispatch({ type: "connect/method-tab-changed", tab }),
|
|
@@ -9093,6 +9374,7 @@ function DepositFlow({
|
|
|
9093
9374
|
effectiveStep.type === "deposit-address" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9094
9375
|
DepositAddressStep,
|
|
9095
9376
|
{
|
|
9377
|
+
payment,
|
|
9096
9378
|
smartAccount: effectiveStep.smartAccount,
|
|
9097
9379
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
9098
9380
|
service,
|
|
@@ -9191,7 +9473,7 @@ function DepositFlow({
|
|
|
9191
9473
|
consumePrefetchedUrl: consumeSwappedWidgetUrlPrefetch,
|
|
9192
9474
|
onSwappedComplete: handleSwappedComplete,
|
|
9193
9475
|
onSwappedFailed: handleDepositFailed,
|
|
9194
|
-
onClose: () => _optionalChain([onClose, 'optionalCall',
|
|
9476
|
+
onClose: () => _optionalChain([onClose, 'optionalCall', _329 => _329(
|
|
9195
9477
|
openExternally ? "native_dismiss_request" : "header_button"
|
|
9196
9478
|
)]),
|
|
9197
9479
|
onGoBack: handleProviderBack,
|
|
@@ -9205,8 +9487,9 @@ function DepositFlow({
|
|
|
9205
9487
|
}
|
|
9206
9488
|
),
|
|
9207
9489
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9208
|
-
|
|
9490
|
+
_chunkHMUGY66Ocjs.ProcessingStep,
|
|
9209
9491
|
{
|
|
9492
|
+
flowLabel: payment ? "payment" : void 0,
|
|
9210
9493
|
smartAccount: step.smartAccount,
|
|
9211
9494
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
9212
9495
|
txHash: step.txHash,
|
|
@@ -9271,7 +9554,7 @@ function DepositFlow({
|
|
|
9271
9554
|
loadUrl: () => loadSwappedConnectUrl(step.smartAccount, step.connection),
|
|
9272
9555
|
onSwappedComplete: handleSwappedComplete,
|
|
9273
9556
|
onSwappedFailed: handleDepositFailed,
|
|
9274
|
-
onClose: () => _optionalChain([onClose, 'optionalCall',
|
|
9557
|
+
onClose: () => _optionalChain([onClose, 'optionalCall', _330 => _330(
|
|
9275
9558
|
openExternally ? "native_dismiss_request" : "header_button"
|
|
9276
9559
|
)]),
|
|
9277
9560
|
onGoBack: handleProviderBack,
|
|
@@ -9285,8 +9568,9 @@ function DepositFlow({
|
|
|
9285
9568
|
}
|
|
9286
9569
|
),
|
|
9287
9570
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9288
|
-
|
|
9571
|
+
_chunkHMUGY66Ocjs.ProcessingStep,
|
|
9289
9572
|
{
|
|
9573
|
+
flowLabel: payment ? "payment" : void 0,
|
|
9290
9574
|
smartAccount: step.smartAccount,
|
|
9291
9575
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
9292
9576
|
txHash: step.txHash,
|
|
@@ -9320,8 +9604,8 @@ function DepositFlow({
|
|
|
9320
9604
|
);
|
|
9321
9605
|
}
|
|
9322
9606
|
if (isSolanaWalletMode) {
|
|
9323
|
-
const solanaAddr = _optionalChain([walletSession, 'optionalAccess',
|
|
9324
|
-
const solanaProvider = _optionalChain([walletSession, 'optionalAccess',
|
|
9607
|
+
const solanaAddr = _optionalChain([walletSession, 'optionalAccess', _331 => _331.solanaAddress]);
|
|
9608
|
+
const solanaProvider = _optionalChain([walletSession, 'optionalAccess', _332 => _332.solanaProvider]);
|
|
9325
9609
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
9326
9610
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9327
9611
|
AccountPreparingSkeleton,
|
|
@@ -9372,7 +9656,7 @@ function DepositFlow({
|
|
|
9372
9656
|
targetToken,
|
|
9373
9657
|
service,
|
|
9374
9658
|
solanaProvider,
|
|
9375
|
-
solanaConnection: _optionalChain([walletSession, 'optionalAccess',
|
|
9659
|
+
solanaConnection: _optionalChain([walletSession, 'optionalAccess', _333 => _333.solanaConnection]),
|
|
9376
9660
|
uiConfig,
|
|
9377
9661
|
onConfirm: handleSolanaConfirmed,
|
|
9378
9662
|
onError: handleError,
|
|
@@ -9414,8 +9698,9 @@ function DepositFlow({
|
|
|
9414
9698
|
) })
|
|
9415
9699
|
] }) : null,
|
|
9416
9700
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9417
|
-
|
|
9701
|
+
_chunkHMUGY66Ocjs.ProcessingStep,
|
|
9418
9702
|
{
|
|
9703
|
+
flowLabel: payment ? "payment" : void 0,
|
|
9419
9704
|
smartAccount: effectiveStep.smartAccount,
|
|
9420
9705
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
9421
9706
|
txHash: effectiveStep.txHash,
|
|
@@ -9453,7 +9738,7 @@ function DepositFlow({
|
|
|
9453
9738
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9454
9739
|
DappImportAssetSelectSkeleton,
|
|
9455
9740
|
{
|
|
9456
|
-
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportProvider, 'optionalAccess',
|
|
9741
|
+
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportProvider, 'optionalAccess', _334 => _334.sourceLabel]), () => ( "")),
|
|
9457
9742
|
error: dappImportBootError,
|
|
9458
9743
|
onRetry: handleBootRetry
|
|
9459
9744
|
}
|
|
@@ -9475,7 +9760,7 @@ function DepositFlow({
|
|
|
9475
9760
|
rows: dappImportSelectRows,
|
|
9476
9761
|
onRequestConnect: _nullishCoalesce(onConnect, () => ( onRequestConnect)),
|
|
9477
9762
|
onSelect: (providerId) => {
|
|
9478
|
-
const availabilityEntry = dappImportOwner && _optionalChain([dappImportAvailabilityOwner, 'optionalAccess',
|
|
9763
|
+
const availabilityEntry = dappImportOwner && _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _335 => _335.toLowerCase, 'call', _336 => _336()]) === dappImportOwner.toLowerCase() ? dappImportAvailability[providerId] : void 0;
|
|
9479
9764
|
if (availabilityEntry === "error") {
|
|
9480
9765
|
storeApi.dispatch({
|
|
9481
9766
|
type: "dapp-import/availability-retry-requested"
|
|
@@ -9494,16 +9779,16 @@ function DepositFlow({
|
|
|
9494
9779
|
}
|
|
9495
9780
|
);
|
|
9496
9781
|
}
|
|
9497
|
-
if (!_optionalChain([signerContext, 'optionalAccess',
|
|
9782
|
+
if (!_optionalChain([signerContext, 'optionalAccess', _337 => _337.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _338 => _338.publicClient])) {
|
|
9498
9783
|
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" }) }) }) }) });
|
|
9499
9784
|
}
|
|
9500
9785
|
const ownerAddress = signerContext.ownerAddress;
|
|
9501
|
-
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access',
|
|
9786
|
+
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _339 => _339.walletClient, 'optionalAccess', _340 => _340.chain, 'optionalAccess', _341 => _341.id]), () => ( _optionalChain([signerContext, 'access', _342 => _342.publicClient, 'access', _343 => _343.chain, 'optionalAccess', _344 => _344.id]))), () => ( setupChainId));
|
|
9502
9787
|
const getReadClientForChain = (chainId) => {
|
|
9503
|
-
if (_optionalChain([signerContext, 'access',
|
|
9788
|
+
if (_optionalChain([signerContext, 'access', _345 => _345.publicClient, 'access', _346 => _346.chain, 'optionalAccess', _347 => _347.id]) === chainId) {
|
|
9504
9789
|
return signerContext.publicClient;
|
|
9505
9790
|
}
|
|
9506
|
-
return
|
|
9791
|
+
return _chunkHMUGY66Ocjs.getPublicClient.call(void 0, chainId, rpcUrls);
|
|
9507
9792
|
};
|
|
9508
9793
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
9509
9794
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -9529,9 +9814,9 @@ function DepositFlow({
|
|
|
9529
9814
|
effectiveStep.type === "dapp-import-asset-select" && activeDappImportProvider && activeDappImportAvailability && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9530
9815
|
DappImportAssetSelectStep,
|
|
9531
9816
|
{
|
|
9532
|
-
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access',
|
|
9817
|
+
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access', _348 => _348.assets, 'access', _349 => _349[0], 'optionalAccess', _350 => _350.sourceLabel]), () => ( activeDappImportProvider.sourceLabel)),
|
|
9533
9818
|
assets: activeDappImportAvailability.assets,
|
|
9534
|
-
incompleteSummary: _optionalChain([activeDappImportAvailability, 'access',
|
|
9819
|
+
incompleteSummary: _optionalChain([activeDappImportAvailability, 'access', _351 => _351.incomplete, 'optionalAccess', _352 => _352.summary]),
|
|
9535
9820
|
onSelect: handleDappImportAssetSelected
|
|
9536
9821
|
}
|
|
9537
9822
|
),
|
|
@@ -9550,6 +9835,9 @@ function DepositFlow({
|
|
|
9550
9835
|
uiConfig,
|
|
9551
9836
|
appBalanceUsd,
|
|
9552
9837
|
service,
|
|
9838
|
+
payment,
|
|
9839
|
+
account: effectiveStep.smartAccount,
|
|
9840
|
+
title: payment ? "Amount to pay" : void 0,
|
|
9553
9841
|
onContinue: handleAmountContinue,
|
|
9554
9842
|
onCtaClick: (ctaName) => {
|
|
9555
9843
|
if (ctaName === "continue") analytics.completeStep();
|
|
@@ -9565,6 +9853,8 @@ function DepositFlow({
|
|
|
9565
9853
|
recipient,
|
|
9566
9854
|
asset: effectiveStep.asset,
|
|
9567
9855
|
amount: effectiveStep.amount,
|
|
9856
|
+
title: payment ? "Review payment" : void 0,
|
|
9857
|
+
routeThroughAccount: Boolean(payment),
|
|
9568
9858
|
targetAmount: effectiveStep.targetAmount,
|
|
9569
9859
|
targetTokenPriceUsd: effectiveStep.targetTokenPriceUsd,
|
|
9570
9860
|
balance: effectiveStep.balance,
|
|
@@ -9606,8 +9896,9 @@ function DepositFlow({
|
|
|
9606
9896
|
}
|
|
9607
9897
|
),
|
|
9608
9898
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9609
|
-
|
|
9899
|
+
_chunkHMUGY66Ocjs.ProcessingStep,
|
|
9610
9900
|
{
|
|
9901
|
+
flowLabel: payment ? "payment" : void 0,
|
|
9611
9902
|
smartAccount: effectiveStep.smartAccount,
|
|
9612
9903
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
9613
9904
|
txHash: effectiveStep.txHash,
|
|
@@ -9646,7 +9937,7 @@ function DepositFlow({
|
|
|
9646
9937
|
|
|
9647
9938
|
var ReownDepositInner = _react.lazy.call(void 0, async () => {
|
|
9648
9939
|
await loadReownDependencies();
|
|
9649
|
-
const module = await Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
9940
|
+
const module = await Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-UITYXJ6W.cjs")));
|
|
9650
9941
|
return { default: module.DepositModalReown };
|
|
9651
9942
|
});
|
|
9652
9943
|
function buildDepositAnalyticsSessionProperties({
|
|
@@ -9675,7 +9966,7 @@ function buildDepositAnalyticsSessionProperties({
|
|
|
9675
9966
|
enabledFundingMethods.push("wallet");
|
|
9676
9967
|
}
|
|
9677
9968
|
if (enableQrTransfer) enabledFundingMethods.push("transfer");
|
|
9678
|
-
if (enableFiatOnramp && _optionalChain([configuredFiatIdentifiers, 'optionalAccess',
|
|
9969
|
+
if (enableFiatOnramp && _optionalChain([configuredFiatIdentifiers, 'optionalAccess', _353 => _353.length]) !== 0) {
|
|
9679
9970
|
enabledFundingMethods.push("fiat_onramp");
|
|
9680
9971
|
}
|
|
9681
9972
|
if (enableExchangeConnect) enabledFundingMethods.push("exchange_connect");
|
|
@@ -9695,7 +9986,7 @@ function buildDepositAnalyticsSessionProperties({
|
|
|
9695
9986
|
amount: defaultAmount !== void 0,
|
|
9696
9987
|
initial_asset_migration: initialAssetMigration !== void 0
|
|
9697
9988
|
},
|
|
9698
|
-
...
|
|
9989
|
+
..._chunkHMUGY66Ocjs.analyticsTargetProperties.call(void 0, { targetChain, targetToken })
|
|
9699
9990
|
};
|
|
9700
9991
|
}
|
|
9701
9992
|
var WALLET_CLIENT_PROP = "walletClient";
|
|
@@ -9703,8 +9994,8 @@ function hasSuppliedWalletClient(props) {
|
|
|
9703
9994
|
return Object.prototype.hasOwnProperty.call(props, WALLET_CLIENT_PROP);
|
|
9704
9995
|
}
|
|
9705
9996
|
function DepositModal(props) {
|
|
9706
|
-
|
|
9707
|
-
|
|
9997
|
+
_chunkHMUGY66Ocjs.warnRemovedProps.call(void 0, "DepositModal", props);
|
|
9998
|
+
_chunkHMUGY66Ocjs.checkBackendUrl.call(void 0, "DepositModal", props.backendUrl);
|
|
9708
9999
|
const needsReown = !!props.reownAppId;
|
|
9709
10000
|
const hasWalletClientProp = hasSuppliedWalletClient(props);
|
|
9710
10001
|
if (needsReown) {
|
|
@@ -9739,6 +10030,7 @@ function DepositModalInner({
|
|
|
9739
10030
|
sourceToken,
|
|
9740
10031
|
defaultAmount,
|
|
9741
10032
|
recipient,
|
|
10033
|
+
payment,
|
|
9742
10034
|
appBalanceUsd,
|
|
9743
10035
|
backendUrl,
|
|
9744
10036
|
rpcUrls: rpcUrlsProp,
|
|
@@ -9776,8 +10068,8 @@ function DepositModalInner({
|
|
|
9776
10068
|
const analyticsControllerRef = _react.useRef.call(void 0, null);
|
|
9777
10069
|
const analyticsSessionIdRef = _react.useRef.call(void 0, null);
|
|
9778
10070
|
const previousOpenRef = _react.useRef.call(void 0, isOpen);
|
|
9779
|
-
const onReadyRef =
|
|
9780
|
-
const onUiStateRef =
|
|
10071
|
+
const onReadyRef = _chunkHMUGY66Ocjs.useLatestRef.call(void 0, onReady);
|
|
10072
|
+
const onUiStateRef = _chunkHMUGY66Ocjs.useLatestRef.call(void 0, onUiState);
|
|
9781
10073
|
const [currentScreen, setCurrentScreen] = _react.useState.call(void 0, "connect");
|
|
9782
10074
|
const [swappedImmersive, setSwappedImmersive] = _react.useState.call(void 0, false);
|
|
9783
10075
|
const [submitting, setSubmitting] = _react.useState.call(void 0, false);
|
|
@@ -9785,31 +10077,31 @@ function DepositModalInner({
|
|
|
9785
10077
|
void 0
|
|
9786
10078
|
);
|
|
9787
10079
|
const [processingSettled, setProcessingSettled] = _react.useState.call(void 0, false);
|
|
9788
|
-
const historyButtonVisible =
|
|
10080
|
+
const historyButtonVisible = !payment && _chunkHMUGY66Ocjs.isHistoryEntryVisible.call(void 0, {
|
|
9789
10081
|
screen: currentScreen,
|
|
9790
10082
|
submitting,
|
|
9791
10083
|
settled: processingSettled
|
|
9792
10084
|
});
|
|
9793
10085
|
const targetChain = typeof targetChainProp === "string" ? targetChainProp : _chunkOY5N3E6Lcjs.getChainId.call(void 0, targetChainProp);
|
|
9794
10086
|
const sourceChain = sourceChainProp ? _chunkOY5N3E6Lcjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
9795
|
-
const rpcUrls =
|
|
10087
|
+
const rpcUrls = _chunkHMUGY66Ocjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
|
|
9796
10088
|
const service = _react.useMemo.call(void 0,
|
|
9797
|
-
() =>
|
|
10089
|
+
() => _chunkHMUGY66Ocjs.createDepositService.call(void 0, backendUrl, {
|
|
9798
10090
|
debug,
|
|
9799
10091
|
debugScope: "service:deposit"
|
|
9800
10092
|
}),
|
|
9801
10093
|
[backendUrl, debug]
|
|
9802
10094
|
);
|
|
9803
10095
|
const historyAnalytics = _react.useMemo.call(void 0,
|
|
9804
|
-
() =>
|
|
10096
|
+
() => _chunkHMUGY66Ocjs.createHistoryAnalytics.call(void 0, {
|
|
9805
10097
|
modal: "deposit",
|
|
9806
10098
|
controllerRef: analyticsControllerRef,
|
|
9807
10099
|
sessionIdRef: analyticsSessionIdRef
|
|
9808
10100
|
}),
|
|
9809
10101
|
[]
|
|
9810
10102
|
);
|
|
9811
|
-
const history =
|
|
9812
|
-
isOpen,
|
|
10103
|
+
const history = _chunkHMUGY66Ocjs.useHistoryPanel.call(void 0, {
|
|
10104
|
+
isOpen: isOpen && !payment,
|
|
9813
10105
|
recipient,
|
|
9814
10106
|
service,
|
|
9815
10107
|
canRecover: Boolean(signRecovery),
|
|
@@ -9848,15 +10140,15 @@ function DepositModalInner({
|
|
|
9848
10140
|
}, [store, targetChain, targetToken]);
|
|
9849
10141
|
_react.useEffect.call(void 0, () => {
|
|
9850
10142
|
if (!isOpen || !modalRef.current) return;
|
|
9851
|
-
return
|
|
10143
|
+
return _chunkHMUGY66Ocjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
9852
10144
|
}, [isOpen, theme]);
|
|
9853
10145
|
_react.useEffect.call(void 0, () => {
|
|
9854
10146
|
if (isOpen) {
|
|
9855
|
-
_optionalChain([onReadyRef, 'access',
|
|
10147
|
+
_optionalChain([onReadyRef, 'access', _354 => _354.current, 'optionalCall', _355 => _355()]);
|
|
9856
10148
|
}
|
|
9857
10149
|
}, [isOpen, onReadyRef]);
|
|
9858
10150
|
_react.useEffect.call(void 0, () => {
|
|
9859
|
-
_optionalChain([onUiStateRef, 'access',
|
|
10151
|
+
_optionalChain([onUiStateRef, 'access', _356 => _356.current, 'optionalCall', _357 => _357({
|
|
9860
10152
|
screen: currentScreen,
|
|
9861
10153
|
back: backHandler,
|
|
9862
10154
|
// A recovery in flight is a submission whose outcome is unknown, so a
|
|
@@ -9877,10 +10169,10 @@ function DepositModalInner({
|
|
|
9877
10169
|
},
|
|
9878
10170
|
[]
|
|
9879
10171
|
);
|
|
9880
|
-
const onLifecycleRef =
|
|
10172
|
+
const onLifecycleRef = _chunkHMUGY66Ocjs.useLatestRef.call(void 0, onLifecycle);
|
|
9881
10173
|
const handleLifecycle = _react.useCallback.call(void 0,
|
|
9882
10174
|
(event) => {
|
|
9883
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
10175
|
+
_optionalChain([onLifecycleRef, 'access', _358 => _358.current, 'optionalCall', _359 => _359(event)]);
|
|
9884
10176
|
if (event.type === "smart-account-changed" && !event.evm && !event.solana) {
|
|
9885
10177
|
invalidateHistory();
|
|
9886
10178
|
}
|
|
@@ -9894,8 +10186,8 @@ function DepositModalInner({
|
|
|
9894
10186
|
(source) => {
|
|
9895
10187
|
if (recoverySubmitting) return;
|
|
9896
10188
|
const analytics = analyticsControllerRef.current;
|
|
9897
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
9898
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
10189
|
+
_optionalChain([analytics, 'optionalAccess', _360 => _360.abandon, 'call', _361 => _361(source === "provider_back" ? "provider_back" : "modal_close")]);
|
|
10190
|
+
_optionalChain([analytics, 'optionalAccess', _362 => _362.close, 'call', _363 => _363(source)]);
|
|
9899
10191
|
onClose();
|
|
9900
10192
|
},
|
|
9901
10193
|
[onClose, recoverySubmitting]
|
|
@@ -9911,8 +10203,8 @@ function DepositModalInner({
|
|
|
9911
10203
|
_react.useEffect.call(void 0, () => {
|
|
9912
10204
|
if (previousOpenRef.current && !isOpen) {
|
|
9913
10205
|
const analytics = analyticsControllerRef.current;
|
|
9914
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
9915
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
10206
|
+
_optionalChain([analytics, 'optionalAccess', _364 => _364.abandon, 'call', _365 => _365("modal_close")]);
|
|
10207
|
+
_optionalChain([analytics, 'optionalAccess', _366 => _366.close, 'call', _367 => _367("host_controlled")]);
|
|
9916
10208
|
}
|
|
9917
10209
|
previousOpenRef.current = isOpen;
|
|
9918
10210
|
}, [isOpen]);
|
|
@@ -9949,12 +10241,12 @@ function DepositModalInner({
|
|
|
9949
10241
|
targetChain,
|
|
9950
10242
|
targetToken
|
|
9951
10243
|
});
|
|
9952
|
-
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
10244
|
+
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _368 => _368.showBackButton]), () => ( true));
|
|
9953
10245
|
const canGoBack = backHandler !== void 0;
|
|
9954
10246
|
const hideHeaderChrome = swappedImmersive;
|
|
9955
10247
|
const modalClassName = `rs-modal${hideHeaderChrome ? " rs-modal--swapped-iframe" : ""}`;
|
|
9956
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9957
|
-
|
|
10248
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.ChainCatalogProvider, { service, rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
10249
|
+
_chunkHMUGY66Ocjs.Modal,
|
|
9958
10250
|
{
|
|
9959
10251
|
isOpen,
|
|
9960
10252
|
onClose: handleModalDismiss,
|
|
@@ -9963,7 +10255,7 @@ function DepositModalInner({
|
|
|
9963
10255
|
closeOnOverlayClick,
|
|
9964
10256
|
ariaLabel: "Deposit",
|
|
9965
10257
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9966
|
-
|
|
10258
|
+
_chunkHMUGY66Ocjs.AnalyticsSession,
|
|
9967
10259
|
{
|
|
9968
10260
|
modal: "deposit",
|
|
9969
10261
|
sessionProperties: analyticsSessionProperties,
|
|
@@ -9985,12 +10277,12 @@ function DepositModalInner({
|
|
|
9985
10277
|
className: "rs-modal-header-back",
|
|
9986
10278
|
"aria-label": "Go back",
|
|
9987
10279
|
onClick: backHandler,
|
|
9988
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
10280
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.ChevronLeftIcon, {})
|
|
9989
10281
|
}
|
|
9990
10282
|
) }),
|
|
9991
10283
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
|
|
9992
10284
|
historyButtonVisible && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9993
|
-
|
|
10285
|
+
_chunkHMUGY66Ocjs.HistoryEntryButton,
|
|
9994
10286
|
{
|
|
9995
10287
|
badge: history.badge,
|
|
9996
10288
|
onClick: history.openPanel,
|
|
@@ -10004,7 +10296,7 @@ function DepositModalInner({
|
|
|
10004
10296
|
onClick: () => closeWithSource("header_button"),
|
|
10005
10297
|
className: "rs-modal-close",
|
|
10006
10298
|
"aria-label": "Close",
|
|
10007
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
10299
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHMUGY66Ocjs.CloseIcon, {})
|
|
10008
10300
|
}
|
|
10009
10301
|
)
|
|
10010
10302
|
] })
|
|
@@ -10022,6 +10314,7 @@ function DepositModalInner({
|
|
|
10022
10314
|
sourceToken,
|
|
10023
10315
|
amount: defaultAmount,
|
|
10024
10316
|
recipient,
|
|
10317
|
+
payment,
|
|
10025
10318
|
appBalanceUsd,
|
|
10026
10319
|
outputTokenRules,
|
|
10027
10320
|
rejectUnmapped,
|
|
@@ -10040,7 +10333,7 @@ function DepositModalInner({
|
|
|
10040
10333
|
onDisconnect,
|
|
10041
10334
|
onRequestConnect,
|
|
10042
10335
|
uiConfig,
|
|
10043
|
-
appFees: _optionalChain([clientSetup, 'optionalAccess',
|
|
10336
|
+
appFees: _optionalChain([clientSetup, 'optionalAccess', _369 => _369.appFees]),
|
|
10044
10337
|
appFeesResolved: clientSetup !== null,
|
|
10045
10338
|
onStepChange: handleStepChange,
|
|
10046
10339
|
onSwappedImmersiveChange: setSwappedImmersive,
|
|
@@ -10054,7 +10347,7 @@ function DepositModalInner({
|
|
|
10054
10347
|
}
|
|
10055
10348
|
),
|
|
10056
10349
|
history.isPanelOpen && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
10057
|
-
|
|
10350
|
+
_chunkHMUGY66Ocjs.HistoryOverlay,
|
|
10058
10351
|
{
|
|
10059
10352
|
controller: history,
|
|
10060
10353
|
backLabel: "Deposit",
|