@rhinestone/deposit-modal 0.9.1 → 0.11.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-6RVLEM3B.mjs} +96 -26
- package/dist/{DepositModalReown-YQSO4SVY.cjs → DepositModalReown-TXTLVZIQ.cjs} +97 -27
- package/dist/caip-D8aRWdEY.d.cts +40 -0
- package/dist/caip-D8aRWdEY.d.ts +40 -0
- package/dist/{chunk-A223BLVC.mjs → chunk-53IFZGSF.mjs} +177 -21
- package/dist/{chunk-VQJHYWAE.cjs → chunk-7RNEYPI4.cjs} +836 -579
- package/dist/{chunk-ITFRTPGF.cjs → chunk-BLJMYCBF.cjs} +92 -90
- package/dist/{chunk-AYWEWI47.mjs → chunk-DYTRG4C7.mjs} +1 -1
- package/dist/{chunk-QGXAAFHU.mjs → chunk-G4FVZQOM.mjs} +23 -21
- package/dist/{chunk-SQOEHQNT.cjs → chunk-GWA6GFTI.cjs} +66 -63
- package/dist/{chunk-EEEQZOTJ.cjs → chunk-HCQWFL3A.cjs} +84 -101
- package/dist/{chunk-WUQZYQRK.mjs → chunk-ITAYM7SB.mjs} +784 -167
- package/dist/{chunk-YEBXUUH3.cjs → chunk-JPRV36DT.cjs} +2 -2
- package/dist/{chunk-EAUF7SGM.cjs → chunk-JYKMR6QI.cjs} +3 -3
- package/dist/{chunk-ILT2PITN.mjs → chunk-MZ53PDIX.mjs} +1 -1
- package/dist/{chunk-6U2H3R3T.cjs → chunk-NPSC5R22.cjs} +862 -245
- package/dist/{chunk-QLZ5RZTA.mjs → chunk-QRR3Y7EK.mjs} +1 -1
- package/dist/{chunk-H577RJN5.cjs → chunk-TENL4H64.cjs} +186 -30
- package/dist/{chunk-N3OHR3T2.mjs → chunk-TRD2FCAR.mjs} +363 -106
- package/dist/{chunk-7OQO6JDC.mjs → chunk-VRNRRN2U.mjs} +12 -9
- package/dist/{chunk-GYEUZSQP.mjs → chunk-WLDTBKRA.mjs} +14 -31
- package/dist/{chunk-XJE5MRY4.cjs → chunk-XVKBCDZI.cjs} +1 -1
- package/dist/claim.cjs +6 -6
- package/dist/claim.d.cts +3 -2
- package/dist/claim.d.ts +3 -2
- package/dist/claim.mjs +5 -5
- package/dist/{caip-523Zrc3r.d.cts → constants-FuzG3h4m.d.cts} +1 -18
- package/dist/{caip-523Zrc3r.d.ts → constants-FuzG3h4m.d.ts} +1 -18
- package/dist/constants.cjs +5 -3
- package/dist/constants.d.cts +3 -2
- package/dist/constants.d.ts +3 -2
- package/dist/constants.mjs +4 -2
- package/dist/deposit.cjs +8 -8
- package/dist/deposit.d.cts +3 -2
- package/dist/deposit.d.ts +3 -2
- package/dist/deposit.mjs +7 -7
- package/dist/index.cjs +12 -10
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.mjs +11 -9
- package/dist/polymarket.cjs +5 -5
- package/dist/polymarket.mjs +2 -2
- package/dist/styles.css +14 -0
- package/dist/{types-C0SGf-21.d.cts → types-C7wag_iL.d.cts} +4 -3
- package/dist/{types-C0SGf-21.d.ts → types-D4b6Cjox.d.ts} +4 -3
- package/dist/withdraw.cjs +6 -6
- package/dist/withdraw.d.cts +3 -2
- package/dist/withdraw.d.ts +3 -2
- package/dist/withdraw.mjs +5 -5
- package/package.json +1 -1
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
+
var _chunkHCQWFL3Acjs = require('./chunk-HCQWFL3A.cjs');
|
|
20
21
|
|
|
21
|
-
var _chunkEEEQZOTJcjs = require('./chunk-EEEQZOTJ.cjs');
|
|
22
22
|
|
|
23
|
+
var _chunkJYKMR6QIcjs = require('./chunk-JYKMR6QI.cjs');
|
|
23
24
|
|
|
24
|
-
var _chunkEAUF7SGMcjs = require('./chunk-EAUF7SGM.cjs');
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
@@ -77,7 +77,6 @@ var _chunkEAUF7SGMcjs = require('./chunk-EAUF7SGM.cjs');
|
|
|
77
77
|
|
|
78
78
|
|
|
79
79
|
|
|
80
|
-
var _chunk6U2H3R3Tcjs = require('./chunk-6U2H3R3T.cjs');
|
|
81
80
|
|
|
82
81
|
|
|
83
82
|
|
|
@@ -86,9 +85,9 @@ var _chunk6U2H3R3Tcjs = require('./chunk-6U2H3R3T.cjs');
|
|
|
86
85
|
|
|
87
86
|
|
|
88
87
|
|
|
88
|
+
var _chunkNPSC5R22cjs = require('./chunk-NPSC5R22.cjs');
|
|
89
89
|
|
|
90
90
|
|
|
91
|
-
var _chunkYEBXUUH3cjs = require('./chunk-YEBXUUH3.cjs');
|
|
92
91
|
|
|
93
92
|
|
|
94
93
|
|
|
@@ -97,6 +96,7 @@ var _chunkYEBXUUH3cjs = require('./chunk-YEBXUUH3.cjs');
|
|
|
97
96
|
|
|
98
97
|
|
|
99
98
|
|
|
99
|
+
var _chunkJPRV36DTcjs = require('./chunk-JPRV36DT.cjs');
|
|
100
100
|
|
|
101
101
|
|
|
102
102
|
|
|
@@ -116,7 +116,20 @@ var _chunkYEBXUUH3cjs = require('./chunk-YEBXUUH3.cjs');
|
|
|
116
116
|
|
|
117
117
|
|
|
118
118
|
|
|
119
|
-
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
var _chunkTENL4H64cjs = require('./chunk-TENL4H64.cjs');
|
|
120
133
|
|
|
121
134
|
// src/DepositModal.tsx
|
|
122
135
|
|
|
@@ -206,12 +219,15 @@ SegmentedToggle.displayName = "SegmentedToggle";
|
|
|
206
219
|
// src/components/ui/ChainIcon.tsx
|
|
207
220
|
|
|
208
221
|
function ChainIcon({ chainId, className, loading }) {
|
|
209
|
-
const badge =
|
|
222
|
+
const badge = _chunkTENL4H64cjs.getChainBadge.call(void 0, chainId);
|
|
223
|
+
const catalogChain = _chunkNPSC5R22cjs.useCatalogChain.call(void 0, _chunkNPSC5R22cjs.catalogKeyForChain.call(void 0, chainId));
|
|
224
|
+
const name = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _2 => _2.name]), () => ( _chunkTENL4H64cjs.getChainName.call(void 0, chainId)));
|
|
225
|
+
const initial = (_nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _3 => _3.name]), () => ( badge.shortLabel))).charAt(0);
|
|
210
226
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
211
|
-
|
|
227
|
+
_chunkNPSC5R22cjs.CdnIcon,
|
|
212
228
|
{
|
|
213
|
-
src:
|
|
214
|
-
alt:
|
|
229
|
+
src: _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _4 => _4.iconUrl]), () => ( _chunkTENL4H64cjs.getChainIcon.call(void 0, chainId))),
|
|
230
|
+
alt: name,
|
|
215
231
|
className,
|
|
216
232
|
loading,
|
|
217
233
|
fallback: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -219,8 +235,8 @@ function ChainIcon({ chainId, className, loading }) {
|
|
|
219
235
|
{
|
|
220
236
|
className: "rs-chain-badge-fallback",
|
|
221
237
|
style: { backgroundColor: badge.bg, color: badge.color },
|
|
222
|
-
"aria-label":
|
|
223
|
-
children:
|
|
238
|
+
"aria-label": name,
|
|
239
|
+
children: initial
|
|
224
240
|
}
|
|
225
241
|
)
|
|
226
242
|
}
|
|
@@ -231,16 +247,16 @@ ChainIcon.displayName = "ChainIcon";
|
|
|
231
247
|
// src/components/ui/WalletBadgeIcons/index.tsx
|
|
232
248
|
|
|
233
249
|
function BadgeImage({ src, alt = "" }) {
|
|
234
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
250
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CdnIcon, { src, alt }) });
|
|
235
251
|
}
|
|
236
252
|
var WALLET_BADGES = ["rabby", "phantom", "walletconnect"];
|
|
237
253
|
function WalletBadgeIcons() {
|
|
238
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-list-row-meta-icons", children: WALLET_BADGES.map((slug) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BadgeImage, { src:
|
|
254
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-list-row-meta-icons", children: WALLET_BADGES.map((slug) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BadgeImage, { src: _chunkTENL4H64cjs.cdnIconUrl.call(void 0, "wallets", slug) }, slug)) });
|
|
239
255
|
}
|
|
240
256
|
WalletBadgeIcons.displayName = "WalletBadgeIcons";
|
|
241
257
|
var TRANSFER_CHAIN_BADGES = ["mainnet", "solana", "base"];
|
|
242
258
|
function ChainBadgeIcons() {
|
|
243
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-list-row-meta-icons", children: TRANSFER_CHAIN_BADGES.map((slug) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BadgeImage, { src:
|
|
259
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-list-row-meta-icons", children: TRANSFER_CHAIN_BADGES.map((slug) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BadgeImage, { src: _chunkTENL4H64cjs.cdnIconUrl.call(void 0, "chains", slug) }, slug)) });
|
|
244
260
|
}
|
|
245
261
|
ChainBadgeIcons.displayName = "ChainBadgeIcons";
|
|
246
262
|
var MAX_WALLET_CHAIN_MARKS = 3;
|
|
@@ -260,24 +276,23 @@ var DAPP_IMPORT_CATALOG = [
|
|
|
260
276
|
{
|
|
261
277
|
id: "polymarket",
|
|
262
278
|
label: "Polymarket",
|
|
263
|
-
iconUrl:
|
|
264
|
-
},
|
|
265
|
-
{
|
|
266
|
-
id: "hyperliquid",
|
|
267
|
-
label: "Hyperliquid",
|
|
268
|
-
iconUrl: _chunkH577RJN5cjs.cdnIconUrl.call(void 0, "dapps", "hyperliquid"),
|
|
269
|
-
comingSoon: true
|
|
279
|
+
iconUrl: _chunkTENL4H64cjs.cdnIconUrl.call(void 0, "dapps", "polymarket")
|
|
270
280
|
},
|
|
271
281
|
{
|
|
272
282
|
id: "aave",
|
|
273
283
|
label: "Aave",
|
|
274
|
-
iconUrl:
|
|
284
|
+
iconUrl: _chunkTENL4H64cjs.cdnIconUrl.call(void 0, "dapps", "aave")
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
id: "hyperliquid",
|
|
288
|
+
label: "Hyperliquid",
|
|
289
|
+
iconUrl: _chunkTENL4H64cjs.cdnIconUrl.call(void 0, "dapps", "hyperliquid"),
|
|
275
290
|
comingSoon: true
|
|
276
291
|
},
|
|
277
292
|
{
|
|
278
293
|
id: "morpho",
|
|
279
294
|
label: "Morpho",
|
|
280
|
-
iconUrl:
|
|
295
|
+
iconUrl: _chunkTENL4H64cjs.cdnIconUrl.call(void 0, "dapps", "morpho"),
|
|
281
296
|
comingSoon: true
|
|
282
297
|
}
|
|
283
298
|
];
|
|
@@ -285,7 +300,7 @@ var DAPP_IMPORT_CATALOG = [
|
|
|
285
300
|
// src/components/ui/BrandIcons.tsx
|
|
286
301
|
|
|
287
302
|
function ExchangeBadgeImage({ name }) {
|
|
288
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
303
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CdnIcon, { src: _nullishCoalesce(_chunkHCQWFL3Acjs.getExchangeLogoSrc.call(void 0, name), () => ( void 0)) });
|
|
289
304
|
}
|
|
290
305
|
var CARD_NETWORKS = ["amex", "visa", "mastercard"];
|
|
291
306
|
function CardNetworkIcons() {
|
|
@@ -293,7 +308,7 @@ function CardNetworkIcons() {
|
|
|
293
308
|
"span",
|
|
294
309
|
{
|
|
295
310
|
className: `rs-card-network rs-card-network--${network}`,
|
|
296
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
311
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CdnIcon, { src: _chunkTENL4H64cjs.cdnIconUrl.call(void 0, "cards", network) })
|
|
297
312
|
},
|
|
298
313
|
network
|
|
299
314
|
)) });
|
|
@@ -314,7 +329,7 @@ function DappBadgeIcons() {
|
|
|
314
329
|
).filter(
|
|
315
330
|
(brand) => Boolean(brand)
|
|
316
331
|
);
|
|
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,
|
|
332
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-list-row-meta-icons rs-list-row-meta-icons--exchanges", children: marks.map((brand) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CdnIcon, { src: brand.iconUrl, alt: brand.label }) }, brand.id)) });
|
|
318
333
|
}
|
|
319
334
|
DappBadgeIcons.displayName = "DappBadgeIcons";
|
|
320
335
|
var DAPP_BADGE_COUNT = DAPP_BADGE_ORDER.length;
|
|
@@ -334,9 +349,9 @@ function balanceSubtitle(status, balanceUsd, fallback) {
|
|
|
334
349
|
return "No balance";
|
|
335
350
|
}
|
|
336
351
|
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,
|
|
352
|
+
if (name === "apple") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.AppleIcon, {});
|
|
353
|
+
if (name === "bank") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.BankIcon, {});
|
|
354
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CardIcon, {});
|
|
340
355
|
}
|
|
341
356
|
function FiatMethodIcon({ option }) {
|
|
342
357
|
const [remoteFailed, setRemoteFailed] = _react.useState.call(void 0, false);
|
|
@@ -419,13 +434,13 @@ function renderWalletLeading(row) {
|
|
|
419
434
|
}
|
|
420
435
|
);
|
|
421
436
|
}
|
|
422
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
437
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.WalletIcon, {});
|
|
423
438
|
}
|
|
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,
|
|
439
|
+
var TRANSFER_CRYPTO_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.TransferCryptoIcon, {});
|
|
440
|
+
var WALLET_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.WalletIcon, {});
|
|
441
|
+
var EXCHANGE_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.UnplugIcon, {});
|
|
442
|
+
var MIGRATE_ASSETS_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.MigrateAssetsIcon, {});
|
|
443
|
+
var SMALL_SPINNER = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.Spinner, { className: "rs-spinner--sm" });
|
|
429
444
|
var CONNECT_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
430
445
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, WalletBadgeIcons, {}),
|
|
431
446
|
"+100"
|
|
@@ -442,7 +457,7 @@ var MIGRATE_ASSETS_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxrunt
|
|
|
442
457
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, DappBadgeIcons, {}),
|
|
443
458
|
EXTRA_DAPP_COUNT > 0 ? `+${EXTRA_DAPP_COUNT}` : null
|
|
444
459
|
] });
|
|
445
|
-
var EXTRA_CHAIN_COUNT = Math.max(0,
|
|
460
|
+
var EXTRA_CHAIN_COUNT = Math.max(0, _chunkTENL4H64cjs.getSupportedChainIds.call(void 0, ).length - 3);
|
|
446
461
|
var CHAIN_BADGE_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
447
462
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChainBadgeIcons, {}),
|
|
448
463
|
EXTRA_CHAIN_COUNT > 0 ? `+${EXTRA_CHAIN_COUNT}` : null
|
|
@@ -486,7 +501,7 @@ function ConnectStep({
|
|
|
486
501
|
if (onSelectTransferCrypto) {
|
|
487
502
|
cryptoRows.push(
|
|
488
503
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
489
|
-
|
|
504
|
+
_chunkJYKMR6QIcjs.ListRow,
|
|
490
505
|
{
|
|
491
506
|
leading: TRANSFER_CRYPTO_LEADING,
|
|
492
507
|
title: "Transfer crypto",
|
|
@@ -507,13 +522,13 @@ function ConnectStep({
|
|
|
507
522
|
);
|
|
508
523
|
cryptoRows.push(
|
|
509
524
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
510
|
-
|
|
525
|
+
_chunkJYKMR6QIcjs.ListRow,
|
|
511
526
|
{
|
|
512
527
|
leading: renderWalletLeading(row),
|
|
513
528
|
title: collapseToExternal ? "External wallet" : row.label,
|
|
514
529
|
subtitle: subtitleText,
|
|
515
|
-
meta: row.kind === "solana" || !_optionalChain([row, 'access',
|
|
516
|
-
onClick: () => _optionalChain([onConfirmWallet, 'optionalCall',
|
|
530
|
+
meta: row.kind === "solana" || !_optionalChain([row, 'access', _5 => _5.balanceChainIds, 'optionalAccess', _6 => _6.length]) ? void 0 : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WalletChainBadgeIcons, { chainIds: row.balanceChainIds }),
|
|
531
|
+
onClick: () => _optionalChain([onConfirmWallet, 'optionalCall', _7 => _7(row.id)]),
|
|
517
532
|
disabled: row.state === "loading",
|
|
518
533
|
trailing: renderRowTrailing(row.state)
|
|
519
534
|
},
|
|
@@ -524,7 +539,7 @@ function ConnectStep({
|
|
|
524
539
|
if (!hasReownWallet && handleConnect) {
|
|
525
540
|
cryptoRows.push(
|
|
526
541
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
527
|
-
|
|
542
|
+
_chunkJYKMR6QIcjs.ListRow,
|
|
528
543
|
{
|
|
529
544
|
leading: WALLET_LEADING,
|
|
530
545
|
title: "Connect wallet",
|
|
@@ -539,7 +554,7 @@ function ConnectStep({
|
|
|
539
554
|
if (onSelectFundFromExchange) {
|
|
540
555
|
cryptoRows.push(
|
|
541
556
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
542
|
-
|
|
557
|
+
_chunkJYKMR6QIcjs.ListRow,
|
|
543
558
|
{
|
|
544
559
|
leading: EXCHANGE_LEADING,
|
|
545
560
|
title: "Connect exchange",
|
|
@@ -554,7 +569,7 @@ function ConnectStep({
|
|
|
554
569
|
if (onSelectMigrateAssets) {
|
|
555
570
|
cryptoRows.push(
|
|
556
571
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
557
|
-
|
|
572
|
+
_chunkJYKMR6QIcjs.ListRow,
|
|
558
573
|
{
|
|
559
574
|
leading: MIGRATE_ASSETS_LEADING,
|
|
560
575
|
title: "Migrate assets",
|
|
@@ -575,7 +590,7 @@ function ConnectStep({
|
|
|
575
590
|
for (const opt of fiatPaymentMethods) {
|
|
576
591
|
cashRows.push(
|
|
577
592
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
578
|
-
|
|
593
|
+
_chunkJYKMR6QIcjs.ListRow,
|
|
579
594
|
{
|
|
580
595
|
leading: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FiatMethodIcon, { option: opt }),
|
|
581
596
|
title: opt.label,
|
|
@@ -590,7 +605,7 @@ function ConnectStep({
|
|
|
590
605
|
} else if (fiatLoading) {
|
|
591
606
|
cashRows.push(
|
|
592
607
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
593
|
-
|
|
608
|
+
_chunkJYKMR6QIcjs.ListRow,
|
|
594
609
|
{
|
|
595
610
|
leading: SMALL_SPINNER,
|
|
596
611
|
title: "Loading payment options\u2026",
|
|
@@ -606,7 +621,7 @@ function ConnectStep({
|
|
|
606
621
|
const [tab, setTab] = _react.useState.call(void 0, defaultMethodTab);
|
|
607
622
|
const handleTabChange = (next) => {
|
|
608
623
|
setTab(next);
|
|
609
|
-
_optionalChain([onMethodTabChange, 'optionalCall',
|
|
624
|
+
_optionalChain([onMethodTabChange, 'optionalCall', _8 => _8(next)]);
|
|
610
625
|
};
|
|
611
626
|
const activeTab = showToggle ? tab : hasCash && !hasCrypto ? "cash" : "crypto";
|
|
612
627
|
const activeRows = activeTab === "cash" ? cashRows : cryptoRows;
|
|
@@ -619,9 +634,9 @@ function ConnectStep({
|
|
|
619
634
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
620
635
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
621
636
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
622
|
-
|
|
637
|
+
_chunkNPSC5R22cjs.BodyHeader,
|
|
623
638
|
{
|
|
624
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
639
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.HandCoinsIcon, {}),
|
|
625
640
|
title,
|
|
626
641
|
subtitle: _nullishCoalesce(subtitle, () => ( defaultSubtitle)),
|
|
627
642
|
aside: showToggle ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -657,7 +672,7 @@ function ConnectStep({
|
|
|
657
672
|
children: "Disconnect wallet"
|
|
658
673
|
}
|
|
659
674
|
) }),
|
|
660
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
675
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.PoweredBy, {})
|
|
661
676
|
] });
|
|
662
677
|
}
|
|
663
678
|
ConnectStep.displayName = "ConnectStep";
|
|
@@ -680,14 +695,17 @@ function AssetSelectStep({
|
|
|
680
695
|
const [selectedAssetId, setSelectedAssetId] = _react.useState.call(void 0, null);
|
|
681
696
|
const [loading, setLoading] = _react.useState.call(void 0, true);
|
|
682
697
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
698
|
+
const isDepositChain = _chunkNPSC5R22cjs.useIsDepositChain.call(void 0, );
|
|
699
|
+
const { catalog } = _chunkNPSC5R22cjs.useChainCatalog.call(void 0, );
|
|
700
|
+
const chainName = _chunkNPSC5R22cjs.useChainName.call(void 0, );
|
|
683
701
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
684
702
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
685
|
-
return
|
|
703
|
+
return _chunkNPSC5R22cjs.getAssetId.call(void 0, {
|
|
686
704
|
chainId: defaultSourceChain,
|
|
687
705
|
token: defaultSourceToken
|
|
688
706
|
});
|
|
689
707
|
}, [defaultSourceChain, defaultSourceToken]);
|
|
690
|
-
const onTotalBalanceComputedRef =
|
|
708
|
+
const onTotalBalanceComputedRef = _chunkNPSC5R22cjs.useLatestRef.call(void 0, onTotalBalanceComputed);
|
|
691
709
|
_react.useEffect.call(void 0, () => {
|
|
692
710
|
let active = true;
|
|
693
711
|
function emitAssetsUpdate(currentAssets) {
|
|
@@ -695,7 +713,7 @@ function AssetSelectStep({
|
|
|
695
713
|
(sum, asset) => sum + (_nullishCoalesce(asset.balanceUsd, () => ( 0))),
|
|
696
714
|
0
|
|
697
715
|
);
|
|
698
|
-
_optionalChain([onTotalBalanceComputedRef, 'access',
|
|
716
|
+
_optionalChain([onTotalBalanceComputedRef, 'access', _9 => _9.current, 'optionalCall', _10 => _10(total)]);
|
|
699
717
|
}
|
|
700
718
|
async function loadPortfolio() {
|
|
701
719
|
if (!address) {
|
|
@@ -707,17 +725,20 @@ function AssetSelectStep({
|
|
|
707
725
|
try {
|
|
708
726
|
const portfolio = await service.fetchPortfolio(address);
|
|
709
727
|
if (!active) return;
|
|
710
|
-
const portfolioAssets =
|
|
728
|
+
const portfolioAssets = _chunkNPSC5R22cjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
711
729
|
setAssets(portfolioAssets);
|
|
712
730
|
emitAssetsUpdate(portfolioAssets);
|
|
713
731
|
const hasNative = portfolioAssets.some(
|
|
714
|
-
(asset) => asset.token.toLowerCase() ===
|
|
732
|
+
(asset) => asset.token.toLowerCase() === _chunkTENL4H64cjs.NATIVE_TOKEN_ADDRESS
|
|
715
733
|
);
|
|
716
734
|
if (!hasNative) {
|
|
735
|
+
const connectedChainId = _optionalChain([publicClient, 'access', _11 => _11.chain, 'optionalAccess', _12 => _12.id]);
|
|
717
736
|
const nativeAssets = await fetchNativeAssets(
|
|
718
737
|
address,
|
|
719
738
|
publicClient,
|
|
720
|
-
portfolioAssets
|
|
739
|
+
portfolioAssets,
|
|
740
|
+
isDepositChain,
|
|
741
|
+
connectedChainId != null ? _optionalChain([catalog, 'optionalAccess', _13 => _13.byChainId, 'access', _14 => _14.get, 'call', _15 => _15(connectedChainId)]) : void 0
|
|
721
742
|
);
|
|
722
743
|
if (!active) return;
|
|
723
744
|
if (nativeAssets.length > 0) {
|
|
@@ -739,15 +760,23 @@ function AssetSelectStep({
|
|
|
739
760
|
return () => {
|
|
740
761
|
active = false;
|
|
741
762
|
};
|
|
742
|
-
}, [
|
|
763
|
+
}, [
|
|
764
|
+
address,
|
|
765
|
+
publicClient,
|
|
766
|
+
service,
|
|
767
|
+
onTotalBalanceComputedRef,
|
|
768
|
+
isDepositChain,
|
|
769
|
+
catalog
|
|
770
|
+
]);
|
|
743
771
|
const rows = _react.useMemo.call(void 0, () => {
|
|
744
772
|
return assets.filter((a) => {
|
|
773
|
+
if (!isDepositChain(a.chainId)) return false;
|
|
745
774
|
try {
|
|
746
775
|
if (BigInt(_nullishCoalesce(a.balance, () => ( "0"))) <= BigInt(0)) return false;
|
|
747
776
|
} catch (e2) {
|
|
748
777
|
return false;
|
|
749
778
|
}
|
|
750
|
-
const isNativeToken = a.token.toLowerCase() ===
|
|
779
|
+
const isNativeToken = a.token.toLowerCase() === _chunkTENL4H64cjs.NATIVE_TOKEN_ADDRESS;
|
|
751
780
|
if (!isNativeToken && !(typeof a.balanceUsd === "number" && a.balanceUsd >= 0.01))
|
|
752
781
|
return false;
|
|
753
782
|
return true;
|
|
@@ -761,7 +790,7 @@ function AssetSelectStep({
|
|
|
761
790
|
if (balB < balA) return -1;
|
|
762
791
|
return 0;
|
|
763
792
|
});
|
|
764
|
-
}, [assets]);
|
|
793
|
+
}, [assets, isDepositChain]);
|
|
765
794
|
_react.useEffect.call(void 0, () => {
|
|
766
795
|
if (!defaultAssetId || selectedAssetId) return;
|
|
767
796
|
if (rows.some((asset) => asset.id === defaultAssetId)) {
|
|
@@ -775,7 +804,7 @@ function AssetSelectStep({
|
|
|
775
804
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
776
805
|
const numeric = Number(raw);
|
|
777
806
|
if (!Number.isFinite(numeric)) return raw;
|
|
778
|
-
return
|
|
807
|
+
return _chunkNPSC5R22cjs.tokenFormatter.format(numeric);
|
|
779
808
|
} catch (e3) {
|
|
780
809
|
return asset.balance;
|
|
781
810
|
}
|
|
@@ -783,20 +812,20 @@ function AssetSelectStep({
|
|
|
783
812
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
784
813
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
785
814
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
786
|
-
|
|
815
|
+
_chunkNPSC5R22cjs.BodyHeader,
|
|
787
816
|
{
|
|
788
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
817
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.WalletIcon, {}),
|
|
789
818
|
title: "Your assets",
|
|
790
819
|
subtitle: "Select source assets to transfer"
|
|
791
820
|
}
|
|
792
821
|
),
|
|
793
822
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
794
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
823
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.Spinner, { className: "rs-text-tertiary" }),
|
|
795
824
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
796
825
|
] }),
|
|
797
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
826
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.Callout, { variant: "error", children: error }),
|
|
798
827
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
799
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
828
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
800
829
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
801
830
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
802
831
|
address.slice(0, 6),
|
|
@@ -816,8 +845,8 @@ function AssetSelectStep({
|
|
|
816
845
|
!loading && !error && rows.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: rows.map((asset) => {
|
|
817
846
|
const isSelected = selectedAssetId === asset.id;
|
|
818
847
|
const tokenAmount = formatBalance(asset);
|
|
819
|
-
const badge =
|
|
820
|
-
const chainIcon =
|
|
848
|
+
const badge = _chunkTENL4H64cjs.getChainBadge.call(void 0, asset.chainId);
|
|
849
|
+
const chainIcon = _chunkTENL4H64cjs.getChainIcon.call(void 0, asset.chainId);
|
|
821
850
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
822
851
|
"button",
|
|
823
852
|
{
|
|
@@ -829,13 +858,13 @@ function AssetSelectStep({
|
|
|
829
858
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
|
|
830
859
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-icon-wrapper", children: [
|
|
831
860
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
832
|
-
|
|
861
|
+
_chunkNPSC5R22cjs.TokenIcon,
|
|
833
862
|
{
|
|
834
863
|
symbol: asset.symbol,
|
|
835
864
|
fallback: asset.symbol.slice(0, 4)
|
|
836
865
|
}
|
|
837
866
|
) }),
|
|
838
|
-
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
867
|
+
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CdnIcon, { src: chainIcon, alt: chainName(asset.chainId) }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
839
868
|
"span",
|
|
840
869
|
{
|
|
841
870
|
className: "rs-asset-chain-badge",
|
|
@@ -852,7 +881,7 @@ function AssetSelectStep({
|
|
|
852
881
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-name", children: asset.symbol }),
|
|
853
882
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-asset-chain", children: [
|
|
854
883
|
"on ",
|
|
855
|
-
|
|
884
|
+
chainName(asset.chainId)
|
|
856
885
|
] })
|
|
857
886
|
] }),
|
|
858
887
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-balance-small", children: [
|
|
@@ -862,14 +891,14 @@ function AssetSelectStep({
|
|
|
862
891
|
] })
|
|
863
892
|
] })
|
|
864
893
|
] }),
|
|
865
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ?
|
|
894
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunkNPSC5R22cjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
866
895
|
]
|
|
867
896
|
},
|
|
868
897
|
asset.id
|
|
869
898
|
);
|
|
870
899
|
}) }),
|
|
871
900
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
872
|
-
|
|
901
|
+
_chunkNPSC5R22cjs.Button,
|
|
873
902
|
{
|
|
874
903
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
875
904
|
disabled: !selectedAsset,
|
|
@@ -878,30 +907,31 @@ function AssetSelectStep({
|
|
|
878
907
|
}
|
|
879
908
|
)
|
|
880
909
|
] }),
|
|
881
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
910
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.PoweredBy, {})
|
|
882
911
|
] });
|
|
883
912
|
}
|
|
884
|
-
async function fetchNativeAssets(address, publicClient, existing) {
|
|
913
|
+
async function fetchNativeAssets(address, publicClient, existing, isDepositChain, catalogChain) {
|
|
885
914
|
const existingIds = new Set(existing.map((asset) => asset.id));
|
|
886
|
-
const connectedChainId = _optionalChain([publicClient, 'access',
|
|
915
|
+
const connectedChainId = _optionalChain([publicClient, 'access', _16 => _16.chain, 'optionalAccess', _17 => _17.id]);
|
|
887
916
|
if (!connectedChainId) return [];
|
|
888
|
-
if (!
|
|
889
|
-
const id =
|
|
917
|
+
if (!isDepositChain(connectedChainId)) return [];
|
|
918
|
+
const id = _chunkNPSC5R22cjs.getAssetId.call(void 0, {
|
|
890
919
|
chainId: connectedChainId,
|
|
891
|
-
token:
|
|
920
|
+
token: _chunkTENL4H64cjs.NATIVE_TOKEN_ADDRESS
|
|
892
921
|
});
|
|
893
922
|
if (existingIds.has(id)) return [];
|
|
894
923
|
try {
|
|
895
924
|
const balance = await publicClient.getBalance({ address });
|
|
896
|
-
const nativeSymbol =
|
|
925
|
+
const nativeSymbol = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _18 => _18.nativeToken, 'access', _19 => _19.symbol]), () => ( _chunkTENL4H64cjs.getNativeSymbol.call(void 0, connectedChainId)));
|
|
926
|
+
const nativeDecimals = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _20 => _20.nativeToken, 'access', _21 => _21.decimals]), () => ( 18));
|
|
897
927
|
return [
|
|
898
928
|
{
|
|
899
929
|
id,
|
|
900
930
|
chainId: connectedChainId,
|
|
901
|
-
token:
|
|
931
|
+
token: _chunkTENL4H64cjs.NATIVE_TOKEN_ADDRESS,
|
|
902
932
|
symbol: nativeSymbol,
|
|
903
933
|
name: nativeSymbol,
|
|
904
|
-
decimals:
|
|
934
|
+
decimals: nativeDecimals,
|
|
905
935
|
balance: balance.toString()
|
|
906
936
|
}
|
|
907
937
|
];
|
|
@@ -1036,6 +1066,7 @@ function AmountStep({
|
|
|
1036
1066
|
publicClient,
|
|
1037
1067
|
address,
|
|
1038
1068
|
balanceAddress,
|
|
1069
|
+
declaredBalance,
|
|
1039
1070
|
asset,
|
|
1040
1071
|
defaultAmount,
|
|
1041
1072
|
switchChain,
|
|
@@ -1053,12 +1084,13 @@ function AmountStep({
|
|
|
1053
1084
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
1054
1085
|
const hasAttemptedSwitch = _react.useRef.call(void 0, false);
|
|
1055
1086
|
const hasAppliedDefaultRef = _react.useRef.call(void 0, false);
|
|
1056
|
-
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess',
|
|
1087
|
+
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess', _22 => _22.trim, 'call', _23 => _23(), 'access', _24 => _24.toLowerCase, 'call', _25 => _25()]) === "max";
|
|
1057
1088
|
const chainMismatch = Boolean(
|
|
1058
|
-
_optionalChain([walletClient, 'optionalAccess',
|
|
1089
|
+
_optionalChain([walletClient, 'optionalAccess', _26 => _26.chain, 'optionalAccess', _27 => _27.id]) && walletClient.chain.id !== asset.chainId
|
|
1059
1090
|
);
|
|
1060
|
-
const
|
|
1061
|
-
const
|
|
1091
|
+
const targetChainId = _chunkTENL4H64cjs.targetChainToChainId.call(void 0, targetChain);
|
|
1092
|
+
const targetSymbol = _chunkTENL4H64cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
1093
|
+
const isSourceStablecoin = _chunkTENL4H64cjs.isStablecoinSymbol.call(void 0, asset.symbol);
|
|
1062
1094
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
1063
1095
|
if (tokenPriceUsdOverride !== void 0 && tokenPriceUsdOverride > 0)
|
|
1064
1096
|
return tokenPriceUsdOverride;
|
|
@@ -1078,11 +1110,15 @@ function AmountStep({
|
|
|
1078
1110
|
const hasPricing = tokenPriceUsd !== null;
|
|
1079
1111
|
_react.useEffect.call(void 0, () => {
|
|
1080
1112
|
let active = true;
|
|
1113
|
+
if (declaredBalance !== void 0) {
|
|
1114
|
+
setBalance(declaredBalance);
|
|
1115
|
+
return;
|
|
1116
|
+
}
|
|
1081
1117
|
async function fetchBalance() {
|
|
1082
1118
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
1083
1119
|
if (!balanceTarget || !publicClient) return;
|
|
1084
1120
|
try {
|
|
1085
|
-
const bal =
|
|
1121
|
+
const bal = _chunkNPSC5R22cjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
1086
1122
|
address: asset.token,
|
|
1087
1123
|
abi: _viem.erc20Abi,
|
|
1088
1124
|
functionName: "balanceOf",
|
|
@@ -1097,13 +1133,13 @@ function AmountStep({
|
|
|
1097
1133
|
return () => {
|
|
1098
1134
|
active = false;
|
|
1099
1135
|
};
|
|
1100
|
-
}, [address, balanceAddress, publicClient, asset]);
|
|
1136
|
+
}, [address, balanceAddress, declaredBalance, publicClient, asset]);
|
|
1101
1137
|
_react.useEffect.call(void 0, () => {
|
|
1102
1138
|
if (chainMismatch && switchChain && !hasAttemptedSwitch.current) {
|
|
1103
1139
|
hasAttemptedSwitch.current = true;
|
|
1104
1140
|
switchChain(asset.chainId).catch((err) => {
|
|
1105
1141
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
1106
|
-
setError(
|
|
1142
|
+
setError(_chunkNPSC5R22cjs.formatUserError.call(void 0, raw));
|
|
1107
1143
|
});
|
|
1108
1144
|
}
|
|
1109
1145
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -1156,7 +1192,7 @@ function AmountStep({
|
|
|
1156
1192
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
1157
1193
|
const numeric = Number(raw);
|
|
1158
1194
|
if (!Number.isFinite(numeric)) return raw;
|
|
1159
|
-
return
|
|
1195
|
+
return _chunkNPSC5R22cjs.tokenFormatter.format(numeric);
|
|
1160
1196
|
} catch (e8) {
|
|
1161
1197
|
return "\u2026";
|
|
1162
1198
|
}
|
|
@@ -1175,8 +1211,8 @@ function AmountStep({
|
|
|
1175
1211
|
return null;
|
|
1176
1212
|
}
|
|
1177
1213
|
}, [numericAmount, isSourceStablecoin, hasPricing, tokenPriceUsd, asset.decimals]);
|
|
1178
|
-
const minDepositUsd =
|
|
1179
|
-
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
1214
|
+
const minDepositUsd = _chunkTENL4H64cjs.isHyperCoreDestination.call(void 0, targetChain) ? Math.max(_chunkTENL4H64cjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _28 => _28.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _29 => _29.minDepositUsd]), () => ( null));
|
|
1215
|
+
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _30 => _30.maxDepositUsd]), () => ( null));
|
|
1180
1216
|
const isBelowMin = minDepositUsd !== null && numericAmount > 0 && amountUsd < minDepositUsd;
|
|
1181
1217
|
const isAboveMax = maxDepositUsd !== null && amountUsd > maxDepositUsd;
|
|
1182
1218
|
const exceedsBalance = Boolean(
|
|
@@ -1185,7 +1221,7 @@ function AmountStep({
|
|
|
1185
1221
|
const balanceAfterUsd = appBalanceUsd !== void 0 ? appBalanceUsd + numericAmount : null;
|
|
1186
1222
|
const handlePresetClick = (percentage) => {
|
|
1187
1223
|
if (balance === null) return;
|
|
1188
|
-
_optionalChain([onCtaClick, 'optionalCall',
|
|
1224
|
+
_optionalChain([onCtaClick, 'optionalCall', _31 => _31(percentage === 100 ? "Max" : `${percentage}%`)]);
|
|
1189
1225
|
const next = formatAmountFromBalance(
|
|
1190
1226
|
balance,
|
|
1191
1227
|
asset.decimals,
|
|
@@ -1232,7 +1268,7 @@ function AmountStep({
|
|
|
1232
1268
|
return;
|
|
1233
1269
|
}
|
|
1234
1270
|
setError(null);
|
|
1235
|
-
_optionalChain([onCtaClick, 'optionalCall',
|
|
1271
|
+
_optionalChain([onCtaClick, 'optionalCall', _32 => _32("continue")]);
|
|
1236
1272
|
onContinue(
|
|
1237
1273
|
sourceAmount.toString(),
|
|
1238
1274
|
effectiveAmount.toString(),
|
|
@@ -1241,11 +1277,12 @@ function AmountStep({
|
|
|
1241
1277
|
};
|
|
1242
1278
|
const continueLabel = exceedsBalance ? "Insufficient balance" : isAboveMax ? "Continue with max allowed deposit" : isBelowMin ? "Continue with minimum deposit" : "Continue";
|
|
1243
1279
|
const continueDisabled = chainMismatch || exceedsBalance || numericAmount === 0 && !isBelowMin || balance === null;
|
|
1244
|
-
const
|
|
1245
|
-
const
|
|
1280
|
+
const chainName = _chunkNPSC5R22cjs.useChainName.call(void 0, );
|
|
1281
|
+
const sourceChainName = chainName(asset.chainId);
|
|
1282
|
+
const targetChainName = chainName(targetChainId);
|
|
1246
1283
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
1247
1284
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
1248
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1285
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.WalletIcon, {}), title: "Wallet deposit" }),
|
|
1249
1286
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
1250
1287
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
1251
1288
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1265,13 +1302,13 @@ function AmountStep({
|
|
|
1265
1302
|
" available",
|
|
1266
1303
|
balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1267
1304
|
" (~",
|
|
1268
|
-
|
|
1305
|
+
_chunkNPSC5R22cjs.currencyFormatter.format(balanceUsd),
|
|
1269
1306
|
")"
|
|
1270
1307
|
] })
|
|
1271
1308
|
] }),
|
|
1272
1309
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
1273
1310
|
"Min. deposit ",
|
|
1274
|
-
|
|
1311
|
+
_chunkNPSC5R22cjs.currencyFormatter.format(minDepositUsd)
|
|
1275
1312
|
] })
|
|
1276
1313
|
] })
|
|
1277
1314
|
] }),
|
|
@@ -1296,7 +1333,7 @@ function AmountStep({
|
|
|
1296
1333
|
" ",
|
|
1297
1334
|
asset.symbol
|
|
1298
1335
|
] }),
|
|
1299
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1336
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.TokenIcon, { symbol: asset.symbol }) })
|
|
1300
1337
|
] })
|
|
1301
1338
|
] }),
|
|
1302
1339
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
@@ -1307,18 +1344,17 @@ function AmountStep({
|
|
|
1307
1344
|
" ",
|
|
1308
1345
|
targetSymbol
|
|
1309
1346
|
] }),
|
|
1310
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1347
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.TokenIcon, { symbol: targetSymbol }) })
|
|
1311
1348
|
] })
|
|
1312
1349
|
] }),
|
|
1313
1350
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
1314
1351
|
/* @__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:
|
|
1352
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkNPSC5R22cjs.currencyFormatter.format(balanceAfterUsd) })
|
|
1316
1353
|
] })
|
|
1317
1354
|
] }),
|
|
1318
|
-
|
|
1319
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6U2H3R3Tcjs.Callout, { variant: "error", children: error }),
|
|
1355
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.Callout, { variant: "error", children: error }),
|
|
1320
1356
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1321
|
-
|
|
1357
|
+
_chunkNPSC5R22cjs.Button,
|
|
1322
1358
|
{
|
|
1323
1359
|
onClick: handleContinue,
|
|
1324
1360
|
fullWidth: true,
|
|
@@ -1327,7 +1363,7 @@ function AmountStep({
|
|
|
1327
1363
|
}
|
|
1328
1364
|
)
|
|
1329
1365
|
] }),
|
|
1330
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1366
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.PoweredBy, {})
|
|
1331
1367
|
] });
|
|
1332
1368
|
}
|
|
1333
1369
|
|
|
@@ -1374,7 +1410,7 @@ function ConfirmStep({
|
|
|
1374
1410
|
const [quoteResult, setQuoteResult] = _react.useState.call(void 0, null);
|
|
1375
1411
|
const hasAttemptedSwitch = _react.useRef.call(void 0, false);
|
|
1376
1412
|
const chainMismatch = Boolean(
|
|
1377
|
-
_optionalChain([walletClient, 'optionalAccess',
|
|
1413
|
+
_optionalChain([walletClient, 'optionalAccess', _33 => _33.chain, 'optionalAccess', _34 => _34.id]) && walletClient.chain.id !== asset.chainId
|
|
1378
1414
|
);
|
|
1379
1415
|
const sameRoute = targetChain === asset.chainId && targetToken.toLowerCase() === asset.token.toLowerCase();
|
|
1380
1416
|
const quoteSource = isDappImportAsset(asset) ? { chainId: asset.depositChainId, token: asset.depositToken } : { chainId: asset.chainId, token: asset.token };
|
|
@@ -1389,40 +1425,41 @@ function ConfirmStep({
|
|
|
1389
1425
|
targetToken,
|
|
1390
1426
|
recipient
|
|
1391
1427
|
]);
|
|
1392
|
-
const quote = setupReady && _optionalChain([quoteResult, 'optionalAccess',
|
|
1393
|
-
const
|
|
1394
|
-
const
|
|
1395
|
-
const
|
|
1396
|
-
const
|
|
1397
|
-
const
|
|
1398
|
-
const
|
|
1399
|
-
const
|
|
1428
|
+
const quote = setupReady && _optionalChain([quoteResult, 'optionalAccess', _35 => _35.requestKey]) === quoteRequestKey ? quoteResult.quote : null;
|
|
1429
|
+
const targetChainId = _chunkTENL4H64cjs.targetChainToChainId.call(void 0, targetChain);
|
|
1430
|
+
const targetSymbol = sameRoute ? asset.symbol : _chunkTENL4H64cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
1431
|
+
const sourceChainName = _chunkTENL4H64cjs.getChainName.call(void 0, asset.chainId);
|
|
1432
|
+
const targetChainName = _chunkTENL4H64cjs.getChainName.call(void 0, targetChainId);
|
|
1433
|
+
const sourceChainIcon = _chunkTENL4H64cjs.getChainIcon.call(void 0, asset.chainId);
|
|
1434
|
+
const targetChainIcon = _chunkTENL4H64cjs.getChainIcon.call(void 0, targetChainId);
|
|
1435
|
+
const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? _nullishCoalesce(_chunkNPSC5R22cjs.formatTokenAmount.call(void 0, Number(amount), asset.symbol), () => ( "0")) : "0";
|
|
1436
|
+
const mustHaveQuote = !appFeesResolved || _chunkNPSC5R22cjs.resolveAppFeeBps.call(void 0,
|
|
1400
1437
|
appFees,
|
|
1401
1438
|
`eip155:${quoteSource.chainId}`,
|
|
1402
1439
|
quoteSource.token
|
|
1403
1440
|
) > 0;
|
|
1404
|
-
const { display: feeDisplay, struck: feesFullySponsored } =
|
|
1405
|
-
_optionalChain([quote, 'optionalAccess',
|
|
1441
|
+
const { display: feeDisplay, struck: feesFullySponsored } = _chunkNPSC5R22cjs.quoteFeeRow.call(void 0,
|
|
1442
|
+
_optionalChain([quote, 'optionalAccess', _36 => _36.fees])
|
|
1406
1443
|
);
|
|
1407
1444
|
const directTransfer = sameRoute && !mustHaveQuote && !executeTransfer;
|
|
1408
1445
|
const receiveDisplay = (() => {
|
|
1409
1446
|
if (directTransfer) return `${formattedSendAmount} ${asset.symbol}`;
|
|
1410
1447
|
if (quote) {
|
|
1411
|
-
const quoted =
|
|
1448
|
+
const quoted = _chunkNPSC5R22cjs.formatQuotedReceive.call(void 0, quote.output, targetSymbol);
|
|
1412
1449
|
if (quoted !== void 0) return quoted;
|
|
1413
1450
|
}
|
|
1414
1451
|
const usdValue = Number(targetAmount);
|
|
1415
1452
|
const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
|
|
1416
|
-
const estimate =
|
|
1453
|
+
const estimate = _chunkNPSC5R22cjs.formatReceiveEstimate.call(void 0, {
|
|
1417
1454
|
sourceAmount: Number.isFinite(Number(amount)) ? Number(amount) : void 0,
|
|
1418
1455
|
sourceSymbol: asset.symbol,
|
|
1419
1456
|
targetSymbol,
|
|
1420
1457
|
sourceAmountUsd,
|
|
1421
|
-
sourceTrusted:
|
|
1458
|
+
sourceTrusted: _chunkNPSC5R22cjs.isRecognizedToken.call(void 0, asset.token, asset.chainId),
|
|
1422
1459
|
// The target is the curated deposit destination, so a stablecoin target
|
|
1423
1460
|
// estimates at $1 when unquoted (DepositFlow skips fetching stablecoin
|
|
1424
1461
|
// target prices). Not applied to the source — that can be a held token.
|
|
1425
|
-
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } :
|
|
1462
|
+
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : _chunkNPSC5R22cjs.isDisplayStablecoinSymbol.call(void 0, targetSymbol) ? { [targetSymbol.toUpperCase()]: 1 } : {}
|
|
1426
1463
|
});
|
|
1427
1464
|
if (estimate !== void 0) return estimate;
|
|
1428
1465
|
return targetSymbol;
|
|
@@ -1433,7 +1470,7 @@ function ConfirmStep({
|
|
|
1433
1470
|
hasAttemptedSwitch.current = true;
|
|
1434
1471
|
switchChain(asset.chainId).catch((err) => {
|
|
1435
1472
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
1436
|
-
setError(
|
|
1473
|
+
setError(_chunkNPSC5R22cjs.formatUserError.call(void 0, raw));
|
|
1437
1474
|
});
|
|
1438
1475
|
}
|
|
1439
1476
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -1522,7 +1559,7 @@ function ConfirmStep({
|
|
|
1522
1559
|
const result = await executeTransfer(amountUnits);
|
|
1523
1560
|
hash = result.txHash;
|
|
1524
1561
|
resolvedSourceToken = result.sourceToken;
|
|
1525
|
-
} else if (
|
|
1562
|
+
} else if (_chunkNPSC5R22cjs.isNativeAsset.call(void 0, asset)) {
|
|
1526
1563
|
hash = await walletClient.sendTransaction({
|
|
1527
1564
|
account,
|
|
1528
1565
|
chain,
|
|
@@ -1539,7 +1576,7 @@ function ConfirmStep({
|
|
|
1539
1576
|
args: [transferTo, amountUnits]
|
|
1540
1577
|
});
|
|
1541
1578
|
}
|
|
1542
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
1579
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _37 => _37(hash, asset.chainId, amountUnits.toString())]);
|
|
1543
1580
|
onConfirm(
|
|
1544
1581
|
hash,
|
|
1545
1582
|
asset.chainId,
|
|
@@ -1553,29 +1590,29 @@ function ConfirmStep({
|
|
|
1553
1590
|
);
|
|
1554
1591
|
} catch (err) {
|
|
1555
1592
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
1556
|
-
const message =
|
|
1593
|
+
const message = _chunkNPSC5R22cjs.formatUserError.call(void 0, raw);
|
|
1557
1594
|
setError(message);
|
|
1558
|
-
_optionalChain([onError, 'optionalCall',
|
|
1595
|
+
_optionalChain([onError, 'optionalCall', _38 => _38(message, "TRANSFER_ERROR")]);
|
|
1559
1596
|
} finally {
|
|
1560
1597
|
setIsSubmitting(false);
|
|
1561
1598
|
}
|
|
1562
1599
|
};
|
|
1563
1600
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
1564
1601
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
1565
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1602
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.WalletIcon, {}), title: "Review deposit" }),
|
|
1566
1603
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
|
|
1567
1604
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1568
1605
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
1569
1606
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1570
1607
|
/* @__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,
|
|
1608
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CdnIcon, { src: sourceChainIcon }) })
|
|
1572
1609
|
] })
|
|
1573
1610
|
] }),
|
|
1574
1611
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1575
1612
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
|
|
1576
1613
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1577
1614
|
/* @__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,
|
|
1615
|
+
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CdnIcon, { src: targetChainIcon }) })
|
|
1579
1616
|
] })
|
|
1580
1617
|
] }),
|
|
1581
1618
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -1590,14 +1627,14 @@ function ConfirmStep({
|
|
|
1590
1627
|
" ",
|
|
1591
1628
|
asset.symbol
|
|
1592
1629
|
] }),
|
|
1593
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1630
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.TokenIcon, { symbol: asset.symbol }) })
|
|
1594
1631
|
] })
|
|
1595
1632
|
] }),
|
|
1596
1633
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1597
1634
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Receive" }),
|
|
1598
1635
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1599
1636
|
/* @__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,
|
|
1637
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.TokenIcon, { symbol: targetSymbol }) })
|
|
1601
1638
|
] })
|
|
1602
1639
|
] }),
|
|
1603
1640
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -1617,10 +1654,9 @@ function ConfirmStep({
|
|
|
1617
1654
|
) })
|
|
1618
1655
|
] })
|
|
1619
1656
|
] }),
|
|
1620
|
-
|
|
1621
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6U2H3R3Tcjs.Callout, { variant: "error", children: error }),
|
|
1657
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.Callout, { variant: "error", children: error }),
|
|
1622
1658
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1623
|
-
|
|
1659
|
+
_chunkNPSC5R22cjs.Button,
|
|
1624
1660
|
{
|
|
1625
1661
|
onClick: handleConfirm,
|
|
1626
1662
|
loading: isSubmitting,
|
|
@@ -1634,7 +1670,7 @@ function ConfirmStep({
|
|
|
1634
1670
|
}
|
|
1635
1671
|
)
|
|
1636
1672
|
] }),
|
|
1637
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1673
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.PoweredBy, {})
|
|
1638
1674
|
] });
|
|
1639
1675
|
}
|
|
1640
1676
|
|
|
@@ -1657,9 +1693,9 @@ var INITIAL_POLL_INTERVAL = 3e3;
|
|
|
1657
1693
|
var MAX_POLL_INTERVAL = 3e4;
|
|
1658
1694
|
var BACKOFF_MULTIPLIER = 1.5;
|
|
1659
1695
|
function isEventForTx(event, txHash) {
|
|
1660
|
-
const eventTxHash =
|
|
1696
|
+
const eventTxHash = _chunkHCQWFL3Acjs.getEventTxHash.call(void 0, event);
|
|
1661
1697
|
if (!eventTxHash) return false;
|
|
1662
|
-
return
|
|
1698
|
+
return _chunkHCQWFL3Acjs.txRefsMatch.call(void 0, eventTxHash, txHash);
|
|
1663
1699
|
}
|
|
1664
1700
|
function truncateHash(hash) {
|
|
1665
1701
|
return `${hash.slice(0, 4)}\u2026${hash.slice(-4)}`;
|
|
@@ -1689,7 +1725,7 @@ function formatTimestamp(ms) {
|
|
|
1689
1725
|
return `${month} ${day}${suffix} \xB7 ${hours}:${minutes}:${seconds}`;
|
|
1690
1726
|
}
|
|
1691
1727
|
function formatBridgeFailedMessage(event) {
|
|
1692
|
-
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess',
|
|
1728
|
+
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _39 => _39.data]), () => ( {}));
|
|
1693
1729
|
const backendMessage = typeof eventData.message === "string" ? eventData.message.trim() : "";
|
|
1694
1730
|
if (backendMessage.length > 0) {
|
|
1695
1731
|
const lower = backendMessage.toLowerCase();
|
|
@@ -1709,7 +1745,7 @@ function formatBridgeFailedMessage(event) {
|
|
|
1709
1745
|
}
|
|
1710
1746
|
return "Bridge failed";
|
|
1711
1747
|
}
|
|
1712
|
-
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1748
|
+
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.ExternalLinkIcon, { className: "rs-deposit-notification-link-icon" });
|
|
1713
1749
|
function DepositNotification({
|
|
1714
1750
|
deposit,
|
|
1715
1751
|
smartAccount,
|
|
@@ -1743,7 +1779,7 @@ function DepositNotification({
|
|
|
1743
1779
|
const pollIntervalRef = _react.useRef.call(void 0, INITIAL_POLL_INTERVAL);
|
|
1744
1780
|
const pollTimeoutRef = _react.useRef.call(void 0, null);
|
|
1745
1781
|
const completedRef = _react.useRef.call(void 0, _nullishCoalesce(directTransfer, () => ( false)));
|
|
1746
|
-
const depositContextRef =
|
|
1782
|
+
const depositContextRef = _chunkNPSC5R22cjs.useLatestRef.call(void 0, {
|
|
1747
1783
|
amount,
|
|
1748
1784
|
sourceChain,
|
|
1749
1785
|
sourceToken: token,
|
|
@@ -1751,8 +1787,8 @@ function DepositNotification({
|
|
|
1751
1787
|
targetChain,
|
|
1752
1788
|
targetToken
|
|
1753
1789
|
});
|
|
1754
|
-
const onCompleteRef =
|
|
1755
|
-
const onFailedRef =
|
|
1790
|
+
const onCompleteRef = _chunkNPSC5R22cjs.useLatestRef.call(void 0, onComplete);
|
|
1791
|
+
const onFailedRef = _chunkNPSC5R22cjs.useLatestRef.call(void 0, onFailed);
|
|
1756
1792
|
const handleComplete = _react.useCallback.call(void 0,
|
|
1757
1793
|
(destTxHash) => {
|
|
1758
1794
|
if (completedRef.current) return;
|
|
@@ -1761,7 +1797,7 @@ function DepositNotification({
|
|
|
1761
1797
|
setCompletedAt(Date.now());
|
|
1762
1798
|
setStatus("complete");
|
|
1763
1799
|
const context = depositContextRef.current;
|
|
1764
|
-
_optionalChain([onCompleteRef, 'access',
|
|
1800
|
+
_optionalChain([onCompleteRef, 'access', _40 => _40.current, 'optionalCall', _41 => _41(txHash, destTxHash, {
|
|
1765
1801
|
amount: context.amount,
|
|
1766
1802
|
sourceChain: context.sourceChain,
|
|
1767
1803
|
sourceToken: context.sourceToken,
|
|
@@ -1777,7 +1813,7 @@ function DepositNotification({
|
|
|
1777
1813
|
if (completedRef.current) return;
|
|
1778
1814
|
completedRef.current = true;
|
|
1779
1815
|
setStatus("failed");
|
|
1780
|
-
_optionalChain([onFailedRef, 'access',
|
|
1816
|
+
_optionalChain([onFailedRef, 'access', _42 => _42.current, 'optionalCall', _43 => _43(txHash, error)]);
|
|
1781
1817
|
},
|
|
1782
1818
|
[onFailedRef, txHash]
|
|
1783
1819
|
);
|
|
@@ -1795,17 +1831,17 @@ function DepositNotification({
|
|
|
1795
1831
|
if (!isMounted) return;
|
|
1796
1832
|
const lastEvent = data.lastEvent;
|
|
1797
1833
|
const eventForTx = isEventForTx(lastEvent, txHash) ? lastEvent : void 0;
|
|
1798
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
1799
|
-
const destTx = _optionalChain([eventForTx, 'access',
|
|
1834
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _44 => _44.type]) === "bridge-complete") {
|
|
1835
|
+
const destTx = _optionalChain([eventForTx, 'access', _45 => _45.data, 'optionalAccess', _46 => _46.destination, 'optionalAccess', _47 => _47.transactionHash]);
|
|
1800
1836
|
handleComplete(destTx);
|
|
1801
1837
|
return;
|
|
1802
1838
|
}
|
|
1803
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
1839
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _48 => _48.type]) === "bridge-failed") {
|
|
1804
1840
|
handleFailed(formatBridgeFailedMessage(eventForTx));
|
|
1805
1841
|
return;
|
|
1806
1842
|
}
|
|
1807
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
1808
|
-
const errorMessage = _nullishCoalesce(_optionalChain([eventForTx, 'access',
|
|
1843
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _49 => _49.type]) === "error") {
|
|
1844
|
+
const errorMessage = _nullishCoalesce(_optionalChain([eventForTx, 'access', _50 => _50.data, 'optionalAccess', _51 => _51.message]), () => ( "Unknown error"));
|
|
1809
1845
|
handleFailed(errorMessage);
|
|
1810
1846
|
return;
|
|
1811
1847
|
}
|
|
@@ -1843,11 +1879,12 @@ function DepositNotification({
|
|
|
1843
1879
|
status,
|
|
1844
1880
|
txHash
|
|
1845
1881
|
]);
|
|
1846
|
-
const
|
|
1847
|
-
const
|
|
1882
|
+
const explorerTxUrl = _chunkNPSC5R22cjs.useExplorerTxUrl.call(void 0, );
|
|
1883
|
+
const sourceExplorerUrl = sourceChain === "unknown" ? void 0 : explorerTxUrl(sourceChain, txHash);
|
|
1884
|
+
const destExplorerUrl = destinationTxHash ? explorerTxUrl(_chunkTENL4H64cjs.targetChainToChainId.call(void 0, targetChain), destinationTxHash) : null;
|
|
1848
1885
|
const title = status === "complete" ? "Deposit completed" : status === "failed" ? "Deposit failed" : "Deposit received and processing\u2026";
|
|
1849
1886
|
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,
|
|
1887
|
+
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, _chunkNPSC5R22cjs.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, _chunkNPSC5R22cjs.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
1888
|
"svg",
|
|
1852
1889
|
{
|
|
1853
1890
|
className: "rs-deposit-notification-spinner",
|
|
@@ -1897,7 +1934,7 @@ function DepositNotification({
|
|
|
1897
1934
|
className: "rs-deposit-notification-close",
|
|
1898
1935
|
onClick: () => onDismiss(deposit.id),
|
|
1899
1936
|
"aria-label": "Dismiss",
|
|
1900
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1937
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CloseIcon, {})
|
|
1901
1938
|
}
|
|
1902
1939
|
)
|
|
1903
1940
|
] }),
|
|
@@ -1913,7 +1950,7 @@ function DepositNotification({
|
|
|
1913
1950
|
"aria-expanded": expanded,
|
|
1914
1951
|
children: [
|
|
1915
1952
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: expanded ? "See less details" : "See more details" }),
|
|
1916
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1953
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.ChevronDownIcon, { className: "rs-deposit-notification-toggle-chevron" })
|
|
1917
1954
|
]
|
|
1918
1955
|
}
|
|
1919
1956
|
),
|
|
@@ -2003,7 +2040,7 @@ function asString(value) {
|
|
|
2003
2040
|
function resolveSolanaTokenMeta(token) {
|
|
2004
2041
|
if (!token) return {};
|
|
2005
2042
|
const normalized = token.toLowerCase();
|
|
2006
|
-
const matched =
|
|
2043
|
+
const matched = _chunkTENL4H64cjs.SOLANA_TOKENS.find(
|
|
2007
2044
|
(entry) => entry.mint.toLowerCase() === normalized
|
|
2008
2045
|
);
|
|
2009
2046
|
if (matched) {
|
|
@@ -2015,7 +2052,7 @@ function resolveSolanaTokenMeta(token) {
|
|
|
2015
2052
|
return {};
|
|
2016
2053
|
}
|
|
2017
2054
|
function getDepositEventDetails(event) {
|
|
2018
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
2055
|
+
if (!_optionalChain([event, 'optionalAccess', _52 => _52.type]) || !isRecord(event.data)) return {};
|
|
2019
2056
|
if (event.type === "deposit-received") {
|
|
2020
2057
|
const chainId = asChainId(event.data.chain);
|
|
2021
2058
|
const token = asString(event.data.token);
|
|
@@ -2030,12 +2067,12 @@ function getDepositEventDetails(event) {
|
|
|
2030
2067
|
const source = isRecord(event.data.source) ? event.data.source : void 0;
|
|
2031
2068
|
const deposit = isRecord(event.data.deposit) ? event.data.deposit : void 0;
|
|
2032
2069
|
if (source || deposit) {
|
|
2033
|
-
const chainId = _nullishCoalesce(asChainId(_optionalChain([source, 'optionalAccess',
|
|
2034
|
-
const token = _nullishCoalesce(_nullishCoalesce(asString(_optionalChain([source, 'optionalAccess',
|
|
2070
|
+
const chainId = _nullishCoalesce(asChainId(_optionalChain([source, 'optionalAccess', _53 => _53.chain])), () => ( asChainId(_optionalChain([deposit, 'optionalAccess', _54 => _54.chain]))));
|
|
2071
|
+
const token = _nullishCoalesce(_nullishCoalesce(asString(_optionalChain([source, 'optionalAccess', _55 => _55.asset])), () => ( asString(_optionalChain([deposit, 'optionalAccess', _56 => _56.asset])))), () => ( asString(_optionalChain([deposit, 'optionalAccess', _57 => _57.token]))));
|
|
2035
2072
|
const solanaMeta = chainId === "solana" ? resolveSolanaTokenMeta(token) : {};
|
|
2036
2073
|
return {
|
|
2037
2074
|
chainId,
|
|
2038
|
-
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess',
|
|
2075
|
+
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess', _58 => _58.amount])), () => ( asAmount(_optionalChain([deposit, 'optionalAccess', _59 => _59.amount])))),
|
|
2039
2076
|
token,
|
|
2040
2077
|
...solanaMeta
|
|
2041
2078
|
};
|
|
@@ -2045,25 +2082,29 @@ function getDepositEventDetails(event) {
|
|
|
2045
2082
|
function isSameRoute(sourceChain, sourceToken, targetChain, targetToken) {
|
|
2046
2083
|
return sourceChain === targetChain && sourceToken.toLowerCase() === targetToken.toLowerCase();
|
|
2047
2084
|
}
|
|
2048
|
-
function chainLabel(chainId) {
|
|
2049
|
-
|
|
2085
|
+
function chainLabel(chainId, catalogChain) {
|
|
2086
|
+
const name = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _60 => _60.name]), () => ( _chunkTENL4H64cjs.getChainName.call(void 0, chainId)));
|
|
2087
|
+
return name.replace(/\s+(One|Mainnet|Smart Chain|Chain)$/i, "");
|
|
2050
2088
|
}
|
|
2051
|
-
function computeTokensForChain(chainId, topTokens) {
|
|
2052
|
-
const fromBackend = _optionalChain([topTokens, 'optionalAccess',
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
)
|
|
2058
|
-
return
|
|
2089
|
+
function computeTokensForChain(chainId, topTokens, catalogChain) {
|
|
2090
|
+
const fromBackend = _optionalChain([topTokens, 'optionalAccess', _61 => _61[String(chainId)], 'optionalAccess', _62 => _62.map, 'call', _63 => _63((t) => t.symbol)]);
|
|
2091
|
+
if (fromBackend) return fromBackend;
|
|
2092
|
+
if (chainId === "solana") return _chunkTENL4H64cjs.SOLANA_TOKENS.map((t) => t.symbol);
|
|
2093
|
+
if (chainId === "hypercore") return ["USDC", "USDT0"];
|
|
2094
|
+
const bundled = _chunkTENL4H64cjs.getBundledTargetTokens.call(void 0, chainId).map((t) => t.symbol);
|
|
2095
|
+
if (bundled.length > 0) return bundled;
|
|
2096
|
+
return Array.isArray(_optionalChain([catalogChain, 'optionalAccess', _64 => _64.supportedTokens])) ? catalogChain.supportedTokens.map((t) => t.symbol) : [];
|
|
2059
2097
|
}
|
|
2060
|
-
function resolveSourceTokenAddress(symbol, chainId, topTokens) {
|
|
2061
|
-
const top = _optionalChain([topTokens, 'optionalAccess',
|
|
2062
|
-
|
|
2098
|
+
function resolveSourceTokenAddress(symbol, chainId, topTokens, catalogChain) {
|
|
2099
|
+
const top = _optionalChain([topTokens, 'optionalAccess', _65 => _65[String(chainId)], 'optionalAccess', _66 => _66.find, 'call', _67 => _67((t) => t.symbol === symbol)]);
|
|
2100
|
+
if (_optionalChain([top, 'optionalAccess', _68 => _68.address])) return top.address;
|
|
2101
|
+
const fromRegistry = _chunkTENL4H64cjs.getTokenAddress.call(void 0, symbol, chainId);
|
|
2102
|
+
if (fromRegistry) return fromRegistry;
|
|
2103
|
+
return Array.isArray(_optionalChain([catalogChain, 'optionalAccess', _69 => _69.supportedTokens])) ? _optionalChain([catalogChain, 'access', _70 => _70.supportedTokens, 'access', _71 => _71.find, 'call', _72 => _72((t) => t.symbol === symbol), 'optionalAccess', _73 => _73.address]) : void 0;
|
|
2063
2104
|
}
|
|
2064
2105
|
function TokenGlyph({ symbol }) {
|
|
2065
2106
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2066
|
-
|
|
2107
|
+
_chunkNPSC5R22cjs.TokenIcon,
|
|
2067
2108
|
{
|
|
2068
2109
|
symbol,
|
|
2069
2110
|
className: "rs-deposit-address-dropdown-icon",
|
|
@@ -2093,25 +2134,38 @@ function DepositAddressStep({
|
|
|
2093
2134
|
const [topTokens, setTopTokens] = _react.useState.call(void 0, null);
|
|
2094
2135
|
_react.useEffect.call(void 0, () => {
|
|
2095
2136
|
let active = true;
|
|
2137
|
+
setTopTokens(null);
|
|
2096
2138
|
service.getTopTokens().then((t) => {
|
|
2097
|
-
if (active)
|
|
2139
|
+
if (!active) return;
|
|
2140
|
+
setTopTokens(t);
|
|
2141
|
+
if (t) _chunkTENL4H64cjs.publishShortlistTokens.call(void 0, t);
|
|
2098
2142
|
});
|
|
2099
2143
|
return () => {
|
|
2100
2144
|
active = false;
|
|
2101
2145
|
};
|
|
2102
2146
|
}, [service]);
|
|
2103
2147
|
const BASE_CHAIN_ID2 = 8453;
|
|
2104
|
-
const evmChainIds =
|
|
2148
|
+
const evmChainIds = _chunkNPSC5R22cjs.useDepositChainIds.call(void 0, );
|
|
2149
|
+
const { catalog } = _chunkNPSC5R22cjs.useChainCatalog.call(void 0, );
|
|
2150
|
+
const catalogFor = _react.useCallback.call(void 0,
|
|
2151
|
+
(chain) => {
|
|
2152
|
+
if (!catalog) return void 0;
|
|
2153
|
+
const key = _chunkNPSC5R22cjs.catalogKeyForChain.call(void 0, chain);
|
|
2154
|
+
return typeof key === "number" ? catalog.byChainId.get(key) : catalog.byCaip2.get(key);
|
|
2155
|
+
},
|
|
2156
|
+
[catalog]
|
|
2157
|
+
);
|
|
2105
2158
|
const chainOptions = _react.useMemo.call(void 0, () => {
|
|
2159
|
+
const acceptsDeposits = (chain) => _optionalChain([catalogFor, 'call', _74 => _74(chain), 'optionalAccess', _75 => _75.deposit]) !== false;
|
|
2106
2160
|
const options = [...evmChainIds];
|
|
2107
2161
|
const extras = [];
|
|
2108
|
-
if (hasSolana) extras.push("solana");
|
|
2109
|
-
extras.push("hypercore");
|
|
2162
|
+
if (hasSolana && acceptsDeposits("solana")) extras.push("solana");
|
|
2163
|
+
if (acceptsDeposits("hypercore")) extras.push("hypercore");
|
|
2110
2164
|
options.splice(1, 0, ...extras);
|
|
2111
2165
|
return options.filter(
|
|
2112
|
-
(chain) => _optionalChain([topTokens, 'optionalAccess',
|
|
2166
|
+
(chain) => _optionalChain([topTokens, 'optionalAccess', _76 => _76[String(chain)], 'optionalAccess', _77 => _77.length]) !== 0 && computeTokensForChain(chain, topTokens, catalogFor(chain)).length > 0
|
|
2113
2167
|
);
|
|
2114
|
-
}, [evmChainIds, hasSolana, topTokens]);
|
|
2168
|
+
}, [evmChainIds, hasSolana, topTokens, catalogFor]);
|
|
2115
2169
|
const preferredChainId = (options) => options.includes(BASE_CHAIN_ID2) ? BASE_CHAIN_ID2 : _nullishCoalesce(options[0], () => ( BASE_CHAIN_ID2));
|
|
2116
2170
|
const [sourceChainId, setSourceChainId] = _react.useState.call(void 0, () => preferredChainId(chainOptions));
|
|
2117
2171
|
_react.useEffect.call(void 0, () => {
|
|
@@ -2122,8 +2176,8 @@ function DepositAddressStep({
|
|
|
2122
2176
|
const isSolana = sourceChainId === "solana";
|
|
2123
2177
|
const isHyperCore = sourceChainId === "hypercore";
|
|
2124
2178
|
const tokensForChain = _react.useMemo.call(void 0,
|
|
2125
|
-
() => computeTokensForChain(sourceChainId, topTokens),
|
|
2126
|
-
[sourceChainId, topTokens]
|
|
2179
|
+
() => computeTokensForChain(sourceChainId, topTokens, catalogFor(sourceChainId)),
|
|
2180
|
+
[sourceChainId, topTokens, catalogFor]
|
|
2127
2181
|
);
|
|
2128
2182
|
const defaultToken = pickFallbackToken(tokensForChain, "USDC");
|
|
2129
2183
|
const [sourceTokenSymbol, setSourceTokenSymbol] = _react.useState.call(void 0, defaultToken);
|
|
@@ -2154,7 +2208,8 @@ function DepositAddressStep({
|
|
|
2154
2208
|
const sourceTokenAddress = resolveSourceTokenAddress(
|
|
2155
2209
|
sourceTokenSymbol,
|
|
2156
2210
|
sourceChainId,
|
|
2157
|
-
topTokens
|
|
2211
|
+
topTokens,
|
|
2212
|
+
catalogFor(sourceChainId)
|
|
2158
2213
|
);
|
|
2159
2214
|
if (!sourceTokenAddress) {
|
|
2160
2215
|
setLiquidityHelper({ kind: "idle" });
|
|
@@ -2165,7 +2220,7 @@ function DepositAddressStep({
|
|
|
2165
2220
|
service.checkLiquidity({
|
|
2166
2221
|
sourceChainId,
|
|
2167
2222
|
sourceToken: sourceTokenAddress,
|
|
2168
|
-
destinationChainId: targetChain,
|
|
2223
|
+
destinationChainId: _chunkTENL4H64cjs.targetChainToCaip2.call(void 0, targetChain),
|
|
2169
2224
|
destinationToken: targetToken,
|
|
2170
2225
|
amount: "1"
|
|
2171
2226
|
}).then((result) => {
|
|
@@ -2205,8 +2260,8 @@ function DepositAddressStep({
|
|
|
2205
2260
|
function handlePointerDown(event) {
|
|
2206
2261
|
const target = event.target;
|
|
2207
2262
|
if (!target) return;
|
|
2208
|
-
const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access',
|
|
2209
|
-
const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access',
|
|
2263
|
+
const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access', _78 => _78.current, 'optionalAccess', _79 => _79.contains, 'call', _80 => _80(target)]);
|
|
2264
|
+
const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access', _81 => _81.current, 'optionalAccess', _82 => _82.contains, 'call', _83 => _83(target)]);
|
|
2210
2265
|
if (clickedChainDropdown || clickedTokenDropdown) return;
|
|
2211
2266
|
setChainDropdownOpen(false);
|
|
2212
2267
|
setTokenDropdownOpen(false);
|
|
@@ -2219,7 +2274,7 @@ function DepositAddressStep({
|
|
|
2219
2274
|
};
|
|
2220
2275
|
}, [chainDropdownOpen, tokenDropdownOpen]);
|
|
2221
2276
|
const handleCopy = _react.useCallback.call(void 0, async () => {
|
|
2222
|
-
_optionalChain([onCopyAddress, 'optionalCall',
|
|
2277
|
+
_optionalChain([onCopyAddress, 'optionalCall', _84 => _84()]);
|
|
2223
2278
|
try {
|
|
2224
2279
|
await navigator.clipboard.writeText(displayAddress);
|
|
2225
2280
|
setCopied(true);
|
|
@@ -2239,14 +2294,18 @@ function DepositAddressStep({
|
|
|
2239
2294
|
}, [displayAddress, onCopyAddress]);
|
|
2240
2295
|
const handleSelectChain = _react.useCallback.call(void 0,
|
|
2241
2296
|
(nextChain) => {
|
|
2242
|
-
const nextTokens = computeTokensForChain(
|
|
2297
|
+
const nextTokens = computeTokensForChain(
|
|
2298
|
+
nextChain,
|
|
2299
|
+
topTokens,
|
|
2300
|
+
catalogFor(nextChain)
|
|
2301
|
+
);
|
|
2243
2302
|
setSourceChainId(nextChain);
|
|
2244
2303
|
setSourceTokenSymbol(pickFallbackToken(nextTokens, sourceTokenSymbol));
|
|
2245
2304
|
setChainDropdownOpen(false);
|
|
2246
2305
|
setTokenDropdownOpen(false);
|
|
2247
2306
|
setCopied(false);
|
|
2248
2307
|
},
|
|
2249
|
-
[sourceTokenSymbol, topTokens]
|
|
2308
|
+
[sourceTokenSymbol, topTokens, catalogFor]
|
|
2250
2309
|
);
|
|
2251
2310
|
const onDepositSubmittedRef = _react.useRef.call(void 0, onDepositSubmitted);
|
|
2252
2311
|
onDepositSubmittedRef.current = onDepositSubmitted;
|
|
@@ -2298,10 +2357,10 @@ function DepositAddressStep({
|
|
|
2298
2357
|
return;
|
|
2299
2358
|
}
|
|
2300
2359
|
const event = status.lastEvent;
|
|
2301
|
-
const eventTxHash =
|
|
2360
|
+
const eventTxHash = _chunkHCQWFL3Acjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkHCQWFL3Acjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
2302
2361
|
if (baselineTxHashRef.current === void 0) {
|
|
2303
2362
|
baselineTxHashRef.current = eventTxHash;
|
|
2304
|
-
} else if (eventTxHash && (!baselineTxHashRef.current || !
|
|
2363
|
+
} else if (eventTxHash && (!baselineTxHashRef.current || !_chunkHCQWFL3Acjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
|
|
2305
2364
|
const details = getDepositEventDetails(event);
|
|
2306
2365
|
const chainId = _nullishCoalesce(details.chainId, () => ( "unknown"));
|
|
2307
2366
|
const amount = _nullishCoalesce(details.amount, () => ( "0"));
|
|
@@ -2310,7 +2369,7 @@ function DepositAddressStep({
|
|
|
2310
2369
|
baselineTxHashRef.current = eventTxHash;
|
|
2311
2370
|
isTrackingRef.current = true;
|
|
2312
2371
|
const isEvmToken = token ? /^0x[a-fA-F0-9]{40}$/.test(token) : false;
|
|
2313
|
-
const sourceDecimals = _nullishCoalesce(details.sourceDecimals, () => ( (isEvmToken ?
|
|
2372
|
+
const sourceDecimals = _nullishCoalesce(details.sourceDecimals, () => ( (isEvmToken ? _chunkTENL4H64cjs.findTokenDecimals.call(void 0,
|
|
2314
2373
|
token,
|
|
2315
2374
|
typeof chainId === "number" ? chainId : void 0
|
|
2316
2375
|
) : void 0)));
|
|
@@ -2333,7 +2392,7 @@ function DepositAddressStep({
|
|
|
2333
2392
|
directTransfer
|
|
2334
2393
|
};
|
|
2335
2394
|
setNotifications((prev) => [notification, ...prev]);
|
|
2336
|
-
_optionalChain([onDepositSubmittedRef, 'access',
|
|
2395
|
+
_optionalChain([onDepositSubmittedRef, 'access', _85 => _85.current, 'optionalCall', _86 => _86({
|
|
2337
2396
|
txHash: eventTxHash,
|
|
2338
2397
|
sourceChain: chainId,
|
|
2339
2398
|
amount,
|
|
@@ -2345,7 +2404,7 @@ function DepositAddressStep({
|
|
|
2345
2404
|
if (!cancelled) {
|
|
2346
2405
|
const msg = err instanceof Error ? err.message : "Failed to check status";
|
|
2347
2406
|
setPollingError(msg);
|
|
2348
|
-
_optionalChain([onErrorRef, 'access',
|
|
2407
|
+
_optionalChain([onErrorRef, 'access', _87 => _87.current, 'optionalCall', _88 => _88(msg, "STATUS_POLL_ERROR")]);
|
|
2349
2408
|
}
|
|
2350
2409
|
}
|
|
2351
2410
|
if (!cancelled) {
|
|
@@ -2361,24 +2420,24 @@ function DepositAddressStep({
|
|
|
2361
2420
|
const handleNotificationComplete = _react.useCallback.call(void 0,
|
|
2362
2421
|
(txHash, destinationTxHash, context) => {
|
|
2363
2422
|
isTrackingRef.current = false;
|
|
2364
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
2423
|
+
_optionalChain([onDepositCompleteRef, 'access', _89 => _89.current, 'optionalCall', _90 => _90(txHash, destinationTxHash, context)]);
|
|
2365
2424
|
},
|
|
2366
2425
|
[]
|
|
2367
2426
|
);
|
|
2368
2427
|
const handleNotificationFailed = _react.useCallback.call(void 0,
|
|
2369
2428
|
(txHash, error) => {
|
|
2370
2429
|
isTrackingRef.current = false;
|
|
2371
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
2430
|
+
_optionalChain([onDepositFailedRef, 'access', _91 => _91.current, 'optionalCall', _92 => _92(txHash, error)]);
|
|
2372
2431
|
},
|
|
2373
2432
|
[]
|
|
2374
2433
|
);
|
|
2375
2434
|
const handleNotificationDismiss = _react.useCallback.call(void 0, (id) => {
|
|
2376
2435
|
setNotifications((prev) => prev.filter((n) => n.id !== id));
|
|
2377
2436
|
}, []);
|
|
2378
|
-
const qrIconSrc =
|
|
2437
|
+
const qrIconSrc = _nullishCoalesce(_optionalChain([catalogFor, 'call', _93 => _93(sourceChainId), 'optionalAccess', _94 => _94.iconUrl]), () => ( _chunkTENL4H64cjs.getChainIcon.call(void 0, sourceChainId)));
|
|
2379
2438
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-step--with-notifications", children: [
|
|
2380
2439
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
2381
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2440
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
2382
2441
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", children: [
|
|
2383
2442
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", ref: chainDropdownRef, children: [
|
|
2384
2443
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
@@ -2394,14 +2453,14 @@ function DepositAddressStep({
|
|
|
2394
2453
|
},
|
|
2395
2454
|
children: [
|
|
2396
2455
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2397
|
-
|
|
2456
|
+
_chunkNPSC5R22cjs.CdnIcon,
|
|
2398
2457
|
{
|
|
2399
|
-
src:
|
|
2458
|
+
src: _nullishCoalesce(_optionalChain([catalogFor, 'call', _95 => _95(sourceChainId), 'optionalAccess', _96 => _96.iconUrl]), () => ( _chunkTENL4H64cjs.getChainIcon.call(void 0, sourceChainId))),
|
|
2400
2459
|
className: "rs-deposit-address-dropdown-icon"
|
|
2401
2460
|
}
|
|
2402
2461
|
),
|
|
2403
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainLabel(sourceChainId) }),
|
|
2404
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2462
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainLabel(sourceChainId, catalogFor(sourceChainId)) }),
|
|
2463
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2405
2464
|
]
|
|
2406
2465
|
}
|
|
2407
2466
|
),
|
|
@@ -2413,13 +2472,13 @@ function DepositAddressStep({
|
|
|
2413
2472
|
onClick: () => handleSelectChain(chainId),
|
|
2414
2473
|
children: [
|
|
2415
2474
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2416
|
-
|
|
2475
|
+
_chunkNPSC5R22cjs.CdnIcon,
|
|
2417
2476
|
{
|
|
2418
|
-
src:
|
|
2477
|
+
src: _nullishCoalesce(_optionalChain([catalogFor, 'call', _97 => _97(chainId), 'optionalAccess', _98 => _98.iconUrl]), () => ( _chunkTENL4H64cjs.getChainIcon.call(void 0, chainId))),
|
|
2419
2478
|
className: "rs-deposit-address-dropdown-icon"
|
|
2420
2479
|
}
|
|
2421
2480
|
),
|
|
2422
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainLabel(chainId) })
|
|
2481
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainLabel(chainId, catalogFor(chainId)) })
|
|
2423
2482
|
]
|
|
2424
2483
|
},
|
|
2425
2484
|
String(chainId)
|
|
@@ -2430,9 +2489,9 @@ function DepositAddressStep({
|
|
|
2430
2489
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Supported token" }),
|
|
2431
2490
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
2432
2491
|
"Min.$",
|
|
2433
|
-
(
|
|
2434
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2435
|
-
|
|
2492
|
+
(_chunkTENL4H64cjs.isHyperCoreDestination.call(void 0, targetChain) || isHyperCore ? Math.max(_chunkTENL4H64cjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _99 => _99.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _100 => _100.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
2493
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHCQWFL3Acjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2494
|
+
_chunkNPSC5R22cjs.InfoIcon,
|
|
2436
2495
|
{
|
|
2437
2496
|
className: "rs-deposit-address-min-icon",
|
|
2438
2497
|
"aria-hidden": "true"
|
|
@@ -2453,7 +2512,7 @@ function DepositAddressStep({
|
|
|
2453
2512
|
children: [
|
|
2454
2513
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenGlyph, { symbol: sourceTokenSymbol }),
|
|
2455
2514
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceTokenSymbol }),
|
|
2456
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2515
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2457
2516
|
]
|
|
2458
2517
|
}
|
|
2459
2518
|
),
|
|
@@ -2497,7 +2556,7 @@ function DepositAddressStep({
|
|
|
2497
2556
|
className: "rs-deposit-address-copy",
|
|
2498
2557
|
onClick: handleCopy,
|
|
2499
2558
|
children: [
|
|
2500
|
-
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2559
|
+
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CopyIcon, {}),
|
|
2501
2560
|
copied ? "Copied!" : "Copy address"
|
|
2502
2561
|
]
|
|
2503
2562
|
}
|
|
@@ -2505,7 +2564,6 @@ function DepositAddressStep({
|
|
|
2505
2564
|
]
|
|
2506
2565
|
}
|
|
2507
2566
|
),
|
|
2508
|
-
targetChain === _chunkH577RJN5cjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6U2H3R3Tcjs.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
2567
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2510
2568
|
"div",
|
|
2511
2569
|
{
|
|
@@ -2523,16 +2581,16 @@ function DepositAddressStep({
|
|
|
2523
2581
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
|
|
2524
2582
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
|
|
2525
2583
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2526
|
-
|
|
2584
|
+
_chunkHCQWFL3Acjs.Tooltip,
|
|
2527
2585
|
{
|
|
2528
2586
|
className: "rs-price-impact-info",
|
|
2529
2587
|
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,
|
|
2588
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.InfoIcon, { "aria-hidden": "true" })
|
|
2531
2589
|
}
|
|
2532
2590
|
)
|
|
2533
2591
|
] }),
|
|
2534
2592
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2535
|
-
|
|
2593
|
+
_chunkNPSC5R22cjs.ChevronDownIcon,
|
|
2536
2594
|
{
|
|
2537
2595
|
className: "rs-price-impact-chevron",
|
|
2538
2596
|
"aria-hidden": "true"
|
|
@@ -2543,29 +2601,29 @@ function DepositAddressStep({
|
|
|
2543
2601
|
),
|
|
2544
2602
|
/* @__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
2603
|
/* @__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,
|
|
2604
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.PercentIcon, {}) }),
|
|
2547
2605
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
2548
2606
|
"Max slippage: ",
|
|
2549
2607
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.2%" })
|
|
2550
2608
|
] }),
|
|
2551
2609
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2552
|
-
|
|
2610
|
+
_chunkHCQWFL3Acjs.Tooltip,
|
|
2553
2611
|
{
|
|
2554
2612
|
className: "rs-price-impact-info",
|
|
2555
2613
|
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,
|
|
2614
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.InfoIcon, { "aria-hidden": "true" })
|
|
2557
2615
|
}
|
|
2558
2616
|
)
|
|
2559
2617
|
] }),
|
|
2560
2618
|
/* @__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,
|
|
2619
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.ClockIcon, {}) }),
|
|
2562
2620
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
2563
2621
|
"Processing time: ",
|
|
2564
2622
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "< 1 min" })
|
|
2565
2623
|
] })
|
|
2566
2624
|
] }),
|
|
2567
|
-
/* @__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,
|
|
2625
|
+
liquidityHelper.kind !== "idle" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
2626
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.PlusCircleIcon, {}) }),
|
|
2569
2627
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
2570
2628
|
"Max deposit:",
|
|
2571
2629
|
" ",
|
|
@@ -2596,7 +2654,7 @@ function DepositAddressStep({
|
|
|
2596
2654
|
},
|
|
2597
2655
|
deposit.id
|
|
2598
2656
|
)) }),
|
|
2599
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2657
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.PoweredBy, {})
|
|
2600
2658
|
] });
|
|
2601
2659
|
}
|
|
2602
2660
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -2644,7 +2702,7 @@ function FinalisingDepositStep() {
|
|
|
2644
2702
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "rs-finalising-subtitle", children: "We are depositing your funds to the application." })
|
|
2645
2703
|
] })
|
|
2646
2704
|
] }),
|
|
2647
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2705
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.PoweredBy, {})
|
|
2648
2706
|
] });
|
|
2649
2707
|
}
|
|
2650
2708
|
FinalisingDepositStep.displayName = "FinalisingDepositStep";
|
|
@@ -2674,7 +2732,7 @@ function SwappedOrderTracker({
|
|
|
2674
2732
|
];
|
|
2675
2733
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-swapped-tracker", children: [
|
|
2676
2734
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2677
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2735
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.HandCoinsIcon, {}), title }),
|
|
2678
2736
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ol", { className: "rs-swapped-tracker-steps", children: labels.map((label, idx) => {
|
|
2679
2737
|
const status = stepStates[idx];
|
|
2680
2738
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
@@ -2688,7 +2746,7 @@ function SwappedOrderTracker({
|
|
|
2688
2746
|
{
|
|
2689
2747
|
className: "rs-swapped-tracker-step-marker",
|
|
2690
2748
|
"aria-hidden": "true",
|
|
2691
|
-
children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2749
|
+
children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CheckIcon, {}) : status === "failed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CloseIcon, {}) : status === "active" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.Spinner, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2692
2750
|
"svg",
|
|
2693
2751
|
{
|
|
2694
2752
|
className: "rs-swapped-tracker-step-ring",
|
|
@@ -2723,7 +2781,7 @@ function SwappedOrderTracker({
|
|
|
2723
2781
|
}
|
|
2724
2782
|
)
|
|
2725
2783
|
] }),
|
|
2726
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2784
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.PoweredBy, {})
|
|
2727
2785
|
] });
|
|
2728
2786
|
}
|
|
2729
2787
|
function formatTrackerAmount(amount) {
|
|
@@ -2875,7 +2933,7 @@ function SwappedIframeStep({
|
|
|
2875
2933
|
if (cancelled) return;
|
|
2876
2934
|
const message = err instanceof Error ? err.message : loadErrorFallback;
|
|
2877
2935
|
setLoadError(message);
|
|
2878
|
-
_optionalChain([onErrorRef, 'access',
|
|
2936
|
+
_optionalChain([onErrorRef, 'access', _101 => _101.current, 'optionalCall', _102 => _102(message, loadErrorCode)]);
|
|
2879
2937
|
});
|
|
2880
2938
|
return () => {
|
|
2881
2939
|
cancelled = true;
|
|
@@ -2928,10 +2986,10 @@ function SwappedIframeStep({
|
|
|
2928
2986
|
const status = await service.fetchLatestStatus(smartAccount);
|
|
2929
2987
|
if (cancelled) return;
|
|
2930
2988
|
const event = status.lastEvent;
|
|
2931
|
-
const eventTxHash =
|
|
2989
|
+
const eventTxHash = _chunkHCQWFL3Acjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkHCQWFL3Acjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
2932
2990
|
if (baselineDepositTxHashRef.current === void 0) {
|
|
2933
2991
|
baselineDepositTxHashRef.current = eventTxHash;
|
|
2934
|
-
} else if (eventTxHash && (!baselineDepositTxHashRef.current || !
|
|
2992
|
+
} else if (eventTxHash && (!baselineDepositTxHashRef.current || !_chunkHCQWFL3Acjs.txRefsMatch.call(void 0, eventTxHash, baselineDepositTxHashRef.current))) {
|
|
2935
2993
|
currentDepositTxHashRef.current = eventTxHash;
|
|
2936
2994
|
setLatestEvent(_nullishCoalesce(event, () => ( null)));
|
|
2937
2995
|
}
|
|
@@ -2956,15 +3014,15 @@ function SwappedIframeStep({
|
|
|
2956
3014
|
}, [service, smartAccount]);
|
|
2957
3015
|
_react.useEffect.call(void 0, () => {
|
|
2958
3016
|
if (fastDepositPollEnabledRef.current) return;
|
|
2959
|
-
const status = _optionalChain([orderState, 'optionalAccess',
|
|
3017
|
+
const status = _optionalChain([orderState, 'optionalAccess', _103 => _103.status]);
|
|
2960
3018
|
if (!status || !SWAPPED_TERMINAL_STATUSES.has(status)) return;
|
|
2961
3019
|
fastDepositPollEnabledRef.current = true;
|
|
2962
|
-
_optionalChain([rescheduleDepositPollRef, 'access',
|
|
3020
|
+
_optionalChain([rescheduleDepositPollRef, 'access', _104 => _104.current, 'optionalCall', _105 => _105(DEPOSIT_POLL_FAST_INITIAL_DELAY_MS)]);
|
|
2963
3021
|
}, [orderState]);
|
|
2964
3022
|
_react.useEffect.call(void 0, () => {
|
|
2965
3023
|
function onMessage(e) {
|
|
2966
3024
|
if (!SWAPPED_IFRAME_ORIGINS.has(e.origin)) return;
|
|
2967
|
-
if (e.source !== _optionalChain([iframeRef, 'access',
|
|
3025
|
+
if (e.source !== _optionalChain([iframeRef, 'access', _106 => _106.current, 'optionalAccess', _107 => _107.contentWindow])) return;
|
|
2968
3026
|
if (isSwappedGoBackMessage(e.data)) {
|
|
2969
3027
|
onGoBackRef.current();
|
|
2970
3028
|
return;
|
|
@@ -2979,16 +3037,16 @@ function SwappedIframeStep({
|
|
|
2979
3037
|
setOrderState((prev) => ({
|
|
2980
3038
|
// Normalise to the uuid the backend poll also keys on, so orderState
|
|
2981
3039
|
// is consistent regardless of which path set it.
|
|
2982
|
-
orderId: _nullishCoalesce(_nullishCoalesce(expectedOrderUuidRef.current, () => ( _optionalChain([prev, 'optionalAccess',
|
|
3040
|
+
orderId: _nullishCoalesce(_nullishCoalesce(expectedOrderUuidRef.current, () => ( _optionalChain([prev, 'optionalAccess', _108 => _108.orderId]))), () => ( ext)),
|
|
2983
3041
|
status: parsed.status,
|
|
2984
|
-
orderCrypto: _nullishCoalesce(_nullishCoalesce(parsed.orderCrypto, () => ( _optionalChain([prev, 'optionalAccess',
|
|
2985
|
-
orderCryptoAmount: _nullishCoalesce(_nullishCoalesce(parsed.orderCryptoAmount, () => ( _optionalChain([prev, 'optionalAccess',
|
|
2986
|
-
transactionId: _nullishCoalesce(_nullishCoalesce(parsed.transactionId, () => ( _optionalChain([prev, 'optionalAccess',
|
|
3042
|
+
orderCrypto: _nullishCoalesce(_nullishCoalesce(parsed.orderCrypto, () => ( _optionalChain([prev, 'optionalAccess', _109 => _109.orderCrypto]))), () => ( null)),
|
|
3043
|
+
orderCryptoAmount: _nullishCoalesce(_nullishCoalesce(parsed.orderCryptoAmount, () => ( _optionalChain([prev, 'optionalAccess', _110 => _110.orderCryptoAmount]))), () => ( null)),
|
|
3044
|
+
transactionId: _nullishCoalesce(_nullishCoalesce(parsed.transactionId, () => ( _optionalChain([prev, 'optionalAccess', _111 => _111.transactionId]))), () => ( null)),
|
|
2987
3045
|
receivedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2988
|
-
paidAmountUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
2989
|
-
paidAmountEur: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
2990
|
-
onrampFeeUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
2991
|
-
paymentMethod: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
3046
|
+
paidAmountUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _112 => _112.paidAmountUsd]), () => ( null)),
|
|
3047
|
+
paidAmountEur: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _113 => _113.paidAmountEur]), () => ( null)),
|
|
3048
|
+
onrampFeeUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _114 => _114.onrampFeeUsd]), () => ( null)),
|
|
3049
|
+
paymentMethod: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _115 => _115.paymentMethod]), () => ( null))
|
|
2992
3050
|
}));
|
|
2993
3051
|
}
|
|
2994
3052
|
window.addEventListener("message", onMessage);
|
|
@@ -3001,17 +3059,17 @@ function SwappedIframeStep({
|
|
|
3001
3059
|
}
|
|
3002
3060
|
}, [phase, orderState, latestEvent, variant]);
|
|
3003
3061
|
const stepStates = _react.useMemo.call(void 0,
|
|
3004
|
-
() => deriveStepStates(_nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
3062
|
+
() => deriveStepStates(_nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _116 => _116.status]), () => ( null)), latestEvent),
|
|
3005
3063
|
[orderState, latestEvent]
|
|
3006
3064
|
);
|
|
3007
3065
|
const terminalState = _react.useMemo.call(void 0, () => {
|
|
3008
|
-
if (
|
|
3066
|
+
if (_chunkHCQWFL3Acjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
|
|
3009
3067
|
return {
|
|
3010
3068
|
kind: "failed",
|
|
3011
|
-
message:
|
|
3069
|
+
message: _chunkHCQWFL3Acjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
|
|
3012
3070
|
};
|
|
3013
3071
|
}
|
|
3014
|
-
if (_optionalChain([orderState, 'optionalAccess',
|
|
3072
|
+
if (_optionalChain([orderState, 'optionalAccess', _117 => _117.status]) === "order_cancelled") {
|
|
3015
3073
|
const banner = bannerForStatus("order_cancelled", {});
|
|
3016
3074
|
return { kind: "cancelled", message: _nullishCoalesce(banner.detail, () => ( banner.title)) };
|
|
3017
3075
|
}
|
|
@@ -3019,7 +3077,7 @@ function SwappedIframeStep({
|
|
|
3019
3077
|
}, [latestEvent, orderState, bannerForStatus]);
|
|
3020
3078
|
_react.useEffect.call(void 0, () => {
|
|
3021
3079
|
if (completeFiredRef.current || failedFiredRef.current) return;
|
|
3022
|
-
const t = _optionalChain([latestEvent, 'optionalAccess',
|
|
3080
|
+
const t = _optionalChain([latestEvent, 'optionalAccess', _118 => _118.type]);
|
|
3023
3081
|
const isSuccess = t === "bridge-complete";
|
|
3024
3082
|
if (!isSuccess) return;
|
|
3025
3083
|
const txHash = currentDepositTxHashRef.current;
|
|
@@ -3028,10 +3086,10 @@ function SwappedIframeStep({
|
|
|
3028
3086
|
const info = {
|
|
3029
3087
|
smartAccount,
|
|
3030
3088
|
txHash,
|
|
3031
|
-
orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
3089
|
+
orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _119 => _119.orderCrypto]), () => ( null)),
|
|
3032
3090
|
// Base-unit source amount from the deposit row/event, consistent with the
|
|
3033
3091
|
// wallet/QR path. ProcessingStep + onLifecycle expect base units.
|
|
3034
|
-
amount: _nullishCoalesce(
|
|
3092
|
+
amount: _nullishCoalesce(_chunkHCQWFL3Acjs.getEventSourceDetails.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0))).amount, () => ( null)),
|
|
3035
3093
|
expectedOrderUuid: expectedOrderUuidRef.current,
|
|
3036
3094
|
initialEvent: _nullishCoalesce(latestEvent, () => ( void 0))
|
|
3037
3095
|
};
|
|
@@ -3042,21 +3100,21 @@ function SwappedIframeStep({
|
|
|
3042
3100
|
}, [latestEvent, orderState, smartAccount]);
|
|
3043
3101
|
_react.useEffect.call(void 0, () => {
|
|
3044
3102
|
if (failedFiredRef.current || completeFiredRef.current) return;
|
|
3045
|
-
if (!
|
|
3103
|
+
if (!_chunkHCQWFL3Acjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) return;
|
|
3046
3104
|
const txHash = currentDepositTxHashRef.current;
|
|
3047
3105
|
if (!txHash) return;
|
|
3048
3106
|
failedFiredRef.current = true;
|
|
3049
3107
|
setPhase("tracker");
|
|
3050
|
-
_optionalChain([onSwappedFailedRef, 'access',
|
|
3108
|
+
_optionalChain([onSwappedFailedRef, 'access', _120 => _120.current, 'optionalCall', _121 => _121(
|
|
3051
3109
|
txHash,
|
|
3052
|
-
|
|
3110
|
+
_chunkHCQWFL3Acjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
|
|
3053
3111
|
)]);
|
|
3054
3112
|
}, [latestEvent]);
|
|
3055
3113
|
const immersive = variant === "fiat" && phase === "iframe" && !loadError;
|
|
3056
3114
|
_react.useEffect.call(void 0, () => {
|
|
3057
|
-
_optionalChain([onImmersiveChangeRef, 'access',
|
|
3115
|
+
_optionalChain([onImmersiveChangeRef, 'access', _122 => _122.current, 'optionalCall', _123 => _123(immersive)]);
|
|
3058
3116
|
}, [immersive]);
|
|
3059
|
-
_react.useEffect.call(void 0, () => () => _optionalChain([onImmersiveChangeRef, 'access',
|
|
3117
|
+
_react.useEffect.call(void 0, () => () => _optionalChain([onImmersiveChangeRef, 'access', _124 => _124.current, 'optionalCall', _125 => _125(false)]), []);
|
|
3060
3118
|
const handleRetry = () => {
|
|
3061
3119
|
setIframeSrc(null);
|
|
3062
3120
|
setWidgetUrl(null);
|
|
@@ -3072,8 +3130,8 @@ function SwappedIframeStep({
|
|
|
3072
3130
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3073
3131
|
SwappedOrderTracker,
|
|
3074
3132
|
{
|
|
3075
|
-
amount: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
3076
|
-
currency: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
3133
|
+
amount: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _126 => _126.orderCryptoAmount]), () => ( null)),
|
|
3134
|
+
currency: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _127 => _127.orderCrypto]), () => ( "USDC")),
|
|
3077
3135
|
stepStates,
|
|
3078
3136
|
terminal: terminalState,
|
|
3079
3137
|
onRetry: handleRetry,
|
|
@@ -3095,7 +3153,7 @@ function SwappedIframeStep({
|
|
|
3095
3153
|
}
|
|
3096
3154
|
)
|
|
3097
3155
|
] }),
|
|
3098
|
-
!loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3156
|
+
!loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.Spinner, {}) }),
|
|
3099
3157
|
widgetUrl && !loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3100
3158
|
"iframe",
|
|
3101
3159
|
{
|
|
@@ -3107,7 +3165,7 @@ function SwappedIframeStep({
|
|
|
3107
3165
|
allow: "payment; camera; microphone; clipboard-write; geolocation",
|
|
3108
3166
|
onLoad: () => {
|
|
3109
3167
|
try {
|
|
3110
|
-
if (_optionalChain([iframeRef, 'access',
|
|
3168
|
+
if (_optionalChain([iframeRef, 'access', _128 => _128.current, 'optionalAccess', _129 => _129.contentWindow, 'optionalAccess', _130 => _130.location, 'optionalAccess', _131 => _131.href]) === "about:blank") {
|
|
3111
3169
|
return;
|
|
3112
3170
|
}
|
|
3113
3171
|
} catch (e19) {
|
|
@@ -3118,11 +3176,11 @@ function SwappedIframeStep({
|
|
|
3118
3176
|
retryToken
|
|
3119
3177
|
)
|
|
3120
3178
|
] }) }),
|
|
3121
|
-
loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3179
|
+
loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.PoweredBy, {})
|
|
3122
3180
|
] });
|
|
3123
3181
|
}
|
|
3124
3182
|
function deriveStepStates(swappedStatus, latestEvent) {
|
|
3125
|
-
if (
|
|
3183
|
+
if (_chunkHCQWFL3Acjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
|
|
3126
3184
|
return ["complete", "complete", "failed", "pending"];
|
|
3127
3185
|
}
|
|
3128
3186
|
if (swappedStatus === "order_cancelled") {
|
|
@@ -3130,7 +3188,7 @@ function deriveStepStates(swappedStatus, latestEvent) {
|
|
|
3130
3188
|
}
|
|
3131
3189
|
const step1Complete = swappedStatus === "order_completed" || swappedStatus === "order_broadcasted";
|
|
3132
3190
|
const step2Complete = latestEvent !== null || swappedStatus === "order_broadcasted";
|
|
3133
|
-
const step3Complete = _optionalChain([latestEvent, 'optionalAccess',
|
|
3191
|
+
const step3Complete = _optionalChain([latestEvent, 'optionalAccess', _132 => _132.type]) === "bridge-complete";
|
|
3134
3192
|
if (step3Complete) {
|
|
3135
3193
|
return ["complete", "complete", "complete", "complete"];
|
|
3136
3194
|
}
|
|
@@ -3186,7 +3244,7 @@ function FiatOnrampStep({
|
|
|
3186
3244
|
onImmersiveChange
|
|
3187
3245
|
}) {
|
|
3188
3246
|
const loadUrl = _react.useCallback.call(void 0, async () => {
|
|
3189
|
-
const prefetched = _optionalChain([consumePrefetchedUrl, 'optionalCall',
|
|
3247
|
+
const prefetched = _optionalChain([consumePrefetchedUrl, 'optionalCall', _133 => _133(
|
|
3190
3248
|
smartAccount,
|
|
3191
3249
|
paymentMethod,
|
|
3192
3250
|
methodSelectionSource
|
|
@@ -3312,7 +3370,7 @@ ExchangeConnectStep.displayName = "ExchangeConnectStep";
|
|
|
3312
3370
|
function ExchangeLogo({ exchange }) {
|
|
3313
3371
|
const [failed, setFailed] = _react.useState.call(void 0, false);
|
|
3314
3372
|
if (!exchange.logoUrl || failed) {
|
|
3315
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3373
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.BankIcon, {});
|
|
3316
3374
|
}
|
|
3317
3375
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3318
3376
|
"img",
|
|
@@ -3357,7 +3415,7 @@ function ExchangeSelectStep({
|
|
|
3357
3415
|
setExchanges([]);
|
|
3358
3416
|
setExchangeFeeBps(0);
|
|
3359
3417
|
setError(message);
|
|
3360
|
-
_optionalChain([onError, 'optionalCall',
|
|
3418
|
+
_optionalChain([onError, 'optionalCall', _134 => _134(message, "SWAPPED_CONNECT_EXCHANGES_FAILED")]);
|
|
3361
3419
|
}).finally(() => {
|
|
3362
3420
|
if (!cancelled) setLoading(false);
|
|
3363
3421
|
});
|
|
@@ -3383,7 +3441,7 @@ function ExchangeSelectStep({
|
|
|
3383
3441
|
} catch (err) {
|
|
3384
3442
|
const message = err instanceof Error ? err.message : "Failed to prepare Connect";
|
|
3385
3443
|
setSelectionNotice(message);
|
|
3386
|
-
_optionalChain([onError, 'optionalCall',
|
|
3444
|
+
_optionalChain([onError, 'optionalCall', _135 => _135(message, "SWAPPED_CONNECT_URL_FAILED")]);
|
|
3387
3445
|
} finally {
|
|
3388
3446
|
setSelectingConnection(null);
|
|
3389
3447
|
}
|
|
@@ -3393,14 +3451,14 @@ function ExchangeSelectStep({
|
|
|
3393
3451
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-exchange-select", children: [
|
|
3394
3452
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3395
3453
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3396
|
-
|
|
3454
|
+
_chunkNPSC5R22cjs.BodyHeader,
|
|
3397
3455
|
{
|
|
3398
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3456
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.UnplugIcon, {}),
|
|
3399
3457
|
title: "Connect exchange",
|
|
3400
3458
|
subtitle: "Select an exchange to connect"
|
|
3401
3459
|
}
|
|
3402
3460
|
),
|
|
3403
|
-
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3461
|
+
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.Spinner, {}) }),
|
|
3404
3462
|
!loading && error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: [
|
|
3405
3463
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state-title", children: "Couldn\u2019t load exchanges" }),
|
|
3406
3464
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3426,7 +3484,7 @@ function ExchangeSelectStep({
|
|
|
3426
3484
|
)
|
|
3427
3485
|
] }),
|
|
3428
3486
|
!loading && !error && exchanges.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-grid", children: exchanges.map((exchange) => {
|
|
3429
|
-
const brand =
|
|
3487
|
+
const brand = _chunkHCQWFL3Acjs.getExchangeLogo.call(void 0, exchange.name, exchange.connection);
|
|
3430
3488
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3431
3489
|
"button",
|
|
3432
3490
|
{
|
|
@@ -3451,7 +3509,7 @@ function ExchangeSelectStep({
|
|
|
3451
3509
|
);
|
|
3452
3510
|
}) })
|
|
3453
3511
|
] }),
|
|
3454
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3512
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.PoweredBy, {}),
|
|
3455
3513
|
exchangeFeeBps > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "rs-exchange-select-fee-note", children: [
|
|
3456
3514
|
"A ",
|
|
3457
3515
|
formatFeeRate(exchangeFeeBps),
|
|
@@ -3468,29 +3526,29 @@ var BASE_CHAIN_ID = 8453;
|
|
|
3468
3526
|
function DepositAddressSkeleton({
|
|
3469
3527
|
uiConfig
|
|
3470
3528
|
}) {
|
|
3471
|
-
const evmChainIds =
|
|
3529
|
+
const evmChainIds = _chunkTENL4H64cjs.getSupportedChainIds.call(void 0, );
|
|
3472
3530
|
const defaultChainId = evmChainIds.includes(BASE_CHAIN_ID) ? BASE_CHAIN_ID : evmChainIds[0];
|
|
3473
|
-
const tokensForChain =
|
|
3531
|
+
const tokensForChain = _chunkTENL4H64cjs.getTargetTokenSymbolsForChain.call(void 0, defaultChainId);
|
|
3474
3532
|
const defaultToken = tokensForChain.includes("USDC") ? "USDC" : _nullishCoalesce(tokensForChain[0], () => ( "USDC"));
|
|
3475
|
-
const chainName =
|
|
3476
|
-
const chainIcon =
|
|
3533
|
+
const chainName = _chunkTENL4H64cjs.getChainName.call(void 0, defaultChainId);
|
|
3534
|
+
const chainIcon = _chunkTENL4H64cjs.getChainIcon.call(void 0, defaultChainId);
|
|
3477
3535
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", "aria-busy": "true", children: [
|
|
3478
3536
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: "Preparing deposit details\u2026" }),
|
|
3479
3537
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
3480
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3538
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
3481
3539
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", "aria-hidden": "true", children: [
|
|
3482
3540
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
3483
3541
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
3484
3542
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown-trigger", children: [
|
|
3485
3543
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3486
|
-
|
|
3544
|
+
_chunkNPSC5R22cjs.CdnIcon,
|
|
3487
3545
|
{
|
|
3488
3546
|
src: chainIcon,
|
|
3489
3547
|
className: "rs-deposit-address-dropdown-icon"
|
|
3490
3548
|
}
|
|
3491
3549
|
),
|
|
3492
3550
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainName }),
|
|
3493
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3551
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
3494
3552
|
] })
|
|
3495
3553
|
] }),
|
|
3496
3554
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
@@ -3498,9 +3556,9 @@ function DepositAddressSkeleton({
|
|
|
3498
3556
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Supported token" }),
|
|
3499
3557
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
3500
3558
|
"Min.$",
|
|
3501
|
-
(_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3502
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3503
|
-
|
|
3559
|
+
(_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _136 => _136.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
3560
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHCQWFL3Acjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3561
|
+
_chunkNPSC5R22cjs.InfoIcon,
|
|
3504
3562
|
{
|
|
3505
3563
|
className: "rs-deposit-address-min-icon",
|
|
3506
3564
|
"aria-hidden": "true"
|
|
@@ -3510,14 +3568,14 @@ function DepositAddressSkeleton({
|
|
|
3510
3568
|
] }),
|
|
3511
3569
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown-trigger", children: [
|
|
3512
3570
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3513
|
-
|
|
3571
|
+
_chunkNPSC5R22cjs.TokenIcon,
|
|
3514
3572
|
{
|
|
3515
3573
|
symbol: defaultToken,
|
|
3516
3574
|
className: "rs-deposit-address-dropdown-icon"
|
|
3517
3575
|
}
|
|
3518
3576
|
),
|
|
3519
3577
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: defaultToken }),
|
|
3520
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3578
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
3521
3579
|
] })
|
|
3522
3580
|
] })
|
|
3523
3581
|
] }),
|
|
@@ -3538,7 +3596,7 @@ function DepositAddressSkeleton({
|
|
|
3538
3596
|
disabled: true,
|
|
3539
3597
|
"aria-hidden": "true",
|
|
3540
3598
|
children: [
|
|
3541
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3599
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CopyIcon, {}),
|
|
3542
3600
|
"Copy address"
|
|
3543
3601
|
]
|
|
3544
3602
|
}
|
|
@@ -3551,16 +3609,16 @@ function DepositAddressSkeleton({
|
|
|
3551
3609
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
|
|
3552
3610
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
|
|
3553
3611
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3554
|
-
|
|
3612
|
+
_chunkHCQWFL3Acjs.Tooltip,
|
|
3555
3613
|
{
|
|
3556
3614
|
className: "rs-price-impact-info",
|
|
3557
3615
|
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,
|
|
3616
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.InfoIcon, { "aria-hidden": "true" })
|
|
3559
3617
|
}
|
|
3560
3618
|
)
|
|
3561
3619
|
] }),
|
|
3562
3620
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3563
|
-
|
|
3621
|
+
_chunkNPSC5R22cjs.ChevronDownIcon,
|
|
3564
3622
|
{
|
|
3565
3623
|
className: "rs-price-impact-chevron",
|
|
3566
3624
|
"aria-hidden": "true"
|
|
@@ -3568,7 +3626,7 @@ function DepositAddressSkeleton({
|
|
|
3568
3626
|
)
|
|
3569
3627
|
] }) })
|
|
3570
3628
|
] }),
|
|
3571
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3629
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.PoweredBy, {})
|
|
3572
3630
|
] });
|
|
3573
3631
|
}
|
|
3574
3632
|
DepositAddressSkeleton.displayName = "DepositAddressSkeleton";
|
|
@@ -3600,14 +3658,14 @@ function SolanaTokenSelectStep({
|
|
|
3600
3658
|
setError(null);
|
|
3601
3659
|
const portfolioBySymbol = {};
|
|
3602
3660
|
try {
|
|
3603
|
-
|
|
3661
|
+
_chunkNPSC5R22cjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
|
|
3604
3662
|
solanaAddress
|
|
3605
3663
|
});
|
|
3606
3664
|
const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
|
|
3607
3665
|
if (!active) return;
|
|
3608
3666
|
for (const t of portfolio.tokens) {
|
|
3609
3667
|
const symbol = t.symbol.toUpperCase();
|
|
3610
|
-
if (!
|
|
3668
|
+
if (!_chunkTENL4H64cjs.SOLANA_TOKENS.some((st) => st.symbol === symbol)) continue;
|
|
3611
3669
|
let parsed = 0n;
|
|
3612
3670
|
try {
|
|
3613
3671
|
parsed = BigInt(t.balance || "0");
|
|
@@ -3623,12 +3681,12 @@ function SolanaTokenSelectStep({
|
|
|
3623
3681
|
};
|
|
3624
3682
|
}
|
|
3625
3683
|
}
|
|
3626
|
-
|
|
3684
|
+
_chunkNPSC5R22cjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
|
|
3627
3685
|
symbols: Object.keys(portfolioBySymbol)
|
|
3628
3686
|
});
|
|
3629
3687
|
} catch (err) {
|
|
3630
3688
|
if (!active) return;
|
|
3631
|
-
|
|
3689
|
+
_chunkNPSC5R22cjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
|
|
3632
3690
|
solanaAddress
|
|
3633
3691
|
});
|
|
3634
3692
|
setError(
|
|
@@ -3639,7 +3697,7 @@ function SolanaTokenSelectStep({
|
|
|
3639
3697
|
return;
|
|
3640
3698
|
}
|
|
3641
3699
|
const results = [];
|
|
3642
|
-
for (const token of
|
|
3700
|
+
for (const token of _chunkTENL4H64cjs.SOLANA_TOKENS) {
|
|
3643
3701
|
const fromPortfolio = portfolioBySymbol[token.symbol];
|
|
3644
3702
|
if (fromPortfolio && fromPortfolio.balance > 0n) {
|
|
3645
3703
|
results.push({
|
|
@@ -3653,7 +3711,7 @@ function SolanaTokenSelectStep({
|
|
|
3653
3711
|
setTokenBalances(results);
|
|
3654
3712
|
setLoading(false);
|
|
3655
3713
|
const totalUsd = results.reduce((sum, r) => sum + r.balanceUsd, 0);
|
|
3656
|
-
_optionalChain([onTotalBalanceComputed, 'optionalCall',
|
|
3714
|
+
_optionalChain([onTotalBalanceComputed, 'optionalCall', _137 => _137(totalUsd)]);
|
|
3657
3715
|
}
|
|
3658
3716
|
void loadBalances();
|
|
3659
3717
|
return () => {
|
|
@@ -3675,30 +3733,30 @@ function SolanaTokenSelectStep({
|
|
|
3675
3733
|
const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
|
|
3676
3734
|
const numeric = Number(raw);
|
|
3677
3735
|
if (!Number.isFinite(numeric)) return raw;
|
|
3678
|
-
return
|
|
3736
|
+
return _chunkNPSC5R22cjs.tokenFormatter.format(numeric);
|
|
3679
3737
|
} catch (e22) {
|
|
3680
3738
|
return "--";
|
|
3681
3739
|
}
|
|
3682
3740
|
};
|
|
3683
|
-
const chainIcon =
|
|
3684
|
-
const chainName =
|
|
3741
|
+
const chainIcon = _chunkTENL4H64cjs.getChainIcon.call(void 0, "solana");
|
|
3742
|
+
const chainName = _chunkTENL4H64cjs.getChainName.call(void 0, "solana");
|
|
3685
3743
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
3686
3744
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
3687
3745
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3688
|
-
|
|
3746
|
+
_chunkNPSC5R22cjs.BodyHeader,
|
|
3689
3747
|
{
|
|
3690
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3748
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.WalletIcon, {}),
|
|
3691
3749
|
title: "Your assets",
|
|
3692
3750
|
subtitle: "Select source assets to transfer"
|
|
3693
3751
|
}
|
|
3694
3752
|
),
|
|
3695
3753
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
3696
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3754
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.Spinner, { className: "rs-text-tertiary" }),
|
|
3697
3755
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
3698
3756
|
] }),
|
|
3699
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3757
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.Callout, { variant: "error", children: error }),
|
|
3700
3758
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
3701
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3759
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
3702
3760
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
3703
3761
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
3704
3762
|
solanaAddress.slice(0, 6),
|
|
@@ -3729,13 +3787,13 @@ function SolanaTokenSelectStep({
|
|
|
3729
3787
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
|
|
3730
3788
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-icon-wrapper", children: [
|
|
3731
3789
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3732
|
-
|
|
3790
|
+
_chunkNPSC5R22cjs.TokenIcon,
|
|
3733
3791
|
{
|
|
3734
3792
|
symbol: entry.token.symbol,
|
|
3735
3793
|
fallback: entry.token.symbol.slice(0, 4)
|
|
3736
3794
|
}
|
|
3737
3795
|
) }),
|
|
3738
|
-
chainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3796
|
+
chainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CdnIcon, { src: chainIcon, alt: chainName }) })
|
|
3739
3797
|
] }),
|
|
3740
3798
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-text", children: [
|
|
3741
3799
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-name-row", children: [
|
|
@@ -3752,14 +3810,14 @@ function SolanaTokenSelectStep({
|
|
|
3752
3810
|
] })
|
|
3753
3811
|
] })
|
|
3754
3812
|
] }),
|
|
3755
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ?
|
|
3813
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunkNPSC5R22cjs.currencyFormatter.format(entry.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${entry.token.symbol}` : "--" })
|
|
3756
3814
|
]
|
|
3757
3815
|
},
|
|
3758
3816
|
entry.token.symbol
|
|
3759
3817
|
);
|
|
3760
3818
|
}) }),
|
|
3761
3819
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3762
|
-
|
|
3820
|
+
_chunkNPSC5R22cjs.Button,
|
|
3763
3821
|
{
|
|
3764
3822
|
onClick: () => selectedEntry && onContinue(
|
|
3765
3823
|
selectedEntry.token,
|
|
@@ -3772,7 +3830,7 @@ function SolanaTokenSelectStep({
|
|
|
3772
3830
|
}
|
|
3773
3831
|
)
|
|
3774
3832
|
] }),
|
|
3775
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3833
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.PoweredBy, {})
|
|
3776
3834
|
] });
|
|
3777
3835
|
}
|
|
3778
3836
|
|
|
@@ -3803,8 +3861,8 @@ function SolanaAmountStep({
|
|
|
3803
3861
|
const [amount, setAmount] = _react.useState.call(void 0, "");
|
|
3804
3862
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
3805
3863
|
const hasAppliedDefaultRef = _react.useRef.call(void 0, false);
|
|
3806
|
-
const isSourceStablecoin =
|
|
3807
|
-
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess',
|
|
3864
|
+
const isSourceStablecoin = _chunkTENL4H64cjs.isStablecoinSymbol.call(void 0, token.symbol);
|
|
3865
|
+
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess', _138 => _138.trim, 'call', _139 => _139(), 'access', _140 => _140.toLowerCase, 'call', _141 => _141()]) === "max";
|
|
3808
3866
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
3809
3867
|
if (isSourceStablecoin) return 1;
|
|
3810
3868
|
try {
|
|
@@ -3824,7 +3882,7 @@ function SolanaAmountStep({
|
|
|
3824
3882
|
const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
|
|
3825
3883
|
const numeric = Number(raw);
|
|
3826
3884
|
if (!Number.isFinite(numeric)) return raw;
|
|
3827
|
-
return
|
|
3885
|
+
return _chunkNPSC5R22cjs.tokenFormatter.format(numeric);
|
|
3828
3886
|
} catch (e24) {
|
|
3829
3887
|
return "\u2026";
|
|
3830
3888
|
}
|
|
@@ -3841,7 +3899,7 @@ function SolanaAmountStep({
|
|
|
3841
3899
|
}
|
|
3842
3900
|
}, [balance, token.decimals, tokenPriceUsd, balanceUsd]);
|
|
3843
3901
|
const spendableBalance = _react.useMemo.call(void 0, () => {
|
|
3844
|
-
if (!
|
|
3902
|
+
if (!_chunkTENL4H64cjs.isNativeSol.call(void 0, token)) return balance;
|
|
3845
3903
|
return balance > SOL_FEE_RESERVE_LAMPORTS ? balance - SOL_FEE_RESERVE_LAMPORTS : 0n;
|
|
3846
3904
|
}, [balance, token]);
|
|
3847
3905
|
const spendableBalanceUsd = _react.useMemo.call(void 0, () => {
|
|
@@ -3906,8 +3964,8 @@ function SolanaAmountStep({
|
|
|
3906
3964
|
return null;
|
|
3907
3965
|
}
|
|
3908
3966
|
}, [numericAmount, isSourceStablecoin, hasPricing, tokenPriceUsd, token.decimals]);
|
|
3909
|
-
const minDepositUsd =
|
|
3910
|
-
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3967
|
+
const minDepositUsd = _chunkTENL4H64cjs.isHyperCoreDestination.call(void 0, targetChain) ? Math.max(_chunkTENL4H64cjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _142 => _142.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _143 => _143.minDepositUsd]), () => ( null));
|
|
3968
|
+
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _144 => _144.maxDepositUsd]), () => ( null));
|
|
3911
3969
|
const isBelowMin = minDepositUsd !== null && numericAmount > 0 && numericAmount < minDepositUsd;
|
|
3912
3970
|
const isAboveMax = maxDepositUsd !== null && numericAmount > maxDepositUsd;
|
|
3913
3971
|
const exceedsBalance = Boolean(
|
|
@@ -3917,7 +3975,7 @@ function SolanaAmountStep({
|
|
|
3917
3975
|
const handlePresetClick = (percentage) => {
|
|
3918
3976
|
const formatted = computePresetAmount(percentage);
|
|
3919
3977
|
if (!formatted) return;
|
|
3920
|
-
|
|
3978
|
+
_chunkNPSC5R22cjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
|
|
3921
3979
|
percentage,
|
|
3922
3980
|
symbol: token.symbol,
|
|
3923
3981
|
formatted
|
|
@@ -3952,7 +4010,7 @@ function SolanaAmountStep({
|
|
|
3952
4010
|
try {
|
|
3953
4011
|
amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
|
|
3954
4012
|
} catch (e29) {
|
|
3955
|
-
|
|
4013
|
+
_chunkNPSC5R22cjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
3956
4014
|
amount,
|
|
3957
4015
|
sourceAmount: sourceAmountStr,
|
|
3958
4016
|
reason: "parse-units-failed"
|
|
@@ -3961,13 +4019,13 @@ function SolanaAmountStep({
|
|
|
3961
4019
|
return;
|
|
3962
4020
|
}
|
|
3963
4021
|
if (amountInUnits > spendableBalance) {
|
|
3964
|
-
const isReserveIssue =
|
|
4022
|
+
const isReserveIssue = _chunkTENL4H64cjs.isNativeSol.call(void 0, token) && amountInUnits <= balance;
|
|
3965
4023
|
setError(
|
|
3966
4024
|
isReserveIssue ? "Use a bit less than your full SOL balance" : "Insufficient balance"
|
|
3967
4025
|
);
|
|
3968
4026
|
return;
|
|
3969
4027
|
}
|
|
3970
|
-
|
|
4028
|
+
_chunkNPSC5R22cjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
|
|
3971
4029
|
symbol: token.symbol,
|
|
3972
4030
|
inputAmountUsd: amount,
|
|
3973
4031
|
sourceAmount: sourceAmountStr,
|
|
@@ -3980,7 +4038,7 @@ function SolanaAmountStep({
|
|
|
3980
4038
|
const continueDisabled = exceedsBalance || numericAmount === 0 && !isBelowMin;
|
|
3981
4039
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
3982
4040
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3983
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4041
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.WalletIcon, {}), title: "Wallet deposit" }),
|
|
3984
4042
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
3985
4043
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
3986
4044
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -4000,13 +4058,13 @@ function SolanaAmountStep({
|
|
|
4000
4058
|
" available",
|
|
4001
4059
|
computedBalanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
4002
4060
|
" (~",
|
|
4003
|
-
|
|
4061
|
+
_chunkNPSC5R22cjs.currencyFormatter.format(computedBalanceUsd),
|
|
4004
4062
|
")"
|
|
4005
4063
|
] })
|
|
4006
4064
|
] }),
|
|
4007
4065
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
4008
4066
|
"Min. deposit ",
|
|
4009
|
-
|
|
4067
|
+
_chunkNPSC5R22cjs.currencyFormatter.format(minDepositUsd)
|
|
4010
4068
|
] })
|
|
4011
4069
|
] })
|
|
4012
4070
|
] }),
|
|
@@ -4029,7 +4087,7 @@ function SolanaAmountStep({
|
|
|
4029
4087
|
"Solana ",
|
|
4030
4088
|
token.symbol
|
|
4031
4089
|
] }),
|
|
4032
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4090
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.TokenIcon, { symbol: token.symbol }) })
|
|
4033
4091
|
] })
|
|
4034
4092
|
] }),
|
|
4035
4093
|
targetChainName && targetTokenSymbol && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
@@ -4040,18 +4098,17 @@ function SolanaAmountStep({
|
|
|
4040
4098
|
" ",
|
|
4041
4099
|
targetTokenSymbol
|
|
4042
4100
|
] }),
|
|
4043
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4101
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.TokenIcon, { symbol: targetTokenSymbol }) })
|
|
4044
4102
|
] })
|
|
4045
4103
|
] }),
|
|
4046
4104
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
4047
4105
|
/* @__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:
|
|
4106
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkNPSC5R22cjs.currencyFormatter.format(balanceAfterUsd) })
|
|
4049
4107
|
] })
|
|
4050
4108
|
] }),
|
|
4051
|
-
|
|
4052
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6U2H3R3Tcjs.Callout, { variant: "error", children: error }),
|
|
4109
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.Callout, { variant: "error", children: error }),
|
|
4053
4110
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4054
|
-
|
|
4111
|
+
_chunkNPSC5R22cjs.Button,
|
|
4055
4112
|
{
|
|
4056
4113
|
onClick: handleContinue,
|
|
4057
4114
|
fullWidth: true,
|
|
@@ -4060,7 +4117,7 @@ function SolanaAmountStep({
|
|
|
4060
4117
|
}
|
|
4061
4118
|
)
|
|
4062
4119
|
] }),
|
|
4063
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4120
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.PoweredBy, {})
|
|
4064
4121
|
] });
|
|
4065
4122
|
}
|
|
4066
4123
|
|
|
@@ -4083,10 +4140,10 @@ var _spltoken = require('@solana/spl-token');
|
|
|
4083
4140
|
var DEFAULT_SOLANA_RPC_URL = "https://api.mainnet.solana.com";
|
|
4084
4141
|
var cachedConnections = /* @__PURE__ */ new Map();
|
|
4085
4142
|
function getSolanaRpcUrl(rpcUrls) {
|
|
4086
|
-
return _nullishCoalesce(
|
|
4143
|
+
return _nullishCoalesce(_chunkNPSC5R22cjs.rpcUrlFor.call(void 0, rpcUrls, "solana"), () => ( DEFAULT_SOLANA_RPC_URL));
|
|
4087
4144
|
}
|
|
4088
4145
|
function hasConfiguredSolanaRpcUrl(rpcUrls) {
|
|
4089
|
-
return
|
|
4146
|
+
return _chunkNPSC5R22cjs.rpcUrlFor.call(void 0, rpcUrls, "solana") !== void 0;
|
|
4090
4147
|
}
|
|
4091
4148
|
function getSolanaConnection(rpcUrls) {
|
|
4092
4149
|
const rpcUrl = getSolanaRpcUrl(rpcUrls);
|
|
@@ -4188,36 +4245,37 @@ function SolanaConfirmStep({
|
|
|
4188
4245
|
onError,
|
|
4189
4246
|
debug
|
|
4190
4247
|
}) {
|
|
4191
|
-
const rpcUrls =
|
|
4248
|
+
const rpcUrls = _chunkNPSC5R22cjs.useRpcUrls.call(void 0, );
|
|
4192
4249
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
4193
4250
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
4194
|
-
const
|
|
4195
|
-
const
|
|
4196
|
-
const
|
|
4197
|
-
const
|
|
4198
|
-
const
|
|
4199
|
-
const
|
|
4200
|
-
const
|
|
4201
|
-
const
|
|
4251
|
+
const targetChainId = _chunkTENL4H64cjs.targetChainToChainId.call(void 0, targetChain);
|
|
4252
|
+
const targetSymbol = _chunkTENL4H64cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
4253
|
+
const sourceChainName = _chunkTENL4H64cjs.getChainName.call(void 0, "solana");
|
|
4254
|
+
const targetChainName = _chunkTENL4H64cjs.getChainName.call(void 0, targetChainId);
|
|
4255
|
+
const sourceChainIcon = _chunkTENL4H64cjs.getChainIcon.call(void 0, "solana");
|
|
4256
|
+
const targetChainIcon = _chunkTENL4H64cjs.getChainIcon.call(void 0, targetChainId);
|
|
4257
|
+
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _145 => _145.feeSponsored]), () => ( false));
|
|
4258
|
+
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _146 => _146.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
4259
|
+
const formattedAmount = sourceAmount && Number.isFinite(Number(sourceAmount)) ? _nullishCoalesce(_chunkNPSC5R22cjs.formatTokenAmount.call(void 0, Number(sourceAmount), token.symbol), () => ( "0")) : "0";
|
|
4202
4260
|
const receiveDisplay = (() => {
|
|
4203
4261
|
const usdValue = Number(targetAmount);
|
|
4204
4262
|
const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
|
|
4205
|
-
const estimate =
|
|
4263
|
+
const estimate = _chunkNPSC5R22cjs.formatReceiveEstimate.call(void 0, {
|
|
4206
4264
|
sourceAmount: Number.isFinite(Number(sourceAmount)) ? Number(sourceAmount) : void 0,
|
|
4207
4265
|
sourceSymbol: token.symbol,
|
|
4208
4266
|
targetSymbol,
|
|
4209
4267
|
sourceAmountUsd,
|
|
4210
|
-
sourceTrusted:
|
|
4268
|
+
sourceTrusted: _chunkNPSC5R22cjs.isRecognizedToken.call(void 0, token.mint, "solana"),
|
|
4211
4269
|
// Curated stablecoin target estimates at $1 when unquoted; never applied
|
|
4212
4270
|
// to the source (a held token). See ConfirmStep for the rationale.
|
|
4213
|
-
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } :
|
|
4271
|
+
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : _chunkNPSC5R22cjs.isDisplayStablecoinSymbol.call(void 0, targetSymbol) ? { [targetSymbol.toUpperCase()]: 1 } : {}
|
|
4214
4272
|
});
|
|
4215
4273
|
if (estimate !== void 0) return estimate;
|
|
4216
4274
|
return targetSymbol;
|
|
4217
4275
|
})();
|
|
4218
4276
|
const handleConfirm = async () => {
|
|
4219
4277
|
if (!solanaProvider) {
|
|
4220
|
-
|
|
4278
|
+
_chunkNPSC5R22cjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
4221
4279
|
reason: "missing-provider"
|
|
4222
4280
|
});
|
|
4223
4281
|
setError("Solana wallet not connected");
|
|
@@ -4225,7 +4283,7 @@ function SolanaConfirmStep({
|
|
|
4225
4283
|
}
|
|
4226
4284
|
const parsedAmount = parseFloat(sourceAmount);
|
|
4227
4285
|
if (isNaN(parsedAmount) || parsedAmount <= 0) {
|
|
4228
|
-
|
|
4286
|
+
_chunkNPSC5R22cjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
4229
4287
|
reason: "invalid-amount",
|
|
4230
4288
|
sourceAmount
|
|
4231
4289
|
});
|
|
@@ -4234,7 +4292,7 @@ function SolanaConfirmStep({
|
|
|
4234
4292
|
}
|
|
4235
4293
|
setError(null);
|
|
4236
4294
|
setIsSubmitting(true);
|
|
4237
|
-
|
|
4295
|
+
_chunkNPSC5R22cjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
|
|
4238
4296
|
smartAccount,
|
|
4239
4297
|
solanaAddress,
|
|
4240
4298
|
solanaDepositAddress,
|
|
@@ -4244,7 +4302,7 @@ function SolanaConfirmStep({
|
|
|
4244
4302
|
});
|
|
4245
4303
|
try {
|
|
4246
4304
|
const check = await service.checkAccount(smartAccount);
|
|
4247
|
-
|
|
4305
|
+
_chunkNPSC5R22cjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
|
|
4248
4306
|
smartAccount,
|
|
4249
4307
|
isRegistered: check.isRegistered,
|
|
4250
4308
|
targetChain: check.targetChain,
|
|
@@ -4257,12 +4315,12 @@ function SolanaConfirmStep({
|
|
|
4257
4315
|
}
|
|
4258
4316
|
const connection = hasConfiguredSolanaRpcUrl(rpcUrls) ? getSolanaConnection(rpcUrls) : _nullishCoalesce(solanaConnection, () => ( getSolanaConnection(rpcUrls)));
|
|
4259
4317
|
const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
|
|
4260
|
-
|
|
4318
|
+
_chunkNPSC5R22cjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
|
|
4261
4319
|
token: token.symbol,
|
|
4262
4320
|
sourceAmount,
|
|
4263
4321
|
amountUnits: amountUnits.toString()
|
|
4264
4322
|
});
|
|
4265
|
-
const transaction =
|
|
4323
|
+
const transaction = _chunkTENL4H64cjs.isNativeSol.call(void 0, token) ? await buildSolTransferTransaction(
|
|
4266
4324
|
connection,
|
|
4267
4325
|
solanaAddress,
|
|
4268
4326
|
solanaDepositAddress,
|
|
@@ -4274,10 +4332,10 @@ function SolanaConfirmStep({
|
|
|
4274
4332
|
token.mint,
|
|
4275
4333
|
amountUnits
|
|
4276
4334
|
);
|
|
4277
|
-
|
|
4335
|
+
_chunkNPSC5R22cjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
4278
4336
|
token: token.symbol,
|
|
4279
4337
|
instructionCount: transaction.instructions.length,
|
|
4280
|
-
feePayer: _optionalChain([transaction, 'access',
|
|
4338
|
+
feePayer: _optionalChain([transaction, 'access', _147 => _147.feePayer, 'optionalAccess', _148 => _148.toBase58, 'call', _149 => _149()]),
|
|
4281
4339
|
recentBlockhash: transaction.recentBlockhash
|
|
4282
4340
|
});
|
|
4283
4341
|
const txHash = await sendSolanaTransaction(
|
|
@@ -4285,7 +4343,7 @@ function SolanaConfirmStep({
|
|
|
4285
4343
|
connection,
|
|
4286
4344
|
transaction
|
|
4287
4345
|
);
|
|
4288
|
-
|
|
4346
|
+
_chunkNPSC5R22cjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
|
|
4289
4347
|
txHash,
|
|
4290
4348
|
amountUnits: amountUnits.toString()
|
|
4291
4349
|
});
|
|
@@ -4297,34 +4355,34 @@ function SolanaConfirmStep({
|
|
|
4297
4355
|
});
|
|
4298
4356
|
} catch (err) {
|
|
4299
4357
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
4300
|
-
const message =
|
|
4301
|
-
|
|
4358
|
+
const message = _chunkNPSC5R22cjs.formatUserError.call(void 0, raw);
|
|
4359
|
+
_chunkNPSC5R22cjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
|
|
4302
4360
|
smartAccount,
|
|
4303
4361
|
token: token.symbol,
|
|
4304
4362
|
sourceAmount
|
|
4305
4363
|
});
|
|
4306
4364
|
setError(message);
|
|
4307
|
-
_optionalChain([onError, 'optionalCall',
|
|
4365
|
+
_optionalChain([onError, 'optionalCall', _150 => _150(message, "SOLANA_TRANSFER_ERROR")]);
|
|
4308
4366
|
} finally {
|
|
4309
4367
|
setIsSubmitting(false);
|
|
4310
4368
|
}
|
|
4311
4369
|
};
|
|
4312
4370
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
4313
4371
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4314
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4372
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.WalletIcon, {}), title: "Review deposit" }),
|
|
4315
4373
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
|
|
4316
4374
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
4317
4375
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
4318
4376
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
4319
4377
|
/* @__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,
|
|
4378
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CdnIcon, { src: sourceChainIcon }) })
|
|
4321
4379
|
] })
|
|
4322
4380
|
] }),
|
|
4323
4381
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
4324
4382
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
|
|
4325
4383
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
4326
4384
|
/* @__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,
|
|
4385
|
+
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CdnIcon, { src: targetChainIcon }) })
|
|
4328
4386
|
] })
|
|
4329
4387
|
] }),
|
|
4330
4388
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -4339,14 +4397,14 @@ function SolanaConfirmStep({
|
|
|
4339
4397
|
" ",
|
|
4340
4398
|
token.symbol
|
|
4341
4399
|
] }),
|
|
4342
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4400
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.TokenIcon, { symbol: token.symbol }) })
|
|
4343
4401
|
] })
|
|
4344
4402
|
] }),
|
|
4345
4403
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
4346
4404
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Receive" }),
|
|
4347
4405
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
4348
4406
|
/* @__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,
|
|
4407
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.TokenIcon, { symbol: targetSymbol }) })
|
|
4350
4408
|
] })
|
|
4351
4409
|
] }),
|
|
4352
4410
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -4359,13 +4417,13 @@ function SolanaConfirmStep({
|
|
|
4359
4417
|
children: "$0.04"
|
|
4360
4418
|
}
|
|
4361
4419
|
),
|
|
4362
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4420
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHCQWFL3Acjs.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, _chunkNPSC5R22cjs.InfoIcon, {}) }) })
|
|
4363
4421
|
] })
|
|
4364
4422
|
] })
|
|
4365
4423
|
] }),
|
|
4366
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4424
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.Callout, { variant: "error", children: error }),
|
|
4367
4425
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4368
|
-
|
|
4426
|
+
_chunkNPSC5R22cjs.Button,
|
|
4369
4427
|
{
|
|
4370
4428
|
onClick: handleConfirm,
|
|
4371
4429
|
loading: isSubmitting,
|
|
@@ -4376,7 +4434,7 @@ function SolanaConfirmStep({
|
|
|
4376
4434
|
}
|
|
4377
4435
|
)
|
|
4378
4436
|
] }),
|
|
4379
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4437
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.PoweredBy, {})
|
|
4380
4438
|
] });
|
|
4381
4439
|
}
|
|
4382
4440
|
|
|
@@ -4385,26 +4443,28 @@ function SolanaConfirmStep({
|
|
|
4385
4443
|
function DappImportAssetSelectStep({
|
|
4386
4444
|
sourceLabel,
|
|
4387
4445
|
assets,
|
|
4446
|
+
incompleteSummary,
|
|
4388
4447
|
onSelect
|
|
4389
4448
|
}) {
|
|
4390
4449
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
4391
4450
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4392
4451
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4393
|
-
|
|
4452
|
+
_chunkNPSC5R22cjs.BodyHeader,
|
|
4394
4453
|
{
|
|
4395
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4454
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.WalletIcon, {}),
|
|
4396
4455
|
title: `Transfer from ${sourceLabel}`,
|
|
4397
4456
|
subtitle: "Pick the balance to import"
|
|
4398
4457
|
}
|
|
4399
4458
|
),
|
|
4459
|
+
incompleteSummary && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-notice", role: "status", children: incompleteSummary }),
|
|
4400
4460
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: assets.map((asset) => {
|
|
4401
|
-
const tokenAmount = asset.balance ?
|
|
4461
|
+
const tokenAmount = asset.balance ? _chunkNPSC5R22cjs.tokenFormatter.format(
|
|
4402
4462
|
Number(asset.balance) / 10 ** asset.decimals
|
|
4403
4463
|
) : "0";
|
|
4404
|
-
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ?
|
|
4464
|
+
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ? _chunkNPSC5R22cjs.currencyFormatter.format(asset.balanceUsd) : `${tokenAmount} ${asset.symbol}`;
|
|
4405
4465
|
const assetIcon = asset.icon;
|
|
4406
|
-
const chainIcon =
|
|
4407
|
-
const badge =
|
|
4466
|
+
const chainIcon = _chunkTENL4H64cjs.getChainIcon.call(void 0, asset.chainId);
|
|
4467
|
+
const badge = _chunkTENL4H64cjs.getChainBadge.call(void 0, asset.chainId);
|
|
4408
4468
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4409
4469
|
"button",
|
|
4410
4470
|
{
|
|
@@ -4414,14 +4474,14 @@ function DappImportAssetSelectStep({
|
|
|
4414
4474
|
children: [
|
|
4415
4475
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
|
|
4416
4476
|
/* @__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
|
-
|
|
4477
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: assetIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CdnIcon, { src: assetIcon, alt: asset.symbol }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4478
|
+
_chunkNPSC5R22cjs.TokenIcon,
|
|
4419
4479
|
{
|
|
4420
4480
|
symbol: asset.symbol,
|
|
4421
4481
|
fallback: asset.symbol.slice(0, 4)
|
|
4422
4482
|
}
|
|
4423
4483
|
) }),
|
|
4424
|
-
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4484
|
+
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CdnIcon, { src: chainIcon, alt: _chunkTENL4H64cjs.getChainName.call(void 0, asset.chainId) }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4425
4485
|
"span",
|
|
4426
4486
|
{
|
|
4427
4487
|
className: "rs-asset-chain-badge",
|
|
@@ -4435,7 +4495,8 @@ function DappImportAssetSelectStep({
|
|
|
4435
4495
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-name", children: asset.symbol }),
|
|
4436
4496
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-asset-chain", children: [
|
|
4437
4497
|
"on ",
|
|
4438
|
-
asset.sourceLabel
|
|
4498
|
+
asset.sourceLabel,
|
|
4499
|
+
asset.qualifier ? ` \xB7 ${asset.qualifier}` : ""
|
|
4439
4500
|
] })
|
|
4440
4501
|
] }),
|
|
4441
4502
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-balance-small", children: [
|
|
@@ -4452,7 +4513,7 @@ function DappImportAssetSelectStep({
|
|
|
4452
4513
|
);
|
|
4453
4514
|
}) })
|
|
4454
4515
|
] }),
|
|
4455
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4516
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.PoweredBy, {})
|
|
4456
4517
|
] });
|
|
4457
4518
|
}
|
|
4458
4519
|
DappImportAssetSelectStep.displayName = "DappImportAssetSelectStep";
|
|
@@ -4474,7 +4535,7 @@ function describeRow(status, comingSoon) {
|
|
|
4474
4535
|
}
|
|
4475
4536
|
if (status.enabled) {
|
|
4476
4537
|
return {
|
|
4477
|
-
subtitle: status.balanceUsd > 0 ?
|
|
4538
|
+
subtitle: status.balanceUsd > 0 ? _chunkNPSC5R22cjs.currencyFormatter.format(status.balanceUsd) : "No balance",
|
|
4478
4539
|
disabled: false,
|
|
4479
4540
|
busy: false
|
|
4480
4541
|
};
|
|
@@ -4497,9 +4558,9 @@ function DappImportSelectStep({
|
|
|
4497
4558
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
4498
4559
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4499
4560
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4500
|
-
|
|
4561
|
+
_chunkNPSC5R22cjs.BodyHeader,
|
|
4501
4562
|
{
|
|
4502
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4563
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.MigrateAssetsIcon, {}),
|
|
4503
4564
|
title: "Migrate assets",
|
|
4504
4565
|
subtitle: "Select a position to migrate"
|
|
4505
4566
|
}
|
|
@@ -4511,16 +4572,16 @@ function DappImportSelectStep({
|
|
|
4511
4572
|
Boolean(brand.comingSoon)
|
|
4512
4573
|
);
|
|
4513
4574
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4514
|
-
|
|
4575
|
+
_chunkJYKMR6QIcjs.ListRow,
|
|
4515
4576
|
{
|
|
4516
4577
|
leadingMedia: brand.iconUrl,
|
|
4517
4578
|
title: brand.label,
|
|
4518
4579
|
subtitle,
|
|
4519
4580
|
disabled,
|
|
4520
|
-
trailing: busy ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4581
|
+
trailing: busy ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.Spinner, { className: "rs-spinner--sm" }) : void 0,
|
|
4521
4582
|
onClick: () => {
|
|
4522
4583
|
if (status === "needs-connect") {
|
|
4523
|
-
_optionalChain([onRequestConnect, 'optionalCall',
|
|
4584
|
+
_optionalChain([onRequestConnect, 'optionalCall', _151 => _151()]);
|
|
4524
4585
|
return;
|
|
4525
4586
|
}
|
|
4526
4587
|
onSelect(brand.id);
|
|
@@ -4530,7 +4591,7 @@ function DappImportSelectStep({
|
|
|
4530
4591
|
);
|
|
4531
4592
|
}) })
|
|
4532
4593
|
] }),
|
|
4533
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4594
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.PoweredBy, {})
|
|
4534
4595
|
] });
|
|
4535
4596
|
}
|
|
4536
4597
|
DappImportSelectStep.displayName = "DappImportSelectStep";
|
|
@@ -4547,9 +4608,9 @@ function DappImportAssetSelectSkeleton({
|
|
|
4547
4608
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: error ? "Couldn't load balances" : "Loading balances\u2026" }),
|
|
4548
4609
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4549
4610
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4550
|
-
|
|
4611
|
+
_chunkNPSC5R22cjs.BodyHeader,
|
|
4551
4612
|
{
|
|
4552
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4613
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.WalletIcon, {}),
|
|
4553
4614
|
title: `Transfer from ${sourceLabel}`,
|
|
4554
4615
|
subtitle: "Pick the balance to import"
|
|
4555
4616
|
}
|
|
@@ -4587,7 +4648,7 @@ function DappImportAssetSelectSkeleton({
|
|
|
4587
4648
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Try again" })
|
|
4588
4649
|
}
|
|
4589
4650
|
) }),
|
|
4590
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4651
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.PoweredBy, {})
|
|
4591
4652
|
] });
|
|
4592
4653
|
}
|
|
4593
4654
|
DappImportAssetSelectSkeleton.displayName = "DappImportAssetSelectSkeleton";
|
|
@@ -4649,6 +4710,188 @@ function composeFiatMethods(regional, fallbackMethods) {
|
|
|
4649
4710
|
};
|
|
4650
4711
|
}
|
|
4651
4712
|
|
|
4713
|
+
// src/core/dapp-imports/balance-source.ts
|
|
4714
|
+
function dappImportBalanceSource(asset) {
|
|
4715
|
+
if (!isDappImportAsset(asset)) return {};
|
|
4716
|
+
if (asset.balanceAddress) return { balanceAddress: asset.balanceAddress };
|
|
4717
|
+
if (asset.balance === void 0) return {};
|
|
4718
|
+
try {
|
|
4719
|
+
return { declaredBalance: BigInt(asset.balance) };
|
|
4720
|
+
} catch (e30) {
|
|
4721
|
+
return {};
|
|
4722
|
+
}
|
|
4723
|
+
}
|
|
4724
|
+
|
|
4725
|
+
// src/core/dapp-imports/aave/index.ts
|
|
4726
|
+
var PROVIDER_ID = "aave";
|
|
4727
|
+
var SOURCE_LABEL = "Aave";
|
|
4728
|
+
var POLICY_REFUSED = [
|
|
4729
|
+
"below_deposit_floor",
|
|
4730
|
+
"deposit_not_whitelisted"
|
|
4731
|
+
];
|
|
4732
|
+
var aaveProvider = {
|
|
4733
|
+
id: PROVIDER_ID,
|
|
4734
|
+
sourceLabel: SOURCE_LABEL,
|
|
4735
|
+
async fetchAvailability({ eoa, backend, signal }) {
|
|
4736
|
+
if (!backend) {
|
|
4737
|
+
throw new Error("Aave positions require a backend connection");
|
|
4738
|
+
}
|
|
4739
|
+
const response = await backend.getPositions(eoa);
|
|
4740
|
+
if (_optionalChain([signal, 'optionalAccess', _152 => _152.aborted])) return null;
|
|
4741
|
+
const assets = toImportableAssets(response.positions);
|
|
4742
|
+
const failures = _nullishCoalesce(response.failures, () => ( []));
|
|
4743
|
+
if (assets.length === 0) {
|
|
4744
|
+
if (failures.length > 0) {
|
|
4745
|
+
throw new Error(
|
|
4746
|
+
`Could not read Aave positions: ${failures.map((failure) => failure.reason).join("; ")}`
|
|
4747
|
+
);
|
|
4748
|
+
}
|
|
4749
|
+
return null;
|
|
4750
|
+
}
|
|
4751
|
+
const availability = {
|
|
4752
|
+
providerId: PROVIDER_ID,
|
|
4753
|
+
// Deliberately the sum over importable assets rather than
|
|
4754
|
+
// `response.totalUsd`: the latter counts positions this flow filters out,
|
|
4755
|
+
// so using it would show a balance the user then cannot find.
|
|
4756
|
+
totalUsd: assets.reduce((sum, asset) => sum + (_nullishCoalesce(asset.balanceUsd, () => ( 0))), 0),
|
|
4757
|
+
assets,
|
|
4758
|
+
// Some markets read, some did not. Erroring would discard positions the
|
|
4759
|
+
// user can migrate right now — and with ~29 markets on a keyless API, one
|
|
4760
|
+
// failing is the expected case, so erroring would be the normal outcome.
|
|
4761
|
+
// The list therefore stands, marked as a floor. The upstream reason names
|
|
4762
|
+
// an internal market, so it is summarised rather than surfaced.
|
|
4763
|
+
...failures.length > 0 ? {
|
|
4764
|
+
incomplete: {
|
|
4765
|
+
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.`
|
|
4766
|
+
}
|
|
4767
|
+
} : {}
|
|
4768
|
+
};
|
|
4769
|
+
return availability;
|
|
4770
|
+
},
|
|
4771
|
+
async executeTransfer({ walletClient, recipient, asset, amount, backend }) {
|
|
4772
|
+
if (!backend) {
|
|
4773
|
+
throw new Error("Aave withdrawals require a backend connection");
|
|
4774
|
+
}
|
|
4775
|
+
const metadata = asset.providerMetadata;
|
|
4776
|
+
const account = walletClient.account;
|
|
4777
|
+
const chain = walletClient.chain;
|
|
4778
|
+
if (!account || !chain) {
|
|
4779
|
+
throw new Error("Wallet not connected");
|
|
4780
|
+
}
|
|
4781
|
+
if (chain.id !== metadata.chainId) {
|
|
4782
|
+
throw new Error(
|
|
4783
|
+
`Switch to ${metadata.marketName} chain (${metadata.chainId}) to sign`
|
|
4784
|
+
);
|
|
4785
|
+
}
|
|
4786
|
+
const prepared = await backend.prepareUnwind({
|
|
4787
|
+
address: account.address,
|
|
4788
|
+
// The backend resolves the recipient from this account rather than
|
|
4789
|
+
// trusting a supplied address. `amount` is always explicit — expressing
|
|
4790
|
+
// "everything" is the backend's call, since only it knows whether sweeping
|
|
4791
|
+
// accrued interest could push the delivered amount past a whitelist
|
|
4792
|
+
// ceiling and get the proceeds rejected after the withdraw succeeded.
|
|
4793
|
+
account: recipient,
|
|
4794
|
+
market: metadata.market,
|
|
4795
|
+
chainId: metadata.chainId,
|
|
4796
|
+
asset: metadata.asset,
|
|
4797
|
+
amount: amount.toString()
|
|
4798
|
+
});
|
|
4799
|
+
if (prepared.recipient.toLowerCase() !== recipient.toLowerCase()) {
|
|
4800
|
+
throw new Error(
|
|
4801
|
+
"Aave withdrawal would send funds to an unexpected address"
|
|
4802
|
+
);
|
|
4803
|
+
}
|
|
4804
|
+
if (prepared.transaction.chainId !== metadata.chainId) {
|
|
4805
|
+
throw new Error("Aave withdrawal was prepared for a different chain");
|
|
4806
|
+
}
|
|
4807
|
+
const txHash = await walletClient.sendTransaction({
|
|
4808
|
+
account,
|
|
4809
|
+
chain,
|
|
4810
|
+
to: prepared.transaction.to,
|
|
4811
|
+
data: prepared.transaction.data,
|
|
4812
|
+
value: BigInt(prepared.transaction.value)
|
|
4813
|
+
});
|
|
4814
|
+
return {
|
|
4815
|
+
txHash,
|
|
4816
|
+
// Aave pays out the underlying straight to the deposit address — no
|
|
4817
|
+
// unwrap, no swap, so what arrives is what was supplied.
|
|
4818
|
+
sourceToken: metadata.asset,
|
|
4819
|
+
sourceSymbol: asset.symbol,
|
|
4820
|
+
sourceDecimals: asset.decimals
|
|
4821
|
+
};
|
|
4822
|
+
}
|
|
4823
|
+
};
|
|
4824
|
+
function toImportableAssets(positions) {
|
|
4825
|
+
const assets = [];
|
|
4826
|
+
for (const position of positions) {
|
|
4827
|
+
const chainId = _chunkTENL4H64cjs.parseEvmChainId.call(void 0, position.chain);
|
|
4828
|
+
if (chainId === null) continue;
|
|
4829
|
+
if (!_chunkTENL4H64cjs.CHAIN_BY_ID[chainId]) continue;
|
|
4830
|
+
if (BigInt(position.maxWithdrawable) <= 0n) continue;
|
|
4831
|
+
if (position.constraints.some((c) => POLICY_REFUSED.includes(c))) continue;
|
|
4832
|
+
assets.push(buildAsset(position, chainId));
|
|
4833
|
+
}
|
|
4834
|
+
return qualifyAmbiguousMarkets(assets);
|
|
4835
|
+
}
|
|
4836
|
+
function buildAsset(position, chainId) {
|
|
4837
|
+
const { asset, market } = position;
|
|
4838
|
+
const token = asset.address.toLowerCase();
|
|
4839
|
+
const metadata = {
|
|
4840
|
+
market: market.address,
|
|
4841
|
+
marketName: market.name,
|
|
4842
|
+
chainId,
|
|
4843
|
+
asset: asset.address
|
|
4844
|
+
};
|
|
4845
|
+
return {
|
|
4846
|
+
// Market-keyed, so one chain holding the same token in two markets yields
|
|
4847
|
+
// two distinct rows rather than one that silently shadows the other.
|
|
4848
|
+
id: `aave:${chainId}:${market.address.toLowerCase()}:${token}`,
|
|
4849
|
+
chainId,
|
|
4850
|
+
token,
|
|
4851
|
+
symbol: asset.symbol,
|
|
4852
|
+
// The market name, not a token description: it is what tells four Aave v3
|
|
4853
|
+
// markets on Ethereum apart.
|
|
4854
|
+
name: market.name,
|
|
4855
|
+
decimals: asset.decimals,
|
|
4856
|
+
// `maxWithdrawable`, NOT the supplied balance. The amount selector lets the
|
|
4857
|
+
// user pick up to this, and seeding it with the supplied balance would let
|
|
4858
|
+
// them choose above the cap and sign a withdraw the pool rejects.
|
|
4859
|
+
balance: position.maxWithdrawable,
|
|
4860
|
+
balanceUsd: withdrawableUsd(position),
|
|
4861
|
+
source: PROVIDER_ID,
|
|
4862
|
+
sourceLabel: SOURCE_LABEL,
|
|
4863
|
+
reviewLabel: `You withdraw ${asset.symbol} from Aave`,
|
|
4864
|
+
// Aave sends the underlying itself to the deposit address, so the token the
|
|
4865
|
+
// orchestrator sees land is the same one and on the same chain.
|
|
4866
|
+
depositToken: token,
|
|
4867
|
+
depositChainId: chainId,
|
|
4868
|
+
providerMetadata: metadata
|
|
4869
|
+
};
|
|
4870
|
+
}
|
|
4871
|
+
function qualifyAmbiguousMarkets(assets) {
|
|
4872
|
+
const counts = /* @__PURE__ */ new Map();
|
|
4873
|
+
for (const asset of assets) {
|
|
4874
|
+
const key = `${asset.chainId}:${asset.token}`;
|
|
4875
|
+
counts.set(key, (_nullishCoalesce(counts.get(key), () => ( 0))) + 1);
|
|
4876
|
+
}
|
|
4877
|
+
return assets.map(
|
|
4878
|
+
(asset) => (_nullishCoalesce(counts.get(`${asset.chainId}:${asset.token}`), () => ( 0))) > 1 ? {
|
|
4879
|
+
...asset,
|
|
4880
|
+
qualifier: asset.providerMetadata.marketName
|
|
4881
|
+
} : asset
|
|
4882
|
+
);
|
|
4883
|
+
}
|
|
4884
|
+
function withdrawableUsd(position) {
|
|
4885
|
+
const amount = BigInt(position.amount);
|
|
4886
|
+
const withdrawable = BigInt(position.maxWithdrawable);
|
|
4887
|
+
if (amount === 0n) return 0;
|
|
4888
|
+
if (withdrawable === amount) return position.usdValue;
|
|
4889
|
+
const SCALE = 1000000n;
|
|
4890
|
+
const ratio = Number(withdrawable * SCALE / amount) / Number(SCALE);
|
|
4891
|
+
const usd = position.usdValue * ratio;
|
|
4892
|
+
return Number.isFinite(usd) ? usd : 0;
|
|
4893
|
+
}
|
|
4894
|
+
|
|
4652
4895
|
// src/core/dapp-imports/polymarket/index.ts
|
|
4653
4896
|
|
|
4654
4897
|
|
|
@@ -4700,7 +4943,7 @@ async function detectPolymarketWalletKind(params) {
|
|
|
4700
4943
|
contracts: [
|
|
4701
4944
|
{
|
|
4702
4945
|
address: proxyWallet,
|
|
4703
|
-
abi:
|
|
4946
|
+
abi: _chunkJPRV36DTcjs.SAFE_ABI,
|
|
4704
4947
|
functionName: "isOwner",
|
|
4705
4948
|
args: [eoa]
|
|
4706
4949
|
},
|
|
@@ -4733,7 +4976,7 @@ async function buildSignedDepositWalletBatch(params) {
|
|
|
4733
4976
|
if (!account || !chain) {
|
|
4734
4977
|
throw new Error("Wallet not connected");
|
|
4735
4978
|
}
|
|
4736
|
-
if (chain.id !==
|
|
4979
|
+
if (chain.id !== _chunkJPRV36DTcjs.POLYMARKET_POLYGON_CHAIN_ID) {
|
|
4737
4980
|
throw new Error("Switch to Polygon to sign");
|
|
4738
4981
|
}
|
|
4739
4982
|
const owner = await publicClient.readContract({
|
|
@@ -4778,14 +5021,14 @@ async function buildSignedDepositWalletBatch(params) {
|
|
|
4778
5021
|
})),
|
|
4779
5022
|
signature
|
|
4780
5023
|
},
|
|
4781
|
-
sourceToken:
|
|
5024
|
+
sourceToken: _chunkJPRV36DTcjs.POLYMARKET_USDCE_ADDRESS,
|
|
4782
5025
|
sourceSymbol: tokenKind === "pusd" ? "pUSD" : "USDC.e"
|
|
4783
5026
|
};
|
|
4784
5027
|
}
|
|
4785
5028
|
function buildUsdceTransferCalls(recipient, amount) {
|
|
4786
5029
|
return [
|
|
4787
5030
|
{
|
|
4788
|
-
target:
|
|
5031
|
+
target: _chunkJPRV36DTcjs.POLYMARKET_USDCE_ADDRESS,
|
|
4789
5032
|
value: 0n,
|
|
4790
5033
|
data: _viem.encodeFunctionData.call(void 0, {
|
|
4791
5034
|
abi: _viem.erc20Abi,
|
|
@@ -4798,65 +5041,64 @@ function buildUsdceTransferCalls(recipient, amount) {
|
|
|
4798
5041
|
function buildPusdUnwrapCalls(recipient, amount) {
|
|
4799
5042
|
return [
|
|
4800
5043
|
{
|
|
4801
|
-
target:
|
|
5044
|
+
target: _chunkJPRV36DTcjs.POLYMARKET_PUSD_ADDRESS,
|
|
4802
5045
|
value: 0n,
|
|
4803
5046
|
data: _viem.encodeFunctionData.call(void 0, {
|
|
4804
5047
|
abi: _viem.erc20Abi,
|
|
4805
5048
|
functionName: "approve",
|
|
4806
|
-
args: [
|
|
5049
|
+
args: [_chunkJPRV36DTcjs.POLYMARKET_COLLATERAL_OFFRAMP_ADDRESS, amount]
|
|
4807
5050
|
})
|
|
4808
5051
|
},
|
|
4809
5052
|
{
|
|
4810
|
-
target:
|
|
5053
|
+
target: _chunkJPRV36DTcjs.POLYMARKET_COLLATERAL_OFFRAMP_ADDRESS,
|
|
4811
5054
|
value: 0n,
|
|
4812
5055
|
data: _viem.encodeFunctionData.call(void 0, {
|
|
4813
5056
|
abi: COLLATERAL_OFFRAMP_ABI,
|
|
4814
5057
|
functionName: "unwrap",
|
|
4815
|
-
args: [
|
|
5058
|
+
args: [_chunkJPRV36DTcjs.POLYMARKET_USDCE_ADDRESS, recipient, amount]
|
|
4816
5059
|
})
|
|
4817
5060
|
}
|
|
4818
5061
|
];
|
|
4819
5062
|
}
|
|
4820
5063
|
|
|
4821
5064
|
// src/core/dapp-imports/polymarket/index.ts
|
|
4822
|
-
var
|
|
5065
|
+
var PROVIDER_ID2 = "polymarket";
|
|
4823
5066
|
var polymarketProvider = {
|
|
4824
|
-
id:
|
|
5067
|
+
id: PROVIDER_ID2,
|
|
4825
5068
|
sourceLabel: "Polymarket",
|
|
4826
|
-
chainId: _chunkYEBXUUH3cjs.POLYMARKET_POLYGON_CHAIN_ID,
|
|
4827
5069
|
async fetchAvailability({ eoa, getPublicClient: getPublicClient2, signal }) {
|
|
4828
|
-
const proxyWallet = await
|
|
5070
|
+
const proxyWallet = await _chunkJPRV36DTcjs.fetchPolymarketProxyWallet.call(void 0, eoa, signal);
|
|
4829
5071
|
if (!proxyWallet) return null;
|
|
4830
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
4831
|
-
const polygonClient = getPublicClient2(
|
|
5072
|
+
if (_optionalChain([signal, 'optionalAccess', _153 => _153.aborted])) return null;
|
|
5073
|
+
const polygonClient = getPublicClient2(_chunkJPRV36DTcjs.POLYMARKET_POLYGON_CHAIN_ID);
|
|
4832
5074
|
if (!polygonClient) return null;
|
|
4833
|
-
const balances = await
|
|
5075
|
+
const balances = await _chunkJPRV36DTcjs.readPolymarketBalances.call(void 0, {
|
|
4834
5076
|
publicClient: polygonClient,
|
|
4835
5077
|
proxyWallet
|
|
4836
5078
|
});
|
|
4837
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
5079
|
+
if (_optionalChain([signal, 'optionalAccess', _154 => _154.aborted])) return null;
|
|
4838
5080
|
if (balances.pusd === 0n && balances.usdce === 0n) return null;
|
|
4839
5081
|
const walletKind = await detectPolymarketWalletKind({
|
|
4840
5082
|
publicClient: polygonClient,
|
|
4841
5083
|
proxyWallet,
|
|
4842
5084
|
eoa
|
|
4843
5085
|
});
|
|
4844
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
5086
|
+
if (_optionalChain([signal, 'optionalAccess', _155 => _155.aborted])) return null;
|
|
4845
5087
|
if (!walletKind) return null;
|
|
4846
5088
|
const assets = [];
|
|
4847
5089
|
if (balances.pusd > 0n) {
|
|
4848
5090
|
assets.push(
|
|
4849
|
-
|
|
5091
|
+
buildAsset2({ tokenKind: "pusd", proxyWallet, walletKind, balance: balances.pusd })
|
|
4850
5092
|
);
|
|
4851
5093
|
}
|
|
4852
5094
|
if (balances.usdce > 0n) {
|
|
4853
5095
|
assets.push(
|
|
4854
|
-
|
|
5096
|
+
buildAsset2({ tokenKind: "usdce", proxyWallet, walletKind, balance: balances.usdce })
|
|
4855
5097
|
);
|
|
4856
5098
|
}
|
|
4857
5099
|
const totalUsd = assets.reduce((sum, a) => sum + (_nullishCoalesce(a.balanceUsd, () => ( 0))), 0);
|
|
4858
5100
|
const availability = {
|
|
4859
|
-
providerId:
|
|
5101
|
+
providerId: PROVIDER_ID2,
|
|
4860
5102
|
totalUsd,
|
|
4861
5103
|
assets
|
|
4862
5104
|
};
|
|
@@ -4888,7 +5130,7 @@ var polymarketProvider = {
|
|
|
4888
5130
|
const { txHash } = await backend.submitPolymarketWithdraw(payload);
|
|
4889
5131
|
return { txHash, sourceToken, sourceSymbol, sourceDecimals: 6 };
|
|
4890
5132
|
}
|
|
4891
|
-
const result = await
|
|
5133
|
+
const result = await _chunkJPRV36DTcjs.executePolymarketSafeTransfer.call(void 0, {
|
|
4892
5134
|
walletClient,
|
|
4893
5135
|
publicClient,
|
|
4894
5136
|
safeAddress: metadata.proxyWallet,
|
|
@@ -4904,37 +5146,43 @@ var polymarketProvider = {
|
|
|
4904
5146
|
};
|
|
4905
5147
|
}
|
|
4906
5148
|
};
|
|
4907
|
-
function
|
|
5149
|
+
function buildAsset2(params) {
|
|
4908
5150
|
const { tokenKind, proxyWallet, walletKind, balance } = params;
|
|
4909
5151
|
const isPusd = tokenKind === "pusd";
|
|
4910
|
-
const tokenAddress = isPusd ?
|
|
5152
|
+
const tokenAddress = isPusd ? _chunkJPRV36DTcjs.POLYMARKET_PUSD_ADDRESS : _chunkJPRV36DTcjs.POLYMARKET_USDCE_ADDRESS;
|
|
4911
5153
|
const symbol = isPusd ? "pUSD" : "USDC.e";
|
|
4912
5154
|
const balanceUsd = Number(_viem.formatUnits.call(void 0, balance, 6));
|
|
4913
5155
|
const metadata = { proxyWallet, tokenKind, walletKind };
|
|
4914
5156
|
return {
|
|
4915
5157
|
id: `polymarket:${tokenKind}`,
|
|
4916
|
-
chainId:
|
|
5158
|
+
chainId: _chunkJPRV36DTcjs.POLYMARKET_POLYGON_CHAIN_ID,
|
|
4917
5159
|
token: tokenAddress,
|
|
4918
5160
|
symbol,
|
|
4919
5161
|
name: isPusd ? "Polymarket USD" : "Polygon USDC.e",
|
|
4920
|
-
icon: isPusd ?
|
|
5162
|
+
icon: isPusd ? _chunkJPRV36DTcjs.POLYMARKET_ICON_URL : void 0,
|
|
4921
5163
|
decimals: 6,
|
|
4922
5164
|
balance: balance.toString(),
|
|
4923
5165
|
balanceUsd: Number.isFinite(balanceUsd) ? balanceUsd : 0,
|
|
4924
|
-
source:
|
|
5166
|
+
source: PROVIDER_ID2,
|
|
4925
5167
|
sourceLabel: "Polymarket",
|
|
5168
|
+
// The proxy wallet really does hold this ERC-20, so the amount step reads it
|
|
5169
|
+
// live rather than trusting the figure from the availability fetch.
|
|
5170
|
+
balanceAddress: proxyWallet,
|
|
4926
5171
|
reviewLabel: isPusd ? "You send pUSD from Polymarket" : "You send USDC.e from Polymarket",
|
|
4927
5172
|
// pUSD unwraps to USDC.e via the offramp; USDC.e is what actually
|
|
4928
5173
|
// arrives at the smart account, so it's also what the orchestrator
|
|
4929
5174
|
// bridges from.
|
|
4930
|
-
depositToken:
|
|
4931
|
-
depositChainId:
|
|
5175
|
+
depositToken: _chunkJPRV36DTcjs.POLYMARKET_USDCE_ADDRESS,
|
|
5176
|
+
depositChainId: _chunkJPRV36DTcjs.POLYMARKET_POLYGON_CHAIN_ID,
|
|
4932
5177
|
providerMetadata: metadata
|
|
4933
5178
|
};
|
|
4934
5179
|
}
|
|
4935
5180
|
|
|
4936
5181
|
// src/core/dapp-imports/registry.ts
|
|
4937
|
-
var DAPP_IMPORT_PROVIDERS = [
|
|
5182
|
+
var DAPP_IMPORT_PROVIDERS = [
|
|
5183
|
+
polymarketProvider,
|
|
5184
|
+
aaveProvider
|
|
5185
|
+
];
|
|
4938
5186
|
function getEnabledProviders(config) {
|
|
4939
5187
|
if (!config) return [];
|
|
4940
5188
|
return DAPP_IMPORT_PROVIDERS.filter(
|
|
@@ -4946,7 +5194,7 @@ function getEnabledProviders(config) {
|
|
|
4946
5194
|
function computeDappImportStatus(providerId, inputs) {
|
|
4947
5195
|
const { owner, availability, availabilityOwner, setup } = inputs;
|
|
4948
5196
|
if (!owner) return "needs-connect";
|
|
4949
|
-
const entry = _optionalChain([availabilityOwner, 'optionalAccess',
|
|
5197
|
+
const entry = _optionalChain([availabilityOwner, 'optionalAccess', _156 => _156.toLowerCase, 'call', _157 => _157()]) === owner.toLowerCase() ? availability[providerId] : void 0;
|
|
4950
5198
|
if (entry === "loading" || entry === void 0) return "loading";
|
|
4951
5199
|
if (entry === "error") {
|
|
4952
5200
|
return {
|
|
@@ -5472,7 +5720,7 @@ function applyAction(state, action) {
|
|
|
5472
5720
|
totalUsd: null,
|
|
5473
5721
|
// Keep any prior chains visible so the cluster does not flicker
|
|
5474
5722
|
// empty across a refresh.
|
|
5475
|
-
chainIds: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
5723
|
+
chainIds: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _158 => _158.chainIds]), () => ( []))
|
|
5476
5724
|
}
|
|
5477
5725
|
}
|
|
5478
5726
|
}
|
|
@@ -5637,7 +5885,7 @@ function applyAction(state, action) {
|
|
|
5637
5885
|
flow: { ...state.flow, step: "processing" }
|
|
5638
5886
|
};
|
|
5639
5887
|
case "processing/quote-loaded":
|
|
5640
|
-
if (state.flow.step !== "processing" || _optionalChain([state, 'access',
|
|
5888
|
+
if (state.flow.step !== "processing" || _optionalChain([state, 'access', _159 => _159.processing, 'access', _160 => _160.txHash, 'optionalAccess', _161 => _161.toLowerCase, 'call', _162 => _162()]) !== action.txHash.toLowerCase()) {
|
|
5641
5889
|
return state;
|
|
5642
5890
|
}
|
|
5643
5891
|
return {
|
|
@@ -5970,7 +6218,7 @@ var SWAPPED_QUOTE_FEE_TIMEOUT_MS = 2500;
|
|
|
5970
6218
|
async function fetchPinnedQuote(params) {
|
|
5971
6219
|
try {
|
|
5972
6220
|
if (BigInt(params.amount) <= 0n) return void 0;
|
|
5973
|
-
} catch (
|
|
6221
|
+
} catch (e31) {
|
|
5974
6222
|
return void 0;
|
|
5975
6223
|
}
|
|
5976
6224
|
let timeoutId;
|
|
@@ -5987,7 +6235,7 @@ async function fetchPinnedQuote(params) {
|
|
|
5987
6235
|
})
|
|
5988
6236
|
]);
|
|
5989
6237
|
return _nullishCoalesce(quote, () => ( void 0));
|
|
5990
|
-
} catch (
|
|
6238
|
+
} catch (e32) {
|
|
5991
6239
|
return void 0;
|
|
5992
6240
|
} finally {
|
|
5993
6241
|
if (timeoutId !== void 0) clearTimeout(timeoutId);
|
|
@@ -6203,11 +6451,11 @@ function DepositFlow({
|
|
|
6203
6451
|
onError,
|
|
6204
6452
|
debug
|
|
6205
6453
|
}) {
|
|
6206
|
-
const rpcUrls =
|
|
6207
|
-
const onStepChangeRef =
|
|
6208
|
-
const onEventRef =
|
|
6209
|
-
const onLifecycleRef =
|
|
6210
|
-
const onErrorRef =
|
|
6454
|
+
const rpcUrls = _chunkNPSC5R22cjs.useRpcUrls.call(void 0, );
|
|
6455
|
+
const onStepChangeRef = _chunkNPSC5R22cjs.useLatestRef.call(void 0, onStepChange);
|
|
6456
|
+
const onEventRef = _chunkNPSC5R22cjs.useLatestRef.call(void 0, onEvent);
|
|
6457
|
+
const onLifecycleRef = _chunkNPSC5R22cjs.useLatestRef.call(void 0, onLifecycle);
|
|
6458
|
+
const onErrorRef = _chunkNPSC5R22cjs.useLatestRef.call(void 0, onError);
|
|
6211
6459
|
const storeApi = useDepositStoreApi();
|
|
6212
6460
|
const flowSlice = useDepositStore((s) => s.flow);
|
|
6213
6461
|
const depositSlice = useDepositStore((s) => s.deposit);
|
|
@@ -6224,13 +6472,13 @@ function DepositFlow({
|
|
|
6224
6472
|
const stableWalletSelectionKeyRef = _react.useRef.call(void 0, null);
|
|
6225
6473
|
const logFlow = _react.useCallback.call(void 0,
|
|
6226
6474
|
(message, data) => {
|
|
6227
|
-
|
|
6475
|
+
_chunkNPSC5R22cjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
|
|
6228
6476
|
},
|
|
6229
6477
|
[debug]
|
|
6230
6478
|
);
|
|
6231
6479
|
const logFlowError = _react.useCallback.call(void 0,
|
|
6232
6480
|
(message, error, data) => {
|
|
6233
|
-
|
|
6481
|
+
_chunkNPSC5R22cjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
|
|
6234
6482
|
},
|
|
6235
6483
|
[debug]
|
|
6236
6484
|
);
|
|
@@ -6254,12 +6502,12 @@ function DepositFlow({
|
|
|
6254
6502
|
};
|
|
6255
6503
|
}, [enableSwappedPreconnect]);
|
|
6256
6504
|
const dappSwitchChain = _react.useMemo.call(void 0, () => {
|
|
6257
|
-
if (!_optionalChain([walletClientProp, 'optionalAccess',
|
|
6505
|
+
if (!_optionalChain([walletClientProp, 'optionalAccess', _163 => _163.switchChain])) return void 0;
|
|
6258
6506
|
return async (chainId) => {
|
|
6259
|
-
await _optionalChain([walletClientProp, 'access',
|
|
6507
|
+
await _optionalChain([walletClientProp, 'access', _164 => _164.switchChain, 'optionalCall', _165 => _165({ id: chainId })]);
|
|
6260
6508
|
};
|
|
6261
6509
|
}, [walletClientProp]);
|
|
6262
|
-
const connectedWalletAddress = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess',
|
|
6510
|
+
const connectedWalletAddress = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess', _166 => _166.account, 'optionalAccess', _167 => _167.address]), () => ( null));
|
|
6263
6511
|
const walletOptions = _react.useMemo.call(void 0, () => {
|
|
6264
6512
|
const options = [];
|
|
6265
6513
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -6273,7 +6521,7 @@ function DepositFlow({
|
|
|
6273
6521
|
});
|
|
6274
6522
|
seen.add(id);
|
|
6275
6523
|
}
|
|
6276
|
-
if (_optionalChain([reownWallet, 'optionalAccess',
|
|
6524
|
+
if (_optionalChain([reownWallet, 'optionalAccess', _168 => _168.isConnected]) && reownWallet.isSolana && reownWallet.solanaAddress) {
|
|
6277
6525
|
const id = _nullishCoalesce(reownWallet.caipAddress, () => ( `solana:${reownWallet.solanaAddress}`));
|
|
6278
6526
|
if (!seen.has(id)) {
|
|
6279
6527
|
options.push({
|
|
@@ -6285,7 +6533,7 @@ function DepositFlow({
|
|
|
6285
6533
|
});
|
|
6286
6534
|
seen.add(id);
|
|
6287
6535
|
}
|
|
6288
|
-
} else if (_optionalChain([reownWallet, 'optionalAccess',
|
|
6536
|
+
} else if (_optionalChain([reownWallet, 'optionalAccess', _169 => _169.address]) && reownWallet.isConnected && reownWallet.walletClient && reownWallet.publicClient && !seen.has(`evm:${reownWallet.address.toLowerCase()}`)) {
|
|
6289
6537
|
const id = `evm:${reownWallet.address.toLowerCase()}`;
|
|
6290
6538
|
if (!seen.has(id)) {
|
|
6291
6539
|
options.push({
|
|
@@ -6301,14 +6549,14 @@ function DepositFlow({
|
|
|
6301
6549
|
return options;
|
|
6302
6550
|
}, [
|
|
6303
6551
|
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',
|
|
6552
|
+
_optionalChain([reownWallet, 'optionalAccess', _170 => _170.address]),
|
|
6553
|
+
_optionalChain([reownWallet, 'optionalAccess', _171 => _171.isConnected]),
|
|
6554
|
+
_optionalChain([reownWallet, 'optionalAccess', _172 => _172.walletClient]),
|
|
6555
|
+
_optionalChain([reownWallet, 'optionalAccess', _173 => _173.publicClient]),
|
|
6556
|
+
_optionalChain([reownWallet, 'optionalAccess', _174 => _174.icon]),
|
|
6557
|
+
_optionalChain([reownWallet, 'optionalAccess', _175 => _175.isSolana]),
|
|
6558
|
+
_optionalChain([reownWallet, 'optionalAccess', _176 => _176.solanaAddress]),
|
|
6559
|
+
_optionalChain([reownWallet, 'optionalAccess', _177 => _177.caipAddress])
|
|
6312
6560
|
]);
|
|
6313
6561
|
const offeredFiatMethods = _react.useMemo.call(void 0,
|
|
6314
6562
|
() => fiatMethods ? FIAT_ONRAMP_METHODS.filter((m) => fiatMethods[m.method]) : FIAT_ONRAMP_METHODS,
|
|
@@ -6328,11 +6576,11 @@ function DepositFlow({
|
|
|
6328
6576
|
hasEnabledAssetMigration
|
|
6329
6577
|
].filter(Boolean).length;
|
|
6330
6578
|
const canAutoLock = Boolean(
|
|
6331
|
-
enableWallet && _optionalChain([walletClientProp, 'optionalAccess',
|
|
6579
|
+
enableWallet && _optionalChain([walletClientProp, 'optionalAccess', _178 => _178.account]) && !reownWallet && enabledFeatureCount === 1
|
|
6332
6580
|
);
|
|
6333
6581
|
const hasWalletOptions = enableWallet && walletOptions.length > 0;
|
|
6334
6582
|
const hasReownSession = Boolean(
|
|
6335
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
6583
|
+
_optionalChain([reownWallet, 'optionalAccess', _179 => _179.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _180 => _180.address])
|
|
6336
6584
|
);
|
|
6337
6585
|
const isDappImportWalletHydrating = Boolean(
|
|
6338
6586
|
hasWalletClientProp && walletClientProp === void 0 || reownWallet && !hasReownSession && !reownWallet.isReady
|
|
@@ -6352,9 +6600,10 @@ function DepositFlow({
|
|
|
6352
6600
|
isConnectSelectionConfirmed,
|
|
6353
6601
|
selectedWalletId
|
|
6354
6602
|
]);
|
|
6355
|
-
const setupChainId = typeof targetChain === "number" && !
|
|
6356
|
-
const
|
|
6357
|
-
const
|
|
6603
|
+
const setupChainId = typeof targetChain === "number" && !_chunkTENL4H64cjs.isVirtualDestination.call(void 0, targetChain) ? targetChain : typeof defaultSourceChain === "number" ? defaultSourceChain : _chains.base.id;
|
|
6604
|
+
const targetChainId = _chunkTENL4H64cjs.targetChainToChainId.call(void 0, targetChain);
|
|
6605
|
+
const targetSymbol = _chunkTENL4H64cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
6606
|
+
const isTargetStablecoin = _chunkTENL4H64cjs.isStablecoinSymbol.call(void 0, targetSymbol);
|
|
6358
6607
|
const targetMarketPriceRef = _react.useRef.call(void 0, null);
|
|
6359
6608
|
_react.useEffect.call(void 0, () => {
|
|
6360
6609
|
targetMarketPriceRef.current = null;
|
|
@@ -6362,8 +6611,8 @@ function DepositFlow({
|
|
|
6362
6611
|
return;
|
|
6363
6612
|
}
|
|
6364
6613
|
let cancelled = false;
|
|
6365
|
-
|
|
6366
|
-
chainId:
|
|
6614
|
+
_chunkHCQWFL3Acjs.fetchTokenPriceUsd.call(void 0, service, {
|
|
6615
|
+
chainId: targetChainId,
|
|
6367
6616
|
address: targetToken,
|
|
6368
6617
|
symbol: targetSymbol
|
|
6369
6618
|
}).then((price) => {
|
|
@@ -6379,11 +6628,11 @@ function DepositFlow({
|
|
|
6379
6628
|
return null;
|
|
6380
6629
|
}
|
|
6381
6630
|
if (canAutoLock) {
|
|
6382
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess',
|
|
6631
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess', _181 => _181.chain, 'optionalAccess', _182 => _182.id]), () => ( setupChainId));
|
|
6383
6632
|
return {
|
|
6384
6633
|
ownerAddress: walletClientProp.account.address,
|
|
6385
6634
|
walletClient: walletClientProp,
|
|
6386
|
-
publicClient: _nullishCoalesce(publicClientProp, () => (
|
|
6635
|
+
publicClient: _nullishCoalesce(publicClientProp, () => ( _chunkNPSC5R22cjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
|
|
6387
6636
|
switchChain: dappSwitchChain
|
|
6388
6637
|
};
|
|
6389
6638
|
}
|
|
@@ -6395,20 +6644,20 @@ function DepositFlow({
|
|
|
6395
6644
|
if (selectedOption.kind === "solana") {
|
|
6396
6645
|
return null;
|
|
6397
6646
|
}
|
|
6398
|
-
if (selectedOption.kind === "connected" && _optionalChain([walletClientProp, 'optionalAccess',
|
|
6399
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess',
|
|
6647
|
+
if (selectedOption.kind === "connected" && _optionalChain([walletClientProp, 'optionalAccess', _183 => _183.account]) && selectedOption.address && walletClientProp.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
6648
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess', _184 => _184.chain, 'optionalAccess', _185 => _185.id]), () => ( setupChainId));
|
|
6400
6649
|
return {
|
|
6401
6650
|
ownerAddress: walletClientProp.account.address,
|
|
6402
6651
|
walletClient: walletClientProp,
|
|
6403
|
-
publicClient: _nullishCoalesce(publicClientProp, () => (
|
|
6652
|
+
publicClient: _nullishCoalesce(publicClientProp, () => ( _chunkNPSC5R22cjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
|
|
6404
6653
|
switchChain: dappSwitchChain
|
|
6405
6654
|
};
|
|
6406
6655
|
}
|
|
6407
|
-
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess',
|
|
6656
|
+
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess', _186 => _186.address]) && selectedOption.address && reownWallet.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
6408
6657
|
return {
|
|
6409
6658
|
ownerAddress: reownWallet.address,
|
|
6410
6659
|
walletClient: reownWallet.walletClient,
|
|
6411
|
-
publicClient: _nullishCoalesce(reownWallet.publicClient, () => (
|
|
6660
|
+
publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunkNPSC5R22cjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
|
|
6412
6661
|
switchChain: reownWallet.switchChain
|
|
6413
6662
|
};
|
|
6414
6663
|
}
|
|
@@ -6461,35 +6710,35 @@ function DepositFlow({
|
|
|
6461
6710
|
const selectedEvmWalletOwner = _react.useMemo.call(void 0, () => {
|
|
6462
6711
|
if (!selectedWalletId) return null;
|
|
6463
6712
|
const opt = walletOptions.find((o) => o.id === selectedWalletId);
|
|
6464
|
-
if (_optionalChain([opt, 'optionalAccess',
|
|
6713
|
+
if (_optionalChain([opt, 'optionalAccess', _187 => _187.kind]) === "external" && opt.address) {
|
|
6465
6714
|
return opt.address;
|
|
6466
6715
|
}
|
|
6467
|
-
if (_optionalChain([opt, 'optionalAccess',
|
|
6716
|
+
if (_optionalChain([opt, 'optionalAccess', _188 => _188.kind]) === "connected" && opt.address) {
|
|
6468
6717
|
return opt.address;
|
|
6469
6718
|
}
|
|
6470
6719
|
return null;
|
|
6471
6720
|
}, [selectedWalletId, walletOptions]);
|
|
6472
6721
|
const dappImportOwner = _react.useMemo.call(void 0, () => {
|
|
6473
6722
|
if (selectedEvmWalletOwner) return selectedEvmWalletOwner;
|
|
6474
|
-
if (_optionalChain([reownWallet, 'optionalAccess',
|
|
6723
|
+
if (_optionalChain([reownWallet, 'optionalAccess', _189 => _189.address]) && reownWallet.isConnected) {
|
|
6475
6724
|
return reownWallet.address;
|
|
6476
6725
|
}
|
|
6477
6726
|
if (connectedWalletAddress) return connectedWalletAddress;
|
|
6478
6727
|
return null;
|
|
6479
6728
|
}, [
|
|
6480
6729
|
selectedEvmWalletOwner,
|
|
6481
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
6482
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
6730
|
+
_optionalChain([reownWallet, 'optionalAccess', _190 => _190.address]),
|
|
6731
|
+
_optionalChain([reownWallet, 'optionalAccess', _191 => _191.isConnected]),
|
|
6483
6732
|
connectedWalletAddress
|
|
6484
6733
|
]);
|
|
6485
6734
|
const activeOwner = _react.useMemo.call(void 0,
|
|
6486
6735
|
() => resolveOwnerForMode(flowMode, {
|
|
6487
|
-
walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess',
|
|
6736
|
+
walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _192 => _192.ownerAddress]), () => ( (canAutoLock ? connectedWalletAddress : selectedEvmWalletOwner))),
|
|
6488
6737
|
dappImportOwner
|
|
6489
6738
|
}),
|
|
6490
6739
|
[
|
|
6491
6740
|
flowMode,
|
|
6492
|
-
_optionalChain([signerContext, 'optionalAccess',
|
|
6741
|
+
_optionalChain([signerContext, 'optionalAccess', _193 => _193.ownerAddress]),
|
|
6493
6742
|
canAutoLock,
|
|
6494
6743
|
connectedWalletAddress,
|
|
6495
6744
|
selectedEvmWalletOwner,
|
|
@@ -6506,7 +6755,7 @@ function DepositFlow({
|
|
|
6506
6755
|
].join(":");
|
|
6507
6756
|
if (lastSmartAccountLifecycleKeyRef.current === lifecycleKey) return;
|
|
6508
6757
|
lastSmartAccountLifecycleKeyRef.current = lifecycleKey;
|
|
6509
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6758
|
+
_optionalChain([onLifecycleRef, 'access', _194 => _194.current, 'optionalCall', _195 => _195({
|
|
6510
6759
|
type: "smart-account-changed",
|
|
6511
6760
|
evm: activeEntry.smartAccount,
|
|
6512
6761
|
solana: _nullishCoalesce(activeEntry.solanaDepositAddress, () => ( null))
|
|
@@ -6534,7 +6783,7 @@ function DepositFlow({
|
|
|
6534
6783
|
return;
|
|
6535
6784
|
}
|
|
6536
6785
|
lastConnectedLifecycleKeyRef.current = lifecycleKey;
|
|
6537
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6786
|
+
_optionalChain([onLifecycleRef, 'access', _196 => _196.current, 'optionalCall', _197 => _197({
|
|
6538
6787
|
type: "connected",
|
|
6539
6788
|
address: activeOwner,
|
|
6540
6789
|
smartAccount: activeEntry.smartAccount
|
|
@@ -6579,7 +6828,7 @@ function DepositFlow({
|
|
|
6579
6828
|
const currentBackHandler = canGoBackFromHere ? handleBack : void 0;
|
|
6580
6829
|
const currentScreen = showConnectStep ? "connect" : effectiveStep.type;
|
|
6581
6830
|
_react.useEffect.call(void 0, () => {
|
|
6582
|
-
_optionalChain([onStepChangeRef, 'access',
|
|
6831
|
+
_optionalChain([onStepChangeRef, 'access', _198 => _198.current, 'optionalCall', _199 => _199(currentBackHandler, currentScreen)]);
|
|
6583
6832
|
}, [currentBackHandler, currentScreen, onStepChangeRef]);
|
|
6584
6833
|
const lastModalHeightRef = _react.useRef.call(void 0, 0);
|
|
6585
6834
|
const modalContentElRef = _react.useRef.call(void 0, null);
|
|
@@ -6589,7 +6838,7 @@ function DepositFlow({
|
|
|
6589
6838
|
modalContentElRef.current = mc;
|
|
6590
6839
|
const ro = new ResizeObserver((entries) => {
|
|
6591
6840
|
for (const entry of entries) {
|
|
6592
|
-
const border = _optionalChain([entry, 'access',
|
|
6841
|
+
const border = _optionalChain([entry, 'access', _200 => _200.borderBoxSize, 'optionalAccess', _201 => _201[0], 'optionalAccess', _202 => _202.blockSize]);
|
|
6593
6842
|
lastModalHeightRef.current = typeof border === "number" ? border : entry.contentRect.height;
|
|
6594
6843
|
}
|
|
6595
6844
|
});
|
|
@@ -6630,23 +6879,23 @@ function DepositFlow({
|
|
|
6630
6879
|
}
|
|
6631
6880
|
lastStepOpenEventKeyRef.current = stepOpenEventKey;
|
|
6632
6881
|
if (effectiveStep.type === "select-asset") {
|
|
6633
|
-
_optionalChain([onEventRef, 'access',
|
|
6882
|
+
_optionalChain([onEventRef, 'access', _203 => _203.current, 'optionalCall', _204 => _204({
|
|
6634
6883
|
type: "deposit_modal_connected_wallet_select_source_open",
|
|
6635
6884
|
total_balance_in_external_wallet: totalBalanceUsd,
|
|
6636
6885
|
pred_balance: totalBalanceUsd
|
|
6637
6886
|
})]);
|
|
6638
6887
|
} else if (effectiveStep.type === "deposit-address") {
|
|
6639
|
-
const chainName =
|
|
6640
|
-
const tokenSymbol =
|
|
6641
|
-
_optionalChain([onEventRef, 'access',
|
|
6888
|
+
const chainName = _chunkTENL4H64cjs.getChainName.call(void 0, targetChainId);
|
|
6889
|
+
const tokenSymbol = _chunkTENL4H64cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
6890
|
+
_optionalChain([onEventRef, 'access', _205 => _205.current, 'optionalCall', _206 => _206({
|
|
6642
6891
|
type: "deposit_modal_transfer_crypto_open",
|
|
6643
6892
|
default_chain: chainName,
|
|
6644
6893
|
default_token: tokenSymbol,
|
|
6645
6894
|
pred_balance: totalBalanceUsd
|
|
6646
6895
|
})]);
|
|
6647
6896
|
} else if (effectiveStep.type === "amount" && stepSendToken) {
|
|
6648
|
-
const receiveSymbol =
|
|
6649
|
-
_optionalChain([onEventRef, 'access',
|
|
6897
|
+
const receiveSymbol = _chunkTENL4H64cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
6898
|
+
_optionalChain([onEventRef, 'access', _207 => _207.current, 'optionalCall', _208 => _208({
|
|
6650
6899
|
type: "deposit_modal_connected_wallet_enter_value_open",
|
|
6651
6900
|
send_token: stepSendToken,
|
|
6652
6901
|
receive_token: receiveSymbol,
|
|
@@ -6679,7 +6928,7 @@ function DepositFlow({
|
|
|
6679
6928
|
targetToken
|
|
6680
6929
|
]);
|
|
6681
6930
|
_react.useEffect.call(void 0, () => {
|
|
6682
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6931
|
+
_optionalChain([onLifecycleRef, 'access', _209 => _209.current, 'optionalCall', _210 => _210({
|
|
6683
6932
|
type: "balance-changed",
|
|
6684
6933
|
totalUsd: totalBalanceUsd
|
|
6685
6934
|
})]);
|
|
@@ -6695,7 +6944,7 @@ function DepositFlow({
|
|
|
6695
6944
|
const handleConfirmWallet = _react.useCallback.call(void 0,
|
|
6696
6945
|
(walletId) => {
|
|
6697
6946
|
const selectedOption = walletOptions.find((o) => o.id === walletId);
|
|
6698
|
-
const mode = _optionalChain([selectedOption, 'optionalAccess',
|
|
6947
|
+
const mode = _optionalChain([selectedOption, 'optionalAccess', _211 => _211.kind]) === "solana" ? "solana-wallet" : "wallet";
|
|
6699
6948
|
storeApi.dispatch({
|
|
6700
6949
|
type: "connect/wallet-confirmed",
|
|
6701
6950
|
walletId,
|
|
@@ -6705,7 +6954,7 @@ function DepositFlow({
|
|
|
6705
6954
|
[walletOptions, storeApi]
|
|
6706
6955
|
);
|
|
6707
6956
|
const isSolanaWalletConnected = Boolean(
|
|
6708
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
6957
|
+
_optionalChain([reownWallet, 'optionalAccess', _212 => _212.isConnected]) && _optionalChain([reownWallet, 'optionalAccess', _213 => _213.isSolana])
|
|
6709
6958
|
);
|
|
6710
6959
|
const assetMigrationsKey = assetMigrations ? Object.keys(assetMigrations).filter((k) => assetMigrations[k]).sort().join(",") : "";
|
|
6711
6960
|
const enabledDappImportProviders = _react.useMemo.call(void 0,
|
|
@@ -6722,7 +6971,7 @@ function DepositFlow({
|
|
|
6722
6971
|
const owner = dappImportOwner;
|
|
6723
6972
|
if (owner) {
|
|
6724
6973
|
const wallet = walletOptions.find(
|
|
6725
|
-
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess',
|
|
6974
|
+
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _214 => _214.toLowerCase, 'call', _215 => _215()]) === owner.toLowerCase()
|
|
6726
6975
|
);
|
|
6727
6976
|
if (wallet) {
|
|
6728
6977
|
storeApi.dispatch({
|
|
@@ -6763,11 +7012,14 @@ function DepositFlow({
|
|
|
6763
7012
|
eoa: dappImportOwner,
|
|
6764
7013
|
getPublicClient: (chainId) => {
|
|
6765
7014
|
try {
|
|
6766
|
-
return
|
|
6767
|
-
} catch (
|
|
7015
|
+
return _chunkNPSC5R22cjs.getPublicClient.call(void 0, chainId, rpcUrls);
|
|
7016
|
+
} catch (e33) {
|
|
6768
7017
|
return null;
|
|
6769
7018
|
}
|
|
6770
7019
|
},
|
|
7020
|
+
// Providers whose positions live behind the Rhinestone API rather than
|
|
7021
|
+
// an RPC (Aave) read them through here.
|
|
7022
|
+
backend: service,
|
|
6771
7023
|
signal: controller.signal
|
|
6772
7024
|
}).then((availability) => {
|
|
6773
7025
|
if (controller.signal.aborted) return;
|
|
@@ -6792,7 +7044,8 @@ function DepositFlow({
|
|
|
6792
7044
|
enabledDappImportProviders,
|
|
6793
7045
|
dappImportAttemptNonce,
|
|
6794
7046
|
storeApi,
|
|
6795
|
-
rpcUrls
|
|
7047
|
+
rpcUrls,
|
|
7048
|
+
service
|
|
6796
7049
|
]);
|
|
6797
7050
|
_react.useLayoutEffect.call(void 0, () => {
|
|
6798
7051
|
if (!initialAssetMigrationProvider) return;
|
|
@@ -6852,7 +7105,7 @@ function DepositFlow({
|
|
|
6852
7105
|
}, [activeDappImportProviderId, enabledDappImportProviders]);
|
|
6853
7106
|
const activeDappImportAvailability = _react.useMemo.call(void 0, () => {
|
|
6854
7107
|
if (!activeDappImportProviderId) return null;
|
|
6855
|
-
if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess',
|
|
7108
|
+
if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _216 => _216.toLowerCase, 'call', _217 => _217()]) !== dappImportOwner.toLowerCase()) {
|
|
6856
7109
|
return null;
|
|
6857
7110
|
}
|
|
6858
7111
|
const entry = dappImportAvailability[activeDappImportProviderId];
|
|
@@ -6893,7 +7146,7 @@ function DepositFlow({
|
|
|
6893
7146
|
setup: setupSlice
|
|
6894
7147
|
});
|
|
6895
7148
|
const pinnableWallet = dappImportOwner ? _nullishCoalesce(walletOptions.find(
|
|
6896
|
-
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess',
|
|
7149
|
+
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _218 => _218.toLowerCase, 'call', _219 => _219()]) === dappImportOwner.toLowerCase()
|
|
6897
7150
|
), () => ( null)) : null;
|
|
6898
7151
|
const outcome = resolveBootOutcome({
|
|
6899
7152
|
status,
|
|
@@ -6935,7 +7188,7 @@ function DepositFlow({
|
|
|
6935
7188
|
if (dappImportOwner) {
|
|
6936
7189
|
const plan = bootRetryPlan({
|
|
6937
7190
|
setupStatus: snapshot.setup.status,
|
|
6938
|
-
availabilityEntry: _optionalChain([snapshot, 'access',
|
|
7191
|
+
availabilityEntry: _optionalChain([snapshot, 'access', _220 => _220.dappImport, 'access', _221 => _221.availabilityOwner, 'optionalAccess', _222 => _222.toLowerCase, 'call', _223 => _223()]) === dappImportOwner.toLowerCase() ? snapshot.dappImport.availability[providerId] : void 0
|
|
6939
7192
|
});
|
|
6940
7193
|
if (plan.restartSetup) {
|
|
6941
7194
|
storeApi.dispatch({ type: "setup/retry-requested" });
|
|
@@ -6984,7 +7237,7 @@ function DepositFlow({
|
|
|
6984
7237
|
acceptedExchangeFeeBps: disclosedFeeBps
|
|
6985
7238
|
});
|
|
6986
7239
|
} catch (error) {
|
|
6987
|
-
if (error instanceof
|
|
7240
|
+
if (error instanceof _chunkNPSC5R22cjs.SwappedConnectFeeChangedError) {
|
|
6988
7241
|
return error.exchangeFeeBps;
|
|
6989
7242
|
}
|
|
6990
7243
|
throw error;
|
|
@@ -6992,7 +7245,7 @@ function DepositFlow({
|
|
|
6992
7245
|
entry = { smartAccount: owner, response };
|
|
6993
7246
|
}
|
|
6994
7247
|
const currentAccount = storeApi.getState().setup.smartAccount;
|
|
6995
|
-
if (_optionalChain([currentAccount, 'optionalAccess',
|
|
7248
|
+
if (_optionalChain([currentAccount, 'optionalAccess', _224 => _224.toLowerCase, 'call', _225 => _225()]) !== owner) {
|
|
6996
7249
|
swappedConnectUrlRef.current.delete(key);
|
|
6997
7250
|
throw new Error("Deposit account changed. Select your exchange again.");
|
|
6998
7251
|
}
|
|
@@ -7023,7 +7276,7 @@ function DepositFlow({
|
|
|
7023
7276
|
);
|
|
7024
7277
|
}
|
|
7025
7278
|
swappedConnectUrlRef.current.delete(key);
|
|
7026
|
-
const response = _optionalChain([entry, 'optionalAccess',
|
|
7279
|
+
const response = _optionalChain([entry, 'optionalAccess', _226 => _226.smartAccount]) === smartAccount.toLowerCase() ? entry.response : await service.getSwappedConnectUrl({
|
|
7027
7280
|
smartAccount,
|
|
7028
7281
|
connection,
|
|
7029
7282
|
acceptedExchangeFeeBps: expectedFeeBps
|
|
@@ -7181,7 +7434,7 @@ function DepositFlow({
|
|
|
7181
7434
|
const handleSelectDisplayedFiatMethod = _react.useCallback.call(void 0,
|
|
7182
7435
|
(method) => {
|
|
7183
7436
|
if (!displayedFiatSource) return;
|
|
7184
|
-
_optionalChain([onEventRef, 'access',
|
|
7437
|
+
_optionalChain([onEventRef, 'access', _227 => _227.current, 'optionalCall', _228 => _228({
|
|
7185
7438
|
type: "deposit_modal_fiat_method_click",
|
|
7186
7439
|
country: displayedFiatCountry,
|
|
7187
7440
|
payment_method: method,
|
|
@@ -7204,7 +7457,7 @@ function DepositFlow({
|
|
|
7204
7457
|
[displayedFiatSource, handlePrefetchFiatMethod]
|
|
7205
7458
|
);
|
|
7206
7459
|
const handleNewDeposit = _react.useCallback.call(void 0, () => {
|
|
7207
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7460
|
+
_optionalChain([onLifecycleRef, 'access', _229 => _229.current, 'optionalCall', _230 => _230({
|
|
7208
7461
|
type: "smart-account-changed",
|
|
7209
7462
|
evm: null,
|
|
7210
7463
|
solana: null
|
|
@@ -7235,17 +7488,17 @@ function DepositFlow({
|
|
|
7235
7488
|
forceRegister
|
|
7236
7489
|
]
|
|
7237
7490
|
);
|
|
7238
|
-
const desiredSetupRequestKey =
|
|
7491
|
+
const desiredSetupRequestKey = _chunkHCQWFL3Acjs.computeRequestKey.call(void 0, setupInput);
|
|
7239
7492
|
const setupReady = setupSlice.status === "ready" && setupSlice.requestKey === desiredSetupRequestKey;
|
|
7240
7493
|
_react.useEffect.call(void 0, () => {
|
|
7241
7494
|
void (async () => {
|
|
7242
|
-
const requestKey =
|
|
7243
|
-
const cacheKey =
|
|
7244
|
-
const cacheable =
|
|
7495
|
+
const requestKey = _chunkHCQWFL3Acjs.computeRequestKey.call(void 0, setupInput);
|
|
7496
|
+
const cacheKey = _chunkHCQWFL3Acjs.computeCacheKey.call(void 0, setupInput);
|
|
7497
|
+
const cacheable = _chunkHCQWFL3Acjs.computeIsCacheable.call(void 0, setupInput);
|
|
7245
7498
|
if (storeApi.getState().setup.requestKey === requestKey) {
|
|
7246
7499
|
return;
|
|
7247
7500
|
}
|
|
7248
|
-
const dedupedResult =
|
|
7501
|
+
const dedupedResult = _chunkHCQWFL3Acjs.readDedupedAccountSetupResult.call(void 0, requestKey);
|
|
7249
7502
|
if (dedupedResult) {
|
|
7250
7503
|
storeApi.dispatch({
|
|
7251
7504
|
type: "setup/started",
|
|
@@ -7271,7 +7524,7 @@ function DepositFlow({
|
|
|
7271
7524
|
cacheable
|
|
7272
7525
|
});
|
|
7273
7526
|
try {
|
|
7274
|
-
const result = await
|
|
7527
|
+
const result = await _chunkHCQWFL3Acjs.runAccountSetupDeduped.call(void 0,
|
|
7275
7528
|
setupInput,
|
|
7276
7529
|
{ service, debug },
|
|
7277
7530
|
requestKey
|
|
@@ -7286,7 +7539,7 @@ function DepositFlow({
|
|
|
7286
7539
|
}
|
|
7287
7540
|
});
|
|
7288
7541
|
} catch (error) {
|
|
7289
|
-
const message = error instanceof
|
|
7542
|
+
const message = error instanceof _chunkHCQWFL3Acjs.SetupError ? error.message : "Deposit service is temporarily unavailable. Please try again shortly.";
|
|
7290
7543
|
storeApi.dispatch({
|
|
7291
7544
|
type: "setup/failed",
|
|
7292
7545
|
requestKey,
|
|
@@ -7318,11 +7571,11 @@ function DepositFlow({
|
|
|
7318
7571
|
return;
|
|
7319
7572
|
}
|
|
7320
7573
|
storeApi.dispatch({ type: "portfolio/loading", network, address });
|
|
7321
|
-
const requestId = _optionalChain([readPortfolioEntry, 'call',
|
|
7574
|
+
const requestId = _optionalChain([readPortfolioEntry, 'call', _231 => _231(
|
|
7322
7575
|
storeApi.getState().portfolio,
|
|
7323
7576
|
network,
|
|
7324
7577
|
address
|
|
7325
|
-
), 'optionalAccess',
|
|
7578
|
+
), 'optionalAccess', _232 => _232.requestId]);
|
|
7326
7579
|
if (requestId === void 0) return;
|
|
7327
7580
|
void (async () => {
|
|
7328
7581
|
try {
|
|
@@ -7335,9 +7588,9 @@ function DepositFlow({
|
|
|
7335
7588
|
address,
|
|
7336
7589
|
requestId,
|
|
7337
7590
|
totalUsd: portfolio.totalUsd,
|
|
7338
|
-
chainIds:
|
|
7591
|
+
chainIds: _chunkNPSC5R22cjs.chainIdsByValue.call(void 0, portfolio.tokens)
|
|
7339
7592
|
});
|
|
7340
|
-
} catch (
|
|
7593
|
+
} catch (e34) {
|
|
7341
7594
|
storeApi.dispatch({
|
|
7342
7595
|
type: "portfolio/failed",
|
|
7343
7596
|
network,
|
|
@@ -7355,7 +7608,7 @@ function DepositFlow({
|
|
|
7355
7608
|
sourceChain: data.sourceChain,
|
|
7356
7609
|
amount: data.amount
|
|
7357
7610
|
});
|
|
7358
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7611
|
+
_optionalChain([onLifecycleRef, 'access', _233 => _233.current, 'optionalCall', _234 => _234({ type: "submitted", ...data })]);
|
|
7359
7612
|
},
|
|
7360
7613
|
[logFlow, onLifecycleRef]
|
|
7361
7614
|
);
|
|
@@ -7374,8 +7627,8 @@ function DepositFlow({
|
|
|
7374
7627
|
);
|
|
7375
7628
|
const handleSolanaAmountContinue = _react.useCallback.call(void 0,
|
|
7376
7629
|
(token, sourceAmount, inputAmountUsd) => {
|
|
7377
|
-
const targetSym =
|
|
7378
|
-
const isTargetStable =
|
|
7630
|
+
const targetSym = _chunkTENL4H64cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
7631
|
+
const isTargetStable = _chunkTENL4H64cjs.isStablecoinSymbol.call(void 0, targetSym);
|
|
7379
7632
|
const targetTokenPriceUsd = isTargetStable ? 1 : targetMarketPriceRef.current;
|
|
7380
7633
|
logFlow("solana:amount:continue", {
|
|
7381
7634
|
token: token.symbol,
|
|
@@ -7419,7 +7672,7 @@ function DepositFlow({
|
|
|
7419
7672
|
sourceDecimals: tokenAtSubmit.decimals,
|
|
7420
7673
|
inputAmountUsd: amountUsd
|
|
7421
7674
|
});
|
|
7422
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7675
|
+
_optionalChain([onLifecycleRef, 'access', _235 => _235.current, 'optionalCall', _236 => _236({
|
|
7423
7676
|
type: "submitted",
|
|
7424
7677
|
txHash,
|
|
7425
7678
|
sourceChain: "solana",
|
|
@@ -7432,7 +7685,7 @@ function DepositFlow({
|
|
|
7432
7685
|
);
|
|
7433
7686
|
const handleAssetContinue = _react.useCallback.call(void 0,
|
|
7434
7687
|
(asset) => {
|
|
7435
|
-
_optionalChain([onEventRef, 'access',
|
|
7688
|
+
_optionalChain([onEventRef, 'access', _237 => _237.current, 'optionalCall', _238 => _238({
|
|
7436
7689
|
type: "deposit_modal_connected_wallet_select_source_cta_click",
|
|
7437
7690
|
total_balance_in_external_wallet: totalBalanceUsd,
|
|
7438
7691
|
pred_balance: totalBalanceUsd,
|
|
@@ -7452,8 +7705,8 @@ function DepositFlow({
|
|
|
7452
7705
|
(amount, targetAmount, balance) => {
|
|
7453
7706
|
const entry = storeApi.getState().setup;
|
|
7454
7707
|
if (entry.status !== "ready") return;
|
|
7455
|
-
const targetSym =
|
|
7456
|
-
const isTargetStable =
|
|
7708
|
+
const targetSym = _chunkTENL4H64cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
7709
|
+
const isTargetStable = _chunkTENL4H64cjs.isStablecoinSymbol.call(void 0, targetSym);
|
|
7457
7710
|
const targetTokenPriceUsd = isTargetStable ? 1 : targetMarketPriceRef.current;
|
|
7458
7711
|
storeApi.dispatch({
|
|
7459
7712
|
type: "amount/entered",
|
|
@@ -7486,8 +7739,8 @@ function DepositFlow({
|
|
|
7486
7739
|
sourceChain: chainId,
|
|
7487
7740
|
sourceToken: token,
|
|
7488
7741
|
amount,
|
|
7489
|
-
sourceSymbol: _optionalChain([asset, 'optionalAccess',
|
|
7490
|
-
sourceDecimals: _optionalChain([asset, 'optionalAccess',
|
|
7742
|
+
sourceSymbol: _optionalChain([asset, 'optionalAccess', _239 => _239.symbol]),
|
|
7743
|
+
sourceDecimals: _optionalChain([asset, 'optionalAccess', _240 => _240.decimals]),
|
|
7491
7744
|
inputAmountUsd: _nullishCoalesce(depositAtSubmit.inputAmountUsd, () => ( void 0)),
|
|
7492
7745
|
directTransfer: routed.directTransfer,
|
|
7493
7746
|
quote
|
|
@@ -7527,7 +7780,7 @@ function DepositFlow({
|
|
|
7527
7780
|
swappedContext,
|
|
7528
7781
|
initialEvent: info.initialEvent
|
|
7529
7782
|
});
|
|
7530
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7783
|
+
_optionalChain([onLifecycleRef, 'access', _241 => _241.current, 'optionalCall', _242 => _242({
|
|
7531
7784
|
type: "submitted",
|
|
7532
7785
|
txHash: info.txHash,
|
|
7533
7786
|
sourceChain: SWAPPED_SOURCE_CHAIN,
|
|
@@ -7555,12 +7808,12 @@ function DepositFlow({
|
|
|
7555
7808
|
const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
|
|
7556
7809
|
(txHash, sourceChain, amount) => {
|
|
7557
7810
|
const depositAtSubmit = storeApi.getState().deposit;
|
|
7558
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7811
|
+
_optionalChain([onLifecycleRef, 'access', _243 => _243.current, 'optionalCall', _244 => _244({
|
|
7559
7812
|
type: "submitted",
|
|
7560
7813
|
txHash,
|
|
7561
7814
|
sourceChain,
|
|
7562
7815
|
amount,
|
|
7563
|
-
sourceDecimals: _optionalChain([depositAtSubmit, 'access',
|
|
7816
|
+
sourceDecimals: _optionalChain([depositAtSubmit, 'access', _245 => _245.selectedAsset, 'optionalAccess', _246 => _246.decimals]),
|
|
7564
7817
|
amountUsd: _nullishCoalesce(depositAtSubmit.inputAmountUsd, () => ( void 0))
|
|
7565
7818
|
})]);
|
|
7566
7819
|
},
|
|
@@ -7569,7 +7822,7 @@ function DepositFlow({
|
|
|
7569
7822
|
const handleDepositComplete = _react.useCallback.call(void 0,
|
|
7570
7823
|
(txHash, destinationTxHash, context) => {
|
|
7571
7824
|
logFlow("deposit:complete", { txHash, destinationTxHash, ...context });
|
|
7572
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7825
|
+
_optionalChain([onLifecycleRef, 'access', _247 => _247.current, 'optionalCall', _248 => _248({
|
|
7573
7826
|
type: "complete",
|
|
7574
7827
|
txHash,
|
|
7575
7828
|
destinationTxHash,
|
|
@@ -7581,14 +7834,14 @@ function DepositFlow({
|
|
|
7581
7834
|
const handleDepositFailed = _react.useCallback.call(void 0,
|
|
7582
7835
|
(txHash, error) => {
|
|
7583
7836
|
logFlowError("deposit:failed", error, { txHash });
|
|
7584
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7837
|
+
_optionalChain([onLifecycleRef, 'access', _249 => _249.current, 'optionalCall', _250 => _250({ type: "failed", txHash, error })]);
|
|
7585
7838
|
},
|
|
7586
7839
|
[logFlowError, onLifecycleRef]
|
|
7587
7840
|
);
|
|
7588
7841
|
const handleError = _react.useCallback.call(void 0,
|
|
7589
7842
|
(message, code) => {
|
|
7590
7843
|
logFlowError("flow:error", message, { code });
|
|
7591
|
-
_optionalChain([onErrorRef, 'access',
|
|
7844
|
+
_optionalChain([onErrorRef, 'access', _251 => _251.current, 'optionalCall', _252 => _252({ message, code })]);
|
|
7592
7845
|
},
|
|
7593
7846
|
[logFlowError, onErrorRef]
|
|
7594
7847
|
);
|
|
@@ -7637,9 +7890,9 @@ function DepositFlow({
|
|
|
7637
7890
|
address: _nullishCoalesce(_nullishCoalesce(option.address, () => ( option.solanaAddress)), () => ( option.id)),
|
|
7638
7891
|
state,
|
|
7639
7892
|
errorReason: _nullishCoalesce(entry.message, () => ( void 0)),
|
|
7640
|
-
balanceStatus: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess',
|
|
7641
|
-
balanceUsd: _optionalChain([portfolioEntry, 'optionalAccess',
|
|
7642
|
-
balanceChainIds: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess',
|
|
7893
|
+
balanceStatus: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess', _253 => _253.status]), () => ( "loading")),
|
|
7894
|
+
balanceUsd: _optionalChain([portfolioEntry, 'optionalAccess', _254 => _254.status]) === "ready" ? portfolioEntry.totalUsd : null,
|
|
7895
|
+
balanceChainIds: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess', _255 => _255.chainIds]), () => ( []))
|
|
7643
7896
|
};
|
|
7644
7897
|
});
|
|
7645
7898
|
}, [enableWallet, walletOptions, setupSlice, portfolioSlice]);
|
|
@@ -7728,9 +7981,9 @@ function DepositFlow({
|
|
|
7728
7981
|
onDepositComplete: handleDepositComplete,
|
|
7729
7982
|
onDepositFailed: handleDepositFailed,
|
|
7730
7983
|
onCopyAddress: () => {
|
|
7731
|
-
const chainName =
|
|
7732
|
-
const tokenSymbol =
|
|
7733
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
7984
|
+
const chainName = _chunkTENL4H64cjs.getChainName.call(void 0, targetChainId);
|
|
7985
|
+
const tokenSymbol = _chunkTENL4H64cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
7986
|
+
_optionalChain([onEvent, 'optionalCall', _256 => _256({
|
|
7734
7987
|
type: "deposit_modal_transfer_crypto_cta_click",
|
|
7735
7988
|
default_chain: chainName,
|
|
7736
7989
|
default_token: tokenSymbol,
|
|
@@ -7777,7 +8030,7 @@ function DepositFlow({
|
|
|
7777
8030
|
}
|
|
7778
8031
|
),
|
|
7779
8032
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7780
|
-
|
|
8033
|
+
_chunkHCQWFL3Acjs.ProcessingStep,
|
|
7781
8034
|
{
|
|
7782
8035
|
smartAccount: step.smartAccount,
|
|
7783
8036
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
@@ -7849,7 +8102,7 @@ function DepositFlow({
|
|
|
7849
8102
|
}
|
|
7850
8103
|
),
|
|
7851
8104
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7852
|
-
|
|
8105
|
+
_chunkHCQWFL3Acjs.ProcessingStep,
|
|
7853
8106
|
{
|
|
7854
8107
|
smartAccount: step.smartAccount,
|
|
7855
8108
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
@@ -7882,8 +8135,8 @@ function DepositFlow({
|
|
|
7882
8135
|
);
|
|
7883
8136
|
}
|
|
7884
8137
|
if (isSolanaWalletMode) {
|
|
7885
|
-
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess',
|
|
7886
|
-
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess',
|
|
8138
|
+
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess', _257 => _257.solanaAddress]);
|
|
8139
|
+
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess', _258 => _258.solanaProvider]);
|
|
7887
8140
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
7888
8141
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7889
8142
|
AccountPreparingSkeleton,
|
|
@@ -7915,8 +8168,8 @@ function DepositFlow({
|
|
|
7915
8168
|
defaultAmount: effectiveStep.inputAmountUsd,
|
|
7916
8169
|
uiConfig,
|
|
7917
8170
|
targetChain,
|
|
7918
|
-
targetChainName:
|
|
7919
|
-
targetTokenSymbol:
|
|
8171
|
+
targetChainName: _chunkTENL4H64cjs.getChainName.call(void 0, targetChainId),
|
|
8172
|
+
targetTokenSymbol: _chunkTENL4H64cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId),
|
|
7920
8173
|
appBalanceUsd,
|
|
7921
8174
|
onContinue: handleSolanaAmountContinue,
|
|
7922
8175
|
debug
|
|
@@ -7937,7 +8190,7 @@ function DepositFlow({
|
|
|
7937
8190
|
targetToken,
|
|
7938
8191
|
service,
|
|
7939
8192
|
solanaProvider,
|
|
7940
|
-
solanaConnection: _optionalChain([reownWallet, 'optionalAccess',
|
|
8193
|
+
solanaConnection: _optionalChain([reownWallet, 'optionalAccess', _259 => _259.solanaConnection]),
|
|
7941
8194
|
uiConfig,
|
|
7942
8195
|
onConfirm: handleSolanaConfirmed,
|
|
7943
8196
|
onError: handleError,
|
|
@@ -7978,7 +8231,7 @@ function DepositFlow({
|
|
|
7978
8231
|
) })
|
|
7979
8232
|
] }) : null,
|
|
7980
8233
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7981
|
-
|
|
8234
|
+
_chunkHCQWFL3Acjs.ProcessingStep,
|
|
7982
8235
|
{
|
|
7983
8236
|
smartAccount: effectiveStep.smartAccount,
|
|
7984
8237
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
@@ -8015,7 +8268,7 @@ function DepositFlow({
|
|
|
8015
8268
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8016
8269
|
DappImportAssetSelectSkeleton,
|
|
8017
8270
|
{
|
|
8018
|
-
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportProvider, 'optionalAccess',
|
|
8271
|
+
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportProvider, 'optionalAccess', _260 => _260.sourceLabel]), () => ( "")),
|
|
8019
8272
|
error: dappImportBootError,
|
|
8020
8273
|
onRetry: handleBootRetry
|
|
8021
8274
|
}
|
|
@@ -8037,7 +8290,7 @@ function DepositFlow({
|
|
|
8037
8290
|
rows: dappImportSelectRows,
|
|
8038
8291
|
onRequestConnect: _nullishCoalesce(onConnect, () => ( onRequestConnect)),
|
|
8039
8292
|
onSelect: (providerId) => {
|
|
8040
|
-
const availabilityEntry = dappImportOwner && _optionalChain([dappImportAvailabilityOwner, 'optionalAccess',
|
|
8293
|
+
const availabilityEntry = dappImportOwner && _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _261 => _261.toLowerCase, 'call', _262 => _262()]) === dappImportOwner.toLowerCase() ? dappImportAvailability[providerId] : void 0;
|
|
8041
8294
|
if (availabilityEntry === "error") {
|
|
8042
8295
|
storeApi.dispatch({
|
|
8043
8296
|
type: "dapp-import/availability-retry-requested"
|
|
@@ -8056,16 +8309,16 @@ function DepositFlow({
|
|
|
8056
8309
|
}
|
|
8057
8310
|
);
|
|
8058
8311
|
}
|
|
8059
|
-
if (!_optionalChain([signerContext, 'optionalAccess',
|
|
8312
|
+
if (!_optionalChain([signerContext, 'optionalAccess', _263 => _263.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _264 => _264.publicClient])) {
|
|
8060
8313
|
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
8314
|
}
|
|
8062
8315
|
const ownerAddress = signerContext.ownerAddress;
|
|
8063
|
-
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access',
|
|
8316
|
+
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _265 => _265.walletClient, 'optionalAccess', _266 => _266.chain, 'optionalAccess', _267 => _267.id]), () => ( _optionalChain([signerContext, 'access', _268 => _268.publicClient, 'access', _269 => _269.chain, 'optionalAccess', _270 => _270.id]))), () => ( setupChainId));
|
|
8064
8317
|
const getReadClientForChain = (chainId) => {
|
|
8065
|
-
if (_optionalChain([signerContext, 'access',
|
|
8318
|
+
if (_optionalChain([signerContext, 'access', _271 => _271.publicClient, 'access', _272 => _272.chain, 'optionalAccess', _273 => _273.id]) === chainId) {
|
|
8066
8319
|
return signerContext.publicClient;
|
|
8067
8320
|
}
|
|
8068
|
-
return
|
|
8321
|
+
return _chunkNPSC5R22cjs.getPublicClient.call(void 0, chainId, rpcUrls);
|
|
8069
8322
|
};
|
|
8070
8323
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
8071
8324
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -8094,8 +8347,9 @@ function DepositFlow({
|
|
|
8094
8347
|
effectiveStep.type === "dapp-import-asset-select" && activeDappImportProvider && activeDappImportAvailability && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8095
8348
|
DappImportAssetSelectStep,
|
|
8096
8349
|
{
|
|
8097
|
-
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access',
|
|
8350
|
+
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access', _274 => _274.assets, 'access', _275 => _275[0], 'optionalAccess', _276 => _276.sourceLabel]), () => ( activeDappImportProvider.sourceLabel)),
|
|
8098
8351
|
assets: activeDappImportAvailability.assets,
|
|
8352
|
+
incompleteSummary: _optionalChain([activeDappImportAvailability, 'access', _277 => _277.incomplete, 'optionalAccess', _278 => _278.summary]),
|
|
8099
8353
|
onSelect: handleDappImportAssetSelected
|
|
8100
8354
|
}
|
|
8101
8355
|
),
|
|
@@ -8105,7 +8359,7 @@ function DepositFlow({
|
|
|
8105
8359
|
walletClient: signerContext.walletClient,
|
|
8106
8360
|
publicClient: getReadClientForChain(effectiveStep.asset.chainId),
|
|
8107
8361
|
address: ownerAddress,
|
|
8108
|
-
|
|
8362
|
+
...dappImportBalanceSource(effectiveStep.asset),
|
|
8109
8363
|
asset: effectiveStep.asset,
|
|
8110
8364
|
defaultAmount: _nullishCoalesce(effectiveStep.inputAmountUsd, () => ( defaultAmount)),
|
|
8111
8365
|
switchChain: signerContext.switchChain,
|
|
@@ -8116,8 +8370,8 @@ function DepositFlow({
|
|
|
8116
8370
|
service,
|
|
8117
8371
|
onContinue: handleAmountContinue,
|
|
8118
8372
|
onCtaClick: (ctaName) => {
|
|
8119
|
-
const receiveSymbol =
|
|
8120
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
8373
|
+
const receiveSymbol = _chunkTENL4H64cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
8374
|
+
_optionalChain([onEvent, 'optionalCall', _279 => _279({
|
|
8121
8375
|
type: "deposit_modal_connected_wallet_enter_value_cta_click",
|
|
8122
8376
|
send_token: effectiveStep.asset.symbol,
|
|
8123
8377
|
receive_token: receiveSymbol,
|
|
@@ -8152,8 +8406,11 @@ function DepositFlow({
|
|
|
8152
8406
|
const result = await activeDappImportProvider.executeTransfer(
|
|
8153
8407
|
{
|
|
8154
8408
|
walletClient: signerContext.walletClient,
|
|
8409
|
+
// The asset's chain: a provider's assets can span chains
|
|
8410
|
+
// (Aave positions exist on every deposit-enabled chain), so
|
|
8411
|
+
// there is no single provider-level chain to read from.
|
|
8155
8412
|
publicClient: getReadClientForChain(
|
|
8156
|
-
|
|
8413
|
+
effectiveStep.asset.chainId
|
|
8157
8414
|
),
|
|
8158
8415
|
recipient: effectiveStep.smartAccount,
|
|
8159
8416
|
asset: effectiveStep.asset,
|
|
@@ -8172,7 +8429,7 @@ function DepositFlow({
|
|
|
8172
8429
|
}
|
|
8173
8430
|
),
|
|
8174
8431
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8175
|
-
|
|
8432
|
+
_chunkHCQWFL3Acjs.ProcessingStep,
|
|
8176
8433
|
{
|
|
8177
8434
|
smartAccount: effectiveStep.smartAccount,
|
|
8178
8435
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
@@ -8218,16 +8475,16 @@ function formatDate(iso) {
|
|
|
8218
8475
|
month: "short",
|
|
8219
8476
|
year: "numeric"
|
|
8220
8477
|
});
|
|
8221
|
-
} catch (
|
|
8478
|
+
} catch (e35) {
|
|
8222
8479
|
return iso;
|
|
8223
8480
|
}
|
|
8224
8481
|
}
|
|
8225
8482
|
function resolveChainId(value) {
|
|
8226
8483
|
if (value === void 0 || value === null) return null;
|
|
8227
8484
|
if (typeof value === "number") return value;
|
|
8228
|
-
if (
|
|
8229
|
-
if (
|
|
8230
|
-
const parsed =
|
|
8485
|
+
if (_chunkTENL4H64cjs.isSolanaCaip2.call(void 0, value) || value === "solana") return "solana";
|
|
8486
|
+
if (_chunkTENL4H64cjs.isHyperCoreCaip2.call(void 0, value) || value === "hypercore") return "hypercore";
|
|
8487
|
+
const parsed = _chunkTENL4H64cjs.parseEvmChainId.call(void 0, value);
|
|
8231
8488
|
if (parsed !== null) return parsed;
|
|
8232
8489
|
const num = Number(value);
|
|
8233
8490
|
return Number.isFinite(num) ? num : null;
|
|
@@ -8236,7 +8493,7 @@ function resolveTokenSymbol(token, chainId) {
|
|
|
8236
8493
|
if (!token) return "";
|
|
8237
8494
|
if (chainId === "solana") {
|
|
8238
8495
|
const normalized = token.toLowerCase();
|
|
8239
|
-
const matched =
|
|
8496
|
+
const matched = _chunkTENL4H64cjs.SOLANA_TOKENS.find(
|
|
8240
8497
|
(entry) => entry.mint.toLowerCase() === normalized
|
|
8241
8498
|
);
|
|
8242
8499
|
if (matched) return matched.symbol;
|
|
@@ -8245,8 +8502,8 @@ function resolveTokenSymbol(token, chainId) {
|
|
|
8245
8502
|
}
|
|
8246
8503
|
}
|
|
8247
8504
|
if (chainId !== null && chainId !== void 0 && chainId !== "solana" && /^0x[a-fA-F0-9]{40}$/.test(token)) {
|
|
8248
|
-
const evmChainId = chainId === "hypercore" ?
|
|
8249
|
-
const sym =
|
|
8505
|
+
const evmChainId = chainId === "hypercore" ? _chunkTENL4H64cjs.HYPERCORE_CHAIN_ID : chainId;
|
|
8506
|
+
const sym = _chunkTENL4H64cjs.getTokenSymbol.call(void 0, token, evmChainId);
|
|
8250
8507
|
if (sym !== "Token") return sym;
|
|
8251
8508
|
}
|
|
8252
8509
|
return shortenHash(token);
|
|
@@ -8257,7 +8514,7 @@ function formatAmount(rawAmount, token, chainId) {
|
|
|
8257
8514
|
if (token && chainId !== null && chainId !== void 0) {
|
|
8258
8515
|
if (chainId === "solana") {
|
|
8259
8516
|
const normalized = token.toLowerCase();
|
|
8260
|
-
const matched =
|
|
8517
|
+
const matched = _chunkTENL4H64cjs.SOLANA_TOKENS.find(
|
|
8261
8518
|
(entry) => entry.mint.toLowerCase() === normalized
|
|
8262
8519
|
);
|
|
8263
8520
|
if (matched) {
|
|
@@ -8266,8 +8523,8 @@ function formatAmount(rawAmount, token, chainId) {
|
|
|
8266
8523
|
decimals = 9;
|
|
8267
8524
|
}
|
|
8268
8525
|
} else if (/^0x[a-fA-F0-9]{40}$/.test(token)) {
|
|
8269
|
-
const evmChainId = chainId === "hypercore" ?
|
|
8270
|
-
decimals =
|
|
8526
|
+
const evmChainId = chainId === "hypercore" ? _chunkTENL4H64cjs.HYPERCORE_CHAIN_ID : chainId;
|
|
8527
|
+
decimals = _chunkTENL4H64cjs.getTokenDecimalsByAddress.call(void 0, token, evmChainId);
|
|
8271
8528
|
}
|
|
8272
8529
|
}
|
|
8273
8530
|
try {
|
|
@@ -8279,13 +8536,13 @@ function formatAmount(rawAmount, token, chainId) {
|
|
|
8279
8536
|
let frac = fracStr.slice(0, 5).replace(/0+$/, "");
|
|
8280
8537
|
if (frac.length < 2) frac = frac.padEnd(2, "0");
|
|
8281
8538
|
return `${whole}.${frac}`;
|
|
8282
|
-
} catch (
|
|
8539
|
+
} catch (e36) {
|
|
8283
8540
|
return rawAmount;
|
|
8284
8541
|
}
|
|
8285
8542
|
}
|
|
8286
8543
|
function getTxExplorerUrl(txHash, chainId) {
|
|
8287
8544
|
if (!chainId) return null;
|
|
8288
|
-
const base2 =
|
|
8545
|
+
const base2 = _chunkTENL4H64cjs.getExplorerUrl.call(void 0, chainId);
|
|
8289
8546
|
if (!base2) return null;
|
|
8290
8547
|
return `${base2}/tx/${txHash}`;
|
|
8291
8548
|
}
|
|
@@ -8328,7 +8585,7 @@ function DepositHistoryPanel({
|
|
|
8328
8585
|
);
|
|
8329
8586
|
const visibleDeposits = _react.useMemo.call(void 0, () => {
|
|
8330
8587
|
const sourceHashes = new Set(
|
|
8331
|
-
deposits.map((d) => _optionalChain([d, 'access',
|
|
8588
|
+
deposits.map((d) => _optionalChain([d, 'access', _280 => _280.sourceTxHash, 'optionalAccess', _281 => _281.toLowerCase, 'call', _282 => _282()])).filter((h) => Boolean(h))
|
|
8332
8589
|
);
|
|
8333
8590
|
return deposits.filter(
|
|
8334
8591
|
(d) => !(d.txHash && sourceHashes.has(d.txHash.toLowerCase()))
|
|
@@ -8350,7 +8607,7 @@ function DepositHistoryPanel({
|
|
|
8350
8607
|
className: "rs-modal-header-back",
|
|
8351
8608
|
"aria-label": "Back",
|
|
8352
8609
|
onClick: onClose,
|
|
8353
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8610
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.ChevronLeftIcon, {})
|
|
8354
8611
|
}
|
|
8355
8612
|
) }),
|
|
8356
8613
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: onCloseModal && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -8360,29 +8617,29 @@ function DepositHistoryPanel({
|
|
|
8360
8617
|
className: "rs-modal-close",
|
|
8361
8618
|
"aria-label": "Close",
|
|
8362
8619
|
onClick: onCloseModal,
|
|
8363
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8620
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CloseIcon, {})
|
|
8364
8621
|
}
|
|
8365
8622
|
) })
|
|
8366
8623
|
] }),
|
|
8367
8624
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen", children: [
|
|
8368
8625
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen-body", children: [
|
|
8369
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8626
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.HistoryIcon, {}), title: "History" }),
|
|
8370
8627
|
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,
|
|
8628
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.HistoryIcon, {}) }),
|
|
8372
8629
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
8373
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8630
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.Spinner, { className: "rs-spinner--sm" }),
|
|
8374
8631
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Loading history\u2026" })
|
|
8375
8632
|
] })
|
|
8376
8633
|
] }),
|
|
8377
8634
|
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,
|
|
8635
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.AlertTriangleIcon, {}) }),
|
|
8379
8636
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
8380
8637
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "Couldn't load history" }),
|
|
8381
8638
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: error })
|
|
8382
8639
|
] })
|
|
8383
8640
|
] }),
|
|
8384
8641
|
!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,
|
|
8642
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.HistoryIcon, {}) }),
|
|
8386
8643
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
8387
8644
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "No deposits yet" }),
|
|
8388
8645
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Your deposit history will appear here" })
|
|
@@ -8402,7 +8659,7 @@ function DepositHistoryPanel({
|
|
|
8402
8659
|
)
|
|
8403
8660
|
] })
|
|
8404
8661
|
] }),
|
|
8405
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8662
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.PoweredBy, {})
|
|
8406
8663
|
] })
|
|
8407
8664
|
]
|
|
8408
8665
|
}
|
|
@@ -8413,10 +8670,10 @@ function HistoryCard({ deposit }) {
|
|
|
8413
8670
|
const status = normalizeStatus(deposit.status, deposit.isSpam);
|
|
8414
8671
|
const sourceChainId = resolveChainId(deposit.chain);
|
|
8415
8672
|
const targetChainId = resolveChainId(deposit.targetChain);
|
|
8416
|
-
const sourceChainName = sourceChainId ?
|
|
8417
|
-
const targetChainName = targetChainId ?
|
|
8418
|
-
const sourceChainIcon = sourceChainId ?
|
|
8419
|
-
const targetChainIcon = targetChainId ?
|
|
8673
|
+
const sourceChainName = sourceChainId ? _chunkTENL4H64cjs.getChainName.call(void 0, sourceChainId) : null;
|
|
8674
|
+
const targetChainName = targetChainId ? _chunkTENL4H64cjs.getChainName.call(void 0, targetChainId) : null;
|
|
8675
|
+
const sourceChainIcon = sourceChainId ? _chunkTENL4H64cjs.getChainIcon.call(void 0, sourceChainId) : void 0;
|
|
8676
|
+
const targetChainIcon = targetChainId ? _chunkTENL4H64cjs.getChainIcon.call(void 0, targetChainId) : void 0;
|
|
8420
8677
|
const sourceSymbol = resolveTokenSymbol(deposit.token, sourceChainId);
|
|
8421
8678
|
const rawAmount = deposit.sourceAmount && deposit.sourceAmount !== "0" ? deposit.sourceAmount : deposit.amount;
|
|
8422
8679
|
const formattedAmount = rawAmount ? formatAmount(rawAmount, deposit.token, sourceChainId) : null;
|
|
@@ -8438,8 +8695,8 @@ function HistoryCard({ deposit }) {
|
|
|
8438
8695
|
children: [
|
|
8439
8696
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-card-row", children: [
|
|
8440
8697
|
/* @__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,
|
|
8698
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-token", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.TokenIcon, { symbol: sourceSymbol, fallback: sourceSymbol.slice(0, 2) }) }),
|
|
8699
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-chain", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CdnIcon, { src: sourceChainIcon }) })
|
|
8443
8700
|
] }),
|
|
8444
8701
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-card-text", children: [
|
|
8445
8702
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-title", children: txTypeLabel }),
|
|
@@ -8455,14 +8712,14 @@ function HistoryCard({ deposit }) {
|
|
|
8455
8712
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
8456
8713
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-detail-value", children: [
|
|
8457
8714
|
/* @__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,
|
|
8715
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CdnIcon, { src: sourceChainIcon }) })
|
|
8459
8716
|
] })
|
|
8460
8717
|
] }),
|
|
8461
8718
|
targetChainName && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
8462
8719
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
|
|
8463
8720
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-detail-value", children: [
|
|
8464
8721
|
/* @__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,
|
|
8722
|
+
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CdnIcon, { src: targetChainIcon }) })
|
|
8466
8723
|
] })
|
|
8467
8724
|
] }),
|
|
8468
8725
|
srcTxUrl && srcTxHash && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
@@ -8477,7 +8734,7 @@ function HistoryCard({ deposit }) {
|
|
|
8477
8734
|
onClick: (e) => e.stopPropagation(),
|
|
8478
8735
|
children: [
|
|
8479
8736
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: shortenHash(srcTxHash) }),
|
|
8480
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8737
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.ArrowUpRightIcon, {})
|
|
8481
8738
|
]
|
|
8482
8739
|
}
|
|
8483
8740
|
)
|
|
@@ -8492,7 +8749,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
|
8492
8749
|
// src/DepositModal.tsx
|
|
8493
8750
|
|
|
8494
8751
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
8495
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
8752
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-TXTLVZIQ.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
8496
8753
|
);
|
|
8497
8754
|
function sortByCreatedAtDesc(items) {
|
|
8498
8755
|
return [...items].sort((a, b) => {
|
|
@@ -8506,8 +8763,8 @@ function hasSuppliedWalletClient(props) {
|
|
|
8506
8763
|
return Object.prototype.hasOwnProperty.call(props, WALLET_CLIENT_PROP);
|
|
8507
8764
|
}
|
|
8508
8765
|
function DepositModal(props) {
|
|
8509
|
-
|
|
8510
|
-
|
|
8766
|
+
_chunkHCQWFL3Acjs.warnRemovedProps.call(void 0, "DepositModal", props);
|
|
8767
|
+
_chunkNPSC5R22cjs.checkBackendUrl.call(void 0, "DepositModal", props.backendUrl);
|
|
8511
8768
|
const needsReown = !!props.reownAppId;
|
|
8512
8769
|
const hasWalletClientProp = hasSuppliedWalletClient(props);
|
|
8513
8770
|
if (needsReown) {
|
|
@@ -8569,13 +8826,13 @@ function DepositModalInner({
|
|
|
8569
8826
|
debug
|
|
8570
8827
|
}) {
|
|
8571
8828
|
const modalRef = _react.useRef.call(void 0, null);
|
|
8572
|
-
const onReadyRef =
|
|
8829
|
+
const onReadyRef = _chunkNPSC5R22cjs.useLatestRef.call(void 0, onReady);
|
|
8573
8830
|
const [currentScreen, setCurrentScreen] = _react.useState.call(void 0, "connect");
|
|
8574
8831
|
const [swappedImmersive, setSwappedImmersive] = _react.useState.call(void 0, false);
|
|
8575
8832
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
8576
8833
|
void 0
|
|
8577
8834
|
);
|
|
8578
|
-
const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
8835
|
+
const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _283 => _283.showHistoryButton]), () => ( false));
|
|
8579
8836
|
const historyButtonVisible = showHistoryButton && (currentScreen === "select-asset" || currentScreen === "deposit-address");
|
|
8580
8837
|
const [historyOpen, setHistoryOpen] = _react.useState.call(void 0, false);
|
|
8581
8838
|
const [historyDeposits, setHistoryDeposits] = _react.useState.call(void 0, []);
|
|
@@ -8586,11 +8843,11 @@ function DepositModalInner({
|
|
|
8586
8843
|
const cursorRef = _react.useRef.call(void 0, null);
|
|
8587
8844
|
const historyStaleRef = _react.useRef.call(void 0, false);
|
|
8588
8845
|
const historyLoadedRef = _react.useRef.call(void 0, false);
|
|
8589
|
-
const targetChain = targetChainProp === "solana" ?
|
|
8590
|
-
const sourceChain = sourceChainProp ?
|
|
8591
|
-
const rpcUrls =
|
|
8846
|
+
const targetChain = targetChainProp === "solana" || targetChainProp === _chunkTENL4H64cjs.HYPERCORE_SPOT_CAIP2 ? targetChainProp : _chunkTENL4H64cjs.getChainId.call(void 0, targetChainProp);
|
|
8847
|
+
const sourceChain = sourceChainProp ? _chunkTENL4H64cjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
8848
|
+
const rpcUrls = _chunkNPSC5R22cjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
|
|
8592
8849
|
const service = _react.useMemo.call(void 0,
|
|
8593
|
-
() =>
|
|
8850
|
+
() => _chunkNPSC5R22cjs.createDepositService.call(void 0, backendUrl, {
|
|
8594
8851
|
debug,
|
|
8595
8852
|
debugScope: "service:deposit"
|
|
8596
8853
|
}),
|
|
@@ -8624,12 +8881,12 @@ function DepositModalInner({
|
|
|
8624
8881
|
}, [store, targetChain, targetToken]);
|
|
8625
8882
|
_react.useEffect.call(void 0, () => {
|
|
8626
8883
|
if (isOpen && modalRef.current) {
|
|
8627
|
-
|
|
8884
|
+
_chunkNPSC5R22cjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
8628
8885
|
}
|
|
8629
8886
|
}, [isOpen, theme]);
|
|
8630
8887
|
_react.useEffect.call(void 0, () => {
|
|
8631
8888
|
if (isOpen) {
|
|
8632
|
-
_optionalChain([onReadyRef, 'access',
|
|
8889
|
+
_optionalChain([onReadyRef, 'access', _284 => _284.current, 'optionalCall', _285 => _285()]);
|
|
8633
8890
|
}
|
|
8634
8891
|
}, [isOpen, onReadyRef]);
|
|
8635
8892
|
const handleStepChange = _react.useCallback.call(void 0,
|
|
@@ -8705,10 +8962,10 @@ function DepositModalInner({
|
|
|
8705
8962
|
fetchHistory("initial");
|
|
8706
8963
|
}
|
|
8707
8964
|
}, [historyOpen, fetchHistory]);
|
|
8708
|
-
const onLifecycleRef =
|
|
8965
|
+
const onLifecycleRef = _chunkNPSC5R22cjs.useLatestRef.call(void 0, onLifecycle);
|
|
8709
8966
|
const handleLifecycle = _react.useCallback.call(void 0,
|
|
8710
8967
|
(event) => {
|
|
8711
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
8968
|
+
_optionalChain([onLifecycleRef, 'access', _286 => _286.current, 'optionalCall', _287 => _287(event)]);
|
|
8712
8969
|
if (event.type === "smart-account-changed" && !event.evm && !event.solana) {
|
|
8713
8970
|
historyStaleRef.current = true;
|
|
8714
8971
|
}
|
|
@@ -8737,12 +8994,12 @@ function DepositModalInner({
|
|
|
8737
8994
|
store.dispatch({ type: "flow/reset" });
|
|
8738
8995
|
}
|
|
8739
8996
|
}, [isOpen, store]);
|
|
8740
|
-
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
8997
|
+
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _288 => _288.showBackButton]), () => ( true));
|
|
8741
8998
|
const canGoBack = backHandler !== void 0;
|
|
8742
8999
|
const hideHeaderChrome = swappedImmersive;
|
|
8743
9000
|
const modalClassName = `rs-modal${hideHeaderChrome ? " rs-modal--swapped-iframe" : ""}`;
|
|
8744
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8745
|
-
|
|
9001
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.ChainCatalogProvider, { service, rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9002
|
+
_chunkNPSC5R22cjs.Modal,
|
|
8746
9003
|
{
|
|
8747
9004
|
isOpen,
|
|
8748
9005
|
onClose,
|
|
@@ -8758,7 +9015,7 @@ function DepositModalInner({
|
|
|
8758
9015
|
className: "rs-modal-header-back",
|
|
8759
9016
|
"aria-label": "Go back",
|
|
8760
9017
|
onClick: backHandler,
|
|
8761
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9018
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.ChevronLeftIcon, {})
|
|
8762
9019
|
}
|
|
8763
9020
|
) }),
|
|
8764
9021
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
|
|
@@ -8770,7 +9027,7 @@ function DepositModalInner({
|
|
|
8770
9027
|
"aria-label": "Deposit history",
|
|
8771
9028
|
onClick: handleHistoryOpen,
|
|
8772
9029
|
disabled: !recipient,
|
|
8773
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9030
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.HistoryIcon, {})
|
|
8774
9031
|
}
|
|
8775
9032
|
),
|
|
8776
9033
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -8780,7 +9037,7 @@ function DepositModalInner({
|
|
|
8780
9037
|
onClick: onClose,
|
|
8781
9038
|
className: "rs-modal-close",
|
|
8782
9039
|
"aria-label": "Close",
|
|
8783
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9040
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkNPSC5R22cjs.CloseIcon, {})
|
|
8784
9041
|
}
|
|
8785
9042
|
)
|
|
8786
9043
|
] })
|
|
@@ -8814,7 +9071,7 @@ function DepositModalInner({
|
|
|
8814
9071
|
onDisconnect,
|
|
8815
9072
|
onRequestConnect,
|
|
8816
9073
|
uiConfig,
|
|
8817
|
-
appFees: _optionalChain([clientSetup, 'optionalAccess',
|
|
9074
|
+
appFees: _optionalChain([clientSetup, 'optionalAccess', _289 => _289.appFees]),
|
|
8818
9075
|
appFeesResolved: clientSetup !== null,
|
|
8819
9076
|
onStepChange: handleStepChange,
|
|
8820
9077
|
onSwappedImmersiveChange: setSwappedImmersive,
|
|
@@ -8840,7 +9097,7 @@ function DepositModalInner({
|
|
|
8840
9097
|
)
|
|
8841
9098
|
] })
|
|
8842
9099
|
}
|
|
8843
|
-
) }) });
|
|
9100
|
+
) }) }) });
|
|
8844
9101
|
}
|
|
8845
9102
|
|
|
8846
9103
|
|