@rhinestone/deposit-modal 0.20.0 → 0.21.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 +45 -17
- package/dist/{BankOnrampStep-JG32OCM2.mjs → BankOnrampStep-JTU7WS5R.mjs} +22 -12
- package/dist/{BankOnrampStep-NPGXAA7U.cjs → BankOnrampStep-QCPISCAQ.cjs} +34 -24
- package/dist/{DepositModalReown-3FGTPER6.mjs → DepositModalReown-FJBSF4VL.mjs} +5 -3
- package/dist/{DepositModalReown-ALVWADG7.cjs → DepositModalReown-QJ6O2FWY.cjs} +18 -16
- package/dist/{WithdrawModal-LL4Z5WZP.mjs → WithdrawModal-CB7RNEPI.mjs} +3 -3
- package/dist/WithdrawModal-E2BTWJV7.cjs +12 -0
- package/dist/{chunk-B2LZQIGB.mjs → chunk-2D3J53PX.mjs} +1 -1
- package/dist/{chunk-CXRH5MKO.cjs → chunk-4O2UGFFT.cjs} +385 -297
- package/dist/{chunk-HP7S7AD6.mjs → chunk-7CHQA2OZ.mjs} +1 -1
- package/dist/chunk-ADEWTBSN.cjs +19 -0
- package/dist/{chunk-FMUSY563.cjs → chunk-AV3SA7TW.cjs} +3 -3
- package/dist/{chunk-247GJH57.mjs → chunk-B2LUWNFX.mjs} +583 -533
- package/dist/{chunk-Z4RBTNKX.cjs → chunk-CAIRS4LK.cjs} +732 -682
- package/dist/{chunk-OPT5EW6L.cjs → chunk-CG3JKPUF.cjs} +2 -2
- package/dist/{chunk-5QUWEFD4.mjs → chunk-CXEQFRX4.mjs} +1 -1
- package/dist/chunk-PP4QE32S.mjs +19 -0
- package/dist/{chunk-XBJCZYBX.mjs → chunk-PZIKRYMO.mjs} +1 -1
- package/dist/{chunk-BTEG2VNZ.cjs → chunk-U7NYYT4Q.cjs} +58 -58
- package/dist/{chunk-32ERBFMO.mjs → chunk-UNXUOV3F.mjs} +131 -43
- package/dist/{chunk-EKFXUF5A.cjs → chunk-VQAV6ESI.cjs} +1 -1
- package/dist/{chunk-6CTJFR3T.mjs → chunk-WK2ELRL3.mjs} +5 -16
- package/dist/{chunk-PYRXOP2Y.cjs → chunk-X425VJFY.cjs} +10 -21
- package/dist/compliance.cjs +4 -4
- package/dist/compliance.mjs +3 -3
- package/dist/constants.cjs +2 -2
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +6 -4
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +5 -3
- package/dist/embed.cjs +16 -14
- package/dist/embed.d.cts +1 -1
- package/dist/embed.d.ts +1 -1
- package/dist/embed.mjs +6 -4
- package/dist/index.cjs +7 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +6 -4
- package/dist/onramp.cjs +5 -4
- package/dist/onramp.mjs +4 -3
- package/dist/server.cjs +12 -8
- package/dist/server.mjs +11 -7
- package/dist/{types-CixUBhrM.d.cts → types-BrxDZNEr.d.cts} +23 -11
- package/dist/{types-BxSrazbq.d.ts → types-DCUB4DY8.d.ts} +23 -11
- 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 +5 -5
- package/dist/WithdrawModal-5YWFJSYY.cjs +0 -12
|
@@ -94,7 +94,11 @@ var _chunkFVJKUTHFcjs = require('./chunk-FVJKUTHF.cjs');
|
|
|
94
94
|
|
|
95
95
|
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
var _chunk4O2UGFFTcjs = require('./chunk-4O2UGFFT.cjs');
|
|
98
102
|
|
|
99
103
|
|
|
100
104
|
|
|
@@ -117,6 +121,12 @@ var _chunkCXRH5MKOcjs = require('./chunk-CXRH5MKO.cjs');
|
|
|
117
121
|
var _chunkG264OM23cjs = require('./chunk-G264OM23.cjs');
|
|
118
122
|
|
|
119
123
|
|
|
124
|
+
var _chunkADEWTBSNcjs = require('./chunk-ADEWTBSN.cjs');
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
var _chunkCG3JKPUFcjs = require('./chunk-CG3JKPUF.cjs');
|
|
128
|
+
|
|
129
|
+
|
|
120
130
|
|
|
121
131
|
|
|
122
132
|
|
|
@@ -186,7 +196,6 @@ var _react = require('react');
|
|
|
186
196
|
|
|
187
197
|
|
|
188
198
|
|
|
189
|
-
|
|
190
199
|
// src/components/steps/ConnectStep.tsx
|
|
191
200
|
|
|
192
201
|
|
|
@@ -255,11 +264,11 @@ SegmentedToggle.displayName = "SegmentedToggle";
|
|
|
255
264
|
|
|
256
265
|
function ChainIcon({ chainId, className, loading }) {
|
|
257
266
|
const badge = _chunkFKJ6EJHHcjs.getChainBadge.call(void 0, chainId);
|
|
258
|
-
const catalogChain =
|
|
267
|
+
const catalogChain = _chunk4O2UGFFTcjs.useCatalogChain.call(void 0, _chunk4O2UGFFTcjs.catalogKeyForChain.call(void 0, chainId));
|
|
259
268
|
const name = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _2 => _2.name]), () => ( _chunkFKJ6EJHHcjs.getChainName.call(void 0, chainId)));
|
|
260
269
|
const initial = (_nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _3 => _3.name]), () => ( badge.shortLabel))).charAt(0);
|
|
261
270
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
262
|
-
|
|
271
|
+
_chunk4O2UGFFTcjs.CdnIcon,
|
|
263
272
|
{
|
|
264
273
|
src: _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _4 => _4.iconUrl]), () => ( _chunkFKJ6EJHHcjs.getChainIcon.call(void 0, chainId))),
|
|
265
274
|
alt: name,
|
|
@@ -282,7 +291,7 @@ ChainIcon.displayName = "ChainIcon";
|
|
|
282
291
|
// src/components/ui/WalletBadgeIcons/index.tsx
|
|
283
292
|
|
|
284
293
|
function BadgeImage({ src, alt = "" }) {
|
|
285
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
294
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.CdnIcon, { src, alt }) });
|
|
286
295
|
}
|
|
287
296
|
var WALLET_BADGES = ["rabby", "phantom", "walletconnect"];
|
|
288
297
|
function WalletBadgeIcons() {
|
|
@@ -335,7 +344,7 @@ var DAPP_IMPORT_CATALOG = [
|
|
|
335
344
|
// src/components/ui/BrandIcons.tsx
|
|
336
345
|
|
|
337
346
|
function ExchangeBadgeImage({ name }) {
|
|
338
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
347
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.CdnIcon, { src: _nullishCoalesce(_chunk4O2UGFFTcjs.getExchangeLogoSrc.call(void 0, name), () => ( void 0)) });
|
|
339
348
|
}
|
|
340
349
|
var CARD_NETWORKS = ["amex", "visa", "mastercard"];
|
|
341
350
|
function CardNetworkIcons() {
|
|
@@ -343,7 +352,7 @@ function CardNetworkIcons() {
|
|
|
343
352
|
"span",
|
|
344
353
|
{
|
|
345
354
|
className: `rs-card-network rs-card-network--${network}`,
|
|
346
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
355
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.CdnIcon, { src: _chunkFKJ6EJHHcjs.cdnIconUrl.call(void 0, "cards", network) })
|
|
347
356
|
},
|
|
348
357
|
network
|
|
349
358
|
)) });
|
|
@@ -362,7 +371,7 @@ function DappBadgeIcons() {
|
|
|
362
371
|
).filter(
|
|
363
372
|
(brand) => Boolean(brand)
|
|
364
373
|
);
|
|
365
|
-
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,
|
|
374
|
+
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, _chunk4O2UGFFTcjs.CdnIcon, { src: brand.iconUrl, alt: brand.label }) }, brand.id)) });
|
|
366
375
|
}
|
|
367
376
|
DappBadgeIcons.displayName = "DappBadgeIcons";
|
|
368
377
|
var DAPP_BADGE_COUNT = DAPP_BADGE_ORDER.length;
|
|
@@ -480,7 +489,7 @@ var CONNECT_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fra
|
|
|
480
489
|
] });
|
|
481
490
|
var EXTRA_EXCHANGE_COUNT = Math.max(
|
|
482
491
|
0,
|
|
483
|
-
|
|
492
|
+
_chunk4O2UGFFTcjs.SUPPORTED_CONNECT_EXCHANGE_COUNT - EXCHANGE_BADGE_COUNT
|
|
484
493
|
);
|
|
485
494
|
var EXCHANGE_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
486
495
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExchangeBadgeIcons, {}),
|
|
@@ -518,6 +527,7 @@ function ConnectStep({
|
|
|
518
527
|
onPrefetchFiatMethod,
|
|
519
528
|
recommendedMethod,
|
|
520
529
|
onSelectFundFromExchange,
|
|
530
|
+
fundFromExchangeLoading,
|
|
521
531
|
onRequestConnect,
|
|
522
532
|
onConnect,
|
|
523
533
|
onDisconnect,
|
|
@@ -539,7 +549,7 @@ function ConnectStep({
|
|
|
539
549
|
if (onSelectTransferCrypto) {
|
|
540
550
|
cryptoRows.push(
|
|
541
551
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
542
|
-
|
|
552
|
+
_chunk4O2UGFFTcjs.ListRow,
|
|
543
553
|
{
|
|
544
554
|
leading: TRANSFER_CRYPTO_LEADING,
|
|
545
555
|
title: "Transfer crypto",
|
|
@@ -560,7 +570,7 @@ function ConnectStep({
|
|
|
560
570
|
);
|
|
561
571
|
cryptoRows.push(
|
|
562
572
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
563
|
-
|
|
573
|
+
_chunk4O2UGFFTcjs.ListRow,
|
|
564
574
|
{
|
|
565
575
|
leading: renderWalletLeading(row),
|
|
566
576
|
title: collapseToExternal ? "External wallet" : row.label,
|
|
@@ -577,7 +587,7 @@ function ConnectStep({
|
|
|
577
587
|
if (!hasSessionWallet && handleConnect) {
|
|
578
588
|
cryptoRows.push(
|
|
579
589
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
580
|
-
|
|
590
|
+
_chunk4O2UGFFTcjs.ListRow,
|
|
581
591
|
{
|
|
582
592
|
leading: WALLET_LEADING,
|
|
583
593
|
title: "Connect wallet",
|
|
@@ -592,13 +602,15 @@ function ConnectStep({
|
|
|
592
602
|
if (onSelectFundFromExchange) {
|
|
593
603
|
cryptoRows.push(
|
|
594
604
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
595
|
-
|
|
605
|
+
_chunk4O2UGFFTcjs.ListRow,
|
|
596
606
|
{
|
|
597
607
|
leading: EXCHANGE_LEADING,
|
|
598
608
|
title: "Connect exchange",
|
|
599
609
|
subtitle: "Instant - No limit",
|
|
600
610
|
meta: EXCHANGE_META,
|
|
601
|
-
onClick: onSelectFundFromExchange
|
|
611
|
+
onClick: onSelectFundFromExchange,
|
|
612
|
+
disabled: fundFromExchangeLoading,
|
|
613
|
+
trailing: fundFromExchangeLoading ? SMALL_SPINNER : void 0
|
|
602
614
|
},
|
|
603
615
|
"connect-exchange"
|
|
604
616
|
)
|
|
@@ -607,7 +619,7 @@ function ConnectStep({
|
|
|
607
619
|
if (onSelectMigrateAssets) {
|
|
608
620
|
cryptoRows.push(
|
|
609
621
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
610
|
-
|
|
622
|
+
_chunk4O2UGFFTcjs.ListRow,
|
|
611
623
|
{
|
|
612
624
|
leading: MIGRATE_ASSETS_LEADING,
|
|
613
625
|
title: "Migrate assets",
|
|
@@ -628,7 +640,7 @@ function ConnectStep({
|
|
|
628
640
|
for (const opt of fiatPaymentMethods) {
|
|
629
641
|
cashRows.push(
|
|
630
642
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
631
|
-
|
|
643
|
+
_chunk4O2UGFFTcjs.ListRow,
|
|
632
644
|
{
|
|
633
645
|
leading: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FiatMethodIcon, { option: opt }),
|
|
634
646
|
title: opt.label,
|
|
@@ -643,7 +655,7 @@ function ConnectStep({
|
|
|
643
655
|
} else if (fiatLoading) {
|
|
644
656
|
cashRows.push(
|
|
645
657
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
646
|
-
|
|
658
|
+
_chunk4O2UGFFTcjs.ListRow,
|
|
647
659
|
{
|
|
648
660
|
leading: SMALL_SPINNER,
|
|
649
661
|
title: "Loading payment options\u2026",
|
|
@@ -691,7 +703,7 @@ function ConnectStep({
|
|
|
691
703
|
) : void 0
|
|
692
704
|
}
|
|
693
705
|
),
|
|
694
|
-
fiatNotice && (activeTab === "cash" || !hasCash) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
706
|
+
fiatNotice && (activeTab === "cash" || !hasCash) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.Callout, { variant: "warning", children: fiatNotice }),
|
|
695
707
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
696
708
|
"div",
|
|
697
709
|
{
|
|
@@ -711,7 +723,7 @@ function ConnectStep({
|
|
|
711
723
|
children: "Disconnect wallet"
|
|
712
724
|
}
|
|
713
725
|
) }),
|
|
714
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
726
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.PoweredBy, {})
|
|
715
727
|
] });
|
|
716
728
|
}
|
|
717
729
|
ConnectStep.displayName = "ConnectStep";
|
|
@@ -734,13 +746,13 @@ function AssetSelectStep({
|
|
|
734
746
|
const [selectedAssetId, setSelectedAssetId] = _react.useState.call(void 0, null);
|
|
735
747
|
const [loading, setLoading] = _react.useState.call(void 0, true);
|
|
736
748
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
737
|
-
const isDepositChain =
|
|
738
|
-
const isExcludedByRestrictedList =
|
|
739
|
-
const { catalog } =
|
|
740
|
-
const chainName =
|
|
749
|
+
const isDepositChain = _chunk4O2UGFFTcjs.useIsDepositChain.call(void 0, );
|
|
750
|
+
const isExcludedByRestrictedList = _chunk4O2UGFFTcjs.useRestrictedListExclusion.call(void 0, );
|
|
751
|
+
const { catalog } = _chunk4O2UGFFTcjs.useChainCatalog.call(void 0, );
|
|
752
|
+
const chainName = _chunk4O2UGFFTcjs.useChainName.call(void 0, );
|
|
741
753
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
742
754
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
743
|
-
return
|
|
755
|
+
return _chunk4O2UGFFTcjs.getAssetId.call(void 0, {
|
|
744
756
|
chainId: defaultSourceChain,
|
|
745
757
|
token: defaultSourceToken
|
|
746
758
|
});
|
|
@@ -765,7 +777,7 @@ function AssetSelectStep({
|
|
|
765
777
|
try {
|
|
766
778
|
const portfolio = await service.fetchPortfolio(address);
|
|
767
779
|
if (!active) return;
|
|
768
|
-
const portfolioAssets =
|
|
780
|
+
const portfolioAssets = _chunk4O2UGFFTcjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
769
781
|
setAssets(portfolioAssets);
|
|
770
782
|
emitAssetsUpdate(portfolioAssets);
|
|
771
783
|
const hasNative = portfolioAssets.some(
|
|
@@ -834,7 +846,7 @@ function AssetSelectStep({
|
|
|
834
846
|
return 0;
|
|
835
847
|
});
|
|
836
848
|
}, [assets, isDepositChain, isExcludedByRestrictedList]);
|
|
837
|
-
const displays =
|
|
849
|
+
const displays = _chunk4O2UGFFTcjs.useTokenDisplays.call(void 0,
|
|
838
850
|
filteredRows.map((asset) => ({
|
|
839
851
|
chain: asset.chainId,
|
|
840
852
|
address: asset.token,
|
|
@@ -861,7 +873,7 @@ function AssetSelectStep({
|
|
|
861
873
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
862
874
|
const numeric = Number(raw);
|
|
863
875
|
if (!Number.isFinite(numeric)) return raw;
|
|
864
|
-
return
|
|
876
|
+
return _chunk4O2UGFFTcjs.tokenFormatter.format(numeric);
|
|
865
877
|
} catch (e3) {
|
|
866
878
|
return asset.balance;
|
|
867
879
|
}
|
|
@@ -880,7 +892,7 @@ function AssetSelectStep({
|
|
|
880
892
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkG264OM23cjs.Spinner, { className: "rs-text-tertiary" }),
|
|
881
893
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
882
894
|
] }),
|
|
883
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
895
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.Callout, { variant: "error", children: error }),
|
|
884
896
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
885
897
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkG264OM23cjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
886
898
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
@@ -915,14 +927,14 @@ function AssetSelectStep({
|
|
|
915
927
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
|
|
916
928
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-icon-wrapper", children: [
|
|
917
929
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
918
|
-
|
|
930
|
+
_chunk4O2UGFFTcjs.TokenIcon,
|
|
919
931
|
{
|
|
920
932
|
token: { chain: asset.chainId, address: asset.token },
|
|
921
933
|
symbol: asset.symbol,
|
|
922
934
|
fallback: asset.symbol.slice(0, 4)
|
|
923
935
|
}
|
|
924
936
|
) }),
|
|
925
|
-
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
937
|
+
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.CdnIcon, { src: chainIcon, alt: chainName(asset.chainId) }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
926
938
|
"span",
|
|
927
939
|
{
|
|
928
940
|
className: "rs-asset-chain-badge",
|
|
@@ -949,14 +961,14 @@ function AssetSelectStep({
|
|
|
949
961
|
] })
|
|
950
962
|
] })
|
|
951
963
|
] }),
|
|
952
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ?
|
|
964
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunk4O2UGFFTcjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
953
965
|
]
|
|
954
966
|
},
|
|
955
967
|
asset.id
|
|
956
968
|
);
|
|
957
969
|
}) }),
|
|
958
970
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
959
|
-
|
|
971
|
+
_chunk4O2UGFFTcjs.Button,
|
|
960
972
|
{
|
|
961
973
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
962
974
|
disabled: !selectedAsset,
|
|
@@ -965,7 +977,7 @@ function AssetSelectStep({
|
|
|
965
977
|
}
|
|
966
978
|
)
|
|
967
979
|
] }),
|
|
968
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
980
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.PoweredBy, {})
|
|
969
981
|
] });
|
|
970
982
|
}
|
|
971
983
|
async function fetchNativeAssets(address, publicClient, existing, isDepositChain, catalogChain) {
|
|
@@ -973,7 +985,7 @@ async function fetchNativeAssets(address, publicClient, existing, isDepositChain
|
|
|
973
985
|
const connectedChainId = _optionalChain([publicClient, 'access', _18 => _18.chain, 'optionalAccess', _19 => _19.id]);
|
|
974
986
|
if (!connectedChainId) return [];
|
|
975
987
|
if (!isDepositChain(connectedChainId)) return [];
|
|
976
|
-
const id =
|
|
988
|
+
const id = _chunk4O2UGFFTcjs.getAssetId.call(void 0, {
|
|
977
989
|
chainId: connectedChainId,
|
|
978
990
|
token: _chunkFKJ6EJHHcjs.NATIVE_TOKEN_ADDRESS
|
|
979
991
|
});
|
|
@@ -1162,7 +1174,7 @@ function AmountStep({
|
|
|
1162
1174
|
_optionalChain([walletClient, 'optionalAccess', _30 => _30.chain, 'optionalAccess', _31 => _31.id]) && walletClient.chain.id !== asset.chainId
|
|
1163
1175
|
);
|
|
1164
1176
|
const targetChainId = _chunkFKJ6EJHHcjs.targetChainToChainId.call(void 0, targetChain);
|
|
1165
|
-
const targetSymbol =
|
|
1177
|
+
const targetSymbol = _chunk4O2UGFFTcjs.useTokenDisplay.call(void 0, targetChainId, targetToken).symbol;
|
|
1166
1178
|
const isSourceStablecoin = _chunkFKJ6EJHHcjs.isStablecoinSymbol.call(void 0, asset.symbol);
|
|
1167
1179
|
const derivedPriceUsd = _react.useMemo.call(void 0, () => {
|
|
1168
1180
|
if (tokenPriceUsdOverride !== void 0 && tokenPriceUsdOverride > 0)
|
|
@@ -1192,7 +1204,7 @@ function AmountStep({
|
|
|
1192
1204
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
1193
1205
|
if (!balanceTarget || !publicClient) return;
|
|
1194
1206
|
try {
|
|
1195
|
-
const bal =
|
|
1207
|
+
const bal = _chunk4O2UGFFTcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
1196
1208
|
address: asset.token,
|
|
1197
1209
|
abi: _viem.erc20Abi,
|
|
1198
1210
|
functionName: "balanceOf",
|
|
@@ -1213,7 +1225,7 @@ function AmountStep({
|
|
|
1213
1225
|
hasAttemptedSwitch.current = true;
|
|
1214
1226
|
switchChain(asset.chainId).catch((err) => {
|
|
1215
1227
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
1216
|
-
setError(
|
|
1228
|
+
setError(_chunk4O2UGFFTcjs.formatUserError.call(void 0, raw));
|
|
1217
1229
|
});
|
|
1218
1230
|
}
|
|
1219
1231
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -1266,7 +1278,7 @@ function AmountStep({
|
|
|
1266
1278
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
1267
1279
|
const numeric = Number(raw);
|
|
1268
1280
|
if (!Number.isFinite(numeric)) return raw;
|
|
1269
|
-
return
|
|
1281
|
+
return _chunk4O2UGFFTcjs.tokenFormatter.format(numeric);
|
|
1270
1282
|
} catch (e9) {
|
|
1271
1283
|
return "\u2026";
|
|
1272
1284
|
}
|
|
@@ -1307,8 +1319,8 @@ function AmountStep({
|
|
|
1307
1319
|
const exceedsBalance = Boolean(
|
|
1308
1320
|
sourceAmountUnits !== null && balance !== null && sourceAmountUnits > balance
|
|
1309
1321
|
);
|
|
1310
|
-
const boundsFor =
|
|
1311
|
-
const boundViolation =
|
|
1322
|
+
const boundsFor = _chunk4O2UGFFTcjs.useDepositBounds.call(void 0, );
|
|
1323
|
+
const boundViolation = _chunk4O2UGFFTcjs.depositBoundsViolation.call(void 0,
|
|
1312
1324
|
boundsFor(asset.chainId, asset.token),
|
|
1313
1325
|
sourceAmountUnits
|
|
1314
1326
|
);
|
|
@@ -1423,7 +1435,7 @@ function AmountStep({
|
|
|
1423
1435
|
// that way and the payer has to be told, not left on a dead button.
|
|
1424
1436
|
chainMismatch || lockedAmount === null || exceedsBalance || boundViolation !== null || knowsBalance && balance === null
|
|
1425
1437
|
) : chainMismatch || exceedsBalance || boundViolation !== null || blockedOnPricing || numericAmount === 0 && !isBelowMin || knowsBalance && balance === null;
|
|
1426
|
-
const chainName =
|
|
1438
|
+
const chainName = _chunk4O2UGFFTcjs.useChainName.call(void 0, );
|
|
1427
1439
|
const sourceChainName = chainName(asset.chainId);
|
|
1428
1440
|
const targetChainName = chainName(targetChainId);
|
|
1429
1441
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
@@ -1431,7 +1443,7 @@ function AmountStep({
|
|
|
1431
1443
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkG264OM23cjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkG264OM23cjs.WalletIcon, {}), title }),
|
|
1432
1444
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
1433
1445
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
1434
|
-
payment ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-amount-fixed", "aria-label": "Amount to pay", children: lockedAmount ? `${
|
|
1446
|
+
payment ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-amount-fixed", "aria-label": "Amount to pay", children: lockedAmount ? `${_chunk4O2UGFFTcjs.tokenFormatter.format(Number(lockedAmount))} ${asset.symbol}` : "\u2014" }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1435
1447
|
AnimatedAmountInput,
|
|
1436
1448
|
{
|
|
1437
1449
|
value: amount,
|
|
@@ -1448,13 +1460,13 @@ function AmountStep({
|
|
|
1448
1460
|
" available",
|
|
1449
1461
|
balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1450
1462
|
" (~",
|
|
1451
|
-
|
|
1463
|
+
_chunk4O2UGFFTcjs.currencyFormatter.format(balanceUsd),
|
|
1452
1464
|
")"
|
|
1453
1465
|
] })
|
|
1454
1466
|
] }),
|
|
1455
1467
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
1456
1468
|
"Min. deposit ",
|
|
1457
|
-
|
|
1469
|
+
_chunk4O2UGFFTcjs.currencyFormatter.format(minDepositUsd)
|
|
1458
1470
|
] })
|
|
1459
1471
|
] })
|
|
1460
1472
|
] }),
|
|
@@ -1480,7 +1492,7 @@ function AmountStep({
|
|
|
1480
1492
|
asset.symbol
|
|
1481
1493
|
] }),
|
|
1482
1494
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1483
|
-
|
|
1495
|
+
_chunk4O2UGFFTcjs.TokenIcon,
|
|
1484
1496
|
{
|
|
1485
1497
|
token: { chain: asset.chainId, address: asset.token },
|
|
1486
1498
|
symbol: asset.symbol
|
|
@@ -1497,7 +1509,7 @@ function AmountStep({
|
|
|
1497
1509
|
targetSymbol
|
|
1498
1510
|
] }),
|
|
1499
1511
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1500
|
-
|
|
1512
|
+
_chunk4O2UGFFTcjs.TokenIcon,
|
|
1501
1513
|
{
|
|
1502
1514
|
token: { chain: targetChainId, address: targetToken },
|
|
1503
1515
|
symbol: targetSymbol
|
|
@@ -1507,10 +1519,10 @@ function AmountStep({
|
|
|
1507
1519
|
] }),
|
|
1508
1520
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
1509
1521
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
1510
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
1522
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunk4O2UGFFTcjs.currencyFormatter.format(balanceAfterUsd) })
|
|
1511
1523
|
] })
|
|
1512
1524
|
] }),
|
|
1513
|
-
payment && paymentQuote === "unavailable" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1525
|
+
payment && paymentQuote === "unavailable" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4O2UGFFTcjs.Callout, { variant: "error", children: [
|
|
1514
1526
|
"This payment can't be priced from ",
|
|
1515
1527
|
asset.symbol,
|
|
1516
1528
|
" on",
|
|
@@ -1518,13 +1530,13 @@ function AmountStep({
|
|
|
1518
1530
|
sourceChainName,
|
|
1519
1531
|
" right now. Try another asset."
|
|
1520
1532
|
] }),
|
|
1521
|
-
blockedOnPricing && sourcePriceUnavailable && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1533
|
+
blockedOnPricing && sourcePriceUnavailable && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4O2UGFFTcjs.Callout, { variant: "error", children: [
|
|
1522
1534
|
asset.symbol,
|
|
1523
1535
|
" can't be priced right now, so this deposit can't be estimated. You can still send any amount to the deposit address."
|
|
1524
1536
|
] }),
|
|
1525
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1537
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.Callout, { variant: "error", children: error }),
|
|
1526
1538
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1527
|
-
|
|
1539
|
+
_chunk4O2UGFFTcjs.Button,
|
|
1528
1540
|
{
|
|
1529
1541
|
onClick: handleContinue,
|
|
1530
1542
|
fullWidth: true,
|
|
@@ -1533,7 +1545,7 @@ function AmountStep({
|
|
|
1533
1545
|
}
|
|
1534
1546
|
)
|
|
1535
1547
|
] }),
|
|
1536
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1548
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.PoweredBy, {})
|
|
1537
1549
|
] });
|
|
1538
1550
|
}
|
|
1539
1551
|
|
|
@@ -1562,14 +1574,14 @@ function ReviewDetails({
|
|
|
1562
1574
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
1563
1575
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1564
1576
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceChainName }),
|
|
1565
|
-
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1577
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.CdnIcon, { src: sourceChainIcon }) })
|
|
1566
1578
|
] })
|
|
1567
1579
|
] }),
|
|
1568
1580
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1569
1581
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
|
|
1570
1582
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1571
1583
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName }),
|
|
1572
|
-
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1584
|
+
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.CdnIcon, { src: targetChainIcon }) })
|
|
1573
1585
|
] })
|
|
1574
1586
|
] }),
|
|
1575
1587
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -1584,21 +1596,21 @@ function ReviewDetails({
|
|
|
1584
1596
|
" ",
|
|
1585
1597
|
sendSymbol
|
|
1586
1598
|
] }),
|
|
1587
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1599
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.TokenIcon, { token: sendToken, symbol: sendSymbol }) })
|
|
1588
1600
|
] })
|
|
1589
1601
|
] }),
|
|
1590
1602
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1591
1603
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Receive" }),
|
|
1592
1604
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1593
1605
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: receiveDisplay }),
|
|
1594
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1606
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.TokenIcon, { token: receiveToken, symbol: receiveSymbol }) })
|
|
1595
1607
|
] })
|
|
1596
1608
|
] }),
|
|
1597
1609
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1598
1610
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Fees" }),
|
|
1599
1611
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1600
1612
|
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 }),
|
|
1601
|
-
fee.tooltip !== void 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1613
|
+
fee.tooltip !== void 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.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, _chunkG264OM23cjs.InfoIcon, {}) }) })
|
|
1602
1614
|
] })
|
|
1603
1615
|
] })
|
|
1604
1616
|
] });
|
|
@@ -1821,24 +1833,24 @@ function ConfirmStep({
|
|
|
1821
1833
|
]);
|
|
1822
1834
|
const quote = setupReady && _optionalChain([quoteResult, 'optionalAccess', _71 => _71.requestKey]) === quoteRequestKey ? quoteResult.quote : null;
|
|
1823
1835
|
const targetChainId = _chunkFKJ6EJHHcjs.targetChainToChainId.call(void 0, targetChain);
|
|
1824
|
-
const resolvedTargetSymbol =
|
|
1836
|
+
const resolvedTargetSymbol = _chunk4O2UGFFTcjs.useTokenDisplay.call(void 0, targetChainId, targetToken).symbol;
|
|
1825
1837
|
const targetSymbol = sameRoute ? asset.symbol : resolvedTargetSymbol;
|
|
1826
|
-
const sourceTrusted =
|
|
1838
|
+
const sourceTrusted = _chunk4O2UGFFTcjs.useIsRecognizedToken.call(void 0, asset.chainId, asset.token);
|
|
1827
1839
|
const sourceChainName = _chunkFKJ6EJHHcjs.getChainName.call(void 0, asset.chainId);
|
|
1828
1840
|
const targetChainName = _chunkFKJ6EJHHcjs.getChainName.call(void 0, targetChainId);
|
|
1829
1841
|
const sourceChainIcon = _chunkFKJ6EJHHcjs.getChainIcon.call(void 0, asset.chainId);
|
|
1830
1842
|
const targetChainIcon = _chunkFKJ6EJHHcjs.getChainIcon.call(void 0, targetChainId);
|
|
1831
|
-
const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? _nullishCoalesce(
|
|
1832
|
-
const mustHaveQuote = !appFeesResolved ||
|
|
1843
|
+
const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? _nullishCoalesce(_chunk4O2UGFFTcjs.formatTokenAmount.call(void 0, Number(amount), asset.symbol), () => ( "0")) : "0";
|
|
1844
|
+
const mustHaveQuote = !appFeesResolved || _chunk4O2UGFFTcjs.resolveAppFeeBps.call(void 0,
|
|
1833
1845
|
appFees,
|
|
1834
1846
|
`eip155:${quoteSource.chainId}`,
|
|
1835
1847
|
quoteSource.token
|
|
1836
1848
|
) > 0;
|
|
1837
|
-
const { display: feeDisplay, struck: feesFullySponsored } =
|
|
1849
|
+
const { display: feeDisplay, struck: feesFullySponsored } = _chunk4O2UGFFTcjs.quoteFeeRow.call(void 0,
|
|
1838
1850
|
_optionalChain([quote, 'optionalAccess', _72 => _72.fees])
|
|
1839
1851
|
);
|
|
1840
1852
|
const directTransfer = sameRoute && !mustHaveQuote && !executeTransfer && !routeThroughAccount;
|
|
1841
|
-
const permitEligible = enableGaslessDeposit && !
|
|
1853
|
+
const permitEligible = enableGaslessDeposit && !_chunk4O2UGFFTcjs.isNativeAsset.call(void 0, asset) && !isDappImportAsset(asset) && !executeTransfer && !directTransfer && asset.chainId !== _chunkFKJ6EJHHcjs.HYPERCORE_CHAIN_ID;
|
|
1842
1854
|
const permitRequestKey = JSON.stringify([
|
|
1843
1855
|
smartAccount.toLowerCase(),
|
|
1844
1856
|
asset.chainId,
|
|
@@ -1848,9 +1860,9 @@ function ConfirmStep({
|
|
|
1848
1860
|
address.toLowerCase()
|
|
1849
1861
|
]);
|
|
1850
1862
|
const permit = permitEligible && !permitDisabled && _optionalChain([permitResult, 'optionalAccess', _73 => _73.requestKey]) === permitRequestKey ? permitResult.prepared : null;
|
|
1851
|
-
const boundsFor =
|
|
1863
|
+
const boundsFor = _chunk4O2UGFFTcjs.useDepositBounds.call(void 0, );
|
|
1852
1864
|
const activeRefusal = _nullishCoalesce((_optionalChain([previewRefusal, 'optionalAccess', _74 => _74.requestKey]) === quoteRequestKey ? previewRefusal.refusal : null), () => ( (_optionalChain([permitRefusal, 'optionalAccess', _75 => _75.requestKey]) === permitRequestKey ? permitRefusal.refusal : null)));
|
|
1853
|
-
const blockedReason = activeRefusal ?
|
|
1865
|
+
const blockedReason = activeRefusal ? _chunk4O2UGFFTcjs.describePolicyRefusal.call(void 0,
|
|
1854
1866
|
activeRefusal,
|
|
1855
1867
|
boundsFor(quoteSource.chainId, quoteSource.token)
|
|
1856
1868
|
) : null;
|
|
@@ -1866,12 +1878,12 @@ function ConfirmStep({
|
|
|
1866
1878
|
const receiveDisplay = (() => {
|
|
1867
1879
|
if (directTransfer) return `${formattedSendAmount} ${asset.symbol}`;
|
|
1868
1880
|
if (quote) {
|
|
1869
|
-
const quoted =
|
|
1881
|
+
const quoted = _chunk4O2UGFFTcjs.formatQuotedReceive.call(void 0, quote.output, targetSymbol);
|
|
1870
1882
|
if (quoted !== void 0) return quoted;
|
|
1871
1883
|
}
|
|
1872
1884
|
const usdValue = Number(targetAmount);
|
|
1873
1885
|
const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
|
|
1874
|
-
const estimate =
|
|
1886
|
+
const estimate = _chunk4O2UGFFTcjs.formatReceiveEstimate.call(void 0, {
|
|
1875
1887
|
sourceAmount: Number.isFinite(Number(amount)) ? Number(amount) : void 0,
|
|
1876
1888
|
sourceSymbol: asset.symbol,
|
|
1877
1889
|
targetSymbol,
|
|
@@ -1880,19 +1892,19 @@ function ConfirmStep({
|
|
|
1880
1892
|
// The target is the curated deposit destination, so a stablecoin target
|
|
1881
1893
|
// estimates at $1 when unquoted (DepositFlow skips fetching stablecoin
|
|
1882
1894
|
// target prices). Not applied to the source — that can be a held token.
|
|
1883
|
-
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } :
|
|
1895
|
+
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : _chunk4O2UGFFTcjs.isDisplayStablecoinSymbol.call(void 0, targetSymbol) ? { [targetSymbol.toUpperCase()]: 1 } : {}
|
|
1884
1896
|
});
|
|
1885
1897
|
if (estimate !== void 0) return estimate;
|
|
1886
1898
|
return targetSymbol;
|
|
1887
1899
|
})();
|
|
1888
1900
|
const servedExpectedSeconds = _nullishCoalesce(_optionalChain([quote, 'optionalAccess', _76 => _76.timing, 'optionalAccess', _77 => _77.expectedSeconds]), () => ( (quote && Number.isFinite(quote.estimatedFillTimeSeconds) ? quote.estimatedFillTimeSeconds : void 0)));
|
|
1889
|
-
const estimatedTimeDisplay = servedExpectedSeconds !== void 0 ?
|
|
1901
|
+
const estimatedTimeDisplay = servedExpectedSeconds !== void 0 ? _chunk4O2UGFFTcjs.formatExpectedDuration.call(void 0, servedExpectedSeconds) : estimatedTime;
|
|
1890
1902
|
_react.useEffect.call(void 0, () => {
|
|
1891
1903
|
if (chainMismatch && switchChain && !hasAttemptedSwitch.current) {
|
|
1892
1904
|
hasAttemptedSwitch.current = true;
|
|
1893
1905
|
switchChain(asset.chainId).catch((err) => {
|
|
1894
1906
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
1895
|
-
setError(
|
|
1907
|
+
setError(_chunk4O2UGFFTcjs.formatUserError.call(void 0, raw));
|
|
1896
1908
|
});
|
|
1897
1909
|
}
|
|
1898
1910
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -1920,7 +1932,7 @@ function ConfirmStep({
|
|
|
1920
1932
|
}).then((result) => {
|
|
1921
1933
|
if (cancelled) return;
|
|
1922
1934
|
setPreviewSettledKey(quoteRequestKey);
|
|
1923
|
-
if (
|
|
1935
|
+
if (_chunk4O2UGFFTcjs.isDepositPolicyRefusal.call(void 0, result)) {
|
|
1924
1936
|
setQuoteResult(null);
|
|
1925
1937
|
setPreviewRefusal({
|
|
1926
1938
|
requestKey: quoteRequestKey,
|
|
@@ -1970,7 +1982,7 @@ function ConfirmStep({
|
|
|
1970
1982
|
if (cancelled) return;
|
|
1971
1983
|
setPermitSettledKey(permitRequestKey);
|
|
1972
1984
|
if (prepared === null) return;
|
|
1973
|
-
if (
|
|
1985
|
+
if (_chunk4O2UGFFTcjs.isDepositPolicyRefusal.call(void 0, prepared)) {
|
|
1974
1986
|
setPermitRefusal({
|
|
1975
1987
|
requestKey: permitRequestKey,
|
|
1976
1988
|
refusal: prepared.policyRefusal
|
|
@@ -2105,9 +2117,9 @@ function ConfirmStep({
|
|
|
2105
2117
|
);
|
|
2106
2118
|
} catch (err) {
|
|
2107
2119
|
const raw = err instanceof Error ? err.message : "Signing failed";
|
|
2108
|
-
const safeToTransfer = !submitStarted || err instanceof
|
|
2120
|
+
const safeToTransfer = !submitStarted || err instanceof _chunk4O2UGFFTcjs.PermitDepositSubmitError && err.safeToTransfer;
|
|
2109
2121
|
if (safeToTransfer) setPermitDisabled(true);
|
|
2110
|
-
const message = safeToTransfer ?
|
|
2122
|
+
const message = safeToTransfer ? _chunk4O2UGFFTcjs.formatUserError.call(void 0, raw) : "Deposit submission status is uncertain. Check your activity before trying a transfer.";
|
|
2111
2123
|
setError(message);
|
|
2112
2124
|
_optionalChain([onError, 'optionalCall', _78 => _78(message, "PERMIT_ERROR", raw)]);
|
|
2113
2125
|
} finally {
|
|
@@ -2128,7 +2140,7 @@ function ConfirmStep({
|
|
|
2128
2140
|
const result = await executeTransfer(amountUnits);
|
|
2129
2141
|
hash = result.txHash;
|
|
2130
2142
|
resolvedSourceToken = result.sourceToken;
|
|
2131
|
-
} else if (
|
|
2143
|
+
} else if (_chunk4O2UGFFTcjs.isNativeAsset.call(void 0, asset)) {
|
|
2132
2144
|
hash = await walletClient.sendTransaction({
|
|
2133
2145
|
account,
|
|
2134
2146
|
chain,
|
|
@@ -2159,8 +2171,8 @@ function ConfirmStep({
|
|
|
2159
2171
|
);
|
|
2160
2172
|
} catch (err) {
|
|
2161
2173
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
2162
|
-
const uncertain =
|
|
2163
|
-
const message = uncertain ? "Deposit submission status is uncertain. Check your activity before trying again." :
|
|
2174
|
+
const uncertain = _chunk4O2UGFFTcjs.isSubmissionUncertain.call(void 0, err);
|
|
2175
|
+
const message = uncertain ? "Deposit submission status is uncertain. Check your activity before trying again." : _chunk4O2UGFFTcjs.formatUserError.call(void 0, raw);
|
|
2164
2176
|
if (uncertain) setSubmissionUncertain(true);
|
|
2165
2177
|
setError(message);
|
|
2166
2178
|
_optionalChain([onError, 'optionalCall', _80 => _80(message, "TRANSFER_ERROR", raw)]);
|
|
@@ -2188,9 +2200,9 @@ function ConfirmStep({
|
|
|
2188
2200
|
fee: { display: feeDisplay, struck: feesFullySponsored }
|
|
2189
2201
|
}
|
|
2190
2202
|
),
|
|
2191
|
-
(_nullishCoalesce(error, () => ( blockedReason))) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2203
|
+
(_nullishCoalesce(error, () => ( blockedReason))) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.Callout, { variant: "error", children: _nullishCoalesce(error, () => ( blockedReason)) }),
|
|
2192
2204
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2193
|
-
|
|
2205
|
+
_chunk4O2UGFFTcjs.Button,
|
|
2194
2206
|
{
|
|
2195
2207
|
onClick: handleConfirm,
|
|
2196
2208
|
loading: isSubmitting,
|
|
@@ -2219,7 +2231,7 @@ function ConfirmStep({
|
|
|
2219
2231
|
] }),
|
|
2220
2232
|
!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." })
|
|
2221
2233
|
] }),
|
|
2222
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2234
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.PoweredBy, {})
|
|
2223
2235
|
] });
|
|
2224
2236
|
}
|
|
2225
2237
|
|
|
@@ -2240,9 +2252,9 @@ function QrReviewStep({
|
|
|
2240
2252
|
}) {
|
|
2241
2253
|
const [quote, setQuote] = _react.useState.call(void 0, { state: "loading", value: null });
|
|
2242
2254
|
const targetChainId = _chunkFKJ6EJHHcjs.targetChainToChainId.call(void 0, targetChain);
|
|
2243
|
-
const targetSymbol =
|
|
2244
|
-
const sourceTrusted =
|
|
2245
|
-
const boundsFor =
|
|
2255
|
+
const targetSymbol = _chunk4O2UGFFTcjs.useTokenDisplay.call(void 0, targetChainId, targetToken).symbol;
|
|
2256
|
+
const sourceTrusted = _chunk4O2UGFFTcjs.useIsRecognizedToken.call(void 0, asset.chainId, asset.token);
|
|
2257
|
+
const boundsFor = _chunk4O2UGFFTcjs.useDepositBounds.call(void 0, );
|
|
2246
2258
|
_react.useEffect.call(void 0, () => {
|
|
2247
2259
|
let cancelled = false;
|
|
2248
2260
|
let units;
|
|
@@ -2264,7 +2276,7 @@ function QrReviewStep({
|
|
|
2264
2276
|
amount: units.toString()
|
|
2265
2277
|
}).then((result) => {
|
|
2266
2278
|
if (cancelled) return;
|
|
2267
|
-
if (
|
|
2279
|
+
if (_chunk4O2UGFFTcjs.isDepositPolicyRefusal.call(void 0, result)) {
|
|
2268
2280
|
setQuote({
|
|
2269
2281
|
state: "refused",
|
|
2270
2282
|
value: null,
|
|
@@ -2282,26 +2294,26 @@ function QrReviewStep({
|
|
|
2282
2294
|
cancelled = true;
|
|
2283
2295
|
};
|
|
2284
2296
|
}, [service, smartAccount, asset, amount]);
|
|
2285
|
-
const formattedSendAmount = _nullishCoalesce(
|
|
2297
|
+
const formattedSendAmount = _nullishCoalesce(_chunk4O2UGFFTcjs.formatTokenAmount.call(void 0, Number(amount), asset.symbol), () => ( amount));
|
|
2286
2298
|
const receiveDisplay = (() => {
|
|
2287
2299
|
if (quote.value) {
|
|
2288
|
-
const quoted =
|
|
2300
|
+
const quoted = _chunk4O2UGFFTcjs.formatQuotedReceive.call(void 0, quote.value.output, targetSymbol);
|
|
2289
2301
|
if (quoted !== void 0) return quoted;
|
|
2290
2302
|
}
|
|
2291
2303
|
const usdValue = Number(targetAmount);
|
|
2292
|
-
const estimate =
|
|
2304
|
+
const estimate = _chunk4O2UGFFTcjs.formatReceiveEstimate.call(void 0, {
|
|
2293
2305
|
sourceAmount: Number.isFinite(Number(amount)) ? Number(amount) : void 0,
|
|
2294
2306
|
sourceSymbol: asset.symbol,
|
|
2295
2307
|
targetSymbol,
|
|
2296
2308
|
sourceAmountUsd: Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0,
|
|
2297
2309
|
sourceTrusted,
|
|
2298
|
-
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } :
|
|
2310
|
+
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : _chunk4O2UGFFTcjs.isDisplayStablecoinSymbol.call(void 0, targetSymbol) ? { [targetSymbol.toUpperCase()]: 1 } : {}
|
|
2299
2311
|
});
|
|
2300
2312
|
return _nullishCoalesce(estimate, () => ( targetSymbol));
|
|
2301
2313
|
})();
|
|
2302
2314
|
const expectedSeconds = _nullishCoalesce(_optionalChain([quote, 'access', _81 => _81.value, 'optionalAccess', _82 => _82.timing, 'optionalAccess', _83 => _83.expectedSeconds]), () => ( (quote.value && Number.isFinite(quote.value.estimatedFillTimeSeconds) ? quote.value.estimatedFillTimeSeconds : void 0)));
|
|
2303
|
-
const estimatedTime = expectedSeconds !== void 0 ?
|
|
2304
|
-
const { display: quotedFee, struck } =
|
|
2315
|
+
const estimatedTime = expectedSeconds !== void 0 ? _chunk4O2UGFFTcjs.formatExpectedDuration.call(void 0, expectedSeconds) : quote.state === "loading" ? "\u2026" : "\u2014";
|
|
2316
|
+
const { display: quotedFee, struck } = _chunk4O2UGFFTcjs.quoteFeeRow.call(void 0, _optionalChain([quote, 'access', _84 => _84.value, 'optionalAccess', _85 => _85.fees]));
|
|
2305
2317
|
const feeDisplay = quote.state === "unavailable" || quote.state === "refused" ? "\u2014" : quotedFee;
|
|
2306
2318
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
2307
2319
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
@@ -2323,13 +2335,13 @@ function QrReviewStep({
|
|
|
2323
2335
|
fee: { display: feeDisplay, struck }
|
|
2324
2336
|
}
|
|
2325
2337
|
),
|
|
2326
|
-
quote.state === "refused" && quote.refusal && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2338
|
+
quote.state === "refused" && quote.refusal && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.Callout, { variant: "error", children: _chunk4O2UGFFTcjs.describePolicyRefusal.call(void 0,
|
|
2327
2339
|
quote.refusal,
|
|
2328
2340
|
boundsFor(asset.chainId, asset.token)
|
|
2329
2341
|
) }),
|
|
2330
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2342
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.Button, { onClick: onClose, fullWidth: true, children: "Close" })
|
|
2331
2343
|
] }),
|
|
2332
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2344
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.PoweredBy, {})
|
|
2333
2345
|
] });
|
|
2334
2346
|
}
|
|
2335
2347
|
QrReviewStep.displayName = "QrReviewStep";
|
|
@@ -2366,7 +2378,7 @@ function DepositAddressSkeleton({
|
|
|
2366
2378
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
2367
2379
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown-trigger", children: [
|
|
2368
2380
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2369
|
-
|
|
2381
|
+
_chunk4O2UGFFTcjs.CdnIcon,
|
|
2370
2382
|
{
|
|
2371
2383
|
src: chainIcon,
|
|
2372
2384
|
className: "rs-deposit-address-dropdown-icon"
|
|
@@ -2382,7 +2394,7 @@ function DepositAddressSkeleton({
|
|
|
2382
2394
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
2383
2395
|
"Min.$",
|
|
2384
2396
|
(_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _86 => _86.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
2385
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2397
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2386
2398
|
_chunkG264OM23cjs.InfoIcon,
|
|
2387
2399
|
{
|
|
2388
2400
|
className: "rs-deposit-address-min-icon",
|
|
@@ -2432,7 +2444,7 @@ function DepositAddressSkeleton({
|
|
|
2432
2444
|
}
|
|
2433
2445
|
)
|
|
2434
2446
|
] }),
|
|
2435
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2447
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.PoweredBy, {})
|
|
2436
2448
|
] });
|
|
2437
2449
|
}
|
|
2438
2450
|
DepositAddressSkeleton.displayName = "DepositAddressSkeleton";
|
|
@@ -2444,9 +2456,9 @@ var INITIAL_POLL_INTERVAL = 3e3;
|
|
|
2444
2456
|
var MAX_POLL_INTERVAL = 3e4;
|
|
2445
2457
|
var BACKOFF_MULTIPLIER = 1.5;
|
|
2446
2458
|
function isEventForTx(event, txHash) {
|
|
2447
|
-
const eventTxHash =
|
|
2459
|
+
const eventTxHash = _chunk4O2UGFFTcjs.getEventTxHash.call(void 0, event);
|
|
2448
2460
|
if (!eventTxHash) return false;
|
|
2449
|
-
return
|
|
2461
|
+
return _chunk4O2UGFFTcjs.txRefsMatch.call(void 0, eventTxHash, txHash);
|
|
2450
2462
|
}
|
|
2451
2463
|
function truncateHash(hash) {
|
|
2452
2464
|
return `${hash.slice(0, 4)}\u2026${hash.slice(-4)}`;
|
|
@@ -2634,7 +2646,7 @@ function DepositNotification({
|
|
|
2634
2646
|
status,
|
|
2635
2647
|
txHash
|
|
2636
2648
|
]);
|
|
2637
|
-
const explorerTxUrl =
|
|
2649
|
+
const explorerTxUrl = _chunk4O2UGFFTcjs.useExplorerTxUrl.call(void 0, );
|
|
2638
2650
|
const sourceExplorerUrl = sourceChain === "unknown" ? void 0 : explorerTxUrl(sourceChain, txHash);
|
|
2639
2651
|
const destExplorerUrl = destinationTxHash ? explorerTxUrl(_chunkFKJ6EJHHcjs.targetChainToChainId.call(void 0, targetChain), destinationTxHash) : null;
|
|
2640
2652
|
const title = status === "complete" ? "Deposit completed" : status === "failed" ? "Deposit failed" : "Deposit received and processing\u2026";
|
|
@@ -2828,7 +2840,7 @@ function asString(value) {
|
|
|
2828
2840
|
return typeof value === "string" ? value : void 0;
|
|
2829
2841
|
}
|
|
2830
2842
|
function resolveSolanaTokenMeta(token) {
|
|
2831
|
-
const matched = token ?
|
|
2843
|
+
const matched = token ? _chunk4O2UGFFTcjs.resolveSolanaToken.call(void 0, token) : void 0;
|
|
2832
2844
|
return matched ? { sourceSymbol: matched.symbol, sourceDecimals: matched.decimals } : {};
|
|
2833
2845
|
}
|
|
2834
2846
|
function getDepositEventDetails(event) {
|
|
@@ -2889,7 +2901,7 @@ function selectionAsAsset(chainId, symbol, offer, catalogChain) {
|
|
|
2889
2901
|
}
|
|
2890
2902
|
function TokenGlyph({ symbol, token }) {
|
|
2891
2903
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2892
|
-
|
|
2904
|
+
_chunk4O2UGFFTcjs.TokenIcon,
|
|
2893
2905
|
{
|
|
2894
2906
|
token,
|
|
2895
2907
|
symbol,
|
|
@@ -2921,14 +2933,14 @@ function DepositAddressStep({
|
|
|
2921
2933
|
onError
|
|
2922
2934
|
}) {
|
|
2923
2935
|
const hasSolana = Boolean(solanaDepositAddress);
|
|
2924
|
-
const offer =
|
|
2936
|
+
const offer = _chunk4O2UGFFTcjs.useDepositOffer.call(void 0, );
|
|
2925
2937
|
const BASE_CHAIN_ID2 = 8453;
|
|
2926
|
-
const evmChainIds =
|
|
2927
|
-
const { catalog, isLoading: catalogLoading, shortlist } =
|
|
2938
|
+
const evmChainIds = _chunk4O2UGFFTcjs.useDepositChainIds.call(void 0, );
|
|
2939
|
+
const { catalog, isLoading: catalogLoading, shortlist } = _chunk4O2UGFFTcjs.useChainCatalog.call(void 0, );
|
|
2928
2940
|
const catalogFor = _react.useCallback.call(void 0,
|
|
2929
2941
|
(chain) => {
|
|
2930
2942
|
if (!catalog) return void 0;
|
|
2931
|
-
const key =
|
|
2943
|
+
const key = _chunk4O2UGFFTcjs.catalogKeyForChain.call(void 0, chain);
|
|
2932
2944
|
return typeof key === "number" ? catalog.byChainId.get(key) : catalog.byCaip2.get(key);
|
|
2933
2945
|
},
|
|
2934
2946
|
[catalog]
|
|
@@ -3047,10 +3059,10 @@ function DepositAddressStep({
|
|
|
3047
3059
|
});
|
|
3048
3060
|
return address ? { chain: sourceChainId, address } : void 0;
|
|
3049
3061
|
};
|
|
3050
|
-
const assetStore =
|
|
3062
|
+
const assetStore = _chunk4O2UGFFTcjs.useAssetStore.call(void 0, );
|
|
3051
3063
|
const assetStoreRef = _react.useRef.call(void 0, assetStore);
|
|
3052
3064
|
assetStoreRef.current = assetStore;
|
|
3053
|
-
const paymentDecimals =
|
|
3065
|
+
const paymentDecimals = _chunk4O2UGFFTcjs.useTokenDisplay.call(void 0,
|
|
3054
3066
|
typeof sourceChainId === "number" ? sourceChainId : void 0,
|
|
3055
3067
|
sourceTokenIdentity
|
|
3056
3068
|
).decimals;
|
|
@@ -3187,10 +3199,10 @@ function DepositAddressStep({
|
|
|
3187
3199
|
return;
|
|
3188
3200
|
}
|
|
3189
3201
|
const event = status.lastEvent;
|
|
3190
|
-
const eventTxHash =
|
|
3202
|
+
const eventTxHash = _chunk4O2UGFFTcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunk4O2UGFFTcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
3191
3203
|
if (baselineTxHashRef.current === void 0) {
|
|
3192
3204
|
baselineTxHashRef.current = eventTxHash;
|
|
3193
|
-
} else if (eventTxHash && (!baselineTxHashRef.current || !
|
|
3205
|
+
} else if (eventTxHash && (!baselineTxHashRef.current || !_chunk4O2UGFFTcjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
|
|
3194
3206
|
const details = getDepositEventDetails(event);
|
|
3195
3207
|
const chainId = _nullishCoalesce(details.chainId, () => ( "unknown"));
|
|
3196
3208
|
const amount = _nullishCoalesce(details.amount, () => ( "0"));
|
|
@@ -3200,8 +3212,8 @@ function DepositAddressStep({
|
|
|
3200
3212
|
isTrackingRef.current = true;
|
|
3201
3213
|
const isEvmToken = token ? /^0x[a-fA-F0-9]{40}$/.test(token) : false;
|
|
3202
3214
|
const knownChain = chainId === "unknown" ? void 0 : chainId;
|
|
3203
|
-
const sourceDecimals = _nullishCoalesce(details.sourceDecimals, () => ( (token && knownChain !== void 0 ? _nullishCoalesce(_optionalChain([
|
|
3204
|
-
_nullishCoalesce(
|
|
3215
|
+
const sourceDecimals = _nullishCoalesce(details.sourceDecimals, () => ( (token && knownChain !== void 0 ? _nullishCoalesce(_optionalChain([_chunk4O2UGFFTcjs.resolveCuratedToken.call(void 0, token, knownChain), 'optionalAccess', _149 => _149.decimals]), () => ( (knownChain === "hypercore" ? void 0 : _optionalChain([assetStoreRef, 'access', _150 => _150.current, 'optionalAccess', _151 => _151.peekMeta, 'call', _152 => _152(
|
|
3216
|
+
_nullishCoalesce(_chunk4O2UGFFTcjs.assetIdFor.call(void 0, knownChain, token), () => ( ""))
|
|
3205
3217
|
), 'optionalAccess', _153 => _153.decimals])))) : void 0)));
|
|
3206
3218
|
const directTransfer = typeof chainId === "number" && isEvmToken && isSameRoute(
|
|
3207
3219
|
chainId,
|
|
@@ -3274,8 +3286,8 @@ function DepositAddressStep({
|
|
|
3274
3286
|
if (offer.status === "error") {
|
|
3275
3287
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-screen", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
3276
3288
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkG264OM23cjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkG264OM23cjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
3277
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3278
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3289
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.Callout, { variant: "error", children: "The tokens this app accepts could not be loaded, so there is no deposit address to show." }),
|
|
3290
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.Button, { onClick: offer.retry, fullWidth: true, children: "Try again" })
|
|
3279
3291
|
] }) });
|
|
3280
3292
|
}
|
|
3281
3293
|
if (chainOptions.length === 0) {
|
|
@@ -3284,7 +3296,7 @@ function DepositAddressStep({
|
|
|
3284
3296
|
}
|
|
3285
3297
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-screen", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
3286
3298
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkG264OM23cjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkG264OM23cjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
3287
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3299
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.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." })
|
|
3288
3300
|
] }) });
|
|
3289
3301
|
}
|
|
3290
3302
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-step--with-notifications", children: [
|
|
@@ -3305,7 +3317,7 @@ function DepositAddressStep({
|
|
|
3305
3317
|
},
|
|
3306
3318
|
children: [
|
|
3307
3319
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3308
|
-
|
|
3320
|
+
_chunk4O2UGFFTcjs.CdnIcon,
|
|
3309
3321
|
{
|
|
3310
3322
|
src: _nullishCoalesce(_optionalChain([catalogFor, 'call', _164 => _164(sourceChainId), 'optionalAccess', _165 => _165.iconUrl]), () => ( _chunkFKJ6EJHHcjs.getChainIcon.call(void 0, sourceChainId))),
|
|
3311
3323
|
className: "rs-deposit-address-dropdown-icon"
|
|
@@ -3324,7 +3336,7 @@ function DepositAddressStep({
|
|
|
3324
3336
|
onClick: () => handleSelectChain(chainId),
|
|
3325
3337
|
children: [
|
|
3326
3338
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3327
|
-
|
|
3339
|
+
_chunk4O2UGFFTcjs.CdnIcon,
|
|
3328
3340
|
{
|
|
3329
3341
|
src: _nullishCoalesce(_optionalChain([catalogFor, 'call', _166 => _166(chainId), 'optionalAccess', _167 => _167.iconUrl]), () => ( _chunkFKJ6EJHHcjs.getChainIcon.call(void 0, chainId))),
|
|
3330
3342
|
className: "rs-deposit-address-dropdown-icon"
|
|
@@ -3342,7 +3354,7 @@ function DepositAddressStep({
|
|
|
3342
3354
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
3343
3355
|
"Min.$",
|
|
3344
3356
|
(_chunkFKJ6EJHHcjs.isHyperCoreDestination.call(void 0, targetChain) || isHyperCore ? Math.max(_chunkFKJ6EJHHcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _168 => _168.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _169 => _169.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
3345
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3357
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3346
3358
|
_chunkG264OM23cjs.InfoIcon,
|
|
3347
3359
|
{
|
|
3348
3360
|
className: "rs-deposit-address-min-icon",
|
|
@@ -3419,7 +3431,7 @@ function DepositAddressStep({
|
|
|
3419
3431
|
] }),
|
|
3420
3432
|
!withholdPaymentQr && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-value", children: displayAddress })
|
|
3421
3433
|
] }),
|
|
3422
|
-
paymentUnquotable && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3434
|
+
paymentUnquotable && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk4O2UGFFTcjs.Callout, { variant: "error", children: [
|
|
3423
3435
|
"This payment can't be priced from ",
|
|
3424
3436
|
sourceTokenSymbol,
|
|
3425
3437
|
" on",
|
|
@@ -3471,12 +3483,12 @@ function DepositAddressStep({
|
|
|
3471
3483
|
},
|
|
3472
3484
|
deposit.id
|
|
3473
3485
|
)) }),
|
|
3474
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3486
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.PoweredBy, {})
|
|
3475
3487
|
] });
|
|
3476
3488
|
}
|
|
3477
3489
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
3478
3490
|
|
|
3479
|
-
// src/components/steps/
|
|
3491
|
+
// src/components/steps/RampOrderStep.tsx
|
|
3480
3492
|
|
|
3481
3493
|
|
|
3482
3494
|
// src/core/swapped.ts
|
|
@@ -3528,7 +3540,7 @@ function FinalisingDepositStep() {
|
|
|
3528
3540
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "rs-finalising-subtitle", children: "We are depositing your funds to the application." })
|
|
3529
3541
|
] })
|
|
3530
3542
|
] }),
|
|
3531
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3543
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.PoweredBy, {})
|
|
3532
3544
|
] });
|
|
3533
3545
|
}
|
|
3534
3546
|
FinalisingDepositStep.displayName = "FinalisingDepositStep";
|
|
@@ -3549,7 +3561,7 @@ function SwappedOrderTracker({
|
|
|
3549
3561
|
onRetry
|
|
3550
3562
|
}) {
|
|
3551
3563
|
const formattedAmount = formatTrackerAmount(amount);
|
|
3552
|
-
const title = terminal ? terminal.kind === "cancelled" ? "Order cancelled" : "Deposit failed" : formattedAmount ? `Depositing ${formattedAmount} ${currency}` : `Depositing ${currency}`;
|
|
3564
|
+
const title = terminal ? _nullishCoalesce(terminal.title, () => ( (terminal.kind === "cancelled" ? "Order cancelled" : "Deposit failed"))) : formattedAmount ? `Depositing ${formattedAmount} ${currency}` : `Depositing ${currency}`;
|
|
3553
3565
|
const labels = [
|
|
3554
3566
|
STEP_LABELS[0],
|
|
3555
3567
|
`${currency} received`,
|
|
@@ -3607,7 +3619,7 @@ function SwappedOrderTracker({
|
|
|
3607
3619
|
}
|
|
3608
3620
|
)
|
|
3609
3621
|
] }),
|
|
3610
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3622
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.PoweredBy, {})
|
|
3611
3623
|
] });
|
|
3612
3624
|
}
|
|
3613
3625
|
function formatTrackerAmount(amount) {
|
|
@@ -3627,16 +3639,10 @@ var DEPOSIT_POLL_FAST_INTERVAL_MS = 500;
|
|
|
3627
3639
|
var IFRAME_LOAD_TIMEOUT_MS = 15e3;
|
|
3628
3640
|
var SWAPPED_SUCCESS_HANDOFF_DELAY_MS = 1400;
|
|
3629
3641
|
var SWAPPED_IFRAME_ORIGINS = new Set(SWAPPED_ORIGINS);
|
|
3630
|
-
var
|
|
3631
|
-
"
|
|
3632
|
-
"
|
|
3633
|
-
|
|
3634
|
-
var SWAPPED_STATUS_VALUES = /* @__PURE__ */ new Set([
|
|
3635
|
-
"payment_pending",
|
|
3636
|
-
"order_completed",
|
|
3637
|
-
"order_broadcasted",
|
|
3638
|
-
"order_cancelled"
|
|
3639
|
-
]);
|
|
3642
|
+
var OUTCOMES = {
|
|
3643
|
+
failed: { title: "Order failed", message: "Any charge will be refunded." },
|
|
3644
|
+
refunded: { title: "Order refunded", message: "Your payment was returned." }
|
|
3645
|
+
};
|
|
3640
3646
|
var SWAPPED_GO_BACK_KEY = "SWAPPED_GO_BACK";
|
|
3641
3647
|
var OPEN_FAILED_MESSAGE = "We could not open your browser.";
|
|
3642
3648
|
var OPEN_FAILED_CODE = "SWAPPED_BROWSER_UNAVAILABLE";
|
|
@@ -3682,19 +3688,20 @@ function parseSwappedIframeMessage(raw) {
|
|
|
3682
3688
|
const obj = data;
|
|
3683
3689
|
const inner = obj.data && typeof obj.data === "object" ? obj.data : obj;
|
|
3684
3690
|
const rawStatus = _nullishCoalesce(_nullishCoalesce(inner.order_status, () => ( inner.status)), () => ( obj.status));
|
|
3685
|
-
if (typeof rawStatus !== "string" || !SWAPPED_STATUS_VALUES.has(rawStatus)) {
|
|
3686
|
-
return null;
|
|
3687
|
-
}
|
|
3688
3691
|
const asString2 = (v) => typeof v === "string" && v.length > 0 ? v : void 0;
|
|
3692
|
+
const state = typeof rawStatus === "string" ? _chunk4O2UGFFTcjs.hostedOrderStateFromSwapped.call(void 0,
|
|
3693
|
+
rawStatus,
|
|
3694
|
+
_nullishCoalesce(asString2(inner.transaction_id), () => ( asString2(obj.transactionId)))
|
|
3695
|
+
) : null;
|
|
3696
|
+
if (!state) return null;
|
|
3689
3697
|
return {
|
|
3690
|
-
|
|
3698
|
+
state,
|
|
3691
3699
|
orderId: _nullishCoalesce(asString2(inner.order_id), () => ( asString2(obj.orderId))),
|
|
3692
3700
|
externalCustomerId: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(asString2(inner.external_customer_id), () => ( asString2(obj.external_customer_id))), () => ( asString2(inner.externalCustomerId))), () => ( asString2(obj.externalCustomerId))),
|
|
3693
3701
|
orderCrypto: assetSymbol(
|
|
3694
3702
|
_nullishCoalesce(asString2(inner.order_crypto), () => ( asString2(obj.orderCrypto)))
|
|
3695
3703
|
),
|
|
3696
|
-
orderCryptoAmount: _nullishCoalesce(asString2(inner.order_crypto_amount), () => ( asString2(obj.orderCryptoAmount)))
|
|
3697
|
-
transactionId: _nullishCoalesce(asString2(inner.transaction_id), () => ( asString2(obj.transactionId)))
|
|
3704
|
+
orderCryptoAmount: _nullishCoalesce(asString2(inner.order_crypto_amount), () => ( asString2(obj.orderCryptoAmount)))
|
|
3698
3705
|
};
|
|
3699
3706
|
}
|
|
3700
3707
|
function SwappedProviderStep({
|
|
@@ -3705,7 +3712,7 @@ function SwappedProviderStep({
|
|
|
3705
3712
|
iframeTitle,
|
|
3706
3713
|
loadErrorCode,
|
|
3707
3714
|
loadErrorFallback,
|
|
3708
|
-
|
|
3715
|
+
cancelledMessage,
|
|
3709
3716
|
onSwappedComplete,
|
|
3710
3717
|
onSwappedFailed,
|
|
3711
3718
|
onClose,
|
|
@@ -3738,6 +3745,8 @@ function SwappedProviderStep({
|
|
|
3738
3745
|
const expectedExternalCustomerIdRef = _react.useRef.call(void 0, null);
|
|
3739
3746
|
const baselineDepositTxHashRef = _react.useRef.call(void 0, void 0);
|
|
3740
3747
|
const currentDepositTxHashRef = _react.useRef.call(void 0, null);
|
|
3748
|
+
const deliveryTxHashRef = _react.useRef.call(void 0, null);
|
|
3749
|
+
deliveryTxHashRef.current = _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _172 => _172.deliveryTxHash]), () => ( null));
|
|
3741
3750
|
const fastDepositPollEnabledRef = _react.useRef.call(void 0, false);
|
|
3742
3751
|
const rescheduleDepositPollRef = _react.useRef.call(void 0,
|
|
3743
3752
|
null
|
|
@@ -3787,18 +3796,18 @@ function SwappedProviderStep({
|
|
|
3787
3796
|
if (cancelled) return;
|
|
3788
3797
|
if (!isTrustedSwappedWidgetUrl(res.url)) {
|
|
3789
3798
|
setLoadError(loadErrorFallback);
|
|
3790
|
-
_optionalChain([onErrorRef, 'access',
|
|
3799
|
+
_optionalChain([onErrorRef, 'access', _173 => _173.current, 'optionalCall', _174 => _174(loadErrorFallback, loadErrorCode)]);
|
|
3791
3800
|
return;
|
|
3792
3801
|
}
|
|
3793
3802
|
setWidgetUrl(res.url);
|
|
3794
3803
|
expectedExternalCustomerIdRef.current = res.externalCustomerId;
|
|
3795
|
-
_optionalChain([onAttemptConsumed, 'optionalCall',
|
|
3804
|
+
_optionalChain([onAttemptConsumed, 'optionalCall', _175 => _175(res.externalCustomerId)]);
|
|
3796
3805
|
expectedOrderUuidRef.current = res.orderId;
|
|
3797
3806
|
}).catch((err) => {
|
|
3798
3807
|
if (cancelled) return;
|
|
3799
3808
|
const message = err instanceof Error ? err.message : loadErrorFallback;
|
|
3800
3809
|
setLoadError(message);
|
|
3801
|
-
_optionalChain([onErrorRef, 'access',
|
|
3810
|
+
_optionalChain([onErrorRef, 'access', _176 => _176.current, 'optionalCall', _177 => _177(message, loadErrorCode)]);
|
|
3802
3811
|
});
|
|
3803
3812
|
return () => {
|
|
3804
3813
|
cancelled = true;
|
|
@@ -3813,7 +3822,7 @@ function SwappedProviderStep({
|
|
|
3813
3822
|
const timer = setTimeout(() => {
|
|
3814
3823
|
const message = "Iframe took too long to load.";
|
|
3815
3824
|
setLoadError(message);
|
|
3816
|
-
_optionalChain([onErrorRef, 'access',
|
|
3825
|
+
_optionalChain([onErrorRef, 'access', _178 => _178.current, 'optionalCall', _179 => _179(message, "SWAPPED_IFRAME_TIMEOUT")]);
|
|
3817
3826
|
}, IFRAME_LOAD_TIMEOUT_MS);
|
|
3818
3827
|
return () => clearTimeout(timer);
|
|
3819
3828
|
}, [openExternally, widgetUrl, iframeLoaded, loadError]);
|
|
@@ -3823,7 +3832,7 @@ function SwappedProviderStep({
|
|
|
3823
3832
|
setIframeSrc(nextSrc);
|
|
3824
3833
|
if (nextSrc && assignedIframeUrlRef.current !== nextSrc) {
|
|
3825
3834
|
assignedIframeUrlRef.current = nextSrc;
|
|
3826
|
-
_optionalChain([onProviderHandoffRef, 'access',
|
|
3835
|
+
_optionalChain([onProviderHandoffRef, 'access', _180 => _180.current, 'optionalCall', _181 => _181()]);
|
|
3827
3836
|
}
|
|
3828
3837
|
}, [openExternally, widgetUrl, loadError, retryToken]);
|
|
3829
3838
|
const openPaymentPage = async (url) => {
|
|
@@ -3833,11 +3842,11 @@ function SwappedProviderStep({
|
|
|
3833
3842
|
try {
|
|
3834
3843
|
await openExternally(url);
|
|
3835
3844
|
setHandoffOpened(true);
|
|
3836
|
-
_optionalChain([onProviderHandoff, 'optionalCall',
|
|
3845
|
+
_optionalChain([onProviderHandoff, 'optionalCall', _182 => _182()]);
|
|
3837
3846
|
} catch (error) {
|
|
3838
3847
|
openedUrlRef.current = null;
|
|
3839
3848
|
setLoadError(OPEN_FAILED_MESSAGE);
|
|
3840
|
-
_optionalChain([onErrorRef, 'access',
|
|
3849
|
+
_optionalChain([onErrorRef, 'access', _183 => _183.current, 'optionalCall', _184 => _184(
|
|
3841
3850
|
error instanceof Error && error.message ? error.message : OPEN_FAILED_MESSAGE,
|
|
3842
3851
|
OPEN_FAILED_CODE
|
|
3843
3852
|
)]);
|
|
@@ -3861,7 +3870,10 @@ function SwappedProviderStep({
|
|
|
3861
3870
|
if (cancelled) return;
|
|
3862
3871
|
const isCurrentOrder = res !== null && res.orderId === expectedOrderUuidRef.current;
|
|
3863
3872
|
if (isCurrentOrder) {
|
|
3864
|
-
setOrderState(
|
|
3873
|
+
setOrderState((prev) => ({
|
|
3874
|
+
...res,
|
|
3875
|
+
..._chunk4O2UGFFTcjs.mergeHostedOrderState.call(void 0, prev, res)
|
|
3876
|
+
}));
|
|
3865
3877
|
}
|
|
3866
3878
|
} catch (e25) {
|
|
3867
3879
|
}
|
|
@@ -3886,8 +3898,8 @@ function SwappedProviderStep({
|
|
|
3886
3898
|
const doc = globalThis.document;
|
|
3887
3899
|
const onVisible = () => {
|
|
3888
3900
|
if (doc.visibilityState !== "visible") return;
|
|
3889
|
-
_optionalChain([rescheduleStatusPollRef, 'access',
|
|
3890
|
-
_optionalChain([rescheduleDepositPollRef, 'access',
|
|
3901
|
+
_optionalChain([rescheduleStatusPollRef, 'access', _185 => _185.current, 'optionalCall', _186 => _186(0)]);
|
|
3902
|
+
_optionalChain([rescheduleDepositPollRef, 'access', _187 => _187.current, 'optionalCall', _188 => _188(0)]);
|
|
3891
3903
|
};
|
|
3892
3904
|
doc.addEventListener("visibilitychange", onVisible);
|
|
3893
3905
|
return () => doc.removeEventListener("visibilitychange", onVisible);
|
|
@@ -3898,15 +3910,29 @@ function SwappedProviderStep({
|
|
|
3898
3910
|
async function pollDeposit() {
|
|
3899
3911
|
if (cancelled) return;
|
|
3900
3912
|
try {
|
|
3901
|
-
const
|
|
3902
|
-
if (
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3913
|
+
const deliveryTxHash = deliveryTxHashRef.current;
|
|
3914
|
+
if (deliveryTxHash) {
|
|
3915
|
+
const { lastEvent } = await service.fetchStatus(
|
|
3916
|
+
smartAccount,
|
|
3917
|
+
deliveryTxHash
|
|
3918
|
+
);
|
|
3919
|
+
if (cancelled) return;
|
|
3920
|
+
const txHash = _chunk4O2UGFFTcjs.isDepositEvent.call(void 0, lastEvent) ? _chunk4O2UGFFTcjs.getEventTxHash.call(void 0, lastEvent) : void 0;
|
|
3921
|
+
if (lastEvent && txHash && _chunk4O2UGFFTcjs.txRefsMatch.call(void 0, txHash, deliveryTxHash)) {
|
|
3922
|
+
currentDepositTxHashRef.current = txHash;
|
|
3923
|
+
setLatestEvent(lastEvent);
|
|
3924
|
+
}
|
|
3925
|
+
} else {
|
|
3926
|
+
const status = await service.fetchLatestStatus(smartAccount);
|
|
3927
|
+
if (cancelled) return;
|
|
3928
|
+
const event = status.lastEvent;
|
|
3929
|
+
const eventTxHash = _chunk4O2UGFFTcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunk4O2UGFFTcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
3930
|
+
if (baselineDepositTxHashRef.current === void 0) {
|
|
3931
|
+
baselineDepositTxHashRef.current = eventTxHash;
|
|
3932
|
+
} else if (eventTxHash && (!baselineDepositTxHashRef.current || !_chunk4O2UGFFTcjs.txRefsMatch.call(void 0, eventTxHash, baselineDepositTxHashRef.current))) {
|
|
3933
|
+
currentDepositTxHashRef.current = eventTxHash;
|
|
3934
|
+
setLatestEvent(_nullishCoalesce(event, () => ( null)));
|
|
3935
|
+
}
|
|
3910
3936
|
}
|
|
3911
3937
|
} catch (e26) {
|
|
3912
3938
|
}
|
|
@@ -3929,8 +3955,7 @@ function SwappedProviderStep({
|
|
|
3929
3955
|
}, [service, smartAccount]);
|
|
3930
3956
|
_react.useEffect.call(void 0, () => {
|
|
3931
3957
|
if (fastDepositPollEnabledRef.current) return;
|
|
3932
|
-
|
|
3933
|
-
if (!status || !SWAPPED_TERMINAL_STATUSES.has(status)) return;
|
|
3958
|
+
if (!_chunk4O2UGFFTcjs.hasReached.call(void 0, orderState, "paid")) return;
|
|
3934
3959
|
fastDepositPollEnabledRef.current = true;
|
|
3935
3960
|
_optionalChain([rescheduleDepositPollRef, 'access', _189 => _189.current, 'optionalCall', _190 => _190(DEPOSIT_POLL_FAST_INITIAL_DELAY_MS)]);
|
|
3936
3961
|
}, [orderState]);
|
|
@@ -3954,49 +3979,48 @@ function SwappedProviderStep({
|
|
|
3954
3979
|
// Normalise to the uuid the backend poll also keys on, so orderState
|
|
3955
3980
|
// is consistent regardless of which path set it.
|
|
3956
3981
|
orderId: _nullishCoalesce(_nullishCoalesce(expectedOrderUuidRef.current, () => ( _optionalChain([prev, 'optionalAccess', _193 => _193.orderId]))), () => ( ext)),
|
|
3957
|
-
|
|
3982
|
+
..._chunk4O2UGFFTcjs.mergeHostedOrderState.call(void 0, prev, parsed.state),
|
|
3958
3983
|
orderCrypto: _nullishCoalesce(_nullishCoalesce(parsed.orderCrypto, () => ( _optionalChain([prev, 'optionalAccess', _194 => _194.orderCrypto]))), () => ( null)),
|
|
3959
3984
|
orderCryptoAmount: _nullishCoalesce(_nullishCoalesce(parsed.orderCryptoAmount, () => ( _optionalChain([prev, 'optionalAccess', _195 => _195.orderCryptoAmount]))), () => ( null)),
|
|
3960
|
-
transactionId: _nullishCoalesce(_nullishCoalesce(parsed.transactionId, () => ( _optionalChain([prev, 'optionalAccess', _196 => _196.transactionId]))), () => ( null)),
|
|
3961
3985
|
receivedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3962
|
-
paidAmountUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
3963
|
-
paidAmountEur: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
3964
|
-
onrampFeeUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
3965
|
-
paymentMethod: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
3986
|
+
paidAmountUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _196 => _196.paidAmountUsd]), () => ( null)),
|
|
3987
|
+
paidAmountEur: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _197 => _197.paidAmountEur]), () => ( null)),
|
|
3988
|
+
onrampFeeUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _198 => _198.onrampFeeUsd]), () => ( null)),
|
|
3989
|
+
paymentMethod: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _199 => _199.paymentMethod]), () => ( null))
|
|
3966
3990
|
}));
|
|
3967
3991
|
}
|
|
3968
3992
|
window.addEventListener("message", onMessage);
|
|
3969
3993
|
return () => window.removeEventListener("message", onMessage);
|
|
3970
3994
|
}, [openExternally]);
|
|
3971
3995
|
_react.useEffect.call(void 0, () => {
|
|
3972
|
-
const swappedProvesLive = orderState !== null &&
|
|
3996
|
+
const swappedProvesLive = orderState !== null && (variant !== "fiat" || _chunk4O2UGFFTcjs.hasReached.call(void 0, orderState, "paying") || orderState.outcome !== null);
|
|
3973
3997
|
if (phase === "provider" && (swappedProvesLive || latestEvent !== null)) {
|
|
3974
3998
|
setPhase("tracker");
|
|
3975
3999
|
}
|
|
3976
4000
|
}, [phase, orderState, latestEvent, variant]);
|
|
3977
4001
|
const stepStates = _react.useMemo.call(void 0,
|
|
3978
|
-
() => deriveStepStates(
|
|
4002
|
+
() => deriveStepStates(orderState, latestEvent),
|
|
3979
4003
|
[orderState, latestEvent]
|
|
3980
4004
|
);
|
|
3981
4005
|
const terminalState = _react.useMemo.call(void 0, () => {
|
|
3982
|
-
if (
|
|
4006
|
+
if (_chunk4O2UGFFTcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
|
|
3983
4007
|
return {
|
|
3984
4008
|
kind: "failed",
|
|
3985
|
-
message:
|
|
4009
|
+
message: _chunk4O2UGFFTcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
|
|
3986
4010
|
};
|
|
3987
4011
|
}
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
return { kind: "cancelled", message:
|
|
4012
|
+
const outcome = _optionalChain([orderState, 'optionalAccess', _200 => _200.outcome]);
|
|
4013
|
+
if (outcome) {
|
|
4014
|
+
return outcome === "cancelled" ? { kind: "cancelled", message: cancelledMessage } : { kind: "cancelled", ...OUTCOMES[outcome] };
|
|
3991
4015
|
}
|
|
3992
4016
|
return null;
|
|
3993
|
-
}, [latestEvent, orderState,
|
|
4017
|
+
}, [latestEvent, orderState, cancelledMessage]);
|
|
3994
4018
|
_react.useEffect.call(void 0, () => {
|
|
3995
|
-
if (_optionalChain([orderState, 'optionalAccess',
|
|
3996
|
-
}, [onCancelled, _optionalChain([orderState, 'optionalAccess',
|
|
4019
|
+
if (_optionalChain([orderState, 'optionalAccess', _201 => _201.outcome]) === "cancelled") _optionalChain([onCancelled, 'optionalCall', _202 => _202()]);
|
|
4020
|
+
}, [onCancelled, _optionalChain([orderState, 'optionalAccess', _203 => _203.outcome])]);
|
|
3997
4021
|
_react.useEffect.call(void 0, () => {
|
|
3998
4022
|
if (completeFiredRef.current || failedFiredRef.current) return;
|
|
3999
|
-
const t = _optionalChain([latestEvent, 'optionalAccess',
|
|
4023
|
+
const t = _optionalChain([latestEvent, 'optionalAccess', _204 => _204.type]);
|
|
4000
4024
|
const isSuccess = t === "bridge-complete";
|
|
4001
4025
|
if (!isSuccess) return;
|
|
4002
4026
|
const txHash = currentDepositTxHashRef.current;
|
|
@@ -4005,10 +4029,10 @@ function SwappedProviderStep({
|
|
|
4005
4029
|
const info = {
|
|
4006
4030
|
smartAccount,
|
|
4007
4031
|
txHash,
|
|
4008
|
-
orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
4032
|
+
orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _205 => _205.orderCrypto]), () => ( null)),
|
|
4009
4033
|
// Base-unit source amount from the deposit row/event, consistent with the
|
|
4010
4034
|
// wallet/QR path. ProcessingStep + onLifecycle expect base units.
|
|
4011
|
-
amount: _nullishCoalesce(
|
|
4035
|
+
amount: _nullishCoalesce(_chunk4O2UGFFTcjs.getEventSourceDetails.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0))).amount, () => ( null)),
|
|
4012
4036
|
expectedOrderUuid: expectedOrderUuidRef.current,
|
|
4013
4037
|
initialEvent: _nullishCoalesce(latestEvent, () => ( void 0))
|
|
4014
4038
|
};
|
|
@@ -4019,23 +4043,23 @@ function SwappedProviderStep({
|
|
|
4019
4043
|
}, [latestEvent, orderState, smartAccount]);
|
|
4020
4044
|
_react.useEffect.call(void 0, () => {
|
|
4021
4045
|
if (failedFiredRef.current || completeFiredRef.current) return;
|
|
4022
|
-
if (!
|
|
4046
|
+
if (!_chunk4O2UGFFTcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) return;
|
|
4023
4047
|
const txHash = currentDepositTxHashRef.current;
|
|
4024
4048
|
if (!txHash) return;
|
|
4025
4049
|
failedFiredRef.current = true;
|
|
4026
4050
|
setPhase("tracker");
|
|
4027
|
-
_optionalChain([onSwappedFailedRef, 'access',
|
|
4051
|
+
_optionalChain([onSwappedFailedRef, 'access', _206 => _206.current, 'optionalCall', _207 => _207(
|
|
4028
4052
|
txHash,
|
|
4029
|
-
|
|
4053
|
+
_chunk4O2UGFFTcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
|
|
4030
4054
|
)]);
|
|
4031
4055
|
}, [latestEvent]);
|
|
4032
4056
|
const immersive = !openExternally && variant === "fiat" && phase === "provider" && !loadError;
|
|
4033
4057
|
_react.useEffect.call(void 0, () => {
|
|
4034
|
-
_optionalChain([onImmersiveChangeRef, 'access',
|
|
4058
|
+
_optionalChain([onImmersiveChangeRef, 'access', _208 => _208.current, 'optionalCall', _209 => _209(immersive)]);
|
|
4035
4059
|
}, [immersive]);
|
|
4036
|
-
_react.useEffect.call(void 0, () => () => _optionalChain([onImmersiveChangeRef, 'access',
|
|
4060
|
+
_react.useEffect.call(void 0, () => () => _optionalChain([onImmersiveChangeRef, 'access', _210 => _210.current, 'optionalCall', _211 => _211(false)]), []);
|
|
4037
4061
|
const handleRetry = () => {
|
|
4038
|
-
_optionalChain([onRetry, 'optionalCall',
|
|
4062
|
+
_optionalChain([onRetry, 'optionalCall', _212 => _212()]);
|
|
4039
4063
|
setIframeSrc(null);
|
|
4040
4064
|
setWidgetUrl(null);
|
|
4041
4065
|
setIframeLoaded(false);
|
|
@@ -4053,8 +4077,8 @@ function SwappedProviderStep({
|
|
|
4053
4077
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4054
4078
|
SwappedOrderTracker,
|
|
4055
4079
|
{
|
|
4056
|
-
amount: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
4057
|
-
currency: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
4080
|
+
amount: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _213 => _213.orderCryptoAmount]), () => ( null)),
|
|
4081
|
+
currency: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _214 => _214.orderCrypto]), () => ( "USDC")),
|
|
4058
4082
|
stepStates,
|
|
4059
4083
|
terminal: terminalState,
|
|
4060
4084
|
onRetry: handleRetry,
|
|
@@ -4100,7 +4124,7 @@ function SwappedProviderStep({
|
|
|
4100
4124
|
}
|
|
4101
4125
|
)
|
|
4102
4126
|
] }) }),
|
|
4103
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4127
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.PoweredBy, {})
|
|
4104
4128
|
] });
|
|
4105
4129
|
}
|
|
4106
4130
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-fiat-onramp", "data-variant": variant, children: [
|
|
@@ -4129,7 +4153,7 @@ function SwappedProviderStep({
|
|
|
4129
4153
|
allow: "payment; camera; microphone; clipboard-write; geolocation",
|
|
4130
4154
|
onLoad: () => {
|
|
4131
4155
|
try {
|
|
4132
|
-
if (_optionalChain([iframeRef, 'access',
|
|
4156
|
+
if (_optionalChain([iframeRef, 'access', _215 => _215.current, 'optionalAccess', _216 => _216.contentWindow, 'optionalAccess', _217 => _217.location, 'optionalAccess', _218 => _218.href]) === "about:blank") {
|
|
4133
4157
|
return;
|
|
4134
4158
|
}
|
|
4135
4159
|
} catch (e27) {
|
|
@@ -4140,84 +4164,88 @@ function SwappedProviderStep({
|
|
|
4140
4164
|
retryToken
|
|
4141
4165
|
)
|
|
4142
4166
|
] }) }),
|
|
4143
|
-
loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4167
|
+
loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.PoweredBy, {})
|
|
4144
4168
|
] });
|
|
4145
4169
|
}
|
|
4146
|
-
function deriveStepStates(
|
|
4147
|
-
if (
|
|
4170
|
+
function deriveStepStates(order, latestEvent) {
|
|
4171
|
+
if (_chunk4O2UGFFTcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
|
|
4148
4172
|
return ["complete", "complete", "failed", "pending"];
|
|
4149
4173
|
}
|
|
4150
|
-
if (
|
|
4174
|
+
if (_optionalChain([order, 'optionalAccess', _219 => _219.outcome])) {
|
|
4151
4175
|
return ["failed", "pending", "pending", "pending"];
|
|
4152
4176
|
}
|
|
4153
|
-
const
|
|
4154
|
-
const
|
|
4155
|
-
const step3Complete = _optionalChain([latestEvent, 'optionalAccess', _221 => _221.type]) === "bridge-complete";
|
|
4177
|
+
const step2Complete = latestEvent !== null || _chunk4O2UGFFTcjs.hasReached.call(void 0, order, "sent");
|
|
4178
|
+
const step3Complete = _optionalChain([latestEvent, 'optionalAccess', _220 => _220.type]) === "bridge-complete";
|
|
4156
4179
|
if (step3Complete) {
|
|
4157
4180
|
return ["complete", "complete", "complete", "complete"];
|
|
4158
4181
|
}
|
|
4159
4182
|
if (step2Complete) {
|
|
4160
4183
|
return ["complete", "complete", "active", "pending"];
|
|
4161
4184
|
}
|
|
4162
|
-
if (
|
|
4185
|
+
if (_chunk4O2UGFFTcjs.hasReached.call(void 0, order, "paid")) {
|
|
4163
4186
|
return ["complete", "active", "pending", "pending"];
|
|
4164
4187
|
}
|
|
4165
4188
|
return ["active", "pending", "pending", "pending"];
|
|
4166
4189
|
}
|
|
4167
4190
|
SwappedProviderStep.displayName = "SwappedProviderStep";
|
|
4168
4191
|
|
|
4169
|
-
// src/components/steps/
|
|
4192
|
+
// src/components/steps/RampOrderStep.tsx
|
|
4170
4193
|
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4194
|
+
var BankOnrampStep = _react.lazy.call(void 0, async () => {
|
|
4195
|
+
const module = await Promise.resolve().then(() => _interopRequireWildcard(require("./BankOnrampStep-QCPISCAQ.cjs")));
|
|
4196
|
+
return { default: module.BankOnrampStep };
|
|
4197
|
+
});
|
|
4198
|
+
var HOSTED = {
|
|
4199
|
+
fiat: {
|
|
4200
|
+
iframeTitle: "Buy crypto with Swapped",
|
|
4201
|
+
loadErrorCode: "SWAPPED_URL_FAILED",
|
|
4202
|
+
loadErrorFallback: "Failed to load on-ramp",
|
|
4203
|
+
cancelledMessage: "If you were charged, Swapped will refund within 5 business days."
|
|
4204
|
+
},
|
|
4205
|
+
exchange: {
|
|
4206
|
+
iframeTitle: "Fund from exchange via Swapped",
|
|
4207
|
+
loadErrorCode: "SWAPPED_CONNECT_URL_FAILED",
|
|
4208
|
+
loadErrorFallback: "Failed to load Connect",
|
|
4209
|
+
cancelledMessage: "If your exchange already debited the funds, Swapped will refund within 5 business days."
|
|
4178
4210
|
}
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
}
|
|
4211
|
+
};
|
|
4212
|
+
function RampOrderStep(props) {
|
|
4213
|
+
const { order, smartAccount } = props;
|
|
4214
|
+
if (order.flow === "funding_account") {
|
|
4215
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4216
|
+
BankOnrampStep,
|
|
4217
|
+
{
|
|
4218
|
+
backendUrl: order.backendUrl,
|
|
4219
|
+
smartAccount,
|
|
4220
|
+
getCustomerSession: order.getCustomerSession,
|
|
4221
|
+
onJourney: order.onJourney,
|
|
4222
|
+
onGoBack: props.onGoBack,
|
|
4223
|
+
onError: props.onError,
|
|
4224
|
+
openExternally: props.openExternally,
|
|
4225
|
+
onUnavailable: order.onUnavailable
|
|
4226
|
+
},
|
|
4227
|
+
`${order.backendUrl}:${smartAccount}`
|
|
4228
|
+
);
|
|
4195
4229
|
}
|
|
4230
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HostedOrder, { ...props, order });
|
|
4196
4231
|
}
|
|
4197
|
-
function
|
|
4232
|
+
function HostedOrder({
|
|
4233
|
+
order,
|
|
4198
4234
|
smartAccount,
|
|
4199
4235
|
service,
|
|
4200
|
-
|
|
4201
|
-
methodSelectionSource,
|
|
4202
|
-
consumePrefetchedUrl,
|
|
4203
|
-
onSwappedComplete,
|
|
4204
|
-
onSwappedFailed,
|
|
4205
|
-
onClose,
|
|
4206
|
-
onGoBack,
|
|
4207
|
-
onError,
|
|
4208
|
-
onAttemptConsumed,
|
|
4209
|
-
onProviderHandoff,
|
|
4210
|
-
onRetry,
|
|
4211
|
-
onCancelled,
|
|
4212
|
-
onImmersiveChange,
|
|
4213
|
-
openExternally
|
|
4236
|
+
...callbacks
|
|
4214
4237
|
}) {
|
|
4238
|
+
const method = order.kind === "fiat" ? order.method : void 0;
|
|
4239
|
+
const source = order.kind === "fiat" ? order.methodSelectionSource : void 0;
|
|
4240
|
+
const consumePrefetched = order.kind === "fiat" ? order.consumePrefetchedUrl : void 0;
|
|
4241
|
+
const connection = order.kind === "exchange" ? order.connection : void 0;
|
|
4242
|
+
const loadPrepared = order.kind === "exchange" ? order.loadPreparedUrl : void 0;
|
|
4215
4243
|
const loadUrl = _react.useCallback.call(void 0, async () => {
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
)]);
|
|
4244
|
+
if (connection !== void 0) {
|
|
4245
|
+
if (loadPrepared) return loadPrepared();
|
|
4246
|
+
return service.getSwappedConnectUrl({ smartAccount, connection });
|
|
4247
|
+
}
|
|
4248
|
+
const prefetched = _optionalChain([consumePrefetched, 'optionalCall', _221 => _221(smartAccount, method, source)]);
|
|
4221
4249
|
if (prefetched) {
|
|
4222
4250
|
try {
|
|
4223
4251
|
const cached = await prefetched;
|
|
@@ -4227,126 +4255,72 @@ function FiatOnrampStep({
|
|
|
4227
4255
|
}
|
|
4228
4256
|
return service.getSwappedWidgetUrl({
|
|
4229
4257
|
smartAccount,
|
|
4230
|
-
method
|
|
4231
|
-
methodSelectionSource
|
|
4258
|
+
method,
|
|
4259
|
+
methodSelectionSource: source
|
|
4232
4260
|
});
|
|
4233
4261
|
}, [
|
|
4234
4262
|
service,
|
|
4235
4263
|
smartAccount,
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4264
|
+
method,
|
|
4265
|
+
source,
|
|
4266
|
+
consumePrefetched,
|
|
4267
|
+
connection,
|
|
4268
|
+
loadPrepared
|
|
4239
4269
|
]);
|
|
4240
4270
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4241
4271
|
SwappedProviderStep,
|
|
4242
4272
|
{
|
|
4243
4273
|
smartAccount,
|
|
4244
4274
|
service,
|
|
4245
|
-
variant: "fiat",
|
|
4275
|
+
variant: order.kind === "fiat" ? "fiat" : "connect",
|
|
4246
4276
|
loadUrl,
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
loadErrorFallback: "Failed to load on-ramp",
|
|
4250
|
-
bannerForStatus: fiatBannerForStatus,
|
|
4251
|
-
onSwappedComplete,
|
|
4252
|
-
onSwappedFailed,
|
|
4253
|
-
onClose,
|
|
4254
|
-
onGoBack,
|
|
4255
|
-
onError,
|
|
4256
|
-
onAttemptConsumed,
|
|
4257
|
-
onProviderHandoff,
|
|
4258
|
-
onRetry,
|
|
4259
|
-
onCancelled,
|
|
4260
|
-
onImmersiveChange,
|
|
4261
|
-
openExternally
|
|
4277
|
+
...HOSTED[order.kind],
|
|
4278
|
+
...callbacks
|
|
4262
4279
|
}
|
|
4263
4280
|
);
|
|
4264
4281
|
}
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
// src/
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4282
|
+
RampOrderStep.displayName = "RampOrderStep";
|
|
4283
|
+
|
|
4284
|
+
// src/core/ramp-rows.ts
|
|
4285
|
+
var NOT_SERVED_NOTICE = "Bank transfer isn't available in your region.";
|
|
4286
|
+
function resolveRampRows(input) {
|
|
4287
|
+
const { providers } = input;
|
|
4288
|
+
const has = (provider, kind) => providers === null || providers !== "loading" && providers.some((p) => p.provider === provider && p.kinds.includes(kind));
|
|
4289
|
+
const loading = providers === "loading";
|
|
4290
|
+
const exchange = !input.enableExchangeConnect ? "hidden" : loading ? "loading" : has("swapped", "exchange") ? "offered" : "hidden";
|
|
4291
|
+
const bankRequested = input.virtualAccounts && input.customerSession && input.bankTransferAllowed;
|
|
4292
|
+
const swappedFiat = has("swapped", "fiat");
|
|
4293
|
+
const bankBy = !bankRequested ? null : has("noah", "fiat") && !input.noahNotServed ? "noah" : swappedFiat && !refusesBank(input.swappedMethods) ? "swapped" : null;
|
|
4294
|
+
const notice = bankRequested && input.noahNotServed && !bankBy ? NOT_SERVED_NOTICE : null;
|
|
4295
|
+
const offered = input.enableFiatOnramp && swappedFiat ? input.swappedMethods : { kind: "hidden" };
|
|
4296
|
+
const swapped = offered.kind === "hidden" && bankBy ? {
|
|
4297
|
+
kind: "list",
|
|
4298
|
+
methods: [],
|
|
4299
|
+
recommendedMethod: input.bankRow.method,
|
|
4300
|
+
country: null,
|
|
4301
|
+
source: "configured"
|
|
4302
|
+
} : offered;
|
|
4303
|
+
if (loading && (input.enableFiatOnramp || bankRequested)) {
|
|
4304
|
+
return { cash: { kind: "loading" }, exchange, notice: null };
|
|
4277
4305
|
}
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
};
|
|
4286
|
-
case "order_broadcasted":
|
|
4287
|
-
return {
|
|
4288
|
-
level: "success",
|
|
4289
|
-
title: "Crypto sent \u2014 confirming on-chain"
|
|
4290
|
-
};
|
|
4291
|
-
case "order_cancelled":
|
|
4292
|
-
return {
|
|
4293
|
-
level: "warning",
|
|
4294
|
-
title: "Order cancelled",
|
|
4295
|
-
detail: "If your exchange already debited the funds, Swapped will refund within 5 business days."
|
|
4296
|
-
};
|
|
4306
|
+
if (swapped.kind !== "list") return { cash: swapped, exchange, notice };
|
|
4307
|
+
const methods = swapped.methods.map((m) => ({
|
|
4308
|
+
...m,
|
|
4309
|
+
provider: isBankRow(m) && bankBy ? bankBy : "swapped"
|
|
4310
|
+
}));
|
|
4311
|
+
if (bankBy && !methods.some(isBankRow)) {
|
|
4312
|
+
methods.push({ ...input.bankRow, provider: bankBy });
|
|
4297
4313
|
}
|
|
4314
|
+
return { cash: { ...swapped, methods }, exchange, notice };
|
|
4298
4315
|
}
|
|
4299
|
-
function
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
onClose,
|
|
4307
|
-
onGoBack,
|
|
4308
|
-
onError,
|
|
4309
|
-
onAttemptConsumed,
|
|
4310
|
-
onProviderHandoff,
|
|
4311
|
-
onRetry,
|
|
4312
|
-
onCancelled,
|
|
4313
|
-
onImmersiveChange,
|
|
4314
|
-
openExternally
|
|
4315
|
-
}) {
|
|
4316
|
-
const loadUrl = _react.useCallback.call(void 0, async () => {
|
|
4317
|
-
if (loadPreparedUrl) return loadPreparedUrl();
|
|
4318
|
-
const res = await service.getSwappedConnectUrl({
|
|
4319
|
-
smartAccount,
|
|
4320
|
-
connection
|
|
4321
|
-
});
|
|
4322
|
-
return res;
|
|
4323
|
-
}, [loadPreparedUrl, service, smartAccount, connection]);
|
|
4324
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4325
|
-
SwappedProviderStep,
|
|
4326
|
-
{
|
|
4327
|
-
smartAccount,
|
|
4328
|
-
service,
|
|
4329
|
-
variant: "connect",
|
|
4330
|
-
loadUrl,
|
|
4331
|
-
iframeTitle: "Fund from exchange via Swapped",
|
|
4332
|
-
loadErrorCode: "SWAPPED_CONNECT_URL_FAILED",
|
|
4333
|
-
loadErrorFallback: "Failed to load Connect",
|
|
4334
|
-
bannerForStatus: connectBannerForStatus,
|
|
4335
|
-
onSwappedComplete,
|
|
4336
|
-
onSwappedFailed,
|
|
4337
|
-
onClose,
|
|
4338
|
-
onGoBack,
|
|
4339
|
-
onError,
|
|
4340
|
-
onAttemptConsumed,
|
|
4341
|
-
onProviderHandoff,
|
|
4342
|
-
onRetry,
|
|
4343
|
-
onCancelled,
|
|
4344
|
-
onImmersiveChange,
|
|
4345
|
-
openExternally
|
|
4346
|
-
}
|
|
4347
|
-
);
|
|
4316
|
+
function refusesBank(swapped) {
|
|
4317
|
+
if (swapped.kind === "hidden") return true;
|
|
4318
|
+
if (swapped.kind !== "list" || swapped.source === "fallback") return false;
|
|
4319
|
+
return !swapped.methods.some(isBankRow);
|
|
4320
|
+
}
|
|
4321
|
+
function isBankRow(m) {
|
|
4322
|
+
return m.method === "bank-transfer";
|
|
4348
4323
|
}
|
|
4349
|
-
ExchangeConnectStep.displayName = "ExchangeConnectStep";
|
|
4350
4324
|
|
|
4351
4325
|
// src/components/steps/ExchangeSelectStep.tsx
|
|
4352
4326
|
|
|
@@ -4393,7 +4367,7 @@ function ExchangeSelectStep({
|
|
|
4393
4367
|
const message = err instanceof Error ? err.message : "Failed to load exchanges";
|
|
4394
4368
|
setExchanges([]);
|
|
4395
4369
|
setError(message);
|
|
4396
|
-
_optionalChain([onError, 'optionalCall',
|
|
4370
|
+
_optionalChain([onError, 'optionalCall', _222 => _222(message, "SWAPPED_CONNECT_EXCHANGES_FAILED")]);
|
|
4397
4371
|
}).finally(() => {
|
|
4398
4372
|
if (!cancelled) setLoading(false);
|
|
4399
4373
|
});
|
|
@@ -4410,7 +4384,7 @@ function ExchangeSelectStep({
|
|
|
4410
4384
|
} catch (err) {
|
|
4411
4385
|
const message = err instanceof Error ? err.message : "Failed to prepare Connect";
|
|
4412
4386
|
setSelectionNotice(message);
|
|
4413
|
-
_optionalChain([onError, 'optionalCall',
|
|
4387
|
+
_optionalChain([onError, 'optionalCall', _223 => _223(message, "SWAPPED_CONNECT_URL_FAILED")]);
|
|
4414
4388
|
} finally {
|
|
4415
4389
|
setSelectingConnection(null);
|
|
4416
4390
|
}
|
|
@@ -4453,7 +4427,7 @@ function ExchangeSelectStep({
|
|
|
4453
4427
|
)
|
|
4454
4428
|
] }),
|
|
4455
4429
|
!loading && !error && exchanges.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-grid", children: exchanges.map((exchange) => {
|
|
4456
|
-
const brand =
|
|
4430
|
+
const brand = _chunk4O2UGFFTcjs.getExchangeLogo.call(void 0, exchange.name, exchange.connection);
|
|
4457
4431
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4458
4432
|
"button",
|
|
4459
4433
|
{
|
|
@@ -4478,7 +4452,7 @@ function ExchangeSelectStep({
|
|
|
4478
4452
|
);
|
|
4479
4453
|
}) })
|
|
4480
4454
|
] }),
|
|
4481
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4455
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.PoweredBy, {}),
|
|
4482
4456
|
selectionNotice && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "rs-exchange-select-fee-note", role: "status", children: selectionNotice })
|
|
4483
4457
|
] });
|
|
4484
4458
|
}
|
|
@@ -4511,14 +4485,14 @@ function SolanaTokenSelectStep({
|
|
|
4511
4485
|
setError(null);
|
|
4512
4486
|
const portfolioBySymbol = {};
|
|
4513
4487
|
try {
|
|
4514
|
-
|
|
4488
|
+
_chunk4O2UGFFTcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
|
|
4515
4489
|
solanaAddress
|
|
4516
4490
|
});
|
|
4517
4491
|
const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
|
|
4518
4492
|
if (!active) return;
|
|
4519
4493
|
for (const t of portfolio.tokens) {
|
|
4520
4494
|
const symbol = t.symbol.toUpperCase();
|
|
4521
|
-
if (!
|
|
4495
|
+
if (!_chunk4O2UGFFTcjs.SOLANA_TOKENS.some((st) => st.symbol === symbol)) continue;
|
|
4522
4496
|
let parsed = 0n;
|
|
4523
4497
|
try {
|
|
4524
4498
|
parsed = BigInt(t.balance || "0");
|
|
@@ -4534,12 +4508,12 @@ function SolanaTokenSelectStep({
|
|
|
4534
4508
|
};
|
|
4535
4509
|
}
|
|
4536
4510
|
}
|
|
4537
|
-
|
|
4511
|
+
_chunk4O2UGFFTcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
|
|
4538
4512
|
symbols: Object.keys(portfolioBySymbol)
|
|
4539
4513
|
});
|
|
4540
4514
|
} catch (err) {
|
|
4541
4515
|
if (!active) return;
|
|
4542
|
-
|
|
4516
|
+
_chunk4O2UGFFTcjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
|
|
4543
4517
|
solanaAddress
|
|
4544
4518
|
});
|
|
4545
4519
|
setError(
|
|
@@ -4550,7 +4524,7 @@ function SolanaTokenSelectStep({
|
|
|
4550
4524
|
return;
|
|
4551
4525
|
}
|
|
4552
4526
|
const results = [];
|
|
4553
|
-
for (const token of
|
|
4527
|
+
for (const token of _chunk4O2UGFFTcjs.SOLANA_TOKENS) {
|
|
4554
4528
|
const fromPortfolio = portfolioBySymbol[token.symbol];
|
|
4555
4529
|
if (fromPortfolio && fromPortfolio.balance > 0n) {
|
|
4556
4530
|
results.push({
|
|
@@ -4564,7 +4538,7 @@ function SolanaTokenSelectStep({
|
|
|
4564
4538
|
setTokenBalances(results);
|
|
4565
4539
|
setLoading(false);
|
|
4566
4540
|
const totalUsd = results.reduce((sum, r) => sum + r.balanceUsd, 0);
|
|
4567
|
-
_optionalChain([onTotalBalanceComputed, 'optionalCall',
|
|
4541
|
+
_optionalChain([onTotalBalanceComputed, 'optionalCall', _224 => _224(totalUsd)]);
|
|
4568
4542
|
}
|
|
4569
4543
|
void loadBalances();
|
|
4570
4544
|
return () => {
|
|
@@ -4586,7 +4560,7 @@ function SolanaTokenSelectStep({
|
|
|
4586
4560
|
const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
|
|
4587
4561
|
const numeric = Number(raw);
|
|
4588
4562
|
if (!Number.isFinite(numeric)) return raw;
|
|
4589
|
-
return
|
|
4563
|
+
return _chunk4O2UGFFTcjs.tokenFormatter.format(numeric);
|
|
4590
4564
|
} catch (e30) {
|
|
4591
4565
|
return "--";
|
|
4592
4566
|
}
|
|
@@ -4607,7 +4581,7 @@ function SolanaTokenSelectStep({
|
|
|
4607
4581
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkG264OM23cjs.Spinner, { className: "rs-text-tertiary" }),
|
|
4608
4582
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
4609
4583
|
] }),
|
|
4610
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4584
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.Callout, { variant: "error", children: error }),
|
|
4611
4585
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
4612
4586
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkG264OM23cjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
4613
4587
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
@@ -4640,14 +4614,14 @@ function SolanaTokenSelectStep({
|
|
|
4640
4614
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
|
|
4641
4615
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-icon-wrapper", children: [
|
|
4642
4616
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4643
|
-
|
|
4617
|
+
_chunk4O2UGFFTcjs.TokenIcon,
|
|
4644
4618
|
{
|
|
4645
4619
|
token: { chain: "solana", address: entry.token.mint },
|
|
4646
4620
|
symbol: entry.token.symbol,
|
|
4647
4621
|
fallback: entry.token.symbol.slice(0, 4)
|
|
4648
4622
|
}
|
|
4649
4623
|
) }),
|
|
4650
|
-
chainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4624
|
+
chainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.CdnIcon, { src: chainIcon, alt: chainName }) })
|
|
4651
4625
|
] }),
|
|
4652
4626
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-text", children: [
|
|
4653
4627
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-name-row", children: [
|
|
@@ -4664,14 +4638,14 @@ function SolanaTokenSelectStep({
|
|
|
4664
4638
|
] })
|
|
4665
4639
|
] })
|
|
4666
4640
|
] }),
|
|
4667
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ?
|
|
4641
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunk4O2UGFFTcjs.currencyFormatter.format(entry.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${entry.token.symbol}` : "--" })
|
|
4668
4642
|
]
|
|
4669
4643
|
},
|
|
4670
4644
|
entry.token.symbol
|
|
4671
4645
|
);
|
|
4672
4646
|
}) }),
|
|
4673
4647
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4674
|
-
|
|
4648
|
+
_chunk4O2UGFFTcjs.Button,
|
|
4675
4649
|
{
|
|
4676
4650
|
onClick: () => selectedEntry && onContinue(
|
|
4677
4651
|
selectedEntry.token,
|
|
@@ -4684,7 +4658,7 @@ function SolanaTokenSelectStep({
|
|
|
4684
4658
|
}
|
|
4685
4659
|
)
|
|
4686
4660
|
] }),
|
|
4687
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4661
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.PoweredBy, {})
|
|
4688
4662
|
] });
|
|
4689
4663
|
}
|
|
4690
4664
|
|
|
@@ -4717,7 +4691,7 @@ function SolanaAmountStep({
|
|
|
4717
4691
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
4718
4692
|
const hasAppliedDefaultRef = _react.useRef.call(void 0, false);
|
|
4719
4693
|
const isSourceStablecoin = _chunkFKJ6EJHHcjs.isStablecoinSymbol.call(void 0, token.symbol);
|
|
4720
|
-
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess',
|
|
4694
|
+
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess', _225 => _225.trim, 'call', _226 => _226(), 'access', _227 => _227.toLowerCase, 'call', _228 => _228()]) === "max";
|
|
4721
4695
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
4722
4696
|
if (isSourceStablecoin) return 1;
|
|
4723
4697
|
try {
|
|
@@ -4737,7 +4711,7 @@ function SolanaAmountStep({
|
|
|
4737
4711
|
const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
|
|
4738
4712
|
const numeric = Number(raw);
|
|
4739
4713
|
if (!Number.isFinite(numeric)) return raw;
|
|
4740
|
-
return
|
|
4714
|
+
return _chunk4O2UGFFTcjs.tokenFormatter.format(numeric);
|
|
4741
4715
|
} catch (e32) {
|
|
4742
4716
|
return "\u2026";
|
|
4743
4717
|
}
|
|
@@ -4754,7 +4728,7 @@ function SolanaAmountStep({
|
|
|
4754
4728
|
}
|
|
4755
4729
|
}, [balance, token.decimals, tokenPriceUsd, balanceUsd]);
|
|
4756
4730
|
const spendableBalance = _react.useMemo.call(void 0, () => {
|
|
4757
|
-
if (!
|
|
4731
|
+
if (!_chunk4O2UGFFTcjs.isNativeSol.call(void 0, token)) return balance;
|
|
4758
4732
|
return balance > SOL_FEE_RESERVE_LAMPORTS ? balance - SOL_FEE_RESERVE_LAMPORTS : 0n;
|
|
4759
4733
|
}, [balance, token]);
|
|
4760
4734
|
const spendableBalanceUsd = _react.useMemo.call(void 0, () => {
|
|
@@ -4819,15 +4793,15 @@ function SolanaAmountStep({
|
|
|
4819
4793
|
return null;
|
|
4820
4794
|
}
|
|
4821
4795
|
}, [numericAmount, isSourceStablecoin, hasPricing, tokenPriceUsd, token.decimals]);
|
|
4822
|
-
const minDepositUsd = _chunkFKJ6EJHHcjs.isHyperCoreDestination.call(void 0, targetChain) ? Math.max(_chunkFKJ6EJHHcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
4823
|
-
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
4796
|
+
const minDepositUsd = _chunkFKJ6EJHHcjs.isHyperCoreDestination.call(void 0, targetChain) ? Math.max(_chunkFKJ6EJHHcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _229 => _229.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _230 => _230.minDepositUsd]), () => ( null));
|
|
4797
|
+
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _231 => _231.maxDepositUsd]), () => ( null));
|
|
4824
4798
|
const isBelowMin = minDepositUsd !== null && numericAmount > 0 && numericAmount < minDepositUsd;
|
|
4825
4799
|
const isAboveMax = maxDepositUsd !== null && numericAmount > maxDepositUsd;
|
|
4826
4800
|
const exceedsBalance = Boolean(
|
|
4827
4801
|
sourceAmountUnits !== null && sourceAmountUnits > spendableBalance
|
|
4828
4802
|
);
|
|
4829
|
-
const boundsFor =
|
|
4830
|
-
const boundViolation =
|
|
4803
|
+
const boundsFor = _chunk4O2UGFFTcjs.useDepositBounds.call(void 0, );
|
|
4804
|
+
const boundViolation = _chunk4O2UGFFTcjs.depositBoundsViolation.call(void 0,
|
|
4831
4805
|
boundsFor("solana", token.mint),
|
|
4832
4806
|
sourceAmountUnits
|
|
4833
4807
|
);
|
|
@@ -4835,7 +4809,7 @@ function SolanaAmountStep({
|
|
|
4835
4809
|
const handlePresetClick = (percentage) => {
|
|
4836
4810
|
const formatted = computePresetAmount(percentage);
|
|
4837
4811
|
if (!formatted) return;
|
|
4838
|
-
|
|
4812
|
+
_chunk4O2UGFFTcjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
|
|
4839
4813
|
percentage,
|
|
4840
4814
|
symbol: token.symbol,
|
|
4841
4815
|
formatted
|
|
@@ -4871,7 +4845,7 @@ function SolanaAmountStep({
|
|
|
4871
4845
|
try {
|
|
4872
4846
|
amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
|
|
4873
4847
|
} catch (e37) {
|
|
4874
|
-
|
|
4848
|
+
_chunk4O2UGFFTcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
4875
4849
|
amount,
|
|
4876
4850
|
sourceAmount: sourceAmountStr,
|
|
4877
4851
|
reason: "parse-units-failed"
|
|
@@ -4880,13 +4854,13 @@ function SolanaAmountStep({
|
|
|
4880
4854
|
return;
|
|
4881
4855
|
}
|
|
4882
4856
|
if (amountInUnits > spendableBalance) {
|
|
4883
|
-
const isReserveIssue =
|
|
4857
|
+
const isReserveIssue = _chunk4O2UGFFTcjs.isNativeSol.call(void 0, token) && amountInUnits <= balance;
|
|
4884
4858
|
setError(
|
|
4885
4859
|
isReserveIssue ? "Use a bit less than your full SOL balance" : "Insufficient balance"
|
|
4886
4860
|
);
|
|
4887
4861
|
return;
|
|
4888
4862
|
}
|
|
4889
|
-
|
|
4863
|
+
_chunk4O2UGFFTcjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
|
|
4890
4864
|
symbol: token.symbol,
|
|
4891
4865
|
inputAmountUsd: amount,
|
|
4892
4866
|
sourceAmount: sourceAmountStr,
|
|
@@ -4919,13 +4893,13 @@ function SolanaAmountStep({
|
|
|
4919
4893
|
" available",
|
|
4920
4894
|
computedBalanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
4921
4895
|
" (~",
|
|
4922
|
-
|
|
4896
|
+
_chunk4O2UGFFTcjs.currencyFormatter.format(computedBalanceUsd),
|
|
4923
4897
|
")"
|
|
4924
4898
|
] })
|
|
4925
4899
|
] }),
|
|
4926
4900
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
4927
4901
|
"Min. deposit ",
|
|
4928
|
-
|
|
4902
|
+
_chunk4O2UGFFTcjs.currencyFormatter.format(minDepositUsd)
|
|
4929
4903
|
] })
|
|
4930
4904
|
] })
|
|
4931
4905
|
] }),
|
|
@@ -4949,7 +4923,7 @@ function SolanaAmountStep({
|
|
|
4949
4923
|
token.symbol
|
|
4950
4924
|
] }),
|
|
4951
4925
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4952
|
-
|
|
4926
|
+
_chunk4O2UGFFTcjs.TokenIcon,
|
|
4953
4927
|
{
|
|
4954
4928
|
token: { chain: "solana", address: token.mint },
|
|
4955
4929
|
symbol: token.symbol
|
|
@@ -4965,17 +4939,17 @@ function SolanaAmountStep({
|
|
|
4965
4939
|
" ",
|
|
4966
4940
|
targetTokenSymbol
|
|
4967
4941
|
] }),
|
|
4968
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4942
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.TokenIcon, { token: targetToken, symbol: targetTokenSymbol }) })
|
|
4969
4943
|
] })
|
|
4970
4944
|
] }),
|
|
4971
4945
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
4972
4946
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
4973
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
4947
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunk4O2UGFFTcjs.currencyFormatter.format(balanceAfterUsd) })
|
|
4974
4948
|
] })
|
|
4975
4949
|
] }),
|
|
4976
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4950
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.Callout, { variant: "error", children: error }),
|
|
4977
4951
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4978
|
-
|
|
4952
|
+
_chunk4O2UGFFTcjs.Button,
|
|
4979
4953
|
{
|
|
4980
4954
|
onClick: handleContinue,
|
|
4981
4955
|
fullWidth: true,
|
|
@@ -4984,7 +4958,7 @@ function SolanaAmountStep({
|
|
|
4984
4958
|
}
|
|
4985
4959
|
)
|
|
4986
4960
|
] }),
|
|
4987
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4961
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.PoweredBy, {})
|
|
4988
4962
|
] });
|
|
4989
4963
|
}
|
|
4990
4964
|
|
|
@@ -5004,10 +4978,10 @@ function loadSolanaDependencies() {
|
|
|
5004
4978
|
return dependenciesPromise2;
|
|
5005
4979
|
}
|
|
5006
4980
|
function getSolanaRpcUrl(rpcUrls) {
|
|
5007
|
-
return _nullishCoalesce(
|
|
4981
|
+
return _nullishCoalesce(_chunk4O2UGFFTcjs.rpcUrlFor.call(void 0, rpcUrls, "solana"), () => ( DEFAULT_SOLANA_RPC_URL));
|
|
5008
4982
|
}
|
|
5009
4983
|
function hasConfiguredSolanaRpcUrl(rpcUrls) {
|
|
5010
|
-
return
|
|
4984
|
+
return _chunk4O2UGFFTcjs.rpcUrlFor.call(void 0, rpcUrls, "solana") !== void 0;
|
|
5011
4985
|
}
|
|
5012
4986
|
async function getSolanaConnection(rpcUrls) {
|
|
5013
4987
|
const rpcUrl = getSolanaRpcUrl(rpcUrls);
|
|
@@ -5124,44 +5098,44 @@ function SolanaConfirmStep({
|
|
|
5124
5098
|
onSubmittingChange,
|
|
5125
5099
|
debug
|
|
5126
5100
|
}) {
|
|
5127
|
-
const rpcUrls =
|
|
5101
|
+
const rpcUrls = _chunk4O2UGFFTcjs.useRpcUrls.call(void 0, );
|
|
5128
5102
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
5129
5103
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
5130
5104
|
const onSubmittingChangeRef = _react.useRef.call(void 0, onSubmittingChange);
|
|
5131
5105
|
onSubmittingChangeRef.current = onSubmittingChange;
|
|
5132
5106
|
_react.useEffect.call(void 0, () => {
|
|
5133
|
-
_optionalChain([onSubmittingChangeRef, 'access',
|
|
5134
|
-
return () => _optionalChain([onSubmittingChangeRef, 'access',
|
|
5107
|
+
_optionalChain([onSubmittingChangeRef, 'access', _232 => _232.current, 'optionalCall', _233 => _233(isSubmitting)]);
|
|
5108
|
+
return () => _optionalChain([onSubmittingChangeRef, 'access', _234 => _234.current, 'optionalCall', _235 => _235(false)]);
|
|
5135
5109
|
}, [isSubmitting]);
|
|
5136
5110
|
const targetChainId = _chunkFKJ6EJHHcjs.targetChainToChainId.call(void 0, targetChain);
|
|
5137
|
-
const targetSymbol =
|
|
5111
|
+
const targetSymbol = _chunk4O2UGFFTcjs.useTokenDisplay.call(void 0, targetChainId, targetToken).symbol;
|
|
5138
5112
|
const sourceChainName = _chunkFKJ6EJHHcjs.getChainName.call(void 0, "solana");
|
|
5139
5113
|
const targetChainName = _chunkFKJ6EJHHcjs.getChainName.call(void 0, targetChainId);
|
|
5140
5114
|
const sourceChainIcon = _chunkFKJ6EJHHcjs.getChainIcon.call(void 0, "solana");
|
|
5141
5115
|
const targetChainIcon = _chunkFKJ6EJHHcjs.getChainIcon.call(void 0, targetChainId);
|
|
5142
|
-
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
5143
|
-
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
5144
|
-
const formattedAmount = sourceAmount && Number.isFinite(Number(sourceAmount)) ? _nullishCoalesce(
|
|
5116
|
+
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _236 => _236.feeSponsored]), () => ( false));
|
|
5117
|
+
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _237 => _237.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
5118
|
+
const formattedAmount = sourceAmount && Number.isFinite(Number(sourceAmount)) ? _nullishCoalesce(_chunk4O2UGFFTcjs.formatTokenAmount.call(void 0, Number(sourceAmount), token.symbol), () => ( "0")) : "0";
|
|
5145
5119
|
const receiveDisplay = (() => {
|
|
5146
5120
|
const usdValue = Number(targetAmount);
|
|
5147
5121
|
const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
|
|
5148
|
-
const estimate =
|
|
5122
|
+
const estimate = _chunk4O2UGFFTcjs.formatReceiveEstimate.call(void 0, {
|
|
5149
5123
|
sourceAmount: Number.isFinite(Number(sourceAmount)) ? Number(sourceAmount) : void 0,
|
|
5150
5124
|
sourceSymbol: token.symbol,
|
|
5151
5125
|
targetSymbol,
|
|
5152
5126
|
sourceAmountUsd,
|
|
5153
5127
|
// The wallet flow only offers the allowlist, so this is the check.
|
|
5154
|
-
sourceTrusted:
|
|
5128
|
+
sourceTrusted: _chunk4O2UGFFTcjs.resolveSolanaToken.call(void 0, token.mint) !== void 0,
|
|
5155
5129
|
// Curated stablecoin target estimates at $1 when unquoted; never applied
|
|
5156
5130
|
// to the source (a held token). See ConfirmStep for the rationale.
|
|
5157
|
-
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } :
|
|
5131
|
+
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : _chunk4O2UGFFTcjs.isDisplayStablecoinSymbol.call(void 0, targetSymbol) ? { [targetSymbol.toUpperCase()]: 1 } : {}
|
|
5158
5132
|
});
|
|
5159
5133
|
if (estimate !== void 0) return estimate;
|
|
5160
5134
|
return targetSymbol;
|
|
5161
5135
|
})();
|
|
5162
5136
|
const handleConfirm = async () => {
|
|
5163
5137
|
if (!solanaProvider) {
|
|
5164
|
-
|
|
5138
|
+
_chunk4O2UGFFTcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
5165
5139
|
reason: "missing-provider"
|
|
5166
5140
|
});
|
|
5167
5141
|
setError("Solana wallet not connected");
|
|
@@ -5169,7 +5143,7 @@ function SolanaConfirmStep({
|
|
|
5169
5143
|
}
|
|
5170
5144
|
const parsedAmount = parseFloat(sourceAmount);
|
|
5171
5145
|
if (isNaN(parsedAmount) || parsedAmount <= 0) {
|
|
5172
|
-
|
|
5146
|
+
_chunk4O2UGFFTcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
5173
5147
|
reason: "invalid-amount",
|
|
5174
5148
|
sourceAmount
|
|
5175
5149
|
});
|
|
@@ -5178,7 +5152,7 @@ function SolanaConfirmStep({
|
|
|
5178
5152
|
}
|
|
5179
5153
|
setError(null);
|
|
5180
5154
|
setIsSubmitting(true);
|
|
5181
|
-
|
|
5155
|
+
_chunk4O2UGFFTcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
|
|
5182
5156
|
smartAccount,
|
|
5183
5157
|
solanaAddress,
|
|
5184
5158
|
solanaDepositAddress,
|
|
@@ -5188,7 +5162,7 @@ function SolanaConfirmStep({
|
|
|
5188
5162
|
});
|
|
5189
5163
|
try {
|
|
5190
5164
|
const check = await service.checkAccount(smartAccount);
|
|
5191
|
-
|
|
5165
|
+
_chunk4O2UGFFTcjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
|
|
5192
5166
|
smartAccount,
|
|
5193
5167
|
isRegistered: check.isRegistered,
|
|
5194
5168
|
targetChain: check.targetChain,
|
|
@@ -5201,12 +5175,12 @@ function SolanaConfirmStep({
|
|
|
5201
5175
|
}
|
|
5202
5176
|
const connection = await (hasConfiguredSolanaRpcUrl(rpcUrls) ? getSolanaConnection(rpcUrls) : _nullishCoalesce(solanaConnection, () => ( getSolanaConnection(rpcUrls))));
|
|
5203
5177
|
const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
|
|
5204
|
-
|
|
5178
|
+
_chunk4O2UGFFTcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
|
|
5205
5179
|
token: token.symbol,
|
|
5206
5180
|
sourceAmount,
|
|
5207
5181
|
amountUnits: amountUnits.toString()
|
|
5208
5182
|
});
|
|
5209
|
-
const transaction =
|
|
5183
|
+
const transaction = _chunk4O2UGFFTcjs.isNativeSol.call(void 0, token) ? await buildSolTransferTransaction(
|
|
5210
5184
|
connection,
|
|
5211
5185
|
solanaAddress,
|
|
5212
5186
|
solanaDepositAddress,
|
|
@@ -5218,10 +5192,10 @@ function SolanaConfirmStep({
|
|
|
5218
5192
|
token.mint,
|
|
5219
5193
|
amountUnits
|
|
5220
5194
|
);
|
|
5221
|
-
|
|
5195
|
+
_chunk4O2UGFFTcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
5222
5196
|
token: token.symbol,
|
|
5223
5197
|
instructionCount: transaction.instructions.length,
|
|
5224
|
-
feePayer: _optionalChain([transaction, 'access',
|
|
5198
|
+
feePayer: _optionalChain([transaction, 'access', _238 => _238.feePayer, 'optionalAccess', _239 => _239.toBase58, 'call', _240 => _240()]),
|
|
5225
5199
|
recentBlockhash: transaction.recentBlockhash
|
|
5226
5200
|
});
|
|
5227
5201
|
const txHash = await sendSolanaTransaction(
|
|
@@ -5229,7 +5203,7 @@ function SolanaConfirmStep({
|
|
|
5229
5203
|
connection,
|
|
5230
5204
|
transaction
|
|
5231
5205
|
);
|
|
5232
|
-
|
|
5206
|
+
_chunk4O2UGFFTcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
|
|
5233
5207
|
txHash,
|
|
5234
5208
|
amountUnits: amountUnits.toString()
|
|
5235
5209
|
});
|
|
@@ -5241,14 +5215,14 @@ function SolanaConfirmStep({
|
|
|
5241
5215
|
});
|
|
5242
5216
|
} catch (err) {
|
|
5243
5217
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
5244
|
-
const message =
|
|
5245
|
-
|
|
5218
|
+
const message = _chunk4O2UGFFTcjs.formatUserError.call(void 0, raw);
|
|
5219
|
+
_chunk4O2UGFFTcjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
|
|
5246
5220
|
smartAccount,
|
|
5247
5221
|
token: token.symbol,
|
|
5248
5222
|
sourceAmount
|
|
5249
5223
|
});
|
|
5250
5224
|
setError(message);
|
|
5251
|
-
_optionalChain([onError, 'optionalCall',
|
|
5225
|
+
_optionalChain([onError, 'optionalCall', _241 => _241(message, "SOLANA_TRANSFER_ERROR", raw)]);
|
|
5252
5226
|
} finally {
|
|
5253
5227
|
setIsSubmitting(false);
|
|
5254
5228
|
}
|
|
@@ -5273,9 +5247,9 @@ function SolanaConfirmStep({
|
|
|
5273
5247
|
fee: { display: "$0.04", struck: feeSponsored, tooltip: feeTooltip }
|
|
5274
5248
|
}
|
|
5275
5249
|
),
|
|
5276
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5250
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.Callout, { variant: "error", children: error }),
|
|
5277
5251
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5278
|
-
|
|
5252
|
+
_chunk4O2UGFFTcjs.Button,
|
|
5279
5253
|
{
|
|
5280
5254
|
onClick: handleConfirm,
|
|
5281
5255
|
loading: isSubmitting,
|
|
@@ -5286,7 +5260,7 @@ function SolanaConfirmStep({
|
|
|
5286
5260
|
}
|
|
5287
5261
|
)
|
|
5288
5262
|
] }),
|
|
5289
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5263
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.PoweredBy, {})
|
|
5290
5264
|
] });
|
|
5291
5265
|
}
|
|
5292
5266
|
|
|
@@ -5310,10 +5284,10 @@ function DappImportAssetSelectStep({
|
|
|
5310
5284
|
),
|
|
5311
5285
|
incompleteSummary && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-notice", role: "status", children: incompleteSummary }),
|
|
5312
5286
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: assets.map((asset) => {
|
|
5313
|
-
const tokenAmount = asset.balance ?
|
|
5287
|
+
const tokenAmount = asset.balance ? _chunk4O2UGFFTcjs.tokenFormatter.format(
|
|
5314
5288
|
Number(asset.balance) / 10 ** asset.decimals
|
|
5315
5289
|
) : "0";
|
|
5316
|
-
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ?
|
|
5290
|
+
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ? _chunk4O2UGFFTcjs.currencyFormatter.format(asset.balanceUsd) : `${tokenAmount} ${asset.symbol}`;
|
|
5317
5291
|
const assetIcon = asset.icon;
|
|
5318
5292
|
const chainIcon = _chunkFKJ6EJHHcjs.getChainIcon.call(void 0, asset.chainId);
|
|
5319
5293
|
const badge = _chunkFKJ6EJHHcjs.getChainBadge.call(void 0, asset.chainId);
|
|
@@ -5326,15 +5300,15 @@ function DappImportAssetSelectStep({
|
|
|
5326
5300
|
children: [
|
|
5327
5301
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
|
|
5328
5302
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-icon-wrapper", children: [
|
|
5329
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: assetIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5330
|
-
|
|
5303
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: assetIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.CdnIcon, { src: assetIcon, alt: asset.symbol }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5304
|
+
_chunk4O2UGFFTcjs.TokenIcon,
|
|
5331
5305
|
{
|
|
5332
5306
|
token: { chain: asset.chainId, address: asset.token },
|
|
5333
5307
|
symbol: asset.symbol,
|
|
5334
5308
|
fallback: asset.symbol.slice(0, 4)
|
|
5335
5309
|
}
|
|
5336
5310
|
) }),
|
|
5337
|
-
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5311
|
+
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.CdnIcon, { src: chainIcon, alt: _chunkFKJ6EJHHcjs.getChainName.call(void 0, asset.chainId) }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5338
5312
|
"span",
|
|
5339
5313
|
{
|
|
5340
5314
|
className: "rs-asset-chain-badge",
|
|
@@ -5366,7 +5340,7 @@ function DappImportAssetSelectStep({
|
|
|
5366
5340
|
);
|
|
5367
5341
|
}) })
|
|
5368
5342
|
] }),
|
|
5369
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5343
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.PoweredBy, {})
|
|
5370
5344
|
] });
|
|
5371
5345
|
}
|
|
5372
5346
|
DappImportAssetSelectStep.displayName = "DappImportAssetSelectStep";
|
|
@@ -5388,7 +5362,7 @@ function describeRow(status, comingSoon) {
|
|
|
5388
5362
|
}
|
|
5389
5363
|
if (status.enabled) {
|
|
5390
5364
|
return {
|
|
5391
|
-
subtitle: status.balanceUsd > 0 ?
|
|
5365
|
+
subtitle: status.balanceUsd > 0 ? _chunk4O2UGFFTcjs.currencyFormatter.format(status.balanceUsd) : "No balance",
|
|
5392
5366
|
disabled: false,
|
|
5393
5367
|
busy: false
|
|
5394
5368
|
};
|
|
@@ -5425,7 +5399,7 @@ function DappImportSelectStep({
|
|
|
5425
5399
|
Boolean(brand.comingSoon)
|
|
5426
5400
|
);
|
|
5427
5401
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5428
|
-
|
|
5402
|
+
_chunk4O2UGFFTcjs.ListRow,
|
|
5429
5403
|
{
|
|
5430
5404
|
leadingMedia: brand.iconUrl,
|
|
5431
5405
|
title: brand.label,
|
|
@@ -5434,7 +5408,7 @@ function DappImportSelectStep({
|
|
|
5434
5408
|
trailing: busy ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkG264OM23cjs.Spinner, { className: "rs-spinner--sm" }) : void 0,
|
|
5435
5409
|
onClick: () => {
|
|
5436
5410
|
if (status === "needs-connect") {
|
|
5437
|
-
_optionalChain([onRequestConnect, 'optionalCall',
|
|
5411
|
+
_optionalChain([onRequestConnect, 'optionalCall', _242 => _242()]);
|
|
5438
5412
|
return;
|
|
5439
5413
|
}
|
|
5440
5414
|
onSelect(brand.id);
|
|
@@ -5444,7 +5418,7 @@ function DappImportSelectStep({
|
|
|
5444
5418
|
);
|
|
5445
5419
|
}) })
|
|
5446
5420
|
] }),
|
|
5447
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5421
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.PoweredBy, {})
|
|
5448
5422
|
] });
|
|
5449
5423
|
}
|
|
5450
5424
|
DappImportSelectStep.displayName = "DappImportSelectStep";
|
|
@@ -5501,21 +5475,21 @@ function DappImportAssetSelectSkeleton({
|
|
|
5501
5475
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Try again" })
|
|
5502
5476
|
}
|
|
5503
5477
|
) }),
|
|
5504
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5478
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.PoweredBy, {})
|
|
5505
5479
|
] });
|
|
5506
5480
|
}
|
|
5507
5481
|
DappImportAssetSelectSkeleton.displayName = "DappImportAssetSelectSkeleton";
|
|
5508
5482
|
|
|
5509
5483
|
// src/core/fiat-methods.ts
|
|
5510
5484
|
var REGIONAL_METHODS_TIMEOUT_MS = 3e3;
|
|
5511
|
-
var
|
|
5485
|
+
var PRODUCT_METHODS = /* @__PURE__ */ new Set([
|
|
5512
5486
|
"creditcard",
|
|
5513
5487
|
"bank-transfer",
|
|
5514
5488
|
"apple-pay"
|
|
5515
5489
|
]);
|
|
5516
5490
|
function serverMethodToOption(m) {
|
|
5517
5491
|
const icon = m.method === "bank-transfer" ? "bank" : m.method === "apple-pay" ? "apple" : "card";
|
|
5518
|
-
const remoteIcon =
|
|
5492
|
+
const remoteIcon = PRODUCT_METHODS.has(m.method) ? {} : {
|
|
5519
5493
|
iconUrl: _nullishCoalesce(m.iconUrl, () => ( void 0)),
|
|
5520
5494
|
iconUrlLight: _nullishCoalesce(m.iconUrlLight, () => ( void 0))
|
|
5521
5495
|
};
|
|
@@ -5550,8 +5524,9 @@ function composeFiatMethods(regional, fallbackMethods) {
|
|
|
5550
5524
|
source: "fallback"
|
|
5551
5525
|
};
|
|
5552
5526
|
}
|
|
5553
|
-
|
|
5554
|
-
|
|
5527
|
+
const methods = dedupe(
|
|
5528
|
+
regional.methods.filter((m) => PRODUCT_METHODS.has(m.method) || m.badge === "Popular").map(serverMethodToOption)
|
|
5529
|
+
);
|
|
5555
5530
|
if (methods.length === 0) return { kind: "hidden" };
|
|
5556
5531
|
const recommendedMethod = regional.recommendedMethod && methods.some(({ method }) => method === regional.recommendedMethod) ? regional.recommendedMethod : methods[0].method;
|
|
5557
5532
|
return {
|
|
@@ -5590,7 +5565,7 @@ var aaveProvider = {
|
|
|
5590
5565
|
throw new Error("Aave positions require a backend connection");
|
|
5591
5566
|
}
|
|
5592
5567
|
const response = await backend.getPositions(eoa);
|
|
5593
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
5568
|
+
if (_optionalChain([signal, 'optionalAccess', _243 => _243.aborted])) return null;
|
|
5594
5569
|
const assets = toImportableAssets(response.positions);
|
|
5595
5570
|
const failures = _nullishCoalesce(response.failures, () => ( []));
|
|
5596
5571
|
if (assets.length === 0) {
|
|
@@ -5923,21 +5898,21 @@ var polymarketProvider = {
|
|
|
5923
5898
|
async fetchAvailability({ eoa, getPublicClient: getPublicClient2, signal }) {
|
|
5924
5899
|
const proxyWallet = await _chunkFVJKUTHFcjs.fetchPolymarketProxyWallet.call(void 0, eoa, signal);
|
|
5925
5900
|
if (!proxyWallet) return null;
|
|
5926
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
5901
|
+
if (_optionalChain([signal, 'optionalAccess', _244 => _244.aborted])) return null;
|
|
5927
5902
|
const polygonClient = getPublicClient2(_chunkFVJKUTHFcjs.POLYMARKET_POLYGON_CHAIN_ID);
|
|
5928
5903
|
if (!polygonClient) return null;
|
|
5929
5904
|
const balances = await _chunkFVJKUTHFcjs.readPolymarketBalances.call(void 0, {
|
|
5930
5905
|
publicClient: polygonClient,
|
|
5931
5906
|
proxyWallet
|
|
5932
5907
|
});
|
|
5933
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
5908
|
+
if (_optionalChain([signal, 'optionalAccess', _245 => _245.aborted])) return null;
|
|
5934
5909
|
if (balances.pusd === 0n && balances.usdce === 0n) return null;
|
|
5935
5910
|
const walletKind = await detectPolymarketWalletKind({
|
|
5936
5911
|
publicClient: polygonClient,
|
|
5937
5912
|
proxyWallet,
|
|
5938
5913
|
eoa
|
|
5939
5914
|
});
|
|
5940
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
5915
|
+
if (_optionalChain([signal, 'optionalAccess', _246 => _246.aborted])) return null;
|
|
5941
5916
|
if (!walletKind) return null;
|
|
5942
5917
|
const assets = [];
|
|
5943
5918
|
if (balances.pusd > 0n) {
|
|
@@ -6075,7 +6050,7 @@ function narrowDappImportAvailability(availability, isExcluded) {
|
|
|
6075
6050
|
function computeDappImportStatus(providerId, inputs) {
|
|
6076
6051
|
const { owner, availability, availabilityOwner, setup } = inputs;
|
|
6077
6052
|
if (!owner) return "needs-connect";
|
|
6078
|
-
const entry = _optionalChain([availabilityOwner, 'optionalAccess',
|
|
6053
|
+
const entry = _optionalChain([availabilityOwner, 'optionalAccess', _247 => _247.toLowerCase, 'call', _248 => _248()]) === owner.toLowerCase() ? availability[providerId] : void 0;
|
|
6079
6054
|
if (entry === "loading" || entry === void 0) return "loading";
|
|
6080
6055
|
if (entry === "error") {
|
|
6081
6056
|
return {
|
|
@@ -6188,7 +6163,16 @@ function analyticsStepForFlowStep(method, step) {
|
|
|
6188
6163
|
return "funding_method_home";
|
|
6189
6164
|
}
|
|
6190
6165
|
}
|
|
6166
|
+
var BANK_FAILURES = {
|
|
6167
|
+
BANK_ONRAMP_OPTIONS_FAILED: "bank_options_failed",
|
|
6168
|
+
BANK_ONRAMP_SESSION_REFUSED: "bank_session_refused",
|
|
6169
|
+
BANK_ONRAMP_SETUP_FAILED: "bank_setup_failed",
|
|
6170
|
+
BANK_ONRAMP_DETAILS_FAILED: "bank_details_failed",
|
|
6171
|
+
BANK_ONRAMP_DETAILS_PENDING: "bank_details_pending"
|
|
6172
|
+
};
|
|
6191
6173
|
function failureReasonForCode(code, cause) {
|
|
6174
|
+
const bank = code ? BANK_FAILURES[code] : void 0;
|
|
6175
|
+
if (bank) return bank;
|
|
6192
6176
|
const normalized = `${_nullishCoalesce(code, () => ( ""))} ${_nullishCoalesce(cause, () => ( ""))}`.toLowerCase();
|
|
6193
6177
|
if (normalized.includes("uncertain")) return "submission_uncertain";
|
|
6194
6178
|
if (normalized.includes("reject") && (normalized.includes("sign") || normalized.includes("permit"))) {
|
|
@@ -6417,7 +6401,7 @@ function DepositAnalyticsControllerProvider({
|
|
|
6417
6401
|
children,
|
|
6418
6402
|
controllerRef
|
|
6419
6403
|
}) {
|
|
6420
|
-
const emit =
|
|
6404
|
+
const emit = _chunk4O2UGFFTcjs.useDepositAnalyticsEmitter.call(void 0, );
|
|
6421
6405
|
const controller = _react.useMemo.call(void 0,
|
|
6422
6406
|
() => createDepositAnalyticsController(emit),
|
|
6423
6407
|
[emit]
|
|
@@ -6505,7 +6489,8 @@ function createInitialState(overrides) {
|
|
|
6505
6489
|
},
|
|
6506
6490
|
fiat: {
|
|
6507
6491
|
selectedMethod: null,
|
|
6508
|
-
methodSelectionSource: null
|
|
6492
|
+
methodSelectionSource: null,
|
|
6493
|
+
selectedProvider: null
|
|
6509
6494
|
},
|
|
6510
6495
|
exchange: {
|
|
6511
6496
|
selectedConnection: null
|
|
@@ -6793,7 +6778,8 @@ function applyAction(state, action) {
|
|
|
6793
6778
|
fiat: {
|
|
6794
6779
|
...state.fiat,
|
|
6795
6780
|
selectedMethod: _nullishCoalesce(action.paymentMethod, () => ( null)),
|
|
6796
|
-
methodSelectionSource: _nullishCoalesce(action.methodSelectionSource, () => ( null))
|
|
6781
|
+
methodSelectionSource: _nullishCoalesce(action.methodSelectionSource, () => ( null)),
|
|
6782
|
+
selectedProvider: _nullishCoalesce(action.provider, () => ( null))
|
|
6797
6783
|
},
|
|
6798
6784
|
// Pin on ENTRY, not on submit: a Swapped order only reports a
|
|
6799
6785
|
// submission on terminal success, so between paying and that callback
|
|
@@ -6937,7 +6923,7 @@ function applyAction(state, action) {
|
|
|
6937
6923
|
totalUsd: null,
|
|
6938
6924
|
// Keep any prior chains visible so the cluster does not flicker
|
|
6939
6925
|
// empty across a refresh.
|
|
6940
|
-
chainIds: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
6926
|
+
chainIds: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _249 => _249.chainIds]), () => ( []))
|
|
6941
6927
|
}
|
|
6942
6928
|
}
|
|
6943
6929
|
}
|
|
@@ -7148,7 +7134,7 @@ function applyAction(state, action) {
|
|
|
7148
7134
|
flow: { ...state.flow, step: "processing" }
|
|
7149
7135
|
};
|
|
7150
7136
|
case "processing/quote-loaded":
|
|
7151
|
-
if (state.flow.step !== "processing" || _optionalChain([state, 'access',
|
|
7137
|
+
if (state.flow.step !== "processing" || _optionalChain([state, 'access', _250 => _250.processing, 'access', _251 => _251.txHash, 'optionalAccess', _252 => _252.toLowerCase, 'call', _253 => _253()]) !== action.txHash.toLowerCase()) {
|
|
7152
7138
|
return state;
|
|
7153
7139
|
}
|
|
7154
7140
|
return {
|
|
@@ -7374,7 +7360,11 @@ function applyAction(state, action) {
|
|
|
7374
7360
|
byKey: {},
|
|
7375
7361
|
nextRequestId: state.portfolio.nextRequestId
|
|
7376
7362
|
},
|
|
7377
|
-
fiat: {
|
|
7363
|
+
fiat: {
|
|
7364
|
+
selectedMethod: null,
|
|
7365
|
+
methodSelectionSource: null,
|
|
7366
|
+
selectedProvider: null
|
|
7367
|
+
},
|
|
7378
7368
|
exchange: { selectedConnection: null }
|
|
7379
7369
|
};
|
|
7380
7370
|
}
|
|
@@ -7451,10 +7441,6 @@ function useDepositStore(selector) {
|
|
|
7451
7441
|
|
|
7452
7442
|
// src/DepositFlow.tsx
|
|
7453
7443
|
|
|
7454
|
-
var BankOnrampStep = _react.lazy.call(void 0, async () => {
|
|
7455
|
-
const module = await Promise.resolve().then(() => _interopRequireWildcard(require("./BankOnrampStep-NPGXAA7U.cjs")));
|
|
7456
|
-
return { default: module.BankOnrampStep };
|
|
7457
|
-
});
|
|
7458
7444
|
function swappedWidgetPrefetchKey(method, methodSelectionSource) {
|
|
7459
7445
|
return JSON.stringify([_nullishCoalesce(methodSelectionSource, () => ( null)), _nullishCoalesce(method, () => ( null))]);
|
|
7460
7446
|
}
|
|
@@ -7503,7 +7489,7 @@ async function fetchPinnedQuote(params) {
|
|
|
7503
7489
|
timeoutId = setTimeout(resolve, SWAPPED_QUOTE_FEE_TIMEOUT_MS, null);
|
|
7504
7490
|
})
|
|
7505
7491
|
]);
|
|
7506
|
-
return quote && !
|
|
7492
|
+
return quote && !_chunk4O2UGFFTcjs.isDepositPolicyRefusal.call(void 0, quote) ? quote : void 0;
|
|
7507
7493
|
} catch (e40) {
|
|
7508
7494
|
return void 0;
|
|
7509
7495
|
} finally {
|
|
@@ -7557,7 +7543,8 @@ function deriveStep(flow, d, p, activeEntry, fiat, exchange) {
|
|
|
7557
7543
|
type: "fiat-onramp",
|
|
7558
7544
|
smartAccount: committedAccount,
|
|
7559
7545
|
paymentMethod: _nullishCoalesce(fiat.selectedMethod, () => ( void 0)),
|
|
7560
|
-
methodSelectionSource: _nullishCoalesce(fiat.methodSelectionSource, () => ( void 0))
|
|
7546
|
+
methodSelectionSource: _nullishCoalesce(fiat.methodSelectionSource, () => ( void 0)),
|
|
7547
|
+
provider: _nullishCoalesce(fiat.selectedProvider, () => ( void 0))
|
|
7561
7548
|
};
|
|
7562
7549
|
case "exchange-select":
|
|
7563
7550
|
return { type: "exchange-select" };
|
|
@@ -7725,7 +7712,8 @@ function DepositFlow({
|
|
|
7725
7712
|
initialAssetMigration,
|
|
7726
7713
|
enableWallet = true,
|
|
7727
7714
|
enableFiatOnramp = false,
|
|
7728
|
-
|
|
7715
|
+
virtualAccountOnramp,
|
|
7716
|
+
getCustomerSession,
|
|
7729
7717
|
onBankJourney,
|
|
7730
7718
|
backendUrl,
|
|
7731
7719
|
enableQrTransfer = true,
|
|
@@ -7750,7 +7738,7 @@ function DepositFlow({
|
|
|
7750
7738
|
onError,
|
|
7751
7739
|
debug
|
|
7752
7740
|
}) {
|
|
7753
|
-
const rpcUrls =
|
|
7741
|
+
const rpcUrls = _chunk4O2UGFFTcjs.useRpcUrls.call(void 0, );
|
|
7754
7742
|
const onStepChangeRef = _chunkG264OM23cjs.useLatestRef.call(void 0, onStepChange);
|
|
7755
7743
|
const analytics = useDepositAnalyticsController();
|
|
7756
7744
|
const onLifecycleRef = _chunkG264OM23cjs.useLatestRef.call(void 0, onLifecycle);
|
|
@@ -7771,18 +7759,18 @@ function DepositFlow({
|
|
|
7771
7759
|
const stableWalletSelectionKeyRef = _react.useRef.call(void 0, null);
|
|
7772
7760
|
const logFlow = _react.useCallback.call(void 0,
|
|
7773
7761
|
(message, data) => {
|
|
7774
|
-
|
|
7762
|
+
_chunk4O2UGFFTcjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
|
|
7775
7763
|
},
|
|
7776
7764
|
[debug]
|
|
7777
7765
|
);
|
|
7778
7766
|
const logFlowError = _react.useCallback.call(void 0,
|
|
7779
7767
|
(message, error, data) => {
|
|
7780
|
-
|
|
7768
|
+
_chunk4O2UGFFTcjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
|
|
7781
7769
|
},
|
|
7782
7770
|
[debug]
|
|
7783
7771
|
);
|
|
7784
7772
|
const bankOnrampEnabled = Boolean(
|
|
7785
|
-
|
|
7773
|
+
virtualAccountOnramp && getCustomerSession && (fiatMethods === void 0 || fiatMethods["bank-transfer"] === true)
|
|
7786
7774
|
);
|
|
7787
7775
|
const hasSwappedFiatMethod = Boolean(
|
|
7788
7776
|
enableFiatOnramp && (!fiatMethods || Object.entries(fiatMethods).some(
|
|
@@ -7809,12 +7797,12 @@ function DepositFlow({
|
|
|
7809
7797
|
};
|
|
7810
7798
|
}, [enableSwappedPreconnect]);
|
|
7811
7799
|
const dappSwitchChain = _react.useMemo.call(void 0, () => {
|
|
7812
|
-
if (!_optionalChain([walletClientProp, 'optionalAccess',
|
|
7800
|
+
if (!_optionalChain([walletClientProp, 'optionalAccess', _254 => _254.switchChain])) return void 0;
|
|
7813
7801
|
return async (chainId) => {
|
|
7814
|
-
await _optionalChain([walletClientProp, 'access',
|
|
7802
|
+
await _optionalChain([walletClientProp, 'access', _255 => _255.switchChain, 'optionalCall', _256 => _256({ id: chainId })]);
|
|
7815
7803
|
};
|
|
7816
7804
|
}, [walletClientProp]);
|
|
7817
|
-
const connectedWalletAddress = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess',
|
|
7805
|
+
const connectedWalletAddress = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess', _257 => _257.account, 'optionalAccess', _258 => _258.address]), () => ( null));
|
|
7818
7806
|
const walletOptions = _react.useMemo.call(void 0, () => {
|
|
7819
7807
|
const options = [];
|
|
7820
7808
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -7828,7 +7816,7 @@ function DepositFlow({
|
|
|
7828
7816
|
});
|
|
7829
7817
|
seen.add(id);
|
|
7830
7818
|
}
|
|
7831
|
-
if (_optionalChain([walletSession, 'optionalAccess',
|
|
7819
|
+
if (_optionalChain([walletSession, 'optionalAccess', _259 => _259.isConnected]) && walletSession.isSolana && walletSession.solanaAddress) {
|
|
7832
7820
|
const id = _nullishCoalesce(walletSession.caipAddress, () => ( `solana:${walletSession.solanaAddress}`));
|
|
7833
7821
|
if (!seen.has(id)) {
|
|
7834
7822
|
options.push({
|
|
@@ -7840,7 +7828,7 @@ function DepositFlow({
|
|
|
7840
7828
|
});
|
|
7841
7829
|
seen.add(id);
|
|
7842
7830
|
}
|
|
7843
|
-
} else if (_optionalChain([walletSession, 'optionalAccess',
|
|
7831
|
+
} else if (_optionalChain([walletSession, 'optionalAccess', _260 => _260.address]) && walletSession.isConnected && walletSession.canSignEvm && !seen.has(`evm:${walletSession.address.toLowerCase()}`)) {
|
|
7844
7832
|
const id = `evm:${walletSession.address.toLowerCase()}`;
|
|
7845
7833
|
if (!seen.has(id)) {
|
|
7846
7834
|
options.push({
|
|
@@ -7856,13 +7844,13 @@ function DepositFlow({
|
|
|
7856
7844
|
return options;
|
|
7857
7845
|
}, [
|
|
7858
7846
|
connectedWalletAddress,
|
|
7859
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7860
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7861
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7862
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7863
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7864
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7865
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7847
|
+
_optionalChain([walletSession, 'optionalAccess', _261 => _261.address]),
|
|
7848
|
+
_optionalChain([walletSession, 'optionalAccess', _262 => _262.isConnected]),
|
|
7849
|
+
_optionalChain([walletSession, 'optionalAccess', _263 => _263.canSignEvm]),
|
|
7850
|
+
_optionalChain([walletSession, 'optionalAccess', _264 => _264.icon]),
|
|
7851
|
+
_optionalChain([walletSession, 'optionalAccess', _265 => _265.isSolana]),
|
|
7852
|
+
_optionalChain([walletSession, 'optionalAccess', _266 => _266.solanaAddress]),
|
|
7853
|
+
_optionalChain([walletSession, 'optionalAccess', _267 => _267.caipAddress])
|
|
7866
7854
|
]);
|
|
7867
7855
|
const configuredFiatMethods = _react.useMemo.call(void 0,
|
|
7868
7856
|
() => fiatMethods ? FIAT_ONRAMP_METHODS.filter(
|
|
@@ -7885,11 +7873,11 @@ function DepositFlow({
|
|
|
7885
7873
|
hasEnabledAssetMigration
|
|
7886
7874
|
].filter(Boolean).length;
|
|
7887
7875
|
const canAutoLock = Boolean(
|
|
7888
|
-
enableWallet && _optionalChain([walletClientProp, 'optionalAccess',
|
|
7876
|
+
enableWallet && _optionalChain([walletClientProp, 'optionalAccess', _268 => _268.account]) && !walletSession && enabledFeatureCount === 1
|
|
7889
7877
|
);
|
|
7890
7878
|
const hasWalletOptions = enableWallet && walletOptions.length > 0;
|
|
7891
7879
|
const hasReownSession = Boolean(
|
|
7892
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7880
|
+
_optionalChain([walletSession, 'optionalAccess', _269 => _269.isConnected]) || _optionalChain([walletSession, 'optionalAccess', _270 => _270.address])
|
|
7893
7881
|
);
|
|
7894
7882
|
const isDappImportWalletHydrating = Boolean(
|
|
7895
7883
|
hasWalletClientProp && walletClientProp === void 0 || walletSession && !hasReownSession && !walletSession.isReady
|
|
@@ -7911,10 +7899,10 @@ function DepositFlow({
|
|
|
7911
7899
|
]);
|
|
7912
7900
|
const setupChainId = typeof targetChain === "number" && !_chunkFKJ6EJHHcjs.isVirtualDestination.call(void 0, targetChain) ? targetChain : typeof defaultSourceChain === "number" ? defaultSourceChain : DEFAULT_SETUP_CHAIN_ID;
|
|
7913
7901
|
const targetChainId = _chunkFKJ6EJHHcjs.targetChainToChainId.call(void 0, targetChain);
|
|
7914
|
-
const targetDisplay =
|
|
7902
|
+
const targetDisplay = _chunk4O2UGFFTcjs.useTokenDisplay.call(void 0, targetChainId, targetToken);
|
|
7915
7903
|
const targetSymbol = targetDisplay.symbol;
|
|
7916
7904
|
const isTargetStablecoin = _chunkFKJ6EJHHcjs.isStablecoinSymbol.call(void 0, targetSymbol);
|
|
7917
|
-
const assetStore =
|
|
7905
|
+
const assetStore = _chunk4O2UGFFTcjs.useAssetStore.call(void 0, );
|
|
7918
7906
|
const targetMarketPriceRef = _react.useRef.call(void 0, null);
|
|
7919
7907
|
_react.useEffect.call(void 0, () => {
|
|
7920
7908
|
targetMarketPriceRef.current = null;
|
|
@@ -7933,11 +7921,11 @@ function DepositFlow({
|
|
|
7933
7921
|
return null;
|
|
7934
7922
|
}
|
|
7935
7923
|
if (canAutoLock) {
|
|
7936
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess',
|
|
7924
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess', _271 => _271.chain, 'optionalAccess', _272 => _272.id]), () => ( setupChainId));
|
|
7937
7925
|
return {
|
|
7938
7926
|
ownerAddress: walletClientProp.account.address,
|
|
7939
7927
|
walletClient: walletClientProp,
|
|
7940
|
-
publicClient: _nullishCoalesce(publicClientProp, () => (
|
|
7928
|
+
publicClient: _nullishCoalesce(publicClientProp, () => ( _chunk4O2UGFFTcjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
|
|
7941
7929
|
switchChain: dappSwitchChain
|
|
7942
7930
|
};
|
|
7943
7931
|
}
|
|
@@ -7949,20 +7937,20 @@ function DepositFlow({
|
|
|
7949
7937
|
if (selectedOption.kind === "solana") {
|
|
7950
7938
|
return null;
|
|
7951
7939
|
}
|
|
7952
|
-
if (selectedOption.kind === "connected" && _optionalChain([walletClientProp, 'optionalAccess',
|
|
7953
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess',
|
|
7940
|
+
if (selectedOption.kind === "connected" && _optionalChain([walletClientProp, 'optionalAccess', _273 => _273.account]) && selectedOption.address && walletClientProp.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
7941
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess', _274 => _274.chain, 'optionalAccess', _275 => _275.id]), () => ( setupChainId));
|
|
7954
7942
|
return {
|
|
7955
7943
|
ownerAddress: walletClientProp.account.address,
|
|
7956
7944
|
walletClient: walletClientProp,
|
|
7957
|
-
publicClient: _nullishCoalesce(publicClientProp, () => (
|
|
7945
|
+
publicClient: _nullishCoalesce(publicClientProp, () => ( _chunk4O2UGFFTcjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
|
|
7958
7946
|
switchChain: dappSwitchChain
|
|
7959
7947
|
};
|
|
7960
7948
|
}
|
|
7961
|
-
if (selectedOption.kind === "external" && _optionalChain([walletSession, 'optionalAccess',
|
|
7949
|
+
if (selectedOption.kind === "external" && _optionalChain([walletSession, 'optionalAccess', _276 => _276.address]) && selectedOption.address && walletSession.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
7962
7950
|
return {
|
|
7963
7951
|
ownerAddress: walletSession.address,
|
|
7964
7952
|
walletClient: walletSession.walletClient,
|
|
7965
|
-
publicClient: _nullishCoalesce(walletSession.publicClient, () => (
|
|
7953
|
+
publicClient: _nullishCoalesce(walletSession.publicClient, () => ( _chunk4O2UGFFTcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
|
|
7966
7954
|
switchChain: walletSession.switchChain
|
|
7967
7955
|
};
|
|
7968
7956
|
}
|
|
@@ -7984,7 +7972,7 @@ function DepositFlow({
|
|
|
7984
7972
|
// nothing else here when the host switches chain, and the context would go
|
|
7985
7973
|
// on holding a client bound to the old one: `chainMismatch` never clears
|
|
7986
7974
|
// and the CTA stays disabled with nothing beside it.
|
|
7987
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7975
|
+
_optionalChain([walletSession, 'optionalAccess', _277 => _277.walletClient]),
|
|
7988
7976
|
setupChainId,
|
|
7989
7977
|
rpcUrls
|
|
7990
7978
|
]);
|
|
@@ -8024,35 +8012,35 @@ function DepositFlow({
|
|
|
8024
8012
|
const selectedEvmWalletOwner = _react.useMemo.call(void 0, () => {
|
|
8025
8013
|
if (!selectedWalletId) return null;
|
|
8026
8014
|
const opt = walletOptions.find((o) => o.id === selectedWalletId);
|
|
8027
|
-
if (_optionalChain([opt, 'optionalAccess',
|
|
8015
|
+
if (_optionalChain([opt, 'optionalAccess', _278 => _278.kind]) === "external" && opt.address) {
|
|
8028
8016
|
return opt.address;
|
|
8029
8017
|
}
|
|
8030
|
-
if (_optionalChain([opt, 'optionalAccess',
|
|
8018
|
+
if (_optionalChain([opt, 'optionalAccess', _279 => _279.kind]) === "connected" && opt.address) {
|
|
8031
8019
|
return opt.address;
|
|
8032
8020
|
}
|
|
8033
8021
|
return null;
|
|
8034
8022
|
}, [selectedWalletId, walletOptions]);
|
|
8035
8023
|
const dappImportOwner = _react.useMemo.call(void 0, () => {
|
|
8036
8024
|
if (selectedEvmWalletOwner) return selectedEvmWalletOwner;
|
|
8037
|
-
if (_optionalChain([walletSession, 'optionalAccess',
|
|
8025
|
+
if (_optionalChain([walletSession, 'optionalAccess', _280 => _280.address]) && walletSession.isConnected) {
|
|
8038
8026
|
return walletSession.address;
|
|
8039
8027
|
}
|
|
8040
8028
|
if (connectedWalletAddress) return connectedWalletAddress;
|
|
8041
8029
|
return null;
|
|
8042
8030
|
}, [
|
|
8043
8031
|
selectedEvmWalletOwner,
|
|
8044
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
8045
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
8032
|
+
_optionalChain([walletSession, 'optionalAccess', _281 => _281.address]),
|
|
8033
|
+
_optionalChain([walletSession, 'optionalAccess', _282 => _282.isConnected]),
|
|
8046
8034
|
connectedWalletAddress
|
|
8047
8035
|
]);
|
|
8048
8036
|
const activeOwner = _react.useMemo.call(void 0,
|
|
8049
8037
|
() => resolveOwnerForMode(flowMode, {
|
|
8050
|
-
walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess',
|
|
8038
|
+
walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _283 => _283.ownerAddress]), () => ( (canAutoLock ? connectedWalletAddress : selectedEvmWalletOwner))),
|
|
8051
8039
|
dappImportOwner
|
|
8052
8040
|
}),
|
|
8053
8041
|
[
|
|
8054
8042
|
flowMode,
|
|
8055
|
-
_optionalChain([signerContext, 'optionalAccess',
|
|
8043
|
+
_optionalChain([signerContext, 'optionalAccess', _284 => _284.ownerAddress]),
|
|
8056
8044
|
canAutoLock,
|
|
8057
8045
|
connectedWalletAddress,
|
|
8058
8046
|
selectedEvmWalletOwner,
|
|
@@ -8069,7 +8057,7 @@ function DepositFlow({
|
|
|
8069
8057
|
].join(":");
|
|
8070
8058
|
if (lastSmartAccountLifecycleKeyRef.current === lifecycleKey) return;
|
|
8071
8059
|
lastSmartAccountLifecycleKeyRef.current = lifecycleKey;
|
|
8072
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
8060
|
+
_optionalChain([onLifecycleRef, 'access', _285 => _285.current, 'optionalCall', _286 => _286({
|
|
8073
8061
|
type: "smart-account-changed",
|
|
8074
8062
|
evm: activeEntry.smartAccount,
|
|
8075
8063
|
solana: _nullishCoalesce(activeEntry.solanaDepositAddress, () => ( null))
|
|
@@ -8097,7 +8085,7 @@ function DepositFlow({
|
|
|
8097
8085
|
return;
|
|
8098
8086
|
}
|
|
8099
8087
|
lastConnectedLifecycleKeyRef.current = lifecycleKey;
|
|
8100
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
8088
|
+
_optionalChain([onLifecycleRef, 'access', _287 => _287.current, 'optionalCall', _288 => _288({
|
|
8101
8089
|
type: "connected",
|
|
8102
8090
|
address: activeOwner,
|
|
8103
8091
|
smartAccount: activeEntry.smartAccount
|
|
@@ -8170,7 +8158,7 @@ function DepositFlow({
|
|
|
8170
8158
|
const handleWalletDisconnect = _react.useCallback.call(void 0, () => {
|
|
8171
8159
|
analytics.abandon("wallet_disconnect");
|
|
8172
8160
|
analytics.resetAttempt();
|
|
8173
|
-
_optionalChain([onDisconnect, 'optionalCall',
|
|
8161
|
+
_optionalChain([onDisconnect, 'optionalCall', _289 => _289()]);
|
|
8174
8162
|
storeApi.dispatch({
|
|
8175
8163
|
type: "back/requested",
|
|
8176
8164
|
hasWalletOptions: hasWalletOptions || Boolean(walletSession)
|
|
@@ -8209,7 +8197,7 @@ function DepositFlow({
|
|
|
8209
8197
|
const currentBackHandler = canGoBackFromHere ? handleBack : void 0;
|
|
8210
8198
|
const currentScreen = showConnectStep ? "connect" : effectiveStep.type;
|
|
8211
8199
|
_react.useEffect.call(void 0, () => {
|
|
8212
|
-
_optionalChain([onStepChangeRef, 'access',
|
|
8200
|
+
_optionalChain([onStepChangeRef, 'access', _290 => _290.current, 'optionalCall', _291 => _291(currentBackHandler, currentScreen)]);
|
|
8213
8201
|
}, [currentBackHandler, currentScreen, onStepChangeRef]);
|
|
8214
8202
|
const lastModalHeightRef = _react.useRef.call(void 0, 0);
|
|
8215
8203
|
const modalContentElRef = _react.useRef.call(void 0, null);
|
|
@@ -8219,7 +8207,7 @@ function DepositFlow({
|
|
|
8219
8207
|
modalContentElRef.current = mc;
|
|
8220
8208
|
const ro = new ResizeObserver((entries) => {
|
|
8221
8209
|
for (const entry of entries) {
|
|
8222
|
-
const border = _optionalChain([entry, 'access',
|
|
8210
|
+
const border = _optionalChain([entry, 'access', _292 => _292.borderBoxSize, 'optionalAccess', _293 => _293[0], 'optionalAccess', _294 => _294.blockSize]);
|
|
8223
8211
|
lastModalHeightRef.current = typeof border === "number" ? border : entry.contentRect.height;
|
|
8224
8212
|
}
|
|
8225
8213
|
});
|
|
@@ -8280,7 +8268,7 @@ function DepositFlow({
|
|
|
8280
8268
|
targetToken
|
|
8281
8269
|
]);
|
|
8282
8270
|
_react.useEffect.call(void 0, () => {
|
|
8283
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
8271
|
+
_optionalChain([onLifecycleRef, 'access', _295 => _295.current, 'optionalCall', _296 => _296({
|
|
8284
8272
|
type: "balance-changed",
|
|
8285
8273
|
totalUsd: totalBalanceUsd
|
|
8286
8274
|
})]);
|
|
@@ -8297,9 +8285,9 @@ function DepositFlow({
|
|
|
8297
8285
|
const handleConfirmWallet = _react.useCallback.call(void 0,
|
|
8298
8286
|
(walletId) => {
|
|
8299
8287
|
const selectedOption = walletOptions.find((o) => o.id === walletId);
|
|
8300
|
-
const mode = _optionalChain([selectedOption, 'optionalAccess',
|
|
8288
|
+
const mode = _optionalChain([selectedOption, 'optionalAccess', _297 => _297.kind]) === "solana" ? "solana-wallet" : "wallet";
|
|
8301
8289
|
analytics.selectMethod("wallet", "user", {
|
|
8302
|
-
network: _optionalChain([selectedOption, 'optionalAccess',
|
|
8290
|
+
network: _optionalChain([selectedOption, 'optionalAccess', _298 => _298.kind]) === "solana" ? "solana" : "evm",
|
|
8303
8291
|
integration: _nullishCoalesce(walletIntegration, () => ( "none"))
|
|
8304
8292
|
});
|
|
8305
8293
|
storeApi.dispatch({
|
|
@@ -8311,7 +8299,7 @@ function DepositFlow({
|
|
|
8311
8299
|
[analytics, walletIntegration, walletOptions, storeApi]
|
|
8312
8300
|
);
|
|
8313
8301
|
const isSolanaWalletConnected = Boolean(
|
|
8314
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
8302
|
+
_optionalChain([walletSession, 'optionalAccess', _299 => _299.isConnected]) && _optionalChain([walletSession, 'optionalAccess', _300 => _300.isSolana])
|
|
8315
8303
|
);
|
|
8316
8304
|
const assetMigrationsKey = assetMigrations ? Object.keys(assetMigrations).filter((k) => assetMigrations[k]).sort().join(",") : "";
|
|
8317
8305
|
const enabledDappImportProviders = _react.useMemo.call(void 0,
|
|
@@ -8330,7 +8318,7 @@ function DepositFlow({
|
|
|
8330
8318
|
const owner = dappImportOwner;
|
|
8331
8319
|
if (owner) {
|
|
8332
8320
|
const wallet = walletOptions.find(
|
|
8333
|
-
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess',
|
|
8321
|
+
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _301 => _301.toLowerCase, 'call', _302 => _302()]) === owner.toLowerCase()
|
|
8334
8322
|
);
|
|
8335
8323
|
if (wallet) {
|
|
8336
8324
|
storeApi.dispatch({
|
|
@@ -8374,7 +8362,7 @@ function DepositFlow({
|
|
|
8374
8362
|
eoa: dappImportOwner,
|
|
8375
8363
|
getPublicClient: (chainId) => {
|
|
8376
8364
|
try {
|
|
8377
|
-
return
|
|
8365
|
+
return _chunk4O2UGFFTcjs.getPublicClient.call(void 0, chainId, rpcUrls);
|
|
8378
8366
|
} catch (e41) {
|
|
8379
8367
|
return null;
|
|
8380
8368
|
}
|
|
@@ -8432,7 +8420,7 @@ function DepositFlow({
|
|
|
8432
8420
|
const storedDappImportAvailability = useDepositStore(
|
|
8433
8421
|
(s) => s.dappImport.availability
|
|
8434
8422
|
);
|
|
8435
|
-
const isExcludedByRestrictedList =
|
|
8423
|
+
const isExcludedByRestrictedList = _chunk4O2UGFFTcjs.useRestrictedListExclusion.call(void 0, );
|
|
8436
8424
|
const dappImportAvailability = _react.useMemo.call(void 0,
|
|
8437
8425
|
() => narrowDappImportAvailability(
|
|
8438
8426
|
storedDappImportAvailability,
|
|
@@ -8487,7 +8475,7 @@ function DepositFlow({
|
|
|
8487
8475
|
}, [activeDappImportProviderId, enabledDappImportProviders]);
|
|
8488
8476
|
const activeDappImportAvailability = _react.useMemo.call(void 0, () => {
|
|
8489
8477
|
if (!activeDappImportProviderId) return null;
|
|
8490
|
-
if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess',
|
|
8478
|
+
if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _303 => _303.toLowerCase, 'call', _304 => _304()]) !== dappImportOwner.toLowerCase()) {
|
|
8491
8479
|
return null;
|
|
8492
8480
|
}
|
|
8493
8481
|
const entry = dappImportAvailability[activeDappImportProviderId];
|
|
@@ -8530,7 +8518,7 @@ function DepositFlow({
|
|
|
8530
8518
|
setup: setupSlice
|
|
8531
8519
|
});
|
|
8532
8520
|
const pinnableWallet = dappImportOwner ? _nullishCoalesce(walletOptions.find(
|
|
8533
|
-
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess',
|
|
8521
|
+
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _305 => _305.toLowerCase, 'call', _306 => _306()]) === dappImportOwner.toLowerCase()
|
|
8534
8522
|
), () => ( null)) : null;
|
|
8535
8523
|
const outcome = resolveBootOutcome({
|
|
8536
8524
|
status,
|
|
@@ -8577,7 +8565,7 @@ function DepositFlow({
|
|
|
8577
8565
|
if (dappImportOwner) {
|
|
8578
8566
|
const plan = bootRetryPlan({
|
|
8579
8567
|
setupStatus: snapshot.setup.status,
|
|
8580
|
-
availabilityEntry: _optionalChain([snapshot, 'access',
|
|
8568
|
+
availabilityEntry: _optionalChain([snapshot, 'access', _307 => _307.dappImport, 'access', _308 => _308.availabilityOwner, 'optionalAccess', _309 => _309.toLowerCase, 'call', _310 => _310()]) === dappImportOwner.toLowerCase() ? snapshot.dappImport.availability[providerId] : void 0
|
|
8581
8569
|
});
|
|
8582
8570
|
if (plan.restartSetup) {
|
|
8583
8571
|
storeApi.dispatch({ type: "setup/retry-requested" });
|
|
@@ -8594,15 +8582,17 @@ function DepositFlow({
|
|
|
8594
8582
|
});
|
|
8595
8583
|
}, [analytics, storeApi, dappImportOwner]);
|
|
8596
8584
|
const handleSelectFiatMethod = _react.useCallback.call(void 0,
|
|
8597
|
-
(paymentMethod, methodSelectionSource) => {
|
|
8585
|
+
(paymentMethod, methodSelectionSource, provider = "swapped") => {
|
|
8598
8586
|
analytics.selectMethod("fiat_onramp", "user", {
|
|
8599
8587
|
payment_method: paymentMethod,
|
|
8600
|
-
source: methodSelectionSource
|
|
8588
|
+
source: methodSelectionSource,
|
|
8589
|
+
provider
|
|
8601
8590
|
});
|
|
8602
8591
|
storeApi.dispatch({
|
|
8603
8592
|
type: "connect/fiat-onramp-selected",
|
|
8604
8593
|
paymentMethod,
|
|
8605
|
-
methodSelectionSource
|
|
8594
|
+
methodSelectionSource,
|
|
8595
|
+
provider
|
|
8606
8596
|
});
|
|
8607
8597
|
},
|
|
8608
8598
|
[analytics, storeApi]
|
|
@@ -8651,7 +8641,7 @@ function DepositFlow({
|
|
|
8651
8641
|
})
|
|
8652
8642
|
}));
|
|
8653
8643
|
const currentAccount = storeApi.getState().setup.smartAccount;
|
|
8654
|
-
if (_optionalChain([currentAccount, 'optionalAccess',
|
|
8644
|
+
if (_optionalChain([currentAccount, 'optionalAccess', _311 => _311.toLowerCase, 'call', _312 => _312()]) !== owner) {
|
|
8655
8645
|
swappedConnectUrlRef.current.delete(key);
|
|
8656
8646
|
throw new Error("Deposit account changed. Select your exchange again.");
|
|
8657
8647
|
}
|
|
@@ -8671,7 +8661,7 @@ function DepositFlow({
|
|
|
8671
8661
|
const key = `${smartAccount.toLowerCase()}:${connection}`;
|
|
8672
8662
|
const entry = swappedConnectUrlRef.current.get(key);
|
|
8673
8663
|
swappedConnectUrlRef.current.delete(key);
|
|
8674
|
-
return _optionalChain([entry, 'optionalAccess',
|
|
8664
|
+
return _optionalChain([entry, 'optionalAccess', _313 => _313.smartAccount]) === smartAccount.toLowerCase() ? entry.response : service.getSwappedConnectUrl({ smartAccount, connection });
|
|
8675
8665
|
},
|
|
8676
8666
|
[service]
|
|
8677
8667
|
);
|
|
@@ -8732,6 +8722,26 @@ function DepositFlow({
|
|
|
8732
8722
|
swappedConnectUrlRef.current.clear();
|
|
8733
8723
|
}, [setupSlice.smartAccount]);
|
|
8734
8724
|
const hasConfiguredFiatMethods = fiatMethods !== void 0;
|
|
8725
|
+
const [providers, setProviders] = _react.useState.call(void 0, "loading");
|
|
8726
|
+
_react.useEffect.call(void 0, () => {
|
|
8727
|
+
if (!enableFiatOnramp && !bankOnrampEnabled && !enableExchangeConnect) {
|
|
8728
|
+
return;
|
|
8729
|
+
}
|
|
8730
|
+
let settled = false;
|
|
8731
|
+
const settle = (list) => {
|
|
8732
|
+
if (settled) return;
|
|
8733
|
+
settled = true;
|
|
8734
|
+
clearTimeout(timer);
|
|
8735
|
+
setProviders(list);
|
|
8736
|
+
};
|
|
8737
|
+
setProviders("loading");
|
|
8738
|
+
const timer = setTimeout(() => settle(null), REGIONAL_METHODS_TIMEOUT_MS);
|
|
8739
|
+
void service.getOnrampProviders().then(settle);
|
|
8740
|
+
return () => {
|
|
8741
|
+
settled = true;
|
|
8742
|
+
clearTimeout(timer);
|
|
8743
|
+
};
|
|
8744
|
+
}, [bankOnrampEnabled, enableExchangeConnect, enableFiatOnramp, service]);
|
|
8735
8745
|
const [regionalMethods, setRegionalMethods] = _react.useState.call(void 0, {
|
|
8736
8746
|
status: "loading",
|
|
8737
8747
|
country: null,
|
|
@@ -8778,46 +8788,51 @@ function DepositFlow({
|
|
|
8778
8788
|
clearTimeout(timeoutTimer);
|
|
8779
8789
|
};
|
|
8780
8790
|
}, [analytics, enableFiatOnramp, hasConfiguredFiatMethods, service]);
|
|
8781
|
-
const
|
|
8782
|
-
() =>
|
|
8791
|
+
const swappedMethods = _react.useMemo.call(void 0,
|
|
8792
|
+
() => hasConfiguredFiatMethods ? {
|
|
8783
8793
|
kind: "list",
|
|
8784
8794
|
methods: configuredFiatMethods,
|
|
8785
|
-
recommendedMethod: _nullishCoalesce(_optionalChain([configuredFiatMethods, 'access',
|
|
8795
|
+
recommendedMethod: _nullishCoalesce(_optionalChain([configuredFiatMethods, 'access', _314 => _314[0], 'optionalAccess', _315 => _315.method]), () => ( "bank-transfer")),
|
|
8786
8796
|
country: null,
|
|
8787
8797
|
source: "configured"
|
|
8788
8798
|
} : composeFiatMethods(regionalMethods, FIAT_ONRAMP_METHODS),
|
|
8799
|
+
[configuredFiatMethods, hasConfiguredFiatMethods, regionalMethods]
|
|
8800
|
+
);
|
|
8801
|
+
const [noahNotServedFor, setNoahNotServedFor] = _react.useState.call(void 0, null);
|
|
8802
|
+
const noahNotServed = noahNotServedFor !== null && noahNotServedFor === _optionalChain([setupSlice, 'access', _316 => _316.smartAccount, 'optionalAccess', _317 => _317.toLowerCase, 'call', _318 => _318()]);
|
|
8803
|
+
const rampRowInputs = _react.useMemo.call(void 0,
|
|
8804
|
+
() => ({
|
|
8805
|
+
enableFiatOnramp,
|
|
8806
|
+
virtualAccounts: Boolean(virtualAccountOnramp),
|
|
8807
|
+
customerSession: Boolean(getCustomerSession),
|
|
8808
|
+
bankTransferAllowed: fiatMethods === void 0 || fiatMethods["bank-transfer"] === true,
|
|
8809
|
+
enableExchangeConnect,
|
|
8810
|
+
providers,
|
|
8811
|
+
swappedMethods,
|
|
8812
|
+
bankRow: FIAT_ONRAMP_METHODS.find(({ method }) => method === "bank-transfer"),
|
|
8813
|
+
noahNotServed
|
|
8814
|
+
}),
|
|
8789
8815
|
[
|
|
8790
|
-
|
|
8816
|
+
enableExchangeConnect,
|
|
8791
8817
|
enableFiatOnramp,
|
|
8792
|
-
|
|
8793
|
-
|
|
8818
|
+
fiatMethods,
|
|
8819
|
+
getCustomerSession,
|
|
8820
|
+
noahNotServed,
|
|
8821
|
+
providers,
|
|
8822
|
+
swappedMethods,
|
|
8823
|
+
virtualAccountOnramp
|
|
8794
8824
|
]
|
|
8795
8825
|
);
|
|
8796
|
-
const
|
|
8797
|
-
const
|
|
8798
|
-
const
|
|
8799
|
-
|
|
8800
|
-
|
|
8801
|
-
|
|
8802
|
-
|
|
8803
|
-
|
|
8804
|
-
|
|
8805
|
-
|
|
8806
|
-
if (!bankRowOffered || swappedDisplay.kind === "loading") {
|
|
8807
|
-
return swappedDisplay;
|
|
8808
|
-
}
|
|
8809
|
-
if (swappedOffersBank) return swappedDisplay;
|
|
8810
|
-
const bankTransfer = FIAT_ONRAMP_METHODS.find(
|
|
8811
|
-
({ method }) => method === "bank-transfer"
|
|
8812
|
-
);
|
|
8813
|
-
return {
|
|
8814
|
-
kind: "list",
|
|
8815
|
-
methods: swappedDisplay.kind === "list" ? [...swappedDisplay.methods, bankTransfer] : [bankTransfer],
|
|
8816
|
-
recommendedMethod: swappedDisplay.kind === "list" ? swappedDisplay.recommendedMethod : bankTransfer.method,
|
|
8817
|
-
country: swappedDisplay.kind === "list" ? swappedDisplay.country : null,
|
|
8818
|
-
source: swappedDisplay.kind === "list" ? swappedDisplay.source : "configured"
|
|
8819
|
-
};
|
|
8820
|
-
}, [bankRowOffered, swappedCashDisplay, swappedOffersBank]);
|
|
8826
|
+
const rampRows = _react.useMemo.call(void 0, () => resolveRampRows(rampRowInputs), [rampRowInputs]);
|
|
8827
|
+
const cashDisplay = rampRows.cash;
|
|
8828
|
+
const handleNoahNotServed = _react.useCallback.call(void 0,
|
|
8829
|
+
(smartAccount) => {
|
|
8830
|
+
setNoahNotServedFor(smartAccount.toLowerCase());
|
|
8831
|
+
const after = resolveRampRows({ ...rampRowInputs, noahNotServed: true });
|
|
8832
|
+
if (after.notice) handleProviderBack();
|
|
8833
|
+
},
|
|
8834
|
+
[handleProviderBack, rampRowInputs]
|
|
8835
|
+
);
|
|
8821
8836
|
_react.useEffect.call(void 0, () => {
|
|
8822
8837
|
if (cashDisplay.kind === "hidden" && fiatEnabled) {
|
|
8823
8838
|
analytics.friction(
|
|
@@ -8832,25 +8847,28 @@ function DepositFlow({
|
|
|
8832
8847
|
}
|
|
8833
8848
|
}, [analytics, cashDisplay, fiatEnabled, hasConfiguredFiatMethods]);
|
|
8834
8849
|
const displayedFiatSource = cashDisplay.kind === "list" ? cashDisplay.source : void 0;
|
|
8850
|
+
const providerOf = _react.useCallback.call(void 0,
|
|
8851
|
+
(method) => cashDisplay.kind === "list" && _optionalChain([cashDisplay, 'access', _319 => _319.methods, 'access', _320 => _320.find, 'call', _321 => _321((m) => m.method === method), 'optionalAccess', _322 => _322.provider]) || "swapped",
|
|
8852
|
+
[cashDisplay]
|
|
8853
|
+
);
|
|
8835
8854
|
const handleSelectDisplayedFiatMethod = _react.useCallback.call(void 0,
|
|
8836
8855
|
(method) => {
|
|
8837
8856
|
if (!displayedFiatSource) return;
|
|
8838
|
-
handleSelectFiatMethod(method, displayedFiatSource);
|
|
8857
|
+
handleSelectFiatMethod(method, displayedFiatSource, providerOf(method));
|
|
8839
8858
|
},
|
|
8840
|
-
[displayedFiatSource, handleSelectFiatMethod]
|
|
8859
|
+
[displayedFiatSource, handleSelectFiatMethod, providerOf]
|
|
8841
8860
|
);
|
|
8842
8861
|
const handlePrefetchDisplayedFiatMethod = _react.useCallback.call(void 0,
|
|
8843
8862
|
(method) => {
|
|
8844
|
-
if (!displayedFiatSource) return;
|
|
8845
|
-
if (bankRowOffered && method === "bank-transfer") return;
|
|
8863
|
+
if (!displayedFiatSource || providerOf(method) !== "swapped") return;
|
|
8846
8864
|
handlePrefetchFiatMethod(method, displayedFiatSource);
|
|
8847
8865
|
},
|
|
8848
|
-
[
|
|
8866
|
+
[displayedFiatSource, handlePrefetchFiatMethod, providerOf]
|
|
8849
8867
|
);
|
|
8850
8868
|
const handleNewDeposit = _react.useCallback.call(void 0, () => {
|
|
8851
8869
|
analytics.completeStep();
|
|
8852
8870
|
analytics.resetAttempt();
|
|
8853
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
8871
|
+
_optionalChain([onLifecycleRef, 'access', _323 => _323.current, 'optionalCall', _324 => _324({
|
|
8854
8872
|
type: "smart-account-changed",
|
|
8855
8873
|
evm: null,
|
|
8856
8874
|
solana: null
|
|
@@ -8882,17 +8900,17 @@ function DepositFlow({
|
|
|
8882
8900
|
payment
|
|
8883
8901
|
]
|
|
8884
8902
|
);
|
|
8885
|
-
const desiredSetupRequestKey =
|
|
8903
|
+
const desiredSetupRequestKey = _chunk4O2UGFFTcjs.computeRequestKey.call(void 0, setupInput);
|
|
8886
8904
|
const setupReady = setupSlice.status === "ready" && setupSlice.requestKey === desiredSetupRequestKey;
|
|
8887
8905
|
_react.useEffect.call(void 0, () => {
|
|
8888
8906
|
void (async () => {
|
|
8889
|
-
const requestKey =
|
|
8890
|
-
const cacheKey =
|
|
8891
|
-
const cacheable =
|
|
8907
|
+
const requestKey = _chunk4O2UGFFTcjs.computeRequestKey.call(void 0, setupInput);
|
|
8908
|
+
const cacheKey = _chunk4O2UGFFTcjs.computeCacheKey.call(void 0, setupInput);
|
|
8909
|
+
const cacheable = _chunk4O2UGFFTcjs.computeIsCacheable.call(void 0, setupInput);
|
|
8892
8910
|
if (storeApi.getState().setup.requestKey === requestKey) {
|
|
8893
8911
|
return;
|
|
8894
8912
|
}
|
|
8895
|
-
const dedupedResult =
|
|
8913
|
+
const dedupedResult = _chunk4O2UGFFTcjs.readDedupedAccountSetupResult.call(void 0, requestKey);
|
|
8896
8914
|
if (dedupedResult) {
|
|
8897
8915
|
storeApi.dispatch({
|
|
8898
8916
|
type: "setup/started",
|
|
@@ -8918,7 +8936,7 @@ function DepositFlow({
|
|
|
8918
8936
|
cacheable
|
|
8919
8937
|
});
|
|
8920
8938
|
try {
|
|
8921
|
-
const result = await
|
|
8939
|
+
const result = await _chunk4O2UGFFTcjs.runAccountSetupDeduped.call(void 0,
|
|
8922
8940
|
setupInput,
|
|
8923
8941
|
{ service, debug },
|
|
8924
8942
|
requestKey
|
|
@@ -8933,7 +8951,7 @@ function DepositFlow({
|
|
|
8933
8951
|
}
|
|
8934
8952
|
});
|
|
8935
8953
|
} catch (error) {
|
|
8936
|
-
const message = error instanceof
|
|
8954
|
+
const message = error instanceof _chunk4O2UGFFTcjs.SetupError ? error.message : "Deposit service is temporarily unavailable. Please try again shortly.";
|
|
8937
8955
|
storeApi.dispatch({
|
|
8938
8956
|
type: "setup/failed",
|
|
8939
8957
|
requestKey,
|
|
@@ -8965,11 +8983,11 @@ function DepositFlow({
|
|
|
8965
8983
|
return;
|
|
8966
8984
|
}
|
|
8967
8985
|
storeApi.dispatch({ type: "portfolio/loading", network, address });
|
|
8968
|
-
const requestId = _optionalChain([readPortfolioEntry, 'call',
|
|
8986
|
+
const requestId = _optionalChain([readPortfolioEntry, 'call', _325 => _325(
|
|
8969
8987
|
storeApi.getState().portfolio,
|
|
8970
8988
|
network,
|
|
8971
8989
|
address
|
|
8972
|
-
), 'optionalAccess',
|
|
8990
|
+
), 'optionalAccess', _326 => _326.requestId]);
|
|
8973
8991
|
if (requestId === void 0) return;
|
|
8974
8992
|
void (async () => {
|
|
8975
8993
|
try {
|
|
@@ -8982,7 +9000,7 @@ function DepositFlow({
|
|
|
8982
9000
|
address,
|
|
8983
9001
|
requestId,
|
|
8984
9002
|
totalUsd: portfolio.totalUsd,
|
|
8985
|
-
chainIds:
|
|
9003
|
+
chainIds: _chunk4O2UGFFTcjs.chainIdsByValue.call(void 0, portfolio.tokens)
|
|
8986
9004
|
});
|
|
8987
9005
|
} catch (e42) {
|
|
8988
9006
|
storeApi.dispatch({
|
|
@@ -9006,7 +9024,7 @@ function DepositFlow({
|
|
|
9006
9024
|
{ type: "transaction_hash", value: data.txHash },
|
|
9007
9025
|
"transfer_tracking"
|
|
9008
9026
|
);
|
|
9009
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
9027
|
+
_optionalChain([onLifecycleRef, 'access', _327 => _327.current, 'optionalCall', _328 => _328({ type: "submitted", ...data })]);
|
|
9010
9028
|
},
|
|
9011
9029
|
[analytics, logFlow, onLifecycleRef]
|
|
9012
9030
|
);
|
|
@@ -9073,7 +9091,7 @@ function DepositFlow({
|
|
|
9073
9091
|
sourceDecimals: tokenAtSubmit.decimals,
|
|
9074
9092
|
inputAmountUsd: amountUsd
|
|
9075
9093
|
});
|
|
9076
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
9094
|
+
_optionalChain([onLifecycleRef, 'access', _329 => _329.current, 'optionalCall', _330 => _330({
|
|
9077
9095
|
type: "submitted",
|
|
9078
9096
|
txHash,
|
|
9079
9097
|
sourceChain: "solana",
|
|
@@ -9164,8 +9182,8 @@ function DepositFlow({
|
|
|
9164
9182
|
sourceChain: chainId,
|
|
9165
9183
|
sourceToken: token,
|
|
9166
9184
|
amount,
|
|
9167
|
-
sourceSymbol: _optionalChain([asset, 'optionalAccess',
|
|
9168
|
-
sourceDecimals: _optionalChain([asset, 'optionalAccess',
|
|
9185
|
+
sourceSymbol: _optionalChain([asset, 'optionalAccess', _331 => _331.symbol]),
|
|
9186
|
+
sourceDecimals: _optionalChain([asset, 'optionalAccess', _332 => _332.decimals]),
|
|
9169
9187
|
inputAmountUsd: _nullishCoalesce(depositAtSubmit.inputAmountUsd, () => ( void 0)),
|
|
9170
9188
|
directTransfer: routed.directTransfer,
|
|
9171
9189
|
sourceTxHashPending: routed.sourceTxHashPending,
|
|
@@ -9206,7 +9224,7 @@ function DepositFlow({
|
|
|
9206
9224
|
swappedContext,
|
|
9207
9225
|
initialEvent: info.initialEvent
|
|
9208
9226
|
});
|
|
9209
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
9227
|
+
_optionalChain([onLifecycleRef, 'access', _333 => _333.current, 'optionalCall', _334 => _334({
|
|
9210
9228
|
type: "submitted",
|
|
9211
9229
|
txHash: info.txHash,
|
|
9212
9230
|
sourceChain: SWAPPED_SOURCE_CHAIN,
|
|
@@ -9234,12 +9252,12 @@ function DepositFlow({
|
|
|
9234
9252
|
const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
|
|
9235
9253
|
(txHash, sourceChain, amount) => {
|
|
9236
9254
|
const depositAtSubmit = storeApi.getState().deposit;
|
|
9237
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
9255
|
+
_optionalChain([onLifecycleRef, 'access', _335 => _335.current, 'optionalCall', _336 => _336({
|
|
9238
9256
|
type: "submitted",
|
|
9239
9257
|
txHash,
|
|
9240
9258
|
sourceChain,
|
|
9241
9259
|
amount,
|
|
9242
|
-
sourceDecimals: _optionalChain([depositAtSubmit, 'access',
|
|
9260
|
+
sourceDecimals: _optionalChain([depositAtSubmit, 'access', _337 => _337.selectedAsset, 'optionalAccess', _338 => _338.decimals]),
|
|
9243
9261
|
amountUsd: _nullishCoalesce(depositAtSubmit.inputAmountUsd, () => ( void 0))
|
|
9244
9262
|
})]);
|
|
9245
9263
|
},
|
|
@@ -9252,7 +9270,7 @@ function DepositFlow({
|
|
|
9252
9270
|
analyticsStepForFlowStep(analyticsMethod, "processing")
|
|
9253
9271
|
);
|
|
9254
9272
|
analytics.outcome("completed");
|
|
9255
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
9273
|
+
_optionalChain([onLifecycleRef, 'access', _339 => _339.current, 'optionalCall', _340 => _340({
|
|
9256
9274
|
type: "complete",
|
|
9257
9275
|
txHash,
|
|
9258
9276
|
destinationTxHash,
|
|
@@ -9269,7 +9287,7 @@ function DepositFlow({
|
|
|
9269
9287
|
);
|
|
9270
9288
|
analytics.outcome("failed");
|
|
9271
9289
|
analytics.failure("processor_failed", false);
|
|
9272
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
9290
|
+
_optionalChain([onLifecycleRef, 'access', _341 => _341.current, 'optionalCall', _342 => _342({ type: "failed", txHash, error })]);
|
|
9273
9291
|
},
|
|
9274
9292
|
[analytics, analyticsMethod, logFlowError, onLifecycleRef]
|
|
9275
9293
|
);
|
|
@@ -9287,7 +9305,7 @@ function DepositFlow({
|
|
|
9287
9305
|
failureStep
|
|
9288
9306
|
);
|
|
9289
9307
|
}
|
|
9290
|
-
_optionalChain([onErrorRef, 'access',
|
|
9308
|
+
_optionalChain([onErrorRef, 'access', _343 => _343.current, 'optionalCall', _344 => _344({
|
|
9291
9309
|
message,
|
|
9292
9310
|
code,
|
|
9293
9311
|
...cause === void 0 ? {} : { cause }
|
|
@@ -9340,9 +9358,9 @@ function DepositFlow({
|
|
|
9340
9358
|
address: _nullishCoalesce(_nullishCoalesce(option.address, () => ( option.solanaAddress)), () => ( option.id)),
|
|
9341
9359
|
state,
|
|
9342
9360
|
errorReason: _nullishCoalesce(entry.message, () => ( void 0)),
|
|
9343
|
-
balanceStatus: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess',
|
|
9344
|
-
balanceUsd: _optionalChain([portfolioEntry, 'optionalAccess',
|
|
9345
|
-
balanceChainIds: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess',
|
|
9361
|
+
balanceStatus: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess', _345 => _345.status]), () => ( "loading")),
|
|
9362
|
+
balanceUsd: _optionalChain([portfolioEntry, 'optionalAccess', _346 => _346.status]) === "ready" ? portfolioEntry.totalUsd : null,
|
|
9363
|
+
balanceChainIds: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess', _347 => _347.chainIds]), () => ( []))
|
|
9346
9364
|
};
|
|
9347
9365
|
});
|
|
9348
9366
|
}, [enableWallet, walletOptions, setupSlice, portfolioSlice]);
|
|
@@ -9375,11 +9393,12 @@ function DepositFlow({
|
|
|
9375
9393
|
),
|
|
9376
9394
|
fiatPaymentMethods: cashDisplay.kind === "list" ? cashDisplay.methods : void 0,
|
|
9377
9395
|
fiatLoading: cashDisplay.kind === "loading",
|
|
9378
|
-
fiatNotice:
|
|
9396
|
+
fiatNotice: _nullishCoalesce(rampRows.notice, () => ( void 0)),
|
|
9379
9397
|
recommendedMethod: cashDisplay.kind === "list" ? cashDisplay.recommendedMethod : void 0,
|
|
9380
9398
|
onSelectFiatMethod: cashDisplay.kind === "list" ? handleSelectDisplayedFiatMethod : void 0,
|
|
9381
9399
|
onPrefetchFiatMethod: cashDisplay.kind === "list" ? handlePrefetchDisplayedFiatMethod : void 0,
|
|
9382
|
-
onSelectFundFromExchange:
|
|
9400
|
+
onSelectFundFromExchange: rampRows.exchange === "hidden" ? void 0 : () => handleSelectExchange(),
|
|
9401
|
+
fundFromExchangeLoading: rampRows.exchange === "loading",
|
|
9383
9402
|
onRequestConnect: enableWallet ? onRequestConnect : void 0,
|
|
9384
9403
|
onConnect: enableWallet ? onConnect : void 0,
|
|
9385
9404
|
onDisconnect,
|
|
@@ -9496,30 +9515,21 @@ function DepositFlow({
|
|
|
9496
9515
|
)
|
|
9497
9516
|
] });
|
|
9498
9517
|
}
|
|
9518
|
+
const rampCallbacks = {
|
|
9519
|
+
service,
|
|
9520
|
+
onSwappedComplete: handleSwappedComplete,
|
|
9521
|
+
onSwappedFailed: handleDepositFailed,
|
|
9522
|
+
onClose: () => _optionalChain([onClose, 'optionalCall', _348 => _348(openExternally ? "native_dismiss_request" : "header_button")]),
|
|
9523
|
+
onGoBack: handleProviderBack,
|
|
9524
|
+
onError: handleError,
|
|
9525
|
+
onAttemptConsumed: handleSwappedAttemptConsumed,
|
|
9526
|
+
onProviderHandoff: handleSwappedProviderHandoff,
|
|
9527
|
+
onRetry: handleSwappedRetry,
|
|
9528
|
+
onCancelled: () => analytics.outcome("cancelled"),
|
|
9529
|
+
onImmersiveChange: onSwappedImmersiveChange,
|
|
9530
|
+
openExternally
|
|
9531
|
+
};
|
|
9499
9532
|
if (isFiatOnrampMode) {
|
|
9500
|
-
const swappedStep = step.type === "fiat-onramp" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9501
|
-
FiatOnrampStep,
|
|
9502
|
-
{
|
|
9503
|
-
smartAccount: step.smartAccount,
|
|
9504
|
-
service,
|
|
9505
|
-
paymentMethod: step.paymentMethod,
|
|
9506
|
-
methodSelectionSource: step.methodSelectionSource,
|
|
9507
|
-
consumePrefetchedUrl: consumeSwappedWidgetUrlPrefetch,
|
|
9508
|
-
onSwappedComplete: handleSwappedComplete,
|
|
9509
|
-
onSwappedFailed: handleDepositFailed,
|
|
9510
|
-
onClose: () => _optionalChain([onClose, 'optionalCall', _342 => _342(
|
|
9511
|
-
openExternally ? "native_dismiss_request" : "header_button"
|
|
9512
|
-
)]),
|
|
9513
|
-
onGoBack: handleProviderBack,
|
|
9514
|
-
onError: handleError,
|
|
9515
|
-
onAttemptConsumed: handleSwappedAttemptConsumed,
|
|
9516
|
-
onProviderHandoff: handleSwappedProviderHandoff,
|
|
9517
|
-
onRetry: handleSwappedRetry,
|
|
9518
|
-
onCancelled: () => analytics.outcome("cancelled"),
|
|
9519
|
-
onImmersiveChange: onSwappedImmersiveChange,
|
|
9520
|
-
openExternally
|
|
9521
|
-
}
|
|
9522
|
-
) : null;
|
|
9523
9533
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
9524
9534
|
"div",
|
|
9525
9535
|
{
|
|
@@ -9534,23 +9544,28 @@ function DepositFlow({
|
|
|
9534
9544
|
onRetry: activeEntry.status === "error" ? () => handleRetrySetup() : void 0
|
|
9535
9545
|
}
|
|
9536
9546
|
),
|
|
9537
|
-
step.type === "fiat-onramp" &&
|
|
9538
|
-
|
|
9547
|
+
step.type === "fiat-onramp" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Suspense, { fallback: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AccountPreparingSkeleton, {}), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9548
|
+
RampOrderStep,
|
|
9539
9549
|
{
|
|
9540
|
-
|
|
9550
|
+
...rampCallbacks,
|
|
9541
9551
|
smartAccount: step.smartAccount,
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
|
|
9545
|
-
|
|
9546
|
-
|
|
9547
|
-
|
|
9548
|
-
|
|
9549
|
-
|
|
9552
|
+
order: step.provider === "noah" && !noahNotServed && getCustomerSession ? {
|
|
9553
|
+
flow: "funding_account",
|
|
9554
|
+
backendUrl,
|
|
9555
|
+
getCustomerSession,
|
|
9556
|
+
onJourney: onBankJourney,
|
|
9557
|
+
onUnavailable: () => handleNoahNotServed(step.smartAccount)
|
|
9558
|
+
} : {
|
|
9559
|
+
flow: "hosted",
|
|
9560
|
+
kind: "fiat",
|
|
9561
|
+
method: step.paymentMethod,
|
|
9562
|
+
methodSelectionSource: step.methodSelectionSource,
|
|
9563
|
+
consumePrefetchedUrl: consumeSwappedWidgetUrlPrefetch
|
|
9564
|
+
}
|
|
9565
|
+
}
|
|
9550
9566
|
) }),
|
|
9551
|
-
step.type === "fiat-onramp" && (!bankRowOffered || step.paymentMethod !== "bank-transfer") && swappedStep,
|
|
9552
9567
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9553
|
-
|
|
9568
|
+
_chunk4O2UGFFTcjs.ProcessingStep,
|
|
9554
9569
|
{
|
|
9555
9570
|
flowLabel: payment ? "payment" : void 0,
|
|
9556
9571
|
smartAccount: step.smartAccount,
|
|
@@ -9609,29 +9624,20 @@ function DepositFlow({
|
|
|
9609
9624
|
}
|
|
9610
9625
|
),
|
|
9611
9626
|
step.type === "exchange-connect" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9612
|
-
|
|
9627
|
+
RampOrderStep,
|
|
9613
9628
|
{
|
|
9629
|
+
...rampCallbacks,
|
|
9614
9630
|
smartAccount: step.smartAccount,
|
|
9615
|
-
|
|
9616
|
-
|
|
9617
|
-
|
|
9618
|
-
|
|
9619
|
-
|
|
9620
|
-
|
|
9621
|
-
openExternally ? "native_dismiss_request" : "header_button"
|
|
9622
|
-
)]),
|
|
9623
|
-
onGoBack: handleProviderBack,
|
|
9624
|
-
onError: handleError,
|
|
9625
|
-
onAttemptConsumed: handleSwappedAttemptConsumed,
|
|
9626
|
-
onProviderHandoff: handleSwappedProviderHandoff,
|
|
9627
|
-
onRetry: handleSwappedRetry,
|
|
9628
|
-
onCancelled: () => analytics.outcome("cancelled"),
|
|
9629
|
-
onImmersiveChange: onSwappedImmersiveChange,
|
|
9630
|
-
openExternally
|
|
9631
|
+
order: {
|
|
9632
|
+
flow: "hosted",
|
|
9633
|
+
kind: "exchange",
|
|
9634
|
+
connection: step.connection,
|
|
9635
|
+
loadPreparedUrl: () => loadSwappedConnectUrl(step.smartAccount, step.connection)
|
|
9636
|
+
}
|
|
9631
9637
|
}
|
|
9632
9638
|
),
|
|
9633
9639
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9634
|
-
|
|
9640
|
+
_chunk4O2UGFFTcjs.ProcessingStep,
|
|
9635
9641
|
{
|
|
9636
9642
|
flowLabel: payment ? "payment" : void 0,
|
|
9637
9643
|
smartAccount: step.smartAccount,
|
|
@@ -9667,8 +9673,8 @@ function DepositFlow({
|
|
|
9667
9673
|
);
|
|
9668
9674
|
}
|
|
9669
9675
|
if (isSolanaWalletMode) {
|
|
9670
|
-
const solanaAddr = _optionalChain([walletSession, 'optionalAccess',
|
|
9671
|
-
const solanaProvider = _optionalChain([walletSession, 'optionalAccess',
|
|
9676
|
+
const solanaAddr = _optionalChain([walletSession, 'optionalAccess', _349 => _349.solanaAddress]);
|
|
9677
|
+
const solanaProvider = _optionalChain([walletSession, 'optionalAccess', _350 => _350.solanaProvider]);
|
|
9672
9678
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
9673
9679
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9674
9680
|
AccountPreparingSkeleton,
|
|
@@ -9720,7 +9726,7 @@ function DepositFlow({
|
|
|
9720
9726
|
targetToken,
|
|
9721
9727
|
service,
|
|
9722
9728
|
solanaProvider,
|
|
9723
|
-
solanaConnection: _optionalChain([walletSession, 'optionalAccess',
|
|
9729
|
+
solanaConnection: _optionalChain([walletSession, 'optionalAccess', _351 => _351.solanaConnection]),
|
|
9724
9730
|
uiConfig,
|
|
9725
9731
|
onConfirm: handleSolanaConfirmed,
|
|
9726
9732
|
onError: handleError,
|
|
@@ -9762,7 +9768,7 @@ function DepositFlow({
|
|
|
9762
9768
|
) })
|
|
9763
9769
|
] }) : null,
|
|
9764
9770
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9765
|
-
|
|
9771
|
+
_chunk4O2UGFFTcjs.ProcessingStep,
|
|
9766
9772
|
{
|
|
9767
9773
|
flowLabel: payment ? "payment" : void 0,
|
|
9768
9774
|
smartAccount: effectiveStep.smartAccount,
|
|
@@ -9802,7 +9808,7 @@ function DepositFlow({
|
|
|
9802
9808
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9803
9809
|
DappImportAssetSelectSkeleton,
|
|
9804
9810
|
{
|
|
9805
|
-
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportProvider, 'optionalAccess',
|
|
9811
|
+
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportProvider, 'optionalAccess', _352 => _352.sourceLabel]), () => ( "")),
|
|
9806
9812
|
error: dappImportBootError,
|
|
9807
9813
|
onRetry: handleBootRetry
|
|
9808
9814
|
}
|
|
@@ -9824,7 +9830,7 @@ function DepositFlow({
|
|
|
9824
9830
|
rows: dappImportSelectRows,
|
|
9825
9831
|
onRequestConnect: _nullishCoalesce(onConnect, () => ( onRequestConnect)),
|
|
9826
9832
|
onSelect: (providerId) => {
|
|
9827
|
-
const availabilityEntry = dappImportOwner && _optionalChain([dappImportAvailabilityOwner, 'optionalAccess',
|
|
9833
|
+
const availabilityEntry = dappImportOwner && _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _353 => _353.toLowerCase, 'call', _354 => _354()]) === dappImportOwner.toLowerCase() ? dappImportAvailability[providerId] : void 0;
|
|
9828
9834
|
if (availabilityEntry === "error") {
|
|
9829
9835
|
storeApi.dispatch({
|
|
9830
9836
|
type: "dapp-import/availability-retry-requested"
|
|
@@ -9843,16 +9849,16 @@ function DepositFlow({
|
|
|
9843
9849
|
}
|
|
9844
9850
|
);
|
|
9845
9851
|
}
|
|
9846
|
-
if (!_optionalChain([signerContext, 'optionalAccess',
|
|
9852
|
+
if (!_optionalChain([signerContext, 'optionalAccess', _355 => _355.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _356 => _356.publicClient])) {
|
|
9847
9853
|
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" }) }) }) }) });
|
|
9848
9854
|
}
|
|
9849
9855
|
const ownerAddress = signerContext.ownerAddress;
|
|
9850
|
-
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access',
|
|
9856
|
+
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _357 => _357.walletClient, 'optionalAccess', _358 => _358.chain, 'optionalAccess', _359 => _359.id]), () => ( _optionalChain([signerContext, 'access', _360 => _360.publicClient, 'access', _361 => _361.chain, 'optionalAccess', _362 => _362.id]))), () => ( setupChainId));
|
|
9851
9857
|
const getReadClientForChain = (chainId) => {
|
|
9852
|
-
if (_optionalChain([signerContext, 'access',
|
|
9858
|
+
if (_optionalChain([signerContext, 'access', _363 => _363.publicClient, 'access', _364 => _364.chain, 'optionalAccess', _365 => _365.id]) === chainId) {
|
|
9853
9859
|
return signerContext.publicClient;
|
|
9854
9860
|
}
|
|
9855
|
-
return
|
|
9861
|
+
return _chunk4O2UGFFTcjs.getPublicClient.call(void 0, chainId, rpcUrls);
|
|
9856
9862
|
};
|
|
9857
9863
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
9858
9864
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -9878,9 +9884,9 @@ function DepositFlow({
|
|
|
9878
9884
|
effectiveStep.type === "dapp-import-asset-select" && activeDappImportProvider && activeDappImportAvailability && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9879
9885
|
DappImportAssetSelectStep,
|
|
9880
9886
|
{
|
|
9881
|
-
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access',
|
|
9887
|
+
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access', _366 => _366.assets, 'access', _367 => _367[0], 'optionalAccess', _368 => _368.sourceLabel]), () => ( activeDappImportProvider.sourceLabel)),
|
|
9882
9888
|
assets: activeDappImportAvailability.assets,
|
|
9883
|
-
incompleteSummary: _optionalChain([activeDappImportAvailability, 'access',
|
|
9889
|
+
incompleteSummary: _optionalChain([activeDappImportAvailability, 'access', _369 => _369.incomplete, 'optionalAccess', _370 => _370.summary]),
|
|
9884
9890
|
onSelect: handleDappImportAssetSelected
|
|
9885
9891
|
}
|
|
9886
9892
|
),
|
|
@@ -9960,7 +9966,7 @@ function DepositFlow({
|
|
|
9960
9966
|
}
|
|
9961
9967
|
),
|
|
9962
9968
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9963
|
-
|
|
9969
|
+
_chunk4O2UGFFTcjs.ProcessingStep,
|
|
9964
9970
|
{
|
|
9965
9971
|
flowLabel: payment ? "payment" : void 0,
|
|
9966
9972
|
smartAccount: effectiveStep.smartAccount,
|
|
@@ -9997,9 +10003,9 @@ function DepositFlow({
|
|
|
9997
10003
|
] });
|
|
9998
10004
|
}
|
|
9999
10005
|
|
|
10000
|
-
// src/components/history/
|
|
10006
|
+
// src/components/history/useOrderHistory.ts
|
|
10001
10007
|
|
|
10002
|
-
function
|
|
10008
|
+
function useOrderHistory(source, open, panelOpen) {
|
|
10003
10009
|
const [orders, setOrders] = _react.useState.call(void 0, []);
|
|
10004
10010
|
const [unread, setUnread] = _react.useState.call(void 0, false);
|
|
10005
10011
|
const [loading, setLoading] = _react.useState.call(void 0, false);
|
|
@@ -10025,9 +10031,11 @@ function useBankHistory(source, open, panelOpen) {
|
|
|
10025
10031
|
...next ? { cursor: next } : {}
|
|
10026
10032
|
});
|
|
10027
10033
|
if (current !== generation.current) return;
|
|
10028
|
-
const
|
|
10034
|
+
const listed = page.items.filter(
|
|
10035
|
+
(order) => order.provider === "noah" || _chunk4O2UGFFTcjs.hostedOrderState.call(void 0, order).progress !== "awaiting_payment"
|
|
10036
|
+
);
|
|
10029
10037
|
let changed = false;
|
|
10030
|
-
for (const order of
|
|
10038
|
+
for (const order of listed) {
|
|
10031
10039
|
const fingerprint = JSON.stringify(order.stages);
|
|
10032
10040
|
if (!next && seen.current.get(order.id) !== fingerprint)
|
|
10033
10041
|
changed = true;
|
|
@@ -10037,7 +10045,7 @@ function useBankHistory(source, open, panelOpen) {
|
|
|
10037
10045
|
if (!next) baselined.current = true;
|
|
10038
10046
|
setOrders((previous) => {
|
|
10039
10047
|
const merged = new Map(previous.map((order) => [order.id, order]));
|
|
10040
|
-
for (const order of
|
|
10048
|
+
for (const order of listed) merged.set(order.id, order);
|
|
10041
10049
|
return [...merged.values()].sort(
|
|
10042
10050
|
(a, b) => b.createdAt.localeCompare(a.createdAt)
|
|
10043
10051
|
);
|
|
@@ -10047,7 +10055,7 @@ function useBankHistory(source, open, panelOpen) {
|
|
|
10047
10055
|
setError(null);
|
|
10048
10056
|
} catch (e43) {
|
|
10049
10057
|
if (current === generation.current)
|
|
10050
|
-
setError("
|
|
10058
|
+
setError("Order history is unavailable. Try again shortly.");
|
|
10051
10059
|
} finally {
|
|
10052
10060
|
if (current === generation.current) {
|
|
10053
10061
|
busy.current = false;
|
|
@@ -10100,12 +10108,53 @@ function useBankHistory(source, open, panelOpen) {
|
|
|
10100
10108
|
}
|
|
10101
10109
|
};
|
|
10102
10110
|
}
|
|
10111
|
+
function useSessionOrders(backendUrl, getCustomerSession, smartAccount) {
|
|
10112
|
+
const getSession = _chunkG264OM23cjs.useLatestRef.call(void 0, getCustomerSession);
|
|
10113
|
+
const enabled = Boolean(getCustomerSession);
|
|
10114
|
+
return _react.useMemo.call(void 0, () => {
|
|
10115
|
+
if (!enabled || !smartAccount) return null;
|
|
10116
|
+
return {
|
|
10117
|
+
listOrders: async ({ cursor, limit }) => {
|
|
10118
|
+
let refused = false;
|
|
10119
|
+
const request = _chunkCG3JKPUFcjs.createBearerTransport.call(void 0, {
|
|
10120
|
+
backendUrl,
|
|
10121
|
+
getSession: async () => {
|
|
10122
|
+
try {
|
|
10123
|
+
return await getSession.current(smartAccount, {
|
|
10124
|
+
resumeOnly: true
|
|
10125
|
+
});
|
|
10126
|
+
} catch (error) {
|
|
10127
|
+
refused = true;
|
|
10128
|
+
throw error;
|
|
10129
|
+
}
|
|
10130
|
+
}
|
|
10131
|
+
});
|
|
10132
|
+
try {
|
|
10133
|
+
return await request(
|
|
10134
|
+
`/onramp/orders?${_chunkADEWTBSNcjs.rampQuery.call(void 0, { cursor, limit })}`
|
|
10135
|
+
);
|
|
10136
|
+
} catch (error) {
|
|
10137
|
+
if (refused) return { items: [], nextCursor: null };
|
|
10138
|
+
throw error;
|
|
10139
|
+
}
|
|
10140
|
+
}
|
|
10141
|
+
};
|
|
10142
|
+
}, [backendUrl, enabled, smartAccount, getSession]);
|
|
10143
|
+
}
|
|
10103
10144
|
|
|
10104
10145
|
// src/DepositModal.tsx
|
|
10105
10146
|
|
|
10147
|
+
var warnedNoCustomerSession = false;
|
|
10148
|
+
function warnNoCustomerSession() {
|
|
10149
|
+
if (warnedNoCustomerSession) return;
|
|
10150
|
+
warnedNoCustomerSession = true;
|
|
10151
|
+
console.warn(
|
|
10152
|
+
"[rhinestone] `virtualAccountOnramp` needs `getCustomerSession`; it is ignored without one."
|
|
10153
|
+
);
|
|
10154
|
+
}
|
|
10106
10155
|
var ReownDepositInner = _react.lazy.call(void 0, async () => {
|
|
10107
10156
|
await loadReownDependencies();
|
|
10108
|
-
const module = await Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
10157
|
+
const module = await Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-QJ6O2FWY.cjs")));
|
|
10109
10158
|
return { default: module.DepositModalReown };
|
|
10110
10159
|
});
|
|
10111
10160
|
function buildDepositAnalyticsSessionProperties({
|
|
@@ -10135,7 +10184,7 @@ function buildDepositAnalyticsSessionProperties({
|
|
|
10135
10184
|
enabledFundingMethods.push("wallet");
|
|
10136
10185
|
}
|
|
10137
10186
|
if (enableQrTransfer) enabledFundingMethods.push("transfer");
|
|
10138
|
-
if (bankOnrampEnabled || enableFiatOnramp && _optionalChain([configuredFiatIdentifiers, 'optionalAccess',
|
|
10187
|
+
if (bankOnrampEnabled || enableFiatOnramp && _optionalChain([configuredFiatIdentifiers, 'optionalAccess', _371 => _371.length]) !== 0) {
|
|
10139
10188
|
enabledFundingMethods.push("fiat_onramp");
|
|
10140
10189
|
}
|
|
10141
10190
|
if (enableExchangeConnect) enabledFundingMethods.push("exchange_connect");
|
|
@@ -10155,7 +10204,7 @@ function buildDepositAnalyticsSessionProperties({
|
|
|
10155
10204
|
amount: defaultAmount !== void 0,
|
|
10156
10205
|
initial_asset_migration: initialAssetMigration !== void 0
|
|
10157
10206
|
},
|
|
10158
|
-
...
|
|
10207
|
+
..._chunk4O2UGFFTcjs.analyticsTargetProperties.call(void 0, { targetChain, targetToken })
|
|
10159
10208
|
};
|
|
10160
10209
|
}
|
|
10161
10210
|
var WALLET_CLIENT_PROP = "walletClient";
|
|
@@ -10163,8 +10212,9 @@ function hasSuppliedWalletClient(props) {
|
|
|
10163
10212
|
return Object.prototype.hasOwnProperty.call(props, WALLET_CLIENT_PROP);
|
|
10164
10213
|
}
|
|
10165
10214
|
function DepositModal(props) {
|
|
10166
|
-
|
|
10167
|
-
|
|
10215
|
+
_chunk4O2UGFFTcjs.warnRemovedProps.call(void 0, "DepositModal", props);
|
|
10216
|
+
if (props.virtualAccountOnramp && !props.getCustomerSession) warnNoCustomerSession();
|
|
10217
|
+
_chunk4O2UGFFTcjs.checkBackendUrl.call(void 0, "DepositModal", props.backendUrl);
|
|
10168
10218
|
const needsReown = !!props.reownAppId;
|
|
10169
10219
|
const hasWalletClientProp = hasSuppliedWalletClient(props);
|
|
10170
10220
|
if (needsReown) {
|
|
@@ -10207,7 +10257,8 @@ function DepositModalInner({
|
|
|
10207
10257
|
assetMigrations,
|
|
10208
10258
|
initialAssetMigration,
|
|
10209
10259
|
enableFiatOnramp = false,
|
|
10210
|
-
|
|
10260
|
+
virtualAccountOnramp,
|
|
10261
|
+
getCustomerSession,
|
|
10211
10262
|
enableQrTransfer = true,
|
|
10212
10263
|
enableGaslessDeposit = false,
|
|
10213
10264
|
fiatMethods,
|
|
@@ -10241,22 +10292,10 @@ function DepositModalInner({
|
|
|
10241
10292
|
const onReadyRef = _chunkG264OM23cjs.useLatestRef.call(void 0, onReady);
|
|
10242
10293
|
const onUiStateRef = _chunkG264OM23cjs.useLatestRef.call(void 0, onUiState);
|
|
10243
10294
|
const [currentScreen, setCurrentScreen] = _react.useState.call(void 0, "connect");
|
|
10244
|
-
const bankScope = `${backendUrl}:${recipient}:${typeof targetChainProp === "string" ? targetChainProp : _chunkFKJ6EJHHcjs.getChainId.call(void 0, targetChainProp)}:${targetToken}`;
|
|
10245
|
-
const [bankSession, setBankSession] = _react.useState.call(void 0, null);
|
|
10246
10295
|
const [bankJourneyVisible, setBankJourneyVisible] = _react.useState.call(void 0, false);
|
|
10247
|
-
const
|
|
10248
|
-
setBankJourneyVisible(Boolean(journey));
|
|
10249
|
-
if (journey)
|
|
10250
|
-
setBankSession(
|
|
10251
|
-
journey.source ? { source: journey.source, scope: bankScope } : null
|
|
10252
|
-
);
|
|
10253
|
-
}, [bankScope]);
|
|
10254
|
-
const bankSource = _optionalChain([bankSession, 'optionalAccess', _367 => _367.scope]) === bankScope ? bankSession.source : null;
|
|
10296
|
+
const [smartAccount, setSmartAccount] = _react.useState.call(void 0, null);
|
|
10255
10297
|
_react.useEffect.call(void 0, () => {
|
|
10256
|
-
if (!isOpen)
|
|
10257
|
-
setBankSession(null);
|
|
10258
|
-
setBankJourneyVisible(false);
|
|
10259
|
-
}
|
|
10298
|
+
if (!isOpen) setBankJourneyVisible(false);
|
|
10260
10299
|
}, [isOpen]);
|
|
10261
10300
|
const [swappedImmersive, setSwappedImmersive] = _react.useState.call(void 0, false);
|
|
10262
10301
|
const [submitting, setSubmitting] = _react.useState.call(void 0, false);
|
|
@@ -10264,48 +10303,57 @@ function DepositModalInner({
|
|
|
10264
10303
|
void 0
|
|
10265
10304
|
);
|
|
10266
10305
|
const [processingSettled, setProcessingSettled] = _react.useState.call(void 0, false);
|
|
10267
|
-
const historyButtonVisible = !payment && (bankJourneyVisible ||
|
|
10306
|
+
const historyButtonVisible = !payment && (bankJourneyVisible || _chunk4O2UGFFTcjs.isHistoryEntryVisible.call(void 0, {
|
|
10268
10307
|
screen: currentScreen,
|
|
10269
10308
|
submitting,
|
|
10270
10309
|
settled: processingSettled
|
|
10271
10310
|
}));
|
|
10272
10311
|
const targetChain = typeof targetChainProp === "string" ? targetChainProp : _chunkFKJ6EJHHcjs.getChainId.call(void 0, targetChainProp);
|
|
10273
10312
|
const sourceChain = sourceChainProp ? _chunkFKJ6EJHHcjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
10274
|
-
const
|
|
10313
|
+
const accountScope = `${isOpen}|${backendUrl}|${recipient}|${targetChain}|${targetToken}`;
|
|
10314
|
+
const [scope, setScope] = _react.useState.call(void 0, accountScope);
|
|
10315
|
+
if (scope !== accountScope) {
|
|
10316
|
+
setScope(accountScope);
|
|
10317
|
+
setSmartAccount(null);
|
|
10318
|
+
}
|
|
10319
|
+
const rpcUrls = _chunk4O2UGFFTcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
|
|
10275
10320
|
const service = _react.useMemo.call(void 0,
|
|
10276
|
-
() =>
|
|
10321
|
+
() => _chunk4O2UGFFTcjs.createDepositService.call(void 0, backendUrl, {
|
|
10277
10322
|
debug,
|
|
10278
10323
|
debugScope: "service:deposit"
|
|
10279
10324
|
}),
|
|
10280
10325
|
[backendUrl, debug]
|
|
10281
10326
|
);
|
|
10282
10327
|
const historyAnalytics = _react.useMemo.call(void 0,
|
|
10283
|
-
() =>
|
|
10328
|
+
() => _chunk4O2UGFFTcjs.createHistoryAnalytics.call(void 0, {
|
|
10284
10329
|
modal: "deposit",
|
|
10285
10330
|
controllerRef: analyticsControllerRef,
|
|
10286
10331
|
sessionIdRef: analyticsSessionIdRef
|
|
10287
10332
|
}),
|
|
10288
10333
|
[]
|
|
10289
10334
|
);
|
|
10290
|
-
const history =
|
|
10335
|
+
const history = _chunk4O2UGFFTcjs.useHistoryPanel.call(void 0, {
|
|
10291
10336
|
isOpen: isOpen && !payment,
|
|
10292
10337
|
recipient,
|
|
10293
10338
|
service,
|
|
10294
10339
|
canRecover: Boolean(signRecovery),
|
|
10295
10340
|
analytics: historyAnalytics
|
|
10296
10341
|
});
|
|
10297
|
-
const
|
|
10298
|
-
|
|
10342
|
+
const orderHistory = useOrderHistory(
|
|
10343
|
+
useSessionOrders(backendUrl, getCustomerSession, smartAccount),
|
|
10344
|
+
isOpen && !payment,
|
|
10345
|
+
history.isPanelOpen
|
|
10346
|
+
);
|
|
10299
10347
|
const historyDepositsRef = _chunkG264OM23cjs.useLatestRef.call(void 0, history.deposits);
|
|
10300
10348
|
_react.useEffect.call(void 0, () => {
|
|
10301
|
-
const waitingForSettlement =
|
|
10349
|
+
const waitingForSettlement = orderHistory.orders.some((order) => {
|
|
10302
10350
|
if (order.stages.delivery.status !== "completed") return false;
|
|
10303
10351
|
const { depositId } = order.stages.delivery;
|
|
10304
10352
|
const deposit = historyDepositsRef.current.find((item) => item.id === depositId);
|
|
10305
10353
|
return !deposit || deposit.status === "pending" || deposit.status === "processing";
|
|
10306
10354
|
});
|
|
10307
10355
|
if (waitingForSettlement) history.markStale();
|
|
10308
|
-
}, [
|
|
10356
|
+
}, [orderHistory.orders, history.markStale, historyDepositsRef]);
|
|
10309
10357
|
const {
|
|
10310
10358
|
markStale: markHistoryStale,
|
|
10311
10359
|
invalidate: invalidateHistory,
|
|
@@ -10339,15 +10387,15 @@ function DepositModalInner({
|
|
|
10339
10387
|
}, [store, targetChain, targetToken]);
|
|
10340
10388
|
_react.useEffect.call(void 0, () => {
|
|
10341
10389
|
if (!isOpen || !modalRef.current) return;
|
|
10342
|
-
return
|
|
10390
|
+
return _chunk4O2UGFFTcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
10343
10391
|
}, [isOpen, theme]);
|
|
10344
10392
|
_react.useEffect.call(void 0, () => {
|
|
10345
10393
|
if (isOpen) {
|
|
10346
|
-
_optionalChain([onReadyRef, 'access',
|
|
10394
|
+
_optionalChain([onReadyRef, 'access', _372 => _372.current, 'optionalCall', _373 => _373()]);
|
|
10347
10395
|
}
|
|
10348
10396
|
}, [isOpen, onReadyRef]);
|
|
10349
10397
|
_react.useEffect.call(void 0, () => {
|
|
10350
|
-
_optionalChain([onUiStateRef, 'access',
|
|
10398
|
+
_optionalChain([onUiStateRef, 'access', _374 => _374.current, 'optionalCall', _375 => _375({
|
|
10351
10399
|
screen: currentScreen,
|
|
10352
10400
|
back: backHandler,
|
|
10353
10401
|
// A recovery in flight is a submission whose outcome is unknown, so a
|
|
@@ -10371,9 +10419,10 @@ function DepositModalInner({
|
|
|
10371
10419
|
const onLifecycleRef = _chunkG264OM23cjs.useLatestRef.call(void 0, onLifecycle);
|
|
10372
10420
|
const handleLifecycle = _react.useCallback.call(void 0,
|
|
10373
10421
|
(event) => {
|
|
10374
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
10375
|
-
if (event.type === "smart-account-changed"
|
|
10376
|
-
|
|
10422
|
+
_optionalChain([onLifecycleRef, 'access', _376 => _376.current, 'optionalCall', _377 => _377(event)]);
|
|
10423
|
+
if (event.type === "smart-account-changed") {
|
|
10424
|
+
setSmartAccount(event.evm);
|
|
10425
|
+
if (!event.evm && !event.solana) invalidateHistory();
|
|
10377
10426
|
}
|
|
10378
10427
|
if (event.type === "submitted" || event.type === "complete" || event.type === "failed") {
|
|
10379
10428
|
markHistoryStale();
|
|
@@ -10385,8 +10434,8 @@ function DepositModalInner({
|
|
|
10385
10434
|
(source) => {
|
|
10386
10435
|
if (recoverySubmitting) return;
|
|
10387
10436
|
const analytics = analyticsControllerRef.current;
|
|
10388
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
10389
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
10437
|
+
_optionalChain([analytics, 'optionalAccess', _378 => _378.abandon, 'call', _379 => _379(source === "provider_back" ? "provider_back" : "modal_close")]);
|
|
10438
|
+
_optionalChain([analytics, 'optionalAccess', _380 => _380.close, 'call', _381 => _381(source)]);
|
|
10390
10439
|
onClose();
|
|
10391
10440
|
},
|
|
10392
10441
|
[onClose, recoverySubmitting]
|
|
@@ -10402,8 +10451,8 @@ function DepositModalInner({
|
|
|
10402
10451
|
_react.useEffect.call(void 0, () => {
|
|
10403
10452
|
if (previousOpenRef.current && !isOpen) {
|
|
10404
10453
|
const analytics = analyticsControllerRef.current;
|
|
10405
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
10406
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
10454
|
+
_optionalChain([analytics, 'optionalAccess', _382 => _382.abandon, 'call', _383 => _383("modal_close")]);
|
|
10455
|
+
_optionalChain([analytics, 'optionalAccess', _384 => _384.close, 'call', _385 => _385("host_controlled")]);
|
|
10407
10456
|
}
|
|
10408
10457
|
previousOpenRef.current = isOpen;
|
|
10409
10458
|
}, [isOpen]);
|
|
@@ -10437,18 +10486,18 @@ function DepositModalInner({
|
|
|
10437
10486
|
sourceToken,
|
|
10438
10487
|
defaultAmount,
|
|
10439
10488
|
bankOnrampEnabled: Boolean(
|
|
10440
|
-
|
|
10489
|
+
virtualAccountOnramp && getCustomerSession && (fiatMethods === void 0 || fiatMethods["bank-transfer"] === true)
|
|
10441
10490
|
),
|
|
10442
10491
|
walletIntegration,
|
|
10443
10492
|
targetChain,
|
|
10444
10493
|
targetToken
|
|
10445
10494
|
});
|
|
10446
|
-
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
10495
|
+
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _386 => _386.showBackButton]), () => ( true));
|
|
10447
10496
|
const canGoBack = backHandler !== void 0;
|
|
10448
10497
|
const hideHeaderChrome = swappedImmersive;
|
|
10449
10498
|
const modalClassName = `rs-modal${hideHeaderChrome ? " rs-modal--swapped-iframe" : ""}`;
|
|
10450
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
10451
|
-
|
|
10499
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.ChainCatalogProvider, { service, rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk4O2UGFFTcjs.AssetMetadataProvider, { service, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
10500
|
+
_chunk4O2UGFFTcjs.Modal,
|
|
10452
10501
|
{
|
|
10453
10502
|
isOpen,
|
|
10454
10503
|
onClose: handleModalDismiss,
|
|
@@ -10457,7 +10506,7 @@ function DepositModalInner({
|
|
|
10457
10506
|
closeOnOverlayClick,
|
|
10458
10507
|
ariaLabel: "Deposit",
|
|
10459
10508
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
10460
|
-
|
|
10509
|
+
_chunk4O2UGFFTcjs.AnalyticsSession,
|
|
10461
10510
|
{
|
|
10462
10511
|
modal: "deposit",
|
|
10463
10512
|
sessionProperties: analyticsSessionProperties,
|
|
@@ -10484,10 +10533,10 @@ function DepositModalInner({
|
|
|
10484
10533
|
) }),
|
|
10485
10534
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
|
|
10486
10535
|
historyButtonVisible && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
10487
|
-
|
|
10536
|
+
_chunk4O2UGFFTcjs.HistoryEntryButton,
|
|
10488
10537
|
{
|
|
10489
10538
|
badge: bankJourneyVisible ? null : history.badge,
|
|
10490
|
-
unread:
|
|
10539
|
+
unread: orderHistory.unread,
|
|
10491
10540
|
onClick: history.openPanel,
|
|
10492
10541
|
disabled: !recipient
|
|
10493
10542
|
}
|
|
@@ -10525,8 +10574,9 @@ function DepositModalInner({
|
|
|
10525
10574
|
assetMigrations,
|
|
10526
10575
|
initialAssetMigration,
|
|
10527
10576
|
enableFiatOnramp,
|
|
10528
|
-
|
|
10529
|
-
|
|
10577
|
+
virtualAccountOnramp,
|
|
10578
|
+
getCustomerSession,
|
|
10579
|
+
onBankJourney: setBankJourneyVisible,
|
|
10530
10580
|
backendUrl,
|
|
10531
10581
|
enableQrTransfer,
|
|
10532
10582
|
enableGaslessDeposit,
|
|
@@ -10539,7 +10589,7 @@ function DepositModalInner({
|
|
|
10539
10589
|
onDisconnect,
|
|
10540
10590
|
onRequestConnect,
|
|
10541
10591
|
uiConfig,
|
|
10542
|
-
appFees: _optionalChain([clientSetup, 'optionalAccess',
|
|
10592
|
+
appFees: _optionalChain([clientSetup, 'optionalAccess', _387 => _387.appFees]),
|
|
10543
10593
|
appFeesResolved: clientSetup !== null,
|
|
10544
10594
|
onStepChange: handleStepChange,
|
|
10545
10595
|
onSwappedImmersiveChange: setSwappedImmersive,
|
|
@@ -10553,11 +10603,11 @@ function DepositModalInner({
|
|
|
10553
10603
|
}
|
|
10554
10604
|
),
|
|
10555
10605
|
history.isPanelOpen && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
10556
|
-
|
|
10606
|
+
_chunk4O2UGFFTcjs.HistoryOverlay,
|
|
10557
10607
|
{
|
|
10558
10608
|
controller: history,
|
|
10559
|
-
|
|
10560
|
-
bankSupportUrl: _optionalChain([
|
|
10609
|
+
orderHistory,
|
|
10610
|
+
bankSupportUrl: _optionalChain([virtualAccountOnramp, 'optionalAccess', _388 => _388.supportUrl]),
|
|
10561
10611
|
backLabel: "Deposit",
|
|
10562
10612
|
recipient,
|
|
10563
10613
|
backendUrl,
|