@rhinestone/deposit-modal 0.10.0 → 0.11.1
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-MTWT6Y66.mjs → DepositModalReown-MO5QDLIT.mjs} +96 -26
- package/dist/{DepositModalReown-S3DSFXTX.cjs → DepositModalReown-YGB73NMW.cjs} +97 -27
- package/dist/caip-D8aRWdEY.d.cts +40 -0
- package/dist/caip-D8aRWdEY.d.ts +40 -0
- package/dist/{chunk-NF4NBRUP.cjs → chunk-4FTI3GTB.cjs} +1 -1
- package/dist/{chunk-A223BLVC.mjs → chunk-53IFZGSF.mjs} +177 -21
- package/dist/{chunk-VDGT6NZQ.mjs → chunk-5746YXKC.mjs} +14 -31
- package/dist/{chunk-7TV7GLJB.mjs → chunk-CWGUBFJL.mjs} +763 -169
- package/dist/{chunk-LR7MKHYV.mjs → chunk-EIWOVX53.mjs} +27 -25
- package/dist/{chunk-VTVOHNXM.cjs → chunk-FVUXJ3RP.cjs} +3 -3
- package/dist/{chunk-A42XAHIB.cjs → chunk-HUHBNYD3.cjs} +84 -101
- package/dist/{chunk-YEBXUUH3.cjs → chunk-JPRV36DT.cjs} +2 -2
- package/dist/{chunk-UMCDZJMG.cjs → chunk-LQGYPM5B.cjs} +96 -94
- package/dist/{chunk-ILT2PITN.mjs → chunk-MZ53PDIX.mjs} +1 -1
- package/dist/{chunk-5NJYW5FT.mjs → chunk-OWYPKCYD.mjs} +12 -9
- package/dist/{chunk-W4YAOJPG.cjs → chunk-SSQ27YFB.cjs} +625 -568
- package/dist/{chunk-H577RJN5.cjs → chunk-TENL4H64.cjs} +186 -30
- package/dist/{chunk-5OEWGJR4.mjs → chunk-URFSTNRS.mjs} +1 -1
- package/dist/{chunk-KW32UBUQ.mjs → chunk-V6T7LORJ.mjs} +1 -1
- package/dist/{chunk-MHIOMTMM.mjs → chunk-YELNYILK.mjs} +391 -334
- package/dist/{chunk-PUJHXHRA.cjs → chunk-ZQR36NCV.cjs} +845 -251
- package/dist/{chunk-DEF767BA.cjs → chunk-ZRIRCIQM.cjs} +66 -63
- 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/{types-C0SGf-21.d.cts → types-CsGa-HxD.d.cts} +10 -3
- package/dist/{types-C0SGf-21.d.ts → types-DdS8OySJ.d.ts} +10 -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 _chunkHUHBNYD3cjs = require('./chunk-HUHBNYD3.cjs');
|
|
20
21
|
|
|
21
|
-
var _chunkA42XAHIBcjs = require('./chunk-A42XAHIB.cjs');
|
|
22
22
|
|
|
23
|
+
var _chunkFVUXJ3RPcjs = require('./chunk-FVUXJ3RP.cjs');
|
|
23
24
|
|
|
24
|
-
var _chunkVTVOHNXMcjs = require('./chunk-VTVOHNXM.cjs');
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
@@ -77,7 +77,6 @@ var _chunkVTVOHNXMcjs = require('./chunk-VTVOHNXM.cjs');
|
|
|
77
77
|
|
|
78
78
|
|
|
79
79
|
|
|
80
|
-
var _chunkPUJHXHRAcjs = require('./chunk-PUJHXHRA.cjs');
|
|
81
80
|
|
|
82
81
|
|
|
83
82
|
|
|
@@ -87,8 +86,8 @@ var _chunkPUJHXHRAcjs = require('./chunk-PUJHXHRA.cjs');
|
|
|
87
86
|
|
|
88
87
|
|
|
89
88
|
|
|
89
|
+
var _chunkZQR36NCVcjs = require('./chunk-ZQR36NCV.cjs');
|
|
90
90
|
|
|
91
|
-
var _chunkYEBXUUH3cjs = require('./chunk-YEBXUUH3.cjs');
|
|
92
91
|
|
|
93
92
|
|
|
94
93
|
|
|
@@ -98,6 +97,7 @@ var _chunkYEBXUUH3cjs = require('./chunk-YEBXUUH3.cjs');
|
|
|
98
97
|
|
|
99
98
|
|
|
100
99
|
|
|
100
|
+
var _chunkJPRV36DTcjs = require('./chunk-JPRV36DT.cjs');
|
|
101
101
|
|
|
102
102
|
|
|
103
103
|
|
|
@@ -117,7 +117,20 @@ var _chunkYEBXUUH3cjs = require('./chunk-YEBXUUH3.cjs');
|
|
|
117
117
|
|
|
118
118
|
|
|
119
119
|
|
|
120
|
-
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
var _chunkTENL4H64cjs = require('./chunk-TENL4H64.cjs');
|
|
121
134
|
|
|
122
135
|
// src/DepositModal.tsx
|
|
123
136
|
|
|
@@ -207,12 +220,15 @@ SegmentedToggle.displayName = "SegmentedToggle";
|
|
|
207
220
|
// src/components/ui/ChainIcon.tsx
|
|
208
221
|
|
|
209
222
|
function ChainIcon({ chainId, className, loading }) {
|
|
210
|
-
const badge =
|
|
223
|
+
const badge = _chunkTENL4H64cjs.getChainBadge.call(void 0, chainId);
|
|
224
|
+
const catalogChain = _chunkZQR36NCVcjs.useCatalogChain.call(void 0, _chunkZQR36NCVcjs.catalogKeyForChain.call(void 0, chainId));
|
|
225
|
+
const name = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _2 => _2.name]), () => ( _chunkTENL4H64cjs.getChainName.call(void 0, chainId)));
|
|
226
|
+
const initial = (_nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _3 => _3.name]), () => ( badge.shortLabel))).charAt(0);
|
|
211
227
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
212
|
-
|
|
228
|
+
_chunkZQR36NCVcjs.CdnIcon,
|
|
213
229
|
{
|
|
214
|
-
src:
|
|
215
|
-
alt:
|
|
230
|
+
src: _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _4 => _4.iconUrl]), () => ( _chunkTENL4H64cjs.getChainIcon.call(void 0, chainId))),
|
|
231
|
+
alt: name,
|
|
216
232
|
className,
|
|
217
233
|
loading,
|
|
218
234
|
fallback: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -220,8 +236,8 @@ function ChainIcon({ chainId, className, loading }) {
|
|
|
220
236
|
{
|
|
221
237
|
className: "rs-chain-badge-fallback",
|
|
222
238
|
style: { backgroundColor: badge.bg, color: badge.color },
|
|
223
|
-
"aria-label":
|
|
224
|
-
children:
|
|
239
|
+
"aria-label": name,
|
|
240
|
+
children: initial
|
|
225
241
|
}
|
|
226
242
|
)
|
|
227
243
|
}
|
|
@@ -232,16 +248,16 @@ ChainIcon.displayName = "ChainIcon";
|
|
|
232
248
|
// src/components/ui/WalletBadgeIcons/index.tsx
|
|
233
249
|
|
|
234
250
|
function BadgeImage({ src, alt = "" }) {
|
|
235
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
251
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.CdnIcon, { src, alt }) });
|
|
236
252
|
}
|
|
237
253
|
var WALLET_BADGES = ["rabby", "phantom", "walletconnect"];
|
|
238
254
|
function WalletBadgeIcons() {
|
|
239
|
-
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:
|
|
255
|
+
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)) });
|
|
240
256
|
}
|
|
241
257
|
WalletBadgeIcons.displayName = "WalletBadgeIcons";
|
|
242
258
|
var TRANSFER_CHAIN_BADGES = ["mainnet", "solana", "base"];
|
|
243
259
|
function ChainBadgeIcons() {
|
|
244
|
-
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:
|
|
260
|
+
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)) });
|
|
245
261
|
}
|
|
246
262
|
ChainBadgeIcons.displayName = "ChainBadgeIcons";
|
|
247
263
|
var MAX_WALLET_CHAIN_MARKS = 3;
|
|
@@ -261,23 +277,23 @@ var DAPP_IMPORT_CATALOG = [
|
|
|
261
277
|
{
|
|
262
278
|
id: "polymarket",
|
|
263
279
|
label: "Polymarket",
|
|
264
|
-
iconUrl:
|
|
280
|
+
iconUrl: _chunkTENL4H64cjs.cdnIconUrl.call(void 0, "dapps", "polymarket")
|
|
265
281
|
},
|
|
266
282
|
{
|
|
267
283
|
id: "aave",
|
|
268
284
|
label: "Aave",
|
|
269
|
-
iconUrl:
|
|
285
|
+
iconUrl: _chunkTENL4H64cjs.cdnIconUrl.call(void 0, "dapps", "aave")
|
|
270
286
|
},
|
|
271
287
|
{
|
|
272
288
|
id: "hyperliquid",
|
|
273
289
|
label: "Hyperliquid",
|
|
274
|
-
iconUrl:
|
|
290
|
+
iconUrl: _chunkTENL4H64cjs.cdnIconUrl.call(void 0, "dapps", "hyperliquid"),
|
|
275
291
|
comingSoon: true
|
|
276
292
|
},
|
|
277
293
|
{
|
|
278
294
|
id: "morpho",
|
|
279
295
|
label: "Morpho",
|
|
280
|
-
iconUrl:
|
|
296
|
+
iconUrl: _chunkTENL4H64cjs.cdnIconUrl.call(void 0, "dapps", "morpho"),
|
|
281
297
|
comingSoon: true
|
|
282
298
|
}
|
|
283
299
|
];
|
|
@@ -285,7 +301,7 @@ var DAPP_IMPORT_CATALOG = [
|
|
|
285
301
|
// src/components/ui/BrandIcons.tsx
|
|
286
302
|
|
|
287
303
|
function ExchangeBadgeImage({ name }) {
|
|
288
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
304
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.CdnIcon, { src: _nullishCoalesce(_chunkHUHBNYD3cjs.getExchangeLogoSrc.call(void 0, name), () => ( void 0)) });
|
|
289
305
|
}
|
|
290
306
|
var CARD_NETWORKS = ["amex", "visa", "mastercard"];
|
|
291
307
|
function CardNetworkIcons() {
|
|
@@ -293,20 +309,18 @@ function CardNetworkIcons() {
|
|
|
293
309
|
"span",
|
|
294
310
|
{
|
|
295
311
|
className: `rs-card-network rs-card-network--${network}`,
|
|
296
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
312
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.CdnIcon, { src: _chunkTENL4H64cjs.cdnIconUrl.call(void 0, "cards", network) })
|
|
297
313
|
},
|
|
298
314
|
network
|
|
299
315
|
)) });
|
|
300
316
|
}
|
|
301
317
|
CardNetworkIcons.displayName = "CardNetworkIcons";
|
|
318
|
+
var EXCHANGE_BADGE_ORDER = ["Coinbase", "Binance", "Bybit"];
|
|
302
319
|
function ExchangeBadgeIcons() {
|
|
303
|
-
return /* @__PURE__ */ _jsxruntime.
|
|
304
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExchangeBadgeImage, { name: "Coinbase" }) }),
|
|
305
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExchangeBadgeImage, { name: "Binance" }) }),
|
|
306
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExchangeBadgeImage, { name: "Kraken" }) })
|
|
307
|
-
] });
|
|
320
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-list-row-meta-icons rs-list-row-meta-icons--exchanges", children: EXCHANGE_BADGE_ORDER.map((name) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExchangeBadgeImage, { name }) }, name)) });
|
|
308
321
|
}
|
|
309
322
|
ExchangeBadgeIcons.displayName = "ExchangeBadgeIcons";
|
|
323
|
+
var EXCHANGE_BADGE_COUNT = EXCHANGE_BADGE_ORDER.length;
|
|
310
324
|
var DAPP_BADGE_ORDER = ["polymarket", "aave", "hyperliquid"];
|
|
311
325
|
function DappBadgeIcons() {
|
|
312
326
|
const marks = DAPP_BADGE_ORDER.map(
|
|
@@ -314,7 +328,7 @@ function DappBadgeIcons() {
|
|
|
314
328
|
).filter(
|
|
315
329
|
(brand) => Boolean(brand)
|
|
316
330
|
);
|
|
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,
|
|
331
|
+
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, _chunkZQR36NCVcjs.CdnIcon, { src: brand.iconUrl, alt: brand.label }) }, brand.id)) });
|
|
318
332
|
}
|
|
319
333
|
DappBadgeIcons.displayName = "DappBadgeIcons";
|
|
320
334
|
var DAPP_BADGE_COUNT = DAPP_BADGE_ORDER.length;
|
|
@@ -334,9 +348,9 @@ function balanceSubtitle(status, balanceUsd, fallback) {
|
|
|
334
348
|
return "No balance";
|
|
335
349
|
}
|
|
336
350
|
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,
|
|
351
|
+
if (name === "apple") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.AppleIcon, {});
|
|
352
|
+
if (name === "bank") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.BankIcon, {});
|
|
353
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.CardIcon, {});
|
|
340
354
|
}
|
|
341
355
|
function FiatMethodIcon({ option }) {
|
|
342
356
|
const [remoteFailed, setRemoteFailed] = _react.useState.call(void 0, false);
|
|
@@ -419,20 +433,24 @@ function renderWalletLeading(row) {
|
|
|
419
433
|
}
|
|
420
434
|
);
|
|
421
435
|
}
|
|
422
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
436
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.WalletIcon, {});
|
|
423
437
|
}
|
|
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,
|
|
438
|
+
var TRANSFER_CRYPTO_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.TransferCryptoIcon, {});
|
|
439
|
+
var WALLET_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.WalletIcon, {});
|
|
440
|
+
var EXCHANGE_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.UnplugIcon, {});
|
|
441
|
+
var MIGRATE_ASSETS_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.MigrateAssetsIcon, {});
|
|
442
|
+
var SMALL_SPINNER = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.Spinner, { className: "rs-spinner--sm" });
|
|
429
443
|
var CONNECT_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
430
444
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, WalletBadgeIcons, {}),
|
|
431
445
|
"+100"
|
|
432
446
|
] });
|
|
447
|
+
var EXTRA_EXCHANGE_COUNT = Math.max(
|
|
448
|
+
0,
|
|
449
|
+
_chunkZQR36NCVcjs.SUPPORTED_CONNECT_EXCHANGE_COUNT - EXCHANGE_BADGE_COUNT
|
|
450
|
+
);
|
|
433
451
|
var EXCHANGE_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
434
452
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExchangeBadgeIcons, {}),
|
|
435
|
-
|
|
453
|
+
EXTRA_EXCHANGE_COUNT > 0 ? `+${EXTRA_EXCHANGE_COUNT}` : null
|
|
436
454
|
] });
|
|
437
455
|
var EXTRA_DAPP_COUNT = Math.max(
|
|
438
456
|
0,
|
|
@@ -442,7 +460,7 @@ var MIGRATE_ASSETS_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxrunt
|
|
|
442
460
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, DappBadgeIcons, {}),
|
|
443
461
|
EXTRA_DAPP_COUNT > 0 ? `+${EXTRA_DAPP_COUNT}` : null
|
|
444
462
|
] });
|
|
445
|
-
var EXTRA_CHAIN_COUNT = Math.max(0,
|
|
463
|
+
var EXTRA_CHAIN_COUNT = Math.max(0, _chunkTENL4H64cjs.getSupportedChainIds.call(void 0, ).length - 3);
|
|
446
464
|
var CHAIN_BADGE_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
447
465
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChainBadgeIcons, {}),
|
|
448
466
|
EXTRA_CHAIN_COUNT > 0 ? `+${EXTRA_CHAIN_COUNT}` : null
|
|
@@ -486,7 +504,7 @@ function ConnectStep({
|
|
|
486
504
|
if (onSelectTransferCrypto) {
|
|
487
505
|
cryptoRows.push(
|
|
488
506
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
489
|
-
|
|
507
|
+
_chunkFVUXJ3RPcjs.ListRow,
|
|
490
508
|
{
|
|
491
509
|
leading: TRANSFER_CRYPTO_LEADING,
|
|
492
510
|
title: "Transfer crypto",
|
|
@@ -507,13 +525,13 @@ function ConnectStep({
|
|
|
507
525
|
);
|
|
508
526
|
cryptoRows.push(
|
|
509
527
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
510
|
-
|
|
528
|
+
_chunkFVUXJ3RPcjs.ListRow,
|
|
511
529
|
{
|
|
512
530
|
leading: renderWalletLeading(row),
|
|
513
531
|
title: collapseToExternal ? "External wallet" : row.label,
|
|
514
532
|
subtitle: subtitleText,
|
|
515
|
-
meta: row.kind === "solana" || !_optionalChain([row, 'access',
|
|
516
|
-
onClick: () => _optionalChain([onConfirmWallet, 'optionalCall',
|
|
533
|
+
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 }),
|
|
534
|
+
onClick: () => _optionalChain([onConfirmWallet, 'optionalCall', _7 => _7(row.id)]),
|
|
517
535
|
disabled: row.state === "loading",
|
|
518
536
|
trailing: renderRowTrailing(row.state)
|
|
519
537
|
},
|
|
@@ -524,7 +542,7 @@ function ConnectStep({
|
|
|
524
542
|
if (!hasReownWallet && handleConnect) {
|
|
525
543
|
cryptoRows.push(
|
|
526
544
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
527
|
-
|
|
545
|
+
_chunkFVUXJ3RPcjs.ListRow,
|
|
528
546
|
{
|
|
529
547
|
leading: WALLET_LEADING,
|
|
530
548
|
title: "Connect wallet",
|
|
@@ -539,7 +557,7 @@ function ConnectStep({
|
|
|
539
557
|
if (onSelectFundFromExchange) {
|
|
540
558
|
cryptoRows.push(
|
|
541
559
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
542
|
-
|
|
560
|
+
_chunkFVUXJ3RPcjs.ListRow,
|
|
543
561
|
{
|
|
544
562
|
leading: EXCHANGE_LEADING,
|
|
545
563
|
title: "Connect exchange",
|
|
@@ -554,7 +572,7 @@ function ConnectStep({
|
|
|
554
572
|
if (onSelectMigrateAssets) {
|
|
555
573
|
cryptoRows.push(
|
|
556
574
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
557
|
-
|
|
575
|
+
_chunkFVUXJ3RPcjs.ListRow,
|
|
558
576
|
{
|
|
559
577
|
leading: MIGRATE_ASSETS_LEADING,
|
|
560
578
|
title: "Migrate assets",
|
|
@@ -575,7 +593,7 @@ function ConnectStep({
|
|
|
575
593
|
for (const opt of fiatPaymentMethods) {
|
|
576
594
|
cashRows.push(
|
|
577
595
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
578
|
-
|
|
596
|
+
_chunkFVUXJ3RPcjs.ListRow,
|
|
579
597
|
{
|
|
580
598
|
leading: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FiatMethodIcon, { option: opt }),
|
|
581
599
|
title: opt.label,
|
|
@@ -590,7 +608,7 @@ function ConnectStep({
|
|
|
590
608
|
} else if (fiatLoading) {
|
|
591
609
|
cashRows.push(
|
|
592
610
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
593
|
-
|
|
611
|
+
_chunkFVUXJ3RPcjs.ListRow,
|
|
594
612
|
{
|
|
595
613
|
leading: SMALL_SPINNER,
|
|
596
614
|
title: "Loading payment options\u2026",
|
|
@@ -606,7 +624,7 @@ function ConnectStep({
|
|
|
606
624
|
const [tab, setTab] = _react.useState.call(void 0, defaultMethodTab);
|
|
607
625
|
const handleTabChange = (next) => {
|
|
608
626
|
setTab(next);
|
|
609
|
-
_optionalChain([onMethodTabChange, 'optionalCall',
|
|
627
|
+
_optionalChain([onMethodTabChange, 'optionalCall', _8 => _8(next)]);
|
|
610
628
|
};
|
|
611
629
|
const activeTab = showToggle ? tab : hasCash && !hasCrypto ? "cash" : "crypto";
|
|
612
630
|
const activeRows = activeTab === "cash" ? cashRows : cryptoRows;
|
|
@@ -619,9 +637,9 @@ function ConnectStep({
|
|
|
619
637
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
620
638
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
621
639
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
622
|
-
|
|
640
|
+
_chunkZQR36NCVcjs.BodyHeader,
|
|
623
641
|
{
|
|
624
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
642
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.HandCoinsIcon, {}),
|
|
625
643
|
title,
|
|
626
644
|
subtitle: _nullishCoalesce(subtitle, () => ( defaultSubtitle)),
|
|
627
645
|
aside: showToggle ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -657,7 +675,7 @@ function ConnectStep({
|
|
|
657
675
|
children: "Disconnect wallet"
|
|
658
676
|
}
|
|
659
677
|
) }),
|
|
660
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
678
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.PoweredBy, {})
|
|
661
679
|
] });
|
|
662
680
|
}
|
|
663
681
|
ConnectStep.displayName = "ConnectStep";
|
|
@@ -680,14 +698,17 @@ function AssetSelectStep({
|
|
|
680
698
|
const [selectedAssetId, setSelectedAssetId] = _react.useState.call(void 0, null);
|
|
681
699
|
const [loading, setLoading] = _react.useState.call(void 0, true);
|
|
682
700
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
701
|
+
const isDepositChain = _chunkZQR36NCVcjs.useIsDepositChain.call(void 0, );
|
|
702
|
+
const { catalog } = _chunkZQR36NCVcjs.useChainCatalog.call(void 0, );
|
|
703
|
+
const chainName = _chunkZQR36NCVcjs.useChainName.call(void 0, );
|
|
683
704
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
684
705
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
685
|
-
return
|
|
706
|
+
return _chunkZQR36NCVcjs.getAssetId.call(void 0, {
|
|
686
707
|
chainId: defaultSourceChain,
|
|
687
708
|
token: defaultSourceToken
|
|
688
709
|
});
|
|
689
710
|
}, [defaultSourceChain, defaultSourceToken]);
|
|
690
|
-
const onTotalBalanceComputedRef =
|
|
711
|
+
const onTotalBalanceComputedRef = _chunkZQR36NCVcjs.useLatestRef.call(void 0, onTotalBalanceComputed);
|
|
691
712
|
_react.useEffect.call(void 0, () => {
|
|
692
713
|
let active = true;
|
|
693
714
|
function emitAssetsUpdate(currentAssets) {
|
|
@@ -695,7 +716,7 @@ function AssetSelectStep({
|
|
|
695
716
|
(sum, asset) => sum + (_nullishCoalesce(asset.balanceUsd, () => ( 0))),
|
|
696
717
|
0
|
|
697
718
|
);
|
|
698
|
-
_optionalChain([onTotalBalanceComputedRef, 'access',
|
|
719
|
+
_optionalChain([onTotalBalanceComputedRef, 'access', _9 => _9.current, 'optionalCall', _10 => _10(total)]);
|
|
699
720
|
}
|
|
700
721
|
async function loadPortfolio() {
|
|
701
722
|
if (!address) {
|
|
@@ -707,17 +728,20 @@ function AssetSelectStep({
|
|
|
707
728
|
try {
|
|
708
729
|
const portfolio = await service.fetchPortfolio(address);
|
|
709
730
|
if (!active) return;
|
|
710
|
-
const portfolioAssets =
|
|
731
|
+
const portfolioAssets = _chunkZQR36NCVcjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
711
732
|
setAssets(portfolioAssets);
|
|
712
733
|
emitAssetsUpdate(portfolioAssets);
|
|
713
734
|
const hasNative = portfolioAssets.some(
|
|
714
|
-
(asset) => asset.token.toLowerCase() ===
|
|
735
|
+
(asset) => asset.token.toLowerCase() === _chunkTENL4H64cjs.NATIVE_TOKEN_ADDRESS
|
|
715
736
|
);
|
|
716
737
|
if (!hasNative) {
|
|
738
|
+
const connectedChainId = _optionalChain([publicClient, 'access', _11 => _11.chain, 'optionalAccess', _12 => _12.id]);
|
|
717
739
|
const nativeAssets = await fetchNativeAssets(
|
|
718
740
|
address,
|
|
719
741
|
publicClient,
|
|
720
|
-
portfolioAssets
|
|
742
|
+
portfolioAssets,
|
|
743
|
+
isDepositChain,
|
|
744
|
+
connectedChainId != null ? _optionalChain([catalog, 'optionalAccess', _13 => _13.byChainId, 'access', _14 => _14.get, 'call', _15 => _15(connectedChainId)]) : void 0
|
|
721
745
|
);
|
|
722
746
|
if (!active) return;
|
|
723
747
|
if (nativeAssets.length > 0) {
|
|
@@ -739,15 +763,23 @@ function AssetSelectStep({
|
|
|
739
763
|
return () => {
|
|
740
764
|
active = false;
|
|
741
765
|
};
|
|
742
|
-
}, [
|
|
766
|
+
}, [
|
|
767
|
+
address,
|
|
768
|
+
publicClient,
|
|
769
|
+
service,
|
|
770
|
+
onTotalBalanceComputedRef,
|
|
771
|
+
isDepositChain,
|
|
772
|
+
catalog
|
|
773
|
+
]);
|
|
743
774
|
const rows = _react.useMemo.call(void 0, () => {
|
|
744
775
|
return assets.filter((a) => {
|
|
776
|
+
if (!isDepositChain(a.chainId)) return false;
|
|
745
777
|
try {
|
|
746
778
|
if (BigInt(_nullishCoalesce(a.balance, () => ( "0"))) <= BigInt(0)) return false;
|
|
747
779
|
} catch (e2) {
|
|
748
780
|
return false;
|
|
749
781
|
}
|
|
750
|
-
const isNativeToken = a.token.toLowerCase() ===
|
|
782
|
+
const isNativeToken = a.token.toLowerCase() === _chunkTENL4H64cjs.NATIVE_TOKEN_ADDRESS;
|
|
751
783
|
if (!isNativeToken && !(typeof a.balanceUsd === "number" && a.balanceUsd >= 0.01))
|
|
752
784
|
return false;
|
|
753
785
|
return true;
|
|
@@ -761,7 +793,7 @@ function AssetSelectStep({
|
|
|
761
793
|
if (balB < balA) return -1;
|
|
762
794
|
return 0;
|
|
763
795
|
});
|
|
764
|
-
}, [assets]);
|
|
796
|
+
}, [assets, isDepositChain]);
|
|
765
797
|
_react.useEffect.call(void 0, () => {
|
|
766
798
|
if (!defaultAssetId || selectedAssetId) return;
|
|
767
799
|
if (rows.some((asset) => asset.id === defaultAssetId)) {
|
|
@@ -775,7 +807,7 @@ function AssetSelectStep({
|
|
|
775
807
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
776
808
|
const numeric = Number(raw);
|
|
777
809
|
if (!Number.isFinite(numeric)) return raw;
|
|
778
|
-
return
|
|
810
|
+
return _chunkZQR36NCVcjs.tokenFormatter.format(numeric);
|
|
779
811
|
} catch (e3) {
|
|
780
812
|
return asset.balance;
|
|
781
813
|
}
|
|
@@ -783,20 +815,20 @@ function AssetSelectStep({
|
|
|
783
815
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
784
816
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
785
817
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
786
|
-
|
|
818
|
+
_chunkZQR36NCVcjs.BodyHeader,
|
|
787
819
|
{
|
|
788
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
820
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.WalletIcon, {}),
|
|
789
821
|
title: "Your assets",
|
|
790
822
|
subtitle: "Select source assets to transfer"
|
|
791
823
|
}
|
|
792
824
|
),
|
|
793
825
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
794
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
826
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
795
827
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
796
828
|
] }),
|
|
797
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
829
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.Callout, { variant: "error", children: error }),
|
|
798
830
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
799
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
831
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
800
832
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
801
833
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
802
834
|
address.slice(0, 6),
|
|
@@ -816,8 +848,8 @@ function AssetSelectStep({
|
|
|
816
848
|
!loading && !error && rows.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: rows.map((asset) => {
|
|
817
849
|
const isSelected = selectedAssetId === asset.id;
|
|
818
850
|
const tokenAmount = formatBalance(asset);
|
|
819
|
-
const badge =
|
|
820
|
-
const chainIcon =
|
|
851
|
+
const badge = _chunkTENL4H64cjs.getChainBadge.call(void 0, asset.chainId);
|
|
852
|
+
const chainIcon = _chunkTENL4H64cjs.getChainIcon.call(void 0, asset.chainId);
|
|
821
853
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
822
854
|
"button",
|
|
823
855
|
{
|
|
@@ -829,13 +861,13 @@ function AssetSelectStep({
|
|
|
829
861
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
|
|
830
862
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-icon-wrapper", children: [
|
|
831
863
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
832
|
-
|
|
864
|
+
_chunkZQR36NCVcjs.TokenIcon,
|
|
833
865
|
{
|
|
834
866
|
symbol: asset.symbol,
|
|
835
867
|
fallback: asset.symbol.slice(0, 4)
|
|
836
868
|
}
|
|
837
869
|
) }),
|
|
838
|
-
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
870
|
+
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.CdnIcon, { src: chainIcon, alt: chainName(asset.chainId) }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
839
871
|
"span",
|
|
840
872
|
{
|
|
841
873
|
className: "rs-asset-chain-badge",
|
|
@@ -852,7 +884,7 @@ function AssetSelectStep({
|
|
|
852
884
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-name", children: asset.symbol }),
|
|
853
885
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-asset-chain", children: [
|
|
854
886
|
"on ",
|
|
855
|
-
|
|
887
|
+
chainName(asset.chainId)
|
|
856
888
|
] })
|
|
857
889
|
] }),
|
|
858
890
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-balance-small", children: [
|
|
@@ -862,14 +894,14 @@ function AssetSelectStep({
|
|
|
862
894
|
] })
|
|
863
895
|
] })
|
|
864
896
|
] }),
|
|
865
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ?
|
|
897
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunkZQR36NCVcjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
866
898
|
]
|
|
867
899
|
},
|
|
868
900
|
asset.id
|
|
869
901
|
);
|
|
870
902
|
}) }),
|
|
871
903
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
872
|
-
|
|
904
|
+
_chunkZQR36NCVcjs.Button,
|
|
873
905
|
{
|
|
874
906
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
875
907
|
disabled: !selectedAsset,
|
|
@@ -878,30 +910,31 @@ function AssetSelectStep({
|
|
|
878
910
|
}
|
|
879
911
|
)
|
|
880
912
|
] }),
|
|
881
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
913
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.PoweredBy, {})
|
|
882
914
|
] });
|
|
883
915
|
}
|
|
884
|
-
async function fetchNativeAssets(address, publicClient, existing) {
|
|
916
|
+
async function fetchNativeAssets(address, publicClient, existing, isDepositChain, catalogChain) {
|
|
885
917
|
const existingIds = new Set(existing.map((asset) => asset.id));
|
|
886
|
-
const connectedChainId = _optionalChain([publicClient, 'access',
|
|
918
|
+
const connectedChainId = _optionalChain([publicClient, 'access', _16 => _16.chain, 'optionalAccess', _17 => _17.id]);
|
|
887
919
|
if (!connectedChainId) return [];
|
|
888
|
-
if (!
|
|
889
|
-
const id =
|
|
920
|
+
if (!isDepositChain(connectedChainId)) return [];
|
|
921
|
+
const id = _chunkZQR36NCVcjs.getAssetId.call(void 0, {
|
|
890
922
|
chainId: connectedChainId,
|
|
891
|
-
token:
|
|
923
|
+
token: _chunkTENL4H64cjs.NATIVE_TOKEN_ADDRESS
|
|
892
924
|
});
|
|
893
925
|
if (existingIds.has(id)) return [];
|
|
894
926
|
try {
|
|
895
927
|
const balance = await publicClient.getBalance({ address });
|
|
896
|
-
const nativeSymbol =
|
|
928
|
+
const nativeSymbol = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _18 => _18.nativeToken, 'access', _19 => _19.symbol]), () => ( _chunkTENL4H64cjs.getNativeSymbol.call(void 0, connectedChainId)));
|
|
929
|
+
const nativeDecimals = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _20 => _20.nativeToken, 'access', _21 => _21.decimals]), () => ( 18));
|
|
897
930
|
return [
|
|
898
931
|
{
|
|
899
932
|
id,
|
|
900
933
|
chainId: connectedChainId,
|
|
901
|
-
token:
|
|
934
|
+
token: _chunkTENL4H64cjs.NATIVE_TOKEN_ADDRESS,
|
|
902
935
|
symbol: nativeSymbol,
|
|
903
936
|
name: nativeSymbol,
|
|
904
|
-
decimals:
|
|
937
|
+
decimals: nativeDecimals,
|
|
905
938
|
balance: balance.toString()
|
|
906
939
|
}
|
|
907
940
|
];
|
|
@@ -1054,12 +1087,13 @@ function AmountStep({
|
|
|
1054
1087
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
1055
1088
|
const hasAttemptedSwitch = _react.useRef.call(void 0, false);
|
|
1056
1089
|
const hasAppliedDefaultRef = _react.useRef.call(void 0, false);
|
|
1057
|
-
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess',
|
|
1090
|
+
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess', _22 => _22.trim, 'call', _23 => _23(), 'access', _24 => _24.toLowerCase, 'call', _25 => _25()]) === "max";
|
|
1058
1091
|
const chainMismatch = Boolean(
|
|
1059
|
-
_optionalChain([walletClient, 'optionalAccess',
|
|
1092
|
+
_optionalChain([walletClient, 'optionalAccess', _26 => _26.chain, 'optionalAccess', _27 => _27.id]) && walletClient.chain.id !== asset.chainId
|
|
1060
1093
|
);
|
|
1061
|
-
const
|
|
1062
|
-
const
|
|
1094
|
+
const targetChainId = _chunkTENL4H64cjs.targetChainToChainId.call(void 0, targetChain);
|
|
1095
|
+
const targetSymbol = _chunkTENL4H64cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
1096
|
+
const isSourceStablecoin = _chunkTENL4H64cjs.isStablecoinSymbol.call(void 0, asset.symbol);
|
|
1063
1097
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
1064
1098
|
if (tokenPriceUsdOverride !== void 0 && tokenPriceUsdOverride > 0)
|
|
1065
1099
|
return tokenPriceUsdOverride;
|
|
@@ -1087,7 +1121,7 @@ function AmountStep({
|
|
|
1087
1121
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
1088
1122
|
if (!balanceTarget || !publicClient) return;
|
|
1089
1123
|
try {
|
|
1090
|
-
const bal =
|
|
1124
|
+
const bal = _chunkZQR36NCVcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
1091
1125
|
address: asset.token,
|
|
1092
1126
|
abi: _viem.erc20Abi,
|
|
1093
1127
|
functionName: "balanceOf",
|
|
@@ -1108,7 +1142,7 @@ function AmountStep({
|
|
|
1108
1142
|
hasAttemptedSwitch.current = true;
|
|
1109
1143
|
switchChain(asset.chainId).catch((err) => {
|
|
1110
1144
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
1111
|
-
setError(
|
|
1145
|
+
setError(_chunkZQR36NCVcjs.formatUserError.call(void 0, raw));
|
|
1112
1146
|
});
|
|
1113
1147
|
}
|
|
1114
1148
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -1161,7 +1195,7 @@ function AmountStep({
|
|
|
1161
1195
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
1162
1196
|
const numeric = Number(raw);
|
|
1163
1197
|
if (!Number.isFinite(numeric)) return raw;
|
|
1164
|
-
return
|
|
1198
|
+
return _chunkZQR36NCVcjs.tokenFormatter.format(numeric);
|
|
1165
1199
|
} catch (e8) {
|
|
1166
1200
|
return "\u2026";
|
|
1167
1201
|
}
|
|
@@ -1180,8 +1214,8 @@ function AmountStep({
|
|
|
1180
1214
|
return null;
|
|
1181
1215
|
}
|
|
1182
1216
|
}, [numericAmount, isSourceStablecoin, hasPricing, tokenPriceUsd, asset.decimals]);
|
|
1183
|
-
const minDepositUsd =
|
|
1184
|
-
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
1217
|
+
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));
|
|
1218
|
+
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _30 => _30.maxDepositUsd]), () => ( null));
|
|
1185
1219
|
const isBelowMin = minDepositUsd !== null && numericAmount > 0 && amountUsd < minDepositUsd;
|
|
1186
1220
|
const isAboveMax = maxDepositUsd !== null && amountUsd > maxDepositUsd;
|
|
1187
1221
|
const exceedsBalance = Boolean(
|
|
@@ -1190,7 +1224,7 @@ function AmountStep({
|
|
|
1190
1224
|
const balanceAfterUsd = appBalanceUsd !== void 0 ? appBalanceUsd + numericAmount : null;
|
|
1191
1225
|
const handlePresetClick = (percentage) => {
|
|
1192
1226
|
if (balance === null) return;
|
|
1193
|
-
_optionalChain([onCtaClick, 'optionalCall',
|
|
1227
|
+
_optionalChain([onCtaClick, 'optionalCall', _31 => _31(percentage === 100 ? "Max" : `${percentage}%`)]);
|
|
1194
1228
|
const next = formatAmountFromBalance(
|
|
1195
1229
|
balance,
|
|
1196
1230
|
asset.decimals,
|
|
@@ -1237,7 +1271,7 @@ function AmountStep({
|
|
|
1237
1271
|
return;
|
|
1238
1272
|
}
|
|
1239
1273
|
setError(null);
|
|
1240
|
-
_optionalChain([onCtaClick, 'optionalCall',
|
|
1274
|
+
_optionalChain([onCtaClick, 'optionalCall', _32 => _32("continue")]);
|
|
1241
1275
|
onContinue(
|
|
1242
1276
|
sourceAmount.toString(),
|
|
1243
1277
|
effectiveAmount.toString(),
|
|
@@ -1246,11 +1280,12 @@ function AmountStep({
|
|
|
1246
1280
|
};
|
|
1247
1281
|
const continueLabel = exceedsBalance ? "Insufficient balance" : isAboveMax ? "Continue with max allowed deposit" : isBelowMin ? "Continue with minimum deposit" : "Continue";
|
|
1248
1282
|
const continueDisabled = chainMismatch || exceedsBalance || numericAmount === 0 && !isBelowMin || balance === null;
|
|
1249
|
-
const
|
|
1250
|
-
const
|
|
1283
|
+
const chainName = _chunkZQR36NCVcjs.useChainName.call(void 0, );
|
|
1284
|
+
const sourceChainName = chainName(asset.chainId);
|
|
1285
|
+
const targetChainName = chainName(targetChainId);
|
|
1251
1286
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
1252
1287
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
1253
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1288
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.WalletIcon, {}), title: "Wallet deposit" }),
|
|
1254
1289
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
1255
1290
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
1256
1291
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1270,13 +1305,13 @@ function AmountStep({
|
|
|
1270
1305
|
" available",
|
|
1271
1306
|
balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1272
1307
|
" (~",
|
|
1273
|
-
|
|
1308
|
+
_chunkZQR36NCVcjs.currencyFormatter.format(balanceUsd),
|
|
1274
1309
|
")"
|
|
1275
1310
|
] })
|
|
1276
1311
|
] }),
|
|
1277
1312
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
1278
1313
|
"Min. deposit ",
|
|
1279
|
-
|
|
1314
|
+
_chunkZQR36NCVcjs.currencyFormatter.format(minDepositUsd)
|
|
1280
1315
|
] })
|
|
1281
1316
|
] })
|
|
1282
1317
|
] }),
|
|
@@ -1301,7 +1336,7 @@ function AmountStep({
|
|
|
1301
1336
|
" ",
|
|
1302
1337
|
asset.symbol
|
|
1303
1338
|
] }),
|
|
1304
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1339
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.TokenIcon, { symbol: asset.symbol }) })
|
|
1305
1340
|
] })
|
|
1306
1341
|
] }),
|
|
1307
1342
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
@@ -1312,18 +1347,17 @@ function AmountStep({
|
|
|
1312
1347
|
" ",
|
|
1313
1348
|
targetSymbol
|
|
1314
1349
|
] }),
|
|
1315
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1350
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.TokenIcon, { symbol: targetSymbol }) })
|
|
1316
1351
|
] })
|
|
1317
1352
|
] }),
|
|
1318
1353
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
1319
1354
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
1320
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
1355
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkZQR36NCVcjs.currencyFormatter.format(balanceAfterUsd) })
|
|
1321
1356
|
] })
|
|
1322
1357
|
] }),
|
|
1323
|
-
|
|
1324
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.Callout, { variant: "error", children: error }),
|
|
1358
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.Callout, { variant: "error", children: error }),
|
|
1325
1359
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1326
|
-
|
|
1360
|
+
_chunkZQR36NCVcjs.Button,
|
|
1327
1361
|
{
|
|
1328
1362
|
onClick: handleContinue,
|
|
1329
1363
|
fullWidth: true,
|
|
@@ -1332,7 +1366,7 @@ function AmountStep({
|
|
|
1332
1366
|
}
|
|
1333
1367
|
)
|
|
1334
1368
|
] }),
|
|
1335
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1369
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.PoweredBy, {})
|
|
1336
1370
|
] });
|
|
1337
1371
|
}
|
|
1338
1372
|
|
|
@@ -1379,7 +1413,7 @@ function ConfirmStep({
|
|
|
1379
1413
|
const [quoteResult, setQuoteResult] = _react.useState.call(void 0, null);
|
|
1380
1414
|
const hasAttemptedSwitch = _react.useRef.call(void 0, false);
|
|
1381
1415
|
const chainMismatch = Boolean(
|
|
1382
|
-
_optionalChain([walletClient, 'optionalAccess',
|
|
1416
|
+
_optionalChain([walletClient, 'optionalAccess', _33 => _33.chain, 'optionalAccess', _34 => _34.id]) && walletClient.chain.id !== asset.chainId
|
|
1383
1417
|
);
|
|
1384
1418
|
const sameRoute = targetChain === asset.chainId && targetToken.toLowerCase() === asset.token.toLowerCase();
|
|
1385
1419
|
const quoteSource = isDappImportAsset(asset) ? { chainId: asset.depositChainId, token: asset.depositToken } : { chainId: asset.chainId, token: asset.token };
|
|
@@ -1394,40 +1428,41 @@ function ConfirmStep({
|
|
|
1394
1428
|
targetToken,
|
|
1395
1429
|
recipient
|
|
1396
1430
|
]);
|
|
1397
|
-
const quote = setupReady && _optionalChain([quoteResult, 'optionalAccess',
|
|
1398
|
-
const
|
|
1399
|
-
const
|
|
1400
|
-
const
|
|
1401
|
-
const
|
|
1402
|
-
const
|
|
1403
|
-
const
|
|
1404
|
-
const
|
|
1431
|
+
const quote = setupReady && _optionalChain([quoteResult, 'optionalAccess', _35 => _35.requestKey]) === quoteRequestKey ? quoteResult.quote : null;
|
|
1432
|
+
const targetChainId = _chunkTENL4H64cjs.targetChainToChainId.call(void 0, targetChain);
|
|
1433
|
+
const targetSymbol = sameRoute ? asset.symbol : _chunkTENL4H64cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
1434
|
+
const sourceChainName = _chunkTENL4H64cjs.getChainName.call(void 0, asset.chainId);
|
|
1435
|
+
const targetChainName = _chunkTENL4H64cjs.getChainName.call(void 0, targetChainId);
|
|
1436
|
+
const sourceChainIcon = _chunkTENL4H64cjs.getChainIcon.call(void 0, asset.chainId);
|
|
1437
|
+
const targetChainIcon = _chunkTENL4H64cjs.getChainIcon.call(void 0, targetChainId);
|
|
1438
|
+
const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? _nullishCoalesce(_chunkZQR36NCVcjs.formatTokenAmount.call(void 0, Number(amount), asset.symbol), () => ( "0")) : "0";
|
|
1439
|
+
const mustHaveQuote = !appFeesResolved || _chunkZQR36NCVcjs.resolveAppFeeBps.call(void 0,
|
|
1405
1440
|
appFees,
|
|
1406
1441
|
`eip155:${quoteSource.chainId}`,
|
|
1407
1442
|
quoteSource.token
|
|
1408
1443
|
) > 0;
|
|
1409
|
-
const { display: feeDisplay, struck: feesFullySponsored } =
|
|
1410
|
-
_optionalChain([quote, 'optionalAccess',
|
|
1444
|
+
const { display: feeDisplay, struck: feesFullySponsored } = _chunkZQR36NCVcjs.quoteFeeRow.call(void 0,
|
|
1445
|
+
_optionalChain([quote, 'optionalAccess', _36 => _36.fees])
|
|
1411
1446
|
);
|
|
1412
1447
|
const directTransfer = sameRoute && !mustHaveQuote && !executeTransfer;
|
|
1413
1448
|
const receiveDisplay = (() => {
|
|
1414
1449
|
if (directTransfer) return `${formattedSendAmount} ${asset.symbol}`;
|
|
1415
1450
|
if (quote) {
|
|
1416
|
-
const quoted =
|
|
1451
|
+
const quoted = _chunkZQR36NCVcjs.formatQuotedReceive.call(void 0, quote.output, targetSymbol);
|
|
1417
1452
|
if (quoted !== void 0) return quoted;
|
|
1418
1453
|
}
|
|
1419
1454
|
const usdValue = Number(targetAmount);
|
|
1420
1455
|
const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
|
|
1421
|
-
const estimate =
|
|
1456
|
+
const estimate = _chunkZQR36NCVcjs.formatReceiveEstimate.call(void 0, {
|
|
1422
1457
|
sourceAmount: Number.isFinite(Number(amount)) ? Number(amount) : void 0,
|
|
1423
1458
|
sourceSymbol: asset.symbol,
|
|
1424
1459
|
targetSymbol,
|
|
1425
1460
|
sourceAmountUsd,
|
|
1426
|
-
sourceTrusted:
|
|
1461
|
+
sourceTrusted: _chunkZQR36NCVcjs.isRecognizedToken.call(void 0, asset.token, asset.chainId),
|
|
1427
1462
|
// The target is the curated deposit destination, so a stablecoin target
|
|
1428
1463
|
// estimates at $1 when unquoted (DepositFlow skips fetching stablecoin
|
|
1429
1464
|
// target prices). Not applied to the source — that can be a held token.
|
|
1430
|
-
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } :
|
|
1465
|
+
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : _chunkZQR36NCVcjs.isDisplayStablecoinSymbol.call(void 0, targetSymbol) ? { [targetSymbol.toUpperCase()]: 1 } : {}
|
|
1431
1466
|
});
|
|
1432
1467
|
if (estimate !== void 0) return estimate;
|
|
1433
1468
|
return targetSymbol;
|
|
@@ -1438,7 +1473,7 @@ function ConfirmStep({
|
|
|
1438
1473
|
hasAttemptedSwitch.current = true;
|
|
1439
1474
|
switchChain(asset.chainId).catch((err) => {
|
|
1440
1475
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
1441
|
-
setError(
|
|
1476
|
+
setError(_chunkZQR36NCVcjs.formatUserError.call(void 0, raw));
|
|
1442
1477
|
});
|
|
1443
1478
|
}
|
|
1444
1479
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -1527,7 +1562,7 @@ function ConfirmStep({
|
|
|
1527
1562
|
const result = await executeTransfer(amountUnits);
|
|
1528
1563
|
hash = result.txHash;
|
|
1529
1564
|
resolvedSourceToken = result.sourceToken;
|
|
1530
|
-
} else if (
|
|
1565
|
+
} else if (_chunkZQR36NCVcjs.isNativeAsset.call(void 0, asset)) {
|
|
1531
1566
|
hash = await walletClient.sendTransaction({
|
|
1532
1567
|
account,
|
|
1533
1568
|
chain,
|
|
@@ -1544,7 +1579,7 @@ function ConfirmStep({
|
|
|
1544
1579
|
args: [transferTo, amountUnits]
|
|
1545
1580
|
});
|
|
1546
1581
|
}
|
|
1547
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
1582
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _37 => _37(hash, asset.chainId, amountUnits.toString())]);
|
|
1548
1583
|
onConfirm(
|
|
1549
1584
|
hash,
|
|
1550
1585
|
asset.chainId,
|
|
@@ -1558,29 +1593,29 @@ function ConfirmStep({
|
|
|
1558
1593
|
);
|
|
1559
1594
|
} catch (err) {
|
|
1560
1595
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
1561
|
-
const message =
|
|
1596
|
+
const message = _chunkZQR36NCVcjs.formatUserError.call(void 0, raw);
|
|
1562
1597
|
setError(message);
|
|
1563
|
-
_optionalChain([onError, 'optionalCall',
|
|
1598
|
+
_optionalChain([onError, 'optionalCall', _38 => _38(message, "TRANSFER_ERROR", raw)]);
|
|
1564
1599
|
} finally {
|
|
1565
1600
|
setIsSubmitting(false);
|
|
1566
1601
|
}
|
|
1567
1602
|
};
|
|
1568
1603
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
1569
1604
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
1570
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1605
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.WalletIcon, {}), title: "Review deposit" }),
|
|
1571
1606
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
|
|
1572
1607
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1573
1608
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
1574
1609
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1575
1610
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceChainName }),
|
|
1576
|
-
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1611
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.CdnIcon, { src: sourceChainIcon }) })
|
|
1577
1612
|
] })
|
|
1578
1613
|
] }),
|
|
1579
1614
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1580
1615
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
|
|
1581
1616
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1582
1617
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName }),
|
|
1583
|
-
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1618
|
+
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.CdnIcon, { src: targetChainIcon }) })
|
|
1584
1619
|
] })
|
|
1585
1620
|
] }),
|
|
1586
1621
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -1595,14 +1630,14 @@ function ConfirmStep({
|
|
|
1595
1630
|
" ",
|
|
1596
1631
|
asset.symbol
|
|
1597
1632
|
] }),
|
|
1598
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1633
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.TokenIcon, { symbol: asset.symbol }) })
|
|
1599
1634
|
] })
|
|
1600
1635
|
] }),
|
|
1601
1636
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1602
1637
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Receive" }),
|
|
1603
1638
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1604
1639
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: receiveDisplay }),
|
|
1605
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1640
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.TokenIcon, { symbol: targetSymbol }) })
|
|
1606
1641
|
] })
|
|
1607
1642
|
] }),
|
|
1608
1643
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -1622,10 +1657,9 @@ function ConfirmStep({
|
|
|
1622
1657
|
) })
|
|
1623
1658
|
] })
|
|
1624
1659
|
] }),
|
|
1625
|
-
|
|
1626
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.Callout, { variant: "error", children: error }),
|
|
1660
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.Callout, { variant: "error", children: error }),
|
|
1627
1661
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1628
|
-
|
|
1662
|
+
_chunkZQR36NCVcjs.Button,
|
|
1629
1663
|
{
|
|
1630
1664
|
onClick: handleConfirm,
|
|
1631
1665
|
loading: isSubmitting,
|
|
@@ -1639,7 +1673,7 @@ function ConfirmStep({
|
|
|
1639
1673
|
}
|
|
1640
1674
|
)
|
|
1641
1675
|
] }),
|
|
1642
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1676
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.PoweredBy, {})
|
|
1643
1677
|
] });
|
|
1644
1678
|
}
|
|
1645
1679
|
|
|
@@ -1662,9 +1696,9 @@ var INITIAL_POLL_INTERVAL = 3e3;
|
|
|
1662
1696
|
var MAX_POLL_INTERVAL = 3e4;
|
|
1663
1697
|
var BACKOFF_MULTIPLIER = 1.5;
|
|
1664
1698
|
function isEventForTx(event, txHash) {
|
|
1665
|
-
const eventTxHash =
|
|
1699
|
+
const eventTxHash = _chunkHUHBNYD3cjs.getEventTxHash.call(void 0, event);
|
|
1666
1700
|
if (!eventTxHash) return false;
|
|
1667
|
-
return
|
|
1701
|
+
return _chunkHUHBNYD3cjs.txRefsMatch.call(void 0, eventTxHash, txHash);
|
|
1668
1702
|
}
|
|
1669
1703
|
function truncateHash(hash) {
|
|
1670
1704
|
return `${hash.slice(0, 4)}\u2026${hash.slice(-4)}`;
|
|
@@ -1694,7 +1728,7 @@ function formatTimestamp(ms) {
|
|
|
1694
1728
|
return `${month} ${day}${suffix} \xB7 ${hours}:${minutes}:${seconds}`;
|
|
1695
1729
|
}
|
|
1696
1730
|
function formatBridgeFailedMessage(event) {
|
|
1697
|
-
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess',
|
|
1731
|
+
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _39 => _39.data]), () => ( {}));
|
|
1698
1732
|
const backendMessage = typeof eventData.message === "string" ? eventData.message.trim() : "";
|
|
1699
1733
|
if (backendMessage.length > 0) {
|
|
1700
1734
|
const lower = backendMessage.toLowerCase();
|
|
@@ -1714,7 +1748,7 @@ function formatBridgeFailedMessage(event) {
|
|
|
1714
1748
|
}
|
|
1715
1749
|
return "Bridge failed";
|
|
1716
1750
|
}
|
|
1717
|
-
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1751
|
+
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.ExternalLinkIcon, { className: "rs-deposit-notification-link-icon" });
|
|
1718
1752
|
function DepositNotification({
|
|
1719
1753
|
deposit,
|
|
1720
1754
|
smartAccount,
|
|
@@ -1748,7 +1782,7 @@ function DepositNotification({
|
|
|
1748
1782
|
const pollIntervalRef = _react.useRef.call(void 0, INITIAL_POLL_INTERVAL);
|
|
1749
1783
|
const pollTimeoutRef = _react.useRef.call(void 0, null);
|
|
1750
1784
|
const completedRef = _react.useRef.call(void 0, _nullishCoalesce(directTransfer, () => ( false)));
|
|
1751
|
-
const depositContextRef =
|
|
1785
|
+
const depositContextRef = _chunkZQR36NCVcjs.useLatestRef.call(void 0, {
|
|
1752
1786
|
amount,
|
|
1753
1787
|
sourceChain,
|
|
1754
1788
|
sourceToken: token,
|
|
@@ -1756,8 +1790,8 @@ function DepositNotification({
|
|
|
1756
1790
|
targetChain,
|
|
1757
1791
|
targetToken
|
|
1758
1792
|
});
|
|
1759
|
-
const onCompleteRef =
|
|
1760
|
-
const onFailedRef =
|
|
1793
|
+
const onCompleteRef = _chunkZQR36NCVcjs.useLatestRef.call(void 0, onComplete);
|
|
1794
|
+
const onFailedRef = _chunkZQR36NCVcjs.useLatestRef.call(void 0, onFailed);
|
|
1761
1795
|
const handleComplete = _react.useCallback.call(void 0,
|
|
1762
1796
|
(destTxHash) => {
|
|
1763
1797
|
if (completedRef.current) return;
|
|
@@ -1766,7 +1800,7 @@ function DepositNotification({
|
|
|
1766
1800
|
setCompletedAt(Date.now());
|
|
1767
1801
|
setStatus("complete");
|
|
1768
1802
|
const context = depositContextRef.current;
|
|
1769
|
-
_optionalChain([onCompleteRef, 'access',
|
|
1803
|
+
_optionalChain([onCompleteRef, 'access', _40 => _40.current, 'optionalCall', _41 => _41(txHash, destTxHash, {
|
|
1770
1804
|
amount: context.amount,
|
|
1771
1805
|
sourceChain: context.sourceChain,
|
|
1772
1806
|
sourceToken: context.sourceToken,
|
|
@@ -1782,7 +1816,7 @@ function DepositNotification({
|
|
|
1782
1816
|
if (completedRef.current) return;
|
|
1783
1817
|
completedRef.current = true;
|
|
1784
1818
|
setStatus("failed");
|
|
1785
|
-
_optionalChain([onFailedRef, 'access',
|
|
1819
|
+
_optionalChain([onFailedRef, 'access', _42 => _42.current, 'optionalCall', _43 => _43(txHash, error)]);
|
|
1786
1820
|
},
|
|
1787
1821
|
[onFailedRef, txHash]
|
|
1788
1822
|
);
|
|
@@ -1800,17 +1834,17 @@ function DepositNotification({
|
|
|
1800
1834
|
if (!isMounted) return;
|
|
1801
1835
|
const lastEvent = data.lastEvent;
|
|
1802
1836
|
const eventForTx = isEventForTx(lastEvent, txHash) ? lastEvent : void 0;
|
|
1803
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
1804
|
-
const destTx = _optionalChain([eventForTx, 'access',
|
|
1837
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _44 => _44.type]) === "bridge-complete") {
|
|
1838
|
+
const destTx = _optionalChain([eventForTx, 'access', _45 => _45.data, 'optionalAccess', _46 => _46.destination, 'optionalAccess', _47 => _47.transactionHash]);
|
|
1805
1839
|
handleComplete(destTx);
|
|
1806
1840
|
return;
|
|
1807
1841
|
}
|
|
1808
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
1842
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _48 => _48.type]) === "bridge-failed") {
|
|
1809
1843
|
handleFailed(formatBridgeFailedMessage(eventForTx));
|
|
1810
1844
|
return;
|
|
1811
1845
|
}
|
|
1812
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
1813
|
-
const errorMessage = _nullishCoalesce(_optionalChain([eventForTx, 'access',
|
|
1846
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _49 => _49.type]) === "error") {
|
|
1847
|
+
const errorMessage = _nullishCoalesce(_optionalChain([eventForTx, 'access', _50 => _50.data, 'optionalAccess', _51 => _51.message]), () => ( "Unknown error"));
|
|
1814
1848
|
handleFailed(errorMessage);
|
|
1815
1849
|
return;
|
|
1816
1850
|
}
|
|
@@ -1848,11 +1882,12 @@ function DepositNotification({
|
|
|
1848
1882
|
status,
|
|
1849
1883
|
txHash
|
|
1850
1884
|
]);
|
|
1851
|
-
const
|
|
1852
|
-
const
|
|
1885
|
+
const explorerTxUrl = _chunkZQR36NCVcjs.useExplorerTxUrl.call(void 0, );
|
|
1886
|
+
const sourceExplorerUrl = sourceChain === "unknown" ? void 0 : explorerTxUrl(sourceChain, txHash);
|
|
1887
|
+
const destExplorerUrl = destinationTxHash ? explorerTxUrl(_chunkTENL4H64cjs.targetChainToChainId.call(void 0, targetChain), destinationTxHash) : null;
|
|
1853
1888
|
const title = status === "complete" ? "Deposit completed" : status === "failed" ? "Deposit failed" : "Deposit received and processing\u2026";
|
|
1854
1889
|
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.";
|
|
1855
|
-
const statusIcon = status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--complete", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1890
|
+
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, _chunkZQR36NCVcjs.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, _chunkZQR36NCVcjs.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,
|
|
1856
1891
|
"svg",
|
|
1857
1892
|
{
|
|
1858
1893
|
className: "rs-deposit-notification-spinner",
|
|
@@ -1902,7 +1937,7 @@ function DepositNotification({
|
|
|
1902
1937
|
className: "rs-deposit-notification-close",
|
|
1903
1938
|
onClick: () => onDismiss(deposit.id),
|
|
1904
1939
|
"aria-label": "Dismiss",
|
|
1905
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1940
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.CloseIcon, {})
|
|
1906
1941
|
}
|
|
1907
1942
|
)
|
|
1908
1943
|
] }),
|
|
@@ -1918,7 +1953,7 @@ function DepositNotification({
|
|
|
1918
1953
|
"aria-expanded": expanded,
|
|
1919
1954
|
children: [
|
|
1920
1955
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: expanded ? "See less details" : "See more details" }),
|
|
1921
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1956
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.ChevronDownIcon, { className: "rs-deposit-notification-toggle-chevron" })
|
|
1922
1957
|
]
|
|
1923
1958
|
}
|
|
1924
1959
|
),
|
|
@@ -2008,7 +2043,7 @@ function asString(value) {
|
|
|
2008
2043
|
function resolveSolanaTokenMeta(token) {
|
|
2009
2044
|
if (!token) return {};
|
|
2010
2045
|
const normalized = token.toLowerCase();
|
|
2011
|
-
const matched =
|
|
2046
|
+
const matched = _chunkTENL4H64cjs.SOLANA_TOKENS.find(
|
|
2012
2047
|
(entry) => entry.mint.toLowerCase() === normalized
|
|
2013
2048
|
);
|
|
2014
2049
|
if (matched) {
|
|
@@ -2020,7 +2055,7 @@ function resolveSolanaTokenMeta(token) {
|
|
|
2020
2055
|
return {};
|
|
2021
2056
|
}
|
|
2022
2057
|
function getDepositEventDetails(event) {
|
|
2023
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
2058
|
+
if (!_optionalChain([event, 'optionalAccess', _52 => _52.type]) || !isRecord(event.data)) return {};
|
|
2024
2059
|
if (event.type === "deposit-received") {
|
|
2025
2060
|
const chainId = asChainId(event.data.chain);
|
|
2026
2061
|
const token = asString(event.data.token);
|
|
@@ -2035,12 +2070,12 @@ function getDepositEventDetails(event) {
|
|
|
2035
2070
|
const source = isRecord(event.data.source) ? event.data.source : void 0;
|
|
2036
2071
|
const deposit = isRecord(event.data.deposit) ? event.data.deposit : void 0;
|
|
2037
2072
|
if (source || deposit) {
|
|
2038
|
-
const chainId = _nullishCoalesce(asChainId(_optionalChain([source, 'optionalAccess',
|
|
2039
|
-
const token = _nullishCoalesce(_nullishCoalesce(asString(_optionalChain([source, 'optionalAccess',
|
|
2073
|
+
const chainId = _nullishCoalesce(asChainId(_optionalChain([source, 'optionalAccess', _53 => _53.chain])), () => ( asChainId(_optionalChain([deposit, 'optionalAccess', _54 => _54.chain]))));
|
|
2074
|
+
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]))));
|
|
2040
2075
|
const solanaMeta = chainId === "solana" ? resolveSolanaTokenMeta(token) : {};
|
|
2041
2076
|
return {
|
|
2042
2077
|
chainId,
|
|
2043
|
-
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess',
|
|
2078
|
+
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess', _58 => _58.amount])), () => ( asAmount(_optionalChain([deposit, 'optionalAccess', _59 => _59.amount])))),
|
|
2044
2079
|
token,
|
|
2045
2080
|
...solanaMeta
|
|
2046
2081
|
};
|
|
@@ -2050,25 +2085,29 @@ function getDepositEventDetails(event) {
|
|
|
2050
2085
|
function isSameRoute(sourceChain, sourceToken, targetChain, targetToken) {
|
|
2051
2086
|
return sourceChain === targetChain && sourceToken.toLowerCase() === targetToken.toLowerCase();
|
|
2052
2087
|
}
|
|
2053
|
-
function chainLabel(chainId) {
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
const
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
)))
|
|
2063
|
-
return
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2088
|
+
function chainLabel(chainId, catalogChain) {
|
|
2089
|
+
const name = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _60 => _60.name]), () => ( _chunkTENL4H64cjs.getChainName.call(void 0, chainId)));
|
|
2090
|
+
return name.replace(/\s+(One|Mainnet|Smart Chain|Chain)$/i, "");
|
|
2091
|
+
}
|
|
2092
|
+
function computeTokensForChain(chainId, topTokens, catalogChain) {
|
|
2093
|
+
const fromBackend = _optionalChain([topTokens, 'optionalAccess', _61 => _61[String(chainId)], 'optionalAccess', _62 => _62.map, 'call', _63 => _63((t) => t.symbol)]);
|
|
2094
|
+
if (fromBackend) return fromBackend;
|
|
2095
|
+
if (chainId === "solana") return _chunkTENL4H64cjs.SOLANA_TOKENS.map((t) => t.symbol);
|
|
2096
|
+
if (chainId === "hypercore") return ["USDC", "USDT0"];
|
|
2097
|
+
const bundled = _chunkTENL4H64cjs.getBundledTargetTokens.call(void 0, chainId).map((t) => t.symbol);
|
|
2098
|
+
if (bundled.length > 0) return bundled;
|
|
2099
|
+
return Array.isArray(_optionalChain([catalogChain, 'optionalAccess', _64 => _64.supportedTokens])) ? catalogChain.supportedTokens.map((t) => t.symbol) : [];
|
|
2100
|
+
}
|
|
2101
|
+
function resolveSourceTokenAddress(symbol, chainId, topTokens, catalogChain) {
|
|
2102
|
+
const top = _optionalChain([topTokens, 'optionalAccess', _65 => _65[String(chainId)], 'optionalAccess', _66 => _66.find, 'call', _67 => _67((t) => t.symbol === symbol)]);
|
|
2103
|
+
if (_optionalChain([top, 'optionalAccess', _68 => _68.address])) return top.address;
|
|
2104
|
+
const fromRegistry = _chunkTENL4H64cjs.getTokenAddress.call(void 0, symbol, chainId);
|
|
2105
|
+
if (fromRegistry) return fromRegistry;
|
|
2106
|
+
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;
|
|
2068
2107
|
}
|
|
2069
2108
|
function TokenGlyph({ symbol }) {
|
|
2070
2109
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2071
|
-
|
|
2110
|
+
_chunkZQR36NCVcjs.TokenIcon,
|
|
2072
2111
|
{
|
|
2073
2112
|
symbol,
|
|
2074
2113
|
className: "rs-deposit-address-dropdown-icon",
|
|
@@ -2098,25 +2137,38 @@ function DepositAddressStep({
|
|
|
2098
2137
|
const [topTokens, setTopTokens] = _react.useState.call(void 0, null);
|
|
2099
2138
|
_react.useEffect.call(void 0, () => {
|
|
2100
2139
|
let active = true;
|
|
2140
|
+
setTopTokens(null);
|
|
2101
2141
|
service.getTopTokens().then((t) => {
|
|
2102
|
-
if (active)
|
|
2142
|
+
if (!active) return;
|
|
2143
|
+
setTopTokens(t);
|
|
2144
|
+
if (t) _chunkTENL4H64cjs.publishShortlistTokens.call(void 0, t);
|
|
2103
2145
|
});
|
|
2104
2146
|
return () => {
|
|
2105
2147
|
active = false;
|
|
2106
2148
|
};
|
|
2107
2149
|
}, [service]);
|
|
2108
2150
|
const BASE_CHAIN_ID2 = 8453;
|
|
2109
|
-
const evmChainIds =
|
|
2151
|
+
const evmChainIds = _chunkZQR36NCVcjs.useDepositChainIds.call(void 0, );
|
|
2152
|
+
const { catalog } = _chunkZQR36NCVcjs.useChainCatalog.call(void 0, );
|
|
2153
|
+
const catalogFor = _react.useCallback.call(void 0,
|
|
2154
|
+
(chain) => {
|
|
2155
|
+
if (!catalog) return void 0;
|
|
2156
|
+
const key = _chunkZQR36NCVcjs.catalogKeyForChain.call(void 0, chain);
|
|
2157
|
+
return typeof key === "number" ? catalog.byChainId.get(key) : catalog.byCaip2.get(key);
|
|
2158
|
+
},
|
|
2159
|
+
[catalog]
|
|
2160
|
+
);
|
|
2110
2161
|
const chainOptions = _react.useMemo.call(void 0, () => {
|
|
2162
|
+
const acceptsDeposits = (chain) => _optionalChain([catalogFor, 'call', _74 => _74(chain), 'optionalAccess', _75 => _75.deposit]) !== false;
|
|
2111
2163
|
const options = [...evmChainIds];
|
|
2112
2164
|
const extras = [];
|
|
2113
|
-
if (hasSolana) extras.push("solana");
|
|
2114
|
-
extras.push("hypercore");
|
|
2165
|
+
if (hasSolana && acceptsDeposits("solana")) extras.push("solana");
|
|
2166
|
+
if (acceptsDeposits("hypercore")) extras.push("hypercore");
|
|
2115
2167
|
options.splice(1, 0, ...extras);
|
|
2116
2168
|
return options.filter(
|
|
2117
|
-
(chain) => _optionalChain([topTokens, 'optionalAccess',
|
|
2169
|
+
(chain) => _optionalChain([topTokens, 'optionalAccess', _76 => _76[String(chain)], 'optionalAccess', _77 => _77.length]) !== 0 && computeTokensForChain(chain, topTokens, catalogFor(chain)).length > 0
|
|
2118
2170
|
);
|
|
2119
|
-
}, [evmChainIds, hasSolana, topTokens]);
|
|
2171
|
+
}, [evmChainIds, hasSolana, topTokens, catalogFor]);
|
|
2120
2172
|
const preferredChainId = (options) => options.includes(BASE_CHAIN_ID2) ? BASE_CHAIN_ID2 : _nullishCoalesce(options[0], () => ( BASE_CHAIN_ID2));
|
|
2121
2173
|
const [sourceChainId, setSourceChainId] = _react.useState.call(void 0, () => preferredChainId(chainOptions));
|
|
2122
2174
|
_react.useEffect.call(void 0, () => {
|
|
@@ -2127,8 +2179,8 @@ function DepositAddressStep({
|
|
|
2127
2179
|
const isSolana = sourceChainId === "solana";
|
|
2128
2180
|
const isHyperCore = sourceChainId === "hypercore";
|
|
2129
2181
|
const tokensForChain = _react.useMemo.call(void 0,
|
|
2130
|
-
() => computeTokensForChain(sourceChainId, topTokens),
|
|
2131
|
-
[sourceChainId, topTokens]
|
|
2182
|
+
() => computeTokensForChain(sourceChainId, topTokens, catalogFor(sourceChainId)),
|
|
2183
|
+
[sourceChainId, topTokens, catalogFor]
|
|
2132
2184
|
);
|
|
2133
2185
|
const defaultToken = pickFallbackToken(tokensForChain, "USDC");
|
|
2134
2186
|
const [sourceTokenSymbol, setSourceTokenSymbol] = _react.useState.call(void 0, defaultToken);
|
|
@@ -2159,7 +2211,8 @@ function DepositAddressStep({
|
|
|
2159
2211
|
const sourceTokenAddress = resolveSourceTokenAddress(
|
|
2160
2212
|
sourceTokenSymbol,
|
|
2161
2213
|
sourceChainId,
|
|
2162
|
-
topTokens
|
|
2214
|
+
topTokens,
|
|
2215
|
+
catalogFor(sourceChainId)
|
|
2163
2216
|
);
|
|
2164
2217
|
if (!sourceTokenAddress) {
|
|
2165
2218
|
setLiquidityHelper({ kind: "idle" });
|
|
@@ -2170,7 +2223,7 @@ function DepositAddressStep({
|
|
|
2170
2223
|
service.checkLiquidity({
|
|
2171
2224
|
sourceChainId,
|
|
2172
2225
|
sourceToken: sourceTokenAddress,
|
|
2173
|
-
destinationChainId: targetChain,
|
|
2226
|
+
destinationChainId: _chunkTENL4H64cjs.targetChainToCaip2.call(void 0, targetChain),
|
|
2174
2227
|
destinationToken: targetToken,
|
|
2175
2228
|
amount: "1"
|
|
2176
2229
|
}).then((result) => {
|
|
@@ -2210,8 +2263,8 @@ function DepositAddressStep({
|
|
|
2210
2263
|
function handlePointerDown(event) {
|
|
2211
2264
|
const target = event.target;
|
|
2212
2265
|
if (!target) return;
|
|
2213
|
-
const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access',
|
|
2214
|
-
const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access',
|
|
2266
|
+
const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access', _78 => _78.current, 'optionalAccess', _79 => _79.contains, 'call', _80 => _80(target)]);
|
|
2267
|
+
const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access', _81 => _81.current, 'optionalAccess', _82 => _82.contains, 'call', _83 => _83(target)]);
|
|
2215
2268
|
if (clickedChainDropdown || clickedTokenDropdown) return;
|
|
2216
2269
|
setChainDropdownOpen(false);
|
|
2217
2270
|
setTokenDropdownOpen(false);
|
|
@@ -2224,7 +2277,7 @@ function DepositAddressStep({
|
|
|
2224
2277
|
};
|
|
2225
2278
|
}, [chainDropdownOpen, tokenDropdownOpen]);
|
|
2226
2279
|
const handleCopy = _react.useCallback.call(void 0, async () => {
|
|
2227
|
-
_optionalChain([onCopyAddress, 'optionalCall',
|
|
2280
|
+
_optionalChain([onCopyAddress, 'optionalCall', _84 => _84()]);
|
|
2228
2281
|
try {
|
|
2229
2282
|
await navigator.clipboard.writeText(displayAddress);
|
|
2230
2283
|
setCopied(true);
|
|
@@ -2244,14 +2297,18 @@ function DepositAddressStep({
|
|
|
2244
2297
|
}, [displayAddress, onCopyAddress]);
|
|
2245
2298
|
const handleSelectChain = _react.useCallback.call(void 0,
|
|
2246
2299
|
(nextChain) => {
|
|
2247
|
-
const nextTokens = computeTokensForChain(
|
|
2300
|
+
const nextTokens = computeTokensForChain(
|
|
2301
|
+
nextChain,
|
|
2302
|
+
topTokens,
|
|
2303
|
+
catalogFor(nextChain)
|
|
2304
|
+
);
|
|
2248
2305
|
setSourceChainId(nextChain);
|
|
2249
2306
|
setSourceTokenSymbol(pickFallbackToken(nextTokens, sourceTokenSymbol));
|
|
2250
2307
|
setChainDropdownOpen(false);
|
|
2251
2308
|
setTokenDropdownOpen(false);
|
|
2252
2309
|
setCopied(false);
|
|
2253
2310
|
},
|
|
2254
|
-
[sourceTokenSymbol, topTokens]
|
|
2311
|
+
[sourceTokenSymbol, topTokens, catalogFor]
|
|
2255
2312
|
);
|
|
2256
2313
|
const onDepositSubmittedRef = _react.useRef.call(void 0, onDepositSubmitted);
|
|
2257
2314
|
onDepositSubmittedRef.current = onDepositSubmitted;
|
|
@@ -2303,10 +2360,10 @@ function DepositAddressStep({
|
|
|
2303
2360
|
return;
|
|
2304
2361
|
}
|
|
2305
2362
|
const event = status.lastEvent;
|
|
2306
|
-
const eventTxHash =
|
|
2363
|
+
const eventTxHash = _chunkHUHBNYD3cjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkHUHBNYD3cjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
2307
2364
|
if (baselineTxHashRef.current === void 0) {
|
|
2308
2365
|
baselineTxHashRef.current = eventTxHash;
|
|
2309
|
-
} else if (eventTxHash && (!baselineTxHashRef.current || !
|
|
2366
|
+
} else if (eventTxHash && (!baselineTxHashRef.current || !_chunkHUHBNYD3cjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
|
|
2310
2367
|
const details = getDepositEventDetails(event);
|
|
2311
2368
|
const chainId = _nullishCoalesce(details.chainId, () => ( "unknown"));
|
|
2312
2369
|
const amount = _nullishCoalesce(details.amount, () => ( "0"));
|
|
@@ -2315,7 +2372,7 @@ function DepositAddressStep({
|
|
|
2315
2372
|
baselineTxHashRef.current = eventTxHash;
|
|
2316
2373
|
isTrackingRef.current = true;
|
|
2317
2374
|
const isEvmToken = token ? /^0x[a-fA-F0-9]{40}$/.test(token) : false;
|
|
2318
|
-
const sourceDecimals = _nullishCoalesce(details.sourceDecimals, () => ( (isEvmToken ?
|
|
2375
|
+
const sourceDecimals = _nullishCoalesce(details.sourceDecimals, () => ( (isEvmToken ? _chunkTENL4H64cjs.findTokenDecimals.call(void 0,
|
|
2319
2376
|
token,
|
|
2320
2377
|
typeof chainId === "number" ? chainId : void 0
|
|
2321
2378
|
) : void 0)));
|
|
@@ -2338,7 +2395,7 @@ function DepositAddressStep({
|
|
|
2338
2395
|
directTransfer
|
|
2339
2396
|
};
|
|
2340
2397
|
setNotifications((prev) => [notification, ...prev]);
|
|
2341
|
-
_optionalChain([onDepositSubmittedRef, 'access',
|
|
2398
|
+
_optionalChain([onDepositSubmittedRef, 'access', _85 => _85.current, 'optionalCall', _86 => _86({
|
|
2342
2399
|
txHash: eventTxHash,
|
|
2343
2400
|
sourceChain: chainId,
|
|
2344
2401
|
amount,
|
|
@@ -2350,7 +2407,7 @@ function DepositAddressStep({
|
|
|
2350
2407
|
if (!cancelled) {
|
|
2351
2408
|
const msg = err instanceof Error ? err.message : "Failed to check status";
|
|
2352
2409
|
setPollingError(msg);
|
|
2353
|
-
_optionalChain([onErrorRef, 'access',
|
|
2410
|
+
_optionalChain([onErrorRef, 'access', _87 => _87.current, 'optionalCall', _88 => _88(msg, "STATUS_POLL_ERROR")]);
|
|
2354
2411
|
}
|
|
2355
2412
|
}
|
|
2356
2413
|
if (!cancelled) {
|
|
@@ -2366,24 +2423,24 @@ function DepositAddressStep({
|
|
|
2366
2423
|
const handleNotificationComplete = _react.useCallback.call(void 0,
|
|
2367
2424
|
(txHash, destinationTxHash, context) => {
|
|
2368
2425
|
isTrackingRef.current = false;
|
|
2369
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
2426
|
+
_optionalChain([onDepositCompleteRef, 'access', _89 => _89.current, 'optionalCall', _90 => _90(txHash, destinationTxHash, context)]);
|
|
2370
2427
|
},
|
|
2371
2428
|
[]
|
|
2372
2429
|
);
|
|
2373
2430
|
const handleNotificationFailed = _react.useCallback.call(void 0,
|
|
2374
2431
|
(txHash, error) => {
|
|
2375
2432
|
isTrackingRef.current = false;
|
|
2376
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
2433
|
+
_optionalChain([onDepositFailedRef, 'access', _91 => _91.current, 'optionalCall', _92 => _92(txHash, error)]);
|
|
2377
2434
|
},
|
|
2378
2435
|
[]
|
|
2379
2436
|
);
|
|
2380
2437
|
const handleNotificationDismiss = _react.useCallback.call(void 0, (id) => {
|
|
2381
2438
|
setNotifications((prev) => prev.filter((n) => n.id !== id));
|
|
2382
2439
|
}, []);
|
|
2383
|
-
const qrIconSrc =
|
|
2440
|
+
const qrIconSrc = _nullishCoalesce(_optionalChain([catalogFor, 'call', _93 => _93(sourceChainId), 'optionalAccess', _94 => _94.iconUrl]), () => ( _chunkTENL4H64cjs.getChainIcon.call(void 0, sourceChainId)));
|
|
2384
2441
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-step--with-notifications", children: [
|
|
2385
2442
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
2386
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2443
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
2387
2444
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", children: [
|
|
2388
2445
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", ref: chainDropdownRef, children: [
|
|
2389
2446
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
@@ -2399,14 +2456,14 @@ function DepositAddressStep({
|
|
|
2399
2456
|
},
|
|
2400
2457
|
children: [
|
|
2401
2458
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2402
|
-
|
|
2459
|
+
_chunkZQR36NCVcjs.CdnIcon,
|
|
2403
2460
|
{
|
|
2404
|
-
src:
|
|
2461
|
+
src: _nullishCoalesce(_optionalChain([catalogFor, 'call', _95 => _95(sourceChainId), 'optionalAccess', _96 => _96.iconUrl]), () => ( _chunkTENL4H64cjs.getChainIcon.call(void 0, sourceChainId))),
|
|
2405
2462
|
className: "rs-deposit-address-dropdown-icon"
|
|
2406
2463
|
}
|
|
2407
2464
|
),
|
|
2408
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainLabel(sourceChainId) }),
|
|
2409
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2465
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainLabel(sourceChainId, catalogFor(sourceChainId)) }),
|
|
2466
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2410
2467
|
]
|
|
2411
2468
|
}
|
|
2412
2469
|
),
|
|
@@ -2418,13 +2475,13 @@ function DepositAddressStep({
|
|
|
2418
2475
|
onClick: () => handleSelectChain(chainId),
|
|
2419
2476
|
children: [
|
|
2420
2477
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2421
|
-
|
|
2478
|
+
_chunkZQR36NCVcjs.CdnIcon,
|
|
2422
2479
|
{
|
|
2423
|
-
src:
|
|
2480
|
+
src: _nullishCoalesce(_optionalChain([catalogFor, 'call', _97 => _97(chainId), 'optionalAccess', _98 => _98.iconUrl]), () => ( _chunkTENL4H64cjs.getChainIcon.call(void 0, chainId))),
|
|
2424
2481
|
className: "rs-deposit-address-dropdown-icon"
|
|
2425
2482
|
}
|
|
2426
2483
|
),
|
|
2427
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainLabel(chainId) })
|
|
2484
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainLabel(chainId, catalogFor(chainId)) })
|
|
2428
2485
|
]
|
|
2429
2486
|
},
|
|
2430
2487
|
String(chainId)
|
|
@@ -2435,9 +2492,9 @@ function DepositAddressStep({
|
|
|
2435
2492
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Supported token" }),
|
|
2436
2493
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
2437
2494
|
"Min.$",
|
|
2438
|
-
(
|
|
2439
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2440
|
-
|
|
2495
|
+
(_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),
|
|
2496
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHUHBNYD3cjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2497
|
+
_chunkZQR36NCVcjs.InfoIcon,
|
|
2441
2498
|
{
|
|
2442
2499
|
className: "rs-deposit-address-min-icon",
|
|
2443
2500
|
"aria-hidden": "true"
|
|
@@ -2458,7 +2515,7 @@ function DepositAddressStep({
|
|
|
2458
2515
|
children: [
|
|
2459
2516
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenGlyph, { symbol: sourceTokenSymbol }),
|
|
2460
2517
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceTokenSymbol }),
|
|
2461
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2518
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2462
2519
|
]
|
|
2463
2520
|
}
|
|
2464
2521
|
),
|
|
@@ -2502,7 +2559,7 @@ function DepositAddressStep({
|
|
|
2502
2559
|
className: "rs-deposit-address-copy",
|
|
2503
2560
|
onClick: handleCopy,
|
|
2504
2561
|
children: [
|
|
2505
|
-
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2562
|
+
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.CopyIcon, {}),
|
|
2506
2563
|
copied ? "Copied!" : "Copy address"
|
|
2507
2564
|
]
|
|
2508
2565
|
}
|
|
@@ -2510,7 +2567,6 @@ function DepositAddressStep({
|
|
|
2510
2567
|
]
|
|
2511
2568
|
}
|
|
2512
2569
|
),
|
|
2513
|
-
targetChain === _chunkH577RJN5cjs.HYPERCORE_CHAIN_ID && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.Callout, { variant: "warning", children: "HyperCore's first deposit to a new account includes a ~1 USDC activation fee \u2014 send at least 1 USDC or it will fail." }),
|
|
2514
2570
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2515
2571
|
"div",
|
|
2516
2572
|
{
|
|
@@ -2528,16 +2584,16 @@ function DepositAddressStep({
|
|
|
2528
2584
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
|
|
2529
2585
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
|
|
2530
2586
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2531
|
-
|
|
2587
|
+
_chunkHUHBNYD3cjs.Tooltip,
|
|
2532
2588
|
{
|
|
2533
2589
|
className: "rs-price-impact-info",
|
|
2534
2590
|
content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
|
|
2535
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2591
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.InfoIcon, { "aria-hidden": "true" })
|
|
2536
2592
|
}
|
|
2537
2593
|
)
|
|
2538
2594
|
] }),
|
|
2539
2595
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2540
|
-
|
|
2596
|
+
_chunkZQR36NCVcjs.ChevronDownIcon,
|
|
2541
2597
|
{
|
|
2542
2598
|
className: "rs-price-impact-chevron",
|
|
2543
2599
|
"aria-hidden": "true"
|
|
@@ -2548,29 +2604,29 @@ function DepositAddressStep({
|
|
|
2548
2604
|
),
|
|
2549
2605
|
/* @__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: [
|
|
2550
2606
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
2551
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2607
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.PercentIcon, {}) }),
|
|
2552
2608
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
2553
2609
|
"Max slippage: ",
|
|
2554
2610
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.2%" })
|
|
2555
2611
|
] }),
|
|
2556
2612
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2557
|
-
|
|
2613
|
+
_chunkHUHBNYD3cjs.Tooltip,
|
|
2558
2614
|
{
|
|
2559
2615
|
className: "rs-price-impact-info",
|
|
2560
2616
|
content: "Slippage accounts for price changes during execution. Slippage is adjusted per pair to ensure reliable execution.",
|
|
2561
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2617
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.InfoIcon, { "aria-hidden": "true" })
|
|
2562
2618
|
}
|
|
2563
2619
|
)
|
|
2564
2620
|
] }),
|
|
2565
2621
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
2566
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2622
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.ClockIcon, {}) }),
|
|
2567
2623
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
2568
2624
|
"Processing time: ",
|
|
2569
2625
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "< 1 min" })
|
|
2570
2626
|
] })
|
|
2571
2627
|
] }),
|
|
2572
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
2573
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2628
|
+
liquidityHelper.kind !== "idle" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
2629
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.PlusCircleIcon, {}) }),
|
|
2574
2630
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
2575
2631
|
"Max deposit:",
|
|
2576
2632
|
" ",
|
|
@@ -2601,7 +2657,7 @@ function DepositAddressStep({
|
|
|
2601
2657
|
},
|
|
2602
2658
|
deposit.id
|
|
2603
2659
|
)) }),
|
|
2604
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2660
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.PoweredBy, {})
|
|
2605
2661
|
] });
|
|
2606
2662
|
}
|
|
2607
2663
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -2649,7 +2705,7 @@ function FinalisingDepositStep() {
|
|
|
2649
2705
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "rs-finalising-subtitle", children: "We are depositing your funds to the application." })
|
|
2650
2706
|
] })
|
|
2651
2707
|
] }),
|
|
2652
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2708
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.PoweredBy, {})
|
|
2653
2709
|
] });
|
|
2654
2710
|
}
|
|
2655
2711
|
FinalisingDepositStep.displayName = "FinalisingDepositStep";
|
|
@@ -2679,7 +2735,7 @@ function SwappedOrderTracker({
|
|
|
2679
2735
|
];
|
|
2680
2736
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-swapped-tracker", children: [
|
|
2681
2737
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2682
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2738
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.HandCoinsIcon, {}), title }),
|
|
2683
2739
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ol", { className: "rs-swapped-tracker-steps", children: labels.map((label, idx) => {
|
|
2684
2740
|
const status = stepStates[idx];
|
|
2685
2741
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
@@ -2693,7 +2749,7 @@ function SwappedOrderTracker({
|
|
|
2693
2749
|
{
|
|
2694
2750
|
className: "rs-swapped-tracker-step-marker",
|
|
2695
2751
|
"aria-hidden": "true",
|
|
2696
|
-
children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2752
|
+
children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.CheckIcon, {}) : status === "failed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.CloseIcon, {}) : status === "active" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.Spinner, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2697
2753
|
"svg",
|
|
2698
2754
|
{
|
|
2699
2755
|
className: "rs-swapped-tracker-step-ring",
|
|
@@ -2728,7 +2784,7 @@ function SwappedOrderTracker({
|
|
|
2728
2784
|
}
|
|
2729
2785
|
)
|
|
2730
2786
|
] }),
|
|
2731
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2787
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.PoweredBy, {})
|
|
2732
2788
|
] });
|
|
2733
2789
|
}
|
|
2734
2790
|
function formatTrackerAmount(amount) {
|
|
@@ -2880,7 +2936,7 @@ function SwappedIframeStep({
|
|
|
2880
2936
|
if (cancelled) return;
|
|
2881
2937
|
const message = err instanceof Error ? err.message : loadErrorFallback;
|
|
2882
2938
|
setLoadError(message);
|
|
2883
|
-
_optionalChain([onErrorRef, 'access',
|
|
2939
|
+
_optionalChain([onErrorRef, 'access', _101 => _101.current, 'optionalCall', _102 => _102(message, loadErrorCode)]);
|
|
2884
2940
|
});
|
|
2885
2941
|
return () => {
|
|
2886
2942
|
cancelled = true;
|
|
@@ -2933,10 +2989,10 @@ function SwappedIframeStep({
|
|
|
2933
2989
|
const status = await service.fetchLatestStatus(smartAccount);
|
|
2934
2990
|
if (cancelled) return;
|
|
2935
2991
|
const event = status.lastEvent;
|
|
2936
|
-
const eventTxHash =
|
|
2992
|
+
const eventTxHash = _chunkHUHBNYD3cjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkHUHBNYD3cjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
2937
2993
|
if (baselineDepositTxHashRef.current === void 0) {
|
|
2938
2994
|
baselineDepositTxHashRef.current = eventTxHash;
|
|
2939
|
-
} else if (eventTxHash && (!baselineDepositTxHashRef.current || !
|
|
2995
|
+
} else if (eventTxHash && (!baselineDepositTxHashRef.current || !_chunkHUHBNYD3cjs.txRefsMatch.call(void 0, eventTxHash, baselineDepositTxHashRef.current))) {
|
|
2940
2996
|
currentDepositTxHashRef.current = eventTxHash;
|
|
2941
2997
|
setLatestEvent(_nullishCoalesce(event, () => ( null)));
|
|
2942
2998
|
}
|
|
@@ -2961,15 +3017,15 @@ function SwappedIframeStep({
|
|
|
2961
3017
|
}, [service, smartAccount]);
|
|
2962
3018
|
_react.useEffect.call(void 0, () => {
|
|
2963
3019
|
if (fastDepositPollEnabledRef.current) return;
|
|
2964
|
-
const status = _optionalChain([orderState, 'optionalAccess',
|
|
3020
|
+
const status = _optionalChain([orderState, 'optionalAccess', _103 => _103.status]);
|
|
2965
3021
|
if (!status || !SWAPPED_TERMINAL_STATUSES.has(status)) return;
|
|
2966
3022
|
fastDepositPollEnabledRef.current = true;
|
|
2967
|
-
_optionalChain([rescheduleDepositPollRef, 'access',
|
|
3023
|
+
_optionalChain([rescheduleDepositPollRef, 'access', _104 => _104.current, 'optionalCall', _105 => _105(DEPOSIT_POLL_FAST_INITIAL_DELAY_MS)]);
|
|
2968
3024
|
}, [orderState]);
|
|
2969
3025
|
_react.useEffect.call(void 0, () => {
|
|
2970
3026
|
function onMessage(e) {
|
|
2971
3027
|
if (!SWAPPED_IFRAME_ORIGINS.has(e.origin)) return;
|
|
2972
|
-
if (e.source !== _optionalChain([iframeRef, 'access',
|
|
3028
|
+
if (e.source !== _optionalChain([iframeRef, 'access', _106 => _106.current, 'optionalAccess', _107 => _107.contentWindow])) return;
|
|
2973
3029
|
if (isSwappedGoBackMessage(e.data)) {
|
|
2974
3030
|
onGoBackRef.current();
|
|
2975
3031
|
return;
|
|
@@ -2984,16 +3040,16 @@ function SwappedIframeStep({
|
|
|
2984
3040
|
setOrderState((prev) => ({
|
|
2985
3041
|
// Normalise to the uuid the backend poll also keys on, so orderState
|
|
2986
3042
|
// is consistent regardless of which path set it.
|
|
2987
|
-
orderId: _nullishCoalesce(_nullishCoalesce(expectedOrderUuidRef.current, () => ( _optionalChain([prev, 'optionalAccess',
|
|
3043
|
+
orderId: _nullishCoalesce(_nullishCoalesce(expectedOrderUuidRef.current, () => ( _optionalChain([prev, 'optionalAccess', _108 => _108.orderId]))), () => ( ext)),
|
|
2988
3044
|
status: parsed.status,
|
|
2989
|
-
orderCrypto: _nullishCoalesce(_nullishCoalesce(parsed.orderCrypto, () => ( _optionalChain([prev, 'optionalAccess',
|
|
2990
|
-
orderCryptoAmount: _nullishCoalesce(_nullishCoalesce(parsed.orderCryptoAmount, () => ( _optionalChain([prev, 'optionalAccess',
|
|
2991
|
-
transactionId: _nullishCoalesce(_nullishCoalesce(parsed.transactionId, () => ( _optionalChain([prev, 'optionalAccess',
|
|
3045
|
+
orderCrypto: _nullishCoalesce(_nullishCoalesce(parsed.orderCrypto, () => ( _optionalChain([prev, 'optionalAccess', _109 => _109.orderCrypto]))), () => ( null)),
|
|
3046
|
+
orderCryptoAmount: _nullishCoalesce(_nullishCoalesce(parsed.orderCryptoAmount, () => ( _optionalChain([prev, 'optionalAccess', _110 => _110.orderCryptoAmount]))), () => ( null)),
|
|
3047
|
+
transactionId: _nullishCoalesce(_nullishCoalesce(parsed.transactionId, () => ( _optionalChain([prev, 'optionalAccess', _111 => _111.transactionId]))), () => ( null)),
|
|
2992
3048
|
receivedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2993
|
-
paidAmountUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
2994
|
-
paidAmountEur: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
2995
|
-
onrampFeeUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
2996
|
-
paymentMethod: _nullishCoalesce(_optionalChain([prev, 'optionalAccess',
|
|
3049
|
+
paidAmountUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _112 => _112.paidAmountUsd]), () => ( null)),
|
|
3050
|
+
paidAmountEur: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _113 => _113.paidAmountEur]), () => ( null)),
|
|
3051
|
+
onrampFeeUsd: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _114 => _114.onrampFeeUsd]), () => ( null)),
|
|
3052
|
+
paymentMethod: _nullishCoalesce(_optionalChain([prev, 'optionalAccess', _115 => _115.paymentMethod]), () => ( null))
|
|
2997
3053
|
}));
|
|
2998
3054
|
}
|
|
2999
3055
|
window.addEventListener("message", onMessage);
|
|
@@ -3006,17 +3062,17 @@ function SwappedIframeStep({
|
|
|
3006
3062
|
}
|
|
3007
3063
|
}, [phase, orderState, latestEvent, variant]);
|
|
3008
3064
|
const stepStates = _react.useMemo.call(void 0,
|
|
3009
|
-
() => deriveStepStates(_nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
3065
|
+
() => deriveStepStates(_nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _116 => _116.status]), () => ( null)), latestEvent),
|
|
3010
3066
|
[orderState, latestEvent]
|
|
3011
3067
|
);
|
|
3012
3068
|
const terminalState = _react.useMemo.call(void 0, () => {
|
|
3013
|
-
if (
|
|
3069
|
+
if (_chunkHUHBNYD3cjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
|
|
3014
3070
|
return {
|
|
3015
3071
|
kind: "failed",
|
|
3016
|
-
message:
|
|
3072
|
+
message: _chunkHUHBNYD3cjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
|
|
3017
3073
|
};
|
|
3018
3074
|
}
|
|
3019
|
-
if (_optionalChain([orderState, 'optionalAccess',
|
|
3075
|
+
if (_optionalChain([orderState, 'optionalAccess', _117 => _117.status]) === "order_cancelled") {
|
|
3020
3076
|
const banner = bannerForStatus("order_cancelled", {});
|
|
3021
3077
|
return { kind: "cancelled", message: _nullishCoalesce(banner.detail, () => ( banner.title)) };
|
|
3022
3078
|
}
|
|
@@ -3024,7 +3080,7 @@ function SwappedIframeStep({
|
|
|
3024
3080
|
}, [latestEvent, orderState, bannerForStatus]);
|
|
3025
3081
|
_react.useEffect.call(void 0, () => {
|
|
3026
3082
|
if (completeFiredRef.current || failedFiredRef.current) return;
|
|
3027
|
-
const t = _optionalChain([latestEvent, 'optionalAccess',
|
|
3083
|
+
const t = _optionalChain([latestEvent, 'optionalAccess', _118 => _118.type]);
|
|
3028
3084
|
const isSuccess = t === "bridge-complete";
|
|
3029
3085
|
if (!isSuccess) return;
|
|
3030
3086
|
const txHash = currentDepositTxHashRef.current;
|
|
@@ -3033,10 +3089,10 @@ function SwappedIframeStep({
|
|
|
3033
3089
|
const info = {
|
|
3034
3090
|
smartAccount,
|
|
3035
3091
|
txHash,
|
|
3036
|
-
orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
3092
|
+
orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _119 => _119.orderCrypto]), () => ( null)),
|
|
3037
3093
|
// Base-unit source amount from the deposit row/event, consistent with the
|
|
3038
3094
|
// wallet/QR path. ProcessingStep + onLifecycle expect base units.
|
|
3039
|
-
amount: _nullishCoalesce(
|
|
3095
|
+
amount: _nullishCoalesce(_chunkHUHBNYD3cjs.getEventSourceDetails.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0))).amount, () => ( null)),
|
|
3040
3096
|
expectedOrderUuid: expectedOrderUuidRef.current,
|
|
3041
3097
|
initialEvent: _nullishCoalesce(latestEvent, () => ( void 0))
|
|
3042
3098
|
};
|
|
@@ -3047,21 +3103,21 @@ function SwappedIframeStep({
|
|
|
3047
3103
|
}, [latestEvent, orderState, smartAccount]);
|
|
3048
3104
|
_react.useEffect.call(void 0, () => {
|
|
3049
3105
|
if (failedFiredRef.current || completeFiredRef.current) return;
|
|
3050
|
-
if (!
|
|
3106
|
+
if (!_chunkHUHBNYD3cjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) return;
|
|
3051
3107
|
const txHash = currentDepositTxHashRef.current;
|
|
3052
3108
|
if (!txHash) return;
|
|
3053
3109
|
failedFiredRef.current = true;
|
|
3054
3110
|
setPhase("tracker");
|
|
3055
|
-
_optionalChain([onSwappedFailedRef, 'access',
|
|
3111
|
+
_optionalChain([onSwappedFailedRef, 'access', _120 => _120.current, 'optionalCall', _121 => _121(
|
|
3056
3112
|
txHash,
|
|
3057
|
-
|
|
3113
|
+
_chunkHUHBNYD3cjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
|
|
3058
3114
|
)]);
|
|
3059
3115
|
}, [latestEvent]);
|
|
3060
3116
|
const immersive = variant === "fiat" && phase === "iframe" && !loadError;
|
|
3061
3117
|
_react.useEffect.call(void 0, () => {
|
|
3062
|
-
_optionalChain([onImmersiveChangeRef, 'access',
|
|
3118
|
+
_optionalChain([onImmersiveChangeRef, 'access', _122 => _122.current, 'optionalCall', _123 => _123(immersive)]);
|
|
3063
3119
|
}, [immersive]);
|
|
3064
|
-
_react.useEffect.call(void 0, () => () => _optionalChain([onImmersiveChangeRef, 'access',
|
|
3120
|
+
_react.useEffect.call(void 0, () => () => _optionalChain([onImmersiveChangeRef, 'access', _124 => _124.current, 'optionalCall', _125 => _125(false)]), []);
|
|
3065
3121
|
const handleRetry = () => {
|
|
3066
3122
|
setIframeSrc(null);
|
|
3067
3123
|
setWidgetUrl(null);
|
|
@@ -3077,8 +3133,8 @@ function SwappedIframeStep({
|
|
|
3077
3133
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3078
3134
|
SwappedOrderTracker,
|
|
3079
3135
|
{
|
|
3080
|
-
amount: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
3081
|
-
currency: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess',
|
|
3136
|
+
amount: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _126 => _126.orderCryptoAmount]), () => ( null)),
|
|
3137
|
+
currency: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _127 => _127.orderCrypto]), () => ( "USDC")),
|
|
3082
3138
|
stepStates,
|
|
3083
3139
|
terminal: terminalState,
|
|
3084
3140
|
onRetry: handleRetry,
|
|
@@ -3100,7 +3156,7 @@ function SwappedIframeStep({
|
|
|
3100
3156
|
}
|
|
3101
3157
|
)
|
|
3102
3158
|
] }),
|
|
3103
|
-
!loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3159
|
+
!loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.Spinner, {}) }),
|
|
3104
3160
|
widgetUrl && !loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3105
3161
|
"iframe",
|
|
3106
3162
|
{
|
|
@@ -3112,7 +3168,7 @@ function SwappedIframeStep({
|
|
|
3112
3168
|
allow: "payment; camera; microphone; clipboard-write; geolocation",
|
|
3113
3169
|
onLoad: () => {
|
|
3114
3170
|
try {
|
|
3115
|
-
if (_optionalChain([iframeRef, 'access',
|
|
3171
|
+
if (_optionalChain([iframeRef, 'access', _128 => _128.current, 'optionalAccess', _129 => _129.contentWindow, 'optionalAccess', _130 => _130.location, 'optionalAccess', _131 => _131.href]) === "about:blank") {
|
|
3116
3172
|
return;
|
|
3117
3173
|
}
|
|
3118
3174
|
} catch (e19) {
|
|
@@ -3123,11 +3179,11 @@ function SwappedIframeStep({
|
|
|
3123
3179
|
retryToken
|
|
3124
3180
|
)
|
|
3125
3181
|
] }) }),
|
|
3126
|
-
loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3182
|
+
loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.PoweredBy, {})
|
|
3127
3183
|
] });
|
|
3128
3184
|
}
|
|
3129
3185
|
function deriveStepStates(swappedStatus, latestEvent) {
|
|
3130
|
-
if (
|
|
3186
|
+
if (_chunkHUHBNYD3cjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
|
|
3131
3187
|
return ["complete", "complete", "failed", "pending"];
|
|
3132
3188
|
}
|
|
3133
3189
|
if (swappedStatus === "order_cancelled") {
|
|
@@ -3135,7 +3191,7 @@ function deriveStepStates(swappedStatus, latestEvent) {
|
|
|
3135
3191
|
}
|
|
3136
3192
|
const step1Complete = swappedStatus === "order_completed" || swappedStatus === "order_broadcasted";
|
|
3137
3193
|
const step2Complete = latestEvent !== null || swappedStatus === "order_broadcasted";
|
|
3138
|
-
const step3Complete = _optionalChain([latestEvent, 'optionalAccess',
|
|
3194
|
+
const step3Complete = _optionalChain([latestEvent, 'optionalAccess', _132 => _132.type]) === "bridge-complete";
|
|
3139
3195
|
if (step3Complete) {
|
|
3140
3196
|
return ["complete", "complete", "complete", "complete"];
|
|
3141
3197
|
}
|
|
@@ -3191,7 +3247,7 @@ function FiatOnrampStep({
|
|
|
3191
3247
|
onImmersiveChange
|
|
3192
3248
|
}) {
|
|
3193
3249
|
const loadUrl = _react.useCallback.call(void 0, async () => {
|
|
3194
|
-
const prefetched = _optionalChain([consumePrefetchedUrl, 'optionalCall',
|
|
3250
|
+
const prefetched = _optionalChain([consumePrefetchedUrl, 'optionalCall', _133 => _133(
|
|
3195
3251
|
smartAccount,
|
|
3196
3252
|
paymentMethod,
|
|
3197
3253
|
methodSelectionSource
|
|
@@ -3317,7 +3373,7 @@ ExchangeConnectStep.displayName = "ExchangeConnectStep";
|
|
|
3317
3373
|
function ExchangeLogo({ exchange }) {
|
|
3318
3374
|
const [failed, setFailed] = _react.useState.call(void 0, false);
|
|
3319
3375
|
if (!exchange.logoUrl || failed) {
|
|
3320
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3376
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.BankIcon, {});
|
|
3321
3377
|
}
|
|
3322
3378
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3323
3379
|
"img",
|
|
@@ -3362,7 +3418,7 @@ function ExchangeSelectStep({
|
|
|
3362
3418
|
setExchanges([]);
|
|
3363
3419
|
setExchangeFeeBps(0);
|
|
3364
3420
|
setError(message);
|
|
3365
|
-
_optionalChain([onError, 'optionalCall',
|
|
3421
|
+
_optionalChain([onError, 'optionalCall', _134 => _134(message, "SWAPPED_CONNECT_EXCHANGES_FAILED")]);
|
|
3366
3422
|
}).finally(() => {
|
|
3367
3423
|
if (!cancelled) setLoading(false);
|
|
3368
3424
|
});
|
|
@@ -3388,7 +3444,7 @@ function ExchangeSelectStep({
|
|
|
3388
3444
|
} catch (err) {
|
|
3389
3445
|
const message = err instanceof Error ? err.message : "Failed to prepare Connect";
|
|
3390
3446
|
setSelectionNotice(message);
|
|
3391
|
-
_optionalChain([onError, 'optionalCall',
|
|
3447
|
+
_optionalChain([onError, 'optionalCall', _135 => _135(message, "SWAPPED_CONNECT_URL_FAILED")]);
|
|
3392
3448
|
} finally {
|
|
3393
3449
|
setSelectingConnection(null);
|
|
3394
3450
|
}
|
|
@@ -3398,14 +3454,14 @@ function ExchangeSelectStep({
|
|
|
3398
3454
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-exchange-select", children: [
|
|
3399
3455
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3400
3456
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3401
|
-
|
|
3457
|
+
_chunkZQR36NCVcjs.BodyHeader,
|
|
3402
3458
|
{
|
|
3403
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3459
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.UnplugIcon, {}),
|
|
3404
3460
|
title: "Connect exchange",
|
|
3405
3461
|
subtitle: "Select an exchange to connect"
|
|
3406
3462
|
}
|
|
3407
3463
|
),
|
|
3408
|
-
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3464
|
+
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.Spinner, {}) }),
|
|
3409
3465
|
!loading && error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: [
|
|
3410
3466
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state-title", children: "Couldn\u2019t load exchanges" }),
|
|
3411
3467
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3431,7 +3487,7 @@ function ExchangeSelectStep({
|
|
|
3431
3487
|
)
|
|
3432
3488
|
] }),
|
|
3433
3489
|
!loading && !error && exchanges.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-grid", children: exchanges.map((exchange) => {
|
|
3434
|
-
const brand =
|
|
3490
|
+
const brand = _chunkHUHBNYD3cjs.getExchangeLogo.call(void 0, exchange.name, exchange.connection);
|
|
3435
3491
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3436
3492
|
"button",
|
|
3437
3493
|
{
|
|
@@ -3456,7 +3512,7 @@ function ExchangeSelectStep({
|
|
|
3456
3512
|
);
|
|
3457
3513
|
}) })
|
|
3458
3514
|
] }),
|
|
3459
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3515
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.PoweredBy, {}),
|
|
3460
3516
|
exchangeFeeBps > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "rs-exchange-select-fee-note", children: [
|
|
3461
3517
|
"A ",
|
|
3462
3518
|
formatFeeRate(exchangeFeeBps),
|
|
@@ -3473,29 +3529,29 @@ var BASE_CHAIN_ID = 8453;
|
|
|
3473
3529
|
function DepositAddressSkeleton({
|
|
3474
3530
|
uiConfig
|
|
3475
3531
|
}) {
|
|
3476
|
-
const evmChainIds =
|
|
3532
|
+
const evmChainIds = _chunkTENL4H64cjs.getSupportedChainIds.call(void 0, );
|
|
3477
3533
|
const defaultChainId = evmChainIds.includes(BASE_CHAIN_ID) ? BASE_CHAIN_ID : evmChainIds[0];
|
|
3478
|
-
const tokensForChain =
|
|
3534
|
+
const tokensForChain = _chunkTENL4H64cjs.getTargetTokenSymbolsForChain.call(void 0, defaultChainId);
|
|
3479
3535
|
const defaultToken = tokensForChain.includes("USDC") ? "USDC" : _nullishCoalesce(tokensForChain[0], () => ( "USDC"));
|
|
3480
|
-
const chainName =
|
|
3481
|
-
const chainIcon =
|
|
3536
|
+
const chainName = _chunkTENL4H64cjs.getChainName.call(void 0, defaultChainId);
|
|
3537
|
+
const chainIcon = _chunkTENL4H64cjs.getChainIcon.call(void 0, defaultChainId);
|
|
3482
3538
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", "aria-busy": "true", children: [
|
|
3483
3539
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: "Preparing deposit details\u2026" }),
|
|
3484
3540
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
3485
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3541
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
3486
3542
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", "aria-hidden": "true", children: [
|
|
3487
3543
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
3488
3544
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
3489
3545
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown-trigger", children: [
|
|
3490
3546
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3491
|
-
|
|
3547
|
+
_chunkZQR36NCVcjs.CdnIcon,
|
|
3492
3548
|
{
|
|
3493
3549
|
src: chainIcon,
|
|
3494
3550
|
className: "rs-deposit-address-dropdown-icon"
|
|
3495
3551
|
}
|
|
3496
3552
|
),
|
|
3497
3553
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainName }),
|
|
3498
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3554
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
3499
3555
|
] })
|
|
3500
3556
|
] }),
|
|
3501
3557
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
@@ -3503,9 +3559,9 @@ function DepositAddressSkeleton({
|
|
|
3503
3559
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Supported token" }),
|
|
3504
3560
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
3505
3561
|
"Min.$",
|
|
3506
|
-
(_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3507
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3508
|
-
|
|
3562
|
+
(_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _136 => _136.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
3563
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHUHBNYD3cjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3564
|
+
_chunkZQR36NCVcjs.InfoIcon,
|
|
3509
3565
|
{
|
|
3510
3566
|
className: "rs-deposit-address-min-icon",
|
|
3511
3567
|
"aria-hidden": "true"
|
|
@@ -3515,14 +3571,14 @@ function DepositAddressSkeleton({
|
|
|
3515
3571
|
] }),
|
|
3516
3572
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown-trigger", children: [
|
|
3517
3573
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3518
|
-
|
|
3574
|
+
_chunkZQR36NCVcjs.TokenIcon,
|
|
3519
3575
|
{
|
|
3520
3576
|
symbol: defaultToken,
|
|
3521
3577
|
className: "rs-deposit-address-dropdown-icon"
|
|
3522
3578
|
}
|
|
3523
3579
|
),
|
|
3524
3580
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: defaultToken }),
|
|
3525
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3581
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
3526
3582
|
] })
|
|
3527
3583
|
] })
|
|
3528
3584
|
] }),
|
|
@@ -3543,7 +3599,7 @@ function DepositAddressSkeleton({
|
|
|
3543
3599
|
disabled: true,
|
|
3544
3600
|
"aria-hidden": "true",
|
|
3545
3601
|
children: [
|
|
3546
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3602
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.CopyIcon, {}),
|
|
3547
3603
|
"Copy address"
|
|
3548
3604
|
]
|
|
3549
3605
|
}
|
|
@@ -3556,16 +3612,16 @@ function DepositAddressSkeleton({
|
|
|
3556
3612
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
|
|
3557
3613
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
|
|
3558
3614
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3559
|
-
|
|
3615
|
+
_chunkHUHBNYD3cjs.Tooltip,
|
|
3560
3616
|
{
|
|
3561
3617
|
className: "rs-price-impact-info",
|
|
3562
3618
|
content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
|
|
3563
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3619
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.InfoIcon, { "aria-hidden": "true" })
|
|
3564
3620
|
}
|
|
3565
3621
|
)
|
|
3566
3622
|
] }),
|
|
3567
3623
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3568
|
-
|
|
3624
|
+
_chunkZQR36NCVcjs.ChevronDownIcon,
|
|
3569
3625
|
{
|
|
3570
3626
|
className: "rs-price-impact-chevron",
|
|
3571
3627
|
"aria-hidden": "true"
|
|
@@ -3573,7 +3629,7 @@ function DepositAddressSkeleton({
|
|
|
3573
3629
|
)
|
|
3574
3630
|
] }) })
|
|
3575
3631
|
] }),
|
|
3576
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3632
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.PoweredBy, {})
|
|
3577
3633
|
] });
|
|
3578
3634
|
}
|
|
3579
3635
|
DepositAddressSkeleton.displayName = "DepositAddressSkeleton";
|
|
@@ -3605,14 +3661,14 @@ function SolanaTokenSelectStep({
|
|
|
3605
3661
|
setError(null);
|
|
3606
3662
|
const portfolioBySymbol = {};
|
|
3607
3663
|
try {
|
|
3608
|
-
|
|
3664
|
+
_chunkZQR36NCVcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
|
|
3609
3665
|
solanaAddress
|
|
3610
3666
|
});
|
|
3611
3667
|
const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
|
|
3612
3668
|
if (!active) return;
|
|
3613
3669
|
for (const t of portfolio.tokens) {
|
|
3614
3670
|
const symbol = t.symbol.toUpperCase();
|
|
3615
|
-
if (!
|
|
3671
|
+
if (!_chunkTENL4H64cjs.SOLANA_TOKENS.some((st) => st.symbol === symbol)) continue;
|
|
3616
3672
|
let parsed = 0n;
|
|
3617
3673
|
try {
|
|
3618
3674
|
parsed = BigInt(t.balance || "0");
|
|
@@ -3628,12 +3684,12 @@ function SolanaTokenSelectStep({
|
|
|
3628
3684
|
};
|
|
3629
3685
|
}
|
|
3630
3686
|
}
|
|
3631
|
-
|
|
3687
|
+
_chunkZQR36NCVcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
|
|
3632
3688
|
symbols: Object.keys(portfolioBySymbol)
|
|
3633
3689
|
});
|
|
3634
3690
|
} catch (err) {
|
|
3635
3691
|
if (!active) return;
|
|
3636
|
-
|
|
3692
|
+
_chunkZQR36NCVcjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
|
|
3637
3693
|
solanaAddress
|
|
3638
3694
|
});
|
|
3639
3695
|
setError(
|
|
@@ -3644,7 +3700,7 @@ function SolanaTokenSelectStep({
|
|
|
3644
3700
|
return;
|
|
3645
3701
|
}
|
|
3646
3702
|
const results = [];
|
|
3647
|
-
for (const token of
|
|
3703
|
+
for (const token of _chunkTENL4H64cjs.SOLANA_TOKENS) {
|
|
3648
3704
|
const fromPortfolio = portfolioBySymbol[token.symbol];
|
|
3649
3705
|
if (fromPortfolio && fromPortfolio.balance > 0n) {
|
|
3650
3706
|
results.push({
|
|
@@ -3658,7 +3714,7 @@ function SolanaTokenSelectStep({
|
|
|
3658
3714
|
setTokenBalances(results);
|
|
3659
3715
|
setLoading(false);
|
|
3660
3716
|
const totalUsd = results.reduce((sum, r) => sum + r.balanceUsd, 0);
|
|
3661
|
-
_optionalChain([onTotalBalanceComputed, 'optionalCall',
|
|
3717
|
+
_optionalChain([onTotalBalanceComputed, 'optionalCall', _137 => _137(totalUsd)]);
|
|
3662
3718
|
}
|
|
3663
3719
|
void loadBalances();
|
|
3664
3720
|
return () => {
|
|
@@ -3680,30 +3736,30 @@ function SolanaTokenSelectStep({
|
|
|
3680
3736
|
const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
|
|
3681
3737
|
const numeric = Number(raw);
|
|
3682
3738
|
if (!Number.isFinite(numeric)) return raw;
|
|
3683
|
-
return
|
|
3739
|
+
return _chunkZQR36NCVcjs.tokenFormatter.format(numeric);
|
|
3684
3740
|
} catch (e22) {
|
|
3685
3741
|
return "--";
|
|
3686
3742
|
}
|
|
3687
3743
|
};
|
|
3688
|
-
const chainIcon =
|
|
3689
|
-
const chainName =
|
|
3744
|
+
const chainIcon = _chunkTENL4H64cjs.getChainIcon.call(void 0, "solana");
|
|
3745
|
+
const chainName = _chunkTENL4H64cjs.getChainName.call(void 0, "solana");
|
|
3690
3746
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
3691
3747
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
3692
3748
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3693
|
-
|
|
3749
|
+
_chunkZQR36NCVcjs.BodyHeader,
|
|
3694
3750
|
{
|
|
3695
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3751
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.WalletIcon, {}),
|
|
3696
3752
|
title: "Your assets",
|
|
3697
3753
|
subtitle: "Select source assets to transfer"
|
|
3698
3754
|
}
|
|
3699
3755
|
),
|
|
3700
3756
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
3701
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3757
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
3702
3758
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
3703
3759
|
] }),
|
|
3704
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3760
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.Callout, { variant: "error", children: error }),
|
|
3705
3761
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
3706
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3762
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
3707
3763
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
3708
3764
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
3709
3765
|
solanaAddress.slice(0, 6),
|
|
@@ -3734,13 +3790,13 @@ function SolanaTokenSelectStep({
|
|
|
3734
3790
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
|
|
3735
3791
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-icon-wrapper", children: [
|
|
3736
3792
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3737
|
-
|
|
3793
|
+
_chunkZQR36NCVcjs.TokenIcon,
|
|
3738
3794
|
{
|
|
3739
3795
|
symbol: entry.token.symbol,
|
|
3740
3796
|
fallback: entry.token.symbol.slice(0, 4)
|
|
3741
3797
|
}
|
|
3742
3798
|
) }),
|
|
3743
|
-
chainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3799
|
+
chainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.CdnIcon, { src: chainIcon, alt: chainName }) })
|
|
3744
3800
|
] }),
|
|
3745
3801
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-text", children: [
|
|
3746
3802
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-name-row", children: [
|
|
@@ -3757,14 +3813,14 @@ function SolanaTokenSelectStep({
|
|
|
3757
3813
|
] })
|
|
3758
3814
|
] })
|
|
3759
3815
|
] }),
|
|
3760
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ?
|
|
3816
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunkZQR36NCVcjs.currencyFormatter.format(entry.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${entry.token.symbol}` : "--" })
|
|
3761
3817
|
]
|
|
3762
3818
|
},
|
|
3763
3819
|
entry.token.symbol
|
|
3764
3820
|
);
|
|
3765
3821
|
}) }),
|
|
3766
3822
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3767
|
-
|
|
3823
|
+
_chunkZQR36NCVcjs.Button,
|
|
3768
3824
|
{
|
|
3769
3825
|
onClick: () => selectedEntry && onContinue(
|
|
3770
3826
|
selectedEntry.token,
|
|
@@ -3777,7 +3833,7 @@ function SolanaTokenSelectStep({
|
|
|
3777
3833
|
}
|
|
3778
3834
|
)
|
|
3779
3835
|
] }),
|
|
3780
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3836
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.PoweredBy, {})
|
|
3781
3837
|
] });
|
|
3782
3838
|
}
|
|
3783
3839
|
|
|
@@ -3808,8 +3864,8 @@ function SolanaAmountStep({
|
|
|
3808
3864
|
const [amount, setAmount] = _react.useState.call(void 0, "");
|
|
3809
3865
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
3810
3866
|
const hasAppliedDefaultRef = _react.useRef.call(void 0, false);
|
|
3811
|
-
const isSourceStablecoin =
|
|
3812
|
-
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess',
|
|
3867
|
+
const isSourceStablecoin = _chunkTENL4H64cjs.isStablecoinSymbol.call(void 0, token.symbol);
|
|
3868
|
+
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess', _138 => _138.trim, 'call', _139 => _139(), 'access', _140 => _140.toLowerCase, 'call', _141 => _141()]) === "max";
|
|
3813
3869
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
3814
3870
|
if (isSourceStablecoin) return 1;
|
|
3815
3871
|
try {
|
|
@@ -3829,7 +3885,7 @@ function SolanaAmountStep({
|
|
|
3829
3885
|
const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
|
|
3830
3886
|
const numeric = Number(raw);
|
|
3831
3887
|
if (!Number.isFinite(numeric)) return raw;
|
|
3832
|
-
return
|
|
3888
|
+
return _chunkZQR36NCVcjs.tokenFormatter.format(numeric);
|
|
3833
3889
|
} catch (e24) {
|
|
3834
3890
|
return "\u2026";
|
|
3835
3891
|
}
|
|
@@ -3846,7 +3902,7 @@ function SolanaAmountStep({
|
|
|
3846
3902
|
}
|
|
3847
3903
|
}, [balance, token.decimals, tokenPriceUsd, balanceUsd]);
|
|
3848
3904
|
const spendableBalance = _react.useMemo.call(void 0, () => {
|
|
3849
|
-
if (!
|
|
3905
|
+
if (!_chunkTENL4H64cjs.isNativeSol.call(void 0, token)) return balance;
|
|
3850
3906
|
return balance > SOL_FEE_RESERVE_LAMPORTS ? balance - SOL_FEE_RESERVE_LAMPORTS : 0n;
|
|
3851
3907
|
}, [balance, token]);
|
|
3852
3908
|
const spendableBalanceUsd = _react.useMemo.call(void 0, () => {
|
|
@@ -3911,8 +3967,8 @@ function SolanaAmountStep({
|
|
|
3911
3967
|
return null;
|
|
3912
3968
|
}
|
|
3913
3969
|
}, [numericAmount, isSourceStablecoin, hasPricing, tokenPriceUsd, token.decimals]);
|
|
3914
|
-
const minDepositUsd =
|
|
3915
|
-
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3970
|
+
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));
|
|
3971
|
+
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _144 => _144.maxDepositUsd]), () => ( null));
|
|
3916
3972
|
const isBelowMin = minDepositUsd !== null && numericAmount > 0 && numericAmount < minDepositUsd;
|
|
3917
3973
|
const isAboveMax = maxDepositUsd !== null && numericAmount > maxDepositUsd;
|
|
3918
3974
|
const exceedsBalance = Boolean(
|
|
@@ -3922,7 +3978,7 @@ function SolanaAmountStep({
|
|
|
3922
3978
|
const handlePresetClick = (percentage) => {
|
|
3923
3979
|
const formatted = computePresetAmount(percentage);
|
|
3924
3980
|
if (!formatted) return;
|
|
3925
|
-
|
|
3981
|
+
_chunkZQR36NCVcjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
|
|
3926
3982
|
percentage,
|
|
3927
3983
|
symbol: token.symbol,
|
|
3928
3984
|
formatted
|
|
@@ -3957,7 +4013,7 @@ function SolanaAmountStep({
|
|
|
3957
4013
|
try {
|
|
3958
4014
|
amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
|
|
3959
4015
|
} catch (e29) {
|
|
3960
|
-
|
|
4016
|
+
_chunkZQR36NCVcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
3961
4017
|
amount,
|
|
3962
4018
|
sourceAmount: sourceAmountStr,
|
|
3963
4019
|
reason: "parse-units-failed"
|
|
@@ -3966,13 +4022,13 @@ function SolanaAmountStep({
|
|
|
3966
4022
|
return;
|
|
3967
4023
|
}
|
|
3968
4024
|
if (amountInUnits > spendableBalance) {
|
|
3969
|
-
const isReserveIssue =
|
|
4025
|
+
const isReserveIssue = _chunkTENL4H64cjs.isNativeSol.call(void 0, token) && amountInUnits <= balance;
|
|
3970
4026
|
setError(
|
|
3971
4027
|
isReserveIssue ? "Use a bit less than your full SOL balance" : "Insufficient balance"
|
|
3972
4028
|
);
|
|
3973
4029
|
return;
|
|
3974
4030
|
}
|
|
3975
|
-
|
|
4031
|
+
_chunkZQR36NCVcjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
|
|
3976
4032
|
symbol: token.symbol,
|
|
3977
4033
|
inputAmountUsd: amount,
|
|
3978
4034
|
sourceAmount: sourceAmountStr,
|
|
@@ -3985,7 +4041,7 @@ function SolanaAmountStep({
|
|
|
3985
4041
|
const continueDisabled = exceedsBalance || numericAmount === 0 && !isBelowMin;
|
|
3986
4042
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
3987
4043
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3988
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4044
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.WalletIcon, {}), title: "Wallet deposit" }),
|
|
3989
4045
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
3990
4046
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
3991
4047
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -4005,13 +4061,13 @@ function SolanaAmountStep({
|
|
|
4005
4061
|
" available",
|
|
4006
4062
|
computedBalanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
4007
4063
|
" (~",
|
|
4008
|
-
|
|
4064
|
+
_chunkZQR36NCVcjs.currencyFormatter.format(computedBalanceUsd),
|
|
4009
4065
|
")"
|
|
4010
4066
|
] })
|
|
4011
4067
|
] }),
|
|
4012
4068
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
4013
4069
|
"Min. deposit ",
|
|
4014
|
-
|
|
4070
|
+
_chunkZQR36NCVcjs.currencyFormatter.format(minDepositUsd)
|
|
4015
4071
|
] })
|
|
4016
4072
|
] })
|
|
4017
4073
|
] }),
|
|
@@ -4034,7 +4090,7 @@ function SolanaAmountStep({
|
|
|
4034
4090
|
"Solana ",
|
|
4035
4091
|
token.symbol
|
|
4036
4092
|
] }),
|
|
4037
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4093
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.TokenIcon, { symbol: token.symbol }) })
|
|
4038
4094
|
] })
|
|
4039
4095
|
] }),
|
|
4040
4096
|
targetChainName && targetTokenSymbol && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
@@ -4045,18 +4101,17 @@ function SolanaAmountStep({
|
|
|
4045
4101
|
" ",
|
|
4046
4102
|
targetTokenSymbol
|
|
4047
4103
|
] }),
|
|
4048
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4104
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.TokenIcon, { symbol: targetTokenSymbol }) })
|
|
4049
4105
|
] })
|
|
4050
4106
|
] }),
|
|
4051
4107
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
4052
4108
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
4053
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
4109
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunkZQR36NCVcjs.currencyFormatter.format(balanceAfterUsd) })
|
|
4054
4110
|
] })
|
|
4055
4111
|
] }),
|
|
4056
|
-
|
|
4057
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkPUJHXHRAcjs.Callout, { variant: "error", children: error }),
|
|
4112
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.Callout, { variant: "error", children: error }),
|
|
4058
4113
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4059
|
-
|
|
4114
|
+
_chunkZQR36NCVcjs.Button,
|
|
4060
4115
|
{
|
|
4061
4116
|
onClick: handleContinue,
|
|
4062
4117
|
fullWidth: true,
|
|
@@ -4065,7 +4120,7 @@ function SolanaAmountStep({
|
|
|
4065
4120
|
}
|
|
4066
4121
|
)
|
|
4067
4122
|
] }),
|
|
4068
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4123
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.PoweredBy, {})
|
|
4069
4124
|
] });
|
|
4070
4125
|
}
|
|
4071
4126
|
|
|
@@ -4088,10 +4143,10 @@ var _spltoken = require('@solana/spl-token');
|
|
|
4088
4143
|
var DEFAULT_SOLANA_RPC_URL = "https://api.mainnet.solana.com";
|
|
4089
4144
|
var cachedConnections = /* @__PURE__ */ new Map();
|
|
4090
4145
|
function getSolanaRpcUrl(rpcUrls) {
|
|
4091
|
-
return _nullishCoalesce(
|
|
4146
|
+
return _nullishCoalesce(_chunkZQR36NCVcjs.rpcUrlFor.call(void 0, rpcUrls, "solana"), () => ( DEFAULT_SOLANA_RPC_URL));
|
|
4092
4147
|
}
|
|
4093
4148
|
function hasConfiguredSolanaRpcUrl(rpcUrls) {
|
|
4094
|
-
return
|
|
4149
|
+
return _chunkZQR36NCVcjs.rpcUrlFor.call(void 0, rpcUrls, "solana") !== void 0;
|
|
4095
4150
|
}
|
|
4096
4151
|
function getSolanaConnection(rpcUrls) {
|
|
4097
4152
|
const rpcUrl = getSolanaRpcUrl(rpcUrls);
|
|
@@ -4193,36 +4248,37 @@ function SolanaConfirmStep({
|
|
|
4193
4248
|
onError,
|
|
4194
4249
|
debug
|
|
4195
4250
|
}) {
|
|
4196
|
-
const rpcUrls =
|
|
4251
|
+
const rpcUrls = _chunkZQR36NCVcjs.useRpcUrls.call(void 0, );
|
|
4197
4252
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
4198
4253
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
4199
|
-
const
|
|
4200
|
-
const
|
|
4201
|
-
const
|
|
4202
|
-
const
|
|
4203
|
-
const
|
|
4204
|
-
const
|
|
4205
|
-
const
|
|
4206
|
-
const
|
|
4254
|
+
const targetChainId = _chunkTENL4H64cjs.targetChainToChainId.call(void 0, targetChain);
|
|
4255
|
+
const targetSymbol = _chunkTENL4H64cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
4256
|
+
const sourceChainName = _chunkTENL4H64cjs.getChainName.call(void 0, "solana");
|
|
4257
|
+
const targetChainName = _chunkTENL4H64cjs.getChainName.call(void 0, targetChainId);
|
|
4258
|
+
const sourceChainIcon = _chunkTENL4H64cjs.getChainIcon.call(void 0, "solana");
|
|
4259
|
+
const targetChainIcon = _chunkTENL4H64cjs.getChainIcon.call(void 0, targetChainId);
|
|
4260
|
+
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _145 => _145.feeSponsored]), () => ( false));
|
|
4261
|
+
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _146 => _146.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
4262
|
+
const formattedAmount = sourceAmount && Number.isFinite(Number(sourceAmount)) ? _nullishCoalesce(_chunkZQR36NCVcjs.formatTokenAmount.call(void 0, Number(sourceAmount), token.symbol), () => ( "0")) : "0";
|
|
4207
4263
|
const receiveDisplay = (() => {
|
|
4208
4264
|
const usdValue = Number(targetAmount);
|
|
4209
4265
|
const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
|
|
4210
|
-
const estimate =
|
|
4266
|
+
const estimate = _chunkZQR36NCVcjs.formatReceiveEstimate.call(void 0, {
|
|
4211
4267
|
sourceAmount: Number.isFinite(Number(sourceAmount)) ? Number(sourceAmount) : void 0,
|
|
4212
4268
|
sourceSymbol: token.symbol,
|
|
4213
4269
|
targetSymbol,
|
|
4214
4270
|
sourceAmountUsd,
|
|
4215
|
-
sourceTrusted:
|
|
4271
|
+
sourceTrusted: _chunkZQR36NCVcjs.isRecognizedToken.call(void 0, token.mint, "solana"),
|
|
4216
4272
|
// Curated stablecoin target estimates at $1 when unquoted; never applied
|
|
4217
4273
|
// to the source (a held token). See ConfirmStep for the rationale.
|
|
4218
|
-
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } :
|
|
4274
|
+
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : _chunkZQR36NCVcjs.isDisplayStablecoinSymbol.call(void 0, targetSymbol) ? { [targetSymbol.toUpperCase()]: 1 } : {}
|
|
4219
4275
|
});
|
|
4220
4276
|
if (estimate !== void 0) return estimate;
|
|
4221
4277
|
return targetSymbol;
|
|
4222
4278
|
})();
|
|
4223
4279
|
const handleConfirm = async () => {
|
|
4224
4280
|
if (!solanaProvider) {
|
|
4225
|
-
|
|
4281
|
+
_chunkZQR36NCVcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
4226
4282
|
reason: "missing-provider"
|
|
4227
4283
|
});
|
|
4228
4284
|
setError("Solana wallet not connected");
|
|
@@ -4230,7 +4286,7 @@ function SolanaConfirmStep({
|
|
|
4230
4286
|
}
|
|
4231
4287
|
const parsedAmount = parseFloat(sourceAmount);
|
|
4232
4288
|
if (isNaN(parsedAmount) || parsedAmount <= 0) {
|
|
4233
|
-
|
|
4289
|
+
_chunkZQR36NCVcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
4234
4290
|
reason: "invalid-amount",
|
|
4235
4291
|
sourceAmount
|
|
4236
4292
|
});
|
|
@@ -4239,7 +4295,7 @@ function SolanaConfirmStep({
|
|
|
4239
4295
|
}
|
|
4240
4296
|
setError(null);
|
|
4241
4297
|
setIsSubmitting(true);
|
|
4242
|
-
|
|
4298
|
+
_chunkZQR36NCVcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
|
|
4243
4299
|
smartAccount,
|
|
4244
4300
|
solanaAddress,
|
|
4245
4301
|
solanaDepositAddress,
|
|
@@ -4249,7 +4305,7 @@ function SolanaConfirmStep({
|
|
|
4249
4305
|
});
|
|
4250
4306
|
try {
|
|
4251
4307
|
const check = await service.checkAccount(smartAccount);
|
|
4252
|
-
|
|
4308
|
+
_chunkZQR36NCVcjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
|
|
4253
4309
|
smartAccount,
|
|
4254
4310
|
isRegistered: check.isRegistered,
|
|
4255
4311
|
targetChain: check.targetChain,
|
|
@@ -4262,12 +4318,12 @@ function SolanaConfirmStep({
|
|
|
4262
4318
|
}
|
|
4263
4319
|
const connection = hasConfiguredSolanaRpcUrl(rpcUrls) ? getSolanaConnection(rpcUrls) : _nullishCoalesce(solanaConnection, () => ( getSolanaConnection(rpcUrls)));
|
|
4264
4320
|
const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
|
|
4265
|
-
|
|
4321
|
+
_chunkZQR36NCVcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
|
|
4266
4322
|
token: token.symbol,
|
|
4267
4323
|
sourceAmount,
|
|
4268
4324
|
amountUnits: amountUnits.toString()
|
|
4269
4325
|
});
|
|
4270
|
-
const transaction =
|
|
4326
|
+
const transaction = _chunkTENL4H64cjs.isNativeSol.call(void 0, token) ? await buildSolTransferTransaction(
|
|
4271
4327
|
connection,
|
|
4272
4328
|
solanaAddress,
|
|
4273
4329
|
solanaDepositAddress,
|
|
@@ -4279,10 +4335,10 @@ function SolanaConfirmStep({
|
|
|
4279
4335
|
token.mint,
|
|
4280
4336
|
amountUnits
|
|
4281
4337
|
);
|
|
4282
|
-
|
|
4338
|
+
_chunkZQR36NCVcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
4283
4339
|
token: token.symbol,
|
|
4284
4340
|
instructionCount: transaction.instructions.length,
|
|
4285
|
-
feePayer: _optionalChain([transaction, 'access',
|
|
4341
|
+
feePayer: _optionalChain([transaction, 'access', _147 => _147.feePayer, 'optionalAccess', _148 => _148.toBase58, 'call', _149 => _149()]),
|
|
4286
4342
|
recentBlockhash: transaction.recentBlockhash
|
|
4287
4343
|
});
|
|
4288
4344
|
const txHash = await sendSolanaTransaction(
|
|
@@ -4290,7 +4346,7 @@ function SolanaConfirmStep({
|
|
|
4290
4346
|
connection,
|
|
4291
4347
|
transaction
|
|
4292
4348
|
);
|
|
4293
|
-
|
|
4349
|
+
_chunkZQR36NCVcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
|
|
4294
4350
|
txHash,
|
|
4295
4351
|
amountUnits: amountUnits.toString()
|
|
4296
4352
|
});
|
|
@@ -4302,34 +4358,34 @@ function SolanaConfirmStep({
|
|
|
4302
4358
|
});
|
|
4303
4359
|
} catch (err) {
|
|
4304
4360
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
4305
|
-
const message =
|
|
4306
|
-
|
|
4361
|
+
const message = _chunkZQR36NCVcjs.formatUserError.call(void 0, raw);
|
|
4362
|
+
_chunkZQR36NCVcjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
|
|
4307
4363
|
smartAccount,
|
|
4308
4364
|
token: token.symbol,
|
|
4309
4365
|
sourceAmount
|
|
4310
4366
|
});
|
|
4311
4367
|
setError(message);
|
|
4312
|
-
_optionalChain([onError, 'optionalCall',
|
|
4368
|
+
_optionalChain([onError, 'optionalCall', _150 => _150(message, "SOLANA_TRANSFER_ERROR", raw)]);
|
|
4313
4369
|
} finally {
|
|
4314
4370
|
setIsSubmitting(false);
|
|
4315
4371
|
}
|
|
4316
4372
|
};
|
|
4317
4373
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
4318
4374
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4319
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4375
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.WalletIcon, {}), title: "Review deposit" }),
|
|
4320
4376
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-details", children: [
|
|
4321
4377
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
4322
4378
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
4323
4379
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
4324
4380
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceChainName }),
|
|
4325
|
-
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4381
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.CdnIcon, { src: sourceChainIcon }) })
|
|
4326
4382
|
] })
|
|
4327
4383
|
] }),
|
|
4328
4384
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
4329
4385
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
|
|
4330
4386
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
4331
4387
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName }),
|
|
4332
|
-
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4388
|
+
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.CdnIcon, { src: targetChainIcon }) })
|
|
4333
4389
|
] })
|
|
4334
4390
|
] }),
|
|
4335
4391
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -4344,14 +4400,14 @@ function SolanaConfirmStep({
|
|
|
4344
4400
|
" ",
|
|
4345
4401
|
token.symbol
|
|
4346
4402
|
] }),
|
|
4347
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4403
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.TokenIcon, { symbol: token.symbol }) })
|
|
4348
4404
|
] })
|
|
4349
4405
|
] }),
|
|
4350
4406
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
4351
4407
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Receive" }),
|
|
4352
4408
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
4353
4409
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: receiveDisplay }),
|
|
4354
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4410
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.TokenIcon, { symbol: targetSymbol }) })
|
|
4355
4411
|
] })
|
|
4356
4412
|
] }),
|
|
4357
4413
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -4364,13 +4420,13 @@ function SolanaConfirmStep({
|
|
|
4364
4420
|
children: "$0.04"
|
|
4365
4421
|
}
|
|
4366
4422
|
),
|
|
4367
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4423
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHUHBNYD3cjs.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, _chunkZQR36NCVcjs.InfoIcon, {}) }) })
|
|
4368
4424
|
] })
|
|
4369
4425
|
] })
|
|
4370
4426
|
] }),
|
|
4371
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4427
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.Callout, { variant: "error", children: error }),
|
|
4372
4428
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4373
|
-
|
|
4429
|
+
_chunkZQR36NCVcjs.Button,
|
|
4374
4430
|
{
|
|
4375
4431
|
onClick: handleConfirm,
|
|
4376
4432
|
loading: isSubmitting,
|
|
@@ -4381,7 +4437,7 @@ function SolanaConfirmStep({
|
|
|
4381
4437
|
}
|
|
4382
4438
|
)
|
|
4383
4439
|
] }),
|
|
4384
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4440
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.PoweredBy, {})
|
|
4385
4441
|
] });
|
|
4386
4442
|
}
|
|
4387
4443
|
|
|
@@ -4396,22 +4452,22 @@ function DappImportAssetSelectStep({
|
|
|
4396
4452
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
4397
4453
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4398
4454
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4399
|
-
|
|
4455
|
+
_chunkZQR36NCVcjs.BodyHeader,
|
|
4400
4456
|
{
|
|
4401
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4457
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.WalletIcon, {}),
|
|
4402
4458
|
title: `Transfer from ${sourceLabel}`,
|
|
4403
4459
|
subtitle: "Pick the balance to import"
|
|
4404
4460
|
}
|
|
4405
4461
|
),
|
|
4406
4462
|
incompleteSummary && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-notice", role: "status", children: incompleteSummary }),
|
|
4407
4463
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: assets.map((asset) => {
|
|
4408
|
-
const tokenAmount = asset.balance ?
|
|
4464
|
+
const tokenAmount = asset.balance ? _chunkZQR36NCVcjs.tokenFormatter.format(
|
|
4409
4465
|
Number(asset.balance) / 10 ** asset.decimals
|
|
4410
4466
|
) : "0";
|
|
4411
|
-
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ?
|
|
4467
|
+
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ? _chunkZQR36NCVcjs.currencyFormatter.format(asset.balanceUsd) : `${tokenAmount} ${asset.symbol}`;
|
|
4412
4468
|
const assetIcon = asset.icon;
|
|
4413
|
-
const chainIcon =
|
|
4414
|
-
const badge =
|
|
4469
|
+
const chainIcon = _chunkTENL4H64cjs.getChainIcon.call(void 0, asset.chainId);
|
|
4470
|
+
const badge = _chunkTENL4H64cjs.getChainBadge.call(void 0, asset.chainId);
|
|
4415
4471
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4416
4472
|
"button",
|
|
4417
4473
|
{
|
|
@@ -4421,14 +4477,14 @@ function DappImportAssetSelectStep({
|
|
|
4421
4477
|
children: [
|
|
4422
4478
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
|
|
4423
4479
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-icon-wrapper", children: [
|
|
4424
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: assetIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4425
|
-
|
|
4480
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: assetIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.CdnIcon, { src: assetIcon, alt: asset.symbol }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4481
|
+
_chunkZQR36NCVcjs.TokenIcon,
|
|
4426
4482
|
{
|
|
4427
4483
|
symbol: asset.symbol,
|
|
4428
4484
|
fallback: asset.symbol.slice(0, 4)
|
|
4429
4485
|
}
|
|
4430
4486
|
) }),
|
|
4431
|
-
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4487
|
+
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.CdnIcon, { src: chainIcon, alt: _chunkTENL4H64cjs.getChainName.call(void 0, asset.chainId) }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4432
4488
|
"span",
|
|
4433
4489
|
{
|
|
4434
4490
|
className: "rs-asset-chain-badge",
|
|
@@ -4460,7 +4516,7 @@ function DappImportAssetSelectStep({
|
|
|
4460
4516
|
);
|
|
4461
4517
|
}) })
|
|
4462
4518
|
] }),
|
|
4463
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4519
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.PoweredBy, {})
|
|
4464
4520
|
] });
|
|
4465
4521
|
}
|
|
4466
4522
|
DappImportAssetSelectStep.displayName = "DappImportAssetSelectStep";
|
|
@@ -4482,7 +4538,7 @@ function describeRow(status, comingSoon) {
|
|
|
4482
4538
|
}
|
|
4483
4539
|
if (status.enabled) {
|
|
4484
4540
|
return {
|
|
4485
|
-
subtitle: status.balanceUsd > 0 ?
|
|
4541
|
+
subtitle: status.balanceUsd > 0 ? _chunkZQR36NCVcjs.currencyFormatter.format(status.balanceUsd) : "No balance",
|
|
4486
4542
|
disabled: false,
|
|
4487
4543
|
busy: false
|
|
4488
4544
|
};
|
|
@@ -4505,9 +4561,9 @@ function DappImportSelectStep({
|
|
|
4505
4561
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
4506
4562
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4507
4563
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4508
|
-
|
|
4564
|
+
_chunkZQR36NCVcjs.BodyHeader,
|
|
4509
4565
|
{
|
|
4510
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4566
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.MigrateAssetsIcon, {}),
|
|
4511
4567
|
title: "Migrate assets",
|
|
4512
4568
|
subtitle: "Select a position to migrate"
|
|
4513
4569
|
}
|
|
@@ -4519,16 +4575,16 @@ function DappImportSelectStep({
|
|
|
4519
4575
|
Boolean(brand.comingSoon)
|
|
4520
4576
|
);
|
|
4521
4577
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4522
|
-
|
|
4578
|
+
_chunkFVUXJ3RPcjs.ListRow,
|
|
4523
4579
|
{
|
|
4524
4580
|
leadingMedia: brand.iconUrl,
|
|
4525
4581
|
title: brand.label,
|
|
4526
4582
|
subtitle,
|
|
4527
4583
|
disabled,
|
|
4528
|
-
trailing: busy ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4584
|
+
trailing: busy ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.Spinner, { className: "rs-spinner--sm" }) : void 0,
|
|
4529
4585
|
onClick: () => {
|
|
4530
4586
|
if (status === "needs-connect") {
|
|
4531
|
-
_optionalChain([onRequestConnect, 'optionalCall',
|
|
4587
|
+
_optionalChain([onRequestConnect, 'optionalCall', _151 => _151()]);
|
|
4532
4588
|
return;
|
|
4533
4589
|
}
|
|
4534
4590
|
onSelect(brand.id);
|
|
@@ -4538,7 +4594,7 @@ function DappImportSelectStep({
|
|
|
4538
4594
|
);
|
|
4539
4595
|
}) })
|
|
4540
4596
|
] }),
|
|
4541
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4597
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.PoweredBy, {})
|
|
4542
4598
|
] });
|
|
4543
4599
|
}
|
|
4544
4600
|
DappImportSelectStep.displayName = "DappImportSelectStep";
|
|
@@ -4555,9 +4611,9 @@ function DappImportAssetSelectSkeleton({
|
|
|
4555
4611
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: error ? "Couldn't load balances" : "Loading balances\u2026" }),
|
|
4556
4612
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4557
4613
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4558
|
-
|
|
4614
|
+
_chunkZQR36NCVcjs.BodyHeader,
|
|
4559
4615
|
{
|
|
4560
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4616
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.WalletIcon, {}),
|
|
4561
4617
|
title: `Transfer from ${sourceLabel}`,
|
|
4562
4618
|
subtitle: "Pick the balance to import"
|
|
4563
4619
|
}
|
|
@@ -4595,7 +4651,7 @@ function DappImportAssetSelectSkeleton({
|
|
|
4595
4651
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Try again" })
|
|
4596
4652
|
}
|
|
4597
4653
|
) }),
|
|
4598
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4654
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.PoweredBy, {})
|
|
4599
4655
|
] });
|
|
4600
4656
|
}
|
|
4601
4657
|
DappImportAssetSelectSkeleton.displayName = "DappImportAssetSelectSkeleton";
|
|
@@ -4684,7 +4740,7 @@ var aaveProvider = {
|
|
|
4684
4740
|
throw new Error("Aave positions require a backend connection");
|
|
4685
4741
|
}
|
|
4686
4742
|
const response = await backend.getPositions(eoa);
|
|
4687
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
4743
|
+
if (_optionalChain([signal, 'optionalAccess', _152 => _152.aborted])) return null;
|
|
4688
4744
|
const assets = toImportableAssets(response.positions);
|
|
4689
4745
|
const failures = _nullishCoalesce(response.failures, () => ( []));
|
|
4690
4746
|
if (assets.length === 0) {
|
|
@@ -4771,9 +4827,9 @@ var aaveProvider = {
|
|
|
4771
4827
|
function toImportableAssets(positions) {
|
|
4772
4828
|
const assets = [];
|
|
4773
4829
|
for (const position of positions) {
|
|
4774
|
-
const chainId =
|
|
4830
|
+
const chainId = _chunkTENL4H64cjs.parseEvmChainId.call(void 0, position.chain);
|
|
4775
4831
|
if (chainId === null) continue;
|
|
4776
|
-
if (!
|
|
4832
|
+
if (!_chunkTENL4H64cjs.CHAIN_BY_ID[chainId]) continue;
|
|
4777
4833
|
if (BigInt(position.maxWithdrawable) <= 0n) continue;
|
|
4778
4834
|
if (position.constraints.some((c) => POLICY_REFUSED.includes(c))) continue;
|
|
4779
4835
|
assets.push(buildAsset(position, chainId));
|
|
@@ -4890,7 +4946,7 @@ async function detectPolymarketWalletKind(params) {
|
|
|
4890
4946
|
contracts: [
|
|
4891
4947
|
{
|
|
4892
4948
|
address: proxyWallet,
|
|
4893
|
-
abi:
|
|
4949
|
+
abi: _chunkJPRV36DTcjs.SAFE_ABI,
|
|
4894
4950
|
functionName: "isOwner",
|
|
4895
4951
|
args: [eoa]
|
|
4896
4952
|
},
|
|
@@ -4923,7 +4979,7 @@ async function buildSignedDepositWalletBatch(params) {
|
|
|
4923
4979
|
if (!account || !chain) {
|
|
4924
4980
|
throw new Error("Wallet not connected");
|
|
4925
4981
|
}
|
|
4926
|
-
if (chain.id !==
|
|
4982
|
+
if (chain.id !== _chunkJPRV36DTcjs.POLYMARKET_POLYGON_CHAIN_ID) {
|
|
4927
4983
|
throw new Error("Switch to Polygon to sign");
|
|
4928
4984
|
}
|
|
4929
4985
|
const owner = await publicClient.readContract({
|
|
@@ -4968,14 +5024,14 @@ async function buildSignedDepositWalletBatch(params) {
|
|
|
4968
5024
|
})),
|
|
4969
5025
|
signature
|
|
4970
5026
|
},
|
|
4971
|
-
sourceToken:
|
|
5027
|
+
sourceToken: _chunkJPRV36DTcjs.POLYMARKET_USDCE_ADDRESS,
|
|
4972
5028
|
sourceSymbol: tokenKind === "pusd" ? "pUSD" : "USDC.e"
|
|
4973
5029
|
};
|
|
4974
5030
|
}
|
|
4975
5031
|
function buildUsdceTransferCalls(recipient, amount) {
|
|
4976
5032
|
return [
|
|
4977
5033
|
{
|
|
4978
|
-
target:
|
|
5034
|
+
target: _chunkJPRV36DTcjs.POLYMARKET_USDCE_ADDRESS,
|
|
4979
5035
|
value: 0n,
|
|
4980
5036
|
data: _viem.encodeFunctionData.call(void 0, {
|
|
4981
5037
|
abi: _viem.erc20Abi,
|
|
@@ -4988,21 +5044,21 @@ function buildUsdceTransferCalls(recipient, amount) {
|
|
|
4988
5044
|
function buildPusdUnwrapCalls(recipient, amount) {
|
|
4989
5045
|
return [
|
|
4990
5046
|
{
|
|
4991
|
-
target:
|
|
5047
|
+
target: _chunkJPRV36DTcjs.POLYMARKET_PUSD_ADDRESS,
|
|
4992
5048
|
value: 0n,
|
|
4993
5049
|
data: _viem.encodeFunctionData.call(void 0, {
|
|
4994
5050
|
abi: _viem.erc20Abi,
|
|
4995
5051
|
functionName: "approve",
|
|
4996
|
-
args: [
|
|
5052
|
+
args: [_chunkJPRV36DTcjs.POLYMARKET_COLLATERAL_OFFRAMP_ADDRESS, amount]
|
|
4997
5053
|
})
|
|
4998
5054
|
},
|
|
4999
5055
|
{
|
|
5000
|
-
target:
|
|
5056
|
+
target: _chunkJPRV36DTcjs.POLYMARKET_COLLATERAL_OFFRAMP_ADDRESS,
|
|
5001
5057
|
value: 0n,
|
|
5002
5058
|
data: _viem.encodeFunctionData.call(void 0, {
|
|
5003
5059
|
abi: COLLATERAL_OFFRAMP_ABI,
|
|
5004
5060
|
functionName: "unwrap",
|
|
5005
|
-
args: [
|
|
5061
|
+
args: [_chunkJPRV36DTcjs.POLYMARKET_USDCE_ADDRESS, recipient, amount]
|
|
5006
5062
|
})
|
|
5007
5063
|
}
|
|
5008
5064
|
];
|
|
@@ -5014,23 +5070,23 @@ var polymarketProvider = {
|
|
|
5014
5070
|
id: PROVIDER_ID2,
|
|
5015
5071
|
sourceLabel: "Polymarket",
|
|
5016
5072
|
async fetchAvailability({ eoa, getPublicClient: getPublicClient2, signal }) {
|
|
5017
|
-
const proxyWallet = await
|
|
5073
|
+
const proxyWallet = await _chunkJPRV36DTcjs.fetchPolymarketProxyWallet.call(void 0, eoa, signal);
|
|
5018
5074
|
if (!proxyWallet) return null;
|
|
5019
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
5020
|
-
const polygonClient = getPublicClient2(
|
|
5075
|
+
if (_optionalChain([signal, 'optionalAccess', _153 => _153.aborted])) return null;
|
|
5076
|
+
const polygonClient = getPublicClient2(_chunkJPRV36DTcjs.POLYMARKET_POLYGON_CHAIN_ID);
|
|
5021
5077
|
if (!polygonClient) return null;
|
|
5022
|
-
const balances = await
|
|
5078
|
+
const balances = await _chunkJPRV36DTcjs.readPolymarketBalances.call(void 0, {
|
|
5023
5079
|
publicClient: polygonClient,
|
|
5024
5080
|
proxyWallet
|
|
5025
5081
|
});
|
|
5026
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
5082
|
+
if (_optionalChain([signal, 'optionalAccess', _154 => _154.aborted])) return null;
|
|
5027
5083
|
if (balances.pusd === 0n && balances.usdce === 0n) return null;
|
|
5028
5084
|
const walletKind = await detectPolymarketWalletKind({
|
|
5029
5085
|
publicClient: polygonClient,
|
|
5030
5086
|
proxyWallet,
|
|
5031
5087
|
eoa
|
|
5032
5088
|
});
|
|
5033
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
5089
|
+
if (_optionalChain([signal, 'optionalAccess', _155 => _155.aborted])) return null;
|
|
5034
5090
|
if (!walletKind) return null;
|
|
5035
5091
|
const assets = [];
|
|
5036
5092
|
if (balances.pusd > 0n) {
|
|
@@ -5077,7 +5133,7 @@ var polymarketProvider = {
|
|
|
5077
5133
|
const { txHash } = await backend.submitPolymarketWithdraw(payload);
|
|
5078
5134
|
return { txHash, sourceToken, sourceSymbol, sourceDecimals: 6 };
|
|
5079
5135
|
}
|
|
5080
|
-
const result = await
|
|
5136
|
+
const result = await _chunkJPRV36DTcjs.executePolymarketSafeTransfer.call(void 0, {
|
|
5081
5137
|
walletClient,
|
|
5082
5138
|
publicClient,
|
|
5083
5139
|
safeAddress: metadata.proxyWallet,
|
|
@@ -5096,17 +5152,17 @@ var polymarketProvider = {
|
|
|
5096
5152
|
function buildAsset2(params) {
|
|
5097
5153
|
const { tokenKind, proxyWallet, walletKind, balance } = params;
|
|
5098
5154
|
const isPusd = tokenKind === "pusd";
|
|
5099
|
-
const tokenAddress = isPusd ?
|
|
5155
|
+
const tokenAddress = isPusd ? _chunkJPRV36DTcjs.POLYMARKET_PUSD_ADDRESS : _chunkJPRV36DTcjs.POLYMARKET_USDCE_ADDRESS;
|
|
5100
5156
|
const symbol = isPusd ? "pUSD" : "USDC.e";
|
|
5101
5157
|
const balanceUsd = Number(_viem.formatUnits.call(void 0, balance, 6));
|
|
5102
5158
|
const metadata = { proxyWallet, tokenKind, walletKind };
|
|
5103
5159
|
return {
|
|
5104
5160
|
id: `polymarket:${tokenKind}`,
|
|
5105
|
-
chainId:
|
|
5161
|
+
chainId: _chunkJPRV36DTcjs.POLYMARKET_POLYGON_CHAIN_ID,
|
|
5106
5162
|
token: tokenAddress,
|
|
5107
5163
|
symbol,
|
|
5108
5164
|
name: isPusd ? "Polymarket USD" : "Polygon USDC.e",
|
|
5109
|
-
icon: isPusd ?
|
|
5165
|
+
icon: isPusd ? _chunkJPRV36DTcjs.POLYMARKET_ICON_URL : void 0,
|
|
5110
5166
|
decimals: 6,
|
|
5111
5167
|
balance: balance.toString(),
|
|
5112
5168
|
balanceUsd: Number.isFinite(balanceUsd) ? balanceUsd : 0,
|
|
@@ -5119,8 +5175,8 @@ function buildAsset2(params) {
|
|
|
5119
5175
|
// pUSD unwraps to USDC.e via the offramp; USDC.e is what actually
|
|
5120
5176
|
// arrives at the smart account, so it's also what the orchestrator
|
|
5121
5177
|
// bridges from.
|
|
5122
|
-
depositToken:
|
|
5123
|
-
depositChainId:
|
|
5178
|
+
depositToken: _chunkJPRV36DTcjs.POLYMARKET_USDCE_ADDRESS,
|
|
5179
|
+
depositChainId: _chunkJPRV36DTcjs.POLYMARKET_POLYGON_CHAIN_ID,
|
|
5124
5180
|
providerMetadata: metadata
|
|
5125
5181
|
};
|
|
5126
5182
|
}
|
|
@@ -5141,7 +5197,7 @@ function getEnabledProviders(config) {
|
|
|
5141
5197
|
function computeDappImportStatus(providerId, inputs) {
|
|
5142
5198
|
const { owner, availability, availabilityOwner, setup } = inputs;
|
|
5143
5199
|
if (!owner) return "needs-connect";
|
|
5144
|
-
const entry = _optionalChain([availabilityOwner, 'optionalAccess',
|
|
5200
|
+
const entry = _optionalChain([availabilityOwner, 'optionalAccess', _156 => _156.toLowerCase, 'call', _157 => _157()]) === owner.toLowerCase() ? availability[providerId] : void 0;
|
|
5145
5201
|
if (entry === "loading" || entry === void 0) return "loading";
|
|
5146
5202
|
if (entry === "error") {
|
|
5147
5203
|
return {
|
|
@@ -5667,7 +5723,7 @@ function applyAction(state, action) {
|
|
|
5667
5723
|
totalUsd: null,
|
|
5668
5724
|
// Keep any prior chains visible so the cluster does not flicker
|
|
5669
5725
|
// empty across a refresh.
|
|
5670
|
-
chainIds: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
5726
|
+
chainIds: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _158 => _158.chainIds]), () => ( []))
|
|
5671
5727
|
}
|
|
5672
5728
|
}
|
|
5673
5729
|
}
|
|
@@ -5832,7 +5888,7 @@ function applyAction(state, action) {
|
|
|
5832
5888
|
flow: { ...state.flow, step: "processing" }
|
|
5833
5889
|
};
|
|
5834
5890
|
case "processing/quote-loaded":
|
|
5835
|
-
if (state.flow.step !== "processing" || _optionalChain([state, 'access',
|
|
5891
|
+
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()) {
|
|
5836
5892
|
return state;
|
|
5837
5893
|
}
|
|
5838
5894
|
return {
|
|
@@ -6398,11 +6454,11 @@ function DepositFlow({
|
|
|
6398
6454
|
onError,
|
|
6399
6455
|
debug
|
|
6400
6456
|
}) {
|
|
6401
|
-
const rpcUrls =
|
|
6402
|
-
const onStepChangeRef =
|
|
6403
|
-
const onEventRef =
|
|
6404
|
-
const onLifecycleRef =
|
|
6405
|
-
const onErrorRef =
|
|
6457
|
+
const rpcUrls = _chunkZQR36NCVcjs.useRpcUrls.call(void 0, );
|
|
6458
|
+
const onStepChangeRef = _chunkZQR36NCVcjs.useLatestRef.call(void 0, onStepChange);
|
|
6459
|
+
const onEventRef = _chunkZQR36NCVcjs.useLatestRef.call(void 0, onEvent);
|
|
6460
|
+
const onLifecycleRef = _chunkZQR36NCVcjs.useLatestRef.call(void 0, onLifecycle);
|
|
6461
|
+
const onErrorRef = _chunkZQR36NCVcjs.useLatestRef.call(void 0, onError);
|
|
6406
6462
|
const storeApi = useDepositStoreApi();
|
|
6407
6463
|
const flowSlice = useDepositStore((s) => s.flow);
|
|
6408
6464
|
const depositSlice = useDepositStore((s) => s.deposit);
|
|
@@ -6419,13 +6475,13 @@ function DepositFlow({
|
|
|
6419
6475
|
const stableWalletSelectionKeyRef = _react.useRef.call(void 0, null);
|
|
6420
6476
|
const logFlow = _react.useCallback.call(void 0,
|
|
6421
6477
|
(message, data) => {
|
|
6422
|
-
|
|
6478
|
+
_chunkZQR36NCVcjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
|
|
6423
6479
|
},
|
|
6424
6480
|
[debug]
|
|
6425
6481
|
);
|
|
6426
6482
|
const logFlowError = _react.useCallback.call(void 0,
|
|
6427
6483
|
(message, error, data) => {
|
|
6428
|
-
|
|
6484
|
+
_chunkZQR36NCVcjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
|
|
6429
6485
|
},
|
|
6430
6486
|
[debug]
|
|
6431
6487
|
);
|
|
@@ -6449,12 +6505,12 @@ function DepositFlow({
|
|
|
6449
6505
|
};
|
|
6450
6506
|
}, [enableSwappedPreconnect]);
|
|
6451
6507
|
const dappSwitchChain = _react.useMemo.call(void 0, () => {
|
|
6452
|
-
if (!_optionalChain([walletClientProp, 'optionalAccess',
|
|
6508
|
+
if (!_optionalChain([walletClientProp, 'optionalAccess', _163 => _163.switchChain])) return void 0;
|
|
6453
6509
|
return async (chainId) => {
|
|
6454
|
-
await _optionalChain([walletClientProp, 'access',
|
|
6510
|
+
await _optionalChain([walletClientProp, 'access', _164 => _164.switchChain, 'optionalCall', _165 => _165({ id: chainId })]);
|
|
6455
6511
|
};
|
|
6456
6512
|
}, [walletClientProp]);
|
|
6457
|
-
const connectedWalletAddress = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess',
|
|
6513
|
+
const connectedWalletAddress = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess', _166 => _166.account, 'optionalAccess', _167 => _167.address]), () => ( null));
|
|
6458
6514
|
const walletOptions = _react.useMemo.call(void 0, () => {
|
|
6459
6515
|
const options = [];
|
|
6460
6516
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -6468,7 +6524,7 @@ function DepositFlow({
|
|
|
6468
6524
|
});
|
|
6469
6525
|
seen.add(id);
|
|
6470
6526
|
}
|
|
6471
|
-
if (_optionalChain([reownWallet, 'optionalAccess',
|
|
6527
|
+
if (_optionalChain([reownWallet, 'optionalAccess', _168 => _168.isConnected]) && reownWallet.isSolana && reownWallet.solanaAddress) {
|
|
6472
6528
|
const id = _nullishCoalesce(reownWallet.caipAddress, () => ( `solana:${reownWallet.solanaAddress}`));
|
|
6473
6529
|
if (!seen.has(id)) {
|
|
6474
6530
|
options.push({
|
|
@@ -6480,7 +6536,7 @@ function DepositFlow({
|
|
|
6480
6536
|
});
|
|
6481
6537
|
seen.add(id);
|
|
6482
6538
|
}
|
|
6483
|
-
} else if (_optionalChain([reownWallet, 'optionalAccess',
|
|
6539
|
+
} else if (_optionalChain([reownWallet, 'optionalAccess', _169 => _169.address]) && reownWallet.isConnected && reownWallet.walletClient && reownWallet.publicClient && !seen.has(`evm:${reownWallet.address.toLowerCase()}`)) {
|
|
6484
6540
|
const id = `evm:${reownWallet.address.toLowerCase()}`;
|
|
6485
6541
|
if (!seen.has(id)) {
|
|
6486
6542
|
options.push({
|
|
@@ -6496,14 +6552,14 @@ function DepositFlow({
|
|
|
6496
6552
|
return options;
|
|
6497
6553
|
}, [
|
|
6498
6554
|
connectedWalletAddress,
|
|
6499
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
6500
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
6501
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
6502
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
6503
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
6504
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
6505
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
6506
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
6555
|
+
_optionalChain([reownWallet, 'optionalAccess', _170 => _170.address]),
|
|
6556
|
+
_optionalChain([reownWallet, 'optionalAccess', _171 => _171.isConnected]),
|
|
6557
|
+
_optionalChain([reownWallet, 'optionalAccess', _172 => _172.walletClient]),
|
|
6558
|
+
_optionalChain([reownWallet, 'optionalAccess', _173 => _173.publicClient]),
|
|
6559
|
+
_optionalChain([reownWallet, 'optionalAccess', _174 => _174.icon]),
|
|
6560
|
+
_optionalChain([reownWallet, 'optionalAccess', _175 => _175.isSolana]),
|
|
6561
|
+
_optionalChain([reownWallet, 'optionalAccess', _176 => _176.solanaAddress]),
|
|
6562
|
+
_optionalChain([reownWallet, 'optionalAccess', _177 => _177.caipAddress])
|
|
6507
6563
|
]);
|
|
6508
6564
|
const offeredFiatMethods = _react.useMemo.call(void 0,
|
|
6509
6565
|
() => fiatMethods ? FIAT_ONRAMP_METHODS.filter((m) => fiatMethods[m.method]) : FIAT_ONRAMP_METHODS,
|
|
@@ -6523,11 +6579,11 @@ function DepositFlow({
|
|
|
6523
6579
|
hasEnabledAssetMigration
|
|
6524
6580
|
].filter(Boolean).length;
|
|
6525
6581
|
const canAutoLock = Boolean(
|
|
6526
|
-
enableWallet && _optionalChain([walletClientProp, 'optionalAccess',
|
|
6582
|
+
enableWallet && _optionalChain([walletClientProp, 'optionalAccess', _178 => _178.account]) && !reownWallet && enabledFeatureCount === 1
|
|
6527
6583
|
);
|
|
6528
6584
|
const hasWalletOptions = enableWallet && walletOptions.length > 0;
|
|
6529
6585
|
const hasReownSession = Boolean(
|
|
6530
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
6586
|
+
_optionalChain([reownWallet, 'optionalAccess', _179 => _179.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _180 => _180.address])
|
|
6531
6587
|
);
|
|
6532
6588
|
const isDappImportWalletHydrating = Boolean(
|
|
6533
6589
|
hasWalletClientProp && walletClientProp === void 0 || reownWallet && !hasReownSession && !reownWallet.isReady
|
|
@@ -6547,9 +6603,10 @@ function DepositFlow({
|
|
|
6547
6603
|
isConnectSelectionConfirmed,
|
|
6548
6604
|
selectedWalletId
|
|
6549
6605
|
]);
|
|
6550
|
-
const setupChainId = typeof targetChain === "number" && !
|
|
6551
|
-
const
|
|
6552
|
-
const
|
|
6606
|
+
const setupChainId = typeof targetChain === "number" && !_chunkTENL4H64cjs.isVirtualDestination.call(void 0, targetChain) ? targetChain : typeof defaultSourceChain === "number" ? defaultSourceChain : _chains.base.id;
|
|
6607
|
+
const targetChainId = _chunkTENL4H64cjs.targetChainToChainId.call(void 0, targetChain);
|
|
6608
|
+
const targetSymbol = _chunkTENL4H64cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
6609
|
+
const isTargetStablecoin = _chunkTENL4H64cjs.isStablecoinSymbol.call(void 0, targetSymbol);
|
|
6553
6610
|
const targetMarketPriceRef = _react.useRef.call(void 0, null);
|
|
6554
6611
|
_react.useEffect.call(void 0, () => {
|
|
6555
6612
|
targetMarketPriceRef.current = null;
|
|
@@ -6557,8 +6614,8 @@ function DepositFlow({
|
|
|
6557
6614
|
return;
|
|
6558
6615
|
}
|
|
6559
6616
|
let cancelled = false;
|
|
6560
|
-
|
|
6561
|
-
chainId:
|
|
6617
|
+
_chunkHUHBNYD3cjs.fetchTokenPriceUsd.call(void 0, service, {
|
|
6618
|
+
chainId: targetChainId,
|
|
6562
6619
|
address: targetToken,
|
|
6563
6620
|
symbol: targetSymbol
|
|
6564
6621
|
}).then((price) => {
|
|
@@ -6574,11 +6631,11 @@ function DepositFlow({
|
|
|
6574
6631
|
return null;
|
|
6575
6632
|
}
|
|
6576
6633
|
if (canAutoLock) {
|
|
6577
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess',
|
|
6634
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess', _181 => _181.chain, 'optionalAccess', _182 => _182.id]), () => ( setupChainId));
|
|
6578
6635
|
return {
|
|
6579
6636
|
ownerAddress: walletClientProp.account.address,
|
|
6580
6637
|
walletClient: walletClientProp,
|
|
6581
|
-
publicClient: _nullishCoalesce(publicClientProp, () => (
|
|
6638
|
+
publicClient: _nullishCoalesce(publicClientProp, () => ( _chunkZQR36NCVcjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
|
|
6582
6639
|
switchChain: dappSwitchChain
|
|
6583
6640
|
};
|
|
6584
6641
|
}
|
|
@@ -6590,20 +6647,20 @@ function DepositFlow({
|
|
|
6590
6647
|
if (selectedOption.kind === "solana") {
|
|
6591
6648
|
return null;
|
|
6592
6649
|
}
|
|
6593
|
-
if (selectedOption.kind === "connected" && _optionalChain([walletClientProp, 'optionalAccess',
|
|
6594
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess',
|
|
6650
|
+
if (selectedOption.kind === "connected" && _optionalChain([walletClientProp, 'optionalAccess', _183 => _183.account]) && selectedOption.address && walletClientProp.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
6651
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess', _184 => _184.chain, 'optionalAccess', _185 => _185.id]), () => ( setupChainId));
|
|
6595
6652
|
return {
|
|
6596
6653
|
ownerAddress: walletClientProp.account.address,
|
|
6597
6654
|
walletClient: walletClientProp,
|
|
6598
|
-
publicClient: _nullishCoalesce(publicClientProp, () => (
|
|
6655
|
+
publicClient: _nullishCoalesce(publicClientProp, () => ( _chunkZQR36NCVcjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
|
|
6599
6656
|
switchChain: dappSwitchChain
|
|
6600
6657
|
};
|
|
6601
6658
|
}
|
|
6602
|
-
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess',
|
|
6659
|
+
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess', _186 => _186.address]) && selectedOption.address && reownWallet.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
6603
6660
|
return {
|
|
6604
6661
|
ownerAddress: reownWallet.address,
|
|
6605
6662
|
walletClient: reownWallet.walletClient,
|
|
6606
|
-
publicClient: _nullishCoalesce(reownWallet.publicClient, () => (
|
|
6663
|
+
publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunkZQR36NCVcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
|
|
6607
6664
|
switchChain: reownWallet.switchChain
|
|
6608
6665
|
};
|
|
6609
6666
|
}
|
|
@@ -6656,35 +6713,35 @@ function DepositFlow({
|
|
|
6656
6713
|
const selectedEvmWalletOwner = _react.useMemo.call(void 0, () => {
|
|
6657
6714
|
if (!selectedWalletId) return null;
|
|
6658
6715
|
const opt = walletOptions.find((o) => o.id === selectedWalletId);
|
|
6659
|
-
if (_optionalChain([opt, 'optionalAccess',
|
|
6716
|
+
if (_optionalChain([opt, 'optionalAccess', _187 => _187.kind]) === "external" && opt.address) {
|
|
6660
6717
|
return opt.address;
|
|
6661
6718
|
}
|
|
6662
|
-
if (_optionalChain([opt, 'optionalAccess',
|
|
6719
|
+
if (_optionalChain([opt, 'optionalAccess', _188 => _188.kind]) === "connected" && opt.address) {
|
|
6663
6720
|
return opt.address;
|
|
6664
6721
|
}
|
|
6665
6722
|
return null;
|
|
6666
6723
|
}, [selectedWalletId, walletOptions]);
|
|
6667
6724
|
const dappImportOwner = _react.useMemo.call(void 0, () => {
|
|
6668
6725
|
if (selectedEvmWalletOwner) return selectedEvmWalletOwner;
|
|
6669
|
-
if (_optionalChain([reownWallet, 'optionalAccess',
|
|
6726
|
+
if (_optionalChain([reownWallet, 'optionalAccess', _189 => _189.address]) && reownWallet.isConnected) {
|
|
6670
6727
|
return reownWallet.address;
|
|
6671
6728
|
}
|
|
6672
6729
|
if (connectedWalletAddress) return connectedWalletAddress;
|
|
6673
6730
|
return null;
|
|
6674
6731
|
}, [
|
|
6675
6732
|
selectedEvmWalletOwner,
|
|
6676
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
6677
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
6733
|
+
_optionalChain([reownWallet, 'optionalAccess', _190 => _190.address]),
|
|
6734
|
+
_optionalChain([reownWallet, 'optionalAccess', _191 => _191.isConnected]),
|
|
6678
6735
|
connectedWalletAddress
|
|
6679
6736
|
]);
|
|
6680
6737
|
const activeOwner = _react.useMemo.call(void 0,
|
|
6681
6738
|
() => resolveOwnerForMode(flowMode, {
|
|
6682
|
-
walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess',
|
|
6739
|
+
walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _192 => _192.ownerAddress]), () => ( (canAutoLock ? connectedWalletAddress : selectedEvmWalletOwner))),
|
|
6683
6740
|
dappImportOwner
|
|
6684
6741
|
}),
|
|
6685
6742
|
[
|
|
6686
6743
|
flowMode,
|
|
6687
|
-
_optionalChain([signerContext, 'optionalAccess',
|
|
6744
|
+
_optionalChain([signerContext, 'optionalAccess', _193 => _193.ownerAddress]),
|
|
6688
6745
|
canAutoLock,
|
|
6689
6746
|
connectedWalletAddress,
|
|
6690
6747
|
selectedEvmWalletOwner,
|
|
@@ -6701,7 +6758,7 @@ function DepositFlow({
|
|
|
6701
6758
|
].join(":");
|
|
6702
6759
|
if (lastSmartAccountLifecycleKeyRef.current === lifecycleKey) return;
|
|
6703
6760
|
lastSmartAccountLifecycleKeyRef.current = lifecycleKey;
|
|
6704
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6761
|
+
_optionalChain([onLifecycleRef, 'access', _194 => _194.current, 'optionalCall', _195 => _195({
|
|
6705
6762
|
type: "smart-account-changed",
|
|
6706
6763
|
evm: activeEntry.smartAccount,
|
|
6707
6764
|
solana: _nullishCoalesce(activeEntry.solanaDepositAddress, () => ( null))
|
|
@@ -6729,7 +6786,7 @@ function DepositFlow({
|
|
|
6729
6786
|
return;
|
|
6730
6787
|
}
|
|
6731
6788
|
lastConnectedLifecycleKeyRef.current = lifecycleKey;
|
|
6732
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6789
|
+
_optionalChain([onLifecycleRef, 'access', _196 => _196.current, 'optionalCall', _197 => _197({
|
|
6733
6790
|
type: "connected",
|
|
6734
6791
|
address: activeOwner,
|
|
6735
6792
|
smartAccount: activeEntry.smartAccount
|
|
@@ -6774,7 +6831,7 @@ function DepositFlow({
|
|
|
6774
6831
|
const currentBackHandler = canGoBackFromHere ? handleBack : void 0;
|
|
6775
6832
|
const currentScreen = showConnectStep ? "connect" : effectiveStep.type;
|
|
6776
6833
|
_react.useEffect.call(void 0, () => {
|
|
6777
|
-
_optionalChain([onStepChangeRef, 'access',
|
|
6834
|
+
_optionalChain([onStepChangeRef, 'access', _198 => _198.current, 'optionalCall', _199 => _199(currentBackHandler, currentScreen)]);
|
|
6778
6835
|
}, [currentBackHandler, currentScreen, onStepChangeRef]);
|
|
6779
6836
|
const lastModalHeightRef = _react.useRef.call(void 0, 0);
|
|
6780
6837
|
const modalContentElRef = _react.useRef.call(void 0, null);
|
|
@@ -6784,7 +6841,7 @@ function DepositFlow({
|
|
|
6784
6841
|
modalContentElRef.current = mc;
|
|
6785
6842
|
const ro = new ResizeObserver((entries) => {
|
|
6786
6843
|
for (const entry of entries) {
|
|
6787
|
-
const border = _optionalChain([entry, 'access',
|
|
6844
|
+
const border = _optionalChain([entry, 'access', _200 => _200.borderBoxSize, 'optionalAccess', _201 => _201[0], 'optionalAccess', _202 => _202.blockSize]);
|
|
6788
6845
|
lastModalHeightRef.current = typeof border === "number" ? border : entry.contentRect.height;
|
|
6789
6846
|
}
|
|
6790
6847
|
});
|
|
@@ -6825,23 +6882,23 @@ function DepositFlow({
|
|
|
6825
6882
|
}
|
|
6826
6883
|
lastStepOpenEventKeyRef.current = stepOpenEventKey;
|
|
6827
6884
|
if (effectiveStep.type === "select-asset") {
|
|
6828
|
-
_optionalChain([onEventRef, 'access',
|
|
6885
|
+
_optionalChain([onEventRef, 'access', _203 => _203.current, 'optionalCall', _204 => _204({
|
|
6829
6886
|
type: "deposit_modal_connected_wallet_select_source_open",
|
|
6830
6887
|
total_balance_in_external_wallet: totalBalanceUsd,
|
|
6831
6888
|
pred_balance: totalBalanceUsd
|
|
6832
6889
|
})]);
|
|
6833
6890
|
} else if (effectiveStep.type === "deposit-address") {
|
|
6834
|
-
const chainName =
|
|
6835
|
-
const tokenSymbol =
|
|
6836
|
-
_optionalChain([onEventRef, 'access',
|
|
6891
|
+
const chainName = _chunkTENL4H64cjs.getChainName.call(void 0, targetChainId);
|
|
6892
|
+
const tokenSymbol = _chunkTENL4H64cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
6893
|
+
_optionalChain([onEventRef, 'access', _205 => _205.current, 'optionalCall', _206 => _206({
|
|
6837
6894
|
type: "deposit_modal_transfer_crypto_open",
|
|
6838
6895
|
default_chain: chainName,
|
|
6839
6896
|
default_token: tokenSymbol,
|
|
6840
6897
|
pred_balance: totalBalanceUsd
|
|
6841
6898
|
})]);
|
|
6842
6899
|
} else if (effectiveStep.type === "amount" && stepSendToken) {
|
|
6843
|
-
const receiveSymbol =
|
|
6844
|
-
_optionalChain([onEventRef, 'access',
|
|
6900
|
+
const receiveSymbol = _chunkTENL4H64cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
6901
|
+
_optionalChain([onEventRef, 'access', _207 => _207.current, 'optionalCall', _208 => _208({
|
|
6845
6902
|
type: "deposit_modal_connected_wallet_enter_value_open",
|
|
6846
6903
|
send_token: stepSendToken,
|
|
6847
6904
|
receive_token: receiveSymbol,
|
|
@@ -6874,7 +6931,7 @@ function DepositFlow({
|
|
|
6874
6931
|
targetToken
|
|
6875
6932
|
]);
|
|
6876
6933
|
_react.useEffect.call(void 0, () => {
|
|
6877
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6934
|
+
_optionalChain([onLifecycleRef, 'access', _209 => _209.current, 'optionalCall', _210 => _210({
|
|
6878
6935
|
type: "balance-changed",
|
|
6879
6936
|
totalUsd: totalBalanceUsd
|
|
6880
6937
|
})]);
|
|
@@ -6890,7 +6947,7 @@ function DepositFlow({
|
|
|
6890
6947
|
const handleConfirmWallet = _react.useCallback.call(void 0,
|
|
6891
6948
|
(walletId) => {
|
|
6892
6949
|
const selectedOption = walletOptions.find((o) => o.id === walletId);
|
|
6893
|
-
const mode = _optionalChain([selectedOption, 'optionalAccess',
|
|
6950
|
+
const mode = _optionalChain([selectedOption, 'optionalAccess', _211 => _211.kind]) === "solana" ? "solana-wallet" : "wallet";
|
|
6894
6951
|
storeApi.dispatch({
|
|
6895
6952
|
type: "connect/wallet-confirmed",
|
|
6896
6953
|
walletId,
|
|
@@ -6900,7 +6957,7 @@ function DepositFlow({
|
|
|
6900
6957
|
[walletOptions, storeApi]
|
|
6901
6958
|
);
|
|
6902
6959
|
const isSolanaWalletConnected = Boolean(
|
|
6903
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
6960
|
+
_optionalChain([reownWallet, 'optionalAccess', _212 => _212.isConnected]) && _optionalChain([reownWallet, 'optionalAccess', _213 => _213.isSolana])
|
|
6904
6961
|
);
|
|
6905
6962
|
const assetMigrationsKey = assetMigrations ? Object.keys(assetMigrations).filter((k) => assetMigrations[k]).sort().join(",") : "";
|
|
6906
6963
|
const enabledDappImportProviders = _react.useMemo.call(void 0,
|
|
@@ -6917,7 +6974,7 @@ function DepositFlow({
|
|
|
6917
6974
|
const owner = dappImportOwner;
|
|
6918
6975
|
if (owner) {
|
|
6919
6976
|
const wallet = walletOptions.find(
|
|
6920
|
-
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess',
|
|
6977
|
+
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _214 => _214.toLowerCase, 'call', _215 => _215()]) === owner.toLowerCase()
|
|
6921
6978
|
);
|
|
6922
6979
|
if (wallet) {
|
|
6923
6980
|
storeApi.dispatch({
|
|
@@ -6958,7 +7015,7 @@ function DepositFlow({
|
|
|
6958
7015
|
eoa: dappImportOwner,
|
|
6959
7016
|
getPublicClient: (chainId) => {
|
|
6960
7017
|
try {
|
|
6961
|
-
return
|
|
7018
|
+
return _chunkZQR36NCVcjs.getPublicClient.call(void 0, chainId, rpcUrls);
|
|
6962
7019
|
} catch (e33) {
|
|
6963
7020
|
return null;
|
|
6964
7021
|
}
|
|
@@ -7051,7 +7108,7 @@ function DepositFlow({
|
|
|
7051
7108
|
}, [activeDappImportProviderId, enabledDappImportProviders]);
|
|
7052
7109
|
const activeDappImportAvailability = _react.useMemo.call(void 0, () => {
|
|
7053
7110
|
if (!activeDappImportProviderId) return null;
|
|
7054
|
-
if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess',
|
|
7111
|
+
if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _216 => _216.toLowerCase, 'call', _217 => _217()]) !== dappImportOwner.toLowerCase()) {
|
|
7055
7112
|
return null;
|
|
7056
7113
|
}
|
|
7057
7114
|
const entry = dappImportAvailability[activeDappImportProviderId];
|
|
@@ -7092,7 +7149,7 @@ function DepositFlow({
|
|
|
7092
7149
|
setup: setupSlice
|
|
7093
7150
|
});
|
|
7094
7151
|
const pinnableWallet = dappImportOwner ? _nullishCoalesce(walletOptions.find(
|
|
7095
|
-
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess',
|
|
7152
|
+
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _218 => _218.toLowerCase, 'call', _219 => _219()]) === dappImportOwner.toLowerCase()
|
|
7096
7153
|
), () => ( null)) : null;
|
|
7097
7154
|
const outcome = resolveBootOutcome({
|
|
7098
7155
|
status,
|
|
@@ -7134,7 +7191,7 @@ function DepositFlow({
|
|
|
7134
7191
|
if (dappImportOwner) {
|
|
7135
7192
|
const plan = bootRetryPlan({
|
|
7136
7193
|
setupStatus: snapshot.setup.status,
|
|
7137
|
-
availabilityEntry: _optionalChain([snapshot, 'access',
|
|
7194
|
+
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
|
|
7138
7195
|
});
|
|
7139
7196
|
if (plan.restartSetup) {
|
|
7140
7197
|
storeApi.dispatch({ type: "setup/retry-requested" });
|
|
@@ -7183,7 +7240,7 @@ function DepositFlow({
|
|
|
7183
7240
|
acceptedExchangeFeeBps: disclosedFeeBps
|
|
7184
7241
|
});
|
|
7185
7242
|
} catch (error) {
|
|
7186
|
-
if (error instanceof
|
|
7243
|
+
if (error instanceof _chunkZQR36NCVcjs.SwappedConnectFeeChangedError) {
|
|
7187
7244
|
return error.exchangeFeeBps;
|
|
7188
7245
|
}
|
|
7189
7246
|
throw error;
|
|
@@ -7191,7 +7248,7 @@ function DepositFlow({
|
|
|
7191
7248
|
entry = { smartAccount: owner, response };
|
|
7192
7249
|
}
|
|
7193
7250
|
const currentAccount = storeApi.getState().setup.smartAccount;
|
|
7194
|
-
if (_optionalChain([currentAccount, 'optionalAccess',
|
|
7251
|
+
if (_optionalChain([currentAccount, 'optionalAccess', _224 => _224.toLowerCase, 'call', _225 => _225()]) !== owner) {
|
|
7195
7252
|
swappedConnectUrlRef.current.delete(key);
|
|
7196
7253
|
throw new Error("Deposit account changed. Select your exchange again.");
|
|
7197
7254
|
}
|
|
@@ -7222,7 +7279,7 @@ function DepositFlow({
|
|
|
7222
7279
|
);
|
|
7223
7280
|
}
|
|
7224
7281
|
swappedConnectUrlRef.current.delete(key);
|
|
7225
|
-
const response = _optionalChain([entry, 'optionalAccess',
|
|
7282
|
+
const response = _optionalChain([entry, 'optionalAccess', _226 => _226.smartAccount]) === smartAccount.toLowerCase() ? entry.response : await service.getSwappedConnectUrl({
|
|
7226
7283
|
smartAccount,
|
|
7227
7284
|
connection,
|
|
7228
7285
|
acceptedExchangeFeeBps: expectedFeeBps
|
|
@@ -7380,7 +7437,7 @@ function DepositFlow({
|
|
|
7380
7437
|
const handleSelectDisplayedFiatMethod = _react.useCallback.call(void 0,
|
|
7381
7438
|
(method) => {
|
|
7382
7439
|
if (!displayedFiatSource) return;
|
|
7383
|
-
_optionalChain([onEventRef, 'access',
|
|
7440
|
+
_optionalChain([onEventRef, 'access', _227 => _227.current, 'optionalCall', _228 => _228({
|
|
7384
7441
|
type: "deposit_modal_fiat_method_click",
|
|
7385
7442
|
country: displayedFiatCountry,
|
|
7386
7443
|
payment_method: method,
|
|
@@ -7403,7 +7460,7 @@ function DepositFlow({
|
|
|
7403
7460
|
[displayedFiatSource, handlePrefetchFiatMethod]
|
|
7404
7461
|
);
|
|
7405
7462
|
const handleNewDeposit = _react.useCallback.call(void 0, () => {
|
|
7406
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7463
|
+
_optionalChain([onLifecycleRef, 'access', _229 => _229.current, 'optionalCall', _230 => _230({
|
|
7407
7464
|
type: "smart-account-changed",
|
|
7408
7465
|
evm: null,
|
|
7409
7466
|
solana: null
|
|
@@ -7434,17 +7491,17 @@ function DepositFlow({
|
|
|
7434
7491
|
forceRegister
|
|
7435
7492
|
]
|
|
7436
7493
|
);
|
|
7437
|
-
const desiredSetupRequestKey =
|
|
7494
|
+
const desiredSetupRequestKey = _chunkHUHBNYD3cjs.computeRequestKey.call(void 0, setupInput);
|
|
7438
7495
|
const setupReady = setupSlice.status === "ready" && setupSlice.requestKey === desiredSetupRequestKey;
|
|
7439
7496
|
_react.useEffect.call(void 0, () => {
|
|
7440
7497
|
void (async () => {
|
|
7441
|
-
const requestKey =
|
|
7442
|
-
const cacheKey =
|
|
7443
|
-
const cacheable =
|
|
7498
|
+
const requestKey = _chunkHUHBNYD3cjs.computeRequestKey.call(void 0, setupInput);
|
|
7499
|
+
const cacheKey = _chunkHUHBNYD3cjs.computeCacheKey.call(void 0, setupInput);
|
|
7500
|
+
const cacheable = _chunkHUHBNYD3cjs.computeIsCacheable.call(void 0, setupInput);
|
|
7444
7501
|
if (storeApi.getState().setup.requestKey === requestKey) {
|
|
7445
7502
|
return;
|
|
7446
7503
|
}
|
|
7447
|
-
const dedupedResult =
|
|
7504
|
+
const dedupedResult = _chunkHUHBNYD3cjs.readDedupedAccountSetupResult.call(void 0, requestKey);
|
|
7448
7505
|
if (dedupedResult) {
|
|
7449
7506
|
storeApi.dispatch({
|
|
7450
7507
|
type: "setup/started",
|
|
@@ -7470,7 +7527,7 @@ function DepositFlow({
|
|
|
7470
7527
|
cacheable
|
|
7471
7528
|
});
|
|
7472
7529
|
try {
|
|
7473
|
-
const result = await
|
|
7530
|
+
const result = await _chunkHUHBNYD3cjs.runAccountSetupDeduped.call(void 0,
|
|
7474
7531
|
setupInput,
|
|
7475
7532
|
{ service, debug },
|
|
7476
7533
|
requestKey
|
|
@@ -7485,7 +7542,7 @@ function DepositFlow({
|
|
|
7485
7542
|
}
|
|
7486
7543
|
});
|
|
7487
7544
|
} catch (error) {
|
|
7488
|
-
const message = error instanceof
|
|
7545
|
+
const message = error instanceof _chunkHUHBNYD3cjs.SetupError ? error.message : "Deposit service is temporarily unavailable. Please try again shortly.";
|
|
7489
7546
|
storeApi.dispatch({
|
|
7490
7547
|
type: "setup/failed",
|
|
7491
7548
|
requestKey,
|
|
@@ -7517,11 +7574,11 @@ function DepositFlow({
|
|
|
7517
7574
|
return;
|
|
7518
7575
|
}
|
|
7519
7576
|
storeApi.dispatch({ type: "portfolio/loading", network, address });
|
|
7520
|
-
const requestId = _optionalChain([readPortfolioEntry, 'call',
|
|
7577
|
+
const requestId = _optionalChain([readPortfolioEntry, 'call', _231 => _231(
|
|
7521
7578
|
storeApi.getState().portfolio,
|
|
7522
7579
|
network,
|
|
7523
7580
|
address
|
|
7524
|
-
), 'optionalAccess',
|
|
7581
|
+
), 'optionalAccess', _232 => _232.requestId]);
|
|
7525
7582
|
if (requestId === void 0) return;
|
|
7526
7583
|
void (async () => {
|
|
7527
7584
|
try {
|
|
@@ -7534,7 +7591,7 @@ function DepositFlow({
|
|
|
7534
7591
|
address,
|
|
7535
7592
|
requestId,
|
|
7536
7593
|
totalUsd: portfolio.totalUsd,
|
|
7537
|
-
chainIds:
|
|
7594
|
+
chainIds: _chunkZQR36NCVcjs.chainIdsByValue.call(void 0, portfolio.tokens)
|
|
7538
7595
|
});
|
|
7539
7596
|
} catch (e34) {
|
|
7540
7597
|
storeApi.dispatch({
|
|
@@ -7554,7 +7611,7 @@ function DepositFlow({
|
|
|
7554
7611
|
sourceChain: data.sourceChain,
|
|
7555
7612
|
amount: data.amount
|
|
7556
7613
|
});
|
|
7557
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7614
|
+
_optionalChain([onLifecycleRef, 'access', _233 => _233.current, 'optionalCall', _234 => _234({ type: "submitted", ...data })]);
|
|
7558
7615
|
},
|
|
7559
7616
|
[logFlow, onLifecycleRef]
|
|
7560
7617
|
);
|
|
@@ -7573,8 +7630,8 @@ function DepositFlow({
|
|
|
7573
7630
|
);
|
|
7574
7631
|
const handleSolanaAmountContinue = _react.useCallback.call(void 0,
|
|
7575
7632
|
(token, sourceAmount, inputAmountUsd) => {
|
|
7576
|
-
const targetSym =
|
|
7577
|
-
const isTargetStable =
|
|
7633
|
+
const targetSym = _chunkTENL4H64cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
7634
|
+
const isTargetStable = _chunkTENL4H64cjs.isStablecoinSymbol.call(void 0, targetSym);
|
|
7578
7635
|
const targetTokenPriceUsd = isTargetStable ? 1 : targetMarketPriceRef.current;
|
|
7579
7636
|
logFlow("solana:amount:continue", {
|
|
7580
7637
|
token: token.symbol,
|
|
@@ -7618,7 +7675,7 @@ function DepositFlow({
|
|
|
7618
7675
|
sourceDecimals: tokenAtSubmit.decimals,
|
|
7619
7676
|
inputAmountUsd: amountUsd
|
|
7620
7677
|
});
|
|
7621
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7678
|
+
_optionalChain([onLifecycleRef, 'access', _235 => _235.current, 'optionalCall', _236 => _236({
|
|
7622
7679
|
type: "submitted",
|
|
7623
7680
|
txHash,
|
|
7624
7681
|
sourceChain: "solana",
|
|
@@ -7631,7 +7688,7 @@ function DepositFlow({
|
|
|
7631
7688
|
);
|
|
7632
7689
|
const handleAssetContinue = _react.useCallback.call(void 0,
|
|
7633
7690
|
(asset) => {
|
|
7634
|
-
_optionalChain([onEventRef, 'access',
|
|
7691
|
+
_optionalChain([onEventRef, 'access', _237 => _237.current, 'optionalCall', _238 => _238({
|
|
7635
7692
|
type: "deposit_modal_connected_wallet_select_source_cta_click",
|
|
7636
7693
|
total_balance_in_external_wallet: totalBalanceUsd,
|
|
7637
7694
|
pred_balance: totalBalanceUsd,
|
|
@@ -7651,8 +7708,8 @@ function DepositFlow({
|
|
|
7651
7708
|
(amount, targetAmount, balance) => {
|
|
7652
7709
|
const entry = storeApi.getState().setup;
|
|
7653
7710
|
if (entry.status !== "ready") return;
|
|
7654
|
-
const targetSym =
|
|
7655
|
-
const isTargetStable =
|
|
7711
|
+
const targetSym = _chunkTENL4H64cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
7712
|
+
const isTargetStable = _chunkTENL4H64cjs.isStablecoinSymbol.call(void 0, targetSym);
|
|
7656
7713
|
const targetTokenPriceUsd = isTargetStable ? 1 : targetMarketPriceRef.current;
|
|
7657
7714
|
storeApi.dispatch({
|
|
7658
7715
|
type: "amount/entered",
|
|
@@ -7685,8 +7742,8 @@ function DepositFlow({
|
|
|
7685
7742
|
sourceChain: chainId,
|
|
7686
7743
|
sourceToken: token,
|
|
7687
7744
|
amount,
|
|
7688
|
-
sourceSymbol: _optionalChain([asset, 'optionalAccess',
|
|
7689
|
-
sourceDecimals: _optionalChain([asset, 'optionalAccess',
|
|
7745
|
+
sourceSymbol: _optionalChain([asset, 'optionalAccess', _239 => _239.symbol]),
|
|
7746
|
+
sourceDecimals: _optionalChain([asset, 'optionalAccess', _240 => _240.decimals]),
|
|
7690
7747
|
inputAmountUsd: _nullishCoalesce(depositAtSubmit.inputAmountUsd, () => ( void 0)),
|
|
7691
7748
|
directTransfer: routed.directTransfer,
|
|
7692
7749
|
quote
|
|
@@ -7726,7 +7783,7 @@ function DepositFlow({
|
|
|
7726
7783
|
swappedContext,
|
|
7727
7784
|
initialEvent: info.initialEvent
|
|
7728
7785
|
});
|
|
7729
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7786
|
+
_optionalChain([onLifecycleRef, 'access', _241 => _241.current, 'optionalCall', _242 => _242({
|
|
7730
7787
|
type: "submitted",
|
|
7731
7788
|
txHash: info.txHash,
|
|
7732
7789
|
sourceChain: SWAPPED_SOURCE_CHAIN,
|
|
@@ -7754,12 +7811,12 @@ function DepositFlow({
|
|
|
7754
7811
|
const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
|
|
7755
7812
|
(txHash, sourceChain, amount) => {
|
|
7756
7813
|
const depositAtSubmit = storeApi.getState().deposit;
|
|
7757
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7814
|
+
_optionalChain([onLifecycleRef, 'access', _243 => _243.current, 'optionalCall', _244 => _244({
|
|
7758
7815
|
type: "submitted",
|
|
7759
7816
|
txHash,
|
|
7760
7817
|
sourceChain,
|
|
7761
7818
|
amount,
|
|
7762
|
-
sourceDecimals: _optionalChain([depositAtSubmit, 'access',
|
|
7819
|
+
sourceDecimals: _optionalChain([depositAtSubmit, 'access', _245 => _245.selectedAsset, 'optionalAccess', _246 => _246.decimals]),
|
|
7763
7820
|
amountUsd: _nullishCoalesce(depositAtSubmit.inputAmountUsd, () => ( void 0))
|
|
7764
7821
|
})]);
|
|
7765
7822
|
},
|
|
@@ -7768,7 +7825,7 @@ function DepositFlow({
|
|
|
7768
7825
|
const handleDepositComplete = _react.useCallback.call(void 0,
|
|
7769
7826
|
(txHash, destinationTxHash, context) => {
|
|
7770
7827
|
logFlow("deposit:complete", { txHash, destinationTxHash, ...context });
|
|
7771
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7828
|
+
_optionalChain([onLifecycleRef, 'access', _247 => _247.current, 'optionalCall', _248 => _248({
|
|
7772
7829
|
type: "complete",
|
|
7773
7830
|
txHash,
|
|
7774
7831
|
destinationTxHash,
|
|
@@ -7780,14 +7837,14 @@ function DepositFlow({
|
|
|
7780
7837
|
const handleDepositFailed = _react.useCallback.call(void 0,
|
|
7781
7838
|
(txHash, error) => {
|
|
7782
7839
|
logFlowError("deposit:failed", error, { txHash });
|
|
7783
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7840
|
+
_optionalChain([onLifecycleRef, 'access', _249 => _249.current, 'optionalCall', _250 => _250({ type: "failed", txHash, error })]);
|
|
7784
7841
|
},
|
|
7785
7842
|
[logFlowError, onLifecycleRef]
|
|
7786
7843
|
);
|
|
7787
7844
|
const handleError = _react.useCallback.call(void 0,
|
|
7788
|
-
(message, code) => {
|
|
7789
|
-
logFlowError("flow:error", message, { code });
|
|
7790
|
-
_optionalChain([onErrorRef, 'access',
|
|
7845
|
+
(message, code, cause) => {
|
|
7846
|
+
logFlowError("flow:error", _nullishCoalesce(cause, () => ( message)), { code });
|
|
7847
|
+
_optionalChain([onErrorRef, 'access', _251 => _251.current, 'optionalCall', _252 => _252({ message, code, cause })]);
|
|
7791
7848
|
},
|
|
7792
7849
|
[logFlowError, onErrorRef]
|
|
7793
7850
|
);
|
|
@@ -7836,9 +7893,9 @@ function DepositFlow({
|
|
|
7836
7893
|
address: _nullishCoalesce(_nullishCoalesce(option.address, () => ( option.solanaAddress)), () => ( option.id)),
|
|
7837
7894
|
state,
|
|
7838
7895
|
errorReason: _nullishCoalesce(entry.message, () => ( void 0)),
|
|
7839
|
-
balanceStatus: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess',
|
|
7840
|
-
balanceUsd: _optionalChain([portfolioEntry, 'optionalAccess',
|
|
7841
|
-
balanceChainIds: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess',
|
|
7896
|
+
balanceStatus: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess', _253 => _253.status]), () => ( "loading")),
|
|
7897
|
+
balanceUsd: _optionalChain([portfolioEntry, 'optionalAccess', _254 => _254.status]) === "ready" ? portfolioEntry.totalUsd : null,
|
|
7898
|
+
balanceChainIds: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess', _255 => _255.chainIds]), () => ( []))
|
|
7842
7899
|
};
|
|
7843
7900
|
});
|
|
7844
7901
|
}, [enableWallet, walletOptions, setupSlice, portfolioSlice]);
|
|
@@ -7927,9 +7984,9 @@ function DepositFlow({
|
|
|
7927
7984
|
onDepositComplete: handleDepositComplete,
|
|
7928
7985
|
onDepositFailed: handleDepositFailed,
|
|
7929
7986
|
onCopyAddress: () => {
|
|
7930
|
-
const chainName =
|
|
7931
|
-
const tokenSymbol =
|
|
7932
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
7987
|
+
const chainName = _chunkTENL4H64cjs.getChainName.call(void 0, targetChainId);
|
|
7988
|
+
const tokenSymbol = _chunkTENL4H64cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
7989
|
+
_optionalChain([onEvent, 'optionalCall', _256 => _256({
|
|
7933
7990
|
type: "deposit_modal_transfer_crypto_cta_click",
|
|
7934
7991
|
default_chain: chainName,
|
|
7935
7992
|
default_token: tokenSymbol,
|
|
@@ -7976,7 +8033,7 @@ function DepositFlow({
|
|
|
7976
8033
|
}
|
|
7977
8034
|
),
|
|
7978
8035
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
7979
|
-
|
|
8036
|
+
_chunkHUHBNYD3cjs.ProcessingStep,
|
|
7980
8037
|
{
|
|
7981
8038
|
smartAccount: step.smartAccount,
|
|
7982
8039
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
@@ -8048,7 +8105,7 @@ function DepositFlow({
|
|
|
8048
8105
|
}
|
|
8049
8106
|
),
|
|
8050
8107
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8051
|
-
|
|
8108
|
+
_chunkHUHBNYD3cjs.ProcessingStep,
|
|
8052
8109
|
{
|
|
8053
8110
|
smartAccount: step.smartAccount,
|
|
8054
8111
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
@@ -8081,8 +8138,8 @@ function DepositFlow({
|
|
|
8081
8138
|
);
|
|
8082
8139
|
}
|
|
8083
8140
|
if (isSolanaWalletMode) {
|
|
8084
|
-
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess',
|
|
8085
|
-
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess',
|
|
8141
|
+
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess', _257 => _257.solanaAddress]);
|
|
8142
|
+
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess', _258 => _258.solanaProvider]);
|
|
8086
8143
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
8087
8144
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8088
8145
|
AccountPreparingSkeleton,
|
|
@@ -8114,8 +8171,8 @@ function DepositFlow({
|
|
|
8114
8171
|
defaultAmount: effectiveStep.inputAmountUsd,
|
|
8115
8172
|
uiConfig,
|
|
8116
8173
|
targetChain,
|
|
8117
|
-
targetChainName:
|
|
8118
|
-
targetTokenSymbol:
|
|
8174
|
+
targetChainName: _chunkTENL4H64cjs.getChainName.call(void 0, targetChainId),
|
|
8175
|
+
targetTokenSymbol: _chunkTENL4H64cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId),
|
|
8119
8176
|
appBalanceUsd,
|
|
8120
8177
|
onContinue: handleSolanaAmountContinue,
|
|
8121
8178
|
debug
|
|
@@ -8136,7 +8193,7 @@ function DepositFlow({
|
|
|
8136
8193
|
targetToken,
|
|
8137
8194
|
service,
|
|
8138
8195
|
solanaProvider,
|
|
8139
|
-
solanaConnection: _optionalChain([reownWallet, 'optionalAccess',
|
|
8196
|
+
solanaConnection: _optionalChain([reownWallet, 'optionalAccess', _259 => _259.solanaConnection]),
|
|
8140
8197
|
uiConfig,
|
|
8141
8198
|
onConfirm: handleSolanaConfirmed,
|
|
8142
8199
|
onError: handleError,
|
|
@@ -8177,7 +8234,7 @@ function DepositFlow({
|
|
|
8177
8234
|
) })
|
|
8178
8235
|
] }) : null,
|
|
8179
8236
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8180
|
-
|
|
8237
|
+
_chunkHUHBNYD3cjs.ProcessingStep,
|
|
8181
8238
|
{
|
|
8182
8239
|
smartAccount: effectiveStep.smartAccount,
|
|
8183
8240
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
@@ -8214,7 +8271,7 @@ function DepositFlow({
|
|
|
8214
8271
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8215
8272
|
DappImportAssetSelectSkeleton,
|
|
8216
8273
|
{
|
|
8217
|
-
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportProvider, 'optionalAccess',
|
|
8274
|
+
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportProvider, 'optionalAccess', _260 => _260.sourceLabel]), () => ( "")),
|
|
8218
8275
|
error: dappImportBootError,
|
|
8219
8276
|
onRetry: handleBootRetry
|
|
8220
8277
|
}
|
|
@@ -8236,7 +8293,7 @@ function DepositFlow({
|
|
|
8236
8293
|
rows: dappImportSelectRows,
|
|
8237
8294
|
onRequestConnect: _nullishCoalesce(onConnect, () => ( onRequestConnect)),
|
|
8238
8295
|
onSelect: (providerId) => {
|
|
8239
|
-
const availabilityEntry = dappImportOwner && _optionalChain([dappImportAvailabilityOwner, 'optionalAccess',
|
|
8296
|
+
const availabilityEntry = dappImportOwner && _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _261 => _261.toLowerCase, 'call', _262 => _262()]) === dappImportOwner.toLowerCase() ? dappImportAvailability[providerId] : void 0;
|
|
8240
8297
|
if (availabilityEntry === "error") {
|
|
8241
8298
|
storeApi.dispatch({
|
|
8242
8299
|
type: "dapp-import/availability-retry-requested"
|
|
@@ -8255,16 +8312,16 @@ function DepositFlow({
|
|
|
8255
8312
|
}
|
|
8256
8313
|
);
|
|
8257
8314
|
}
|
|
8258
|
-
if (!_optionalChain([signerContext, 'optionalAccess',
|
|
8315
|
+
if (!_optionalChain([signerContext, 'optionalAccess', _263 => _263.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _264 => _264.publicClient])) {
|
|
8259
8316
|
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" }) }) }) }) });
|
|
8260
8317
|
}
|
|
8261
8318
|
const ownerAddress = signerContext.ownerAddress;
|
|
8262
|
-
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access',
|
|
8319
|
+
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));
|
|
8263
8320
|
const getReadClientForChain = (chainId) => {
|
|
8264
|
-
if (_optionalChain([signerContext, 'access',
|
|
8321
|
+
if (_optionalChain([signerContext, 'access', _271 => _271.publicClient, 'access', _272 => _272.chain, 'optionalAccess', _273 => _273.id]) === chainId) {
|
|
8265
8322
|
return signerContext.publicClient;
|
|
8266
8323
|
}
|
|
8267
|
-
return
|
|
8324
|
+
return _chunkZQR36NCVcjs.getPublicClient.call(void 0, chainId, rpcUrls);
|
|
8268
8325
|
};
|
|
8269
8326
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
8270
8327
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -8293,9 +8350,9 @@ function DepositFlow({
|
|
|
8293
8350
|
effectiveStep.type === "dapp-import-asset-select" && activeDappImportProvider && activeDappImportAvailability && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8294
8351
|
DappImportAssetSelectStep,
|
|
8295
8352
|
{
|
|
8296
|
-
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access',
|
|
8353
|
+
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access', _274 => _274.assets, 'access', _275 => _275[0], 'optionalAccess', _276 => _276.sourceLabel]), () => ( activeDappImportProvider.sourceLabel)),
|
|
8297
8354
|
assets: activeDappImportAvailability.assets,
|
|
8298
|
-
incompleteSummary: _optionalChain([activeDappImportAvailability, 'access',
|
|
8355
|
+
incompleteSummary: _optionalChain([activeDappImportAvailability, 'access', _277 => _277.incomplete, 'optionalAccess', _278 => _278.summary]),
|
|
8299
8356
|
onSelect: handleDappImportAssetSelected
|
|
8300
8357
|
}
|
|
8301
8358
|
),
|
|
@@ -8316,8 +8373,8 @@ function DepositFlow({
|
|
|
8316
8373
|
service,
|
|
8317
8374
|
onContinue: handleAmountContinue,
|
|
8318
8375
|
onCtaClick: (ctaName) => {
|
|
8319
|
-
const receiveSymbol =
|
|
8320
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
8376
|
+
const receiveSymbol = _chunkTENL4H64cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
8377
|
+
_optionalChain([onEvent, 'optionalCall', _279 => _279({
|
|
8321
8378
|
type: "deposit_modal_connected_wallet_enter_value_cta_click",
|
|
8322
8379
|
send_token: effectiveStep.asset.symbol,
|
|
8323
8380
|
receive_token: receiveSymbol,
|
|
@@ -8375,7 +8432,7 @@ function DepositFlow({
|
|
|
8375
8432
|
}
|
|
8376
8433
|
),
|
|
8377
8434
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8378
|
-
|
|
8435
|
+
_chunkHUHBNYD3cjs.ProcessingStep,
|
|
8379
8436
|
{
|
|
8380
8437
|
smartAccount: effectiveStep.smartAccount,
|
|
8381
8438
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
@@ -8428,9 +8485,9 @@ function formatDate(iso) {
|
|
|
8428
8485
|
function resolveChainId(value) {
|
|
8429
8486
|
if (value === void 0 || value === null) return null;
|
|
8430
8487
|
if (typeof value === "number") return value;
|
|
8431
|
-
if (
|
|
8432
|
-
if (
|
|
8433
|
-
const parsed =
|
|
8488
|
+
if (_chunkTENL4H64cjs.isSolanaCaip2.call(void 0, value) || value === "solana") return "solana";
|
|
8489
|
+
if (_chunkTENL4H64cjs.isHyperCoreCaip2.call(void 0, value) || value === "hypercore") return "hypercore";
|
|
8490
|
+
const parsed = _chunkTENL4H64cjs.parseEvmChainId.call(void 0, value);
|
|
8434
8491
|
if (parsed !== null) return parsed;
|
|
8435
8492
|
const num = Number(value);
|
|
8436
8493
|
return Number.isFinite(num) ? num : null;
|
|
@@ -8439,7 +8496,7 @@ function resolveTokenSymbol(token, chainId) {
|
|
|
8439
8496
|
if (!token) return "";
|
|
8440
8497
|
if (chainId === "solana") {
|
|
8441
8498
|
const normalized = token.toLowerCase();
|
|
8442
|
-
const matched =
|
|
8499
|
+
const matched = _chunkTENL4H64cjs.SOLANA_TOKENS.find(
|
|
8443
8500
|
(entry) => entry.mint.toLowerCase() === normalized
|
|
8444
8501
|
);
|
|
8445
8502
|
if (matched) return matched.symbol;
|
|
@@ -8448,8 +8505,8 @@ function resolveTokenSymbol(token, chainId) {
|
|
|
8448
8505
|
}
|
|
8449
8506
|
}
|
|
8450
8507
|
if (chainId !== null && chainId !== void 0 && chainId !== "solana" && /^0x[a-fA-F0-9]{40}$/.test(token)) {
|
|
8451
|
-
const evmChainId = chainId === "hypercore" ?
|
|
8452
|
-
const sym =
|
|
8508
|
+
const evmChainId = chainId === "hypercore" ? _chunkTENL4H64cjs.HYPERCORE_CHAIN_ID : chainId;
|
|
8509
|
+
const sym = _chunkTENL4H64cjs.getTokenSymbol.call(void 0, token, evmChainId);
|
|
8453
8510
|
if (sym !== "Token") return sym;
|
|
8454
8511
|
}
|
|
8455
8512
|
return shortenHash(token);
|
|
@@ -8460,7 +8517,7 @@ function formatAmount(rawAmount, token, chainId) {
|
|
|
8460
8517
|
if (token && chainId !== null && chainId !== void 0) {
|
|
8461
8518
|
if (chainId === "solana") {
|
|
8462
8519
|
const normalized = token.toLowerCase();
|
|
8463
|
-
const matched =
|
|
8520
|
+
const matched = _chunkTENL4H64cjs.SOLANA_TOKENS.find(
|
|
8464
8521
|
(entry) => entry.mint.toLowerCase() === normalized
|
|
8465
8522
|
);
|
|
8466
8523
|
if (matched) {
|
|
@@ -8469,8 +8526,8 @@ function formatAmount(rawAmount, token, chainId) {
|
|
|
8469
8526
|
decimals = 9;
|
|
8470
8527
|
}
|
|
8471
8528
|
} else if (/^0x[a-fA-F0-9]{40}$/.test(token)) {
|
|
8472
|
-
const evmChainId = chainId === "hypercore" ?
|
|
8473
|
-
decimals =
|
|
8529
|
+
const evmChainId = chainId === "hypercore" ? _chunkTENL4H64cjs.HYPERCORE_CHAIN_ID : chainId;
|
|
8530
|
+
decimals = _chunkTENL4H64cjs.getTokenDecimalsByAddress.call(void 0, token, evmChainId);
|
|
8474
8531
|
}
|
|
8475
8532
|
}
|
|
8476
8533
|
try {
|
|
@@ -8488,7 +8545,7 @@ function formatAmount(rawAmount, token, chainId) {
|
|
|
8488
8545
|
}
|
|
8489
8546
|
function getTxExplorerUrl(txHash, chainId) {
|
|
8490
8547
|
if (!chainId) return null;
|
|
8491
|
-
const base2 =
|
|
8548
|
+
const base2 = _chunkTENL4H64cjs.getExplorerUrl.call(void 0, chainId);
|
|
8492
8549
|
if (!base2) return null;
|
|
8493
8550
|
return `${base2}/tx/${txHash}`;
|
|
8494
8551
|
}
|
|
@@ -8531,7 +8588,7 @@ function DepositHistoryPanel({
|
|
|
8531
8588
|
);
|
|
8532
8589
|
const visibleDeposits = _react.useMemo.call(void 0, () => {
|
|
8533
8590
|
const sourceHashes = new Set(
|
|
8534
|
-
deposits.map((d) => _optionalChain([d, 'access',
|
|
8591
|
+
deposits.map((d) => _optionalChain([d, 'access', _280 => _280.sourceTxHash, 'optionalAccess', _281 => _281.toLowerCase, 'call', _282 => _282()])).filter((h) => Boolean(h))
|
|
8535
8592
|
);
|
|
8536
8593
|
return deposits.filter(
|
|
8537
8594
|
(d) => !(d.txHash && sourceHashes.has(d.txHash.toLowerCase()))
|
|
@@ -8553,7 +8610,7 @@ function DepositHistoryPanel({
|
|
|
8553
8610
|
className: "rs-modal-header-back",
|
|
8554
8611
|
"aria-label": "Back",
|
|
8555
8612
|
onClick: onClose,
|
|
8556
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8613
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.ChevronLeftIcon, {})
|
|
8557
8614
|
}
|
|
8558
8615
|
) }),
|
|
8559
8616
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: onCloseModal && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -8563,29 +8620,29 @@ function DepositHistoryPanel({
|
|
|
8563
8620
|
className: "rs-modal-close",
|
|
8564
8621
|
"aria-label": "Close",
|
|
8565
8622
|
onClick: onCloseModal,
|
|
8566
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8623
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.CloseIcon, {})
|
|
8567
8624
|
}
|
|
8568
8625
|
) })
|
|
8569
8626
|
] }),
|
|
8570
8627
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen", children: [
|
|
8571
8628
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen-body", children: [
|
|
8572
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8629
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.HistoryIcon, {}), title: "History" }),
|
|
8573
8630
|
isLoading && deposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
8574
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8631
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.HistoryIcon, {}) }),
|
|
8575
8632
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
8576
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8633
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.Spinner, { className: "rs-spinner--sm" }),
|
|
8577
8634
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Loading history\u2026" })
|
|
8578
8635
|
] })
|
|
8579
8636
|
] }),
|
|
8580
8637
|
error && !isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
8581
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8638
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.AlertTriangleIcon, {}) }),
|
|
8582
8639
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
8583
8640
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "Couldn't load history" }),
|
|
8584
8641
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: error })
|
|
8585
8642
|
] })
|
|
8586
8643
|
] }),
|
|
8587
8644
|
!isLoading && !error && visibleDeposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
8588
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8645
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.HistoryIcon, {}) }),
|
|
8589
8646
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
8590
8647
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "No deposits yet" }),
|
|
8591
8648
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Your deposit history will appear here" })
|
|
@@ -8605,7 +8662,7 @@ function DepositHistoryPanel({
|
|
|
8605
8662
|
)
|
|
8606
8663
|
] })
|
|
8607
8664
|
] }),
|
|
8608
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8665
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.PoweredBy, {})
|
|
8609
8666
|
] })
|
|
8610
8667
|
]
|
|
8611
8668
|
}
|
|
@@ -8616,10 +8673,10 @@ function HistoryCard({ deposit }) {
|
|
|
8616
8673
|
const status = normalizeStatus(deposit.status, deposit.isSpam);
|
|
8617
8674
|
const sourceChainId = resolveChainId(deposit.chain);
|
|
8618
8675
|
const targetChainId = resolveChainId(deposit.targetChain);
|
|
8619
|
-
const sourceChainName = sourceChainId ?
|
|
8620
|
-
const targetChainName = targetChainId ?
|
|
8621
|
-
const sourceChainIcon = sourceChainId ?
|
|
8622
|
-
const targetChainIcon = targetChainId ?
|
|
8676
|
+
const sourceChainName = sourceChainId ? _chunkTENL4H64cjs.getChainName.call(void 0, sourceChainId) : null;
|
|
8677
|
+
const targetChainName = targetChainId ? _chunkTENL4H64cjs.getChainName.call(void 0, targetChainId) : null;
|
|
8678
|
+
const sourceChainIcon = sourceChainId ? _chunkTENL4H64cjs.getChainIcon.call(void 0, sourceChainId) : void 0;
|
|
8679
|
+
const targetChainIcon = targetChainId ? _chunkTENL4H64cjs.getChainIcon.call(void 0, targetChainId) : void 0;
|
|
8623
8680
|
const sourceSymbol = resolveTokenSymbol(deposit.token, sourceChainId);
|
|
8624
8681
|
const rawAmount = deposit.sourceAmount && deposit.sourceAmount !== "0" ? deposit.sourceAmount : deposit.amount;
|
|
8625
8682
|
const formattedAmount = rawAmount ? formatAmount(rawAmount, deposit.token, sourceChainId) : null;
|
|
@@ -8641,8 +8698,8 @@ function HistoryCard({ deposit }) {
|
|
|
8641
8698
|
children: [
|
|
8642
8699
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-card-row", children: [
|
|
8643
8700
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-card-icons", children: [
|
|
8644
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-token", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8645
|
-
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-chain", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8701
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-token", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.TokenIcon, { symbol: sourceSymbol, fallback: sourceSymbol.slice(0, 2) }) }),
|
|
8702
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-chain", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.CdnIcon, { src: sourceChainIcon }) })
|
|
8646
8703
|
] }),
|
|
8647
8704
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-card-text", children: [
|
|
8648
8705
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-title", children: txTypeLabel }),
|
|
@@ -8658,14 +8715,14 @@ function HistoryCard({ deposit }) {
|
|
|
8658
8715
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
8659
8716
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-detail-value", children: [
|
|
8660
8717
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceChainName }),
|
|
8661
|
-
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8718
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.CdnIcon, { src: sourceChainIcon }) })
|
|
8662
8719
|
] })
|
|
8663
8720
|
] }),
|
|
8664
8721
|
targetChainName && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
8665
8722
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
|
|
8666
8723
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-detail-value", children: [
|
|
8667
8724
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName }),
|
|
8668
|
-
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8725
|
+
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.CdnIcon, { src: targetChainIcon }) })
|
|
8669
8726
|
] })
|
|
8670
8727
|
] }),
|
|
8671
8728
|
srcTxUrl && srcTxHash && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
@@ -8680,7 +8737,7 @@ function HistoryCard({ deposit }) {
|
|
|
8680
8737
|
onClick: (e) => e.stopPropagation(),
|
|
8681
8738
|
children: [
|
|
8682
8739
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: shortenHash(srcTxHash) }),
|
|
8683
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8740
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.ArrowUpRightIcon, {})
|
|
8684
8741
|
]
|
|
8685
8742
|
}
|
|
8686
8743
|
)
|
|
@@ -8695,7 +8752,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
|
8695
8752
|
// src/DepositModal.tsx
|
|
8696
8753
|
|
|
8697
8754
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
8698
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
8755
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-YGB73NMW.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
8699
8756
|
);
|
|
8700
8757
|
function sortByCreatedAtDesc(items) {
|
|
8701
8758
|
return [...items].sort((a, b) => {
|
|
@@ -8709,8 +8766,8 @@ function hasSuppliedWalletClient(props) {
|
|
|
8709
8766
|
return Object.prototype.hasOwnProperty.call(props, WALLET_CLIENT_PROP);
|
|
8710
8767
|
}
|
|
8711
8768
|
function DepositModal(props) {
|
|
8712
|
-
|
|
8713
|
-
|
|
8769
|
+
_chunkHUHBNYD3cjs.warnRemovedProps.call(void 0, "DepositModal", props);
|
|
8770
|
+
_chunkZQR36NCVcjs.checkBackendUrl.call(void 0, "DepositModal", props.backendUrl);
|
|
8714
8771
|
const needsReown = !!props.reownAppId;
|
|
8715
8772
|
const hasWalletClientProp = hasSuppliedWalletClient(props);
|
|
8716
8773
|
if (needsReown) {
|
|
@@ -8772,13 +8829,13 @@ function DepositModalInner({
|
|
|
8772
8829
|
debug
|
|
8773
8830
|
}) {
|
|
8774
8831
|
const modalRef = _react.useRef.call(void 0, null);
|
|
8775
|
-
const onReadyRef =
|
|
8832
|
+
const onReadyRef = _chunkZQR36NCVcjs.useLatestRef.call(void 0, onReady);
|
|
8776
8833
|
const [currentScreen, setCurrentScreen] = _react.useState.call(void 0, "connect");
|
|
8777
8834
|
const [swappedImmersive, setSwappedImmersive] = _react.useState.call(void 0, false);
|
|
8778
8835
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
8779
8836
|
void 0
|
|
8780
8837
|
);
|
|
8781
|
-
const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
8838
|
+
const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _283 => _283.showHistoryButton]), () => ( false));
|
|
8782
8839
|
const historyButtonVisible = showHistoryButton && (currentScreen === "select-asset" || currentScreen === "deposit-address");
|
|
8783
8840
|
const [historyOpen, setHistoryOpen] = _react.useState.call(void 0, false);
|
|
8784
8841
|
const [historyDeposits, setHistoryDeposits] = _react.useState.call(void 0, []);
|
|
@@ -8789,11 +8846,11 @@ function DepositModalInner({
|
|
|
8789
8846
|
const cursorRef = _react.useRef.call(void 0, null);
|
|
8790
8847
|
const historyStaleRef = _react.useRef.call(void 0, false);
|
|
8791
8848
|
const historyLoadedRef = _react.useRef.call(void 0, false);
|
|
8792
|
-
const targetChain = targetChainProp === "solana" ?
|
|
8793
|
-
const sourceChain = sourceChainProp ?
|
|
8794
|
-
const rpcUrls =
|
|
8849
|
+
const targetChain = targetChainProp === "solana" || targetChainProp === _chunkTENL4H64cjs.HYPERCORE_SPOT_CAIP2 ? targetChainProp : _chunkTENL4H64cjs.getChainId.call(void 0, targetChainProp);
|
|
8850
|
+
const sourceChain = sourceChainProp ? _chunkTENL4H64cjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
8851
|
+
const rpcUrls = _chunkZQR36NCVcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
|
|
8795
8852
|
const service = _react.useMemo.call(void 0,
|
|
8796
|
-
() =>
|
|
8853
|
+
() => _chunkZQR36NCVcjs.createDepositService.call(void 0, backendUrl, {
|
|
8797
8854
|
debug,
|
|
8798
8855
|
debugScope: "service:deposit"
|
|
8799
8856
|
}),
|
|
@@ -8827,12 +8884,12 @@ function DepositModalInner({
|
|
|
8827
8884
|
}, [store, targetChain, targetToken]);
|
|
8828
8885
|
_react.useEffect.call(void 0, () => {
|
|
8829
8886
|
if (isOpen && modalRef.current) {
|
|
8830
|
-
|
|
8887
|
+
_chunkZQR36NCVcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
8831
8888
|
}
|
|
8832
8889
|
}, [isOpen, theme]);
|
|
8833
8890
|
_react.useEffect.call(void 0, () => {
|
|
8834
8891
|
if (isOpen) {
|
|
8835
|
-
_optionalChain([onReadyRef, 'access',
|
|
8892
|
+
_optionalChain([onReadyRef, 'access', _284 => _284.current, 'optionalCall', _285 => _285()]);
|
|
8836
8893
|
}
|
|
8837
8894
|
}, [isOpen, onReadyRef]);
|
|
8838
8895
|
const handleStepChange = _react.useCallback.call(void 0,
|
|
@@ -8908,10 +8965,10 @@ function DepositModalInner({
|
|
|
8908
8965
|
fetchHistory("initial");
|
|
8909
8966
|
}
|
|
8910
8967
|
}, [historyOpen, fetchHistory]);
|
|
8911
|
-
const onLifecycleRef =
|
|
8968
|
+
const onLifecycleRef = _chunkZQR36NCVcjs.useLatestRef.call(void 0, onLifecycle);
|
|
8912
8969
|
const handleLifecycle = _react.useCallback.call(void 0,
|
|
8913
8970
|
(event) => {
|
|
8914
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
8971
|
+
_optionalChain([onLifecycleRef, 'access', _286 => _286.current, 'optionalCall', _287 => _287(event)]);
|
|
8915
8972
|
if (event.type === "smart-account-changed" && !event.evm && !event.solana) {
|
|
8916
8973
|
historyStaleRef.current = true;
|
|
8917
8974
|
}
|
|
@@ -8940,12 +8997,12 @@ function DepositModalInner({
|
|
|
8940
8997
|
store.dispatch({ type: "flow/reset" });
|
|
8941
8998
|
}
|
|
8942
8999
|
}, [isOpen, store]);
|
|
8943
|
-
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
9000
|
+
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _288 => _288.showBackButton]), () => ( true));
|
|
8944
9001
|
const canGoBack = backHandler !== void 0;
|
|
8945
9002
|
const hideHeaderChrome = swappedImmersive;
|
|
8946
9003
|
const modalClassName = `rs-modal${hideHeaderChrome ? " rs-modal--swapped-iframe" : ""}`;
|
|
8947
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
8948
|
-
|
|
9004
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.ChainCatalogProvider, { service, rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9005
|
+
_chunkZQR36NCVcjs.Modal,
|
|
8949
9006
|
{
|
|
8950
9007
|
isOpen,
|
|
8951
9008
|
onClose,
|
|
@@ -8961,7 +9018,7 @@ function DepositModalInner({
|
|
|
8961
9018
|
className: "rs-modal-header-back",
|
|
8962
9019
|
"aria-label": "Go back",
|
|
8963
9020
|
onClick: backHandler,
|
|
8964
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9021
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.ChevronLeftIcon, {})
|
|
8965
9022
|
}
|
|
8966
9023
|
) }),
|
|
8967
9024
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
|
|
@@ -8973,7 +9030,7 @@ function DepositModalInner({
|
|
|
8973
9030
|
"aria-label": "Deposit history",
|
|
8974
9031
|
onClick: handleHistoryOpen,
|
|
8975
9032
|
disabled: !recipient,
|
|
8976
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9033
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.HistoryIcon, {})
|
|
8977
9034
|
}
|
|
8978
9035
|
),
|
|
8979
9036
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -8983,7 +9040,7 @@ function DepositModalInner({
|
|
|
8983
9040
|
onClick: onClose,
|
|
8984
9041
|
className: "rs-modal-close",
|
|
8985
9042
|
"aria-label": "Close",
|
|
8986
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9043
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZQR36NCVcjs.CloseIcon, {})
|
|
8987
9044
|
}
|
|
8988
9045
|
)
|
|
8989
9046
|
] })
|
|
@@ -9017,7 +9074,7 @@ function DepositModalInner({
|
|
|
9017
9074
|
onDisconnect,
|
|
9018
9075
|
onRequestConnect,
|
|
9019
9076
|
uiConfig,
|
|
9020
|
-
appFees: _optionalChain([clientSetup, 'optionalAccess',
|
|
9077
|
+
appFees: _optionalChain([clientSetup, 'optionalAccess', _289 => _289.appFees]),
|
|
9021
9078
|
appFeesResolved: clientSetup !== null,
|
|
9022
9079
|
onStepChange: handleStepChange,
|
|
9023
9080
|
onSwappedImmersiveChange: setSwappedImmersive,
|
|
@@ -9043,7 +9100,7 @@ function DepositModalInner({
|
|
|
9043
9100
|
)
|
|
9044
9101
|
] })
|
|
9045
9102
|
}
|
|
9046
|
-
) }) });
|
|
9103
|
+
) }) }) });
|
|
9047
9104
|
}
|
|
9048
9105
|
|
|
9049
9106
|
|