@rhinestone/deposit-modal 0.9.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{DepositModalReown-JUJI7UHE.mjs → DepositModalReown-MTWT6Y66.mjs} +5 -5
- package/dist/{DepositModalReown-YQSO4SVY.cjs → DepositModalReown-S3DSFXTX.cjs} +9 -9
- package/dist/{chunk-7OQO6JDC.mjs → chunk-5NJYW5FT.mjs} +3 -3
- package/dist/{chunk-QLZ5RZTA.mjs → chunk-5OEWGJR4.mjs} +1 -1
- package/dist/{chunk-WUQZYQRK.mjs → chunk-7TV7GLJB.mjs} +62 -1
- package/dist/{chunk-EEEQZOTJ.cjs → chunk-A42XAHIB.cjs} +66 -66
- package/dist/{chunk-SQOEHQNT.cjs → chunk-DEF767BA.cjs} +52 -52
- package/dist/{chunk-AYWEWI47.mjs → chunk-KW32UBUQ.mjs} +1 -1
- package/dist/{chunk-QGXAAFHU.mjs → chunk-LR7MKHYV.mjs} +2 -2
- package/dist/{chunk-N3OHR3T2.mjs → chunk-MHIOMTMM.mjs} +227 -24
- package/dist/{chunk-XJE5MRY4.cjs → chunk-NF4NBRUP.cjs} +1 -1
- package/dist/{chunk-6U2H3R3T.cjs → chunk-PUJHXHRA.cjs} +108 -47
- package/dist/{chunk-ITFRTPGF.cjs → chunk-UMCDZJMG.cjs} +57 -57
- package/dist/{chunk-GYEUZSQP.mjs → chunk-VDGT6NZQ.mjs} +1 -1
- package/dist/{chunk-EAUF7SGM.cjs → chunk-VTVOHNXM.cjs} +3 -3
- package/dist/{chunk-VQJHYWAE.cjs → chunk-W4YAOJPG.cjs} +570 -367
- package/dist/claim.cjs +5 -5
- package/dist/claim.mjs +4 -4
- package/dist/constants.cjs +2 -2
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +6 -6
- package/dist/deposit.mjs +5 -5
- package/dist/index.cjs +8 -8
- package/dist/index.mjs +7 -7
- package/dist/styles.css +14 -0
- package/dist/withdraw.cjs +5 -5
- package/dist/withdraw.mjs +4 -4
- package/package.json +1 -1
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunkA42XAHIBcjs = require('./chunk-A42XAHIB.cjs');
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _chunkVTVOHNXMcjs = require('./chunk-VTVOHNXM.cjs');
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
@@ -77,7 +77,7 @@ var _chunkEAUF7SGMcjs = require('./chunk-EAUF7SGM.cjs');
|
|
|
77
77
|
|
|
78
78
|
|
|
79
79
|
|
|
80
|
-
var
|
|
80
|
+
var _chunkPUJHXHRAcjs = require('./chunk-PUJHXHRA.cjs');
|
|
81
81
|
|
|
82
82
|
|
|
83
83
|
|
|
@@ -114,6 +114,7 @@ var _chunkYEBXUUH3cjs = require('./chunk-YEBXUUH3.cjs');
|
|
|
114
114
|
|
|
115
115
|
|
|
116
116
|
|
|
117
|
+
|
|
117
118
|
|
|
118
119
|
|
|
119
120
|
var _chunkH577RJN5cjs = require('./chunk-H577RJN5.cjs');
|
|
@@ -208,7 +209,7 @@ SegmentedToggle.displayName = "SegmentedToggle";
|
|
|
208
209
|
function ChainIcon({ chainId, className, loading }) {
|
|
209
210
|
const badge = _chunkH577RJN5cjs.getChainBadge.call(void 0, chainId);
|
|
210
211
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
211
|
-
|
|
212
|
+
_chunkPUJHXHRAcjs.CdnIcon,
|
|
212
213
|
{
|
|
213
214
|
src: _chunkH577RJN5cjs.getChainIcon.call(void 0, chainId),
|
|
214
215
|
alt: _chunkH577RJN5cjs.getChainName.call(void 0, chainId),
|
|
@@ -231,7 +232,7 @@ ChainIcon.displayName = "ChainIcon";
|
|
|
231
232
|
// src/components/ui/WalletBadgeIcons/index.tsx
|
|
232
233
|
|
|
233
234
|
function BadgeImage({ src, alt = "" }) {
|
|
234
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
235
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.CdnIcon, { src, alt }) });
|
|
235
236
|
}
|
|
236
237
|
var WALLET_BADGES = ["rabby", "phantom", "walletconnect"];
|
|
237
238
|
function WalletBadgeIcons() {
|
|
@@ -262,18 +263,17 @@ var DAPP_IMPORT_CATALOG = [
|
|
|
262
263
|
label: "Polymarket",
|
|
263
264
|
iconUrl: _chunkH577RJN5cjs.cdnIconUrl.call(void 0, "dapps", "polymarket")
|
|
264
265
|
},
|
|
266
|
+
{
|
|
267
|
+
id: "aave",
|
|
268
|
+
label: "Aave",
|
|
269
|
+
iconUrl: _chunkH577RJN5cjs.cdnIconUrl.call(void 0, "dapps", "aave")
|
|
270
|
+
},
|
|
265
271
|
{
|
|
266
272
|
id: "hyperliquid",
|
|
267
273
|
label: "Hyperliquid",
|
|
268
274
|
iconUrl: _chunkH577RJN5cjs.cdnIconUrl.call(void 0, "dapps", "hyperliquid"),
|
|
269
275
|
comingSoon: true
|
|
270
276
|
},
|
|
271
|
-
{
|
|
272
|
-
id: "aave",
|
|
273
|
-
label: "Aave",
|
|
274
|
-
iconUrl: _chunkH577RJN5cjs.cdnIconUrl.call(void 0, "dapps", "aave"),
|
|
275
|
-
comingSoon: true
|
|
276
|
-
},
|
|
277
277
|
{
|
|
278
278
|
id: "morpho",
|
|
279
279
|
label: "Morpho",
|
|
@@ -285,7 +285,7 @@ var DAPP_IMPORT_CATALOG = [
|
|
|
285
285
|
// src/components/ui/BrandIcons.tsx
|
|
286
286
|
|
|
287
287
|
function ExchangeBadgeImage({ name }) {
|
|
288
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
288
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.CdnIcon, { src: _nullishCoalesce(_chunkA42XAHIBcjs.getExchangeLogoSrc.call(void 0, name), () => ( void 0)) });
|
|
289
289
|
}
|
|
290
290
|
var CARD_NETWORKS = ["amex", "visa", "mastercard"];
|
|
291
291
|
function CardNetworkIcons() {
|
|
@@ -293,7 +293,7 @@ function CardNetworkIcons() {
|
|
|
293
293
|
"span",
|
|
294
294
|
{
|
|
295
295
|
className: `rs-card-network rs-card-network--${network}`,
|
|
296
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
296
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.CdnIcon, { src: _chunkH577RJN5cjs.cdnIconUrl.call(void 0, "cards", network) })
|
|
297
297
|
},
|
|
298
298
|
network
|
|
299
299
|
)) });
|
|
@@ -314,7 +314,7 @@ function DappBadgeIcons() {
|
|
|
314
314
|
).filter(
|
|
315
315
|
(brand) => Boolean(brand)
|
|
316
316
|
);
|
|
317
|
-
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,
|
|
317
|
+
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, _chunkPUJHXHRAcjs.CdnIcon, { src: brand.iconUrl, alt: brand.label }) }, brand.id)) });
|
|
318
318
|
}
|
|
319
319
|
DappBadgeIcons.displayName = "DappBadgeIcons";
|
|
320
320
|
var DAPP_BADGE_COUNT = DAPP_BADGE_ORDER.length;
|
|
@@ -334,9 +334,9 @@ function balanceSubtitle(status, balanceUsd, fallback) {
|
|
|
334
334
|
return "No balance";
|
|
335
335
|
}
|
|
336
336
|
function fiatIcon(name) {
|
|
337
|
-
if (name === "apple") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
338
|
-
if (name === "bank") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
339
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
337
|
+
if (name === "apple") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.AppleIcon, {});
|
|
338
|
+
if (name === "bank") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.BankIcon, {});
|
|
339
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.CardIcon, {});
|
|
340
340
|
}
|
|
341
341
|
function FiatMethodIcon({ option }) {
|
|
342
342
|
const [remoteFailed, setRemoteFailed] = _react.useState.call(void 0, false);
|
|
@@ -419,13 +419,13 @@ function renderWalletLeading(row) {
|
|
|
419
419
|
}
|
|
420
420
|
);
|
|
421
421
|
}
|
|
422
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
422
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.WalletIcon, {});
|
|
423
423
|
}
|
|
424
|
-
var TRANSFER_CRYPTO_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
425
|
-
var WALLET_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
426
|
-
var EXCHANGE_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
427
|
-
var MIGRATE_ASSETS_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
428
|
-
var SMALL_SPINNER = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
424
|
+
var TRANSFER_CRYPTO_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.TransferCryptoIcon, {});
|
|
425
|
+
var WALLET_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.WalletIcon, {});
|
|
426
|
+
var EXCHANGE_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.UnplugIcon, {});
|
|
427
|
+
var MIGRATE_ASSETS_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.MigrateAssetsIcon, {});
|
|
428
|
+
var SMALL_SPINNER = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.Spinner, { className: "rs-spinner--sm" });
|
|
429
429
|
var CONNECT_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
430
430
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, WalletBadgeIcons, {}),
|
|
431
431
|
"+100"
|
|
@@ -486,7 +486,7 @@ function ConnectStep({
|
|
|
486
486
|
if (onSelectTransferCrypto) {
|
|
487
487
|
cryptoRows.push(
|
|
488
488
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
489
|
-
|
|
489
|
+
_chunkVTVOHNXMcjs.ListRow,
|
|
490
490
|
{
|
|
491
491
|
leading: TRANSFER_CRYPTO_LEADING,
|
|
492
492
|
title: "Transfer crypto",
|
|
@@ -507,7 +507,7 @@ function ConnectStep({
|
|
|
507
507
|
);
|
|
508
508
|
cryptoRows.push(
|
|
509
509
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
510
|
-
|
|
510
|
+
_chunkVTVOHNXMcjs.ListRow,
|
|
511
511
|
{
|
|
512
512
|
leading: renderWalletLeading(row),
|
|
513
513
|
title: collapseToExternal ? "External wallet" : row.label,
|
|
@@ -524,7 +524,7 @@ function ConnectStep({
|
|
|
524
524
|
if (!hasReownWallet && handleConnect) {
|
|
525
525
|
cryptoRows.push(
|
|
526
526
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
527
|
-
|
|
527
|
+
_chunkVTVOHNXMcjs.ListRow,
|
|
528
528
|
{
|
|
529
529
|
leading: WALLET_LEADING,
|
|
530
530
|
title: "Connect wallet",
|
|
@@ -539,7 +539,7 @@ function ConnectStep({
|
|
|
539
539
|
if (onSelectFundFromExchange) {
|
|
540
540
|
cryptoRows.push(
|
|
541
541
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
542
|
-
|
|
542
|
+
_chunkVTVOHNXMcjs.ListRow,
|
|
543
543
|
{
|
|
544
544
|
leading: EXCHANGE_LEADING,
|
|
545
545
|
title: "Connect exchange",
|
|
@@ -554,7 +554,7 @@ function ConnectStep({
|
|
|
554
554
|
if (onSelectMigrateAssets) {
|
|
555
555
|
cryptoRows.push(
|
|
556
556
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
557
|
-
|
|
557
|
+
_chunkVTVOHNXMcjs.ListRow,
|
|
558
558
|
{
|
|
559
559
|
leading: MIGRATE_ASSETS_LEADING,
|
|
560
560
|
title: "Migrate assets",
|
|
@@ -575,7 +575,7 @@ function ConnectStep({
|
|
|
575
575
|
for (const opt of fiatPaymentMethods) {
|
|
576
576
|
cashRows.push(
|
|
577
577
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
578
|
-
|
|
578
|
+
_chunkVTVOHNXMcjs.ListRow,
|
|
579
579
|
{
|
|
580
580
|
leading: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FiatMethodIcon, { option: opt }),
|
|
581
581
|
title: opt.label,
|
|
@@ -590,7 +590,7 @@ function ConnectStep({
|
|
|
590
590
|
} else if (fiatLoading) {
|
|
591
591
|
cashRows.push(
|
|
592
592
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
593
|
-
|
|
593
|
+
_chunkVTVOHNXMcjs.ListRow,
|
|
594
594
|
{
|
|
595
595
|
leading: SMALL_SPINNER,
|
|
596
596
|
title: "Loading payment options\u2026",
|
|
@@ -619,9 +619,9 @@ function ConnectStep({
|
|
|
619
619
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
620
620
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
621
621
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
622
|
-
|
|
622
|
+
_chunkPUJHXHRAcjs.BodyHeader,
|
|
623
623
|
{
|
|
624
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
624
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.HandCoinsIcon, {}),
|
|
625
625
|
title,
|
|
626
626
|
subtitle: _nullishCoalesce(subtitle, () => ( defaultSubtitle)),
|
|
627
627
|
aside: showToggle ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -657,7 +657,7 @@ function ConnectStep({
|
|
|
657
657
|
children: "Disconnect wallet"
|
|
658
658
|
}
|
|
659
659
|
) }),
|
|
660
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
660
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.PoweredBy, {})
|
|
661
661
|
] });
|
|
662
662
|
}
|
|
663
663
|
ConnectStep.displayName = "ConnectStep";
|
|
@@ -682,12 +682,12 @@ function AssetSelectStep({
|
|
|
682
682
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
683
683
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
684
684
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
685
|
-
return
|
|
685
|
+
return _chunkPUJHXHRAcjs.getAssetId.call(void 0, {
|
|
686
686
|
chainId: defaultSourceChain,
|
|
687
687
|
token: defaultSourceToken
|
|
688
688
|
});
|
|
689
689
|
}, [defaultSourceChain, defaultSourceToken]);
|
|
690
|
-
const onTotalBalanceComputedRef =
|
|
690
|
+
const onTotalBalanceComputedRef = _chunkPUJHXHRAcjs.useLatestRef.call(void 0, onTotalBalanceComputed);
|
|
691
691
|
_react.useEffect.call(void 0, () => {
|
|
692
692
|
let active = true;
|
|
693
693
|
function emitAssetsUpdate(currentAssets) {
|
|
@@ -707,7 +707,7 @@ function AssetSelectStep({
|
|
|
707
707
|
try {
|
|
708
708
|
const portfolio = await service.fetchPortfolio(address);
|
|
709
709
|
if (!active) return;
|
|
710
|
-
const portfolioAssets =
|
|
710
|
+
const portfolioAssets = _chunkPUJHXHRAcjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
711
711
|
setAssets(portfolioAssets);
|
|
712
712
|
emitAssetsUpdate(portfolioAssets);
|
|
713
713
|
const hasNative = portfolioAssets.some(
|
|
@@ -775,7 +775,7 @@ function AssetSelectStep({
|
|
|
775
775
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
776
776
|
const numeric = Number(raw);
|
|
777
777
|
if (!Number.isFinite(numeric)) return raw;
|
|
778
|
-
return
|
|
778
|
+
return _chunkPUJHXHRAcjs.tokenFormatter.format(numeric);
|
|
779
779
|
} catch (e3) {
|
|
780
780
|
return asset.balance;
|
|
781
781
|
}
|
|
@@ -783,20 +783,20 @@ function AssetSelectStep({
|
|
|
783
783
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
784
784
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
785
785
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
786
|
-
|
|
786
|
+
_chunkPUJHXHRAcjs.BodyHeader,
|
|
787
787
|
{
|
|
788
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
788
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.WalletIcon, {}),
|
|
789
789
|
title: "Your assets",
|
|
790
790
|
subtitle: "Select source assets to transfer"
|
|
791
791
|
}
|
|
792
792
|
),
|
|
793
793
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
794
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
794
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
795
795
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
796
796
|
] }),
|
|
797
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
797
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.Callout, { variant: "error", children: error }),
|
|
798
798
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
799
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
799
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
800
800
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
801
801
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
802
802
|
address.slice(0, 6),
|
|
@@ -829,13 +829,13 @@ function AssetSelectStep({
|
|
|
829
829
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
|
|
830
830
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-icon-wrapper", children: [
|
|
831
831
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
832
|
-
|
|
832
|
+
_chunkPUJHXHRAcjs.TokenIcon,
|
|
833
833
|
{
|
|
834
834
|
symbol: asset.symbol,
|
|
835
835
|
fallback: asset.symbol.slice(0, 4)
|
|
836
836
|
}
|
|
837
837
|
) }),
|
|
838
|
-
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
838
|
+
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.CdnIcon, { src: chainIcon, alt: _chunkH577RJN5cjs.getChainName.call(void 0, asset.chainId) }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
839
839
|
"span",
|
|
840
840
|
{
|
|
841
841
|
className: "rs-asset-chain-badge",
|
|
@@ -862,14 +862,14 @@ function AssetSelectStep({
|
|
|
862
862
|
] })
|
|
863
863
|
] })
|
|
864
864
|
] }),
|
|
865
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ?
|
|
865
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunkPUJHXHRAcjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
866
866
|
]
|
|
867
867
|
},
|
|
868
868
|
asset.id
|
|
869
869
|
);
|
|
870
870
|
}) }),
|
|
871
871
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
872
|
-
|
|
872
|
+
_chunkPUJHXHRAcjs.Button,
|
|
873
873
|
{
|
|
874
874
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
875
875
|
disabled: !selectedAsset,
|
|
@@ -878,7 +878,7 @@ function AssetSelectStep({
|
|
|
878
878
|
}
|
|
879
879
|
)
|
|
880
880
|
] }),
|
|
881
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
881
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.PoweredBy, {})
|
|
882
882
|
] });
|
|
883
883
|
}
|
|
884
884
|
async function fetchNativeAssets(address, publicClient, existing) {
|
|
@@ -886,7 +886,7 @@ async function fetchNativeAssets(address, publicClient, existing) {
|
|
|
886
886
|
const connectedChainId = _optionalChain([publicClient, 'access', _8 => _8.chain, 'optionalAccess', _9 => _9.id]);
|
|
887
887
|
if (!connectedChainId) return [];
|
|
888
888
|
if (!_chunkH577RJN5cjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
|
|
889
|
-
const id =
|
|
889
|
+
const id = _chunkPUJHXHRAcjs.getAssetId.call(void 0, {
|
|
890
890
|
chainId: connectedChainId,
|
|
891
891
|
token: _chunkH577RJN5cjs.NATIVE_TOKEN_ADDRESS
|
|
892
892
|
});
|
|
@@ -1036,6 +1036,7 @@ function AmountStep({
|
|
|
1036
1036
|
publicClient,
|
|
1037
1037
|
address,
|
|
1038
1038
|
balanceAddress,
|
|
1039
|
+
declaredBalance,
|
|
1039
1040
|
asset,
|
|
1040
1041
|
defaultAmount,
|
|
1041
1042
|
switchChain,
|
|
@@ -1078,11 +1079,15 @@ function AmountStep({
|
|
|
1078
1079
|
const hasPricing = tokenPriceUsd !== null;
|
|
1079
1080
|
_react.useEffect.call(void 0, () => {
|
|
1080
1081
|
let active = true;
|
|
1082
|
+
if (declaredBalance !== void 0) {
|
|
1083
|
+
setBalance(declaredBalance);
|
|
1084
|
+
return;
|
|
1085
|
+
}
|
|
1081
1086
|
async function fetchBalance() {
|
|
1082
1087
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
1083
1088
|
if (!balanceTarget || !publicClient) return;
|
|
1084
1089
|
try {
|
|
1085
|
-
const bal =
|
|
1090
|
+
const bal = _chunkPUJHXHRAcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
1086
1091
|
address: asset.token,
|
|
1087
1092
|
abi: _viem.erc20Abi,
|
|
1088
1093
|
functionName: "balanceOf",
|
|
@@ -1097,13 +1102,13 @@ function AmountStep({
|
|
|
1097
1102
|
return () => {
|
|
1098
1103
|
active = false;
|
|
1099
1104
|
};
|
|
1100
|
-
}, [address, balanceAddress, publicClient, asset]);
|
|
1105
|
+
}, [address, balanceAddress, declaredBalance, publicClient, asset]);
|
|
1101
1106
|
_react.useEffect.call(void 0, () => {
|
|
1102
1107
|
if (chainMismatch && switchChain && !hasAttemptedSwitch.current) {
|
|
1103
1108
|
hasAttemptedSwitch.current = true;
|
|
1104
1109
|
switchChain(asset.chainId).catch((err) => {
|
|
1105
1110
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
1106
|
-
setError(
|
|
1111
|
+
setError(_chunkPUJHXHRAcjs.formatUserError.call(void 0, raw));
|
|
1107
1112
|
});
|
|
1108
1113
|
}
|
|
1109
1114
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -1156,7 +1161,7 @@ function AmountStep({
|
|
|
1156
1161
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
1157
1162
|
const numeric = Number(raw);
|
|
1158
1163
|
if (!Number.isFinite(numeric)) return raw;
|
|
1159
|
-
return
|
|
1164
|
+
return _chunkPUJHXHRAcjs.tokenFormatter.format(numeric);
|
|
1160
1165
|
} catch (e8) {
|
|
1161
1166
|
return "\u2026";
|
|
1162
1167
|
}
|
|
@@ -1245,7 +1250,7 @@ function AmountStep({
|
|
|
1245
1250
|
const targetChainName = _chunkH577RJN5cjs.getChainName.call(void 0, targetChain);
|
|
1246
1251
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
1247
1252
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
1248
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1253
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.WalletIcon, {}), title: "Wallet deposit" }),
|
|
1249
1254
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
1250
1255
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
1251
1256
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1265,13 +1270,13 @@ function AmountStep({
|
|
|
1265
1270
|
" available",
|
|
1266
1271
|
balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1267
1272
|
" (~",
|
|
1268
|
-
|
|
1273
|
+
_chunkPUJHXHRAcjs.currencyFormatter.format(balanceUsd),
|
|
1269
1274
|
")"
|
|
1270
1275
|
] })
|
|
1271
1276
|
] }),
|
|
1272
1277
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
1273
1278
|
"Min. deposit ",
|
|
1274
|
-
|
|
1279
|
+
_chunkPUJHXHRAcjs.currencyFormatter.format(minDepositUsd)
|
|
1275
1280
|
] })
|
|
1276
1281
|
] })
|
|
1277
1282
|
] }),
|
|
@@ -1296,7 +1301,7 @@ function AmountStep({
|
|
|
1296
1301
|
" ",
|
|
1297
1302
|
asset.symbol
|
|
1298
1303
|
] }),
|
|
1299
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1304
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.TokenIcon, { symbol: asset.symbol }) })
|
|
1300
1305
|
] })
|
|
1301
1306
|
] }),
|
|
1302
1307
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
@@ -1307,18 +1312,18 @@ function AmountStep({
|
|
|
1307
1312
|
" ",
|
|
1308
1313
|
targetSymbol
|
|
1309
1314
|
] }),
|
|
1310
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1315
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.TokenIcon, { symbol: targetSymbol }) })
|
|
1311
1316
|
] })
|
|
1312
1317
|
] }),
|
|
1313
1318
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
1314
1319
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
1315
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
1320
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkPUJHXHRAcjs.currencyFormatter.format(balanceAfterUsd) })
|
|
1316
1321
|
] })
|
|
1317
1322
|
] }),
|
|
1318
|
-
targetChain === _chunkH577RJN5cjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1319
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1323
|
+
targetChain === _chunkH577RJN5cjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
|
|
1324
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.Callout, { variant: "error", children: error }),
|
|
1320
1325
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1321
|
-
|
|
1326
|
+
_chunkPUJHXHRAcjs.Button,
|
|
1322
1327
|
{
|
|
1323
1328
|
onClick: handleContinue,
|
|
1324
1329
|
fullWidth: true,
|
|
@@ -1327,7 +1332,7 @@ function AmountStep({
|
|
|
1327
1332
|
}
|
|
1328
1333
|
)
|
|
1329
1334
|
] }),
|
|
1330
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1335
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.PoweredBy, {})
|
|
1331
1336
|
] });
|
|
1332
1337
|
}
|
|
1333
1338
|
|
|
@@ -1395,34 +1400,34 @@ function ConfirmStep({
|
|
|
1395
1400
|
const targetChainName = _chunkH577RJN5cjs.getChainName.call(void 0, targetChain);
|
|
1396
1401
|
const sourceChainIcon = _chunkH577RJN5cjs.getChainIcon.call(void 0, asset.chainId);
|
|
1397
1402
|
const targetChainIcon = _chunkH577RJN5cjs.getChainIcon.call(void 0, targetChain);
|
|
1398
|
-
const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? _nullishCoalesce(
|
|
1399
|
-
const mustHaveQuote = !appFeesResolved ||
|
|
1403
|
+
const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? _nullishCoalesce(_chunkPUJHXHRAcjs.formatTokenAmount.call(void 0, Number(amount), asset.symbol), () => ( "0")) : "0";
|
|
1404
|
+
const mustHaveQuote = !appFeesResolved || _chunkPUJHXHRAcjs.resolveAppFeeBps.call(void 0,
|
|
1400
1405
|
appFees,
|
|
1401
1406
|
`eip155:${quoteSource.chainId}`,
|
|
1402
1407
|
quoteSource.token
|
|
1403
1408
|
) > 0;
|
|
1404
|
-
const { display: feeDisplay, struck: feesFullySponsored } =
|
|
1409
|
+
const { display: feeDisplay, struck: feesFullySponsored } = _chunkPUJHXHRAcjs.quoteFeeRow.call(void 0,
|
|
1405
1410
|
_optionalChain([quote, 'optionalAccess', _24 => _24.fees])
|
|
1406
1411
|
);
|
|
1407
1412
|
const directTransfer = sameRoute && !mustHaveQuote && !executeTransfer;
|
|
1408
1413
|
const receiveDisplay = (() => {
|
|
1409
1414
|
if (directTransfer) return `${formattedSendAmount} ${asset.symbol}`;
|
|
1410
1415
|
if (quote) {
|
|
1411
|
-
const quoted =
|
|
1416
|
+
const quoted = _chunkPUJHXHRAcjs.formatQuotedReceive.call(void 0, quote.output, targetSymbol);
|
|
1412
1417
|
if (quoted !== void 0) return quoted;
|
|
1413
1418
|
}
|
|
1414
1419
|
const usdValue = Number(targetAmount);
|
|
1415
1420
|
const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
|
|
1416
|
-
const estimate =
|
|
1421
|
+
const estimate = _chunkPUJHXHRAcjs.formatReceiveEstimate.call(void 0, {
|
|
1417
1422
|
sourceAmount: Number.isFinite(Number(amount)) ? Number(amount) : void 0,
|
|
1418
1423
|
sourceSymbol: asset.symbol,
|
|
1419
1424
|
targetSymbol,
|
|
1420
1425
|
sourceAmountUsd,
|
|
1421
|
-
sourceTrusted:
|
|
1426
|
+
sourceTrusted: _chunkPUJHXHRAcjs.isRecognizedToken.call(void 0, asset.token, asset.chainId),
|
|
1422
1427
|
// The target is the curated deposit destination, so a stablecoin target
|
|
1423
1428
|
// estimates at $1 when unquoted (DepositFlow skips fetching stablecoin
|
|
1424
1429
|
// target prices). Not applied to the source — that can be a held token.
|
|
1425
|
-
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } :
|
|
1430
|
+
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : _chunkPUJHXHRAcjs.isDisplayStablecoinSymbol.call(void 0, targetSymbol) ? { [targetSymbol.toUpperCase()]: 1 } : {}
|
|
1426
1431
|
});
|
|
1427
1432
|
if (estimate !== void 0) return estimate;
|
|
1428
1433
|
return targetSymbol;
|
|
@@ -1433,7 +1438,7 @@ function ConfirmStep({
|
|
|
1433
1438
|
hasAttemptedSwitch.current = true;
|
|
1434
1439
|
switchChain(asset.chainId).catch((err) => {
|
|
1435
1440
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
1436
|
-
setError(
|
|
1441
|
+
setError(_chunkPUJHXHRAcjs.formatUserError.call(void 0, raw));
|
|
1437
1442
|
});
|
|
1438
1443
|
}
|
|
1439
1444
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -1522,7 +1527,7 @@ function ConfirmStep({
|
|
|
1522
1527
|
const result = await executeTransfer(amountUnits);
|
|
1523
1528
|
hash = result.txHash;
|
|
1524
1529
|
resolvedSourceToken = result.sourceToken;
|
|
1525
|
-
} else if (
|
|
1530
|
+
} else if (_chunkPUJHXHRAcjs.isNativeAsset.call(void 0, asset)) {
|
|
1526
1531
|
hash = await walletClient.sendTransaction({
|
|
1527
1532
|
account,
|
|
1528
1533
|
chain,
|
|
@@ -1553,7 +1558,7 @@ function ConfirmStep({
|
|
|
1553
1558
|
);
|
|
1554
1559
|
} catch (err) {
|
|
1555
1560
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
1556
|
-
const message =
|
|
1561
|
+
const message = _chunkPUJHXHRAcjs.formatUserError.call(void 0, raw);
|
|
1557
1562
|
setError(message);
|
|
1558
1563
|
_optionalChain([onError, 'optionalCall', _26 => _26(message, "TRANSFER_ERROR")]);
|
|
1559
1564
|
} finally {
|
|
@@ -1562,20 +1567,20 @@ function ConfirmStep({
|
|
|
1562
1567
|
};
|
|
1563
1568
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
1564
1569
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
1565
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1570
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.WalletIcon, {}), title: "Review deposit" }),
|
|
1566
1571
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
|
|
1567
1572
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1568
1573
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
1569
1574
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1570
1575
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceChainName }),
|
|
1571
|
-
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1576
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.CdnIcon, { src: sourceChainIcon }) })
|
|
1572
1577
|
] })
|
|
1573
1578
|
] }),
|
|
1574
1579
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1575
1580
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
|
|
1576
1581
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1577
1582
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName }),
|
|
1578
|
-
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1583
|
+
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.CdnIcon, { src: targetChainIcon }) })
|
|
1579
1584
|
] })
|
|
1580
1585
|
] }),
|
|
1581
1586
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -1590,14 +1595,14 @@ function ConfirmStep({
|
|
|
1590
1595
|
" ",
|
|
1591
1596
|
asset.symbol
|
|
1592
1597
|
] }),
|
|
1593
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1598
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.TokenIcon, { symbol: asset.symbol }) })
|
|
1594
1599
|
] })
|
|
1595
1600
|
] }),
|
|
1596
1601
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1597
1602
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Receive" }),
|
|
1598
1603
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1599
1604
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: receiveDisplay }),
|
|
1600
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1605
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.TokenIcon, { symbol: targetSymbol }) })
|
|
1601
1606
|
] })
|
|
1602
1607
|
] }),
|
|
1603
1608
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -1617,10 +1622,10 @@ function ConfirmStep({
|
|
|
1617
1622
|
) })
|
|
1618
1623
|
] })
|
|
1619
1624
|
] }),
|
|
1620
|
-
targetChain === _chunkH577RJN5cjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1621
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1625
|
+
targetChain === _chunkH577RJN5cjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
|
|
1626
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.Callout, { variant: "error", children: error }),
|
|
1622
1627
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1623
|
-
|
|
1628
|
+
_chunkPUJHXHRAcjs.Button,
|
|
1624
1629
|
{
|
|
1625
1630
|
onClick: handleConfirm,
|
|
1626
1631
|
loading: isSubmitting,
|
|
@@ -1634,7 +1639,7 @@ function ConfirmStep({
|
|
|
1634
1639
|
}
|
|
1635
1640
|
)
|
|
1636
1641
|
] }),
|
|
1637
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1642
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.PoweredBy, {})
|
|
1638
1643
|
] });
|
|
1639
1644
|
}
|
|
1640
1645
|
|
|
@@ -1657,9 +1662,9 @@ var INITIAL_POLL_INTERVAL = 3e3;
|
|
|
1657
1662
|
var MAX_POLL_INTERVAL = 3e4;
|
|
1658
1663
|
var BACKOFF_MULTIPLIER = 1.5;
|
|
1659
1664
|
function isEventForTx(event, txHash) {
|
|
1660
|
-
const eventTxHash =
|
|
1665
|
+
const eventTxHash = _chunkA42XAHIBcjs.getEventTxHash.call(void 0, event);
|
|
1661
1666
|
if (!eventTxHash) return false;
|
|
1662
|
-
return
|
|
1667
|
+
return _chunkA42XAHIBcjs.txRefsMatch.call(void 0, eventTxHash, txHash);
|
|
1663
1668
|
}
|
|
1664
1669
|
function truncateHash(hash) {
|
|
1665
1670
|
return `${hash.slice(0, 4)}\u2026${hash.slice(-4)}`;
|
|
@@ -1709,7 +1714,7 @@ function formatBridgeFailedMessage(event) {
|
|
|
1709
1714
|
}
|
|
1710
1715
|
return "Bridge failed";
|
|
1711
1716
|
}
|
|
1712
|
-
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1717
|
+
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.ExternalLinkIcon, { className: "rs-deposit-notification-link-icon" });
|
|
1713
1718
|
function DepositNotification({
|
|
1714
1719
|
deposit,
|
|
1715
1720
|
smartAccount,
|
|
@@ -1743,7 +1748,7 @@ function DepositNotification({
|
|
|
1743
1748
|
const pollIntervalRef = _react.useRef.call(void 0, INITIAL_POLL_INTERVAL);
|
|
1744
1749
|
const pollTimeoutRef = _react.useRef.call(void 0, null);
|
|
1745
1750
|
const completedRef = _react.useRef.call(void 0, _nullishCoalesce(directTransfer, () => ( false)));
|
|
1746
|
-
const depositContextRef =
|
|
1751
|
+
const depositContextRef = _chunkPUJHXHRAcjs.useLatestRef.call(void 0, {
|
|
1747
1752
|
amount,
|
|
1748
1753
|
sourceChain,
|
|
1749
1754
|
sourceToken: token,
|
|
@@ -1751,8 +1756,8 @@ function DepositNotification({
|
|
|
1751
1756
|
targetChain,
|
|
1752
1757
|
targetToken
|
|
1753
1758
|
});
|
|
1754
|
-
const onCompleteRef =
|
|
1755
|
-
const onFailedRef =
|
|
1759
|
+
const onCompleteRef = _chunkPUJHXHRAcjs.useLatestRef.call(void 0, onComplete);
|
|
1760
|
+
const onFailedRef = _chunkPUJHXHRAcjs.useLatestRef.call(void 0, onFailed);
|
|
1756
1761
|
const handleComplete = _react.useCallback.call(void 0,
|
|
1757
1762
|
(destTxHash) => {
|
|
1758
1763
|
if (completedRef.current) return;
|
|
@@ -1847,7 +1852,7 @@ function DepositNotification({
|
|
|
1847
1852
|
const destExplorerUrl = destinationTxHash ? _chunkH577RJN5cjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
|
|
1848
1853
|
const title = status === "complete" ? "Deposit completed" : status === "failed" ? "Deposit failed" : "Deposit received and processing\u2026";
|
|
1849
1854
|
const subtitle = status === "complete" ? "Your deposit has been credited to your account." : status === "failed" ? "Your deposit could not be processed." : "Your deposit will be credited to your account shortly.";
|
|
1850
|
-
const statusIcon = status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--complete", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1855
|
+
const statusIcon = status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--complete", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.CheckIcon, {}) }) : status === "failed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--failed", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.CloseIcon, {}) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--processing", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1851
1856
|
"svg",
|
|
1852
1857
|
{
|
|
1853
1858
|
className: "rs-deposit-notification-spinner",
|
|
@@ -1897,7 +1902,7 @@ function DepositNotification({
|
|
|
1897
1902
|
className: "rs-deposit-notification-close",
|
|
1898
1903
|
onClick: () => onDismiss(deposit.id),
|
|
1899
1904
|
"aria-label": "Dismiss",
|
|
1900
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1905
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.CloseIcon, {})
|
|
1901
1906
|
}
|
|
1902
1907
|
)
|
|
1903
1908
|
] }),
|
|
@@ -1913,7 +1918,7 @@ function DepositNotification({
|
|
|
1913
1918
|
"aria-expanded": expanded,
|
|
1914
1919
|
children: [
|
|
1915
1920
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: expanded ? "See less details" : "See more details" }),
|
|
1916
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1921
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.ChevronDownIcon, { className: "rs-deposit-notification-toggle-chevron" })
|
|
1917
1922
|
]
|
|
1918
1923
|
}
|
|
1919
1924
|
),
|
|
@@ -2063,7 +2068,7 @@ function resolveSourceTokenAddress(symbol, chainId, topTokens) {
|
|
|
2063
2068
|
}
|
|
2064
2069
|
function TokenGlyph({ symbol }) {
|
|
2065
2070
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2066
|
-
|
|
2071
|
+
_chunkPUJHXHRAcjs.TokenIcon,
|
|
2067
2072
|
{
|
|
2068
2073
|
symbol,
|
|
2069
2074
|
className: "rs-deposit-address-dropdown-icon",
|
|
@@ -2298,10 +2303,10 @@ function DepositAddressStep({
|
|
|
2298
2303
|
return;
|
|
2299
2304
|
}
|
|
2300
2305
|
const event = status.lastEvent;
|
|
2301
|
-
const eventTxHash =
|
|
2306
|
+
const eventTxHash = _chunkA42XAHIBcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkA42XAHIBcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
2302
2307
|
if (baselineTxHashRef.current === void 0) {
|
|
2303
2308
|
baselineTxHashRef.current = eventTxHash;
|
|
2304
|
-
} else if (eventTxHash && (!baselineTxHashRef.current || !
|
|
2309
|
+
} else if (eventTxHash && (!baselineTxHashRef.current || !_chunkA42XAHIBcjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
|
|
2305
2310
|
const details = getDepositEventDetails(event);
|
|
2306
2311
|
const chainId = _nullishCoalesce(details.chainId, () => ( "unknown"));
|
|
2307
2312
|
const amount = _nullishCoalesce(details.amount, () => ( "0"));
|
|
@@ -2378,7 +2383,7 @@ function DepositAddressStep({
|
|
|
2378
2383
|
const qrIconSrc = _chunkH577RJN5cjs.getChainIcon.call(void 0, sourceChainId);
|
|
2379
2384
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-step--with-notifications", children: [
|
|
2380
2385
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
2381
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2386
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
2382
2387
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", children: [
|
|
2383
2388
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", ref: chainDropdownRef, children: [
|
|
2384
2389
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
@@ -2394,14 +2399,14 @@ function DepositAddressStep({
|
|
|
2394
2399
|
},
|
|
2395
2400
|
children: [
|
|
2396
2401
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2397
|
-
|
|
2402
|
+
_chunkPUJHXHRAcjs.CdnIcon,
|
|
2398
2403
|
{
|
|
2399
2404
|
src: _chunkH577RJN5cjs.getChainIcon.call(void 0, sourceChainId),
|
|
2400
2405
|
className: "rs-deposit-address-dropdown-icon"
|
|
2401
2406
|
}
|
|
2402
2407
|
),
|
|
2403
2408
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainLabel(sourceChainId) }),
|
|
2404
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2409
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2405
2410
|
]
|
|
2406
2411
|
}
|
|
2407
2412
|
),
|
|
@@ -2413,7 +2418,7 @@ function DepositAddressStep({
|
|
|
2413
2418
|
onClick: () => handleSelectChain(chainId),
|
|
2414
2419
|
children: [
|
|
2415
2420
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2416
|
-
|
|
2421
|
+
_chunkPUJHXHRAcjs.CdnIcon,
|
|
2417
2422
|
{
|
|
2418
2423
|
src: _chunkH577RJN5cjs.getChainIcon.call(void 0, chainId),
|
|
2419
2424
|
className: "rs-deposit-address-dropdown-icon"
|
|
@@ -2431,8 +2436,8 @@ function DepositAddressStep({
|
|
|
2431
2436
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
2432
2437
|
"Min.$",
|
|
2433
2438
|
(targetChain === _chunkH577RJN5cjs.HYPERCORE_CHAIN_ID || isHyperCore ? Math.max(_chunkH577RJN5cjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _72 => _72.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _73 => _73.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
2434
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2435
|
-
|
|
2439
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkA42XAHIBcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2440
|
+
_chunkPUJHXHRAcjs.InfoIcon,
|
|
2436
2441
|
{
|
|
2437
2442
|
className: "rs-deposit-address-min-icon",
|
|
2438
2443
|
"aria-hidden": "true"
|
|
@@ -2453,7 +2458,7 @@ function DepositAddressStep({
|
|
|
2453
2458
|
children: [
|
|
2454
2459
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenGlyph, { symbol: sourceTokenSymbol }),
|
|
2455
2460
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceTokenSymbol }),
|
|
2456
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2461
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2457
2462
|
]
|
|
2458
2463
|
}
|
|
2459
2464
|
),
|
|
@@ -2497,7 +2502,7 @@ function DepositAddressStep({
|
|
|
2497
2502
|
className: "rs-deposit-address-copy",
|
|
2498
2503
|
onClick: handleCopy,
|
|
2499
2504
|
children: [
|
|
2500
|
-
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2505
|
+
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.CopyIcon, {}),
|
|
2501
2506
|
copied ? "Copied!" : "Copy address"
|
|
2502
2507
|
]
|
|
2503
2508
|
}
|
|
@@ -2505,7 +2510,7 @@ function DepositAddressStep({
|
|
|
2505
2510
|
]
|
|
2506
2511
|
}
|
|
2507
2512
|
),
|
|
2508
|
-
targetChain === _chunkH577RJN5cjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2513
|
+
targetChain === _chunkH577RJN5cjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.Callout, { variant: "warning", children: "HyperCore's first deposit to a new account includes a ~1 USDC activation fee \u2014 send at least 1 USDC or it will fail." }),
|
|
2509
2514
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2510
2515
|
"div",
|
|
2511
2516
|
{
|
|
@@ -2523,16 +2528,16 @@ function DepositAddressStep({
|
|
|
2523
2528
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
|
|
2524
2529
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
|
|
2525
2530
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2526
|
-
|
|
2531
|
+
_chunkA42XAHIBcjs.Tooltip,
|
|
2527
2532
|
{
|
|
2528
2533
|
className: "rs-price-impact-info",
|
|
2529
2534
|
content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
|
|
2530
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2535
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.InfoIcon, { "aria-hidden": "true" })
|
|
2531
2536
|
}
|
|
2532
2537
|
)
|
|
2533
2538
|
] }),
|
|
2534
2539
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2535
|
-
|
|
2540
|
+
_chunkPUJHXHRAcjs.ChevronDownIcon,
|
|
2536
2541
|
{
|
|
2537
2542
|
className: "rs-price-impact-chevron",
|
|
2538
2543
|
"aria-hidden": "true"
|
|
@@ -2543,29 +2548,29 @@ function DepositAddressStep({
|
|
|
2543
2548
|
),
|
|
2544
2549
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-price-impact-panel", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-panel-inner", children: [
|
|
2545
2550
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
2546
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2551
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.PercentIcon, {}) }),
|
|
2547
2552
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
2548
2553
|
"Max slippage: ",
|
|
2549
2554
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.2%" })
|
|
2550
2555
|
] }),
|
|
2551
2556
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2552
|
-
|
|
2557
|
+
_chunkA42XAHIBcjs.Tooltip,
|
|
2553
2558
|
{
|
|
2554
2559
|
className: "rs-price-impact-info",
|
|
2555
2560
|
content: "Slippage accounts for price changes during execution. Slippage is adjusted per pair to ensure reliable execution.",
|
|
2556
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2561
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.InfoIcon, { "aria-hidden": "true" })
|
|
2557
2562
|
}
|
|
2558
2563
|
)
|
|
2559
2564
|
] }),
|
|
2560
2565
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
2561
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2566
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.ClockIcon, {}) }),
|
|
2562
2567
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
2563
2568
|
"Processing time: ",
|
|
2564
2569
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "< 1 min" })
|
|
2565
2570
|
] })
|
|
2566
2571
|
] }),
|
|
2567
2572
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
2568
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2573
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.PlusCircleIcon, {}) }),
|
|
2569
2574
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
2570
2575
|
"Max deposit:",
|
|
2571
2576
|
" ",
|
|
@@ -2596,7 +2601,7 @@ function DepositAddressStep({
|
|
|
2596
2601
|
},
|
|
2597
2602
|
deposit.id
|
|
2598
2603
|
)) }),
|
|
2599
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2604
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.PoweredBy, {})
|
|
2600
2605
|
] });
|
|
2601
2606
|
}
|
|
2602
2607
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -2644,7 +2649,7 @@ function FinalisingDepositStep() {
|
|
|
2644
2649
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "rs-finalising-subtitle", children: "We are depositing your funds to the application." })
|
|
2645
2650
|
] })
|
|
2646
2651
|
] }),
|
|
2647
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2652
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.PoweredBy, {})
|
|
2648
2653
|
] });
|
|
2649
2654
|
}
|
|
2650
2655
|
FinalisingDepositStep.displayName = "FinalisingDepositStep";
|
|
@@ -2674,7 +2679,7 @@ function SwappedOrderTracker({
|
|
|
2674
2679
|
];
|
|
2675
2680
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-swapped-tracker", children: [
|
|
2676
2681
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2677
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2682
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.HandCoinsIcon, {}), title }),
|
|
2678
2683
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ol", { className: "rs-swapped-tracker-steps", children: labels.map((label, idx) => {
|
|
2679
2684
|
const status = stepStates[idx];
|
|
2680
2685
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
@@ -2688,7 +2693,7 @@ function SwappedOrderTracker({
|
|
|
2688
2693
|
{
|
|
2689
2694
|
className: "rs-swapped-tracker-step-marker",
|
|
2690
2695
|
"aria-hidden": "true",
|
|
2691
|
-
children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2696
|
+
children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.CheckIcon, {}) : status === "failed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.CloseIcon, {}) : status === "active" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.Spinner, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2692
2697
|
"svg",
|
|
2693
2698
|
{
|
|
2694
2699
|
className: "rs-swapped-tracker-step-ring",
|
|
@@ -2723,7 +2728,7 @@ function SwappedOrderTracker({
|
|
|
2723
2728
|
}
|
|
2724
2729
|
)
|
|
2725
2730
|
] }),
|
|
2726
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2731
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.PoweredBy, {})
|
|
2727
2732
|
] });
|
|
2728
2733
|
}
|
|
2729
2734
|
function formatTrackerAmount(amount) {
|
|
@@ -2928,10 +2933,10 @@ function SwappedIframeStep({
|
|
|
2928
2933
|
const status = await service.fetchLatestStatus(smartAccount);
|
|
2929
2934
|
if (cancelled) return;
|
|
2930
2935
|
const event = status.lastEvent;
|
|
2931
|
-
const eventTxHash =
|
|
2936
|
+
const eventTxHash = _chunkA42XAHIBcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkA42XAHIBcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
2932
2937
|
if (baselineDepositTxHashRef.current === void 0) {
|
|
2933
2938
|
baselineDepositTxHashRef.current = eventTxHash;
|
|
2934
|
-
} else if (eventTxHash && (!baselineDepositTxHashRef.current || !
|
|
2939
|
+
} else if (eventTxHash && (!baselineDepositTxHashRef.current || !_chunkA42XAHIBcjs.txRefsMatch.call(void 0, eventTxHash, baselineDepositTxHashRef.current))) {
|
|
2935
2940
|
currentDepositTxHashRef.current = eventTxHash;
|
|
2936
2941
|
setLatestEvent(_nullishCoalesce(event, () => ( null)));
|
|
2937
2942
|
}
|
|
@@ -3005,10 +3010,10 @@ function SwappedIframeStep({
|
|
|
3005
3010
|
[orderState, latestEvent]
|
|
3006
3011
|
);
|
|
3007
3012
|
const terminalState = _react.useMemo.call(void 0, () => {
|
|
3008
|
-
if (
|
|
3013
|
+
if (_chunkA42XAHIBcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
|
|
3009
3014
|
return {
|
|
3010
3015
|
kind: "failed",
|
|
3011
|
-
message:
|
|
3016
|
+
message: _chunkA42XAHIBcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
|
|
3012
3017
|
};
|
|
3013
3018
|
}
|
|
3014
3019
|
if (_optionalChain([orderState, 'optionalAccess', _90 => _90.status]) === "order_cancelled") {
|
|
@@ -3031,7 +3036,7 @@ function SwappedIframeStep({
|
|
|
3031
3036
|
orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _92 => _92.orderCrypto]), () => ( null)),
|
|
3032
3037
|
// Base-unit source amount from the deposit row/event, consistent with the
|
|
3033
3038
|
// wallet/QR path. ProcessingStep + onLifecycle expect base units.
|
|
3034
|
-
amount: _nullishCoalesce(
|
|
3039
|
+
amount: _nullishCoalesce(_chunkA42XAHIBcjs.getEventSourceDetails.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0))).amount, () => ( null)),
|
|
3035
3040
|
expectedOrderUuid: expectedOrderUuidRef.current,
|
|
3036
3041
|
initialEvent: _nullishCoalesce(latestEvent, () => ( void 0))
|
|
3037
3042
|
};
|
|
@@ -3042,14 +3047,14 @@ function SwappedIframeStep({
|
|
|
3042
3047
|
}, [latestEvent, orderState, smartAccount]);
|
|
3043
3048
|
_react.useEffect.call(void 0, () => {
|
|
3044
3049
|
if (failedFiredRef.current || completeFiredRef.current) return;
|
|
3045
|
-
if (!
|
|
3050
|
+
if (!_chunkA42XAHIBcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) return;
|
|
3046
3051
|
const txHash = currentDepositTxHashRef.current;
|
|
3047
3052
|
if (!txHash) return;
|
|
3048
3053
|
failedFiredRef.current = true;
|
|
3049
3054
|
setPhase("tracker");
|
|
3050
3055
|
_optionalChain([onSwappedFailedRef, 'access', _93 => _93.current, 'optionalCall', _94 => _94(
|
|
3051
3056
|
txHash,
|
|
3052
|
-
|
|
3057
|
+
_chunkA42XAHIBcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
|
|
3053
3058
|
)]);
|
|
3054
3059
|
}, [latestEvent]);
|
|
3055
3060
|
const immersive = variant === "fiat" && phase === "iframe" && !loadError;
|
|
@@ -3095,7 +3100,7 @@ function SwappedIframeStep({
|
|
|
3095
3100
|
}
|
|
3096
3101
|
)
|
|
3097
3102
|
] }),
|
|
3098
|
-
!loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3103
|
+
!loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.Spinner, {}) }),
|
|
3099
3104
|
widgetUrl && !loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3100
3105
|
"iframe",
|
|
3101
3106
|
{
|
|
@@ -3118,11 +3123,11 @@ function SwappedIframeStep({
|
|
|
3118
3123
|
retryToken
|
|
3119
3124
|
)
|
|
3120
3125
|
] }) }),
|
|
3121
|
-
loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3126
|
+
loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.PoweredBy, {})
|
|
3122
3127
|
] });
|
|
3123
3128
|
}
|
|
3124
3129
|
function deriveStepStates(swappedStatus, latestEvent) {
|
|
3125
|
-
if (
|
|
3130
|
+
if (_chunkA42XAHIBcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
|
|
3126
3131
|
return ["complete", "complete", "failed", "pending"];
|
|
3127
3132
|
}
|
|
3128
3133
|
if (swappedStatus === "order_cancelled") {
|
|
@@ -3312,7 +3317,7 @@ ExchangeConnectStep.displayName = "ExchangeConnectStep";
|
|
|
3312
3317
|
function ExchangeLogo({ exchange }) {
|
|
3313
3318
|
const [failed, setFailed] = _react.useState.call(void 0, false);
|
|
3314
3319
|
if (!exchange.logoUrl || failed) {
|
|
3315
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3320
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.BankIcon, {});
|
|
3316
3321
|
}
|
|
3317
3322
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3318
3323
|
"img",
|
|
@@ -3393,14 +3398,14 @@ function ExchangeSelectStep({
|
|
|
3393
3398
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-exchange-select", children: [
|
|
3394
3399
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3395
3400
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3396
|
-
|
|
3401
|
+
_chunkPUJHXHRAcjs.BodyHeader,
|
|
3397
3402
|
{
|
|
3398
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3403
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.UnplugIcon, {}),
|
|
3399
3404
|
title: "Connect exchange",
|
|
3400
3405
|
subtitle: "Select an exchange to connect"
|
|
3401
3406
|
}
|
|
3402
3407
|
),
|
|
3403
|
-
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3408
|
+
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.Spinner, {}) }),
|
|
3404
3409
|
!loading && error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: [
|
|
3405
3410
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state-title", children: "Couldn\u2019t load exchanges" }),
|
|
3406
3411
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3426,7 +3431,7 @@ function ExchangeSelectStep({
|
|
|
3426
3431
|
)
|
|
3427
3432
|
] }),
|
|
3428
3433
|
!loading && !error && exchanges.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-grid", children: exchanges.map((exchange) => {
|
|
3429
|
-
const brand =
|
|
3434
|
+
const brand = _chunkA42XAHIBcjs.getExchangeLogo.call(void 0, exchange.name, exchange.connection);
|
|
3430
3435
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3431
3436
|
"button",
|
|
3432
3437
|
{
|
|
@@ -3451,7 +3456,7 @@ function ExchangeSelectStep({
|
|
|
3451
3456
|
);
|
|
3452
3457
|
}) })
|
|
3453
3458
|
] }),
|
|
3454
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3459
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.PoweredBy, {}),
|
|
3455
3460
|
exchangeFeeBps > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "rs-exchange-select-fee-note", children: [
|
|
3456
3461
|
"A ",
|
|
3457
3462
|
formatFeeRate(exchangeFeeBps),
|
|
@@ -3477,20 +3482,20 @@ function DepositAddressSkeleton({
|
|
|
3477
3482
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", "aria-busy": "true", children: [
|
|
3478
3483
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: "Preparing deposit details\u2026" }),
|
|
3479
3484
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
3480
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3485
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
3481
3486
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", "aria-hidden": "true", children: [
|
|
3482
3487
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
3483
3488
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
3484
3489
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown-trigger", children: [
|
|
3485
3490
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3486
|
-
|
|
3491
|
+
_chunkPUJHXHRAcjs.CdnIcon,
|
|
3487
3492
|
{
|
|
3488
3493
|
src: chainIcon,
|
|
3489
3494
|
className: "rs-deposit-address-dropdown-icon"
|
|
3490
3495
|
}
|
|
3491
3496
|
),
|
|
3492
3497
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainName }),
|
|
3493
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3498
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
3494
3499
|
] })
|
|
3495
3500
|
] }),
|
|
3496
3501
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
@@ -3499,8 +3504,8 @@ function DepositAddressSkeleton({
|
|
|
3499
3504
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
3500
3505
|
"Min.$",
|
|
3501
3506
|
(_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _109 => _109.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
3502
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3503
|
-
|
|
3507
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkA42XAHIBcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3508
|
+
_chunkPUJHXHRAcjs.InfoIcon,
|
|
3504
3509
|
{
|
|
3505
3510
|
className: "rs-deposit-address-min-icon",
|
|
3506
3511
|
"aria-hidden": "true"
|
|
@@ -3510,14 +3515,14 @@ function DepositAddressSkeleton({
|
|
|
3510
3515
|
] }),
|
|
3511
3516
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown-trigger", children: [
|
|
3512
3517
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3513
|
-
|
|
3518
|
+
_chunkPUJHXHRAcjs.TokenIcon,
|
|
3514
3519
|
{
|
|
3515
3520
|
symbol: defaultToken,
|
|
3516
3521
|
className: "rs-deposit-address-dropdown-icon"
|
|
3517
3522
|
}
|
|
3518
3523
|
),
|
|
3519
3524
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: defaultToken }),
|
|
3520
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3525
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
3521
3526
|
] })
|
|
3522
3527
|
] })
|
|
3523
3528
|
] }),
|
|
@@ -3538,7 +3543,7 @@ function DepositAddressSkeleton({
|
|
|
3538
3543
|
disabled: true,
|
|
3539
3544
|
"aria-hidden": "true",
|
|
3540
3545
|
children: [
|
|
3541
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3546
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.CopyIcon, {}),
|
|
3542
3547
|
"Copy address"
|
|
3543
3548
|
]
|
|
3544
3549
|
}
|
|
@@ -3551,16 +3556,16 @@ function DepositAddressSkeleton({
|
|
|
3551
3556
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
|
|
3552
3557
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
|
|
3553
3558
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3554
|
-
|
|
3559
|
+
_chunkA42XAHIBcjs.Tooltip,
|
|
3555
3560
|
{
|
|
3556
3561
|
className: "rs-price-impact-info",
|
|
3557
3562
|
content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
|
|
3558
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3563
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.InfoIcon, { "aria-hidden": "true" })
|
|
3559
3564
|
}
|
|
3560
3565
|
)
|
|
3561
3566
|
] }),
|
|
3562
3567
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3563
|
-
|
|
3568
|
+
_chunkPUJHXHRAcjs.ChevronDownIcon,
|
|
3564
3569
|
{
|
|
3565
3570
|
className: "rs-price-impact-chevron",
|
|
3566
3571
|
"aria-hidden": "true"
|
|
@@ -3568,7 +3573,7 @@ function DepositAddressSkeleton({
|
|
|
3568
3573
|
)
|
|
3569
3574
|
] }) })
|
|
3570
3575
|
] }),
|
|
3571
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3576
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.PoweredBy, {})
|
|
3572
3577
|
] });
|
|
3573
3578
|
}
|
|
3574
3579
|
DepositAddressSkeleton.displayName = "DepositAddressSkeleton";
|
|
@@ -3600,7 +3605,7 @@ function SolanaTokenSelectStep({
|
|
|
3600
3605
|
setError(null);
|
|
3601
3606
|
const portfolioBySymbol = {};
|
|
3602
3607
|
try {
|
|
3603
|
-
|
|
3608
|
+
_chunkPUJHXHRAcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
|
|
3604
3609
|
solanaAddress
|
|
3605
3610
|
});
|
|
3606
3611
|
const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
|
|
@@ -3623,12 +3628,12 @@ function SolanaTokenSelectStep({
|
|
|
3623
3628
|
};
|
|
3624
3629
|
}
|
|
3625
3630
|
}
|
|
3626
|
-
|
|
3631
|
+
_chunkPUJHXHRAcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
|
|
3627
3632
|
symbols: Object.keys(portfolioBySymbol)
|
|
3628
3633
|
});
|
|
3629
3634
|
} catch (err) {
|
|
3630
3635
|
if (!active) return;
|
|
3631
|
-
|
|
3636
|
+
_chunkPUJHXHRAcjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
|
|
3632
3637
|
solanaAddress
|
|
3633
3638
|
});
|
|
3634
3639
|
setError(
|
|
@@ -3675,7 +3680,7 @@ function SolanaTokenSelectStep({
|
|
|
3675
3680
|
const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
|
|
3676
3681
|
const numeric = Number(raw);
|
|
3677
3682
|
if (!Number.isFinite(numeric)) return raw;
|
|
3678
|
-
return
|
|
3683
|
+
return _chunkPUJHXHRAcjs.tokenFormatter.format(numeric);
|
|
3679
3684
|
} catch (e22) {
|
|
3680
3685
|
return "--";
|
|
3681
3686
|
}
|
|
@@ -3685,20 +3690,20 @@ function SolanaTokenSelectStep({
|
|
|
3685
3690
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
3686
3691
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
3687
3692
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3688
|
-
|
|
3693
|
+
_chunkPUJHXHRAcjs.BodyHeader,
|
|
3689
3694
|
{
|
|
3690
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3695
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.WalletIcon, {}),
|
|
3691
3696
|
title: "Your assets",
|
|
3692
3697
|
subtitle: "Select source assets to transfer"
|
|
3693
3698
|
}
|
|
3694
3699
|
),
|
|
3695
3700
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
3696
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3701
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
3697
3702
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
3698
3703
|
] }),
|
|
3699
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3704
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.Callout, { variant: "error", children: error }),
|
|
3700
3705
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
3701
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3706
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
3702
3707
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
3703
3708
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
3704
3709
|
solanaAddress.slice(0, 6),
|
|
@@ -3729,13 +3734,13 @@ function SolanaTokenSelectStep({
|
|
|
3729
3734
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
|
|
3730
3735
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-icon-wrapper", children: [
|
|
3731
3736
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3732
|
-
|
|
3737
|
+
_chunkPUJHXHRAcjs.TokenIcon,
|
|
3733
3738
|
{
|
|
3734
3739
|
symbol: entry.token.symbol,
|
|
3735
3740
|
fallback: entry.token.symbol.slice(0, 4)
|
|
3736
3741
|
}
|
|
3737
3742
|
) }),
|
|
3738
|
-
chainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3743
|
+
chainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.CdnIcon, { src: chainIcon, alt: chainName }) })
|
|
3739
3744
|
] }),
|
|
3740
3745
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-text", children: [
|
|
3741
3746
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-name-row", children: [
|
|
@@ -3752,14 +3757,14 @@ function SolanaTokenSelectStep({
|
|
|
3752
3757
|
] })
|
|
3753
3758
|
] })
|
|
3754
3759
|
] }),
|
|
3755
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ?
|
|
3760
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunkPUJHXHRAcjs.currencyFormatter.format(entry.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${entry.token.symbol}` : "--" })
|
|
3756
3761
|
]
|
|
3757
3762
|
},
|
|
3758
3763
|
entry.token.symbol
|
|
3759
3764
|
);
|
|
3760
3765
|
}) }),
|
|
3761
3766
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3762
|
-
|
|
3767
|
+
_chunkPUJHXHRAcjs.Button,
|
|
3763
3768
|
{
|
|
3764
3769
|
onClick: () => selectedEntry && onContinue(
|
|
3765
3770
|
selectedEntry.token,
|
|
@@ -3772,7 +3777,7 @@ function SolanaTokenSelectStep({
|
|
|
3772
3777
|
}
|
|
3773
3778
|
)
|
|
3774
3779
|
] }),
|
|
3775
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3780
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.PoweredBy, {})
|
|
3776
3781
|
] });
|
|
3777
3782
|
}
|
|
3778
3783
|
|
|
@@ -3824,7 +3829,7 @@ function SolanaAmountStep({
|
|
|
3824
3829
|
const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
|
|
3825
3830
|
const numeric = Number(raw);
|
|
3826
3831
|
if (!Number.isFinite(numeric)) return raw;
|
|
3827
|
-
return
|
|
3832
|
+
return _chunkPUJHXHRAcjs.tokenFormatter.format(numeric);
|
|
3828
3833
|
} catch (e24) {
|
|
3829
3834
|
return "\u2026";
|
|
3830
3835
|
}
|
|
@@ -3917,7 +3922,7 @@ function SolanaAmountStep({
|
|
|
3917
3922
|
const handlePresetClick = (percentage) => {
|
|
3918
3923
|
const formatted = computePresetAmount(percentage);
|
|
3919
3924
|
if (!formatted) return;
|
|
3920
|
-
|
|
3925
|
+
_chunkPUJHXHRAcjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
|
|
3921
3926
|
percentage,
|
|
3922
3927
|
symbol: token.symbol,
|
|
3923
3928
|
formatted
|
|
@@ -3952,7 +3957,7 @@ function SolanaAmountStep({
|
|
|
3952
3957
|
try {
|
|
3953
3958
|
amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
|
|
3954
3959
|
} catch (e29) {
|
|
3955
|
-
|
|
3960
|
+
_chunkPUJHXHRAcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
3956
3961
|
amount,
|
|
3957
3962
|
sourceAmount: sourceAmountStr,
|
|
3958
3963
|
reason: "parse-units-failed"
|
|
@@ -3967,7 +3972,7 @@ function SolanaAmountStep({
|
|
|
3967
3972
|
);
|
|
3968
3973
|
return;
|
|
3969
3974
|
}
|
|
3970
|
-
|
|
3975
|
+
_chunkPUJHXHRAcjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
|
|
3971
3976
|
symbol: token.symbol,
|
|
3972
3977
|
inputAmountUsd: amount,
|
|
3973
3978
|
sourceAmount: sourceAmountStr,
|
|
@@ -3980,7 +3985,7 @@ function SolanaAmountStep({
|
|
|
3980
3985
|
const continueDisabled = exceedsBalance || numericAmount === 0 && !isBelowMin;
|
|
3981
3986
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
3982
3987
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3983
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3988
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.WalletIcon, {}), title: "Wallet deposit" }),
|
|
3984
3989
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
3985
3990
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
3986
3991
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -4000,13 +4005,13 @@ function SolanaAmountStep({
|
|
|
4000
4005
|
" available",
|
|
4001
4006
|
computedBalanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
4002
4007
|
" (~",
|
|
4003
|
-
|
|
4008
|
+
_chunkPUJHXHRAcjs.currencyFormatter.format(computedBalanceUsd),
|
|
4004
4009
|
")"
|
|
4005
4010
|
] })
|
|
4006
4011
|
] }),
|
|
4007
4012
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
4008
4013
|
"Min. deposit ",
|
|
4009
|
-
|
|
4014
|
+
_chunkPUJHXHRAcjs.currencyFormatter.format(minDepositUsd)
|
|
4010
4015
|
] })
|
|
4011
4016
|
] })
|
|
4012
4017
|
] }),
|
|
@@ -4029,7 +4034,7 @@ function SolanaAmountStep({
|
|
|
4029
4034
|
"Solana ",
|
|
4030
4035
|
token.symbol
|
|
4031
4036
|
] }),
|
|
4032
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4037
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.TokenIcon, { symbol: token.symbol }) })
|
|
4033
4038
|
] })
|
|
4034
4039
|
] }),
|
|
4035
4040
|
targetChainName && targetTokenSymbol && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
@@ -4040,18 +4045,18 @@ function SolanaAmountStep({
|
|
|
4040
4045
|
" ",
|
|
4041
4046
|
targetTokenSymbol
|
|
4042
4047
|
] }),
|
|
4043
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4048
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.TokenIcon, { symbol: targetTokenSymbol }) })
|
|
4044
4049
|
] })
|
|
4045
4050
|
] }),
|
|
4046
4051
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
4047
4052
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
4048
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
4053
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkPUJHXHRAcjs.currencyFormatter.format(balanceAfterUsd) })
|
|
4049
4054
|
] })
|
|
4050
4055
|
] }),
|
|
4051
|
-
targetChain === _chunkH577RJN5cjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4052
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4056
|
+
targetChain === _chunkH577RJN5cjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.Callout, { variant: "warning", children: "First deposit to a new HyperCore account includes a ~1 USDC activation fee." }),
|
|
4057
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.Callout, { variant: "error", children: error }),
|
|
4053
4058
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4054
|
-
|
|
4059
|
+
_chunkPUJHXHRAcjs.Button,
|
|
4055
4060
|
{
|
|
4056
4061
|
onClick: handleContinue,
|
|
4057
4062
|
fullWidth: true,
|
|
@@ -4060,7 +4065,7 @@ function SolanaAmountStep({
|
|
|
4060
4065
|
}
|
|
4061
4066
|
)
|
|
4062
4067
|
] }),
|
|
4063
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4068
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.PoweredBy, {})
|
|
4064
4069
|
] });
|
|
4065
4070
|
}
|
|
4066
4071
|
|
|
@@ -4083,10 +4088,10 @@ var _spltoken = require('@solana/spl-token');
|
|
|
4083
4088
|
var DEFAULT_SOLANA_RPC_URL = "https://api.mainnet.solana.com";
|
|
4084
4089
|
var cachedConnections = /* @__PURE__ */ new Map();
|
|
4085
4090
|
function getSolanaRpcUrl(rpcUrls) {
|
|
4086
|
-
return _nullishCoalesce(
|
|
4091
|
+
return _nullishCoalesce(_chunkPUJHXHRAcjs.rpcUrlFor.call(void 0, rpcUrls, "solana"), () => ( DEFAULT_SOLANA_RPC_URL));
|
|
4087
4092
|
}
|
|
4088
4093
|
function hasConfiguredSolanaRpcUrl(rpcUrls) {
|
|
4089
|
-
return
|
|
4094
|
+
return _chunkPUJHXHRAcjs.rpcUrlFor.call(void 0, rpcUrls, "solana") !== void 0;
|
|
4090
4095
|
}
|
|
4091
4096
|
function getSolanaConnection(rpcUrls) {
|
|
4092
4097
|
const rpcUrl = getSolanaRpcUrl(rpcUrls);
|
|
@@ -4188,7 +4193,7 @@ function SolanaConfirmStep({
|
|
|
4188
4193
|
onError,
|
|
4189
4194
|
debug
|
|
4190
4195
|
}) {
|
|
4191
|
-
const rpcUrls =
|
|
4196
|
+
const rpcUrls = _chunkPUJHXHRAcjs.useRpcUrls.call(void 0, );
|
|
4192
4197
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
4193
4198
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
4194
4199
|
const targetSymbol = _chunkH577RJN5cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
@@ -4198,26 +4203,26 @@ function SolanaConfirmStep({
|
|
|
4198
4203
|
const targetChainIcon = _chunkH577RJN5cjs.getChainIcon.call(void 0, targetChain);
|
|
4199
4204
|
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _118 => _118.feeSponsored]), () => ( false));
|
|
4200
4205
|
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _119 => _119.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
4201
|
-
const formattedAmount = sourceAmount && Number.isFinite(Number(sourceAmount)) ? _nullishCoalesce(
|
|
4206
|
+
const formattedAmount = sourceAmount && Number.isFinite(Number(sourceAmount)) ? _nullishCoalesce(_chunkPUJHXHRAcjs.formatTokenAmount.call(void 0, Number(sourceAmount), token.symbol), () => ( "0")) : "0";
|
|
4202
4207
|
const receiveDisplay = (() => {
|
|
4203
4208
|
const usdValue = Number(targetAmount);
|
|
4204
4209
|
const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
|
|
4205
|
-
const estimate =
|
|
4210
|
+
const estimate = _chunkPUJHXHRAcjs.formatReceiveEstimate.call(void 0, {
|
|
4206
4211
|
sourceAmount: Number.isFinite(Number(sourceAmount)) ? Number(sourceAmount) : void 0,
|
|
4207
4212
|
sourceSymbol: token.symbol,
|
|
4208
4213
|
targetSymbol,
|
|
4209
4214
|
sourceAmountUsd,
|
|
4210
|
-
sourceTrusted:
|
|
4215
|
+
sourceTrusted: _chunkPUJHXHRAcjs.isRecognizedToken.call(void 0, token.mint, "solana"),
|
|
4211
4216
|
// Curated stablecoin target estimates at $1 when unquoted; never applied
|
|
4212
4217
|
// to the source (a held token). See ConfirmStep for the rationale.
|
|
4213
|
-
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } :
|
|
4218
|
+
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : _chunkPUJHXHRAcjs.isDisplayStablecoinSymbol.call(void 0, targetSymbol) ? { [targetSymbol.toUpperCase()]: 1 } : {}
|
|
4214
4219
|
});
|
|
4215
4220
|
if (estimate !== void 0) return estimate;
|
|
4216
4221
|
return targetSymbol;
|
|
4217
4222
|
})();
|
|
4218
4223
|
const handleConfirm = async () => {
|
|
4219
4224
|
if (!solanaProvider) {
|
|
4220
|
-
|
|
4225
|
+
_chunkPUJHXHRAcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
4221
4226
|
reason: "missing-provider"
|
|
4222
4227
|
});
|
|
4223
4228
|
setError("Solana wallet not connected");
|
|
@@ -4225,7 +4230,7 @@ function SolanaConfirmStep({
|
|
|
4225
4230
|
}
|
|
4226
4231
|
const parsedAmount = parseFloat(sourceAmount);
|
|
4227
4232
|
if (isNaN(parsedAmount) || parsedAmount <= 0) {
|
|
4228
|
-
|
|
4233
|
+
_chunkPUJHXHRAcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
4229
4234
|
reason: "invalid-amount",
|
|
4230
4235
|
sourceAmount
|
|
4231
4236
|
});
|
|
@@ -4234,7 +4239,7 @@ function SolanaConfirmStep({
|
|
|
4234
4239
|
}
|
|
4235
4240
|
setError(null);
|
|
4236
4241
|
setIsSubmitting(true);
|
|
4237
|
-
|
|
4242
|
+
_chunkPUJHXHRAcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
|
|
4238
4243
|
smartAccount,
|
|
4239
4244
|
solanaAddress,
|
|
4240
4245
|
solanaDepositAddress,
|
|
@@ -4244,7 +4249,7 @@ function SolanaConfirmStep({
|
|
|
4244
4249
|
});
|
|
4245
4250
|
try {
|
|
4246
4251
|
const check = await service.checkAccount(smartAccount);
|
|
4247
|
-
|
|
4252
|
+
_chunkPUJHXHRAcjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
|
|
4248
4253
|
smartAccount,
|
|
4249
4254
|
isRegistered: check.isRegistered,
|
|
4250
4255
|
targetChain: check.targetChain,
|
|
@@ -4257,7 +4262,7 @@ function SolanaConfirmStep({
|
|
|
4257
4262
|
}
|
|
4258
4263
|
const connection = hasConfiguredSolanaRpcUrl(rpcUrls) ? getSolanaConnection(rpcUrls) : _nullishCoalesce(solanaConnection, () => ( getSolanaConnection(rpcUrls)));
|
|
4259
4264
|
const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
|
|
4260
|
-
|
|
4265
|
+
_chunkPUJHXHRAcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
|
|
4261
4266
|
token: token.symbol,
|
|
4262
4267
|
sourceAmount,
|
|
4263
4268
|
amountUnits: amountUnits.toString()
|
|
@@ -4274,7 +4279,7 @@ function SolanaConfirmStep({
|
|
|
4274
4279
|
token.mint,
|
|
4275
4280
|
amountUnits
|
|
4276
4281
|
);
|
|
4277
|
-
|
|
4282
|
+
_chunkPUJHXHRAcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
4278
4283
|
token: token.symbol,
|
|
4279
4284
|
instructionCount: transaction.instructions.length,
|
|
4280
4285
|
feePayer: _optionalChain([transaction, 'access', _120 => _120.feePayer, 'optionalAccess', _121 => _121.toBase58, 'call', _122 => _122()]),
|
|
@@ -4285,7 +4290,7 @@ function SolanaConfirmStep({
|
|
|
4285
4290
|
connection,
|
|
4286
4291
|
transaction
|
|
4287
4292
|
);
|
|
4288
|
-
|
|
4293
|
+
_chunkPUJHXHRAcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
|
|
4289
4294
|
txHash,
|
|
4290
4295
|
amountUnits: amountUnits.toString()
|
|
4291
4296
|
});
|
|
@@ -4297,8 +4302,8 @@ function SolanaConfirmStep({
|
|
|
4297
4302
|
});
|
|
4298
4303
|
} catch (err) {
|
|
4299
4304
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
4300
|
-
const message =
|
|
4301
|
-
|
|
4305
|
+
const message = _chunkPUJHXHRAcjs.formatUserError.call(void 0, raw);
|
|
4306
|
+
_chunkPUJHXHRAcjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
|
|
4302
4307
|
smartAccount,
|
|
4303
4308
|
token: token.symbol,
|
|
4304
4309
|
sourceAmount
|
|
@@ -4311,20 +4316,20 @@ function SolanaConfirmStep({
|
|
|
4311
4316
|
};
|
|
4312
4317
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
4313
4318
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4314
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4319
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.WalletIcon, {}), title: "Review deposit" }),
|
|
4315
4320
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
|
|
4316
4321
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
4317
4322
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
4318
4323
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
4319
4324
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceChainName }),
|
|
4320
|
-
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4325
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.CdnIcon, { src: sourceChainIcon }) })
|
|
4321
4326
|
] })
|
|
4322
4327
|
] }),
|
|
4323
4328
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
4324
4329
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
|
|
4325
4330
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
4326
4331
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName }),
|
|
4327
|
-
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4332
|
+
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.CdnIcon, { src: targetChainIcon }) })
|
|
4328
4333
|
] })
|
|
4329
4334
|
] }),
|
|
4330
4335
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -4339,14 +4344,14 @@ function SolanaConfirmStep({
|
|
|
4339
4344
|
" ",
|
|
4340
4345
|
token.symbol
|
|
4341
4346
|
] }),
|
|
4342
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4347
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.TokenIcon, { symbol: token.symbol }) })
|
|
4343
4348
|
] })
|
|
4344
4349
|
] }),
|
|
4345
4350
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
4346
4351
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Receive" }),
|
|
4347
4352
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
4348
4353
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: receiveDisplay }),
|
|
4349
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4354
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.TokenIcon, { symbol: targetSymbol }) })
|
|
4350
4355
|
] })
|
|
4351
4356
|
] }),
|
|
4352
4357
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -4359,13 +4364,13 @@ function SolanaConfirmStep({
|
|
|
4359
4364
|
children: "$0.04"
|
|
4360
4365
|
}
|
|
4361
4366
|
),
|
|
4362
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4367
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkA42XAHIBcjs.Tooltip, { content: feeTooltip, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-info", "aria-label": "Fee info", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.InfoIcon, {}) }) })
|
|
4363
4368
|
] })
|
|
4364
4369
|
] })
|
|
4365
4370
|
] }),
|
|
4366
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4371
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.Callout, { variant: "error", children: error }),
|
|
4367
4372
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4368
|
-
|
|
4373
|
+
_chunkPUJHXHRAcjs.Button,
|
|
4369
4374
|
{
|
|
4370
4375
|
onClick: handleConfirm,
|
|
4371
4376
|
loading: isSubmitting,
|
|
@@ -4376,7 +4381,7 @@ function SolanaConfirmStep({
|
|
|
4376
4381
|
}
|
|
4377
4382
|
)
|
|
4378
4383
|
] }),
|
|
4379
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4384
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.PoweredBy, {})
|
|
4380
4385
|
] });
|
|
4381
4386
|
}
|
|
4382
4387
|
|
|
@@ -4385,23 +4390,25 @@ function SolanaConfirmStep({
|
|
|
4385
4390
|
function DappImportAssetSelectStep({
|
|
4386
4391
|
sourceLabel,
|
|
4387
4392
|
assets,
|
|
4393
|
+
incompleteSummary,
|
|
4388
4394
|
onSelect
|
|
4389
4395
|
}) {
|
|
4390
4396
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
4391
4397
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4392
4398
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4393
|
-
|
|
4399
|
+
_chunkPUJHXHRAcjs.BodyHeader,
|
|
4394
4400
|
{
|
|
4395
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4401
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.WalletIcon, {}),
|
|
4396
4402
|
title: `Transfer from ${sourceLabel}`,
|
|
4397
4403
|
subtitle: "Pick the balance to import"
|
|
4398
4404
|
}
|
|
4399
4405
|
),
|
|
4406
|
+
incompleteSummary && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-notice", role: "status", children: incompleteSummary }),
|
|
4400
4407
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: assets.map((asset) => {
|
|
4401
|
-
const tokenAmount = asset.balance ?
|
|
4408
|
+
const tokenAmount = asset.balance ? _chunkPUJHXHRAcjs.tokenFormatter.format(
|
|
4402
4409
|
Number(asset.balance) / 10 ** asset.decimals
|
|
4403
4410
|
) : "0";
|
|
4404
|
-
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ?
|
|
4411
|
+
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ? _chunkPUJHXHRAcjs.currencyFormatter.format(asset.balanceUsd) : `${tokenAmount} ${asset.symbol}`;
|
|
4405
4412
|
const assetIcon = asset.icon;
|
|
4406
4413
|
const chainIcon = _chunkH577RJN5cjs.getChainIcon.call(void 0, asset.chainId);
|
|
4407
4414
|
const badge = _chunkH577RJN5cjs.getChainBadge.call(void 0, asset.chainId);
|
|
@@ -4414,14 +4421,14 @@ function DappImportAssetSelectStep({
|
|
|
4414
4421
|
children: [
|
|
4415
4422
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
|
|
4416
4423
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-icon-wrapper", children: [
|
|
4417
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: assetIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4418
|
-
|
|
4424
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: assetIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.CdnIcon, { src: assetIcon, alt: asset.symbol }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4425
|
+
_chunkPUJHXHRAcjs.TokenIcon,
|
|
4419
4426
|
{
|
|
4420
4427
|
symbol: asset.symbol,
|
|
4421
4428
|
fallback: asset.symbol.slice(0, 4)
|
|
4422
4429
|
}
|
|
4423
4430
|
) }),
|
|
4424
|
-
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4431
|
+
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.CdnIcon, { src: chainIcon, alt: _chunkH577RJN5cjs.getChainName.call(void 0, asset.chainId) }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4425
4432
|
"span",
|
|
4426
4433
|
{
|
|
4427
4434
|
className: "rs-asset-chain-badge",
|
|
@@ -4435,7 +4442,8 @@ function DappImportAssetSelectStep({
|
|
|
4435
4442
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-name", children: asset.symbol }),
|
|
4436
4443
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-asset-chain", children: [
|
|
4437
4444
|
"on ",
|
|
4438
|
-
asset.sourceLabel
|
|
4445
|
+
asset.sourceLabel,
|
|
4446
|
+
asset.qualifier ? ` \xB7 ${asset.qualifier}` : ""
|
|
4439
4447
|
] })
|
|
4440
4448
|
] }),
|
|
4441
4449
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-balance-small", children: [
|
|
@@ -4452,7 +4460,7 @@ function DappImportAssetSelectStep({
|
|
|
4452
4460
|
);
|
|
4453
4461
|
}) })
|
|
4454
4462
|
] }),
|
|
4455
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4463
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.PoweredBy, {})
|
|
4456
4464
|
] });
|
|
4457
4465
|
}
|
|
4458
4466
|
DappImportAssetSelectStep.displayName = "DappImportAssetSelectStep";
|
|
@@ -4474,7 +4482,7 @@ function describeRow(status, comingSoon) {
|
|
|
4474
4482
|
}
|
|
4475
4483
|
if (status.enabled) {
|
|
4476
4484
|
return {
|
|
4477
|
-
subtitle: status.balanceUsd > 0 ?
|
|
4485
|
+
subtitle: status.balanceUsd > 0 ? _chunkPUJHXHRAcjs.currencyFormatter.format(status.balanceUsd) : "No balance",
|
|
4478
4486
|
disabled: false,
|
|
4479
4487
|
busy: false
|
|
4480
4488
|
};
|
|
@@ -4497,9 +4505,9 @@ function DappImportSelectStep({
|
|
|
4497
4505
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
4498
4506
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4499
4507
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4500
|
-
|
|
4508
|
+
_chunkPUJHXHRAcjs.BodyHeader,
|
|
4501
4509
|
{
|
|
4502
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4510
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.MigrateAssetsIcon, {}),
|
|
4503
4511
|
title: "Migrate assets",
|
|
4504
4512
|
subtitle: "Select a position to migrate"
|
|
4505
4513
|
}
|
|
@@ -4511,13 +4519,13 @@ function DappImportSelectStep({
|
|
|
4511
4519
|
Boolean(brand.comingSoon)
|
|
4512
4520
|
);
|
|
4513
4521
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4514
|
-
|
|
4522
|
+
_chunkVTVOHNXMcjs.ListRow,
|
|
4515
4523
|
{
|
|
4516
4524
|
leadingMedia: brand.iconUrl,
|
|
4517
4525
|
title: brand.label,
|
|
4518
4526
|
subtitle,
|
|
4519
4527
|
disabled,
|
|
4520
|
-
trailing: busy ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4528
|
+
trailing: busy ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.Spinner, { className: "rs-spinner--sm" }) : void 0,
|
|
4521
4529
|
onClick: () => {
|
|
4522
4530
|
if (status === "needs-connect") {
|
|
4523
4531
|
_optionalChain([onRequestConnect, 'optionalCall', _124 => _124()]);
|
|
@@ -4530,7 +4538,7 @@ function DappImportSelectStep({
|
|
|
4530
4538
|
);
|
|
4531
4539
|
}) })
|
|
4532
4540
|
] }),
|
|
4533
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4541
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.PoweredBy, {})
|
|
4534
4542
|
] });
|
|
4535
4543
|
}
|
|
4536
4544
|
DappImportSelectStep.displayName = "DappImportSelectStep";
|
|
@@ -4547,9 +4555,9 @@ function DappImportAssetSelectSkeleton({
|
|
|
4547
4555
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: error ? "Couldn't load balances" : "Loading balances\u2026" }),
|
|
4548
4556
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4549
4557
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4550
|
-
|
|
4558
|
+
_chunkPUJHXHRAcjs.BodyHeader,
|
|
4551
4559
|
{
|
|
4552
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4560
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.WalletIcon, {}),
|
|
4553
4561
|
title: `Transfer from ${sourceLabel}`,
|
|
4554
4562
|
subtitle: "Pick the balance to import"
|
|
4555
4563
|
}
|
|
@@ -4587,7 +4595,7 @@ function DappImportAssetSelectSkeleton({
|
|
|
4587
4595
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Try again" })
|
|
4588
4596
|
}
|
|
4589
4597
|
) }),
|
|
4590
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4598
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.PoweredBy, {})
|
|
4591
4599
|
] });
|
|
4592
4600
|
}
|
|
4593
4601
|
DappImportAssetSelectSkeleton.displayName = "DappImportAssetSelectSkeleton";
|
|
@@ -4649,6 +4657,188 @@ function composeFiatMethods(regional, fallbackMethods) {
|
|
|
4649
4657
|
};
|
|
4650
4658
|
}
|
|
4651
4659
|
|
|
4660
|
+
// src/core/dapp-imports/balance-source.ts
|
|
4661
|
+
function dappImportBalanceSource(asset) {
|
|
4662
|
+
if (!isDappImportAsset(asset)) return {};
|
|
4663
|
+
if (asset.balanceAddress) return { balanceAddress: asset.balanceAddress };
|
|
4664
|
+
if (asset.balance === void 0) return {};
|
|
4665
|
+
try {
|
|
4666
|
+
return { declaredBalance: BigInt(asset.balance) };
|
|
4667
|
+
} catch (e30) {
|
|
4668
|
+
return {};
|
|
4669
|
+
}
|
|
4670
|
+
}
|
|
4671
|
+
|
|
4672
|
+
// src/core/dapp-imports/aave/index.ts
|
|
4673
|
+
var PROVIDER_ID = "aave";
|
|
4674
|
+
var SOURCE_LABEL = "Aave";
|
|
4675
|
+
var POLICY_REFUSED = [
|
|
4676
|
+
"below_deposit_floor",
|
|
4677
|
+
"deposit_not_whitelisted"
|
|
4678
|
+
];
|
|
4679
|
+
var aaveProvider = {
|
|
4680
|
+
id: PROVIDER_ID,
|
|
4681
|
+
sourceLabel: SOURCE_LABEL,
|
|
4682
|
+
async fetchAvailability({ eoa, backend, signal }) {
|
|
4683
|
+
if (!backend) {
|
|
4684
|
+
throw new Error("Aave positions require a backend connection");
|
|
4685
|
+
}
|
|
4686
|
+
const response = await backend.getPositions(eoa);
|
|
4687
|
+
if (_optionalChain([signal, 'optionalAccess', _125 => _125.aborted])) return null;
|
|
4688
|
+
const assets = toImportableAssets(response.positions);
|
|
4689
|
+
const failures = _nullishCoalesce(response.failures, () => ( []));
|
|
4690
|
+
if (assets.length === 0) {
|
|
4691
|
+
if (failures.length > 0) {
|
|
4692
|
+
throw new Error(
|
|
4693
|
+
`Could not read Aave positions: ${failures.map((failure) => failure.reason).join("; ")}`
|
|
4694
|
+
);
|
|
4695
|
+
}
|
|
4696
|
+
return null;
|
|
4697
|
+
}
|
|
4698
|
+
const availability = {
|
|
4699
|
+
providerId: PROVIDER_ID,
|
|
4700
|
+
// Deliberately the sum over importable assets rather than
|
|
4701
|
+
// `response.totalUsd`: the latter counts positions this flow filters out,
|
|
4702
|
+
// so using it would show a balance the user then cannot find.
|
|
4703
|
+
totalUsd: assets.reduce((sum, asset) => sum + (_nullishCoalesce(asset.balanceUsd, () => ( 0))), 0),
|
|
4704
|
+
assets,
|
|
4705
|
+
// Some markets read, some did not. Erroring would discard positions the
|
|
4706
|
+
// user can migrate right now — and with ~29 markets on a keyless API, one
|
|
4707
|
+
// failing is the expected case, so erroring would be the normal outcome.
|
|
4708
|
+
// The list therefore stands, marked as a floor. The upstream reason names
|
|
4709
|
+
// an internal market, so it is summarised rather than surfaced.
|
|
4710
|
+
...failures.length > 0 ? {
|
|
4711
|
+
incomplete: {
|
|
4712
|
+
summary: failures.length === 1 ? "One Aave market couldn't be loaded, so a position may be missing." : `${failures.length} Aave markets couldn't be loaded, so positions may be missing.`
|
|
4713
|
+
}
|
|
4714
|
+
} : {}
|
|
4715
|
+
};
|
|
4716
|
+
return availability;
|
|
4717
|
+
},
|
|
4718
|
+
async executeTransfer({ walletClient, recipient, asset, amount, backend }) {
|
|
4719
|
+
if (!backend) {
|
|
4720
|
+
throw new Error("Aave withdrawals require a backend connection");
|
|
4721
|
+
}
|
|
4722
|
+
const metadata = asset.providerMetadata;
|
|
4723
|
+
const account = walletClient.account;
|
|
4724
|
+
const chain = walletClient.chain;
|
|
4725
|
+
if (!account || !chain) {
|
|
4726
|
+
throw new Error("Wallet not connected");
|
|
4727
|
+
}
|
|
4728
|
+
if (chain.id !== metadata.chainId) {
|
|
4729
|
+
throw new Error(
|
|
4730
|
+
`Switch to ${metadata.marketName} chain (${metadata.chainId}) to sign`
|
|
4731
|
+
);
|
|
4732
|
+
}
|
|
4733
|
+
const prepared = await backend.prepareUnwind({
|
|
4734
|
+
address: account.address,
|
|
4735
|
+
// The backend resolves the recipient from this account rather than
|
|
4736
|
+
// trusting a supplied address. `amount` is always explicit — expressing
|
|
4737
|
+
// "everything" is the backend's call, since only it knows whether sweeping
|
|
4738
|
+
// accrued interest could push the delivered amount past a whitelist
|
|
4739
|
+
// ceiling and get the proceeds rejected after the withdraw succeeded.
|
|
4740
|
+
account: recipient,
|
|
4741
|
+
market: metadata.market,
|
|
4742
|
+
chainId: metadata.chainId,
|
|
4743
|
+
asset: metadata.asset,
|
|
4744
|
+
amount: amount.toString()
|
|
4745
|
+
});
|
|
4746
|
+
if (prepared.recipient.toLowerCase() !== recipient.toLowerCase()) {
|
|
4747
|
+
throw new Error(
|
|
4748
|
+
"Aave withdrawal would send funds to an unexpected address"
|
|
4749
|
+
);
|
|
4750
|
+
}
|
|
4751
|
+
if (prepared.transaction.chainId !== metadata.chainId) {
|
|
4752
|
+
throw new Error("Aave withdrawal was prepared for a different chain");
|
|
4753
|
+
}
|
|
4754
|
+
const txHash = await walletClient.sendTransaction({
|
|
4755
|
+
account,
|
|
4756
|
+
chain,
|
|
4757
|
+
to: prepared.transaction.to,
|
|
4758
|
+
data: prepared.transaction.data,
|
|
4759
|
+
value: BigInt(prepared.transaction.value)
|
|
4760
|
+
});
|
|
4761
|
+
return {
|
|
4762
|
+
txHash,
|
|
4763
|
+
// Aave pays out the underlying straight to the deposit address — no
|
|
4764
|
+
// unwrap, no swap, so what arrives is what was supplied.
|
|
4765
|
+
sourceToken: metadata.asset,
|
|
4766
|
+
sourceSymbol: asset.symbol,
|
|
4767
|
+
sourceDecimals: asset.decimals
|
|
4768
|
+
};
|
|
4769
|
+
}
|
|
4770
|
+
};
|
|
4771
|
+
function toImportableAssets(positions) {
|
|
4772
|
+
const assets = [];
|
|
4773
|
+
for (const position of positions) {
|
|
4774
|
+
const chainId = _chunkH577RJN5cjs.parseEvmChainId.call(void 0, position.chain);
|
|
4775
|
+
if (chainId === null) continue;
|
|
4776
|
+
if (!_chunkH577RJN5cjs.CHAIN_BY_ID[chainId]) continue;
|
|
4777
|
+
if (BigInt(position.maxWithdrawable) <= 0n) continue;
|
|
4778
|
+
if (position.constraints.some((c) => POLICY_REFUSED.includes(c))) continue;
|
|
4779
|
+
assets.push(buildAsset(position, chainId));
|
|
4780
|
+
}
|
|
4781
|
+
return qualifyAmbiguousMarkets(assets);
|
|
4782
|
+
}
|
|
4783
|
+
function buildAsset(position, chainId) {
|
|
4784
|
+
const { asset, market } = position;
|
|
4785
|
+
const token = asset.address.toLowerCase();
|
|
4786
|
+
const metadata = {
|
|
4787
|
+
market: market.address,
|
|
4788
|
+
marketName: market.name,
|
|
4789
|
+
chainId,
|
|
4790
|
+
asset: asset.address
|
|
4791
|
+
};
|
|
4792
|
+
return {
|
|
4793
|
+
// Market-keyed, so one chain holding the same token in two markets yields
|
|
4794
|
+
// two distinct rows rather than one that silently shadows the other.
|
|
4795
|
+
id: `aave:${chainId}:${market.address.toLowerCase()}:${token}`,
|
|
4796
|
+
chainId,
|
|
4797
|
+
token,
|
|
4798
|
+
symbol: asset.symbol,
|
|
4799
|
+
// The market name, not a token description: it is what tells four Aave v3
|
|
4800
|
+
// markets on Ethereum apart.
|
|
4801
|
+
name: market.name,
|
|
4802
|
+
decimals: asset.decimals,
|
|
4803
|
+
// `maxWithdrawable`, NOT the supplied balance. The amount selector lets the
|
|
4804
|
+
// user pick up to this, and seeding it with the supplied balance would let
|
|
4805
|
+
// them choose above the cap and sign a withdraw the pool rejects.
|
|
4806
|
+
balance: position.maxWithdrawable,
|
|
4807
|
+
balanceUsd: withdrawableUsd(position),
|
|
4808
|
+
source: PROVIDER_ID,
|
|
4809
|
+
sourceLabel: SOURCE_LABEL,
|
|
4810
|
+
reviewLabel: `You withdraw ${asset.symbol} from Aave`,
|
|
4811
|
+
// Aave sends the underlying itself to the deposit address, so the token the
|
|
4812
|
+
// orchestrator sees land is the same one and on the same chain.
|
|
4813
|
+
depositToken: token,
|
|
4814
|
+
depositChainId: chainId,
|
|
4815
|
+
providerMetadata: metadata
|
|
4816
|
+
};
|
|
4817
|
+
}
|
|
4818
|
+
function qualifyAmbiguousMarkets(assets) {
|
|
4819
|
+
const counts = /* @__PURE__ */ new Map();
|
|
4820
|
+
for (const asset of assets) {
|
|
4821
|
+
const key = `${asset.chainId}:${asset.token}`;
|
|
4822
|
+
counts.set(key, (_nullishCoalesce(counts.get(key), () => ( 0))) + 1);
|
|
4823
|
+
}
|
|
4824
|
+
return assets.map(
|
|
4825
|
+
(asset) => (_nullishCoalesce(counts.get(`${asset.chainId}:${asset.token}`), () => ( 0))) > 1 ? {
|
|
4826
|
+
...asset,
|
|
4827
|
+
qualifier: asset.providerMetadata.marketName
|
|
4828
|
+
} : asset
|
|
4829
|
+
);
|
|
4830
|
+
}
|
|
4831
|
+
function withdrawableUsd(position) {
|
|
4832
|
+
const amount = BigInt(position.amount);
|
|
4833
|
+
const withdrawable = BigInt(position.maxWithdrawable);
|
|
4834
|
+
if (amount === 0n) return 0;
|
|
4835
|
+
if (withdrawable === amount) return position.usdValue;
|
|
4836
|
+
const SCALE = 1000000n;
|
|
4837
|
+
const ratio = Number(withdrawable * SCALE / amount) / Number(SCALE);
|
|
4838
|
+
const usd = position.usdValue * ratio;
|
|
4839
|
+
return Number.isFinite(usd) ? usd : 0;
|
|
4840
|
+
}
|
|
4841
|
+
|
|
4652
4842
|
// src/core/dapp-imports/polymarket/index.ts
|
|
4653
4843
|
|
|
4654
4844
|
|
|
@@ -4819,44 +5009,43 @@ function buildPusdUnwrapCalls(recipient, amount) {
|
|
|
4819
5009
|
}
|
|
4820
5010
|
|
|
4821
5011
|
// src/core/dapp-imports/polymarket/index.ts
|
|
4822
|
-
var
|
|
5012
|
+
var PROVIDER_ID2 = "polymarket";
|
|
4823
5013
|
var polymarketProvider = {
|
|
4824
|
-
id:
|
|
5014
|
+
id: PROVIDER_ID2,
|
|
4825
5015
|
sourceLabel: "Polymarket",
|
|
4826
|
-
chainId: _chunkYEBXUUH3cjs.POLYMARKET_POLYGON_CHAIN_ID,
|
|
4827
5016
|
async fetchAvailability({ eoa, getPublicClient: getPublicClient2, signal }) {
|
|
4828
5017
|
const proxyWallet = await _chunkYEBXUUH3cjs.fetchPolymarketProxyWallet.call(void 0, eoa, signal);
|
|
4829
5018
|
if (!proxyWallet) return null;
|
|
4830
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
5019
|
+
if (_optionalChain([signal, 'optionalAccess', _126 => _126.aborted])) return null;
|
|
4831
5020
|
const polygonClient = getPublicClient2(_chunkYEBXUUH3cjs.POLYMARKET_POLYGON_CHAIN_ID);
|
|
4832
5021
|
if (!polygonClient) return null;
|
|
4833
5022
|
const balances = await _chunkYEBXUUH3cjs.readPolymarketBalances.call(void 0, {
|
|
4834
5023
|
publicClient: polygonClient,
|
|
4835
5024
|
proxyWallet
|
|
4836
5025
|
});
|
|
4837
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
5026
|
+
if (_optionalChain([signal, 'optionalAccess', _127 => _127.aborted])) return null;
|
|
4838
5027
|
if (balances.pusd === 0n && balances.usdce === 0n) return null;
|
|
4839
5028
|
const walletKind = await detectPolymarketWalletKind({
|
|
4840
5029
|
publicClient: polygonClient,
|
|
4841
5030
|
proxyWallet,
|
|
4842
5031
|
eoa
|
|
4843
5032
|
});
|
|
4844
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
5033
|
+
if (_optionalChain([signal, 'optionalAccess', _128 => _128.aborted])) return null;
|
|
4845
5034
|
if (!walletKind) return null;
|
|
4846
5035
|
const assets = [];
|
|
4847
5036
|
if (balances.pusd > 0n) {
|
|
4848
5037
|
assets.push(
|
|
4849
|
-
|
|
5038
|
+
buildAsset2({ tokenKind: "pusd", proxyWallet, walletKind, balance: balances.pusd })
|
|
4850
5039
|
);
|
|
4851
5040
|
}
|
|
4852
5041
|
if (balances.usdce > 0n) {
|
|
4853
5042
|
assets.push(
|
|
4854
|
-
|
|
5043
|
+
buildAsset2({ tokenKind: "usdce", proxyWallet, walletKind, balance: balances.usdce })
|
|
4855
5044
|
);
|
|
4856
5045
|
}
|
|
4857
5046
|
const totalUsd = assets.reduce((sum, a) => sum + (_nullishCoalesce(a.balanceUsd, () => ( 0))), 0);
|
|
4858
5047
|
const availability = {
|
|
4859
|
-
providerId:
|
|
5048
|
+
providerId: PROVIDER_ID2,
|
|
4860
5049
|
totalUsd,
|
|
4861
5050
|
assets
|
|
4862
5051
|
};
|
|
@@ -4904,7 +5093,7 @@ var polymarketProvider = {
|
|
|
4904
5093
|
};
|
|
4905
5094
|
}
|
|
4906
5095
|
};
|
|
4907
|
-
function
|
|
5096
|
+
function buildAsset2(params) {
|
|
4908
5097
|
const { tokenKind, proxyWallet, walletKind, balance } = params;
|
|
4909
5098
|
const isPusd = tokenKind === "pusd";
|
|
4910
5099
|
const tokenAddress = isPusd ? _chunkYEBXUUH3cjs.POLYMARKET_PUSD_ADDRESS : _chunkYEBXUUH3cjs.POLYMARKET_USDCE_ADDRESS;
|
|
@@ -4921,8 +5110,11 @@ function buildAsset(params) {
|
|
|
4921
5110
|
decimals: 6,
|
|
4922
5111
|
balance: balance.toString(),
|
|
4923
5112
|
balanceUsd: Number.isFinite(balanceUsd) ? balanceUsd : 0,
|
|
4924
|
-
source:
|
|
5113
|
+
source: PROVIDER_ID2,
|
|
4925
5114
|
sourceLabel: "Polymarket",
|
|
5115
|
+
// The proxy wallet really does hold this ERC-20, so the amount step reads it
|
|
5116
|
+
// live rather than trusting the figure from the availability fetch.
|
|
5117
|
+
balanceAddress: proxyWallet,
|
|
4926
5118
|
reviewLabel: isPusd ? "You send pUSD from Polymarket" : "You send USDC.e from Polymarket",
|
|
4927
5119
|
// pUSD unwraps to USDC.e via the offramp; USDC.e is what actually
|
|
4928
5120
|
// arrives at the smart account, so it's also what the orchestrator
|
|
@@ -4934,7 +5126,10 @@ function buildAsset(params) {
|
|
|
4934
5126
|
}
|
|
4935
5127
|
|
|
4936
5128
|
// src/core/dapp-imports/registry.ts
|
|
4937
|
-
var DAPP_IMPORT_PROVIDERS = [
|
|
5129
|
+
var DAPP_IMPORT_PROVIDERS = [
|
|
5130
|
+
polymarketProvider,
|
|
5131
|
+
aaveProvider
|
|
5132
|
+
];
|
|
4938
5133
|
function getEnabledProviders(config) {
|
|
4939
5134
|
if (!config) return [];
|
|
4940
5135
|
return DAPP_IMPORT_PROVIDERS.filter(
|
|
@@ -4946,7 +5141,7 @@ function getEnabledProviders(config) {
|
|
|
4946
5141
|
function computeDappImportStatus(providerId, inputs) {
|
|
4947
5142
|
const { owner, availability, availabilityOwner, setup } = inputs;
|
|
4948
5143
|
if (!owner) return "needs-connect";
|
|
4949
|
-
const entry = _optionalChain([availabilityOwner, 'optionalAccess',
|
|
5144
|
+
const entry = _optionalChain([availabilityOwner, 'optionalAccess', _129 => _129.toLowerCase, 'call', _130 => _130()]) === owner.toLowerCase() ? availability[providerId] : void 0;
|
|
4950
5145
|
if (entry === "loading" || entry === void 0) return "loading";
|
|
4951
5146
|
if (entry === "error") {
|
|
4952
5147
|
return {
|
|
@@ -5472,7 +5667,7 @@ function applyAction(state, action) {
|
|
|
5472
5667
|
totalUsd: null,
|
|
5473
5668
|
// Keep any prior chains visible so the cluster does not flicker
|
|
5474
5669
|
// empty across a refresh.
|
|
5475
|
-
chainIds: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
5670
|
+
chainIds: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _131 => _131.chainIds]), () => ( []))
|
|
5476
5671
|
}
|
|
5477
5672
|
}
|
|
5478
5673
|
}
|
|
@@ -5637,7 +5832,7 @@ function applyAction(state, action) {
|
|
|
5637
5832
|
flow: { ...state.flow, step: "processing" }
|
|
5638
5833
|
};
|
|
5639
5834
|
case "processing/quote-loaded":
|
|
5640
|
-
if (state.flow.step !== "processing" || _optionalChain([state, 'access',
|
|
5835
|
+
if (state.flow.step !== "processing" || _optionalChain([state, 'access', _132 => _132.processing, 'access', _133 => _133.txHash, 'optionalAccess', _134 => _134.toLowerCase, 'call', _135 => _135()]) !== action.txHash.toLowerCase()) {
|
|
5641
5836
|
return state;
|
|
5642
5837
|
}
|
|
5643
5838
|
return {
|
|
@@ -5970,7 +6165,7 @@ var SWAPPED_QUOTE_FEE_TIMEOUT_MS = 2500;
|
|
|
5970
6165
|
async function fetchPinnedQuote(params) {
|
|
5971
6166
|
try {
|
|
5972
6167
|
if (BigInt(params.amount) <= 0n) return void 0;
|
|
5973
|
-
} catch (
|
|
6168
|
+
} catch (e31) {
|
|
5974
6169
|
return void 0;
|
|
5975
6170
|
}
|
|
5976
6171
|
let timeoutId;
|
|
@@ -5987,7 +6182,7 @@ async function fetchPinnedQuote(params) {
|
|
|
5987
6182
|
})
|
|
5988
6183
|
]);
|
|
5989
6184
|
return _nullishCoalesce(quote, () => ( void 0));
|
|
5990
|
-
} catch (
|
|
6185
|
+
} catch (e32) {
|
|
5991
6186
|
return void 0;
|
|
5992
6187
|
} finally {
|
|
5993
6188
|
if (timeoutId !== void 0) clearTimeout(timeoutId);
|
|
@@ -6203,11 +6398,11 @@ function DepositFlow({
|
|
|
6203
6398
|
onError,
|
|
6204
6399
|
debug
|
|
6205
6400
|
}) {
|
|
6206
|
-
const rpcUrls =
|
|
6207
|
-
const onStepChangeRef =
|
|
6208
|
-
const onEventRef =
|
|
6209
|
-
const onLifecycleRef =
|
|
6210
|
-
const onErrorRef =
|
|
6401
|
+
const rpcUrls = _chunkPUJHXHRAcjs.useRpcUrls.call(void 0, );
|
|
6402
|
+
const onStepChangeRef = _chunkPUJHXHRAcjs.useLatestRef.call(void 0, onStepChange);
|
|
6403
|
+
const onEventRef = _chunkPUJHXHRAcjs.useLatestRef.call(void 0, onEvent);
|
|
6404
|
+
const onLifecycleRef = _chunkPUJHXHRAcjs.useLatestRef.call(void 0, onLifecycle);
|
|
6405
|
+
const onErrorRef = _chunkPUJHXHRAcjs.useLatestRef.call(void 0, onError);
|
|
6211
6406
|
const storeApi = useDepositStoreApi();
|
|
6212
6407
|
const flowSlice = useDepositStore((s) => s.flow);
|
|
6213
6408
|
const depositSlice = useDepositStore((s) => s.deposit);
|
|
@@ -6224,13 +6419,13 @@ function DepositFlow({
|
|
|
6224
6419
|
const stableWalletSelectionKeyRef = _react.useRef.call(void 0, null);
|
|
6225
6420
|
const logFlow = _react.useCallback.call(void 0,
|
|
6226
6421
|
(message, data) => {
|
|
6227
|
-
|
|
6422
|
+
_chunkPUJHXHRAcjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
|
|
6228
6423
|
},
|
|
6229
6424
|
[debug]
|
|
6230
6425
|
);
|
|
6231
6426
|
const logFlowError = _react.useCallback.call(void 0,
|
|
6232
6427
|
(message, error, data) => {
|
|
6233
|
-
|
|
6428
|
+
_chunkPUJHXHRAcjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
|
|
6234
6429
|
},
|
|
6235
6430
|
[debug]
|
|
6236
6431
|
);
|
|
@@ -6254,12 +6449,12 @@ function DepositFlow({
|
|
|
6254
6449
|
};
|
|
6255
6450
|
}, [enableSwappedPreconnect]);
|
|
6256
6451
|
const dappSwitchChain = _react.useMemo.call(void 0, () => {
|
|
6257
|
-
if (!_optionalChain([walletClientProp, 'optionalAccess',
|
|
6452
|
+
if (!_optionalChain([walletClientProp, 'optionalAccess', _136 => _136.switchChain])) return void 0;
|
|
6258
6453
|
return async (chainId) => {
|
|
6259
|
-
await _optionalChain([walletClientProp, 'access',
|
|
6454
|
+
await _optionalChain([walletClientProp, 'access', _137 => _137.switchChain, 'optionalCall', _138 => _138({ id: chainId })]);
|
|
6260
6455
|
};
|
|
6261
6456
|
}, [walletClientProp]);
|
|
6262
|
-
const connectedWalletAddress = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess',
|
|
6457
|
+
const connectedWalletAddress = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess', _139 => _139.account, 'optionalAccess', _140 => _140.address]), () => ( null));
|
|
6263
6458
|
const walletOptions = _react.useMemo.call(void 0, () => {
|
|
6264
6459
|
const options = [];
|
|
6265
6460
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -6273,7 +6468,7 @@ function DepositFlow({
|
|
|
6273
6468
|
});
|
|
6274
6469
|
seen.add(id);
|
|
6275
6470
|
}
|
|
6276
|
-
if (_optionalChain([reownWallet, 'optionalAccess',
|
|
6471
|
+
if (_optionalChain([reownWallet, 'optionalAccess', _141 => _141.isConnected]) && reownWallet.isSolana && reownWallet.solanaAddress) {
|
|
6277
6472
|
const id = _nullishCoalesce(reownWallet.caipAddress, () => ( `solana:${reownWallet.solanaAddress}`));
|
|
6278
6473
|
if (!seen.has(id)) {
|
|
6279
6474
|
options.push({
|
|
@@ -6285,7 +6480,7 @@ function DepositFlow({
|
|
|
6285
6480
|
});
|
|
6286
6481
|
seen.add(id);
|
|
6287
6482
|
}
|
|
6288
|
-
} else if (_optionalChain([reownWallet, 'optionalAccess',
|
|
6483
|
+
} else if (_optionalChain([reownWallet, 'optionalAccess', _142 => _142.address]) && reownWallet.isConnected && reownWallet.walletClient && reownWallet.publicClient && !seen.has(`evm:${reownWallet.address.toLowerCase()}`)) {
|
|
6289
6484
|
const id = `evm:${reownWallet.address.toLowerCase()}`;
|
|
6290
6485
|
if (!seen.has(id)) {
|
|
6291
6486
|
options.push({
|
|
@@ -6301,14 +6496,14 @@ function DepositFlow({
|
|
|
6301
6496
|
return options;
|
|
6302
6497
|
}, [
|
|
6303
6498
|
connectedWalletAddress,
|
|
6304
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
6305
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
6306
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
6307
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
6308
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
6309
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
6310
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
6311
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
6499
|
+
_optionalChain([reownWallet, 'optionalAccess', _143 => _143.address]),
|
|
6500
|
+
_optionalChain([reownWallet, 'optionalAccess', _144 => _144.isConnected]),
|
|
6501
|
+
_optionalChain([reownWallet, 'optionalAccess', _145 => _145.walletClient]),
|
|
6502
|
+
_optionalChain([reownWallet, 'optionalAccess', _146 => _146.publicClient]),
|
|
6503
|
+
_optionalChain([reownWallet, 'optionalAccess', _147 => _147.icon]),
|
|
6504
|
+
_optionalChain([reownWallet, 'optionalAccess', _148 => _148.isSolana]),
|
|
6505
|
+
_optionalChain([reownWallet, 'optionalAccess', _149 => _149.solanaAddress]),
|
|
6506
|
+
_optionalChain([reownWallet, 'optionalAccess', _150 => _150.caipAddress])
|
|
6312
6507
|
]);
|
|
6313
6508
|
const offeredFiatMethods = _react.useMemo.call(void 0,
|
|
6314
6509
|
() => fiatMethods ? FIAT_ONRAMP_METHODS.filter((m) => fiatMethods[m.method]) : FIAT_ONRAMP_METHODS,
|
|
@@ -6328,11 +6523,11 @@ function DepositFlow({
|
|
|
6328
6523
|
hasEnabledAssetMigration
|
|
6329
6524
|
].filter(Boolean).length;
|
|
6330
6525
|
const canAutoLock = Boolean(
|
|
6331
|
-
enableWallet && _optionalChain([walletClientProp, 'optionalAccess',
|
|
6526
|
+
enableWallet && _optionalChain([walletClientProp, 'optionalAccess', _151 => _151.account]) && !reownWallet && enabledFeatureCount === 1
|
|
6332
6527
|
);
|
|
6333
6528
|
const hasWalletOptions = enableWallet && walletOptions.length > 0;
|
|
6334
6529
|
const hasReownSession = Boolean(
|
|
6335
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
6530
|
+
_optionalChain([reownWallet, 'optionalAccess', _152 => _152.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _153 => _153.address])
|
|
6336
6531
|
);
|
|
6337
6532
|
const isDappImportWalletHydrating = Boolean(
|
|
6338
6533
|
hasWalletClientProp && walletClientProp === void 0 || reownWallet && !hasReownSession && !reownWallet.isReady
|
|
@@ -6362,7 +6557,7 @@ function DepositFlow({
|
|
|
6362
6557
|
return;
|
|
6363
6558
|
}
|
|
6364
6559
|
let cancelled = false;
|
|
6365
|
-
|
|
6560
|
+
_chunkA42XAHIBcjs.fetchTokenPriceUsd.call(void 0, service, {
|
|
6366
6561
|
chainId: targetChain,
|
|
6367
6562
|
address: targetToken,
|
|
6368
6563
|
symbol: targetSymbol
|
|
@@ -6379,11 +6574,11 @@ function DepositFlow({
|
|
|
6379
6574
|
return null;
|
|
6380
6575
|
}
|
|
6381
6576
|
if (canAutoLock) {
|
|
6382
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess',
|
|
6577
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess', _154 => _154.chain, 'optionalAccess', _155 => _155.id]), () => ( setupChainId));
|
|
6383
6578
|
return {
|
|
6384
6579
|
ownerAddress: walletClientProp.account.address,
|
|
6385
6580
|
walletClient: walletClientProp,
|
|
6386
|
-
publicClient: _nullishCoalesce(publicClientProp, () => (
|
|
6581
|
+
publicClient: _nullishCoalesce(publicClientProp, () => ( _chunkA42XAHIBcjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
|
|
6387
6582
|
switchChain: dappSwitchChain
|
|
6388
6583
|
};
|
|
6389
6584
|
}
|
|
@@ -6395,20 +6590,20 @@ function DepositFlow({
|
|
|
6395
6590
|
if (selectedOption.kind === "solana") {
|
|
6396
6591
|
return null;
|
|
6397
6592
|
}
|
|
6398
|
-
if (selectedOption.kind === "connected" && _optionalChain([walletClientProp, 'optionalAccess',
|
|
6399
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess',
|
|
6593
|
+
if (selectedOption.kind === "connected" && _optionalChain([walletClientProp, 'optionalAccess', _156 => _156.account]) && selectedOption.address && walletClientProp.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
6594
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess', _157 => _157.chain, 'optionalAccess', _158 => _158.id]), () => ( setupChainId));
|
|
6400
6595
|
return {
|
|
6401
6596
|
ownerAddress: walletClientProp.account.address,
|
|
6402
6597
|
walletClient: walletClientProp,
|
|
6403
|
-
publicClient: _nullishCoalesce(publicClientProp, () => (
|
|
6598
|
+
publicClient: _nullishCoalesce(publicClientProp, () => ( _chunkA42XAHIBcjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
|
|
6404
6599
|
switchChain: dappSwitchChain
|
|
6405
6600
|
};
|
|
6406
6601
|
}
|
|
6407
|
-
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess',
|
|
6602
|
+
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess', _159 => _159.address]) && selectedOption.address && reownWallet.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
6408
6603
|
return {
|
|
6409
6604
|
ownerAddress: reownWallet.address,
|
|
6410
6605
|
walletClient: reownWallet.walletClient,
|
|
6411
|
-
publicClient: _nullishCoalesce(reownWallet.publicClient, () => (
|
|
6606
|
+
publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunkA42XAHIBcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
|
|
6412
6607
|
switchChain: reownWallet.switchChain
|
|
6413
6608
|
};
|
|
6414
6609
|
}
|
|
@@ -6461,35 +6656,35 @@ function DepositFlow({
|
|
|
6461
6656
|
const selectedEvmWalletOwner = _react.useMemo.call(void 0, () => {
|
|
6462
6657
|
if (!selectedWalletId) return null;
|
|
6463
6658
|
const opt = walletOptions.find((o) => o.id === selectedWalletId);
|
|
6464
|
-
if (_optionalChain([opt, 'optionalAccess',
|
|
6659
|
+
if (_optionalChain([opt, 'optionalAccess', _160 => _160.kind]) === "external" && opt.address) {
|
|
6465
6660
|
return opt.address;
|
|
6466
6661
|
}
|
|
6467
|
-
if (_optionalChain([opt, 'optionalAccess',
|
|
6662
|
+
if (_optionalChain([opt, 'optionalAccess', _161 => _161.kind]) === "connected" && opt.address) {
|
|
6468
6663
|
return opt.address;
|
|
6469
6664
|
}
|
|
6470
6665
|
return null;
|
|
6471
6666
|
}, [selectedWalletId, walletOptions]);
|
|
6472
6667
|
const dappImportOwner = _react.useMemo.call(void 0, () => {
|
|
6473
6668
|
if (selectedEvmWalletOwner) return selectedEvmWalletOwner;
|
|
6474
|
-
if (_optionalChain([reownWallet, 'optionalAccess',
|
|
6669
|
+
if (_optionalChain([reownWallet, 'optionalAccess', _162 => _162.address]) && reownWallet.isConnected) {
|
|
6475
6670
|
return reownWallet.address;
|
|
6476
6671
|
}
|
|
6477
6672
|
if (connectedWalletAddress) return connectedWalletAddress;
|
|
6478
6673
|
return null;
|
|
6479
6674
|
}, [
|
|
6480
6675
|
selectedEvmWalletOwner,
|
|
6481
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
6482
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
6676
|
+
_optionalChain([reownWallet, 'optionalAccess', _163 => _163.address]),
|
|
6677
|
+
_optionalChain([reownWallet, 'optionalAccess', _164 => _164.isConnected]),
|
|
6483
6678
|
connectedWalletAddress
|
|
6484
6679
|
]);
|
|
6485
6680
|
const activeOwner = _react.useMemo.call(void 0,
|
|
6486
6681
|
() => resolveOwnerForMode(flowMode, {
|
|
6487
|
-
walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess',
|
|
6682
|
+
walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _165 => _165.ownerAddress]), () => ( (canAutoLock ? connectedWalletAddress : selectedEvmWalletOwner))),
|
|
6488
6683
|
dappImportOwner
|
|
6489
6684
|
}),
|
|
6490
6685
|
[
|
|
6491
6686
|
flowMode,
|
|
6492
|
-
_optionalChain([signerContext, 'optionalAccess',
|
|
6687
|
+
_optionalChain([signerContext, 'optionalAccess', _166 => _166.ownerAddress]),
|
|
6493
6688
|
canAutoLock,
|
|
6494
6689
|
connectedWalletAddress,
|
|
6495
6690
|
selectedEvmWalletOwner,
|
|
@@ -6506,7 +6701,7 @@ function DepositFlow({
|
|
|
6506
6701
|
].join(":");
|
|
6507
6702
|
if (lastSmartAccountLifecycleKeyRef.current === lifecycleKey) return;
|
|
6508
6703
|
lastSmartAccountLifecycleKeyRef.current = lifecycleKey;
|
|
6509
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6704
|
+
_optionalChain([onLifecycleRef, 'access', _167 => _167.current, 'optionalCall', _168 => _168({
|
|
6510
6705
|
type: "smart-account-changed",
|
|
6511
6706
|
evm: activeEntry.smartAccount,
|
|
6512
6707
|
solana: _nullishCoalesce(activeEntry.solanaDepositAddress, () => ( null))
|
|
@@ -6534,7 +6729,7 @@ function DepositFlow({
|
|
|
6534
6729
|
return;
|
|
6535
6730
|
}
|
|
6536
6731
|
lastConnectedLifecycleKeyRef.current = lifecycleKey;
|
|
6537
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6732
|
+
_optionalChain([onLifecycleRef, 'access', _169 => _169.current, 'optionalCall', _170 => _170({
|
|
6538
6733
|
type: "connected",
|
|
6539
6734
|
address: activeOwner,
|
|
6540
6735
|
smartAccount: activeEntry.smartAccount
|
|
@@ -6579,7 +6774,7 @@ function DepositFlow({
|
|
|
6579
6774
|
const currentBackHandler = canGoBackFromHere ? handleBack : void 0;
|
|
6580
6775
|
const currentScreen = showConnectStep ? "connect" : effectiveStep.type;
|
|
6581
6776
|
_react.useEffect.call(void 0, () => {
|
|
6582
|
-
_optionalChain([onStepChangeRef, 'access',
|
|
6777
|
+
_optionalChain([onStepChangeRef, 'access', _171 => _171.current, 'optionalCall', _172 => _172(currentBackHandler, currentScreen)]);
|
|
6583
6778
|
}, [currentBackHandler, currentScreen, onStepChangeRef]);
|
|
6584
6779
|
const lastModalHeightRef = _react.useRef.call(void 0, 0);
|
|
6585
6780
|
const modalContentElRef = _react.useRef.call(void 0, null);
|
|
@@ -6589,7 +6784,7 @@ function DepositFlow({
|
|
|
6589
6784
|
modalContentElRef.current = mc;
|
|
6590
6785
|
const ro = new ResizeObserver((entries) => {
|
|
6591
6786
|
for (const entry of entries) {
|
|
6592
|
-
const border = _optionalChain([entry, 'access',
|
|
6787
|
+
const border = _optionalChain([entry, 'access', _173 => _173.borderBoxSize, 'optionalAccess', _174 => _174[0], 'optionalAccess', _175 => _175.blockSize]);
|
|
6593
6788
|
lastModalHeightRef.current = typeof border === "number" ? border : entry.contentRect.height;
|
|
6594
6789
|
}
|
|
6595
6790
|
});
|
|
@@ -6630,7 +6825,7 @@ function DepositFlow({
|
|
|
6630
6825
|
}
|
|
6631
6826
|
lastStepOpenEventKeyRef.current = stepOpenEventKey;
|
|
6632
6827
|
if (effectiveStep.type === "select-asset") {
|
|
6633
|
-
_optionalChain([onEventRef, 'access',
|
|
6828
|
+
_optionalChain([onEventRef, 'access', _176 => _176.current, 'optionalCall', _177 => _177({
|
|
6634
6829
|
type: "deposit_modal_connected_wallet_select_source_open",
|
|
6635
6830
|
total_balance_in_external_wallet: totalBalanceUsd,
|
|
6636
6831
|
pred_balance: totalBalanceUsd
|
|
@@ -6638,7 +6833,7 @@ function DepositFlow({
|
|
|
6638
6833
|
} else if (effectiveStep.type === "deposit-address") {
|
|
6639
6834
|
const chainName = _chunkH577RJN5cjs.getChainName.call(void 0, targetChain);
|
|
6640
6835
|
const tokenSymbol = _chunkH577RJN5cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
6641
|
-
_optionalChain([onEventRef, 'access',
|
|
6836
|
+
_optionalChain([onEventRef, 'access', _178 => _178.current, 'optionalCall', _179 => _179({
|
|
6642
6837
|
type: "deposit_modal_transfer_crypto_open",
|
|
6643
6838
|
default_chain: chainName,
|
|
6644
6839
|
default_token: tokenSymbol,
|
|
@@ -6646,7 +6841,7 @@ function DepositFlow({
|
|
|
6646
6841
|
})]);
|
|
6647
6842
|
} else if (effectiveStep.type === "amount" && stepSendToken) {
|
|
6648
6843
|
const receiveSymbol = _chunkH577RJN5cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
6649
|
-
_optionalChain([onEventRef, 'access',
|
|
6844
|
+
_optionalChain([onEventRef, 'access', _180 => _180.current, 'optionalCall', _181 => _181({
|
|
6650
6845
|
type: "deposit_modal_connected_wallet_enter_value_open",
|
|
6651
6846
|
send_token: stepSendToken,
|
|
6652
6847
|
receive_token: receiveSymbol,
|
|
@@ -6679,7 +6874,7 @@ function DepositFlow({
|
|
|
6679
6874
|
targetToken
|
|
6680
6875
|
]);
|
|
6681
6876
|
_react.useEffect.call(void 0, () => {
|
|
6682
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6877
|
+
_optionalChain([onLifecycleRef, 'access', _182 => _182.current, 'optionalCall', _183 => _183({
|
|
6683
6878
|
type: "balance-changed",
|
|
6684
6879
|
totalUsd: totalBalanceUsd
|
|
6685
6880
|
})]);
|
|
@@ -6695,7 +6890,7 @@ function DepositFlow({
|
|
|
6695
6890
|
const handleConfirmWallet = _react.useCallback.call(void 0,
|
|
6696
6891
|
(walletId) => {
|
|
6697
6892
|
const selectedOption = walletOptions.find((o) => o.id === walletId);
|
|
6698
|
-
const mode = _optionalChain([selectedOption, 'optionalAccess',
|
|
6893
|
+
const mode = _optionalChain([selectedOption, 'optionalAccess', _184 => _184.kind]) === "solana" ? "solana-wallet" : "wallet";
|
|
6699
6894
|
storeApi.dispatch({
|
|
6700
6895
|
type: "connect/wallet-confirmed",
|
|
6701
6896
|
walletId,
|
|
@@ -6705,7 +6900,7 @@ function DepositFlow({
|
|
|
6705
6900
|
[walletOptions, storeApi]
|
|
6706
6901
|
);
|
|
6707
6902
|
const isSolanaWalletConnected = Boolean(
|
|
6708
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
6903
|
+
_optionalChain([reownWallet, 'optionalAccess', _185 => _185.isConnected]) && _optionalChain([reownWallet, 'optionalAccess', _186 => _186.isSolana])
|
|
6709
6904
|
);
|
|
6710
6905
|
const assetMigrationsKey = assetMigrations ? Object.keys(assetMigrations).filter((k) => assetMigrations[k]).sort().join(",") : "";
|
|
6711
6906
|
const enabledDappImportProviders = _react.useMemo.call(void 0,
|
|
@@ -6722,7 +6917,7 @@ function DepositFlow({
|
|
|
6722
6917
|
const owner = dappImportOwner;
|
|
6723
6918
|
if (owner) {
|
|
6724
6919
|
const wallet = walletOptions.find(
|
|
6725
|
-
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess',
|
|
6920
|
+
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _187 => _187.toLowerCase, 'call', _188 => _188()]) === owner.toLowerCase()
|
|
6726
6921
|
);
|
|
6727
6922
|
if (wallet) {
|
|
6728
6923
|
storeApi.dispatch({
|
|
@@ -6763,11 +6958,14 @@ function DepositFlow({
|
|
|
6763
6958
|
eoa: dappImportOwner,
|
|
6764
6959
|
getPublicClient: (chainId) => {
|
|
6765
6960
|
try {
|
|
6766
|
-
return
|
|
6767
|
-
} catch (
|
|
6961
|
+
return _chunkA42XAHIBcjs.getPublicClient.call(void 0, chainId, rpcUrls);
|
|
6962
|
+
} catch (e33) {
|
|
6768
6963
|
return null;
|
|
6769
6964
|
}
|
|
6770
6965
|
},
|
|
6966
|
+
// Providers whose positions live behind the Rhinestone API rather than
|
|
6967
|
+
// an RPC (Aave) read them through here.
|
|
6968
|
+
backend: service,
|
|
6771
6969
|
signal: controller.signal
|
|
6772
6970
|
}).then((availability) => {
|
|
6773
6971
|
if (controller.signal.aborted) return;
|
|
@@ -6792,7 +6990,8 @@ function DepositFlow({
|
|
|
6792
6990
|
enabledDappImportProviders,
|
|
6793
6991
|
dappImportAttemptNonce,
|
|
6794
6992
|
storeApi,
|
|
6795
|
-
rpcUrls
|
|
6993
|
+
rpcUrls,
|
|
6994
|
+
service
|
|
6796
6995
|
]);
|
|
6797
6996
|
_react.useLayoutEffect.call(void 0, () => {
|
|
6798
6997
|
if (!initialAssetMigrationProvider) return;
|
|
@@ -6852,7 +7051,7 @@ function DepositFlow({
|
|
|
6852
7051
|
}, [activeDappImportProviderId, enabledDappImportProviders]);
|
|
6853
7052
|
const activeDappImportAvailability = _react.useMemo.call(void 0, () => {
|
|
6854
7053
|
if (!activeDappImportProviderId) return null;
|
|
6855
|
-
if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess',
|
|
7054
|
+
if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _189 => _189.toLowerCase, 'call', _190 => _190()]) !== dappImportOwner.toLowerCase()) {
|
|
6856
7055
|
return null;
|
|
6857
7056
|
}
|
|
6858
7057
|
const entry = dappImportAvailability[activeDappImportProviderId];
|
|
@@ -6893,7 +7092,7 @@ function DepositFlow({
|
|
|
6893
7092
|
setup: setupSlice
|
|
6894
7093
|
});
|
|
6895
7094
|
const pinnableWallet = dappImportOwner ? _nullishCoalesce(walletOptions.find(
|
|
6896
|
-
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess',
|
|
7095
|
+
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _191 => _191.toLowerCase, 'call', _192 => _192()]) === dappImportOwner.toLowerCase()
|
|
6897
7096
|
), () => ( null)) : null;
|
|
6898
7097
|
const outcome = resolveBootOutcome({
|
|
6899
7098
|
status,
|
|
@@ -6935,7 +7134,7 @@ function DepositFlow({
|
|
|
6935
7134
|
if (dappImportOwner) {
|
|
6936
7135
|
const plan = bootRetryPlan({
|
|
6937
7136
|
setupStatus: snapshot.setup.status,
|
|
6938
|
-
availabilityEntry: _optionalChain([snapshot, 'access',
|
|
7137
|
+
availabilityEntry: _optionalChain([snapshot, 'access', _193 => _193.dappImport, 'access', _194 => _194.availabilityOwner, 'optionalAccess', _195 => _195.toLowerCase, 'call', _196 => _196()]) === dappImportOwner.toLowerCase() ? snapshot.dappImport.availability[providerId] : void 0
|
|
6939
7138
|
});
|
|
6940
7139
|
if (plan.restartSetup) {
|
|
6941
7140
|
storeApi.dispatch({ type: "setup/retry-requested" });
|
|
@@ -6984,7 +7183,7 @@ function DepositFlow({
|
|
|
6984
7183
|
acceptedExchangeFeeBps: disclosedFeeBps
|
|
6985
7184
|
});
|
|
6986
7185
|
} catch (error) {
|
|
6987
|
-
if (error instanceof
|
|
7186
|
+
if (error instanceof _chunkPUJHXHRAcjs.SwappedConnectFeeChangedError) {
|
|
6988
7187
|
return error.exchangeFeeBps;
|
|
6989
7188
|
}
|
|
6990
7189
|
throw error;
|
|
@@ -6992,7 +7191,7 @@ function DepositFlow({
|
|
|
6992
7191
|
entry = { smartAccount: owner, response };
|
|
6993
7192
|
}
|
|
6994
7193
|
const currentAccount = storeApi.getState().setup.smartAccount;
|
|
6995
|
-
if (_optionalChain([currentAccount, 'optionalAccess',
|
|
7194
|
+
if (_optionalChain([currentAccount, 'optionalAccess', _197 => _197.toLowerCase, 'call', _198 => _198()]) !== owner) {
|
|
6996
7195
|
swappedConnectUrlRef.current.delete(key);
|
|
6997
7196
|
throw new Error("Deposit account changed. Select your exchange again.");
|
|
6998
7197
|
}
|
|
@@ -7023,7 +7222,7 @@ function DepositFlow({
|
|
|
7023
7222
|
);
|
|
7024
7223
|
}
|
|
7025
7224
|
swappedConnectUrlRef.current.delete(key);
|
|
7026
|
-
const response = _optionalChain([entry, 'optionalAccess',
|
|
7225
|
+
const response = _optionalChain([entry, 'optionalAccess', _199 => _199.smartAccount]) === smartAccount.toLowerCase() ? entry.response : await service.getSwappedConnectUrl({
|
|
7027
7226
|
smartAccount,
|
|
7028
7227
|
connection,
|
|
7029
7228
|
acceptedExchangeFeeBps: expectedFeeBps
|
|
@@ -7181,7 +7380,7 @@ function DepositFlow({
|
|
|
7181
7380
|
const handleSelectDisplayedFiatMethod = _react.useCallback.call(void 0,
|
|
7182
7381
|
(method) => {
|
|
7183
7382
|
if (!displayedFiatSource) return;
|
|
7184
|
-
_optionalChain([onEventRef, 'access',
|
|
7383
|
+
_optionalChain([onEventRef, 'access', _200 => _200.current, 'optionalCall', _201 => _201({
|
|
7185
7384
|
type: "deposit_modal_fiat_method_click",
|
|
7186
7385
|
country: displayedFiatCountry,
|
|
7187
7386
|
payment_method: method,
|
|
@@ -7204,7 +7403,7 @@ function DepositFlow({
|
|
|
7204
7403
|
[displayedFiatSource, handlePrefetchFiatMethod]
|
|
7205
7404
|
);
|
|
7206
7405
|
const handleNewDeposit = _react.useCallback.call(void 0, () => {
|
|
7207
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7406
|
+
_optionalChain([onLifecycleRef, 'access', _202 => _202.current, 'optionalCall', _203 => _203({
|
|
7208
7407
|
type: "smart-account-changed",
|
|
7209
7408
|
evm: null,
|
|
7210
7409
|
solana: null
|
|
@@ -7235,17 +7434,17 @@ function DepositFlow({
|
|
|
7235
7434
|
forceRegister
|
|
7236
7435
|
]
|
|
7237
7436
|
);
|
|
7238
|
-
const desiredSetupRequestKey =
|
|
7437
|
+
const desiredSetupRequestKey = _chunkA42XAHIBcjs.computeRequestKey.call(void 0, setupInput);
|
|
7239
7438
|
const setupReady = setupSlice.status === "ready" && setupSlice.requestKey === desiredSetupRequestKey;
|
|
7240
7439
|
_react.useEffect.call(void 0, () => {
|
|
7241
7440
|
void (async () => {
|
|
7242
|
-
const requestKey =
|
|
7243
|
-
const cacheKey =
|
|
7244
|
-
const cacheable =
|
|
7441
|
+
const requestKey = _chunkA42XAHIBcjs.computeRequestKey.call(void 0, setupInput);
|
|
7442
|
+
const cacheKey = _chunkA42XAHIBcjs.computeCacheKey.call(void 0, setupInput);
|
|
7443
|
+
const cacheable = _chunkA42XAHIBcjs.computeIsCacheable.call(void 0, setupInput);
|
|
7245
7444
|
if (storeApi.getState().setup.requestKey === requestKey) {
|
|
7246
7445
|
return;
|
|
7247
7446
|
}
|
|
7248
|
-
const dedupedResult =
|
|
7447
|
+
const dedupedResult = _chunkA42XAHIBcjs.readDedupedAccountSetupResult.call(void 0, requestKey);
|
|
7249
7448
|
if (dedupedResult) {
|
|
7250
7449
|
storeApi.dispatch({
|
|
7251
7450
|
type: "setup/started",
|
|
@@ -7271,7 +7470,7 @@ function DepositFlow({
|
|
|
7271
7470
|
cacheable
|
|
7272
7471
|
});
|
|
7273
7472
|
try {
|
|
7274
|
-
const result = await
|
|
7473
|
+
const result = await _chunkA42XAHIBcjs.runAccountSetupDeduped.call(void 0,
|
|
7275
7474
|
setupInput,
|
|
7276
7475
|
{ service, debug },
|
|
7277
7476
|
requestKey
|
|
@@ -7286,7 +7485,7 @@ function DepositFlow({
|
|
|
7286
7485
|
}
|
|
7287
7486
|
});
|
|
7288
7487
|
} catch (error) {
|
|
7289
|
-
const message = error instanceof
|
|
7488
|
+
const message = error instanceof _chunkA42XAHIBcjs.SetupError ? error.message : "Deposit service is temporarily unavailable. Please try again shortly.";
|
|
7290
7489
|
storeApi.dispatch({
|
|
7291
7490
|
type: "setup/failed",
|
|
7292
7491
|
requestKey,
|
|
@@ -7318,11 +7517,11 @@ function DepositFlow({
|
|
|
7318
7517
|
return;
|
|
7319
7518
|
}
|
|
7320
7519
|
storeApi.dispatch({ type: "portfolio/loading", network, address });
|
|
7321
|
-
const requestId = _optionalChain([readPortfolioEntry, 'call',
|
|
7520
|
+
const requestId = _optionalChain([readPortfolioEntry, 'call', _204 => _204(
|
|
7322
7521
|
storeApi.getState().portfolio,
|
|
7323
7522
|
network,
|
|
7324
7523
|
address
|
|
7325
|
-
), 'optionalAccess',
|
|
7524
|
+
), 'optionalAccess', _205 => _205.requestId]);
|
|
7326
7525
|
if (requestId === void 0) return;
|
|
7327
7526
|
void (async () => {
|
|
7328
7527
|
try {
|
|
@@ -7335,9 +7534,9 @@ function DepositFlow({
|
|
|
7335
7534
|
address,
|
|
7336
7535
|
requestId,
|
|
7337
7536
|
totalUsd: portfolio.totalUsd,
|
|
7338
|
-
chainIds:
|
|
7537
|
+
chainIds: _chunkPUJHXHRAcjs.chainIdsByValue.call(void 0, portfolio.tokens)
|
|
7339
7538
|
});
|
|
7340
|
-
} catch (
|
|
7539
|
+
} catch (e34) {
|
|
7341
7540
|
storeApi.dispatch({
|
|
7342
7541
|
type: "portfolio/failed",
|
|
7343
7542
|
network,
|
|
@@ -7355,7 +7554,7 @@ function DepositFlow({
|
|
|
7355
7554
|
sourceChain: data.sourceChain,
|
|
7356
7555
|
amount: data.amount
|
|
7357
7556
|
});
|
|
7358
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7557
|
+
_optionalChain([onLifecycleRef, 'access', _206 => _206.current, 'optionalCall', _207 => _207({ type: "submitted", ...data })]);
|
|
7359
7558
|
},
|
|
7360
7559
|
[logFlow, onLifecycleRef]
|
|
7361
7560
|
);
|
|
@@ -7419,7 +7618,7 @@ function DepositFlow({
|
|
|
7419
7618
|
sourceDecimals: tokenAtSubmit.decimals,
|
|
7420
7619
|
inputAmountUsd: amountUsd
|
|
7421
7620
|
});
|
|
7422
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7621
|
+
_optionalChain([onLifecycleRef, 'access', _208 => _208.current, 'optionalCall', _209 => _209({
|
|
7423
7622
|
type: "submitted",
|
|
7424
7623
|
txHash,
|
|
7425
7624
|
sourceChain: "solana",
|
|
@@ -7432,7 +7631,7 @@ function DepositFlow({
|
|
|
7432
7631
|
);
|
|
7433
7632
|
const handleAssetContinue = _react.useCallback.call(void 0,
|
|
7434
7633
|
(asset) => {
|
|
7435
|
-
_optionalChain([onEventRef, 'access',
|
|
7634
|
+
_optionalChain([onEventRef, 'access', _210 => _210.current, 'optionalCall', _211 => _211({
|
|
7436
7635
|
type: "deposit_modal_connected_wallet_select_source_cta_click",
|
|
7437
7636
|
total_balance_in_external_wallet: totalBalanceUsd,
|
|
7438
7637
|
pred_balance: totalBalanceUsd,
|
|
@@ -7486,8 +7685,8 @@ function DepositFlow({
|
|
|
7486
7685
|
sourceChain: chainId,
|
|
7487
7686
|
sourceToken: token,
|
|
7488
7687
|
amount,
|
|
7489
|
-
sourceSymbol: _optionalChain([asset, 'optionalAccess',
|
|
7490
|
-
sourceDecimals: _optionalChain([asset, 'optionalAccess',
|
|
7688
|
+
sourceSymbol: _optionalChain([asset, 'optionalAccess', _212 => _212.symbol]),
|
|
7689
|
+
sourceDecimals: _optionalChain([asset, 'optionalAccess', _213 => _213.decimals]),
|
|
7491
7690
|
inputAmountUsd: _nullishCoalesce(depositAtSubmit.inputAmountUsd, () => ( void 0)),
|
|
7492
7691
|
directTransfer: routed.directTransfer,
|
|
7493
7692
|
quote
|
|
@@ -7527,7 +7726,7 @@ function DepositFlow({
|
|
|
7527
7726
|
swappedContext,
|
|
7528
7727
|
initialEvent: info.initialEvent
|
|
7529
7728
|
});
|
|
7530
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7729
|
+
_optionalChain([onLifecycleRef, 'access', _214 => _214.current, 'optionalCall', _215 => _215({
|
|
7531
7730
|
type: "submitted",
|
|
7532
7731
|
txHash: info.txHash,
|
|
7533
7732
|
sourceChain: SWAPPED_SOURCE_CHAIN,
|
|
@@ -7555,12 +7754,12 @@ function DepositFlow({
|
|
|
7555
7754
|
const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
|
|
7556
7755
|
(txHash, sourceChain, amount) => {
|
|
7557
7756
|
const depositAtSubmit = storeApi.getState().deposit;
|
|
7558
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7757
|
+
_optionalChain([onLifecycleRef, 'access', _216 => _216.current, 'optionalCall', _217 => _217({
|
|
7559
7758
|
type: "submitted",
|
|
7560
7759
|
txHash,
|
|
7561
7760
|
sourceChain,
|
|
7562
7761
|
amount,
|
|
7563
|
-
sourceDecimals: _optionalChain([depositAtSubmit, 'access',
|
|
7762
|
+
sourceDecimals: _optionalChain([depositAtSubmit, 'access', _218 => _218.selectedAsset, 'optionalAccess', _219 => _219.decimals]),
|
|
7564
7763
|
amountUsd: _nullishCoalesce(depositAtSubmit.inputAmountUsd, () => ( void 0))
|
|
7565
7764
|
})]);
|
|
7566
7765
|
},
|
|
@@ -7569,7 +7768,7 @@ function DepositFlow({
|
|
|
7569
7768
|
const handleDepositComplete = _react.useCallback.call(void 0,
|
|
7570
7769
|
(txHash, destinationTxHash, context) => {
|
|
7571
7770
|
logFlow("deposit:complete", { txHash, destinationTxHash, ...context });
|
|
7572
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7771
|
+
_optionalChain([onLifecycleRef, 'access', _220 => _220.current, 'optionalCall', _221 => _221({
|
|
7573
7772
|
type: "complete",
|
|
7574
7773
|
txHash,
|
|
7575
7774
|
destinationTxHash,
|
|
@@ -7581,14 +7780,14 @@ function DepositFlow({
|
|
|
7581
7780
|
const handleDepositFailed = _react.useCallback.call(void 0,
|
|
7582
7781
|
(txHash, error) => {
|
|
7583
7782
|
logFlowError("deposit:failed", error, { txHash });
|
|
7584
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7783
|
+
_optionalChain([onLifecycleRef, 'access', _222 => _222.current, 'optionalCall', _223 => _223({ type: "failed", txHash, error })]);
|
|
7585
7784
|
},
|
|
7586
7785
|
[logFlowError, onLifecycleRef]
|
|
7587
7786
|
);
|
|
7588
7787
|
const handleError = _react.useCallback.call(void 0,
|
|
7589
7788
|
(message, code) => {
|
|
7590
7789
|
logFlowError("flow:error", message, { code });
|
|
7591
|
-
_optionalChain([onErrorRef, 'access',
|
|
7790
|
+
_optionalChain([onErrorRef, 'access', _224 => _224.current, 'optionalCall', _225 => _225({ message, code })]);
|
|
7592
7791
|
},
|
|
7593
7792
|
[logFlowError, onErrorRef]
|
|
7594
7793
|
);
|
|
@@ -7637,9 +7836,9 @@ function DepositFlow({
|
|
|
7637
7836
|
address: _nullishCoalesce(_nullishCoalesce(option.address, () => ( option.solanaAddress)), () => ( option.id)),
|
|
7638
7837
|
state,
|
|
7639
7838
|
errorReason: _nullishCoalesce(entry.message, () => ( void 0)),
|
|
7640
|
-
balanceStatus: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess',
|
|
7641
|
-
balanceUsd: _optionalChain([portfolioEntry, 'optionalAccess',
|
|
7642
|
-
balanceChainIds: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess',
|
|
7839
|
+
balanceStatus: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess', _226 => _226.status]), () => ( "loading")),
|
|
7840
|
+
balanceUsd: _optionalChain([portfolioEntry, 'optionalAccess', _227 => _227.status]) === "ready" ? portfolioEntry.totalUsd : null,
|
|
7841
|
+
balanceChainIds: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess', _228 => _228.chainIds]), () => ( []))
|
|
7643
7842
|
};
|
|
7644
7843
|
});
|
|
7645
7844
|
}, [enableWallet, walletOptions, setupSlice, portfolioSlice]);
|
|
@@ -7730,7 +7929,7 @@ function DepositFlow({
|
|
|
7730
7929
|
onCopyAddress: () => {
|
|
7731
7930
|
const chainName = _chunkH577RJN5cjs.getChainName.call(void 0, targetChain);
|
|
7732
7931
|
const tokenSymbol = _chunkH577RJN5cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
7733
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
7932
|
+
_optionalChain([onEvent, 'optionalCall', _229 => _229({
|
|
7734
7933
|
type: "deposit_modal_transfer_crypto_cta_click",
|
|
7735
7934
|
default_chain: chainName,
|
|
7736
7935
|
default_token: tokenSymbol,
|
|
@@ -7777,7 +7976,7 @@ function DepositFlow({
|
|
|
7777
7976
|
}
|
|
7778
7977
|
),
|
|
7779
7978
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7780
|
-
|
|
7979
|
+
_chunkA42XAHIBcjs.ProcessingStep,
|
|
7781
7980
|
{
|
|
7782
7981
|
smartAccount: step.smartAccount,
|
|
7783
7982
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
@@ -7849,7 +8048,7 @@ function DepositFlow({
|
|
|
7849
8048
|
}
|
|
7850
8049
|
),
|
|
7851
8050
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7852
|
-
|
|
8051
|
+
_chunkA42XAHIBcjs.ProcessingStep,
|
|
7853
8052
|
{
|
|
7854
8053
|
smartAccount: step.smartAccount,
|
|
7855
8054
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
@@ -7882,8 +8081,8 @@ function DepositFlow({
|
|
|
7882
8081
|
);
|
|
7883
8082
|
}
|
|
7884
8083
|
if (isSolanaWalletMode) {
|
|
7885
|
-
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess',
|
|
7886
|
-
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess',
|
|
8084
|
+
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess', _230 => _230.solanaAddress]);
|
|
8085
|
+
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess', _231 => _231.solanaProvider]);
|
|
7887
8086
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
7888
8087
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7889
8088
|
AccountPreparingSkeleton,
|
|
@@ -7937,7 +8136,7 @@ function DepositFlow({
|
|
|
7937
8136
|
targetToken,
|
|
7938
8137
|
service,
|
|
7939
8138
|
solanaProvider,
|
|
7940
|
-
solanaConnection: _optionalChain([reownWallet, 'optionalAccess',
|
|
8139
|
+
solanaConnection: _optionalChain([reownWallet, 'optionalAccess', _232 => _232.solanaConnection]),
|
|
7941
8140
|
uiConfig,
|
|
7942
8141
|
onConfirm: handleSolanaConfirmed,
|
|
7943
8142
|
onError: handleError,
|
|
@@ -7978,7 +8177,7 @@ function DepositFlow({
|
|
|
7978
8177
|
) })
|
|
7979
8178
|
] }) : null,
|
|
7980
8179
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7981
|
-
|
|
8180
|
+
_chunkA42XAHIBcjs.ProcessingStep,
|
|
7982
8181
|
{
|
|
7983
8182
|
smartAccount: effectiveStep.smartAccount,
|
|
7984
8183
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
@@ -8015,7 +8214,7 @@ function DepositFlow({
|
|
|
8015
8214
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8016
8215
|
DappImportAssetSelectSkeleton,
|
|
8017
8216
|
{
|
|
8018
|
-
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportProvider, 'optionalAccess',
|
|
8217
|
+
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportProvider, 'optionalAccess', _233 => _233.sourceLabel]), () => ( "")),
|
|
8019
8218
|
error: dappImportBootError,
|
|
8020
8219
|
onRetry: handleBootRetry
|
|
8021
8220
|
}
|
|
@@ -8037,7 +8236,7 @@ function DepositFlow({
|
|
|
8037
8236
|
rows: dappImportSelectRows,
|
|
8038
8237
|
onRequestConnect: _nullishCoalesce(onConnect, () => ( onRequestConnect)),
|
|
8039
8238
|
onSelect: (providerId) => {
|
|
8040
|
-
const availabilityEntry = dappImportOwner && _optionalChain([dappImportAvailabilityOwner, 'optionalAccess',
|
|
8239
|
+
const availabilityEntry = dappImportOwner && _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _234 => _234.toLowerCase, 'call', _235 => _235()]) === dappImportOwner.toLowerCase() ? dappImportAvailability[providerId] : void 0;
|
|
8041
8240
|
if (availabilityEntry === "error") {
|
|
8042
8241
|
storeApi.dispatch({
|
|
8043
8242
|
type: "dapp-import/availability-retry-requested"
|
|
@@ -8056,16 +8255,16 @@ function DepositFlow({
|
|
|
8056
8255
|
}
|
|
8057
8256
|
);
|
|
8058
8257
|
}
|
|
8059
|
-
if (!_optionalChain([signerContext, 'optionalAccess',
|
|
8258
|
+
if (!_optionalChain([signerContext, 'optionalAccess', _236 => _236.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _237 => _237.publicClient])) {
|
|
8060
8259
|
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" }) }) }) }) });
|
|
8061
8260
|
}
|
|
8062
8261
|
const ownerAddress = signerContext.ownerAddress;
|
|
8063
|
-
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access',
|
|
8262
|
+
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _238 => _238.walletClient, 'optionalAccess', _239 => _239.chain, 'optionalAccess', _240 => _240.id]), () => ( _optionalChain([signerContext, 'access', _241 => _241.publicClient, 'access', _242 => _242.chain, 'optionalAccess', _243 => _243.id]))), () => ( setupChainId));
|
|
8064
8263
|
const getReadClientForChain = (chainId) => {
|
|
8065
|
-
if (_optionalChain([signerContext, 'access',
|
|
8264
|
+
if (_optionalChain([signerContext, 'access', _244 => _244.publicClient, 'access', _245 => _245.chain, 'optionalAccess', _246 => _246.id]) === chainId) {
|
|
8066
8265
|
return signerContext.publicClient;
|
|
8067
8266
|
}
|
|
8068
|
-
return
|
|
8267
|
+
return _chunkA42XAHIBcjs.getPublicClient.call(void 0, chainId, rpcUrls);
|
|
8069
8268
|
};
|
|
8070
8269
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
8071
8270
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -8094,8 +8293,9 @@ function DepositFlow({
|
|
|
8094
8293
|
effectiveStep.type === "dapp-import-asset-select" && activeDappImportProvider && activeDappImportAvailability && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8095
8294
|
DappImportAssetSelectStep,
|
|
8096
8295
|
{
|
|
8097
|
-
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access',
|
|
8296
|
+
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access', _247 => _247.assets, 'access', _248 => _248[0], 'optionalAccess', _249 => _249.sourceLabel]), () => ( activeDappImportProvider.sourceLabel)),
|
|
8098
8297
|
assets: activeDappImportAvailability.assets,
|
|
8298
|
+
incompleteSummary: _optionalChain([activeDappImportAvailability, 'access', _250 => _250.incomplete, 'optionalAccess', _251 => _251.summary]),
|
|
8099
8299
|
onSelect: handleDappImportAssetSelected
|
|
8100
8300
|
}
|
|
8101
8301
|
),
|
|
@@ -8105,7 +8305,7 @@ function DepositFlow({
|
|
|
8105
8305
|
walletClient: signerContext.walletClient,
|
|
8106
8306
|
publicClient: getReadClientForChain(effectiveStep.asset.chainId),
|
|
8107
8307
|
address: ownerAddress,
|
|
8108
|
-
|
|
8308
|
+
...dappImportBalanceSource(effectiveStep.asset),
|
|
8109
8309
|
asset: effectiveStep.asset,
|
|
8110
8310
|
defaultAmount: _nullishCoalesce(effectiveStep.inputAmountUsd, () => ( defaultAmount)),
|
|
8111
8311
|
switchChain: signerContext.switchChain,
|
|
@@ -8117,7 +8317,7 @@ function DepositFlow({
|
|
|
8117
8317
|
onContinue: handleAmountContinue,
|
|
8118
8318
|
onCtaClick: (ctaName) => {
|
|
8119
8319
|
const receiveSymbol = _chunkH577RJN5cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
8120
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
8320
|
+
_optionalChain([onEvent, 'optionalCall', _252 => _252({
|
|
8121
8321
|
type: "deposit_modal_connected_wallet_enter_value_cta_click",
|
|
8122
8322
|
send_token: effectiveStep.asset.symbol,
|
|
8123
8323
|
receive_token: receiveSymbol,
|
|
@@ -8152,8 +8352,11 @@ function DepositFlow({
|
|
|
8152
8352
|
const result = await activeDappImportProvider.executeTransfer(
|
|
8153
8353
|
{
|
|
8154
8354
|
walletClient: signerContext.walletClient,
|
|
8355
|
+
// The asset's chain: a provider's assets can span chains
|
|
8356
|
+
// (Aave positions exist on every deposit-enabled chain), so
|
|
8357
|
+
// there is no single provider-level chain to read from.
|
|
8155
8358
|
publicClient: getReadClientForChain(
|
|
8156
|
-
|
|
8359
|
+
effectiveStep.asset.chainId
|
|
8157
8360
|
),
|
|
8158
8361
|
recipient: effectiveStep.smartAccount,
|
|
8159
8362
|
asset: effectiveStep.asset,
|
|
@@ -8172,7 +8375,7 @@ function DepositFlow({
|
|
|
8172
8375
|
}
|
|
8173
8376
|
),
|
|
8174
8377
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8175
|
-
|
|
8378
|
+
_chunkA42XAHIBcjs.ProcessingStep,
|
|
8176
8379
|
{
|
|
8177
8380
|
smartAccount: effectiveStep.smartAccount,
|
|
8178
8381
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
@@ -8218,7 +8421,7 @@ function formatDate(iso) {
|
|
|
8218
8421
|
month: "short",
|
|
8219
8422
|
year: "numeric"
|
|
8220
8423
|
});
|
|
8221
|
-
} catch (
|
|
8424
|
+
} catch (e35) {
|
|
8222
8425
|
return iso;
|
|
8223
8426
|
}
|
|
8224
8427
|
}
|
|
@@ -8279,7 +8482,7 @@ function formatAmount(rawAmount, token, chainId) {
|
|
|
8279
8482
|
let frac = fracStr.slice(0, 5).replace(/0+$/, "");
|
|
8280
8483
|
if (frac.length < 2) frac = frac.padEnd(2, "0");
|
|
8281
8484
|
return `${whole}.${frac}`;
|
|
8282
|
-
} catch (
|
|
8485
|
+
} catch (e36) {
|
|
8283
8486
|
return rawAmount;
|
|
8284
8487
|
}
|
|
8285
8488
|
}
|
|
@@ -8328,7 +8531,7 @@ function DepositHistoryPanel({
|
|
|
8328
8531
|
);
|
|
8329
8532
|
const visibleDeposits = _react.useMemo.call(void 0, () => {
|
|
8330
8533
|
const sourceHashes = new Set(
|
|
8331
|
-
deposits.map((d) => _optionalChain([d, 'access',
|
|
8534
|
+
deposits.map((d) => _optionalChain([d, 'access', _253 => _253.sourceTxHash, 'optionalAccess', _254 => _254.toLowerCase, 'call', _255 => _255()])).filter((h) => Boolean(h))
|
|
8332
8535
|
);
|
|
8333
8536
|
return deposits.filter(
|
|
8334
8537
|
(d) => !(d.txHash && sourceHashes.has(d.txHash.toLowerCase()))
|
|
@@ -8350,7 +8553,7 @@ function DepositHistoryPanel({
|
|
|
8350
8553
|
className: "rs-modal-header-back",
|
|
8351
8554
|
"aria-label": "Back",
|
|
8352
8555
|
onClick: onClose,
|
|
8353
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8556
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.ChevronLeftIcon, {})
|
|
8354
8557
|
}
|
|
8355
8558
|
) }),
|
|
8356
8559
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: onCloseModal && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -8360,29 +8563,29 @@ function DepositHistoryPanel({
|
|
|
8360
8563
|
className: "rs-modal-close",
|
|
8361
8564
|
"aria-label": "Close",
|
|
8362
8565
|
onClick: onCloseModal,
|
|
8363
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8566
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.CloseIcon, {})
|
|
8364
8567
|
}
|
|
8365
8568
|
) })
|
|
8366
8569
|
] }),
|
|
8367
8570
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen", children: [
|
|
8368
8571
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen-body", children: [
|
|
8369
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8572
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.HistoryIcon, {}), title: "History" }),
|
|
8370
8573
|
isLoading && deposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
8371
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8574
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.HistoryIcon, {}) }),
|
|
8372
8575
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
8373
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8576
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.Spinner, { className: "rs-spinner--sm" }),
|
|
8374
8577
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Loading history\u2026" })
|
|
8375
8578
|
] })
|
|
8376
8579
|
] }),
|
|
8377
8580
|
error && !isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
8378
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8581
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.AlertTriangleIcon, {}) }),
|
|
8379
8582
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
8380
8583
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "Couldn't load history" }),
|
|
8381
8584
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: error })
|
|
8382
8585
|
] })
|
|
8383
8586
|
] }),
|
|
8384
8587
|
!isLoading && !error && visibleDeposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
8385
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8588
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.HistoryIcon, {}) }),
|
|
8386
8589
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
8387
8590
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "No deposits yet" }),
|
|
8388
8591
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Your deposit history will appear here" })
|
|
@@ -8402,7 +8605,7 @@ function DepositHistoryPanel({
|
|
|
8402
8605
|
)
|
|
8403
8606
|
] })
|
|
8404
8607
|
] }),
|
|
8405
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8608
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.PoweredBy, {})
|
|
8406
8609
|
] })
|
|
8407
8610
|
]
|
|
8408
8611
|
}
|
|
@@ -8438,8 +8641,8 @@ function HistoryCard({ deposit }) {
|
|
|
8438
8641
|
children: [
|
|
8439
8642
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-card-row", children: [
|
|
8440
8643
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-card-icons", children: [
|
|
8441
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-token", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8442
|
-
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-chain", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8644
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-token", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.TokenIcon, { symbol: sourceSymbol, fallback: sourceSymbol.slice(0, 2) }) }),
|
|
8645
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-chain", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.CdnIcon, { src: sourceChainIcon }) })
|
|
8443
8646
|
] }),
|
|
8444
8647
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-card-text", children: [
|
|
8445
8648
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-title", children: txTypeLabel }),
|
|
@@ -8455,14 +8658,14 @@ function HistoryCard({ deposit }) {
|
|
|
8455
8658
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
8456
8659
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-detail-value", children: [
|
|
8457
8660
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceChainName }),
|
|
8458
|
-
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8661
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.CdnIcon, { src: sourceChainIcon }) })
|
|
8459
8662
|
] })
|
|
8460
8663
|
] }),
|
|
8461
8664
|
targetChainName && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
8462
8665
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
|
|
8463
8666
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-detail-value", children: [
|
|
8464
8667
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName }),
|
|
8465
|
-
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8668
|
+
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.CdnIcon, { src: targetChainIcon }) })
|
|
8466
8669
|
] })
|
|
8467
8670
|
] }),
|
|
8468
8671
|
srcTxUrl && srcTxHash && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
@@ -8477,7 +8680,7 @@ function HistoryCard({ deposit }) {
|
|
|
8477
8680
|
onClick: (e) => e.stopPropagation(),
|
|
8478
8681
|
children: [
|
|
8479
8682
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: shortenHash(srcTxHash) }),
|
|
8480
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8683
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.ArrowUpRightIcon, {})
|
|
8481
8684
|
]
|
|
8482
8685
|
}
|
|
8483
8686
|
)
|
|
@@ -8492,7 +8695,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
|
8492
8695
|
// src/DepositModal.tsx
|
|
8493
8696
|
|
|
8494
8697
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
8495
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
8698
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-S3DSFXTX.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
8496
8699
|
);
|
|
8497
8700
|
function sortByCreatedAtDesc(items) {
|
|
8498
8701
|
return [...items].sort((a, b) => {
|
|
@@ -8506,8 +8709,8 @@ function hasSuppliedWalletClient(props) {
|
|
|
8506
8709
|
return Object.prototype.hasOwnProperty.call(props, WALLET_CLIENT_PROP);
|
|
8507
8710
|
}
|
|
8508
8711
|
function DepositModal(props) {
|
|
8509
|
-
|
|
8510
|
-
|
|
8712
|
+
_chunkA42XAHIBcjs.warnRemovedProps.call(void 0, "DepositModal", props);
|
|
8713
|
+
_chunkPUJHXHRAcjs.checkBackendUrl.call(void 0, "DepositModal", props.backendUrl);
|
|
8511
8714
|
const needsReown = !!props.reownAppId;
|
|
8512
8715
|
const hasWalletClientProp = hasSuppliedWalletClient(props);
|
|
8513
8716
|
if (needsReown) {
|
|
@@ -8569,13 +8772,13 @@ function DepositModalInner({
|
|
|
8569
8772
|
debug
|
|
8570
8773
|
}) {
|
|
8571
8774
|
const modalRef = _react.useRef.call(void 0, null);
|
|
8572
|
-
const onReadyRef =
|
|
8775
|
+
const onReadyRef = _chunkPUJHXHRAcjs.useLatestRef.call(void 0, onReady);
|
|
8573
8776
|
const [currentScreen, setCurrentScreen] = _react.useState.call(void 0, "connect");
|
|
8574
8777
|
const [swappedImmersive, setSwappedImmersive] = _react.useState.call(void 0, false);
|
|
8575
8778
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
8576
8779
|
void 0
|
|
8577
8780
|
);
|
|
8578
|
-
const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
8781
|
+
const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _256 => _256.showHistoryButton]), () => ( false));
|
|
8579
8782
|
const historyButtonVisible = showHistoryButton && (currentScreen === "select-asset" || currentScreen === "deposit-address");
|
|
8580
8783
|
const [historyOpen, setHistoryOpen] = _react.useState.call(void 0, false);
|
|
8581
8784
|
const [historyDeposits, setHistoryDeposits] = _react.useState.call(void 0, []);
|
|
@@ -8588,9 +8791,9 @@ function DepositModalInner({
|
|
|
8588
8791
|
const historyLoadedRef = _react.useRef.call(void 0, false);
|
|
8589
8792
|
const targetChain = targetChainProp === "solana" ? "solana" : _chunkH577RJN5cjs.getChainId.call(void 0, targetChainProp);
|
|
8590
8793
|
const sourceChain = sourceChainProp ? _chunkH577RJN5cjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
8591
|
-
const rpcUrls =
|
|
8794
|
+
const rpcUrls = _chunkPUJHXHRAcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
|
|
8592
8795
|
const service = _react.useMemo.call(void 0,
|
|
8593
|
-
() =>
|
|
8796
|
+
() => _chunkPUJHXHRAcjs.createDepositService.call(void 0, backendUrl, {
|
|
8594
8797
|
debug,
|
|
8595
8798
|
debugScope: "service:deposit"
|
|
8596
8799
|
}),
|
|
@@ -8624,12 +8827,12 @@ function DepositModalInner({
|
|
|
8624
8827
|
}, [store, targetChain, targetToken]);
|
|
8625
8828
|
_react.useEffect.call(void 0, () => {
|
|
8626
8829
|
if (isOpen && modalRef.current) {
|
|
8627
|
-
|
|
8830
|
+
_chunkPUJHXHRAcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
8628
8831
|
}
|
|
8629
8832
|
}, [isOpen, theme]);
|
|
8630
8833
|
_react.useEffect.call(void 0, () => {
|
|
8631
8834
|
if (isOpen) {
|
|
8632
|
-
_optionalChain([onReadyRef, 'access',
|
|
8835
|
+
_optionalChain([onReadyRef, 'access', _257 => _257.current, 'optionalCall', _258 => _258()]);
|
|
8633
8836
|
}
|
|
8634
8837
|
}, [isOpen, onReadyRef]);
|
|
8635
8838
|
const handleStepChange = _react.useCallback.call(void 0,
|
|
@@ -8705,10 +8908,10 @@ function DepositModalInner({
|
|
|
8705
8908
|
fetchHistory("initial");
|
|
8706
8909
|
}
|
|
8707
8910
|
}, [historyOpen, fetchHistory]);
|
|
8708
|
-
const onLifecycleRef =
|
|
8911
|
+
const onLifecycleRef = _chunkPUJHXHRAcjs.useLatestRef.call(void 0, onLifecycle);
|
|
8709
8912
|
const handleLifecycle = _react.useCallback.call(void 0,
|
|
8710
8913
|
(event) => {
|
|
8711
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
8914
|
+
_optionalChain([onLifecycleRef, 'access', _259 => _259.current, 'optionalCall', _260 => _260(event)]);
|
|
8712
8915
|
if (event.type === "smart-account-changed" && !event.evm && !event.solana) {
|
|
8713
8916
|
historyStaleRef.current = true;
|
|
8714
8917
|
}
|
|
@@ -8737,12 +8940,12 @@ function DepositModalInner({
|
|
|
8737
8940
|
store.dispatch({ type: "flow/reset" });
|
|
8738
8941
|
}
|
|
8739
8942
|
}, [isOpen, store]);
|
|
8740
|
-
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
8943
|
+
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _261 => _261.showBackButton]), () => ( true));
|
|
8741
8944
|
const canGoBack = backHandler !== void 0;
|
|
8742
8945
|
const hideHeaderChrome = swappedImmersive;
|
|
8743
8946
|
const modalClassName = `rs-modal${hideHeaderChrome ? " rs-modal--swapped-iframe" : ""}`;
|
|
8744
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8745
|
-
|
|
8947
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8948
|
+
_chunkPUJHXHRAcjs.Modal,
|
|
8746
8949
|
{
|
|
8747
8950
|
isOpen,
|
|
8748
8951
|
onClose,
|
|
@@ -8758,7 +8961,7 @@ function DepositModalInner({
|
|
|
8758
8961
|
className: "rs-modal-header-back",
|
|
8759
8962
|
"aria-label": "Go back",
|
|
8760
8963
|
onClick: backHandler,
|
|
8761
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8964
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.ChevronLeftIcon, {})
|
|
8762
8965
|
}
|
|
8763
8966
|
) }),
|
|
8764
8967
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
|
|
@@ -8770,7 +8973,7 @@ function DepositModalInner({
|
|
|
8770
8973
|
"aria-label": "Deposit history",
|
|
8771
8974
|
onClick: handleHistoryOpen,
|
|
8772
8975
|
disabled: !recipient,
|
|
8773
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8976
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.HistoryIcon, {})
|
|
8774
8977
|
}
|
|
8775
8978
|
),
|
|
8776
8979
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -8780,7 +8983,7 @@ function DepositModalInner({
|
|
|
8780
8983
|
onClick: onClose,
|
|
8781
8984
|
className: "rs-modal-close",
|
|
8782
8985
|
"aria-label": "Close",
|
|
8783
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8986
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.CloseIcon, {})
|
|
8784
8987
|
}
|
|
8785
8988
|
)
|
|
8786
8989
|
] })
|
|
@@ -8814,7 +9017,7 @@ function DepositModalInner({
|
|
|
8814
9017
|
onDisconnect,
|
|
8815
9018
|
onRequestConnect,
|
|
8816
9019
|
uiConfig,
|
|
8817
|
-
appFees: _optionalChain([clientSetup, 'optionalAccess',
|
|
9020
|
+
appFees: _optionalChain([clientSetup, 'optionalAccess', _262 => _262.appFees]),
|
|
8818
9021
|
appFeesResolved: clientSetup !== null,
|
|
8819
9022
|
onStepChange: handleStepChange,
|
|
8820
9023
|
onSwappedImmersiveChange: setSwappedImmersive,
|