@rhinestone/deposit-modal 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -12
- package/bridge-transcript.json +14 -0
- package/dist/ClaimModal-GFDBVCN5.cjs +11 -0
- package/dist/ClaimModal-VQS3AKEL.mjs +11 -0
- package/dist/{DepositModalReown-Q2JMLT47.mjs → DepositModalReown-KOJ7VEY7.mjs} +30 -29
- package/dist/{DepositModalReown-46LPVFB6.cjs → DepositModalReown-R37SSHUF.cjs} +79 -78
- package/dist/WithdrawModal-QVXHMH43.mjs +12 -0
- package/dist/WithdrawModal-RY2NMFLE.cjs +12 -0
- package/dist/{caip-D8aRWdEY.d.cts → caip-BMi-9t09.d.cts} +27 -3
- package/dist/{caip-D8aRWdEY.d.ts → caip-BMi-9t09.d.ts} +27 -3
- package/dist/{chunk-V2OBGLJD.cjs → chunk-3OOY67VJ.cjs} +1103 -253
- package/dist/{chunk-6KG642KH.cjs → chunk-5P2PVLS4.cjs} +1 -1
- package/dist/{chunk-IN77XSWO.mjs → chunk-5VONFVQN.mjs} +976 -126
- package/dist/chunk-6HUHVXCY.cjs +704 -0
- package/dist/{chunk-PKML3XVS.mjs → chunk-7UQ6OUEE.mjs} +166 -45
- package/dist/{chunk-K4H6TGBE.mjs → chunk-CXBMIZUF.mjs} +1 -1
- package/dist/{chunk-MTFJSE52.cjs → chunk-DTVZUBHI.cjs} +236 -115
- package/dist/{chunk-VUATPOWJ.mjs → chunk-EAGMY3QE.mjs} +74 -17
- package/dist/{chunk-RN5VKWI6.mjs → chunk-FTWKAJGN.mjs} +1 -1
- package/dist/{chunk-KTUVSKR4.mjs → chunk-IKUYZA7A.mjs} +265 -523
- package/dist/{chunk-DW2EQA2U.cjs → chunk-LVCD6RHF.cjs} +2 -2
- package/dist/{chunk-4KCSH4T3.cjs → chunk-OY5N3E6L.cjs} +86 -29
- package/dist/chunk-QJ7RCCU7.mjs +704 -0
- package/dist/chunk-UCBUCX2W.mjs +3169 -0
- package/dist/{chunk-YCQZJQO6.cjs → chunk-VPDCGD2D.cjs} +622 -880
- package/dist/{chunk-7ICSHJFE.cjs → chunk-X4D52IZK.cjs} +1501 -176
- package/dist/claim.cjs +5 -7
- package/dist/claim.d.cts +3 -3
- package/dist/claim.d.ts +3 -3
- package/dist/claim.mjs +4 -6
- package/dist/{constants-DBrWhJWE.d.cts → constants-BT4ctuHo.d.cts} +7 -6
- package/dist/{constants-DBrWhJWE.d.ts → constants-D21ZdNOP.d.ts} +7 -6
- package/dist/constants.cjs +3 -3
- package/dist/constants.d.cts +3 -3
- package/dist/constants.d.ts +3 -3
- package/dist/constants.mjs +2 -2
- package/dist/deposit.cjs +7 -8
- package/dist/deposit.d.cts +3 -3
- package/dist/deposit.d.ts +3 -3
- package/dist/deposit.mjs +6 -7
- package/dist/embed.cjs +135 -44
- package/dist/embed.d.cts +2 -2
- package/dist/embed.d.ts +2 -2
- package/dist/embed.mjs +116 -25
- package/dist/index.cjs +13 -11
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +12 -10
- package/dist/polymarket.cjs +6 -6
- package/dist/polymarket.mjs +2 -2
- package/dist/styles.css +132 -100
- package/dist/{types-Bho4OA03.d.ts → types-CQ0NHqCy.d.ts} +146 -11
- package/dist/{types-DP_3KwlD.d.cts → types-CxiLX5sv.d.cts} +146 -11
- package/dist/withdraw.cjs +6 -6
- package/dist/withdraw.d.cts +4 -4
- package/dist/withdraw.d.ts +4 -4
- package/dist/withdraw.mjs +5 -5
- package/package.json +7 -6
- package/dist/ClaimModal-IKTJU43Y.cjs +0 -13
- package/dist/ClaimModal-SEKNWRMA.mjs +0 -13
- package/dist/WithdrawModal-5ICGD4HJ.mjs +0 -12
- package/dist/WithdrawModal-VP6PMIRO.cjs +0 -12
- package/dist/chunk-7SR7ENVJ.mjs +0 -1844
- package/dist/chunk-CFKC77SV.mjs +0 -1062
- package/dist/chunk-LZFRL2AL.cjs +0 -81
- package/dist/chunk-WUJIKCFU.mjs +0 -81
- package/dist/chunk-X2IPAPXU.cjs +0 -163
- package/dist/chunk-YWMWI7PZ.cjs +0 -1062
- package/dist/chunk-ZEO6ADM3.mjs +0 -163
|
@@ -19,13 +19,12 @@
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
var _chunk7ICSHJFEcjs = require('./chunk-7ICSHJFE.cjs');
|
|
23
22
|
|
|
24
23
|
|
|
25
|
-
var _chunkLZFRL2ALcjs = require('./chunk-LZFRL2AL.cjs');
|
|
26
24
|
|
|
27
25
|
|
|
28
26
|
|
|
27
|
+
var _chunkX4D52IZKcjs = require('./chunk-X4D52IZK.cjs');
|
|
29
28
|
|
|
30
29
|
|
|
31
30
|
|
|
@@ -88,8 +87,8 @@ var _chunkLZFRL2ALcjs = require('./chunk-LZFRL2AL.cjs');
|
|
|
88
87
|
|
|
89
88
|
|
|
90
89
|
|
|
91
|
-
var _chunkV2OBGLJDcjs = require('./chunk-V2OBGLJD.cjs');
|
|
92
90
|
|
|
91
|
+
var _chunk3OOY67VJcjs = require('./chunk-3OOY67VJ.cjs');
|
|
93
92
|
|
|
94
93
|
|
|
95
94
|
|
|
@@ -100,8 +99,8 @@ var _chunkV2OBGLJDcjs = require('./chunk-V2OBGLJD.cjs');
|
|
|
100
99
|
|
|
101
100
|
|
|
102
101
|
|
|
103
|
-
var _chunkDW2EQA2Ucjs = require('./chunk-DW2EQA2U.cjs');
|
|
104
102
|
|
|
103
|
+
var _chunkLVCD6RHFcjs = require('./chunk-LVCD6RHF.cjs');
|
|
105
104
|
|
|
106
105
|
|
|
107
106
|
|
|
@@ -128,10 +127,35 @@ var _chunkDW2EQA2Ucjs = require('./chunk-DW2EQA2U.cjs');
|
|
|
128
127
|
|
|
129
128
|
|
|
130
129
|
|
|
130
|
+
var _chunkOY5N3E6Lcjs = require('./chunk-OY5N3E6L.cjs');
|
|
131
131
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
var
|
|
132
|
+
// src/core/reown-dependencies.ts
|
|
133
|
+
var dependencies;
|
|
134
|
+
var dependenciesPromise;
|
|
135
|
+
function loadReownDependencies() {
|
|
136
|
+
_nullishCoalesce(dependenciesPromise, () => ( (dependenciesPromise = Promise.all([
|
|
137
|
+
Promise.resolve().then(() => _interopRequireWildcard(require("@reown/appkit/react"))),
|
|
138
|
+
Promise.resolve().then(() => _interopRequireWildcard(require("@reown/appkit/networks"))),
|
|
139
|
+
Promise.resolve().then(() => _interopRequireWildcard(require("@reown/appkit-adapter-wagmi"))),
|
|
140
|
+
Promise.resolve().then(() => _interopRequireWildcard(require("@reown/appkit-adapter-solana"))),
|
|
141
|
+
Promise.resolve().then(() => _interopRequireWildcard(require("@reown/appkit-adapter-solana/react")))
|
|
142
|
+
]).then((modules) => dependencies = modules).catch((cause) => {
|
|
143
|
+
const error = new Error(
|
|
144
|
+
"[rhinestone] reownAppId requires @reown/appkit, @reown/appkit-adapter-wagmi, @reown/appkit-adapter-solana, @solana/web3.js, and @solana/spl-token."
|
|
145
|
+
);
|
|
146
|
+
error.cause = cause;
|
|
147
|
+
throw error;
|
|
148
|
+
}))));
|
|
149
|
+
return dependenciesPromise;
|
|
150
|
+
}
|
|
151
|
+
function getReownDependencies() {
|
|
152
|
+
if (!dependencies) {
|
|
153
|
+
throw new Error(
|
|
154
|
+
"[rhinestone] Reown dependencies were accessed before initialization."
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
return dependencies;
|
|
158
|
+
}
|
|
135
159
|
|
|
136
160
|
// src/DepositModal.tsx
|
|
137
161
|
|
|
@@ -221,14 +245,14 @@ SegmentedToggle.displayName = "SegmentedToggle";
|
|
|
221
245
|
// src/components/ui/ChainIcon.tsx
|
|
222
246
|
|
|
223
247
|
function ChainIcon({ chainId, className, loading }) {
|
|
224
|
-
const badge =
|
|
225
|
-
const catalogChain =
|
|
226
|
-
const name = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _2 => _2.name]), () => (
|
|
248
|
+
const badge = _chunkOY5N3E6Lcjs.getChainBadge.call(void 0, chainId);
|
|
249
|
+
const catalogChain = _chunk3OOY67VJcjs.useCatalogChain.call(void 0, _chunk3OOY67VJcjs.catalogKeyForChain.call(void 0, chainId));
|
|
250
|
+
const name = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _2 => _2.name]), () => ( _chunkOY5N3E6Lcjs.getChainName.call(void 0, chainId)));
|
|
227
251
|
const initial = (_nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _3 => _3.name]), () => ( badge.shortLabel))).charAt(0);
|
|
228
252
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
229
|
-
|
|
253
|
+
_chunk3OOY67VJcjs.CdnIcon,
|
|
230
254
|
{
|
|
231
|
-
src: _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _4 => _4.iconUrl]), () => (
|
|
255
|
+
src: _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _4 => _4.iconUrl]), () => ( _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, chainId))),
|
|
232
256
|
alt: name,
|
|
233
257
|
className,
|
|
234
258
|
loading,
|
|
@@ -249,16 +273,16 @@ ChainIcon.displayName = "ChainIcon";
|
|
|
249
273
|
// src/components/ui/WalletBadgeIcons/index.tsx
|
|
250
274
|
|
|
251
275
|
function BadgeImage({ src, alt = "" }) {
|
|
252
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
276
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.CdnIcon, { src, alt }) });
|
|
253
277
|
}
|
|
254
278
|
var WALLET_BADGES = ["rabby", "phantom", "walletconnect"];
|
|
255
279
|
function WalletBadgeIcons() {
|
|
256
|
-
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:
|
|
280
|
+
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: _chunkOY5N3E6Lcjs.cdnIconUrl.call(void 0, "wallets", slug) }, slug)) });
|
|
257
281
|
}
|
|
258
282
|
WalletBadgeIcons.displayName = "WalletBadgeIcons";
|
|
259
283
|
var TRANSFER_CHAIN_BADGES = ["mainnet", "solana", "base"];
|
|
260
284
|
function ChainBadgeIcons() {
|
|
261
|
-
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:
|
|
285
|
+
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: _chunkOY5N3E6Lcjs.cdnIconUrl.call(void 0, "chains", slug) }, slug)) });
|
|
262
286
|
}
|
|
263
287
|
ChainBadgeIcons.displayName = "ChainBadgeIcons";
|
|
264
288
|
var MAX_WALLET_CHAIN_MARKS = 3;
|
|
@@ -278,23 +302,23 @@ var DAPP_IMPORT_CATALOG = [
|
|
|
278
302
|
{
|
|
279
303
|
id: "polymarket",
|
|
280
304
|
label: "Polymarket",
|
|
281
|
-
iconUrl:
|
|
305
|
+
iconUrl: _chunkOY5N3E6Lcjs.cdnIconUrl.call(void 0, "dapps", "polymarket")
|
|
282
306
|
},
|
|
283
307
|
{
|
|
284
308
|
id: "aave",
|
|
285
309
|
label: "Aave",
|
|
286
|
-
iconUrl:
|
|
310
|
+
iconUrl: _chunkOY5N3E6Lcjs.cdnIconUrl.call(void 0, "dapps", "aave")
|
|
287
311
|
},
|
|
288
312
|
{
|
|
289
313
|
id: "hyperliquid",
|
|
290
314
|
label: "Hyperliquid",
|
|
291
|
-
iconUrl:
|
|
315
|
+
iconUrl: _chunkOY5N3E6Lcjs.cdnIconUrl.call(void 0, "dapps", "hyperliquid"),
|
|
292
316
|
comingSoon: true
|
|
293
317
|
},
|
|
294
318
|
{
|
|
295
319
|
id: "morpho",
|
|
296
320
|
label: "Morpho",
|
|
297
|
-
iconUrl:
|
|
321
|
+
iconUrl: _chunkOY5N3E6Lcjs.cdnIconUrl.call(void 0, "dapps", "morpho"),
|
|
298
322
|
comingSoon: true
|
|
299
323
|
}
|
|
300
324
|
];
|
|
@@ -302,7 +326,7 @@ var DAPP_IMPORT_CATALOG = [
|
|
|
302
326
|
// src/components/ui/BrandIcons.tsx
|
|
303
327
|
|
|
304
328
|
function ExchangeBadgeImage({ name }) {
|
|
305
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
329
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.CdnIcon, { src: _nullishCoalesce(_chunkX4D52IZKcjs.getExchangeLogoSrc.call(void 0, name), () => ( void 0)) });
|
|
306
330
|
}
|
|
307
331
|
var CARD_NETWORKS = ["amex", "visa", "mastercard"];
|
|
308
332
|
function CardNetworkIcons() {
|
|
@@ -310,7 +334,7 @@ function CardNetworkIcons() {
|
|
|
310
334
|
"span",
|
|
311
335
|
{
|
|
312
336
|
className: `rs-card-network rs-card-network--${network}`,
|
|
313
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
337
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.CdnIcon, { src: _chunkOY5N3E6Lcjs.cdnIconUrl.call(void 0, "cards", network) })
|
|
314
338
|
},
|
|
315
339
|
network
|
|
316
340
|
)) });
|
|
@@ -329,7 +353,7 @@ function DappBadgeIcons() {
|
|
|
329
353
|
).filter(
|
|
330
354
|
(brand) => Boolean(brand)
|
|
331
355
|
);
|
|
332
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-list-row-meta-icons rs-list-row-meta-icons--exchanges", children: marks.map((brand) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
356
|
+
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, _chunk3OOY67VJcjs.CdnIcon, { src: brand.iconUrl, alt: brand.label }) }, brand.id)) });
|
|
333
357
|
}
|
|
334
358
|
DappBadgeIcons.displayName = "DappBadgeIcons";
|
|
335
359
|
var DAPP_BADGE_COUNT = DAPP_BADGE_ORDER.length;
|
|
@@ -349,9 +373,9 @@ function balanceSubtitle(status, balanceUsd, fallback) {
|
|
|
349
373
|
return "No balance";
|
|
350
374
|
}
|
|
351
375
|
function fiatIcon(name) {
|
|
352
|
-
if (name === "apple") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
353
|
-
if (name === "bank") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
354
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
376
|
+
if (name === "apple") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.AppleIcon, {});
|
|
377
|
+
if (name === "bank") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.BankIcon, {});
|
|
378
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.CardIcon, {});
|
|
355
379
|
}
|
|
356
380
|
function FiatMethodIcon({ option }) {
|
|
357
381
|
const [remoteFailed, setRemoteFailed] = _react.useState.call(void 0, false);
|
|
@@ -434,20 +458,20 @@ function renderWalletLeading(row) {
|
|
|
434
458
|
}
|
|
435
459
|
);
|
|
436
460
|
}
|
|
437
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
461
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.WalletIcon, {});
|
|
438
462
|
}
|
|
439
|
-
var TRANSFER_CRYPTO_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
440
|
-
var WALLET_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
441
|
-
var EXCHANGE_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
442
|
-
var MIGRATE_ASSETS_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
443
|
-
var SMALL_SPINNER = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
463
|
+
var TRANSFER_CRYPTO_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.TransferCryptoIcon, {});
|
|
464
|
+
var WALLET_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.WalletIcon, {});
|
|
465
|
+
var EXCHANGE_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.UnplugIcon, {});
|
|
466
|
+
var MIGRATE_ASSETS_LEADING = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.MigrateAssetsIcon, {});
|
|
467
|
+
var SMALL_SPINNER = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.Spinner, { className: "rs-spinner--sm" });
|
|
444
468
|
var CONNECT_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
445
469
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, WalletBadgeIcons, {}),
|
|
446
470
|
"+100"
|
|
447
471
|
] });
|
|
448
472
|
var EXTRA_EXCHANGE_COUNT = Math.max(
|
|
449
473
|
0,
|
|
450
|
-
|
|
474
|
+
_chunk3OOY67VJcjs.SUPPORTED_CONNECT_EXCHANGE_COUNT - EXCHANGE_BADGE_COUNT
|
|
451
475
|
);
|
|
452
476
|
var EXCHANGE_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
453
477
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExchangeBadgeIcons, {}),
|
|
@@ -461,7 +485,7 @@ var MIGRATE_ASSETS_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxrunt
|
|
|
461
485
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, DappBadgeIcons, {}),
|
|
462
486
|
EXTRA_DAPP_COUNT > 0 ? `+${EXTRA_DAPP_COUNT}` : null
|
|
463
487
|
] });
|
|
464
|
-
var EXTRA_CHAIN_COUNT = Math.max(0,
|
|
488
|
+
var EXTRA_CHAIN_COUNT = Math.max(0, _chunkOY5N3E6Lcjs.getSupportedChainIds.call(void 0, ).length - 3);
|
|
465
489
|
var CHAIN_BADGE_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
466
490
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChainBadgeIcons, {}),
|
|
467
491
|
EXTRA_CHAIN_COUNT > 0 ? `+${EXTRA_CHAIN_COUNT}` : null
|
|
@@ -505,7 +529,7 @@ function ConnectStep({
|
|
|
505
529
|
if (onSelectTransferCrypto) {
|
|
506
530
|
cryptoRows.push(
|
|
507
531
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
508
|
-
|
|
532
|
+
_chunk3OOY67VJcjs.ListRow,
|
|
509
533
|
{
|
|
510
534
|
leading: TRANSFER_CRYPTO_LEADING,
|
|
511
535
|
title: "Transfer crypto",
|
|
@@ -526,7 +550,7 @@ function ConnectStep({
|
|
|
526
550
|
);
|
|
527
551
|
cryptoRows.push(
|
|
528
552
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
529
|
-
|
|
553
|
+
_chunk3OOY67VJcjs.ListRow,
|
|
530
554
|
{
|
|
531
555
|
leading: renderWalletLeading(row),
|
|
532
556
|
title: collapseToExternal ? "External wallet" : row.label,
|
|
@@ -543,7 +567,7 @@ function ConnectStep({
|
|
|
543
567
|
if (!hasSessionWallet && handleConnect) {
|
|
544
568
|
cryptoRows.push(
|
|
545
569
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
546
|
-
|
|
570
|
+
_chunk3OOY67VJcjs.ListRow,
|
|
547
571
|
{
|
|
548
572
|
leading: WALLET_LEADING,
|
|
549
573
|
title: "Connect wallet",
|
|
@@ -558,7 +582,7 @@ function ConnectStep({
|
|
|
558
582
|
if (onSelectFundFromExchange) {
|
|
559
583
|
cryptoRows.push(
|
|
560
584
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
561
|
-
|
|
585
|
+
_chunk3OOY67VJcjs.ListRow,
|
|
562
586
|
{
|
|
563
587
|
leading: EXCHANGE_LEADING,
|
|
564
588
|
title: "Connect exchange",
|
|
@@ -573,7 +597,7 @@ function ConnectStep({
|
|
|
573
597
|
if (onSelectMigrateAssets) {
|
|
574
598
|
cryptoRows.push(
|
|
575
599
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
576
|
-
|
|
600
|
+
_chunk3OOY67VJcjs.ListRow,
|
|
577
601
|
{
|
|
578
602
|
leading: MIGRATE_ASSETS_LEADING,
|
|
579
603
|
title: "Migrate assets",
|
|
@@ -594,7 +618,7 @@ function ConnectStep({
|
|
|
594
618
|
for (const opt of fiatPaymentMethods) {
|
|
595
619
|
cashRows.push(
|
|
596
620
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
597
|
-
|
|
621
|
+
_chunk3OOY67VJcjs.ListRow,
|
|
598
622
|
{
|
|
599
623
|
leading: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FiatMethodIcon, { option: opt }),
|
|
600
624
|
title: opt.label,
|
|
@@ -609,7 +633,7 @@ function ConnectStep({
|
|
|
609
633
|
} else if (fiatLoading) {
|
|
610
634
|
cashRows.push(
|
|
611
635
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
612
|
-
|
|
636
|
+
_chunk3OOY67VJcjs.ListRow,
|
|
613
637
|
{
|
|
614
638
|
leading: SMALL_SPINNER,
|
|
615
639
|
title: "Loading payment options\u2026",
|
|
@@ -638,9 +662,9 @@ function ConnectStep({
|
|
|
638
662
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
639
663
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
640
664
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
641
|
-
|
|
665
|
+
_chunk3OOY67VJcjs.BodyHeader,
|
|
642
666
|
{
|
|
643
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
667
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.HandCoinsIcon, {}),
|
|
644
668
|
title,
|
|
645
669
|
subtitle: _nullishCoalesce(subtitle, () => ( defaultSubtitle)),
|
|
646
670
|
aside: showToggle ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -676,7 +700,7 @@ function ConnectStep({
|
|
|
676
700
|
children: "Disconnect wallet"
|
|
677
701
|
}
|
|
678
702
|
) }),
|
|
679
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
703
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.PoweredBy, {})
|
|
680
704
|
] });
|
|
681
705
|
}
|
|
682
706
|
ConnectStep.displayName = "ConnectStep";
|
|
@@ -699,17 +723,17 @@ function AssetSelectStep({
|
|
|
699
723
|
const [selectedAssetId, setSelectedAssetId] = _react.useState.call(void 0, null);
|
|
700
724
|
const [loading, setLoading] = _react.useState.call(void 0, true);
|
|
701
725
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
702
|
-
const isDepositChain =
|
|
703
|
-
const { catalog } =
|
|
704
|
-
const chainName =
|
|
726
|
+
const isDepositChain = _chunk3OOY67VJcjs.useIsDepositChain.call(void 0, );
|
|
727
|
+
const { catalog } = _chunk3OOY67VJcjs.useChainCatalog.call(void 0, );
|
|
728
|
+
const chainName = _chunk3OOY67VJcjs.useChainName.call(void 0, );
|
|
705
729
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
706
730
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
707
|
-
return
|
|
731
|
+
return _chunk3OOY67VJcjs.getAssetId.call(void 0, {
|
|
708
732
|
chainId: defaultSourceChain,
|
|
709
733
|
token: defaultSourceToken
|
|
710
734
|
});
|
|
711
735
|
}, [defaultSourceChain, defaultSourceToken]);
|
|
712
|
-
const onTotalBalanceComputedRef =
|
|
736
|
+
const onTotalBalanceComputedRef = _chunk3OOY67VJcjs.useLatestRef.call(void 0, onTotalBalanceComputed);
|
|
713
737
|
_react.useEffect.call(void 0, () => {
|
|
714
738
|
let active = true;
|
|
715
739
|
function emitAssetsUpdate(currentAssets) {
|
|
@@ -729,11 +753,11 @@ function AssetSelectStep({
|
|
|
729
753
|
try {
|
|
730
754
|
const portfolio = await service.fetchPortfolio(address);
|
|
731
755
|
if (!active) return;
|
|
732
|
-
const portfolioAssets =
|
|
756
|
+
const portfolioAssets = _chunk3OOY67VJcjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
733
757
|
setAssets(portfolioAssets);
|
|
734
758
|
emitAssetsUpdate(portfolioAssets);
|
|
735
759
|
const hasNative = portfolioAssets.some(
|
|
736
|
-
(asset) => asset.token.toLowerCase() ===
|
|
760
|
+
(asset) => asset.token.toLowerCase() === _chunkOY5N3E6Lcjs.NATIVE_TOKEN_ADDRESS
|
|
737
761
|
);
|
|
738
762
|
if (!hasNative) {
|
|
739
763
|
const connectedChainId = _optionalChain([publicClient, 'access', _11 => _11.chain, 'optionalAccess', _12 => _12.id]);
|
|
@@ -780,7 +804,7 @@ function AssetSelectStep({
|
|
|
780
804
|
} catch (e2) {
|
|
781
805
|
return false;
|
|
782
806
|
}
|
|
783
|
-
const isNativeToken = a.token.toLowerCase() ===
|
|
807
|
+
const isNativeToken = a.token.toLowerCase() === _chunkOY5N3E6Lcjs.NATIVE_TOKEN_ADDRESS;
|
|
784
808
|
if (!isNativeToken && !(typeof a.balanceUsd === "number" && a.balanceUsd >= 0.01))
|
|
785
809
|
return false;
|
|
786
810
|
return true;
|
|
@@ -808,7 +832,7 @@ function AssetSelectStep({
|
|
|
808
832
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
809
833
|
const numeric = Number(raw);
|
|
810
834
|
if (!Number.isFinite(numeric)) return raw;
|
|
811
|
-
return
|
|
835
|
+
return _chunk3OOY67VJcjs.tokenFormatter.format(numeric);
|
|
812
836
|
} catch (e3) {
|
|
813
837
|
return asset.balance;
|
|
814
838
|
}
|
|
@@ -816,20 +840,20 @@ function AssetSelectStep({
|
|
|
816
840
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
817
841
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
818
842
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
819
|
-
|
|
843
|
+
_chunk3OOY67VJcjs.BodyHeader,
|
|
820
844
|
{
|
|
821
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
845
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.WalletIcon, {}),
|
|
822
846
|
title: "Your assets",
|
|
823
847
|
subtitle: "Select source assets to transfer"
|
|
824
848
|
}
|
|
825
849
|
),
|
|
826
850
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
827
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
851
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
828
852
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
829
853
|
] }),
|
|
830
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
854
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.Callout, { variant: "error", children: error }),
|
|
831
855
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
832
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
856
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
833
857
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
834
858
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
835
859
|
address.slice(0, 6),
|
|
@@ -849,8 +873,8 @@ function AssetSelectStep({
|
|
|
849
873
|
!loading && !error && rows.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: rows.map((asset) => {
|
|
850
874
|
const isSelected = selectedAssetId === asset.id;
|
|
851
875
|
const tokenAmount = formatBalance(asset);
|
|
852
|
-
const badge =
|
|
853
|
-
const chainIcon =
|
|
876
|
+
const badge = _chunkOY5N3E6Lcjs.getChainBadge.call(void 0, asset.chainId);
|
|
877
|
+
const chainIcon = _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, asset.chainId);
|
|
854
878
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
855
879
|
"button",
|
|
856
880
|
{
|
|
@@ -862,13 +886,13 @@ function AssetSelectStep({
|
|
|
862
886
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
|
|
863
887
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-icon-wrapper", children: [
|
|
864
888
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
865
|
-
|
|
889
|
+
_chunk3OOY67VJcjs.TokenIcon,
|
|
866
890
|
{
|
|
867
891
|
symbol: asset.symbol,
|
|
868
892
|
fallback: asset.symbol.slice(0, 4)
|
|
869
893
|
}
|
|
870
894
|
) }),
|
|
871
|
-
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
895
|
+
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.CdnIcon, { src: chainIcon, alt: chainName(asset.chainId) }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
872
896
|
"span",
|
|
873
897
|
{
|
|
874
898
|
className: "rs-asset-chain-badge",
|
|
@@ -895,14 +919,14 @@ function AssetSelectStep({
|
|
|
895
919
|
] })
|
|
896
920
|
] })
|
|
897
921
|
] }),
|
|
898
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ?
|
|
922
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunk3OOY67VJcjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
899
923
|
]
|
|
900
924
|
},
|
|
901
925
|
asset.id
|
|
902
926
|
);
|
|
903
927
|
}) }),
|
|
904
928
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
905
|
-
|
|
929
|
+
_chunk3OOY67VJcjs.Button,
|
|
906
930
|
{
|
|
907
931
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
908
932
|
disabled: !selectedAsset,
|
|
@@ -911,7 +935,7 @@ function AssetSelectStep({
|
|
|
911
935
|
}
|
|
912
936
|
)
|
|
913
937
|
] }),
|
|
914
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
938
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.PoweredBy, {})
|
|
915
939
|
] });
|
|
916
940
|
}
|
|
917
941
|
async function fetchNativeAssets(address, publicClient, existing, isDepositChain, catalogChain) {
|
|
@@ -919,20 +943,20 @@ async function fetchNativeAssets(address, publicClient, existing, isDepositChain
|
|
|
919
943
|
const connectedChainId = _optionalChain([publicClient, 'access', _16 => _16.chain, 'optionalAccess', _17 => _17.id]);
|
|
920
944
|
if (!connectedChainId) return [];
|
|
921
945
|
if (!isDepositChain(connectedChainId)) return [];
|
|
922
|
-
const id =
|
|
946
|
+
const id = _chunk3OOY67VJcjs.getAssetId.call(void 0, {
|
|
923
947
|
chainId: connectedChainId,
|
|
924
|
-
token:
|
|
948
|
+
token: _chunkOY5N3E6Lcjs.NATIVE_TOKEN_ADDRESS
|
|
925
949
|
});
|
|
926
950
|
if (existingIds.has(id)) return [];
|
|
927
951
|
try {
|
|
928
952
|
const balance = await publicClient.getBalance({ address });
|
|
929
|
-
const nativeSymbol = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _18 => _18.nativeToken, 'access', _19 => _19.symbol]), () => (
|
|
953
|
+
const nativeSymbol = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _18 => _18.nativeToken, 'access', _19 => _19.symbol]), () => ( _chunkOY5N3E6Lcjs.getNativeSymbol.call(void 0, connectedChainId)));
|
|
930
954
|
const nativeDecimals = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _20 => _20.nativeToken, 'access', _21 => _21.decimals]), () => ( 18));
|
|
931
955
|
return [
|
|
932
956
|
{
|
|
933
957
|
id,
|
|
934
958
|
chainId: connectedChainId,
|
|
935
|
-
token:
|
|
959
|
+
token: _chunkOY5N3E6Lcjs.NATIVE_TOKEN_ADDRESS,
|
|
936
960
|
symbol: nativeSymbol,
|
|
937
961
|
name: nativeSymbol,
|
|
938
962
|
decimals: nativeDecimals,
|
|
@@ -1094,9 +1118,9 @@ function AmountStep({
|
|
|
1094
1118
|
const chainMismatch = Boolean(
|
|
1095
1119
|
_optionalChain([walletClient, 'optionalAccess', _26 => _26.chain, 'optionalAccess', _27 => _27.id]) && walletClient.chain.id !== asset.chainId
|
|
1096
1120
|
);
|
|
1097
|
-
const targetChainId =
|
|
1098
|
-
const targetSymbol =
|
|
1099
|
-
const isSourceStablecoin =
|
|
1121
|
+
const targetChainId = _chunkOY5N3E6Lcjs.targetChainToChainId.call(void 0, targetChain);
|
|
1122
|
+
const targetSymbol = _chunkOY5N3E6Lcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
1123
|
+
const isSourceStablecoin = _chunkOY5N3E6Lcjs.isStablecoinSymbol.call(void 0, asset.symbol);
|
|
1100
1124
|
const derivedPriceUsd = _react.useMemo.call(void 0, () => {
|
|
1101
1125
|
if (tokenPriceUsdOverride !== void 0 && tokenPriceUsdOverride > 0)
|
|
1102
1126
|
return tokenPriceUsdOverride;
|
|
@@ -1125,7 +1149,7 @@ function AmountStep({
|
|
|
1125
1149
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
1126
1150
|
if (!balanceTarget || !publicClient) return;
|
|
1127
1151
|
try {
|
|
1128
|
-
const bal =
|
|
1152
|
+
const bal = _chunk3OOY67VJcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
1129
1153
|
address: asset.token,
|
|
1130
1154
|
abi: _viem.erc20Abi,
|
|
1131
1155
|
functionName: "balanceOf",
|
|
@@ -1146,7 +1170,7 @@ function AmountStep({
|
|
|
1146
1170
|
hasAttemptedSwitch.current = true;
|
|
1147
1171
|
switchChain(asset.chainId).catch((err) => {
|
|
1148
1172
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
1149
|
-
setError(
|
|
1173
|
+
setError(_chunk3OOY67VJcjs.formatUserError.call(void 0, raw));
|
|
1150
1174
|
});
|
|
1151
1175
|
}
|
|
1152
1176
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -1199,7 +1223,7 @@ function AmountStep({
|
|
|
1199
1223
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
1200
1224
|
const numeric = Number(raw);
|
|
1201
1225
|
if (!Number.isFinite(numeric)) return raw;
|
|
1202
|
-
return
|
|
1226
|
+
return _chunk3OOY67VJcjs.tokenFormatter.format(numeric);
|
|
1203
1227
|
} catch (e8) {
|
|
1204
1228
|
return "\u2026";
|
|
1205
1229
|
}
|
|
@@ -1218,7 +1242,7 @@ function AmountStep({
|
|
|
1218
1242
|
return null;
|
|
1219
1243
|
}
|
|
1220
1244
|
}, [numericAmount, isSourceStablecoin, hasPricing, tokenPriceUsd, asset.decimals]);
|
|
1221
|
-
const minDepositUsd =
|
|
1245
|
+
const minDepositUsd = _chunkOY5N3E6Lcjs.isHyperCoreDestination.call(void 0, targetChain) ? Math.max(_chunkOY5N3E6Lcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _28 => _28.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _29 => _29.minDepositUsd]), () => ( null));
|
|
1222
1246
|
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _30 => _30.maxDepositUsd]), () => ( null));
|
|
1223
1247
|
const isBelowMin = minDepositUsd !== null && numericAmount > 0 && amountUsd < minDepositUsd;
|
|
1224
1248
|
const isAboveMax = maxDepositUsd !== null && amountUsd > maxDepositUsd;
|
|
@@ -1287,12 +1311,12 @@ function AmountStep({
|
|
|
1287
1311
|
const needsPricing = !knowsBalance && !isSourceStablecoin;
|
|
1288
1312
|
const blockedOnPricing = needsPricing && !hasPricing;
|
|
1289
1313
|
const continueDisabled = chainMismatch || exceedsBalance || blockedOnPricing || numericAmount === 0 && !isBelowMin || knowsBalance && balance === null;
|
|
1290
|
-
const chainName =
|
|
1314
|
+
const chainName = _chunk3OOY67VJcjs.useChainName.call(void 0, );
|
|
1291
1315
|
const sourceChainName = chainName(asset.chainId);
|
|
1292
1316
|
const targetChainName = chainName(targetChainId);
|
|
1293
1317
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
1294
1318
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
1295
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1319
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.WalletIcon, {}), title }),
|
|
1296
1320
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
1297
1321
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
1298
1322
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1312,13 +1336,13 @@ function AmountStep({
|
|
|
1312
1336
|
" available",
|
|
1313
1337
|
balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1314
1338
|
" (~",
|
|
1315
|
-
|
|
1339
|
+
_chunk3OOY67VJcjs.currencyFormatter.format(balanceUsd),
|
|
1316
1340
|
")"
|
|
1317
1341
|
] })
|
|
1318
1342
|
] }),
|
|
1319
1343
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
1320
1344
|
"Min. deposit ",
|
|
1321
|
-
|
|
1345
|
+
_chunk3OOY67VJcjs.currencyFormatter.format(minDepositUsd)
|
|
1322
1346
|
] })
|
|
1323
1347
|
] })
|
|
1324
1348
|
] }),
|
|
@@ -1343,7 +1367,7 @@ function AmountStep({
|
|
|
1343
1367
|
" ",
|
|
1344
1368
|
asset.symbol
|
|
1345
1369
|
] }),
|
|
1346
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1370
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.TokenIcon, { symbol: asset.symbol }) })
|
|
1347
1371
|
] })
|
|
1348
1372
|
] }),
|
|
1349
1373
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
@@ -1354,21 +1378,21 @@ function AmountStep({
|
|
|
1354
1378
|
" ",
|
|
1355
1379
|
targetSymbol
|
|
1356
1380
|
] }),
|
|
1357
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1381
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.TokenIcon, { symbol: targetSymbol }) })
|
|
1358
1382
|
] })
|
|
1359
1383
|
] }),
|
|
1360
1384
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
1361
1385
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
1362
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
1386
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunk3OOY67VJcjs.currencyFormatter.format(balanceAfterUsd) })
|
|
1363
1387
|
] })
|
|
1364
1388
|
] }),
|
|
1365
|
-
blockedOnPricing && sourcePriceUnavailable && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1389
|
+
blockedOnPricing && sourcePriceUnavailable && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunk3OOY67VJcjs.Callout, { variant: "error", children: [
|
|
1366
1390
|
asset.symbol,
|
|
1367
1391
|
" can't be priced right now, so this deposit can't be estimated. You can still send any amount to the deposit address."
|
|
1368
1392
|
] }),
|
|
1369
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1393
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.Callout, { variant: "error", children: error }),
|
|
1370
1394
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1371
|
-
|
|
1395
|
+
_chunk3OOY67VJcjs.Button,
|
|
1372
1396
|
{
|
|
1373
1397
|
onClick: handleContinue,
|
|
1374
1398
|
fullWidth: true,
|
|
@@ -1377,7 +1401,7 @@ function AmountStep({
|
|
|
1377
1401
|
}
|
|
1378
1402
|
)
|
|
1379
1403
|
] }),
|
|
1380
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1404
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.PoweredBy, {})
|
|
1381
1405
|
] });
|
|
1382
1406
|
}
|
|
1383
1407
|
|
|
@@ -1404,14 +1428,14 @@ function ReviewDetails({
|
|
|
1404
1428
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
1405
1429
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1406
1430
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceChainName }),
|
|
1407
|
-
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1431
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.CdnIcon, { src: sourceChainIcon }) })
|
|
1408
1432
|
] })
|
|
1409
1433
|
] }),
|
|
1410
1434
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1411
1435
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
|
|
1412
1436
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1413
1437
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName }),
|
|
1414
|
-
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1438
|
+
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.CdnIcon, { src: targetChainIcon }) })
|
|
1415
1439
|
] })
|
|
1416
1440
|
] }),
|
|
1417
1441
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
@@ -1426,21 +1450,21 @@ function ReviewDetails({
|
|
|
1426
1450
|
" ",
|
|
1427
1451
|
sendSymbol
|
|
1428
1452
|
] }),
|
|
1429
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1453
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.TokenIcon, { symbol: sendSymbol }) })
|
|
1430
1454
|
] })
|
|
1431
1455
|
] }),
|
|
1432
1456
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1433
1457
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Receive" }),
|
|
1434
1458
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1435
1459
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: receiveDisplay }),
|
|
1436
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1460
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.TokenIcon, { symbol: receiveSymbol }) })
|
|
1437
1461
|
] })
|
|
1438
1462
|
] }),
|
|
1439
1463
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
1440
1464
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Fees" }),
|
|
1441
1465
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
1442
1466
|
fee.display === null ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-skeleton rs-skeleton-fee", "aria-hidden": "true" }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { style: fee.struck ? { textDecoration: "line-through" } : void 0, children: fee.display }),
|
|
1443
|
-
fee.tooltip !== void 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1467
|
+
fee.tooltip !== void 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkX4D52IZKcjs.Tooltip, { content: fee.tooltip, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-info", "aria-label": "Fee info", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.InfoIcon, {}) }) })
|
|
1444
1468
|
] })
|
|
1445
1469
|
] })
|
|
1446
1470
|
] });
|
|
@@ -1652,23 +1676,23 @@ function ConfirmStep({
|
|
|
1652
1676
|
recipient
|
|
1653
1677
|
]);
|
|
1654
1678
|
const quote = setupReady && _optionalChain([quoteResult, 'optionalAccess', _66 => _66.requestKey]) === quoteRequestKey ? quoteResult.quote : null;
|
|
1655
|
-
const targetChainId =
|
|
1656
|
-
const targetSymbol = sameRoute ? asset.symbol :
|
|
1657
|
-
const sourceChainName =
|
|
1658
|
-
const targetChainName =
|
|
1659
|
-
const sourceChainIcon =
|
|
1660
|
-
const targetChainIcon =
|
|
1661
|
-
const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? _nullishCoalesce(
|
|
1662
|
-
const mustHaveQuote = !appFeesResolved ||
|
|
1679
|
+
const targetChainId = _chunkOY5N3E6Lcjs.targetChainToChainId.call(void 0, targetChain);
|
|
1680
|
+
const targetSymbol = sameRoute ? asset.symbol : _chunkOY5N3E6Lcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
1681
|
+
const sourceChainName = _chunkOY5N3E6Lcjs.getChainName.call(void 0, asset.chainId);
|
|
1682
|
+
const targetChainName = _chunkOY5N3E6Lcjs.getChainName.call(void 0, targetChainId);
|
|
1683
|
+
const sourceChainIcon = _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, asset.chainId);
|
|
1684
|
+
const targetChainIcon = _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, targetChainId);
|
|
1685
|
+
const formattedSendAmount = amount && Number.isFinite(Number(amount)) ? _nullishCoalesce(_chunk3OOY67VJcjs.formatTokenAmount.call(void 0, Number(amount), asset.symbol), () => ( "0")) : "0";
|
|
1686
|
+
const mustHaveQuote = !appFeesResolved || _chunk3OOY67VJcjs.resolveAppFeeBps.call(void 0,
|
|
1663
1687
|
appFees,
|
|
1664
1688
|
`eip155:${quoteSource.chainId}`,
|
|
1665
1689
|
quoteSource.token
|
|
1666
1690
|
) > 0;
|
|
1667
|
-
const { display: feeDisplay, struck: feesFullySponsored } =
|
|
1691
|
+
const { display: feeDisplay, struck: feesFullySponsored } = _chunk3OOY67VJcjs.quoteFeeRow.call(void 0,
|
|
1668
1692
|
_optionalChain([quote, 'optionalAccess', _67 => _67.fees])
|
|
1669
1693
|
);
|
|
1670
1694
|
const directTransfer = sameRoute && !mustHaveQuote && !executeTransfer;
|
|
1671
|
-
const permitEligible = enableGaslessDeposit && !
|
|
1695
|
+
const permitEligible = enableGaslessDeposit && !_chunk3OOY67VJcjs.isNativeAsset.call(void 0, asset) && !isDappImportAsset(asset) && !executeTransfer && !directTransfer && asset.chainId !== _chunkOY5N3E6Lcjs.HYPERCORE_CHAIN_ID;
|
|
1672
1696
|
const permitRequestKey = JSON.stringify([
|
|
1673
1697
|
smartAccount.toLowerCase(),
|
|
1674
1698
|
asset.chainId,
|
|
@@ -1681,21 +1705,21 @@ function ConfirmStep({
|
|
|
1681
1705
|
const receiveDisplay = (() => {
|
|
1682
1706
|
if (directTransfer) return `${formattedSendAmount} ${asset.symbol}`;
|
|
1683
1707
|
if (quote) {
|
|
1684
|
-
const quoted =
|
|
1708
|
+
const quoted = _chunk3OOY67VJcjs.formatQuotedReceive.call(void 0, quote.output, targetSymbol);
|
|
1685
1709
|
if (quoted !== void 0) return quoted;
|
|
1686
1710
|
}
|
|
1687
1711
|
const usdValue = Number(targetAmount);
|
|
1688
1712
|
const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
|
|
1689
|
-
const estimate =
|
|
1713
|
+
const estimate = _chunk3OOY67VJcjs.formatReceiveEstimate.call(void 0, {
|
|
1690
1714
|
sourceAmount: Number.isFinite(Number(amount)) ? Number(amount) : void 0,
|
|
1691
1715
|
sourceSymbol: asset.symbol,
|
|
1692
1716
|
targetSymbol,
|
|
1693
1717
|
sourceAmountUsd,
|
|
1694
|
-
sourceTrusted:
|
|
1718
|
+
sourceTrusted: _chunk3OOY67VJcjs.isRecognizedToken.call(void 0, asset.token, asset.chainId),
|
|
1695
1719
|
// The target is the curated deposit destination, so a stablecoin target
|
|
1696
1720
|
// estimates at $1 when unquoted (DepositFlow skips fetching stablecoin
|
|
1697
1721
|
// target prices). Not applied to the source — that can be a held token.
|
|
1698
|
-
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } :
|
|
1722
|
+
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : _chunk3OOY67VJcjs.isDisplayStablecoinSymbol.call(void 0, targetSymbol) ? { [targetSymbol.toUpperCase()]: 1 } : {}
|
|
1699
1723
|
});
|
|
1700
1724
|
if (estimate !== void 0) return estimate;
|
|
1701
1725
|
return targetSymbol;
|
|
@@ -1706,7 +1730,7 @@ function ConfirmStep({
|
|
|
1706
1730
|
hasAttemptedSwitch.current = true;
|
|
1707
1731
|
switchChain(asset.chainId).catch((err) => {
|
|
1708
1732
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
1709
|
-
setError(
|
|
1733
|
+
setError(_chunk3OOY67VJcjs.formatUserError.call(void 0, raw));
|
|
1710
1734
|
});
|
|
1711
1735
|
}
|
|
1712
1736
|
}, [chainMismatch, switchChain, asset.chainId]);
|
|
@@ -1893,9 +1917,9 @@ function ConfirmStep({
|
|
|
1893
1917
|
);
|
|
1894
1918
|
} catch (err) {
|
|
1895
1919
|
const raw = err instanceof Error ? err.message : "Signing failed";
|
|
1896
|
-
const safeToTransfer = !submitStarted || err instanceof
|
|
1920
|
+
const safeToTransfer = !submitStarted || err instanceof _chunk3OOY67VJcjs.PermitDepositSubmitError && err.safeToTransfer;
|
|
1897
1921
|
if (safeToTransfer) setPermitDisabled(true);
|
|
1898
|
-
const message = safeToTransfer ?
|
|
1922
|
+
const message = safeToTransfer ? _chunk3OOY67VJcjs.formatUserError.call(void 0, raw) : "Deposit submission status is uncertain. Check your activity before trying a transfer.";
|
|
1899
1923
|
setError(message);
|
|
1900
1924
|
_optionalChain([onError, 'optionalCall', _69 => _69(message, "PERMIT_ERROR", raw)]);
|
|
1901
1925
|
} finally {
|
|
@@ -1916,7 +1940,7 @@ function ConfirmStep({
|
|
|
1916
1940
|
const result = await executeTransfer(amountUnits);
|
|
1917
1941
|
hash = result.txHash;
|
|
1918
1942
|
resolvedSourceToken = result.sourceToken;
|
|
1919
|
-
} else if (
|
|
1943
|
+
} else if (_chunk3OOY67VJcjs.isNativeAsset.call(void 0, asset)) {
|
|
1920
1944
|
hash = await walletClient.sendTransaction({
|
|
1921
1945
|
account,
|
|
1922
1946
|
chain,
|
|
@@ -1947,8 +1971,8 @@ function ConfirmStep({
|
|
|
1947
1971
|
);
|
|
1948
1972
|
} catch (err) {
|
|
1949
1973
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
1950
|
-
const uncertain =
|
|
1951
|
-
const message = uncertain ? "Deposit submission status is uncertain. Check your activity before trying again." :
|
|
1974
|
+
const uncertain = _chunkX4D52IZKcjs.isSubmissionUncertain.call(void 0, err);
|
|
1975
|
+
const message = uncertain ? "Deposit submission status is uncertain. Check your activity before trying again." : _chunk3OOY67VJcjs.formatUserError.call(void 0, raw);
|
|
1952
1976
|
if (uncertain) setSubmissionUncertain(true);
|
|
1953
1977
|
setError(message);
|
|
1954
1978
|
_optionalChain([onError, 'optionalCall', _71 => _71(message, "TRANSFER_ERROR", raw)]);
|
|
@@ -1958,7 +1982,7 @@ function ConfirmStep({
|
|
|
1958
1982
|
};
|
|
1959
1983
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
1960
1984
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
1961
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1985
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.WalletIcon, {}), title: "Review deposit" }),
|
|
1962
1986
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1963
1987
|
ReviewDetails,
|
|
1964
1988
|
{
|
|
@@ -1974,9 +1998,9 @@ function ConfirmStep({
|
|
|
1974
1998
|
fee: { display: feeDisplay, struck: feesFullySponsored }
|
|
1975
1999
|
}
|
|
1976
2000
|
),
|
|
1977
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2001
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.Callout, { variant: "error", children: error }),
|
|
1978
2002
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1979
|
-
|
|
2003
|
+
_chunk3OOY67VJcjs.Button,
|
|
1980
2004
|
{
|
|
1981
2005
|
onClick: handleConfirm,
|
|
1982
2006
|
loading: isSubmitting,
|
|
@@ -2003,7 +2027,7 @@ function ConfirmStep({
|
|
|
2003
2027
|
] }),
|
|
2004
2028
|
!permit && permitEligible && permitUnavailable && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "rs-gasless-note", children: permitUnavailable === "permit2-approval-required" ? "Gasless unavailable until Permit2 is approved; Continue sends a token transaction." : "This wallet/token cannot use gasless authorization; Continue sends a token transaction." })
|
|
2005
2029
|
] }),
|
|
2006
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2030
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.PoweredBy, {})
|
|
2007
2031
|
] });
|
|
2008
2032
|
}
|
|
2009
2033
|
|
|
@@ -2023,8 +2047,8 @@ function QrReviewStep({
|
|
|
2023
2047
|
onClose
|
|
2024
2048
|
}) {
|
|
2025
2049
|
const [quote, setQuote] = _react.useState.call(void 0, { state: "loading", value: null });
|
|
2026
|
-
const targetChainId =
|
|
2027
|
-
const targetSymbol =
|
|
2050
|
+
const targetChainId = _chunkOY5N3E6Lcjs.targetChainToChainId.call(void 0, targetChain);
|
|
2051
|
+
const targetSymbol = _chunkOY5N3E6Lcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
2028
2052
|
_react.useEffect.call(void 0, () => {
|
|
2029
2053
|
let cancelled = false;
|
|
2030
2054
|
let units;
|
|
@@ -2056,36 +2080,36 @@ function QrReviewStep({
|
|
|
2056
2080
|
cancelled = true;
|
|
2057
2081
|
};
|
|
2058
2082
|
}, [service, smartAccount, asset, amount]);
|
|
2059
|
-
const formattedSendAmount = _nullishCoalesce(
|
|
2083
|
+
const formattedSendAmount = _nullishCoalesce(_chunk3OOY67VJcjs.formatTokenAmount.call(void 0, Number(amount), asset.symbol), () => ( amount));
|
|
2060
2084
|
const receiveDisplay = (() => {
|
|
2061
2085
|
if (quote.value) {
|
|
2062
|
-
const quoted =
|
|
2086
|
+
const quoted = _chunk3OOY67VJcjs.formatQuotedReceive.call(void 0, quote.value.output, targetSymbol);
|
|
2063
2087
|
if (quoted !== void 0) return quoted;
|
|
2064
2088
|
}
|
|
2065
2089
|
const usdValue = Number(targetAmount);
|
|
2066
|
-
const estimate =
|
|
2090
|
+
const estimate = _chunk3OOY67VJcjs.formatReceiveEstimate.call(void 0, {
|
|
2067
2091
|
sourceAmount: Number.isFinite(Number(amount)) ? Number(amount) : void 0,
|
|
2068
2092
|
sourceSymbol: asset.symbol,
|
|
2069
2093
|
targetSymbol,
|
|
2070
2094
|
sourceAmountUsd: Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0,
|
|
2071
|
-
sourceTrusted:
|
|
2072
|
-
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } :
|
|
2095
|
+
sourceTrusted: _chunk3OOY67VJcjs.isRecognizedToken.call(void 0, asset.token, asset.chainId),
|
|
2096
|
+
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : _chunk3OOY67VJcjs.isDisplayStablecoinSymbol.call(void 0, targetSymbol) ? { [targetSymbol.toUpperCase()]: 1 } : {}
|
|
2073
2097
|
});
|
|
2074
2098
|
return _nullishCoalesce(estimate, () => ( targetSymbol));
|
|
2075
2099
|
})();
|
|
2076
2100
|
const estimatedTime = quote.value && Number.isFinite(quote.value.estimatedFillTimeSeconds) ? quote.value.estimatedFillTimeSeconds < 60 ? "< 1 min" : `~${Math.round(quote.value.estimatedFillTimeSeconds / 60)} min` : quote.state === "loading" ? "\u2026" : "\u2014";
|
|
2077
|
-
const { display: quotedFee, struck } =
|
|
2101
|
+
const { display: quotedFee, struck } = _chunk3OOY67VJcjs.quoteFeeRow.call(void 0, _optionalChain([quote, 'access', _72 => _72.value, 'optionalAccess', _73 => _73.fees]));
|
|
2078
2102
|
const feeDisplay = quote.state === "unavailable" ? "\u2014" : quotedFee;
|
|
2079
2103
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
2080
2104
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
2081
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2105
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.TransferCryptoIcon, {}), title: "Fee estimate" }),
|
|
2082
2106
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2083
2107
|
ReviewDetails,
|
|
2084
2108
|
{
|
|
2085
|
-
sourceChainName:
|
|
2086
|
-
sourceChainIcon:
|
|
2087
|
-
targetChainName:
|
|
2088
|
-
targetChainIcon:
|
|
2109
|
+
sourceChainName: _chunkOY5N3E6Lcjs.getChainName.call(void 0, asset.chainId),
|
|
2110
|
+
sourceChainIcon: _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, asset.chainId),
|
|
2111
|
+
targetChainName: _chunkOY5N3E6Lcjs.getChainName.call(void 0, targetChainId),
|
|
2112
|
+
targetChainIcon: _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, targetChainId),
|
|
2089
2113
|
estimatedTime,
|
|
2090
2114
|
sendAmount: formattedSendAmount,
|
|
2091
2115
|
sendSymbol: asset.symbol,
|
|
@@ -2094,9 +2118,9 @@ function QrReviewStep({
|
|
|
2094
2118
|
fee: { display: feeDisplay, struck }
|
|
2095
2119
|
}
|
|
2096
2120
|
),
|
|
2097
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2121
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.Button, { onClick: onClose, fullWidth: true, children: "Close" })
|
|
2098
2122
|
] }),
|
|
2099
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2123
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.PoweredBy, {})
|
|
2100
2124
|
] });
|
|
2101
2125
|
}
|
|
2102
2126
|
QrReviewStep.displayName = "QrReviewStep";
|
|
@@ -2118,29 +2142,29 @@ var BASE_CHAIN_ID = 8453;
|
|
|
2118
2142
|
function DepositAddressSkeleton({
|
|
2119
2143
|
uiConfig
|
|
2120
2144
|
}) {
|
|
2121
|
-
const evmChainIds =
|
|
2145
|
+
const evmChainIds = _chunkOY5N3E6Lcjs.getSupportedChainIds.call(void 0, );
|
|
2122
2146
|
const defaultChainId = evmChainIds.includes(BASE_CHAIN_ID) ? BASE_CHAIN_ID : evmChainIds[0];
|
|
2123
|
-
const tokensForChain =
|
|
2147
|
+
const tokensForChain = _chunkOY5N3E6Lcjs.getTargetTokenSymbolsForChain.call(void 0, defaultChainId);
|
|
2124
2148
|
const defaultToken = tokensForChain.includes("USDC") ? "USDC" : _nullishCoalesce(tokensForChain[0], () => ( "USDC"));
|
|
2125
|
-
const chainName =
|
|
2126
|
-
const chainIcon =
|
|
2149
|
+
const chainName = _chunkOY5N3E6Lcjs.getChainName.call(void 0, defaultChainId);
|
|
2150
|
+
const chainIcon = _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, defaultChainId);
|
|
2127
2151
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", "aria-busy": "true", children: [
|
|
2128
2152
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: "Preparing deposit details\u2026" }),
|
|
2129
2153
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
2130
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2154
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
2131
2155
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", "aria-hidden": "true", children: [
|
|
2132
2156
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
2133
2157
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
2134
2158
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown-trigger", children: [
|
|
2135
2159
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2136
|
-
|
|
2160
|
+
_chunk3OOY67VJcjs.CdnIcon,
|
|
2137
2161
|
{
|
|
2138
2162
|
src: chainIcon,
|
|
2139
2163
|
className: "rs-deposit-address-dropdown-icon"
|
|
2140
2164
|
}
|
|
2141
2165
|
),
|
|
2142
2166
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainName }),
|
|
2143
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2167
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2144
2168
|
] })
|
|
2145
2169
|
] }),
|
|
2146
2170
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
@@ -2149,8 +2173,8 @@ function DepositAddressSkeleton({
|
|
|
2149
2173
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
2150
2174
|
"Min.$",
|
|
2151
2175
|
(_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _74 => _74.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
2152
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2153
|
-
|
|
2176
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkX4D52IZKcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2177
|
+
_chunk3OOY67VJcjs.InfoIcon,
|
|
2154
2178
|
{
|
|
2155
2179
|
className: "rs-deposit-address-min-icon",
|
|
2156
2180
|
"aria-hidden": "true"
|
|
@@ -2160,14 +2184,14 @@ function DepositAddressSkeleton({
|
|
|
2160
2184
|
] }),
|
|
2161
2185
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown-trigger", children: [
|
|
2162
2186
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2163
|
-
|
|
2187
|
+
_chunk3OOY67VJcjs.TokenIcon,
|
|
2164
2188
|
{
|
|
2165
2189
|
symbol: defaultToken,
|
|
2166
2190
|
className: "rs-deposit-address-dropdown-icon"
|
|
2167
2191
|
}
|
|
2168
2192
|
),
|
|
2169
2193
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: defaultToken }),
|
|
2170
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2194
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2171
2195
|
] })
|
|
2172
2196
|
] })
|
|
2173
2197
|
] }),
|
|
@@ -2182,7 +2206,7 @@ function DepositAddressSkeleton({
|
|
|
2182
2206
|
] }),
|
|
2183
2207
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-actions", "aria-hidden": "true", children: [
|
|
2184
2208
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "button", { type: "button", className: "rs-deposit-address-copy", disabled: true, children: [
|
|
2185
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2209
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.CopyIcon, {}),
|
|
2186
2210
|
"Copy address"
|
|
2187
2211
|
] }),
|
|
2188
2212
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2199,7 +2223,7 @@ function DepositAddressSkeleton({
|
|
|
2199
2223
|
}
|
|
2200
2224
|
)
|
|
2201
2225
|
] }),
|
|
2202
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2226
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.PoweredBy, {})
|
|
2203
2227
|
] });
|
|
2204
2228
|
}
|
|
2205
2229
|
DepositAddressSkeleton.displayName = "DepositAddressSkeleton";
|
|
@@ -2211,9 +2235,9 @@ var INITIAL_POLL_INTERVAL = 3e3;
|
|
|
2211
2235
|
var MAX_POLL_INTERVAL = 3e4;
|
|
2212
2236
|
var BACKOFF_MULTIPLIER = 1.5;
|
|
2213
2237
|
function isEventForTx(event, txHash) {
|
|
2214
|
-
const eventTxHash =
|
|
2238
|
+
const eventTxHash = _chunkX4D52IZKcjs.getEventTxHash.call(void 0, event);
|
|
2215
2239
|
if (!eventTxHash) return false;
|
|
2216
|
-
return
|
|
2240
|
+
return _chunkX4D52IZKcjs.txRefsMatch.call(void 0, eventTxHash, txHash);
|
|
2217
2241
|
}
|
|
2218
2242
|
function truncateHash(hash) {
|
|
2219
2243
|
return `${hash.slice(0, 4)}\u2026${hash.slice(-4)}`;
|
|
@@ -2263,7 +2287,7 @@ function formatBridgeFailedMessage(event) {
|
|
|
2263
2287
|
}
|
|
2264
2288
|
return "Bridge failed";
|
|
2265
2289
|
}
|
|
2266
|
-
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2290
|
+
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.ExternalLinkIcon, { className: "rs-deposit-notification-link-icon" });
|
|
2267
2291
|
function DepositNotification({
|
|
2268
2292
|
deposit,
|
|
2269
2293
|
smartAccount,
|
|
@@ -2297,7 +2321,7 @@ function DepositNotification({
|
|
|
2297
2321
|
const pollIntervalRef = _react.useRef.call(void 0, INITIAL_POLL_INTERVAL);
|
|
2298
2322
|
const pollTimeoutRef = _react.useRef.call(void 0, null);
|
|
2299
2323
|
const completedRef = _react.useRef.call(void 0, false);
|
|
2300
|
-
const depositContextRef =
|
|
2324
|
+
const depositContextRef = _chunk3OOY67VJcjs.useLatestRef.call(void 0, {
|
|
2301
2325
|
amount,
|
|
2302
2326
|
sourceChain,
|
|
2303
2327
|
sourceToken: token,
|
|
@@ -2305,8 +2329,8 @@ function DepositNotification({
|
|
|
2305
2329
|
targetChain,
|
|
2306
2330
|
targetToken
|
|
2307
2331
|
});
|
|
2308
|
-
const onCompleteRef =
|
|
2309
|
-
const onFailedRef =
|
|
2332
|
+
const onCompleteRef = _chunk3OOY67VJcjs.useLatestRef.call(void 0, onComplete);
|
|
2333
|
+
const onFailedRef = _chunk3OOY67VJcjs.useLatestRef.call(void 0, onFailed);
|
|
2310
2334
|
const handleComplete = _react.useCallback.call(void 0,
|
|
2311
2335
|
(destTxHash) => {
|
|
2312
2336
|
if (completedRef.current) return;
|
|
@@ -2397,12 +2421,12 @@ function DepositNotification({
|
|
|
2397
2421
|
status,
|
|
2398
2422
|
txHash
|
|
2399
2423
|
]);
|
|
2400
|
-
const explorerTxUrl =
|
|
2424
|
+
const explorerTxUrl = _chunk3OOY67VJcjs.useExplorerTxUrl.call(void 0, );
|
|
2401
2425
|
const sourceExplorerUrl = sourceChain === "unknown" ? void 0 : explorerTxUrl(sourceChain, txHash);
|
|
2402
|
-
const destExplorerUrl = destinationTxHash ? explorerTxUrl(
|
|
2426
|
+
const destExplorerUrl = destinationTxHash ? explorerTxUrl(_chunkOY5N3E6Lcjs.targetChainToChainId.call(void 0, targetChain), destinationTxHash) : null;
|
|
2403
2427
|
const title = status === "complete" ? "Deposit completed" : status === "failed" ? "Deposit failed" : "Deposit received and processing\u2026";
|
|
2404
2428
|
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.";
|
|
2405
|
-
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,
|
|
2429
|
+
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, _chunk3OOY67VJcjs.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, _chunk3OOY67VJcjs.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,
|
|
2406
2430
|
"svg",
|
|
2407
2431
|
{
|
|
2408
2432
|
className: "rs-deposit-notification-spinner",
|
|
@@ -2452,7 +2476,7 @@ function DepositNotification({
|
|
|
2452
2476
|
className: "rs-deposit-notification-close",
|
|
2453
2477
|
onClick: () => onDismiss(deposit.id),
|
|
2454
2478
|
"aria-label": "Dismiss",
|
|
2455
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2479
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.CloseIcon, {})
|
|
2456
2480
|
}
|
|
2457
2481
|
)
|
|
2458
2482
|
] }),
|
|
@@ -2468,7 +2492,7 @@ function DepositNotification({
|
|
|
2468
2492
|
"aria-expanded": expanded,
|
|
2469
2493
|
children: [
|
|
2470
2494
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: expanded ? "See less details" : "See more details" }),
|
|
2471
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2495
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.ChevronDownIcon, { className: "rs-deposit-notification-toggle-chevron" })
|
|
2472
2496
|
]
|
|
2473
2497
|
}
|
|
2474
2498
|
),
|
|
@@ -2523,9 +2547,9 @@ function DepositNotification({
|
|
|
2523
2547
|
var SOLANA_NATIVE_MINT = "11111111111111111111111111111111";
|
|
2524
2548
|
var EVM_ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
2525
2549
|
function sourceChainToCaip2(chain) {
|
|
2526
|
-
if (chain === "solana") return
|
|
2527
|
-
if (chain === "hypercore") return
|
|
2528
|
-
return
|
|
2550
|
+
if (chain === "solana") return _chunkOY5N3E6Lcjs.SOLANA_MAINNET_CAIP2;
|
|
2551
|
+
if (chain === "hypercore") return _chunkOY5N3E6Lcjs.HYPERCORE_SPOT_CAIP2;
|
|
2552
|
+
return _chunkOY5N3E6Lcjs.toEvmCaip2.call(void 0, chain);
|
|
2529
2553
|
}
|
|
2530
2554
|
function findAddress(tokens, symbol) {
|
|
2531
2555
|
return _optionalChain([tokens, 'optionalAccess', _88 => _88.find, 'call', _89 => _89((t) => t.symbol.toLowerCase() === symbol.toLowerCase()), 'optionalAccess', _90 => _90.address]);
|
|
@@ -2582,7 +2606,7 @@ function asString(value) {
|
|
|
2582
2606
|
function resolveSolanaTokenMeta(token) {
|
|
2583
2607
|
if (!token) return {};
|
|
2584
2608
|
const normalized = token.toLowerCase();
|
|
2585
|
-
const matched =
|
|
2609
|
+
const matched = _chunkOY5N3E6Lcjs.SOLANA_TOKENS.find(
|
|
2586
2610
|
(entry) => entry.mint.toLowerCase() === normalized
|
|
2587
2611
|
);
|
|
2588
2612
|
if (matched) {
|
|
@@ -2625,7 +2649,7 @@ function isSameRoute(sourceChain, sourceToken, targetChain, targetToken) {
|
|
|
2625
2649
|
return sourceChain === targetChain && sourceToken.toLowerCase() === targetToken.toLowerCase();
|
|
2626
2650
|
}
|
|
2627
2651
|
function chainLabel(chainId, catalogChain) {
|
|
2628
|
-
const name = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _100 => _100.name]), () => (
|
|
2652
|
+
const name = _nullishCoalesce(_optionalChain([catalogChain, 'optionalAccess', _100 => _100.name]), () => ( _chunkOY5N3E6Lcjs.getChainName.call(void 0, chainId)));
|
|
2629
2653
|
return name.replace(/\s+(One|Mainnet|Smart Chain|Chain)$/i, "");
|
|
2630
2654
|
}
|
|
2631
2655
|
function computeTokensForChain(chainId, topTokens, catalogChain) {
|
|
@@ -2653,7 +2677,7 @@ function selectionAsAsset(chainId, symbol, topTokens, catalogChain) {
|
|
|
2653
2677
|
}
|
|
2654
2678
|
function TokenGlyph({ symbol }) {
|
|
2655
2679
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2656
|
-
|
|
2680
|
+
_chunk3OOY67VJcjs.TokenIcon,
|
|
2657
2681
|
{
|
|
2658
2682
|
symbol,
|
|
2659
2683
|
className: "rs-deposit-address-dropdown-icon",
|
|
@@ -2693,19 +2717,19 @@ function DepositAddressStep({
|
|
|
2693
2717
|
if (!active) return;
|
|
2694
2718
|
setTopTokens(t);
|
|
2695
2719
|
setTopTokensSettled(true);
|
|
2696
|
-
if (t)
|
|
2720
|
+
if (t) _chunkOY5N3E6Lcjs.publishShortlistTokens.call(void 0, t);
|
|
2697
2721
|
});
|
|
2698
2722
|
return () => {
|
|
2699
2723
|
active = false;
|
|
2700
2724
|
};
|
|
2701
2725
|
}, [service]);
|
|
2702
2726
|
const BASE_CHAIN_ID2 = 8453;
|
|
2703
|
-
const evmChainIds =
|
|
2704
|
-
const { catalog, isLoading: catalogLoading } =
|
|
2727
|
+
const evmChainIds = _chunk3OOY67VJcjs.useDepositChainIds.call(void 0, );
|
|
2728
|
+
const { catalog, isLoading: catalogLoading } = _chunk3OOY67VJcjs.useChainCatalog.call(void 0, );
|
|
2705
2729
|
const catalogFor = _react.useCallback.call(void 0,
|
|
2706
2730
|
(chain) => {
|
|
2707
2731
|
if (!catalog) return void 0;
|
|
2708
|
-
const key =
|
|
2732
|
+
const key = _chunk3OOY67VJcjs.catalogKeyForChain.call(void 0, chain);
|
|
2709
2733
|
return typeof key === "number" ? catalog.byChainId.get(key) : catalog.byCaip2.get(key);
|
|
2710
2734
|
},
|
|
2711
2735
|
[catalog]
|
|
@@ -2910,10 +2934,10 @@ function DepositAddressStep({
|
|
|
2910
2934
|
return;
|
|
2911
2935
|
}
|
|
2912
2936
|
const event = status.lastEvent;
|
|
2913
|
-
const eventTxHash =
|
|
2937
|
+
const eventTxHash = _chunkX4D52IZKcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkX4D52IZKcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
2914
2938
|
if (baselineTxHashRef.current === void 0) {
|
|
2915
2939
|
baselineTxHashRef.current = eventTxHash;
|
|
2916
|
-
} else if (eventTxHash && (!baselineTxHashRef.current || !
|
|
2940
|
+
} else if (eventTxHash && (!baselineTxHashRef.current || !_chunkX4D52IZKcjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
|
|
2917
2941
|
const details = getDepositEventDetails(event);
|
|
2918
2942
|
const chainId = _nullishCoalesce(details.chainId, () => ( "unknown"));
|
|
2919
2943
|
const amount = _nullishCoalesce(details.amount, () => ( "0"));
|
|
@@ -2922,7 +2946,7 @@ function DepositAddressStep({
|
|
|
2922
2946
|
baselineTxHashRef.current = eventTxHash;
|
|
2923
2947
|
isTrackingRef.current = true;
|
|
2924
2948
|
const isEvmToken = token ? /^0x[a-fA-F0-9]{40}$/.test(token) : false;
|
|
2925
|
-
const sourceDecimals = _nullishCoalesce(details.sourceDecimals, () => ( (isEvmToken ?
|
|
2949
|
+
const sourceDecimals = _nullishCoalesce(details.sourceDecimals, () => ( (isEvmToken ? _chunkOY5N3E6Lcjs.findTokenDecimals.call(void 0,
|
|
2926
2950
|
token,
|
|
2927
2951
|
typeof chainId === "number" ? chainId : void 0
|
|
2928
2952
|
) : void 0)));
|
|
@@ -2987,7 +3011,7 @@ function DepositAddressStep({
|
|
|
2987
3011
|
const handleNotificationDismiss = _react.useCallback.call(void 0, (id) => {
|
|
2988
3012
|
setNotifications((prev) => prev.filter((n) => n.id !== id));
|
|
2989
3013
|
}, []);
|
|
2990
|
-
const qrIconSrc = _nullishCoalesce(_optionalChain([catalogFor, 'call', _140 => _140(sourceChainId), 'optionalAccess', _141 => _141.iconUrl]), () => (
|
|
3014
|
+
const qrIconSrc = _nullishCoalesce(_optionalChain([catalogFor, 'call', _140 => _140(sourceChainId), 'optionalAccess', _141 => _141.iconUrl]), () => ( _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, sourceChainId)));
|
|
2991
3015
|
const reviewAsset = selectionAsAsset(
|
|
2992
3016
|
sourceChainId,
|
|
2993
3017
|
sourceTokenSymbol,
|
|
@@ -2997,13 +3021,13 @@ function DepositAddressStep({
|
|
|
2997
3021
|
if (chainOptions.length === 0) {
|
|
2998
3022
|
if (catalogLoading) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositAddressSkeleton, { uiConfig });
|
|
2999
3023
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-screen", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
3000
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3001
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3024
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
3025
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.Callout, { variant: "error", children: "Supported chains are unavailable right now, so there is no deposit address to show. Close and try again in a moment." })
|
|
3002
3026
|
] }) });
|
|
3003
3027
|
}
|
|
3004
3028
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-step--with-notifications", children: [
|
|
3005
3029
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
3006
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3030
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
3007
3031
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", children: [
|
|
3008
3032
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", ref: chainDropdownRef, children: [
|
|
3009
3033
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
@@ -3019,14 +3043,14 @@ function DepositAddressStep({
|
|
|
3019
3043
|
},
|
|
3020
3044
|
children: [
|
|
3021
3045
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3022
|
-
|
|
3046
|
+
_chunk3OOY67VJcjs.CdnIcon,
|
|
3023
3047
|
{
|
|
3024
|
-
src: _nullishCoalesce(_optionalChain([catalogFor, 'call', _142 => _142(sourceChainId), 'optionalAccess', _143 => _143.iconUrl]), () => (
|
|
3048
|
+
src: _nullishCoalesce(_optionalChain([catalogFor, 'call', _142 => _142(sourceChainId), 'optionalAccess', _143 => _143.iconUrl]), () => ( _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, sourceChainId))),
|
|
3025
3049
|
className: "rs-deposit-address-dropdown-icon"
|
|
3026
3050
|
}
|
|
3027
3051
|
),
|
|
3028
3052
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainLabel(sourceChainId, catalogFor(sourceChainId)) }),
|
|
3029
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3053
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
3030
3054
|
]
|
|
3031
3055
|
}
|
|
3032
3056
|
),
|
|
@@ -3038,9 +3062,9 @@ function DepositAddressStep({
|
|
|
3038
3062
|
onClick: () => handleSelectChain(chainId),
|
|
3039
3063
|
children: [
|
|
3040
3064
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3041
|
-
|
|
3065
|
+
_chunk3OOY67VJcjs.CdnIcon,
|
|
3042
3066
|
{
|
|
3043
|
-
src: _nullishCoalesce(_optionalChain([catalogFor, 'call', _144 => _144(chainId), 'optionalAccess', _145 => _145.iconUrl]), () => (
|
|
3067
|
+
src: _nullishCoalesce(_optionalChain([catalogFor, 'call', _144 => _144(chainId), 'optionalAccess', _145 => _145.iconUrl]), () => ( _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, chainId))),
|
|
3044
3068
|
className: "rs-deposit-address-dropdown-icon"
|
|
3045
3069
|
}
|
|
3046
3070
|
),
|
|
@@ -3055,9 +3079,9 @@ function DepositAddressStep({
|
|
|
3055
3079
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Supported token" }),
|
|
3056
3080
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
3057
3081
|
"Min.$",
|
|
3058
|
-
(
|
|
3059
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3060
|
-
|
|
3082
|
+
(_chunkOY5N3E6Lcjs.isHyperCoreDestination.call(void 0, targetChain) || isHyperCore ? Math.max(_chunkOY5N3E6Lcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _146 => _146.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _147 => _147.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
3083
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkX4D52IZKcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3084
|
+
_chunk3OOY67VJcjs.InfoIcon,
|
|
3061
3085
|
{
|
|
3062
3086
|
className: "rs-deposit-address-min-icon",
|
|
3063
3087
|
"aria-hidden": "true"
|
|
@@ -3078,7 +3102,7 @@ function DepositAddressStep({
|
|
|
3078
3102
|
children: [
|
|
3079
3103
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenGlyph, { symbol: sourceTokenSymbol }),
|
|
3080
3104
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceTokenSymbol }),
|
|
3081
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3105
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
3082
3106
|
]
|
|
3083
3107
|
}
|
|
3084
3108
|
),
|
|
@@ -3123,7 +3147,7 @@ function DepositAddressStep({
|
|
|
3123
3147
|
className: "rs-deposit-address-copy",
|
|
3124
3148
|
onClick: handleCopy,
|
|
3125
3149
|
children: [
|
|
3126
|
-
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3150
|
+
copied ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.CheckIcon, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.CopyIcon, {}),
|
|
3127
3151
|
copied ? "Copied!" : "Copy address"
|
|
3128
3152
|
]
|
|
3129
3153
|
}
|
|
@@ -3158,7 +3182,7 @@ function DepositAddressStep({
|
|
|
3158
3182
|
},
|
|
3159
3183
|
deposit.id
|
|
3160
3184
|
)) }),
|
|
3161
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3185
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.PoweredBy, {})
|
|
3162
3186
|
] });
|
|
3163
3187
|
}
|
|
3164
3188
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -3215,7 +3239,7 @@ function FinalisingDepositStep() {
|
|
|
3215
3239
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "rs-finalising-subtitle", children: "We are depositing your funds to the application." })
|
|
3216
3240
|
] })
|
|
3217
3241
|
] }),
|
|
3218
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3242
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.PoweredBy, {})
|
|
3219
3243
|
] });
|
|
3220
3244
|
}
|
|
3221
3245
|
FinalisingDepositStep.displayName = "FinalisingDepositStep";
|
|
@@ -3245,7 +3269,7 @@ function SwappedOrderTracker({
|
|
|
3245
3269
|
];
|
|
3246
3270
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-swapped-tracker", children: [
|
|
3247
3271
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
3248
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3272
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.HandCoinsIcon, {}), title }),
|
|
3249
3273
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ol", { className: "rs-swapped-tracker-steps", children: labels.map((label, idx) => {
|
|
3250
3274
|
const status = stepStates[idx];
|
|
3251
3275
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
@@ -3259,7 +3283,7 @@ function SwappedOrderTracker({
|
|
|
3259
3283
|
{
|
|
3260
3284
|
className: "rs-swapped-tracker-step-marker",
|
|
3261
3285
|
"aria-hidden": "true",
|
|
3262
|
-
children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3286
|
+
children: status === "complete" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.CheckIcon, {}) : status === "failed" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.CloseIcon, {}) : status === "active" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.Spinner, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3263
3287
|
"svg",
|
|
3264
3288
|
{
|
|
3265
3289
|
className: "rs-swapped-tracker-step-ring",
|
|
@@ -3294,7 +3318,7 @@ function SwappedOrderTracker({
|
|
|
3294
3318
|
}
|
|
3295
3319
|
)
|
|
3296
3320
|
] }),
|
|
3297
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3321
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.PoweredBy, {})
|
|
3298
3322
|
] });
|
|
3299
3323
|
}
|
|
3300
3324
|
function formatTrackerAmount(amount) {
|
|
@@ -3582,10 +3606,10 @@ function SwappedProviderStep({
|
|
|
3582
3606
|
const status = await service.fetchLatestStatus(smartAccount);
|
|
3583
3607
|
if (cancelled) return;
|
|
3584
3608
|
const event = status.lastEvent;
|
|
3585
|
-
const eventTxHash =
|
|
3609
|
+
const eventTxHash = _chunkX4D52IZKcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkX4D52IZKcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
3586
3610
|
if (baselineDepositTxHashRef.current === void 0) {
|
|
3587
3611
|
baselineDepositTxHashRef.current = eventTxHash;
|
|
3588
|
-
} else if (eventTxHash && (!baselineDepositTxHashRef.current || !
|
|
3612
|
+
} else if (eventTxHash && (!baselineDepositTxHashRef.current || !_chunkX4D52IZKcjs.txRefsMatch.call(void 0, eventTxHash, baselineDepositTxHashRef.current))) {
|
|
3589
3613
|
currentDepositTxHashRef.current = eventTxHash;
|
|
3590
3614
|
setLatestEvent(_nullishCoalesce(event, () => ( null)));
|
|
3591
3615
|
}
|
|
@@ -3660,10 +3684,10 @@ function SwappedProviderStep({
|
|
|
3660
3684
|
[orderState, latestEvent]
|
|
3661
3685
|
);
|
|
3662
3686
|
const terminalState = _react.useMemo.call(void 0, () => {
|
|
3663
|
-
if (
|
|
3687
|
+
if (_chunkX4D52IZKcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
|
|
3664
3688
|
return {
|
|
3665
3689
|
kind: "failed",
|
|
3666
|
-
message:
|
|
3690
|
+
message: _chunkX4D52IZKcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
|
|
3667
3691
|
};
|
|
3668
3692
|
}
|
|
3669
3693
|
if (_optionalChain([orderState, 'optionalAccess', _178 => _178.status]) === "order_cancelled") {
|
|
@@ -3689,7 +3713,7 @@ function SwappedProviderStep({
|
|
|
3689
3713
|
orderCrypto: _nullishCoalesce(_optionalChain([orderState, 'optionalAccess', _183 => _183.orderCrypto]), () => ( null)),
|
|
3690
3714
|
// Base-unit source amount from the deposit row/event, consistent with the
|
|
3691
3715
|
// wallet/QR path. ProcessingStep + onLifecycle expect base units.
|
|
3692
|
-
amount: _nullishCoalesce(
|
|
3716
|
+
amount: _nullishCoalesce(_chunkX4D52IZKcjs.getEventSourceDetails.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0))).amount, () => ( null)),
|
|
3693
3717
|
expectedOrderUuid: expectedOrderUuidRef.current,
|
|
3694
3718
|
initialEvent: _nullishCoalesce(latestEvent, () => ( void 0))
|
|
3695
3719
|
};
|
|
@@ -3700,14 +3724,14 @@ function SwappedProviderStep({
|
|
|
3700
3724
|
}, [latestEvent, orderState, smartAccount]);
|
|
3701
3725
|
_react.useEffect.call(void 0, () => {
|
|
3702
3726
|
if (failedFiredRef.current || completeFiredRef.current) return;
|
|
3703
|
-
if (!
|
|
3727
|
+
if (!_chunkX4D52IZKcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) return;
|
|
3704
3728
|
const txHash = currentDepositTxHashRef.current;
|
|
3705
3729
|
if (!txHash) return;
|
|
3706
3730
|
failedFiredRef.current = true;
|
|
3707
3731
|
setPhase("tracker");
|
|
3708
3732
|
_optionalChain([onSwappedFailedRef, 'access', _184 => _184.current, 'optionalCall', _185 => _185(
|
|
3709
3733
|
txHash,
|
|
3710
|
-
|
|
3734
|
+
_chunkX4D52IZKcjs.failureMessageForEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))
|
|
3711
3735
|
)]);
|
|
3712
3736
|
}, [latestEvent]);
|
|
3713
3737
|
const immersive = !openExternally && variant === "fiat" && phase === "provider" && !loadError;
|
|
@@ -3757,7 +3781,7 @@ function SwappedProviderStep({
|
|
|
3757
3781
|
}
|
|
3758
3782
|
)
|
|
3759
3783
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
3760
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3784
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.Spinner, {}),
|
|
3761
3785
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-swapped-handoff-text", children: [
|
|
3762
3786
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h2", { className: "rs-swapped-handoff-title", children: handoffOpened ? variant === "fiat" ? "Finish paying in your browser" : "Approve the transfer in your browser" : "Opening your browser\u2026" }),
|
|
3763
3787
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "rs-swapped-handoff-subtitle", children: handoffOpened ? (
|
|
@@ -3781,7 +3805,7 @@ function SwappedProviderStep({
|
|
|
3781
3805
|
}
|
|
3782
3806
|
)
|
|
3783
3807
|
] }) }),
|
|
3784
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3808
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.PoweredBy, {})
|
|
3785
3809
|
] });
|
|
3786
3810
|
}
|
|
3787
3811
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-fiat-onramp", "data-variant": variant, children: [
|
|
@@ -3798,7 +3822,7 @@ function SwappedProviderStep({
|
|
|
3798
3822
|
}
|
|
3799
3823
|
)
|
|
3800
3824
|
] }),
|
|
3801
|
-
!loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3825
|
+
!loadError && !iframeLoaded && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fiat-onramp-loading", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.Spinner, {}) }),
|
|
3802
3826
|
widgetUrl && !loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3803
3827
|
"iframe",
|
|
3804
3828
|
{
|
|
@@ -3821,11 +3845,11 @@ function SwappedProviderStep({
|
|
|
3821
3845
|
retryToken
|
|
3822
3846
|
)
|
|
3823
3847
|
] }) }),
|
|
3824
|
-
loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3848
|
+
loadError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.PoweredBy, {})
|
|
3825
3849
|
] });
|
|
3826
3850
|
}
|
|
3827
3851
|
function deriveStepStates(swappedStatus, latestEvent) {
|
|
3828
|
-
if (
|
|
3852
|
+
if (_chunkX4D52IZKcjs.isFailedEvent.call(void 0, _nullishCoalesce(latestEvent, () => ( void 0)))) {
|
|
3829
3853
|
return ["complete", "complete", "failed", "pending"];
|
|
3830
3854
|
}
|
|
3831
3855
|
if (swappedStatus === "order_cancelled") {
|
|
@@ -4035,7 +4059,7 @@ ExchangeConnectStep.displayName = "ExchangeConnectStep";
|
|
|
4035
4059
|
function ExchangeLogo({ exchange }) {
|
|
4036
4060
|
const [failed, setFailed] = _react.useState.call(void 0, false);
|
|
4037
4061
|
if (!exchange.logoUrl || failed) {
|
|
4038
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4062
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.BankIcon, {});
|
|
4039
4063
|
}
|
|
4040
4064
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4041
4065
|
"img",
|
|
@@ -4116,14 +4140,14 @@ function ExchangeSelectStep({
|
|
|
4116
4140
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen rs-exchange-select", children: [
|
|
4117
4141
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4118
4142
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4119
|
-
|
|
4143
|
+
_chunk3OOY67VJcjs.BodyHeader,
|
|
4120
4144
|
{
|
|
4121
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4145
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.UnplugIcon, {}),
|
|
4122
4146
|
title: "Connect exchange",
|
|
4123
4147
|
subtitle: "Select an exchange to connect"
|
|
4124
4148
|
}
|
|
4125
4149
|
),
|
|
4126
|
-
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4150
|
+
loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.Spinner, {}) }),
|
|
4127
4151
|
!loading && error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-exchange-select-state", "aria-live": "polite", children: [
|
|
4128
4152
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-select-state-title", children: "Couldn\u2019t load exchanges" }),
|
|
4129
4153
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -4149,7 +4173,7 @@ function ExchangeSelectStep({
|
|
|
4149
4173
|
)
|
|
4150
4174
|
] }),
|
|
4151
4175
|
!loading && !error && exchanges.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-exchange-grid", children: exchanges.map((exchange) => {
|
|
4152
|
-
const brand =
|
|
4176
|
+
const brand = _chunkX4D52IZKcjs.getExchangeLogo.call(void 0, exchange.name, exchange.connection);
|
|
4153
4177
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4154
4178
|
"button",
|
|
4155
4179
|
{
|
|
@@ -4174,7 +4198,7 @@ function ExchangeSelectStep({
|
|
|
4174
4198
|
);
|
|
4175
4199
|
}) })
|
|
4176
4200
|
] }),
|
|
4177
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4201
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.PoweredBy, {}),
|
|
4178
4202
|
exchangeFeeBps > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "rs-exchange-select-fee-note", children: [
|
|
4179
4203
|
"A ",
|
|
4180
4204
|
formatFeeRate(exchangeFeeBps),
|
|
@@ -4212,14 +4236,14 @@ function SolanaTokenSelectStep({
|
|
|
4212
4236
|
setError(null);
|
|
4213
4237
|
const portfolioBySymbol = {};
|
|
4214
4238
|
try {
|
|
4215
|
-
|
|
4239
|
+
_chunk3OOY67VJcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
|
|
4216
4240
|
solanaAddress
|
|
4217
4241
|
});
|
|
4218
4242
|
const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
|
|
4219
4243
|
if (!active) return;
|
|
4220
4244
|
for (const t of portfolio.tokens) {
|
|
4221
4245
|
const symbol = t.symbol.toUpperCase();
|
|
4222
|
-
if (!
|
|
4246
|
+
if (!_chunkOY5N3E6Lcjs.SOLANA_TOKENS.some((st) => st.symbol === symbol)) continue;
|
|
4223
4247
|
let parsed = 0n;
|
|
4224
4248
|
try {
|
|
4225
4249
|
parsed = BigInt(t.balance || "0");
|
|
@@ -4235,12 +4259,12 @@ function SolanaTokenSelectStep({
|
|
|
4235
4259
|
};
|
|
4236
4260
|
}
|
|
4237
4261
|
}
|
|
4238
|
-
|
|
4262
|
+
_chunk3OOY67VJcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
|
|
4239
4263
|
symbols: Object.keys(portfolioBySymbol)
|
|
4240
4264
|
});
|
|
4241
4265
|
} catch (err) {
|
|
4242
4266
|
if (!active) return;
|
|
4243
|
-
|
|
4267
|
+
_chunk3OOY67VJcjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
|
|
4244
4268
|
solanaAddress
|
|
4245
4269
|
});
|
|
4246
4270
|
setError(
|
|
@@ -4251,7 +4275,7 @@ function SolanaTokenSelectStep({
|
|
|
4251
4275
|
return;
|
|
4252
4276
|
}
|
|
4253
4277
|
const results = [];
|
|
4254
|
-
for (const token of
|
|
4278
|
+
for (const token of _chunkOY5N3E6Lcjs.SOLANA_TOKENS) {
|
|
4255
4279
|
const fromPortfolio = portfolioBySymbol[token.symbol];
|
|
4256
4280
|
if (fromPortfolio && fromPortfolio.balance > 0n) {
|
|
4257
4281
|
results.push({
|
|
@@ -4287,30 +4311,30 @@ function SolanaTokenSelectStep({
|
|
|
4287
4311
|
const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
|
|
4288
4312
|
const numeric = Number(raw);
|
|
4289
4313
|
if (!Number.isFinite(numeric)) return raw;
|
|
4290
|
-
return
|
|
4314
|
+
return _chunk3OOY67VJcjs.tokenFormatter.format(numeric);
|
|
4291
4315
|
} catch (e27) {
|
|
4292
4316
|
return "--";
|
|
4293
4317
|
}
|
|
4294
4318
|
};
|
|
4295
|
-
const chainIcon =
|
|
4296
|
-
const chainName =
|
|
4319
|
+
const chainIcon = _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, "solana");
|
|
4320
|
+
const chainName = _chunkOY5N3E6Lcjs.getChainName.call(void 0, "solana");
|
|
4297
4321
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
4298
4322
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
4299
4323
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4300
|
-
|
|
4324
|
+
_chunk3OOY67VJcjs.BodyHeader,
|
|
4301
4325
|
{
|
|
4302
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4326
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.WalletIcon, {}),
|
|
4303
4327
|
title: "Your assets",
|
|
4304
4328
|
subtitle: "Select source assets to transfer"
|
|
4305
4329
|
}
|
|
4306
4330
|
),
|
|
4307
4331
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
4308
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4332
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
4309
4333
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
4310
4334
|
] }),
|
|
4311
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4335
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.Callout, { variant: "error", children: error }),
|
|
4312
4336
|
!loading && !error && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
4313
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4337
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.WalletIcon, { className: "rs-empty-icon" }),
|
|
4314
4338
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-empty-text", children: "No funds in connected wallet" }),
|
|
4315
4339
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-address", children: [
|
|
4316
4340
|
solanaAddress.slice(0, 6),
|
|
@@ -4341,13 +4365,13 @@ function SolanaTokenSelectStep({
|
|
|
4341
4365
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
|
|
4342
4366
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-icon-wrapper", children: [
|
|
4343
4367
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4344
|
-
|
|
4368
|
+
_chunk3OOY67VJcjs.TokenIcon,
|
|
4345
4369
|
{
|
|
4346
4370
|
symbol: entry.token.symbol,
|
|
4347
4371
|
fallback: entry.token.symbol.slice(0, 4)
|
|
4348
4372
|
}
|
|
4349
4373
|
) }),
|
|
4350
|
-
chainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4374
|
+
chainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.CdnIcon, { src: chainIcon, alt: chainName }) })
|
|
4351
4375
|
] }),
|
|
4352
4376
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-text", children: [
|
|
4353
4377
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-name-row", children: [
|
|
@@ -4364,14 +4388,14 @@ function SolanaTokenSelectStep({
|
|
|
4364
4388
|
] })
|
|
4365
4389
|
] })
|
|
4366
4390
|
] }),
|
|
4367
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ?
|
|
4391
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunk3OOY67VJcjs.currencyFormatter.format(entry.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${entry.token.symbol}` : "--" })
|
|
4368
4392
|
]
|
|
4369
4393
|
},
|
|
4370
4394
|
entry.token.symbol
|
|
4371
4395
|
);
|
|
4372
4396
|
}) }),
|
|
4373
4397
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4374
|
-
|
|
4398
|
+
_chunk3OOY67VJcjs.Button,
|
|
4375
4399
|
{
|
|
4376
4400
|
onClick: () => selectedEntry && onContinue(
|
|
4377
4401
|
selectedEntry.token,
|
|
@@ -4384,7 +4408,7 @@ function SolanaTokenSelectStep({
|
|
|
4384
4408
|
}
|
|
4385
4409
|
)
|
|
4386
4410
|
] }),
|
|
4387
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4411
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.PoweredBy, {})
|
|
4388
4412
|
] });
|
|
4389
4413
|
}
|
|
4390
4414
|
|
|
@@ -4415,7 +4439,7 @@ function SolanaAmountStep({
|
|
|
4415
4439
|
const [amount, setAmount] = _react.useState.call(void 0, "");
|
|
4416
4440
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
4417
4441
|
const hasAppliedDefaultRef = _react.useRef.call(void 0, false);
|
|
4418
|
-
const isSourceStablecoin =
|
|
4442
|
+
const isSourceStablecoin = _chunkOY5N3E6Lcjs.isStablecoinSymbol.call(void 0, token.symbol);
|
|
4419
4443
|
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess', _202 => _202.trim, 'call', _203 => _203(), 'access', _204 => _204.toLowerCase, 'call', _205 => _205()]) === "max";
|
|
4420
4444
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
4421
4445
|
if (isSourceStablecoin) return 1;
|
|
@@ -4436,7 +4460,7 @@ function SolanaAmountStep({
|
|
|
4436
4460
|
const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
|
|
4437
4461
|
const numeric = Number(raw);
|
|
4438
4462
|
if (!Number.isFinite(numeric)) return raw;
|
|
4439
|
-
return
|
|
4463
|
+
return _chunk3OOY67VJcjs.tokenFormatter.format(numeric);
|
|
4440
4464
|
} catch (e29) {
|
|
4441
4465
|
return "\u2026";
|
|
4442
4466
|
}
|
|
@@ -4453,7 +4477,7 @@ function SolanaAmountStep({
|
|
|
4453
4477
|
}
|
|
4454
4478
|
}, [balance, token.decimals, tokenPriceUsd, balanceUsd]);
|
|
4455
4479
|
const spendableBalance = _react.useMemo.call(void 0, () => {
|
|
4456
|
-
if (!
|
|
4480
|
+
if (!_chunkOY5N3E6Lcjs.isNativeSol.call(void 0, token)) return balance;
|
|
4457
4481
|
return balance > SOL_FEE_RESERVE_LAMPORTS ? balance - SOL_FEE_RESERVE_LAMPORTS : 0n;
|
|
4458
4482
|
}, [balance, token]);
|
|
4459
4483
|
const spendableBalanceUsd = _react.useMemo.call(void 0, () => {
|
|
@@ -4518,7 +4542,7 @@ function SolanaAmountStep({
|
|
|
4518
4542
|
return null;
|
|
4519
4543
|
}
|
|
4520
4544
|
}, [numericAmount, isSourceStablecoin, hasPricing, tokenPriceUsd, token.decimals]);
|
|
4521
|
-
const minDepositUsd =
|
|
4545
|
+
const minDepositUsd = _chunkOY5N3E6Lcjs.isHyperCoreDestination.call(void 0, targetChain) ? Math.max(_chunkOY5N3E6Lcjs.HYPERCORE_MIN_DEPOSIT_USD, _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _206 => _206.minDepositUsd]), () => ( 0))) : _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _207 => _207.minDepositUsd]), () => ( null));
|
|
4522
4546
|
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _208 => _208.maxDepositUsd]), () => ( null));
|
|
4523
4547
|
const isBelowMin = minDepositUsd !== null && numericAmount > 0 && numericAmount < minDepositUsd;
|
|
4524
4548
|
const isAboveMax = maxDepositUsd !== null && numericAmount > maxDepositUsd;
|
|
@@ -4529,7 +4553,7 @@ function SolanaAmountStep({
|
|
|
4529
4553
|
const handlePresetClick = (percentage) => {
|
|
4530
4554
|
const formatted = computePresetAmount(percentage);
|
|
4531
4555
|
if (!formatted) return;
|
|
4532
|
-
|
|
4556
|
+
_chunk3OOY67VJcjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
|
|
4533
4557
|
percentage,
|
|
4534
4558
|
symbol: token.symbol,
|
|
4535
4559
|
formatted
|
|
@@ -4564,7 +4588,7 @@ function SolanaAmountStep({
|
|
|
4564
4588
|
try {
|
|
4565
4589
|
amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
|
|
4566
4590
|
} catch (e34) {
|
|
4567
|
-
|
|
4591
|
+
_chunk3OOY67VJcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
4568
4592
|
amount,
|
|
4569
4593
|
sourceAmount: sourceAmountStr,
|
|
4570
4594
|
reason: "parse-units-failed"
|
|
@@ -4573,13 +4597,13 @@ function SolanaAmountStep({
|
|
|
4573
4597
|
return;
|
|
4574
4598
|
}
|
|
4575
4599
|
if (amountInUnits > spendableBalance) {
|
|
4576
|
-
const isReserveIssue =
|
|
4600
|
+
const isReserveIssue = _chunkOY5N3E6Lcjs.isNativeSol.call(void 0, token) && amountInUnits <= balance;
|
|
4577
4601
|
setError(
|
|
4578
4602
|
isReserveIssue ? "Use a bit less than your full SOL balance" : "Insufficient balance"
|
|
4579
4603
|
);
|
|
4580
4604
|
return;
|
|
4581
4605
|
}
|
|
4582
|
-
|
|
4606
|
+
_chunk3OOY67VJcjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
|
|
4583
4607
|
symbol: token.symbol,
|
|
4584
4608
|
inputAmountUsd: amount,
|
|
4585
4609
|
sourceAmount: sourceAmountStr,
|
|
@@ -4592,7 +4616,7 @@ function SolanaAmountStep({
|
|
|
4592
4616
|
const continueDisabled = exceedsBalance || numericAmount === 0 && !isBelowMin;
|
|
4593
4617
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
4594
4618
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4595
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4619
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.WalletIcon, {}), title: "Wallet deposit" }),
|
|
4596
4620
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-section", children: [
|
|
4597
4621
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-display", children: [
|
|
4598
4622
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -4612,13 +4636,13 @@ function SolanaAmountStep({
|
|
|
4612
4636
|
" available",
|
|
4613
4637
|
computedBalanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
4614
4638
|
" (~",
|
|
4615
|
-
|
|
4639
|
+
_chunk3OOY67VJcjs.currencyFormatter.format(computedBalanceUsd),
|
|
4616
4640
|
")"
|
|
4617
4641
|
] })
|
|
4618
4642
|
] }),
|
|
4619
4643
|
minDepositUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-meta-minimum", children: [
|
|
4620
4644
|
"Min. deposit ",
|
|
4621
|
-
|
|
4645
|
+
_chunk3OOY67VJcjs.currencyFormatter.format(minDepositUsd)
|
|
4622
4646
|
] })
|
|
4623
4647
|
] })
|
|
4624
4648
|
] }),
|
|
@@ -4641,7 +4665,7 @@ function SolanaAmountStep({
|
|
|
4641
4665
|
"Solana ",
|
|
4642
4666
|
token.symbol
|
|
4643
4667
|
] }),
|
|
4644
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4668
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.TokenIcon, { symbol: token.symbol }) })
|
|
4645
4669
|
] })
|
|
4646
4670
|
] }),
|
|
4647
4671
|
targetChainName && targetTokenSymbol && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
@@ -4652,17 +4676,17 @@ function SolanaAmountStep({
|
|
|
4652
4676
|
" ",
|
|
4653
4677
|
targetTokenSymbol
|
|
4654
4678
|
] }),
|
|
4655
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4679
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.TokenIcon, { symbol: targetTokenSymbol }) })
|
|
4656
4680
|
] })
|
|
4657
4681
|
] }),
|
|
4658
4682
|
balanceAfterUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
4659
4683
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Balance after deposit" }),
|
|
4660
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children:
|
|
4684
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-value", children: _chunk3OOY67VJcjs.currencyFormatter.format(balanceAfterUsd) })
|
|
4661
4685
|
] })
|
|
4662
4686
|
] }),
|
|
4663
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4687
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.Callout, { variant: "error", children: error }),
|
|
4664
4688
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4665
|
-
|
|
4689
|
+
_chunk3OOY67VJcjs.Button,
|
|
4666
4690
|
{
|
|
4667
4691
|
onClick: handleContinue,
|
|
4668
4692
|
fullWidth: true,
|
|
@@ -4671,7 +4695,7 @@ function SolanaAmountStep({
|
|
|
4671
4695
|
}
|
|
4672
4696
|
)
|
|
4673
4697
|
] }),
|
|
4674
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4698
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.PoweredBy, {})
|
|
4675
4699
|
] });
|
|
4676
4700
|
}
|
|
4677
4701
|
|
|
@@ -4680,40 +4704,41 @@ function SolanaAmountStep({
|
|
|
4680
4704
|
|
|
4681
4705
|
|
|
4682
4706
|
// src/core/solana.ts
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
var _web3js = require('@solana/web3.js');
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
var _spltoken = require('@solana/spl-token');
|
|
4694
4707
|
var DEFAULT_SOLANA_RPC_URL = "https://api.mainnet.solana.com";
|
|
4695
4708
|
var cachedConnections = /* @__PURE__ */ new Map();
|
|
4709
|
+
var dependenciesPromise2;
|
|
4710
|
+
function loadSolanaDependencies() {
|
|
4711
|
+
_nullishCoalesce(dependenciesPromise2, () => ( (dependenciesPromise2 = Promise.all([
|
|
4712
|
+
Promise.resolve().then(() => _interopRequireWildcard(require("@solana/web3.js"))),
|
|
4713
|
+
Promise.resolve().then(() => _interopRequireWildcard(require("@solana/spl-token")))
|
|
4714
|
+
]))));
|
|
4715
|
+
return dependenciesPromise2;
|
|
4716
|
+
}
|
|
4696
4717
|
function getSolanaRpcUrl(rpcUrls) {
|
|
4697
|
-
return _nullishCoalesce(
|
|
4718
|
+
return _nullishCoalesce(_chunk3OOY67VJcjs.rpcUrlFor.call(void 0, rpcUrls, "solana"), () => ( DEFAULT_SOLANA_RPC_URL));
|
|
4698
4719
|
}
|
|
4699
4720
|
function hasConfiguredSolanaRpcUrl(rpcUrls) {
|
|
4700
|
-
return
|
|
4721
|
+
return _chunk3OOY67VJcjs.rpcUrlFor.call(void 0, rpcUrls, "solana") !== void 0;
|
|
4701
4722
|
}
|
|
4702
|
-
function getSolanaConnection(rpcUrls) {
|
|
4723
|
+
async function getSolanaConnection(rpcUrls) {
|
|
4703
4724
|
const rpcUrl = getSolanaRpcUrl(rpcUrls);
|
|
4704
4725
|
const cached = cachedConnections.get(rpcUrl);
|
|
4705
4726
|
if (cached) {
|
|
4706
4727
|
return cached;
|
|
4707
4728
|
}
|
|
4708
|
-
const
|
|
4729
|
+
const [web3] = await loadSolanaDependencies();
|
|
4730
|
+
const initialized = cachedConnections.get(rpcUrl);
|
|
4731
|
+
if (initialized) return initialized;
|
|
4732
|
+
const next = new web3.Connection(rpcUrl, "confirmed");
|
|
4709
4733
|
cachedConnections.set(rpcUrl, next);
|
|
4710
4734
|
return next;
|
|
4711
4735
|
}
|
|
4712
4736
|
async function buildSolTransferTransaction(connection, from, to, lamports) {
|
|
4713
|
-
const
|
|
4714
|
-
const
|
|
4715
|
-
const
|
|
4716
|
-
|
|
4737
|
+
const [web3] = await loadSolanaDependencies();
|
|
4738
|
+
const fromPubkey = new web3.PublicKey(from);
|
|
4739
|
+
const toPubkey = new web3.PublicKey(to);
|
|
4740
|
+
const tx = new web3.Transaction().add(
|
|
4741
|
+
web3.SystemProgram.transfer({
|
|
4717
4742
|
fromPubkey,
|
|
4718
4743
|
toPubkey,
|
|
4719
4744
|
lamports
|
|
@@ -4726,16 +4751,24 @@ async function buildSolTransferTransaction(connection, from, to, lamports) {
|
|
|
4726
4751
|
return tx;
|
|
4727
4752
|
}
|
|
4728
4753
|
async function buildSplTransferTransaction(connection, from, to, mint, amount) {
|
|
4729
|
-
const
|
|
4730
|
-
const
|
|
4731
|
-
const
|
|
4732
|
-
const
|
|
4733
|
-
const
|
|
4734
|
-
|
|
4754
|
+
const [web3, splToken] = await loadSolanaDependencies();
|
|
4755
|
+
const fromPubkey = new web3.PublicKey(from);
|
|
4756
|
+
const toPubkey = new web3.PublicKey(to);
|
|
4757
|
+
const mintPubkey = new web3.PublicKey(mint);
|
|
4758
|
+
const fromAta = await splToken.getAssociatedTokenAddress(
|
|
4759
|
+
mintPubkey,
|
|
4760
|
+
fromPubkey
|
|
4761
|
+
);
|
|
4762
|
+
const toAta = await splToken.getAssociatedTokenAddress(
|
|
4763
|
+
mintPubkey,
|
|
4764
|
+
toPubkey,
|
|
4765
|
+
true
|
|
4766
|
+
);
|
|
4767
|
+
const tx = new web3.Transaction();
|
|
4735
4768
|
const toAtaInfo = await connection.getAccountInfo(toAta);
|
|
4736
4769
|
if (!toAtaInfo) {
|
|
4737
4770
|
tx.add(
|
|
4738
|
-
|
|
4771
|
+
splToken.createAssociatedTokenAccountInstruction(
|
|
4739
4772
|
fromPubkey,
|
|
4740
4773
|
toAta,
|
|
4741
4774
|
toPubkey,
|
|
@@ -4743,7 +4776,9 @@ async function buildSplTransferTransaction(connection, from, to, mint, amount) {
|
|
|
4743
4776
|
)
|
|
4744
4777
|
);
|
|
4745
4778
|
}
|
|
4746
|
-
tx.add(
|
|
4779
|
+
tx.add(
|
|
4780
|
+
splToken.createTransferInstruction(fromAta, toAta, fromPubkey, amount)
|
|
4781
|
+
);
|
|
4747
4782
|
const { blockhash, lastValidBlockHeight } = await connection.getLatestBlockhash();
|
|
4748
4783
|
tx.recentBlockhash = blockhash;
|
|
4749
4784
|
tx.lastValidBlockHeight = lastValidBlockHeight;
|
|
@@ -4797,39 +4832,46 @@ function SolanaConfirmStep({
|
|
|
4797
4832
|
estimatedTime = "< 1 min",
|
|
4798
4833
|
onConfirm,
|
|
4799
4834
|
onError,
|
|
4835
|
+
onSubmittingChange,
|
|
4800
4836
|
debug
|
|
4801
4837
|
}) {
|
|
4802
|
-
const rpcUrls =
|
|
4838
|
+
const rpcUrls = _chunk3OOY67VJcjs.useRpcUrls.call(void 0, );
|
|
4803
4839
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
4804
4840
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
4805
|
-
const
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
const
|
|
4812
|
-
const
|
|
4813
|
-
const
|
|
4841
|
+
const onSubmittingChangeRef = _react.useRef.call(void 0, onSubmittingChange);
|
|
4842
|
+
onSubmittingChangeRef.current = onSubmittingChange;
|
|
4843
|
+
_react.useEffect.call(void 0, () => {
|
|
4844
|
+
_optionalChain([onSubmittingChangeRef, 'access', _209 => _209.current, 'optionalCall', _210 => _210(isSubmitting)]);
|
|
4845
|
+
return () => _optionalChain([onSubmittingChangeRef, 'access', _211 => _211.current, 'optionalCall', _212 => _212(false)]);
|
|
4846
|
+
}, [isSubmitting]);
|
|
4847
|
+
const targetChainId = _chunkOY5N3E6Lcjs.targetChainToChainId.call(void 0, targetChain);
|
|
4848
|
+
const targetSymbol = _chunkOY5N3E6Lcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
4849
|
+
const sourceChainName = _chunkOY5N3E6Lcjs.getChainName.call(void 0, "solana");
|
|
4850
|
+
const targetChainName = _chunkOY5N3E6Lcjs.getChainName.call(void 0, targetChainId);
|
|
4851
|
+
const sourceChainIcon = _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, "solana");
|
|
4852
|
+
const targetChainIcon = _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, targetChainId);
|
|
4853
|
+
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _213 => _213.feeSponsored]), () => ( false));
|
|
4854
|
+
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _214 => _214.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
4855
|
+
const formattedAmount = sourceAmount && Number.isFinite(Number(sourceAmount)) ? _nullishCoalesce(_chunk3OOY67VJcjs.formatTokenAmount.call(void 0, Number(sourceAmount), token.symbol), () => ( "0")) : "0";
|
|
4814
4856
|
const receiveDisplay = (() => {
|
|
4815
4857
|
const usdValue = Number(targetAmount);
|
|
4816
4858
|
const sourceAmountUsd = Number.isFinite(usdValue) && usdValue > 0 ? usdValue : void 0;
|
|
4817
|
-
const estimate =
|
|
4859
|
+
const estimate = _chunk3OOY67VJcjs.formatReceiveEstimate.call(void 0, {
|
|
4818
4860
|
sourceAmount: Number.isFinite(Number(sourceAmount)) ? Number(sourceAmount) : void 0,
|
|
4819
4861
|
sourceSymbol: token.symbol,
|
|
4820
4862
|
targetSymbol,
|
|
4821
4863
|
sourceAmountUsd,
|
|
4822
|
-
sourceTrusted:
|
|
4864
|
+
sourceTrusted: _chunk3OOY67VJcjs.isRecognizedToken.call(void 0, token.mint, "solana"),
|
|
4823
4865
|
// Curated stablecoin target estimates at $1 when unquoted; never applied
|
|
4824
4866
|
// to the source (a held token). See ConfirmStep for the rationale.
|
|
4825
|
-
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } :
|
|
4867
|
+
prices: targetTokenPriceUsd !== null && targetTokenPriceUsd > 0 ? { [targetSymbol.toUpperCase()]: targetTokenPriceUsd } : _chunk3OOY67VJcjs.isDisplayStablecoinSymbol.call(void 0, targetSymbol) ? { [targetSymbol.toUpperCase()]: 1 } : {}
|
|
4826
4868
|
});
|
|
4827
4869
|
if (estimate !== void 0) return estimate;
|
|
4828
4870
|
return targetSymbol;
|
|
4829
4871
|
})();
|
|
4830
4872
|
const handleConfirm = async () => {
|
|
4831
4873
|
if (!solanaProvider) {
|
|
4832
|
-
|
|
4874
|
+
_chunk3OOY67VJcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
4833
4875
|
reason: "missing-provider"
|
|
4834
4876
|
});
|
|
4835
4877
|
setError("Solana wallet not connected");
|
|
@@ -4837,7 +4879,7 @@ function SolanaConfirmStep({
|
|
|
4837
4879
|
}
|
|
4838
4880
|
const parsedAmount = parseFloat(sourceAmount);
|
|
4839
4881
|
if (isNaN(parsedAmount) || parsedAmount <= 0) {
|
|
4840
|
-
|
|
4882
|
+
_chunk3OOY67VJcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
4841
4883
|
reason: "invalid-amount",
|
|
4842
4884
|
sourceAmount
|
|
4843
4885
|
});
|
|
@@ -4846,7 +4888,7 @@ function SolanaConfirmStep({
|
|
|
4846
4888
|
}
|
|
4847
4889
|
setError(null);
|
|
4848
4890
|
setIsSubmitting(true);
|
|
4849
|
-
|
|
4891
|
+
_chunk3OOY67VJcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
|
|
4850
4892
|
smartAccount,
|
|
4851
4893
|
solanaAddress,
|
|
4852
4894
|
solanaDepositAddress,
|
|
@@ -4856,7 +4898,7 @@ function SolanaConfirmStep({
|
|
|
4856
4898
|
});
|
|
4857
4899
|
try {
|
|
4858
4900
|
const check = await service.checkAccount(smartAccount);
|
|
4859
|
-
|
|
4901
|
+
_chunk3OOY67VJcjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
|
|
4860
4902
|
smartAccount,
|
|
4861
4903
|
isRegistered: check.isRegistered,
|
|
4862
4904
|
targetChain: check.targetChain,
|
|
@@ -4867,14 +4909,14 @@ function SolanaConfirmStep({
|
|
|
4867
4909
|
"Deposit account is not registered yet. Please restart setup and try again."
|
|
4868
4910
|
);
|
|
4869
4911
|
}
|
|
4870
|
-
const connection = hasConfiguredSolanaRpcUrl(rpcUrls) ? getSolanaConnection(rpcUrls) : _nullishCoalesce(solanaConnection, () => ( getSolanaConnection(rpcUrls)));
|
|
4912
|
+
const connection = await (hasConfiguredSolanaRpcUrl(rpcUrls) ? getSolanaConnection(rpcUrls) : _nullishCoalesce(solanaConnection, () => ( getSolanaConnection(rpcUrls))));
|
|
4871
4913
|
const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
|
|
4872
|
-
|
|
4914
|
+
_chunk3OOY67VJcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
|
|
4873
4915
|
token: token.symbol,
|
|
4874
4916
|
sourceAmount,
|
|
4875
4917
|
amountUnits: amountUnits.toString()
|
|
4876
4918
|
});
|
|
4877
|
-
const transaction =
|
|
4919
|
+
const transaction = _chunkOY5N3E6Lcjs.isNativeSol.call(void 0, token) ? await buildSolTransferTransaction(
|
|
4878
4920
|
connection,
|
|
4879
4921
|
solanaAddress,
|
|
4880
4922
|
solanaDepositAddress,
|
|
@@ -4886,10 +4928,10 @@ function SolanaConfirmStep({
|
|
|
4886
4928
|
token.mint,
|
|
4887
4929
|
amountUnits
|
|
4888
4930
|
);
|
|
4889
|
-
|
|
4931
|
+
_chunk3OOY67VJcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
4890
4932
|
token: token.symbol,
|
|
4891
4933
|
instructionCount: transaction.instructions.length,
|
|
4892
|
-
feePayer: _optionalChain([transaction, 'access',
|
|
4934
|
+
feePayer: _optionalChain([transaction, 'access', _215 => _215.feePayer, 'optionalAccess', _216 => _216.toBase58, 'call', _217 => _217()]),
|
|
4893
4935
|
recentBlockhash: transaction.recentBlockhash
|
|
4894
4936
|
});
|
|
4895
4937
|
const txHash = await sendSolanaTransaction(
|
|
@@ -4897,7 +4939,7 @@ function SolanaConfirmStep({
|
|
|
4897
4939
|
connection,
|
|
4898
4940
|
transaction
|
|
4899
4941
|
);
|
|
4900
|
-
|
|
4942
|
+
_chunk3OOY67VJcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
|
|
4901
4943
|
txHash,
|
|
4902
4944
|
amountUnits: amountUnits.toString()
|
|
4903
4945
|
});
|
|
@@ -4909,21 +4951,21 @@ function SolanaConfirmStep({
|
|
|
4909
4951
|
});
|
|
4910
4952
|
} catch (err) {
|
|
4911
4953
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
4912
|
-
const message =
|
|
4913
|
-
|
|
4954
|
+
const message = _chunk3OOY67VJcjs.formatUserError.call(void 0, raw);
|
|
4955
|
+
_chunk3OOY67VJcjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
|
|
4914
4956
|
smartAccount,
|
|
4915
4957
|
token: token.symbol,
|
|
4916
4958
|
sourceAmount
|
|
4917
4959
|
});
|
|
4918
4960
|
setError(message);
|
|
4919
|
-
_optionalChain([onError, 'optionalCall',
|
|
4961
|
+
_optionalChain([onError, 'optionalCall', _218 => _218(message, "SOLANA_TRANSFER_ERROR", raw)]);
|
|
4920
4962
|
} finally {
|
|
4921
4963
|
setIsSubmitting(false);
|
|
4922
4964
|
}
|
|
4923
4965
|
};
|
|
4924
4966
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
4925
4967
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4926
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4968
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.WalletIcon, {}), title: "Review deposit" }),
|
|
4927
4969
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4928
4970
|
ReviewDetails,
|
|
4929
4971
|
{
|
|
@@ -4939,9 +4981,9 @@ function SolanaConfirmStep({
|
|
|
4939
4981
|
fee: { display: "$0.04", struck: feeSponsored, tooltip: feeTooltip }
|
|
4940
4982
|
}
|
|
4941
4983
|
),
|
|
4942
|
-
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4984
|
+
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.Callout, { variant: "error", children: error }),
|
|
4943
4985
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4944
|
-
|
|
4986
|
+
_chunk3OOY67VJcjs.Button,
|
|
4945
4987
|
{
|
|
4946
4988
|
onClick: handleConfirm,
|
|
4947
4989
|
loading: isSubmitting,
|
|
@@ -4952,7 +4994,7 @@ function SolanaConfirmStep({
|
|
|
4952
4994
|
}
|
|
4953
4995
|
)
|
|
4954
4996
|
] }),
|
|
4955
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4997
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.PoweredBy, {})
|
|
4956
4998
|
] });
|
|
4957
4999
|
}
|
|
4958
5000
|
|
|
@@ -4967,22 +5009,22 @@ function DappImportAssetSelectStep({
|
|
|
4967
5009
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
4968
5010
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
4969
5011
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4970
|
-
|
|
5012
|
+
_chunk3OOY67VJcjs.BodyHeader,
|
|
4971
5013
|
{
|
|
4972
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5014
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.WalletIcon, {}),
|
|
4973
5015
|
title: `Transfer from ${sourceLabel}`,
|
|
4974
5016
|
subtitle: "Pick the balance to import"
|
|
4975
5017
|
}
|
|
4976
5018
|
),
|
|
4977
5019
|
incompleteSummary && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-notice", role: "status", children: incompleteSummary }),
|
|
4978
5020
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: assets.map((asset) => {
|
|
4979
|
-
const tokenAmount = asset.balance ?
|
|
5021
|
+
const tokenAmount = asset.balance ? _chunk3OOY67VJcjs.tokenFormatter.format(
|
|
4980
5022
|
Number(asset.balance) / 10 ** asset.decimals
|
|
4981
5023
|
) : "0";
|
|
4982
|
-
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ?
|
|
5024
|
+
const balanceUsd = asset.balanceUsd && asset.balanceUsd > 0 ? _chunk3OOY67VJcjs.currencyFormatter.format(asset.balanceUsd) : `${tokenAmount} ${asset.symbol}`;
|
|
4983
5025
|
const assetIcon = asset.icon;
|
|
4984
|
-
const chainIcon =
|
|
4985
|
-
const badge =
|
|
5026
|
+
const chainIcon = _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, asset.chainId);
|
|
5027
|
+
const badge = _chunkOY5N3E6Lcjs.getChainBadge.call(void 0, asset.chainId);
|
|
4986
5028
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4987
5029
|
"button",
|
|
4988
5030
|
{
|
|
@@ -4992,14 +5034,14 @@ function DappImportAssetSelectStep({
|
|
|
4992
5034
|
children: [
|
|
4993
5035
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-info", children: [
|
|
4994
5036
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-icon-wrapper", children: [
|
|
4995
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: assetIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4996
|
-
|
|
5037
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-icon", children: assetIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.CdnIcon, { src: assetIcon, alt: asset.symbol }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5038
|
+
_chunk3OOY67VJcjs.TokenIcon,
|
|
4997
5039
|
{
|
|
4998
5040
|
symbol: asset.symbol,
|
|
4999
5041
|
fallback: asset.symbol.slice(0, 4)
|
|
5000
5042
|
}
|
|
5001
5043
|
) }),
|
|
5002
|
-
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5044
|
+
chainIcon ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-asset-chain-badge", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.CdnIcon, { src: chainIcon, alt: _chunkOY5N3E6Lcjs.getChainName.call(void 0, asset.chainId) }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5003
5045
|
"span",
|
|
5004
5046
|
{
|
|
5005
5047
|
className: "rs-asset-chain-badge",
|
|
@@ -5031,7 +5073,7 @@ function DappImportAssetSelectStep({
|
|
|
5031
5073
|
);
|
|
5032
5074
|
}) })
|
|
5033
5075
|
] }),
|
|
5034
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5076
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.PoweredBy, {})
|
|
5035
5077
|
] });
|
|
5036
5078
|
}
|
|
5037
5079
|
DappImportAssetSelectStep.displayName = "DappImportAssetSelectStep";
|
|
@@ -5053,7 +5095,7 @@ function describeRow(status, comingSoon) {
|
|
|
5053
5095
|
}
|
|
5054
5096
|
if (status.enabled) {
|
|
5055
5097
|
return {
|
|
5056
|
-
subtitle: status.balanceUsd > 0 ?
|
|
5098
|
+
subtitle: status.balanceUsd > 0 ? _chunk3OOY67VJcjs.currencyFormatter.format(status.balanceUsd) : "No balance",
|
|
5057
5099
|
disabled: false,
|
|
5058
5100
|
busy: false
|
|
5059
5101
|
};
|
|
@@ -5076,9 +5118,9 @@ function DappImportSelectStep({
|
|
|
5076
5118
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
|
|
5077
5119
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
5078
5120
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5079
|
-
|
|
5121
|
+
_chunk3OOY67VJcjs.BodyHeader,
|
|
5080
5122
|
{
|
|
5081
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5123
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.MigrateAssetsIcon, {}),
|
|
5082
5124
|
title: "Migrate assets",
|
|
5083
5125
|
subtitle: "Select a position to migrate"
|
|
5084
5126
|
}
|
|
@@ -5090,16 +5132,16 @@ function DappImportSelectStep({
|
|
|
5090
5132
|
Boolean(brand.comingSoon)
|
|
5091
5133
|
);
|
|
5092
5134
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5093
|
-
|
|
5135
|
+
_chunk3OOY67VJcjs.ListRow,
|
|
5094
5136
|
{
|
|
5095
5137
|
leadingMedia: brand.iconUrl,
|
|
5096
5138
|
title: brand.label,
|
|
5097
5139
|
subtitle,
|
|
5098
5140
|
disabled,
|
|
5099
|
-
trailing: busy ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5141
|
+
trailing: busy ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.Spinner, { className: "rs-spinner--sm" }) : void 0,
|
|
5100
5142
|
onClick: () => {
|
|
5101
5143
|
if (status === "needs-connect") {
|
|
5102
|
-
_optionalChain([onRequestConnect, 'optionalCall',
|
|
5144
|
+
_optionalChain([onRequestConnect, 'optionalCall', _219 => _219()]);
|
|
5103
5145
|
return;
|
|
5104
5146
|
}
|
|
5105
5147
|
onSelect(brand.id);
|
|
@@ -5109,7 +5151,7 @@ function DappImportSelectStep({
|
|
|
5109
5151
|
);
|
|
5110
5152
|
}) })
|
|
5111
5153
|
] }),
|
|
5112
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5154
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.PoweredBy, {})
|
|
5113
5155
|
] });
|
|
5114
5156
|
}
|
|
5115
5157
|
DappImportSelectStep.displayName = "DappImportSelectStep";
|
|
@@ -5126,9 +5168,9 @@ function DappImportAssetSelectSkeleton({
|
|
|
5126
5168
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: error ? "Couldn't load balances" : "Loading balances\u2026" }),
|
|
5127
5169
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
|
|
5128
5170
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5129
|
-
|
|
5171
|
+
_chunk3OOY67VJcjs.BodyHeader,
|
|
5130
5172
|
{
|
|
5131
|
-
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5173
|
+
icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.WalletIcon, {}),
|
|
5132
5174
|
title: `Transfer from ${sourceLabel}`,
|
|
5133
5175
|
subtitle: "Pick the balance to import"
|
|
5134
5176
|
}
|
|
@@ -5166,7 +5208,7 @@ function DappImportAssetSelectSkeleton({
|
|
|
5166
5208
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Try again" })
|
|
5167
5209
|
}
|
|
5168
5210
|
) }),
|
|
5169
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5211
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.PoweredBy, {})
|
|
5170
5212
|
] });
|
|
5171
5213
|
}
|
|
5172
5214
|
DappImportAssetSelectSkeleton.displayName = "DappImportAssetSelectSkeleton";
|
|
@@ -5255,7 +5297,7 @@ var aaveProvider = {
|
|
|
5255
5297
|
throw new Error("Aave positions require a backend connection");
|
|
5256
5298
|
}
|
|
5257
5299
|
const response = await backend.getPositions(eoa);
|
|
5258
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
5300
|
+
if (_optionalChain([signal, 'optionalAccess', _220 => _220.aborted])) return null;
|
|
5259
5301
|
const assets = toImportableAssets(response.positions);
|
|
5260
5302
|
const failures = _nullishCoalesce(response.failures, () => ( []));
|
|
5261
5303
|
if (assets.length === 0) {
|
|
@@ -5342,9 +5384,9 @@ var aaveProvider = {
|
|
|
5342
5384
|
function toImportableAssets(positions) {
|
|
5343
5385
|
const assets = [];
|
|
5344
5386
|
for (const position of positions) {
|
|
5345
|
-
const chainId =
|
|
5387
|
+
const chainId = _chunkOY5N3E6Lcjs.parseEvmChainId.call(void 0, position.chain);
|
|
5346
5388
|
if (chainId === null) continue;
|
|
5347
|
-
if (!
|
|
5389
|
+
if (!_chunkOY5N3E6Lcjs.SUPPORTED_CHAIN_IDS.includes(chainId)) continue;
|
|
5348
5390
|
if (BigInt(position.maxWithdrawable) <= 0n) continue;
|
|
5349
5391
|
if (position.constraints.some((c) => POLICY_REFUSED.includes(c))) continue;
|
|
5350
5392
|
assets.push(buildAsset(position, chainId));
|
|
@@ -5458,11 +5500,11 @@ async function detectPolymarketWalletKind(params) {
|
|
|
5458
5500
|
const { publicClient, proxyWallet, eoa } = params;
|
|
5459
5501
|
const results = await publicClient.multicall({
|
|
5460
5502
|
allowFailure: true,
|
|
5461
|
-
multicallAddress:
|
|
5503
|
+
multicallAddress: _chunkLVCD6RHFcjs.MULTICALL3_ADDRESS,
|
|
5462
5504
|
contracts: [
|
|
5463
5505
|
{
|
|
5464
5506
|
address: proxyWallet,
|
|
5465
|
-
abi:
|
|
5507
|
+
abi: _chunkLVCD6RHFcjs.SAFE_ABI,
|
|
5466
5508
|
functionName: "isOwner",
|
|
5467
5509
|
args: [eoa]
|
|
5468
5510
|
},
|
|
@@ -5495,7 +5537,7 @@ async function buildSignedDepositWalletBatch(params) {
|
|
|
5495
5537
|
if (!account || !chain) {
|
|
5496
5538
|
throw new Error("Wallet not connected");
|
|
5497
5539
|
}
|
|
5498
|
-
if (chain.id !==
|
|
5540
|
+
if (chain.id !== _chunkLVCD6RHFcjs.POLYMARKET_POLYGON_CHAIN_ID) {
|
|
5499
5541
|
throw new Error("Switch to Polygon to sign");
|
|
5500
5542
|
}
|
|
5501
5543
|
const owner = await publicClient.readContract({
|
|
@@ -5540,14 +5582,14 @@ async function buildSignedDepositWalletBatch(params) {
|
|
|
5540
5582
|
})),
|
|
5541
5583
|
signature
|
|
5542
5584
|
},
|
|
5543
|
-
sourceToken:
|
|
5585
|
+
sourceToken: _chunkLVCD6RHFcjs.POLYMARKET_USDCE_ADDRESS,
|
|
5544
5586
|
sourceSymbol: tokenKind === "pusd" ? "pUSD" : "USDC.e"
|
|
5545
5587
|
};
|
|
5546
5588
|
}
|
|
5547
5589
|
function buildUsdceTransferCalls(recipient, amount) {
|
|
5548
5590
|
return [
|
|
5549
5591
|
{
|
|
5550
|
-
target:
|
|
5592
|
+
target: _chunkLVCD6RHFcjs.POLYMARKET_USDCE_ADDRESS,
|
|
5551
5593
|
value: 0n,
|
|
5552
5594
|
data: _viem.encodeFunctionData.call(void 0, {
|
|
5553
5595
|
abi: _viem.erc20Abi,
|
|
@@ -5560,21 +5602,21 @@ function buildUsdceTransferCalls(recipient, amount) {
|
|
|
5560
5602
|
function buildPusdUnwrapCalls(recipient, amount) {
|
|
5561
5603
|
return [
|
|
5562
5604
|
{
|
|
5563
|
-
target:
|
|
5605
|
+
target: _chunkLVCD6RHFcjs.POLYMARKET_PUSD_ADDRESS,
|
|
5564
5606
|
value: 0n,
|
|
5565
5607
|
data: _viem.encodeFunctionData.call(void 0, {
|
|
5566
5608
|
abi: _viem.erc20Abi,
|
|
5567
5609
|
functionName: "approve",
|
|
5568
|
-
args: [
|
|
5610
|
+
args: [_chunkLVCD6RHFcjs.POLYMARKET_COLLATERAL_OFFRAMP_ADDRESS, amount]
|
|
5569
5611
|
})
|
|
5570
5612
|
},
|
|
5571
5613
|
{
|
|
5572
|
-
target:
|
|
5614
|
+
target: _chunkLVCD6RHFcjs.POLYMARKET_COLLATERAL_OFFRAMP_ADDRESS,
|
|
5573
5615
|
value: 0n,
|
|
5574
5616
|
data: _viem.encodeFunctionData.call(void 0, {
|
|
5575
5617
|
abi: COLLATERAL_OFFRAMP_ABI,
|
|
5576
5618
|
functionName: "unwrap",
|
|
5577
|
-
args: [
|
|
5619
|
+
args: [_chunkLVCD6RHFcjs.POLYMARKET_USDCE_ADDRESS, recipient, amount]
|
|
5578
5620
|
})
|
|
5579
5621
|
}
|
|
5580
5622
|
];
|
|
@@ -5586,23 +5628,23 @@ var polymarketProvider = {
|
|
|
5586
5628
|
id: PROVIDER_ID2,
|
|
5587
5629
|
sourceLabel: "Polymarket",
|
|
5588
5630
|
async fetchAvailability({ eoa, getPublicClient: getPublicClient2, signal }) {
|
|
5589
|
-
const proxyWallet = await
|
|
5631
|
+
const proxyWallet = await _chunkLVCD6RHFcjs.fetchPolymarketProxyWallet.call(void 0, eoa, signal);
|
|
5590
5632
|
if (!proxyWallet) return null;
|
|
5591
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
5592
|
-
const polygonClient = getPublicClient2(
|
|
5633
|
+
if (_optionalChain([signal, 'optionalAccess', _221 => _221.aborted])) return null;
|
|
5634
|
+
const polygonClient = getPublicClient2(_chunkLVCD6RHFcjs.POLYMARKET_POLYGON_CHAIN_ID);
|
|
5593
5635
|
if (!polygonClient) return null;
|
|
5594
|
-
const balances = await
|
|
5636
|
+
const balances = await _chunkLVCD6RHFcjs.readPolymarketBalances.call(void 0, {
|
|
5595
5637
|
publicClient: polygonClient,
|
|
5596
5638
|
proxyWallet
|
|
5597
5639
|
});
|
|
5598
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
5640
|
+
if (_optionalChain([signal, 'optionalAccess', _222 => _222.aborted])) return null;
|
|
5599
5641
|
if (balances.pusd === 0n && balances.usdce === 0n) return null;
|
|
5600
5642
|
const walletKind = await detectPolymarketWalletKind({
|
|
5601
5643
|
publicClient: polygonClient,
|
|
5602
5644
|
proxyWallet,
|
|
5603
5645
|
eoa
|
|
5604
5646
|
});
|
|
5605
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
5647
|
+
if (_optionalChain([signal, 'optionalAccess', _223 => _223.aborted])) return null;
|
|
5606
5648
|
if (!walletKind) return null;
|
|
5607
5649
|
const assets = [];
|
|
5608
5650
|
if (balances.pusd > 0n) {
|
|
@@ -5649,7 +5691,7 @@ var polymarketProvider = {
|
|
|
5649
5691
|
const { txHash } = await backend.submitPolymarketWithdraw(payload);
|
|
5650
5692
|
return { txHash, sourceToken, sourceSymbol, sourceDecimals: 6 };
|
|
5651
5693
|
}
|
|
5652
|
-
const result = await
|
|
5694
|
+
const result = await _chunkLVCD6RHFcjs.executePolymarketSafeTransfer.call(void 0, {
|
|
5653
5695
|
walletClient,
|
|
5654
5696
|
publicClient,
|
|
5655
5697
|
safeAddress: metadata.proxyWallet,
|
|
@@ -5668,17 +5710,17 @@ var polymarketProvider = {
|
|
|
5668
5710
|
function buildAsset2(params) {
|
|
5669
5711
|
const { tokenKind, proxyWallet, walletKind, balance } = params;
|
|
5670
5712
|
const isPusd = tokenKind === "pusd";
|
|
5671
|
-
const tokenAddress = isPusd ?
|
|
5713
|
+
const tokenAddress = isPusd ? _chunkLVCD6RHFcjs.POLYMARKET_PUSD_ADDRESS : _chunkLVCD6RHFcjs.POLYMARKET_USDCE_ADDRESS;
|
|
5672
5714
|
const symbol = isPusd ? "pUSD" : "USDC.e";
|
|
5673
5715
|
const balanceUsd = Number(_viem.formatUnits.call(void 0, balance, 6));
|
|
5674
5716
|
const metadata = { proxyWallet, tokenKind, walletKind };
|
|
5675
5717
|
return {
|
|
5676
5718
|
id: `polymarket:${tokenKind}`,
|
|
5677
|
-
chainId:
|
|
5719
|
+
chainId: _chunkLVCD6RHFcjs.POLYMARKET_POLYGON_CHAIN_ID,
|
|
5678
5720
|
token: tokenAddress,
|
|
5679
5721
|
symbol,
|
|
5680
5722
|
name: isPusd ? "Polymarket USD" : "Polygon USDC.e",
|
|
5681
|
-
icon: isPusd ?
|
|
5723
|
+
icon: isPusd ? _chunkLVCD6RHFcjs.POLYMARKET_ICON_URL : void 0,
|
|
5682
5724
|
decimals: 6,
|
|
5683
5725
|
balance: balance.toString(),
|
|
5684
5726
|
balanceUsd: Number.isFinite(balanceUsd) ? balanceUsd : 0,
|
|
@@ -5691,8 +5733,8 @@ function buildAsset2(params) {
|
|
|
5691
5733
|
// pUSD unwraps to USDC.e via the offramp; USDC.e is what actually
|
|
5692
5734
|
// arrives at the smart account, so it's also what the orchestrator
|
|
5693
5735
|
// bridges from.
|
|
5694
|
-
depositToken:
|
|
5695
|
-
depositChainId:
|
|
5736
|
+
depositToken: _chunkLVCD6RHFcjs.POLYMARKET_USDCE_ADDRESS,
|
|
5737
|
+
depositChainId: _chunkLVCD6RHFcjs.POLYMARKET_POLYGON_CHAIN_ID,
|
|
5696
5738
|
providerMetadata: metadata
|
|
5697
5739
|
};
|
|
5698
5740
|
}
|
|
@@ -5713,7 +5755,7 @@ function getEnabledProviders(config) {
|
|
|
5713
5755
|
function computeDappImportStatus(providerId, inputs) {
|
|
5714
5756
|
const { owner, availability, availabilityOwner, setup } = inputs;
|
|
5715
5757
|
if (!owner) return "needs-connect";
|
|
5716
|
-
const entry = _optionalChain([availabilityOwner, 'optionalAccess',
|
|
5758
|
+
const entry = _optionalChain([availabilityOwner, 'optionalAccess', _224 => _224.toLowerCase, 'call', _225 => _225()]) === owner.toLowerCase() ? availability[providerId] : void 0;
|
|
5717
5759
|
if (entry === "loading" || entry === void 0) return "loading";
|
|
5718
5760
|
if (entry === "error") {
|
|
5719
5761
|
return {
|
|
@@ -5871,6 +5913,10 @@ function createDepositAnalyticsController(emit) {
|
|
|
5871
5913
|
dedupe.add(key);
|
|
5872
5914
|
emit(...args);
|
|
5873
5915
|
};
|
|
5916
|
+
const sendHistory = (type, detail) => {
|
|
5917
|
+
controller.openSession();
|
|
5918
|
+
emit(...[{ type, ...detail }, method]);
|
|
5919
|
+
};
|
|
5874
5920
|
const controller = {
|
|
5875
5921
|
emit,
|
|
5876
5922
|
openSession() {
|
|
@@ -5878,6 +5924,21 @@ function createDepositAnalyticsController(emit) {
|
|
|
5878
5924
|
opened = true;
|
|
5879
5925
|
emit({ type: "deposit_modal_open" }, null);
|
|
5880
5926
|
},
|
|
5927
|
+
historyOpened(detail) {
|
|
5928
|
+
sendHistory("deposit_modal_history_open", detail);
|
|
5929
|
+
},
|
|
5930
|
+
historyRowViewed(detail) {
|
|
5931
|
+
sendHistory("deposit_modal_history_row_view", detail);
|
|
5932
|
+
},
|
|
5933
|
+
historyLoadMore(detail) {
|
|
5934
|
+
sendHistory("deposit_modal_history_load_more", detail);
|
|
5935
|
+
},
|
|
5936
|
+
historyFallbackOpened(detail) {
|
|
5937
|
+
sendHistory("deposit_modal_history_fallback_open", detail);
|
|
5938
|
+
},
|
|
5939
|
+
historyRecoveryStarted(detail) {
|
|
5940
|
+
sendHistory("deposit_modal_history_recovery_start", detail);
|
|
5941
|
+
},
|
|
5881
5942
|
selectMethod(...args) {
|
|
5882
5943
|
const [nextMethod, entrySource, identifiers] = args;
|
|
5883
5944
|
controller.openSession();
|
|
@@ -6036,7 +6097,7 @@ function DepositAnalyticsControllerProvider({
|
|
|
6036
6097
|
children,
|
|
6037
6098
|
controllerRef
|
|
6038
6099
|
}) {
|
|
6039
|
-
const emit =
|
|
6100
|
+
const emit = _chunk3OOY67VJcjs.useDepositAnalyticsEmitter.call(void 0, );
|
|
6040
6101
|
const controller = _react.useMemo.call(void 0,
|
|
6041
6102
|
() => createDepositAnalyticsController(emit),
|
|
6042
6103
|
[emit]
|
|
@@ -6556,7 +6617,7 @@ function applyAction(state, action) {
|
|
|
6556
6617
|
totalUsd: null,
|
|
6557
6618
|
// Keep any prior chains visible so the cluster does not flicker
|
|
6558
6619
|
// empty across a refresh.
|
|
6559
|
-
chainIds: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
6620
|
+
chainIds: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _226 => _226.chainIds]), () => ( []))
|
|
6560
6621
|
}
|
|
6561
6622
|
}
|
|
6562
6623
|
}
|
|
@@ -6767,7 +6828,7 @@ function applyAction(state, action) {
|
|
|
6767
6828
|
flow: { ...state.flow, step: "processing" }
|
|
6768
6829
|
};
|
|
6769
6830
|
case "processing/quote-loaded":
|
|
6770
|
-
if (state.flow.step !== "processing" || _optionalChain([state, 'access',
|
|
6831
|
+
if (state.flow.step !== "processing" || _optionalChain([state, 'access', _227 => _227.processing, 'access', _228 => _228.txHash, 'optionalAccess', _229 => _229.toLowerCase, 'call', _230 => _230()]) !== action.txHash.toLowerCase()) {
|
|
6771
6832
|
return state;
|
|
6772
6833
|
}
|
|
6773
6834
|
return {
|
|
@@ -7355,16 +7416,17 @@ function DepositFlow({
|
|
|
7355
7416
|
onSwappedImmersiveChange,
|
|
7356
7417
|
openExternally,
|
|
7357
7418
|
onSubmittingChange,
|
|
7419
|
+
onProcessingSettledChange,
|
|
7358
7420
|
onClose,
|
|
7359
7421
|
onLifecycle,
|
|
7360
7422
|
onError,
|
|
7361
7423
|
debug
|
|
7362
7424
|
}) {
|
|
7363
|
-
const rpcUrls =
|
|
7364
|
-
const onStepChangeRef =
|
|
7425
|
+
const rpcUrls = _chunk3OOY67VJcjs.useRpcUrls.call(void 0, );
|
|
7426
|
+
const onStepChangeRef = _chunk3OOY67VJcjs.useLatestRef.call(void 0, onStepChange);
|
|
7365
7427
|
const analytics = useDepositAnalyticsController();
|
|
7366
|
-
const onLifecycleRef =
|
|
7367
|
-
const onErrorRef =
|
|
7428
|
+
const onLifecycleRef = _chunk3OOY67VJcjs.useLatestRef.call(void 0, onLifecycle);
|
|
7429
|
+
const onErrorRef = _chunk3OOY67VJcjs.useLatestRef.call(void 0, onError);
|
|
7368
7430
|
const storeApi = useDepositStoreApi();
|
|
7369
7431
|
const flowSlice = useDepositStore((s) => s.flow);
|
|
7370
7432
|
const depositSlice = useDepositStore((s) => s.deposit);
|
|
@@ -7381,13 +7443,13 @@ function DepositFlow({
|
|
|
7381
7443
|
const stableWalletSelectionKeyRef = _react.useRef.call(void 0, null);
|
|
7382
7444
|
const logFlow = _react.useCallback.call(void 0,
|
|
7383
7445
|
(message, data) => {
|
|
7384
|
-
|
|
7446
|
+
_chunk3OOY67VJcjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
|
|
7385
7447
|
},
|
|
7386
7448
|
[debug]
|
|
7387
7449
|
);
|
|
7388
7450
|
const logFlowError = _react.useCallback.call(void 0,
|
|
7389
7451
|
(message, error, data) => {
|
|
7390
|
-
|
|
7452
|
+
_chunk3OOY67VJcjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
|
|
7391
7453
|
},
|
|
7392
7454
|
[debug]
|
|
7393
7455
|
);
|
|
@@ -7411,12 +7473,12 @@ function DepositFlow({
|
|
|
7411
7473
|
};
|
|
7412
7474
|
}, [enableSwappedPreconnect]);
|
|
7413
7475
|
const dappSwitchChain = _react.useMemo.call(void 0, () => {
|
|
7414
|
-
if (!_optionalChain([walletClientProp, 'optionalAccess',
|
|
7476
|
+
if (!_optionalChain([walletClientProp, 'optionalAccess', _231 => _231.switchChain])) return void 0;
|
|
7415
7477
|
return async (chainId) => {
|
|
7416
|
-
await _optionalChain([walletClientProp, 'access',
|
|
7478
|
+
await _optionalChain([walletClientProp, 'access', _232 => _232.switchChain, 'optionalCall', _233 => _233({ id: chainId })]);
|
|
7417
7479
|
};
|
|
7418
7480
|
}, [walletClientProp]);
|
|
7419
|
-
const connectedWalletAddress = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess',
|
|
7481
|
+
const connectedWalletAddress = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess', _234 => _234.account, 'optionalAccess', _235 => _235.address]), () => ( null));
|
|
7420
7482
|
const walletOptions = _react.useMemo.call(void 0, () => {
|
|
7421
7483
|
const options = [];
|
|
7422
7484
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -7430,7 +7492,7 @@ function DepositFlow({
|
|
|
7430
7492
|
});
|
|
7431
7493
|
seen.add(id);
|
|
7432
7494
|
}
|
|
7433
|
-
if (_optionalChain([walletSession, 'optionalAccess',
|
|
7495
|
+
if (_optionalChain([walletSession, 'optionalAccess', _236 => _236.isConnected]) && walletSession.isSolana && walletSession.solanaAddress) {
|
|
7434
7496
|
const id = _nullishCoalesce(walletSession.caipAddress, () => ( `solana:${walletSession.solanaAddress}`));
|
|
7435
7497
|
if (!seen.has(id)) {
|
|
7436
7498
|
options.push({
|
|
@@ -7442,7 +7504,7 @@ function DepositFlow({
|
|
|
7442
7504
|
});
|
|
7443
7505
|
seen.add(id);
|
|
7444
7506
|
}
|
|
7445
|
-
} else if (_optionalChain([walletSession, 'optionalAccess',
|
|
7507
|
+
} else if (_optionalChain([walletSession, 'optionalAccess', _237 => _237.address]) && walletSession.isConnected && walletSession.canSignEvm && !seen.has(`evm:${walletSession.address.toLowerCase()}`)) {
|
|
7446
7508
|
const id = `evm:${walletSession.address.toLowerCase()}`;
|
|
7447
7509
|
if (!seen.has(id)) {
|
|
7448
7510
|
options.push({
|
|
@@ -7458,13 +7520,13 @@ function DepositFlow({
|
|
|
7458
7520
|
return options;
|
|
7459
7521
|
}, [
|
|
7460
7522
|
connectedWalletAddress,
|
|
7461
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7462
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7463
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7464
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7465
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7466
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7467
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7523
|
+
_optionalChain([walletSession, 'optionalAccess', _238 => _238.address]),
|
|
7524
|
+
_optionalChain([walletSession, 'optionalAccess', _239 => _239.isConnected]),
|
|
7525
|
+
_optionalChain([walletSession, 'optionalAccess', _240 => _240.canSignEvm]),
|
|
7526
|
+
_optionalChain([walletSession, 'optionalAccess', _241 => _241.icon]),
|
|
7527
|
+
_optionalChain([walletSession, 'optionalAccess', _242 => _242.isSolana]),
|
|
7528
|
+
_optionalChain([walletSession, 'optionalAccess', _243 => _243.solanaAddress]),
|
|
7529
|
+
_optionalChain([walletSession, 'optionalAccess', _244 => _244.caipAddress])
|
|
7468
7530
|
]);
|
|
7469
7531
|
const offeredFiatMethods = _react.useMemo.call(void 0,
|
|
7470
7532
|
() => fiatMethods ? FIAT_ONRAMP_METHODS.filter((m) => fiatMethods[m.method]) : FIAT_ONRAMP_METHODS,
|
|
@@ -7484,11 +7546,11 @@ function DepositFlow({
|
|
|
7484
7546
|
hasEnabledAssetMigration
|
|
7485
7547
|
].filter(Boolean).length;
|
|
7486
7548
|
const canAutoLock = Boolean(
|
|
7487
|
-
enableWallet && _optionalChain([walletClientProp, 'optionalAccess',
|
|
7549
|
+
enableWallet && _optionalChain([walletClientProp, 'optionalAccess', _245 => _245.account]) && !walletSession && enabledFeatureCount === 1
|
|
7488
7550
|
);
|
|
7489
7551
|
const hasWalletOptions = enableWallet && walletOptions.length > 0;
|
|
7490
7552
|
const hasReownSession = Boolean(
|
|
7491
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7553
|
+
_optionalChain([walletSession, 'optionalAccess', _246 => _246.isConnected]) || _optionalChain([walletSession, 'optionalAccess', _247 => _247.address])
|
|
7492
7554
|
);
|
|
7493
7555
|
const isDappImportWalletHydrating = Boolean(
|
|
7494
7556
|
hasWalletClientProp && walletClientProp === void 0 || walletSession && !hasReownSession && !walletSession.isReady
|
|
@@ -7508,10 +7570,10 @@ function DepositFlow({
|
|
|
7508
7570
|
isConnectSelectionConfirmed,
|
|
7509
7571
|
selectedWalletId
|
|
7510
7572
|
]);
|
|
7511
|
-
const setupChainId = typeof targetChain === "number" && !
|
|
7512
|
-
const targetChainId =
|
|
7513
|
-
const targetSymbol =
|
|
7514
|
-
const isTargetStablecoin =
|
|
7573
|
+
const setupChainId = typeof targetChain === "number" && !_chunkOY5N3E6Lcjs.isVirtualDestination.call(void 0, targetChain) ? targetChain : typeof defaultSourceChain === "number" ? defaultSourceChain : DEFAULT_SETUP_CHAIN_ID;
|
|
7574
|
+
const targetChainId = _chunkOY5N3E6Lcjs.targetChainToChainId.call(void 0, targetChain);
|
|
7575
|
+
const targetSymbol = _chunkOY5N3E6Lcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
7576
|
+
const isTargetStablecoin = _chunkOY5N3E6Lcjs.isStablecoinSymbol.call(void 0, targetSymbol);
|
|
7515
7577
|
const targetMarketPriceRef = _react.useRef.call(void 0, null);
|
|
7516
7578
|
_react.useEffect.call(void 0, () => {
|
|
7517
7579
|
targetMarketPriceRef.current = null;
|
|
@@ -7519,7 +7581,7 @@ function DepositFlow({
|
|
|
7519
7581
|
return;
|
|
7520
7582
|
}
|
|
7521
7583
|
let cancelled = false;
|
|
7522
|
-
|
|
7584
|
+
_chunkX4D52IZKcjs.fetchTokenPriceUsd.call(void 0, service, {
|
|
7523
7585
|
chainId: targetChainId,
|
|
7524
7586
|
address: targetToken,
|
|
7525
7587
|
symbol: targetSymbol
|
|
@@ -7536,11 +7598,11 @@ function DepositFlow({
|
|
|
7536
7598
|
return null;
|
|
7537
7599
|
}
|
|
7538
7600
|
if (canAutoLock) {
|
|
7539
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess',
|
|
7601
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess', _248 => _248.chain, 'optionalAccess', _249 => _249.id]), () => ( setupChainId));
|
|
7540
7602
|
return {
|
|
7541
7603
|
ownerAddress: walletClientProp.account.address,
|
|
7542
7604
|
walletClient: walletClientProp,
|
|
7543
|
-
publicClient: _nullishCoalesce(publicClientProp, () => (
|
|
7605
|
+
publicClient: _nullishCoalesce(publicClientProp, () => ( _chunk3OOY67VJcjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
|
|
7544
7606
|
switchChain: dappSwitchChain
|
|
7545
7607
|
};
|
|
7546
7608
|
}
|
|
@@ -7552,20 +7614,20 @@ function DepositFlow({
|
|
|
7552
7614
|
if (selectedOption.kind === "solana") {
|
|
7553
7615
|
return null;
|
|
7554
7616
|
}
|
|
7555
|
-
if (selectedOption.kind === "connected" && _optionalChain([walletClientProp, 'optionalAccess',
|
|
7556
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess',
|
|
7617
|
+
if (selectedOption.kind === "connected" && _optionalChain([walletClientProp, 'optionalAccess', _250 => _250.account]) && selectedOption.address && walletClientProp.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
7618
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([walletClientProp, 'optionalAccess', _251 => _251.chain, 'optionalAccess', _252 => _252.id]), () => ( setupChainId));
|
|
7557
7619
|
return {
|
|
7558
7620
|
ownerAddress: walletClientProp.account.address,
|
|
7559
7621
|
walletClient: walletClientProp,
|
|
7560
|
-
publicClient: _nullishCoalesce(publicClientProp, () => (
|
|
7622
|
+
publicClient: _nullishCoalesce(publicClientProp, () => ( _chunk3OOY67VJcjs.getPublicClient.call(void 0, fallbackChainId, rpcUrls))),
|
|
7561
7623
|
switchChain: dappSwitchChain
|
|
7562
7624
|
};
|
|
7563
7625
|
}
|
|
7564
|
-
if (selectedOption.kind === "external" && _optionalChain([walletSession, 'optionalAccess',
|
|
7626
|
+
if (selectedOption.kind === "external" && _optionalChain([walletSession, 'optionalAccess', _253 => _253.address]) && selectedOption.address && walletSession.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
7565
7627
|
return {
|
|
7566
7628
|
ownerAddress: walletSession.address,
|
|
7567
7629
|
walletClient: walletSession.walletClient,
|
|
7568
|
-
publicClient: _nullishCoalesce(walletSession.publicClient, () => (
|
|
7630
|
+
publicClient: _nullishCoalesce(walletSession.publicClient, () => ( _chunk3OOY67VJcjs.getPublicClient.call(void 0, setupChainId, rpcUrls))),
|
|
7569
7631
|
switchChain: walletSession.switchChain
|
|
7570
7632
|
};
|
|
7571
7633
|
}
|
|
@@ -7587,7 +7649,7 @@ function DepositFlow({
|
|
|
7587
7649
|
// nothing else here when the host switches chain, and the context would go
|
|
7588
7650
|
// on holding a client bound to the old one: `chainMismatch` never clears
|
|
7589
7651
|
// and the CTA stays disabled with nothing beside it.
|
|
7590
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7652
|
+
_optionalChain([walletSession, 'optionalAccess', _254 => _254.walletClient]),
|
|
7591
7653
|
setupChainId,
|
|
7592
7654
|
rpcUrls
|
|
7593
7655
|
]);
|
|
@@ -7627,35 +7689,35 @@ function DepositFlow({
|
|
|
7627
7689
|
const selectedEvmWalletOwner = _react.useMemo.call(void 0, () => {
|
|
7628
7690
|
if (!selectedWalletId) return null;
|
|
7629
7691
|
const opt = walletOptions.find((o) => o.id === selectedWalletId);
|
|
7630
|
-
if (_optionalChain([opt, 'optionalAccess',
|
|
7692
|
+
if (_optionalChain([opt, 'optionalAccess', _255 => _255.kind]) === "external" && opt.address) {
|
|
7631
7693
|
return opt.address;
|
|
7632
7694
|
}
|
|
7633
|
-
if (_optionalChain([opt, 'optionalAccess',
|
|
7695
|
+
if (_optionalChain([opt, 'optionalAccess', _256 => _256.kind]) === "connected" && opt.address) {
|
|
7634
7696
|
return opt.address;
|
|
7635
7697
|
}
|
|
7636
7698
|
return null;
|
|
7637
7699
|
}, [selectedWalletId, walletOptions]);
|
|
7638
7700
|
const dappImportOwner = _react.useMemo.call(void 0, () => {
|
|
7639
7701
|
if (selectedEvmWalletOwner) return selectedEvmWalletOwner;
|
|
7640
|
-
if (_optionalChain([walletSession, 'optionalAccess',
|
|
7702
|
+
if (_optionalChain([walletSession, 'optionalAccess', _257 => _257.address]) && walletSession.isConnected) {
|
|
7641
7703
|
return walletSession.address;
|
|
7642
7704
|
}
|
|
7643
7705
|
if (connectedWalletAddress) return connectedWalletAddress;
|
|
7644
7706
|
return null;
|
|
7645
7707
|
}, [
|
|
7646
7708
|
selectedEvmWalletOwner,
|
|
7647
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7648
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7709
|
+
_optionalChain([walletSession, 'optionalAccess', _258 => _258.address]),
|
|
7710
|
+
_optionalChain([walletSession, 'optionalAccess', _259 => _259.isConnected]),
|
|
7649
7711
|
connectedWalletAddress
|
|
7650
7712
|
]);
|
|
7651
7713
|
const activeOwner = _react.useMemo.call(void 0,
|
|
7652
7714
|
() => resolveOwnerForMode(flowMode, {
|
|
7653
|
-
walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess',
|
|
7715
|
+
walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _260 => _260.ownerAddress]), () => ( (canAutoLock ? connectedWalletAddress : selectedEvmWalletOwner))),
|
|
7654
7716
|
dappImportOwner
|
|
7655
7717
|
}),
|
|
7656
7718
|
[
|
|
7657
7719
|
flowMode,
|
|
7658
|
-
_optionalChain([signerContext, 'optionalAccess',
|
|
7720
|
+
_optionalChain([signerContext, 'optionalAccess', _261 => _261.ownerAddress]),
|
|
7659
7721
|
canAutoLock,
|
|
7660
7722
|
connectedWalletAddress,
|
|
7661
7723
|
selectedEvmWalletOwner,
|
|
@@ -7672,7 +7734,7 @@ function DepositFlow({
|
|
|
7672
7734
|
].join(":");
|
|
7673
7735
|
if (lastSmartAccountLifecycleKeyRef.current === lifecycleKey) return;
|
|
7674
7736
|
lastSmartAccountLifecycleKeyRef.current = lifecycleKey;
|
|
7675
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7737
|
+
_optionalChain([onLifecycleRef, 'access', _262 => _262.current, 'optionalCall', _263 => _263({
|
|
7676
7738
|
type: "smart-account-changed",
|
|
7677
7739
|
evm: activeEntry.smartAccount,
|
|
7678
7740
|
solana: _nullishCoalesce(activeEntry.solanaDepositAddress, () => ( null))
|
|
@@ -7700,7 +7762,7 @@ function DepositFlow({
|
|
|
7700
7762
|
return;
|
|
7701
7763
|
}
|
|
7702
7764
|
lastConnectedLifecycleKeyRef.current = lifecycleKey;
|
|
7703
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7765
|
+
_optionalChain([onLifecycleRef, 'access', _264 => _264.current, 'optionalCall', _265 => _265({
|
|
7704
7766
|
type: "connected",
|
|
7705
7767
|
address: activeOwner,
|
|
7706
7768
|
smartAccount: activeEntry.smartAccount
|
|
@@ -7773,7 +7835,7 @@ function DepositFlow({
|
|
|
7773
7835
|
const handleWalletDisconnect = _react.useCallback.call(void 0, () => {
|
|
7774
7836
|
analytics.abandon("wallet_disconnect");
|
|
7775
7837
|
analytics.resetAttempt();
|
|
7776
|
-
_optionalChain([onDisconnect, 'optionalCall',
|
|
7838
|
+
_optionalChain([onDisconnect, 'optionalCall', _266 => _266()]);
|
|
7777
7839
|
storeApi.dispatch({
|
|
7778
7840
|
type: "back/requested",
|
|
7779
7841
|
hasWalletOptions: hasWalletOptions || Boolean(walletSession)
|
|
@@ -7786,7 +7848,7 @@ function DepositFlow({
|
|
|
7786
7848
|
setQrSourcePrice({ resolved: false, usd: null });
|
|
7787
7849
|
if (!qrSourceAsset) return;
|
|
7788
7850
|
let cancelled = false;
|
|
7789
|
-
|
|
7851
|
+
_chunkX4D52IZKcjs.fetchTokenPriceUsd.call(void 0, service, {
|
|
7790
7852
|
chainId: qrSourceAsset.chainId,
|
|
7791
7853
|
address: qrSourceAsset.token,
|
|
7792
7854
|
symbol: qrSourceAsset.symbol
|
|
@@ -7809,7 +7871,7 @@ function DepositFlow({
|
|
|
7809
7871
|
const currentBackHandler = canGoBackFromHere ? handleBack : void 0;
|
|
7810
7872
|
const currentScreen = showConnectStep ? "connect" : effectiveStep.type;
|
|
7811
7873
|
_react.useEffect.call(void 0, () => {
|
|
7812
|
-
_optionalChain([onStepChangeRef, 'access',
|
|
7874
|
+
_optionalChain([onStepChangeRef, 'access', _267 => _267.current, 'optionalCall', _268 => _268(currentBackHandler, currentScreen)]);
|
|
7813
7875
|
}, [currentBackHandler, currentScreen, onStepChangeRef]);
|
|
7814
7876
|
const lastModalHeightRef = _react.useRef.call(void 0, 0);
|
|
7815
7877
|
const modalContentElRef = _react.useRef.call(void 0, null);
|
|
@@ -7819,7 +7881,7 @@ function DepositFlow({
|
|
|
7819
7881
|
modalContentElRef.current = mc;
|
|
7820
7882
|
const ro = new ResizeObserver((entries) => {
|
|
7821
7883
|
for (const entry of entries) {
|
|
7822
|
-
const border = _optionalChain([entry, 'access',
|
|
7884
|
+
const border = _optionalChain([entry, 'access', _269 => _269.borderBoxSize, 'optionalAccess', _270 => _270[0], 'optionalAccess', _271 => _271.blockSize]);
|
|
7823
7885
|
lastModalHeightRef.current = typeof border === "number" ? border : entry.contentRect.height;
|
|
7824
7886
|
}
|
|
7825
7887
|
});
|
|
@@ -7880,7 +7942,7 @@ function DepositFlow({
|
|
|
7880
7942
|
targetToken
|
|
7881
7943
|
]);
|
|
7882
7944
|
_react.useEffect.call(void 0, () => {
|
|
7883
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
7945
|
+
_optionalChain([onLifecycleRef, 'access', _272 => _272.current, 'optionalCall', _273 => _273({
|
|
7884
7946
|
type: "balance-changed",
|
|
7885
7947
|
totalUsd: totalBalanceUsd
|
|
7886
7948
|
})]);
|
|
@@ -7897,9 +7959,9 @@ function DepositFlow({
|
|
|
7897
7959
|
const handleConfirmWallet = _react.useCallback.call(void 0,
|
|
7898
7960
|
(walletId) => {
|
|
7899
7961
|
const selectedOption = walletOptions.find((o) => o.id === walletId);
|
|
7900
|
-
const mode = _optionalChain([selectedOption, 'optionalAccess',
|
|
7962
|
+
const mode = _optionalChain([selectedOption, 'optionalAccess', _274 => _274.kind]) === "solana" ? "solana-wallet" : "wallet";
|
|
7901
7963
|
analytics.selectMethod("wallet", "user", {
|
|
7902
|
-
network: _optionalChain([selectedOption, 'optionalAccess',
|
|
7964
|
+
network: _optionalChain([selectedOption, 'optionalAccess', _275 => _275.kind]) === "solana" ? "solana" : "evm",
|
|
7903
7965
|
integration: _nullishCoalesce(walletIntegration, () => ( "none"))
|
|
7904
7966
|
});
|
|
7905
7967
|
storeApi.dispatch({
|
|
@@ -7911,7 +7973,7 @@ function DepositFlow({
|
|
|
7911
7973
|
[analytics, walletIntegration, walletOptions, storeApi]
|
|
7912
7974
|
);
|
|
7913
7975
|
const isSolanaWalletConnected = Boolean(
|
|
7914
|
-
_optionalChain([walletSession, 'optionalAccess',
|
|
7976
|
+
_optionalChain([walletSession, 'optionalAccess', _276 => _276.isConnected]) && _optionalChain([walletSession, 'optionalAccess', _277 => _277.isSolana])
|
|
7915
7977
|
);
|
|
7916
7978
|
const assetMigrationsKey = assetMigrations ? Object.keys(assetMigrations).filter((k) => assetMigrations[k]).sort().join(",") : "";
|
|
7917
7979
|
const enabledDappImportProviders = _react.useMemo.call(void 0,
|
|
@@ -7928,7 +7990,7 @@ function DepositFlow({
|
|
|
7928
7990
|
const owner = dappImportOwner;
|
|
7929
7991
|
if (owner) {
|
|
7930
7992
|
const wallet = walletOptions.find(
|
|
7931
|
-
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess',
|
|
7993
|
+
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _278 => _278.toLowerCase, 'call', _279 => _279()]) === owner.toLowerCase()
|
|
7932
7994
|
);
|
|
7933
7995
|
if (wallet) {
|
|
7934
7996
|
storeApi.dispatch({
|
|
@@ -7972,7 +8034,7 @@ function DepositFlow({
|
|
|
7972
8034
|
eoa: dappImportOwner,
|
|
7973
8035
|
getPublicClient: (chainId) => {
|
|
7974
8036
|
try {
|
|
7975
|
-
return
|
|
8037
|
+
return _chunk3OOY67VJcjs.getPublicClient.call(void 0, chainId, rpcUrls);
|
|
7976
8038
|
} catch (e38) {
|
|
7977
8039
|
return null;
|
|
7978
8040
|
}
|
|
@@ -8075,7 +8137,7 @@ function DepositFlow({
|
|
|
8075
8137
|
}, [activeDappImportProviderId, enabledDappImportProviders]);
|
|
8076
8138
|
const activeDappImportAvailability = _react.useMemo.call(void 0, () => {
|
|
8077
8139
|
if (!activeDappImportProviderId) return null;
|
|
8078
|
-
if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess',
|
|
8140
|
+
if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _280 => _280.toLowerCase, 'call', _281 => _281()]) !== dappImportOwner.toLowerCase()) {
|
|
8079
8141
|
return null;
|
|
8080
8142
|
}
|
|
8081
8143
|
const entry = dappImportAvailability[activeDappImportProviderId];
|
|
@@ -8118,7 +8180,7 @@ function DepositFlow({
|
|
|
8118
8180
|
setup: setupSlice
|
|
8119
8181
|
});
|
|
8120
8182
|
const pinnableWallet = dappImportOwner ? _nullishCoalesce(walletOptions.find(
|
|
8121
|
-
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess',
|
|
8183
|
+
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _282 => _282.toLowerCase, 'call', _283 => _283()]) === dappImportOwner.toLowerCase()
|
|
8122
8184
|
), () => ( null)) : null;
|
|
8123
8185
|
const outcome = resolveBootOutcome({
|
|
8124
8186
|
status,
|
|
@@ -8168,7 +8230,7 @@ function DepositFlow({
|
|
|
8168
8230
|
if (dappImportOwner) {
|
|
8169
8231
|
const plan = bootRetryPlan({
|
|
8170
8232
|
setupStatus: snapshot.setup.status,
|
|
8171
|
-
availabilityEntry: _optionalChain([snapshot, 'access',
|
|
8233
|
+
availabilityEntry: _optionalChain([snapshot, 'access', _284 => _284.dappImport, 'access', _285 => _285.availabilityOwner, 'optionalAccess', _286 => _286.toLowerCase, 'call', _287 => _287()]) === dappImportOwner.toLowerCase() ? snapshot.dappImport.availability[providerId] : void 0
|
|
8172
8234
|
});
|
|
8173
8235
|
if (plan.restartSetup) {
|
|
8174
8236
|
storeApi.dispatch({ type: "setup/retry-requested" });
|
|
@@ -8242,7 +8304,7 @@ function DepositFlow({
|
|
|
8242
8304
|
acceptedExchangeFeeBps: disclosedFeeBps
|
|
8243
8305
|
});
|
|
8244
8306
|
} catch (error) {
|
|
8245
|
-
if (error instanceof
|
|
8307
|
+
if (error instanceof _chunk3OOY67VJcjs.SwappedConnectFeeChangedError) {
|
|
8246
8308
|
return error.exchangeFeeBps;
|
|
8247
8309
|
}
|
|
8248
8310
|
throw error;
|
|
@@ -8250,7 +8312,7 @@ function DepositFlow({
|
|
|
8250
8312
|
entry = { smartAccount: owner, response };
|
|
8251
8313
|
}
|
|
8252
8314
|
const currentAccount = storeApi.getState().setup.smartAccount;
|
|
8253
|
-
if (_optionalChain([currentAccount, 'optionalAccess',
|
|
8315
|
+
if (_optionalChain([currentAccount, 'optionalAccess', _288 => _288.toLowerCase, 'call', _289 => _289()]) !== owner) {
|
|
8254
8316
|
swappedConnectUrlRef.current.delete(key);
|
|
8255
8317
|
throw new Error("Deposit account changed. Select your exchange again.");
|
|
8256
8318
|
}
|
|
@@ -8284,7 +8346,7 @@ function DepositFlow({
|
|
|
8284
8346
|
);
|
|
8285
8347
|
}
|
|
8286
8348
|
swappedConnectUrlRef.current.delete(key);
|
|
8287
|
-
const response = _optionalChain([entry, 'optionalAccess',
|
|
8349
|
+
const response = _optionalChain([entry, 'optionalAccess', _290 => _290.smartAccount]) === smartAccount.toLowerCase() ? entry.response : await service.getSwappedConnectUrl({
|
|
8288
8350
|
smartAccount,
|
|
8289
8351
|
connection,
|
|
8290
8352
|
acceptedExchangeFeeBps: expectedFeeBps
|
|
@@ -8452,7 +8514,7 @@ function DepositFlow({
|
|
|
8452
8514
|
const handleNewDeposit = _react.useCallback.call(void 0, () => {
|
|
8453
8515
|
analytics.completeStep();
|
|
8454
8516
|
analytics.resetAttempt();
|
|
8455
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
8517
|
+
_optionalChain([onLifecycleRef, 'access', _291 => _291.current, 'optionalCall', _292 => _292({
|
|
8456
8518
|
type: "smart-account-changed",
|
|
8457
8519
|
evm: null,
|
|
8458
8520
|
solana: null
|
|
@@ -8483,17 +8545,17 @@ function DepositFlow({
|
|
|
8483
8545
|
forceRegister
|
|
8484
8546
|
]
|
|
8485
8547
|
);
|
|
8486
|
-
const desiredSetupRequestKey =
|
|
8548
|
+
const desiredSetupRequestKey = _chunkX4D52IZKcjs.computeRequestKey.call(void 0, setupInput);
|
|
8487
8549
|
const setupReady = setupSlice.status === "ready" && setupSlice.requestKey === desiredSetupRequestKey;
|
|
8488
8550
|
_react.useEffect.call(void 0, () => {
|
|
8489
8551
|
void (async () => {
|
|
8490
|
-
const requestKey =
|
|
8491
|
-
const cacheKey =
|
|
8492
|
-
const cacheable =
|
|
8552
|
+
const requestKey = _chunkX4D52IZKcjs.computeRequestKey.call(void 0, setupInput);
|
|
8553
|
+
const cacheKey = _chunkX4D52IZKcjs.computeCacheKey.call(void 0, setupInput);
|
|
8554
|
+
const cacheable = _chunkX4D52IZKcjs.computeIsCacheable.call(void 0, setupInput);
|
|
8493
8555
|
if (storeApi.getState().setup.requestKey === requestKey) {
|
|
8494
8556
|
return;
|
|
8495
8557
|
}
|
|
8496
|
-
const dedupedResult =
|
|
8558
|
+
const dedupedResult = _chunkX4D52IZKcjs.readDedupedAccountSetupResult.call(void 0, requestKey);
|
|
8497
8559
|
if (dedupedResult) {
|
|
8498
8560
|
storeApi.dispatch({
|
|
8499
8561
|
type: "setup/started",
|
|
@@ -8519,7 +8581,7 @@ function DepositFlow({
|
|
|
8519
8581
|
cacheable
|
|
8520
8582
|
});
|
|
8521
8583
|
try {
|
|
8522
|
-
const result = await
|
|
8584
|
+
const result = await _chunkX4D52IZKcjs.runAccountSetupDeduped.call(void 0,
|
|
8523
8585
|
setupInput,
|
|
8524
8586
|
{ service, debug },
|
|
8525
8587
|
requestKey
|
|
@@ -8534,7 +8596,7 @@ function DepositFlow({
|
|
|
8534
8596
|
}
|
|
8535
8597
|
});
|
|
8536
8598
|
} catch (error) {
|
|
8537
|
-
const message = error instanceof
|
|
8599
|
+
const message = error instanceof _chunkX4D52IZKcjs.SetupError ? error.message : "Deposit service is temporarily unavailable. Please try again shortly.";
|
|
8538
8600
|
storeApi.dispatch({
|
|
8539
8601
|
type: "setup/failed",
|
|
8540
8602
|
requestKey,
|
|
@@ -8566,11 +8628,11 @@ function DepositFlow({
|
|
|
8566
8628
|
return;
|
|
8567
8629
|
}
|
|
8568
8630
|
storeApi.dispatch({ type: "portfolio/loading", network, address });
|
|
8569
|
-
const requestId = _optionalChain([readPortfolioEntry, 'call',
|
|
8631
|
+
const requestId = _optionalChain([readPortfolioEntry, 'call', _293 => _293(
|
|
8570
8632
|
storeApi.getState().portfolio,
|
|
8571
8633
|
network,
|
|
8572
8634
|
address
|
|
8573
|
-
), 'optionalAccess',
|
|
8635
|
+
), 'optionalAccess', _294 => _294.requestId]);
|
|
8574
8636
|
if (requestId === void 0) return;
|
|
8575
8637
|
void (async () => {
|
|
8576
8638
|
try {
|
|
@@ -8583,7 +8645,7 @@ function DepositFlow({
|
|
|
8583
8645
|
address,
|
|
8584
8646
|
requestId,
|
|
8585
8647
|
totalUsd: portfolio.totalUsd,
|
|
8586
|
-
chainIds:
|
|
8648
|
+
chainIds: _chunk3OOY67VJcjs.chainIdsByValue.call(void 0, portfolio.tokens)
|
|
8587
8649
|
});
|
|
8588
8650
|
} catch (e39) {
|
|
8589
8651
|
storeApi.dispatch({
|
|
@@ -8607,7 +8669,7 @@ function DepositFlow({
|
|
|
8607
8669
|
{ type: "transaction_hash", value: data.txHash },
|
|
8608
8670
|
"transfer_tracking"
|
|
8609
8671
|
);
|
|
8610
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
8672
|
+
_optionalChain([onLifecycleRef, 'access', _295 => _295.current, 'optionalCall', _296 => _296({ type: "submitted", ...data })]);
|
|
8611
8673
|
},
|
|
8612
8674
|
[analytics, logFlow, onLifecycleRef]
|
|
8613
8675
|
);
|
|
@@ -8626,8 +8688,8 @@ function DepositFlow({
|
|
|
8626
8688
|
);
|
|
8627
8689
|
const handleSolanaAmountContinue = _react.useCallback.call(void 0,
|
|
8628
8690
|
(token, sourceAmount, inputAmountUsd) => {
|
|
8629
|
-
const targetSym =
|
|
8630
|
-
const isTargetStable =
|
|
8691
|
+
const targetSym = _chunkOY5N3E6Lcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
8692
|
+
const isTargetStable = _chunkOY5N3E6Lcjs.isStablecoinSymbol.call(void 0, targetSym);
|
|
8631
8693
|
const targetTokenPriceUsd = isTargetStable ? 1 : targetMarketPriceRef.current;
|
|
8632
8694
|
logFlow("solana:amount:continue", {
|
|
8633
8695
|
token: token.symbol,
|
|
@@ -8676,7 +8738,7 @@ function DepositFlow({
|
|
|
8676
8738
|
sourceDecimals: tokenAtSubmit.decimals,
|
|
8677
8739
|
inputAmountUsd: amountUsd
|
|
8678
8740
|
});
|
|
8679
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
8741
|
+
_optionalChain([onLifecycleRef, 'access', _297 => _297.current, 'optionalCall', _298 => _298({
|
|
8680
8742
|
type: "submitted",
|
|
8681
8743
|
txHash,
|
|
8682
8744
|
sourceChain: "solana",
|
|
@@ -8702,8 +8764,8 @@ function DepositFlow({
|
|
|
8702
8764
|
(amount, targetAmount, balance) => {
|
|
8703
8765
|
const entry = storeApi.getState().setup;
|
|
8704
8766
|
if (entry.status !== "ready") return;
|
|
8705
|
-
const targetSym =
|
|
8706
|
-
const isTargetStable =
|
|
8767
|
+
const targetSym = _chunkOY5N3E6Lcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
8768
|
+
const isTargetStable = _chunkOY5N3E6Lcjs.isStablecoinSymbol.call(void 0, targetSym);
|
|
8707
8769
|
const targetTokenPriceUsd = isTargetStable ? 1 : targetMarketPriceRef.current;
|
|
8708
8770
|
storeApi.dispatch({
|
|
8709
8771
|
type: "amount/entered",
|
|
@@ -8723,8 +8785,8 @@ function DepositFlow({
|
|
|
8723
8785
|
);
|
|
8724
8786
|
const handleQrAmountContinue = _react.useCallback.call(void 0,
|
|
8725
8787
|
(amount, targetAmount) => {
|
|
8726
|
-
const targetSym =
|
|
8727
|
-
const targetTokenPriceUsd =
|
|
8788
|
+
const targetSym = _chunkOY5N3E6Lcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId);
|
|
8789
|
+
const targetTokenPriceUsd = _chunkOY5N3E6Lcjs.isStablecoinSymbol.call(void 0, targetSym) ? 1 : targetMarketPriceRef.current;
|
|
8728
8790
|
storeApi.dispatch({
|
|
8729
8791
|
type: "qr/amount-entered",
|
|
8730
8792
|
amount,
|
|
@@ -8770,8 +8832,8 @@ function DepositFlow({
|
|
|
8770
8832
|
sourceChain: chainId,
|
|
8771
8833
|
sourceToken: token,
|
|
8772
8834
|
amount,
|
|
8773
|
-
sourceSymbol: _optionalChain([asset, 'optionalAccess',
|
|
8774
|
-
sourceDecimals: _optionalChain([asset, 'optionalAccess',
|
|
8835
|
+
sourceSymbol: _optionalChain([asset, 'optionalAccess', _299 => _299.symbol]),
|
|
8836
|
+
sourceDecimals: _optionalChain([asset, 'optionalAccess', _300 => _300.decimals]),
|
|
8775
8837
|
inputAmountUsd: _nullishCoalesce(depositAtSubmit.inputAmountUsd, () => ( void 0)),
|
|
8776
8838
|
directTransfer: routed.directTransfer,
|
|
8777
8839
|
sourceTxHashPending: routed.sourceTxHashPending,
|
|
@@ -8812,7 +8874,7 @@ function DepositFlow({
|
|
|
8812
8874
|
swappedContext,
|
|
8813
8875
|
initialEvent: info.initialEvent
|
|
8814
8876
|
});
|
|
8815
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
8877
|
+
_optionalChain([onLifecycleRef, 'access', _301 => _301.current, 'optionalCall', _302 => _302({
|
|
8816
8878
|
type: "submitted",
|
|
8817
8879
|
txHash: info.txHash,
|
|
8818
8880
|
sourceChain: SWAPPED_SOURCE_CHAIN,
|
|
@@ -8840,12 +8902,12 @@ function DepositFlow({
|
|
|
8840
8902
|
const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
|
|
8841
8903
|
(txHash, sourceChain, amount) => {
|
|
8842
8904
|
const depositAtSubmit = storeApi.getState().deposit;
|
|
8843
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
8905
|
+
_optionalChain([onLifecycleRef, 'access', _303 => _303.current, 'optionalCall', _304 => _304({
|
|
8844
8906
|
type: "submitted",
|
|
8845
8907
|
txHash,
|
|
8846
8908
|
sourceChain,
|
|
8847
8909
|
amount,
|
|
8848
|
-
sourceDecimals: _optionalChain([depositAtSubmit, 'access',
|
|
8910
|
+
sourceDecimals: _optionalChain([depositAtSubmit, 'access', _305 => _305.selectedAsset, 'optionalAccess', _306 => _306.decimals]),
|
|
8849
8911
|
amountUsd: _nullishCoalesce(depositAtSubmit.inputAmountUsd, () => ( void 0))
|
|
8850
8912
|
})]);
|
|
8851
8913
|
},
|
|
@@ -8858,7 +8920,7 @@ function DepositFlow({
|
|
|
8858
8920
|
analyticsStepForFlowStep(analyticsMethod, "processing")
|
|
8859
8921
|
);
|
|
8860
8922
|
analytics.outcome("completed");
|
|
8861
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
8923
|
+
_optionalChain([onLifecycleRef, 'access', _307 => _307.current, 'optionalCall', _308 => _308({
|
|
8862
8924
|
type: "complete",
|
|
8863
8925
|
txHash,
|
|
8864
8926
|
destinationTxHash,
|
|
@@ -8875,7 +8937,7 @@ function DepositFlow({
|
|
|
8875
8937
|
);
|
|
8876
8938
|
analytics.outcome("failed");
|
|
8877
8939
|
analytics.failure("processor_failed", false);
|
|
8878
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
8940
|
+
_optionalChain([onLifecycleRef, 'access', _309 => _309.current, 'optionalCall', _310 => _310({ type: "failed", txHash, error })]);
|
|
8879
8941
|
},
|
|
8880
8942
|
[analytics, analyticsMethod, logFlowError, onLifecycleRef]
|
|
8881
8943
|
);
|
|
@@ -8896,7 +8958,7 @@ function DepositFlow({
|
|
|
8896
8958
|
failureStep
|
|
8897
8959
|
);
|
|
8898
8960
|
}
|
|
8899
|
-
_optionalChain([onErrorRef, 'access',
|
|
8961
|
+
_optionalChain([onErrorRef, 'access', _311 => _311.current, 'optionalCall', _312 => _312({ message, code, cause })]);
|
|
8900
8962
|
},
|
|
8901
8963
|
[analytics, logFlowError, onErrorRef]
|
|
8902
8964
|
);
|
|
@@ -8945,9 +9007,9 @@ function DepositFlow({
|
|
|
8945
9007
|
address: _nullishCoalesce(_nullishCoalesce(option.address, () => ( option.solanaAddress)), () => ( option.id)),
|
|
8946
9008
|
state,
|
|
8947
9009
|
errorReason: _nullishCoalesce(entry.message, () => ( void 0)),
|
|
8948
|
-
balanceStatus: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess',
|
|
8949
|
-
balanceUsd: _optionalChain([portfolioEntry, 'optionalAccess',
|
|
8950
|
-
balanceChainIds: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess',
|
|
9010
|
+
balanceStatus: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess', _313 => _313.status]), () => ( "loading")),
|
|
9011
|
+
balanceUsd: _optionalChain([portfolioEntry, 'optionalAccess', _314 => _314.status]) === "ready" ? portfolioEntry.totalUsd : null,
|
|
9012
|
+
balanceChainIds: _nullishCoalesce(_optionalChain([portfolioEntry, 'optionalAccess', _315 => _315.chainIds]), () => ( []))
|
|
8951
9013
|
};
|
|
8952
9014
|
});
|
|
8953
9015
|
}, [enableWallet, walletOptions, setupSlice, portfolioSlice]);
|
|
@@ -9128,7 +9190,7 @@ function DepositFlow({
|
|
|
9128
9190
|
consumePrefetchedUrl: consumeSwappedWidgetUrlPrefetch,
|
|
9129
9191
|
onSwappedComplete: handleSwappedComplete,
|
|
9130
9192
|
onSwappedFailed: handleDepositFailed,
|
|
9131
|
-
onClose: () => _optionalChain([onClose, 'optionalCall',
|
|
9193
|
+
onClose: () => _optionalChain([onClose, 'optionalCall', _316 => _316(
|
|
9132
9194
|
openExternally ? "native_dismiss_request" : "header_button"
|
|
9133
9195
|
)]),
|
|
9134
9196
|
onGoBack: handleProviderBack,
|
|
@@ -9142,7 +9204,7 @@ function DepositFlow({
|
|
|
9142
9204
|
}
|
|
9143
9205
|
),
|
|
9144
9206
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9145
|
-
|
|
9207
|
+
_chunkX4D52IZKcjs.ProcessingStep,
|
|
9146
9208
|
{
|
|
9147
9209
|
smartAccount: step.smartAccount,
|
|
9148
9210
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
@@ -9168,7 +9230,8 @@ function DepositFlow({
|
|
|
9168
9230
|
onDepositComplete: handleDepositComplete,
|
|
9169
9231
|
onDepositFailed: handleDepositFailed,
|
|
9170
9232
|
onError: handleError,
|
|
9171
|
-
debug
|
|
9233
|
+
debug,
|
|
9234
|
+
onSettledChange: onProcessingSettledChange
|
|
9172
9235
|
}
|
|
9173
9236
|
)
|
|
9174
9237
|
]
|
|
@@ -9207,7 +9270,7 @@ function DepositFlow({
|
|
|
9207
9270
|
loadUrl: () => loadSwappedConnectUrl(step.smartAccount, step.connection),
|
|
9208
9271
|
onSwappedComplete: handleSwappedComplete,
|
|
9209
9272
|
onSwappedFailed: handleDepositFailed,
|
|
9210
|
-
onClose: () => _optionalChain([onClose, 'optionalCall',
|
|
9273
|
+
onClose: () => _optionalChain([onClose, 'optionalCall', _317 => _317(
|
|
9211
9274
|
openExternally ? "native_dismiss_request" : "header_button"
|
|
9212
9275
|
)]),
|
|
9213
9276
|
onGoBack: handleProviderBack,
|
|
@@ -9221,7 +9284,7 @@ function DepositFlow({
|
|
|
9221
9284
|
}
|
|
9222
9285
|
),
|
|
9223
9286
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9224
|
-
|
|
9287
|
+
_chunkX4D52IZKcjs.ProcessingStep,
|
|
9225
9288
|
{
|
|
9226
9289
|
smartAccount: step.smartAccount,
|
|
9227
9290
|
solanaDepositAddress: step.solanaDepositAddress,
|
|
@@ -9247,7 +9310,8 @@ function DepositFlow({
|
|
|
9247
9310
|
onDepositComplete: handleDepositComplete,
|
|
9248
9311
|
onDepositFailed: handleDepositFailed,
|
|
9249
9312
|
onError: handleError,
|
|
9250
|
-
debug
|
|
9313
|
+
debug,
|
|
9314
|
+
onSettledChange: onProcessingSettledChange
|
|
9251
9315
|
}
|
|
9252
9316
|
)
|
|
9253
9317
|
]
|
|
@@ -9255,8 +9319,8 @@ function DepositFlow({
|
|
|
9255
9319
|
);
|
|
9256
9320
|
}
|
|
9257
9321
|
if (isSolanaWalletMode) {
|
|
9258
|
-
const solanaAddr = _optionalChain([walletSession, 'optionalAccess',
|
|
9259
|
-
const solanaProvider = _optionalChain([walletSession, 'optionalAccess',
|
|
9322
|
+
const solanaAddr = _optionalChain([walletSession, 'optionalAccess', _318 => _318.solanaAddress]);
|
|
9323
|
+
const solanaProvider = _optionalChain([walletSession, 'optionalAccess', _319 => _319.solanaProvider]);
|
|
9260
9324
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
9261
9325
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9262
9326
|
AccountPreparingSkeleton,
|
|
@@ -9285,8 +9349,8 @@ function DepositFlow({
|
|
|
9285
9349
|
defaultAmount: effectiveStep.inputAmountUsd,
|
|
9286
9350
|
uiConfig,
|
|
9287
9351
|
targetChain,
|
|
9288
|
-
targetChainName:
|
|
9289
|
-
targetTokenSymbol:
|
|
9352
|
+
targetChainName: _chunkOY5N3E6Lcjs.getChainName.call(void 0, targetChainId),
|
|
9353
|
+
targetTokenSymbol: _chunkOY5N3E6Lcjs.getTargetTokenSymbol.call(void 0, targetToken, targetChainId),
|
|
9290
9354
|
appBalanceUsd,
|
|
9291
9355
|
onContinue: handleSolanaAmountContinue,
|
|
9292
9356
|
debug
|
|
@@ -9307,11 +9371,12 @@ function DepositFlow({
|
|
|
9307
9371
|
targetToken,
|
|
9308
9372
|
service,
|
|
9309
9373
|
solanaProvider,
|
|
9310
|
-
solanaConnection: _optionalChain([walletSession, 'optionalAccess',
|
|
9374
|
+
solanaConnection: _optionalChain([walletSession, 'optionalAccess', _320 => _320.solanaConnection]),
|
|
9311
9375
|
uiConfig,
|
|
9312
9376
|
onConfirm: handleSolanaConfirmed,
|
|
9313
9377
|
onError: handleError,
|
|
9314
|
-
debug
|
|
9378
|
+
debug,
|
|
9379
|
+
onSubmittingChange
|
|
9315
9380
|
}
|
|
9316
9381
|
) : effectiveStep.type === "solana-confirm" ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
9317
9382
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", children: [
|
|
@@ -9348,7 +9413,7 @@ function DepositFlow({
|
|
|
9348
9413
|
) })
|
|
9349
9414
|
] }) : null,
|
|
9350
9415
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9351
|
-
|
|
9416
|
+
_chunkX4D52IZKcjs.ProcessingStep,
|
|
9352
9417
|
{
|
|
9353
9418
|
smartAccount: effectiveStep.smartAccount,
|
|
9354
9419
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
@@ -9371,7 +9436,8 @@ function DepositFlow({
|
|
|
9371
9436
|
onDepositComplete: handleDepositComplete,
|
|
9372
9437
|
onDepositFailed: handleDepositFailed,
|
|
9373
9438
|
onError: handleError,
|
|
9374
|
-
debug
|
|
9439
|
+
debug,
|
|
9440
|
+
onSettledChange: onProcessingSettledChange
|
|
9375
9441
|
}
|
|
9376
9442
|
)
|
|
9377
9443
|
] });
|
|
@@ -9386,7 +9452,7 @@ function DepositFlow({
|
|
|
9386
9452
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9387
9453
|
DappImportAssetSelectSkeleton,
|
|
9388
9454
|
{
|
|
9389
|
-
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportProvider, 'optionalAccess',
|
|
9455
|
+
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportProvider, 'optionalAccess', _321 => _321.sourceLabel]), () => ( "")),
|
|
9390
9456
|
error: dappImportBootError,
|
|
9391
9457
|
onRetry: handleBootRetry
|
|
9392
9458
|
}
|
|
@@ -9408,7 +9474,7 @@ function DepositFlow({
|
|
|
9408
9474
|
rows: dappImportSelectRows,
|
|
9409
9475
|
onRequestConnect: _nullishCoalesce(onConnect, () => ( onRequestConnect)),
|
|
9410
9476
|
onSelect: (providerId) => {
|
|
9411
|
-
const availabilityEntry = dappImportOwner && _optionalChain([dappImportAvailabilityOwner, 'optionalAccess',
|
|
9477
|
+
const availabilityEntry = dappImportOwner && _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _322 => _322.toLowerCase, 'call', _323 => _323()]) === dappImportOwner.toLowerCase() ? dappImportAvailability[providerId] : void 0;
|
|
9412
9478
|
if (availabilityEntry === "error") {
|
|
9413
9479
|
storeApi.dispatch({
|
|
9414
9480
|
type: "dapp-import/availability-retry-requested"
|
|
@@ -9427,16 +9493,16 @@ function DepositFlow({
|
|
|
9427
9493
|
}
|
|
9428
9494
|
);
|
|
9429
9495
|
}
|
|
9430
|
-
if (!_optionalChain([signerContext, 'optionalAccess',
|
|
9496
|
+
if (!_optionalChain([signerContext, 'optionalAccess', _324 => _324.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _325 => _325.publicClient])) {
|
|
9431
9497
|
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" }) }) }) }) });
|
|
9432
9498
|
}
|
|
9433
9499
|
const ownerAddress = signerContext.ownerAddress;
|
|
9434
|
-
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access',
|
|
9500
|
+
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _326 => _326.walletClient, 'optionalAccess', _327 => _327.chain, 'optionalAccess', _328 => _328.id]), () => ( _optionalChain([signerContext, 'access', _329 => _329.publicClient, 'access', _330 => _330.chain, 'optionalAccess', _331 => _331.id]))), () => ( setupChainId));
|
|
9435
9501
|
const getReadClientForChain = (chainId) => {
|
|
9436
|
-
if (_optionalChain([signerContext, 'access',
|
|
9502
|
+
if (_optionalChain([signerContext, 'access', _332 => _332.publicClient, 'access', _333 => _333.chain, 'optionalAccess', _334 => _334.id]) === chainId) {
|
|
9437
9503
|
return signerContext.publicClient;
|
|
9438
9504
|
}
|
|
9439
|
-
return
|
|
9505
|
+
return _chunk3OOY67VJcjs.getPublicClient.call(void 0, chainId, rpcUrls);
|
|
9440
9506
|
};
|
|
9441
9507
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
9442
9508
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -9462,9 +9528,9 @@ function DepositFlow({
|
|
|
9462
9528
|
effectiveStep.type === "dapp-import-asset-select" && activeDappImportProvider && activeDappImportAvailability && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9463
9529
|
DappImportAssetSelectStep,
|
|
9464
9530
|
{
|
|
9465
|
-
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access',
|
|
9531
|
+
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access', _335 => _335.assets, 'access', _336 => _336[0], 'optionalAccess', _337 => _337.sourceLabel]), () => ( activeDappImportProvider.sourceLabel)),
|
|
9466
9532
|
assets: activeDappImportAvailability.assets,
|
|
9467
|
-
incompleteSummary: _optionalChain([activeDappImportAvailability, 'access',
|
|
9533
|
+
incompleteSummary: _optionalChain([activeDappImportAvailability, 'access', _338 => _338.incomplete, 'optionalAccess', _339 => _339.summary]),
|
|
9468
9534
|
onSelect: handleDappImportAssetSelected
|
|
9469
9535
|
}
|
|
9470
9536
|
),
|
|
@@ -9539,7 +9605,7 @@ function DepositFlow({
|
|
|
9539
9605
|
}
|
|
9540
9606
|
),
|
|
9541
9607
|
effectiveStep.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9542
|
-
|
|
9608
|
+
_chunkX4D52IZKcjs.ProcessingStep,
|
|
9543
9609
|
{
|
|
9544
9610
|
smartAccount: effectiveStep.smartAccount,
|
|
9545
9611
|
solanaDepositAddress: effectiveStep.solanaDepositAddress,
|
|
@@ -9568,306 +9634,20 @@ function DepositFlow({
|
|
|
9568
9634
|
onDepositComplete: handleDepositComplete,
|
|
9569
9635
|
onDepositFailed: handleDepositFailed,
|
|
9570
9636
|
onError: handleError,
|
|
9571
|
-
debug
|
|
9637
|
+
debug,
|
|
9638
|
+
onSettledChange: onProcessingSettledChange
|
|
9572
9639
|
}
|
|
9573
9640
|
)
|
|
9574
9641
|
] });
|
|
9575
9642
|
}
|
|
9576
9643
|
|
|
9577
|
-
// src/components/history/DepositHistoryPanel.tsx
|
|
9578
|
-
|
|
9579
|
-
|
|
9580
|
-
function shortenHash(hash) {
|
|
9581
|
-
if (hash.length <= 14) return hash;
|
|
9582
|
-
return `${hash.slice(0, 6)}\u2026${hash.slice(-4)}`;
|
|
9583
|
-
}
|
|
9584
|
-
function formatDate(iso) {
|
|
9585
|
-
try {
|
|
9586
|
-
const date = new Date(iso);
|
|
9587
|
-
if (Number.isNaN(date.getTime())) return iso;
|
|
9588
|
-
return date.toLocaleDateString("en-US", {
|
|
9589
|
-
day: "numeric",
|
|
9590
|
-
month: "short",
|
|
9591
|
-
year: "numeric"
|
|
9592
|
-
});
|
|
9593
|
-
} catch (e40) {
|
|
9594
|
-
return iso;
|
|
9595
|
-
}
|
|
9596
|
-
}
|
|
9597
|
-
function resolveChainId(value) {
|
|
9598
|
-
if (value === void 0 || value === null) return null;
|
|
9599
|
-
if (typeof value === "number") return value;
|
|
9600
|
-
if (_chunk4KCSH4T3cjs.isSolanaCaip2.call(void 0, value) || value === "solana") return "solana";
|
|
9601
|
-
if (_chunk4KCSH4T3cjs.isHyperCoreCaip2.call(void 0, value) || value === "hypercore") return "hypercore";
|
|
9602
|
-
const parsed = _chunk4KCSH4T3cjs.parseEvmChainId.call(void 0, value);
|
|
9603
|
-
if (parsed !== null) return parsed;
|
|
9604
|
-
const num = Number(value);
|
|
9605
|
-
return Number.isFinite(num) ? num : null;
|
|
9606
|
-
}
|
|
9607
|
-
function resolveTokenSymbol(token, chainId) {
|
|
9608
|
-
if (!token) return "";
|
|
9609
|
-
if (chainId === "solana") {
|
|
9610
|
-
const normalized = token.toLowerCase();
|
|
9611
|
-
const matched = _chunk4KCSH4T3cjs.SOLANA_TOKENS.find(
|
|
9612
|
-
(entry) => entry.mint.toLowerCase() === normalized
|
|
9613
|
-
);
|
|
9614
|
-
if (matched) return matched.symbol;
|
|
9615
|
-
if (normalized === "native" || normalized === "11111111111111111111111111111111" || normalized === "so11111111111111111111111111111111111111112") {
|
|
9616
|
-
return "SOL";
|
|
9617
|
-
}
|
|
9618
|
-
}
|
|
9619
|
-
if (chainId !== null && chainId !== void 0 && chainId !== "solana" && /^0x[a-fA-F0-9]{40}$/.test(token)) {
|
|
9620
|
-
const evmChainId = chainId === "hypercore" ? _chunk4KCSH4T3cjs.HYPERCORE_CHAIN_ID : chainId;
|
|
9621
|
-
const sym = _chunk4KCSH4T3cjs.getTokenSymbol.call(void 0, token, evmChainId);
|
|
9622
|
-
if (sym !== "Token") return sym;
|
|
9623
|
-
}
|
|
9624
|
-
return shortenHash(token);
|
|
9625
|
-
}
|
|
9626
|
-
function formatAmount(rawAmount, token, chainId) {
|
|
9627
|
-
if (!rawAmount) return "";
|
|
9628
|
-
let decimals = 18;
|
|
9629
|
-
if (token && chainId !== null && chainId !== void 0) {
|
|
9630
|
-
if (chainId === "solana") {
|
|
9631
|
-
const normalized = token.toLowerCase();
|
|
9632
|
-
const matched = _chunk4KCSH4T3cjs.SOLANA_TOKENS.find(
|
|
9633
|
-
(entry) => entry.mint.toLowerCase() === normalized
|
|
9634
|
-
);
|
|
9635
|
-
if (matched) {
|
|
9636
|
-
decimals = matched.decimals;
|
|
9637
|
-
} else if (normalized === "native" || normalized === "11111111111111111111111111111111" || normalized === "so11111111111111111111111111111111111111112") {
|
|
9638
|
-
decimals = 9;
|
|
9639
|
-
}
|
|
9640
|
-
} else if (/^0x[a-fA-F0-9]{40}$/.test(token)) {
|
|
9641
|
-
const evmChainId = chainId === "hypercore" ? _chunk4KCSH4T3cjs.HYPERCORE_CHAIN_ID : chainId;
|
|
9642
|
-
decimals = _chunk4KCSH4T3cjs.getTokenDecimalsByAddress.call(void 0, token, evmChainId);
|
|
9643
|
-
}
|
|
9644
|
-
}
|
|
9645
|
-
try {
|
|
9646
|
-
const raw = BigInt(rawAmount);
|
|
9647
|
-
const divisor = 10n ** BigInt(decimals);
|
|
9648
|
-
const whole = raw / divisor;
|
|
9649
|
-
const remainder = raw % divisor;
|
|
9650
|
-
const fracStr = remainder.toString().padStart(decimals, "0");
|
|
9651
|
-
let frac = fracStr.slice(0, 5).replace(/0+$/, "");
|
|
9652
|
-
if (frac.length < 2) frac = frac.padEnd(2, "0");
|
|
9653
|
-
return `${whole}.${frac}`;
|
|
9654
|
-
} catch (e41) {
|
|
9655
|
-
return rawAmount;
|
|
9656
|
-
}
|
|
9657
|
-
}
|
|
9658
|
-
function normalizeStatus(raw, isSpam) {
|
|
9659
|
-
const lower = raw.toLowerCase();
|
|
9660
|
-
if (lower === "completed" || lower === "complete" || lower === "bridge-complete" || lower === "processed")
|
|
9661
|
-
return "completed";
|
|
9662
|
-
if (lower === "failed" || lower === "error" || lower === "bridge-failed") {
|
|
9663
|
-
return isSpam ? "spam" : "failed";
|
|
9664
|
-
}
|
|
9665
|
-
if (lower === "processing" || lower === "submitted" || lower === "bridging")
|
|
9666
|
-
return "processing";
|
|
9667
|
-
return "pending";
|
|
9668
|
-
}
|
|
9669
|
-
var STATUS_LABEL = {
|
|
9670
|
-
pending: "Pending",
|
|
9671
|
-
processing: "Processing",
|
|
9672
|
-
completed: "Completed",
|
|
9673
|
-
failed: "Failed",
|
|
9674
|
-
spam: "Spam token"
|
|
9675
|
-
};
|
|
9676
|
-
function DepositHistoryPanel({
|
|
9677
|
-
deposits,
|
|
9678
|
-
isLoading,
|
|
9679
|
-
error,
|
|
9680
|
-
hasMore,
|
|
9681
|
-
isLoadingMore,
|
|
9682
|
-
onLoadMore,
|
|
9683
|
-
onClose,
|
|
9684
|
-
onCloseModal
|
|
9685
|
-
}) {
|
|
9686
|
-
const handleKeyDown = _react.useCallback.call(void 0,
|
|
9687
|
-
(e) => {
|
|
9688
|
-
if (e.key === "Escape") {
|
|
9689
|
-
e.stopPropagation();
|
|
9690
|
-
onClose();
|
|
9691
|
-
}
|
|
9692
|
-
},
|
|
9693
|
-
[onClose]
|
|
9694
|
-
);
|
|
9695
|
-
const visibleDeposits = _react.useMemo.call(void 0, () => {
|
|
9696
|
-
const sourceHashes = new Set(
|
|
9697
|
-
deposits.map((d) => _optionalChain([d, 'access', _336 => _336.sourceTxHash, 'optionalAccess', _337 => _337.toLowerCase, 'call', _338 => _338()])).filter((h) => Boolean(h))
|
|
9698
|
-
);
|
|
9699
|
-
return deposits.filter(
|
|
9700
|
-
(d) => !(d.txHash && sourceHashes.has(d.txHash.toLowerCase()))
|
|
9701
|
-
);
|
|
9702
|
-
}, [deposits]);
|
|
9703
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
9704
|
-
"div",
|
|
9705
|
-
{
|
|
9706
|
-
className: "rs-history-panel",
|
|
9707
|
-
role: "dialog",
|
|
9708
|
-
"aria-label": "Deposit history",
|
|
9709
|
-
onKeyDown: handleKeyDown,
|
|
9710
|
-
children: [
|
|
9711
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header--redesigned", children: [
|
|
9712
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-left", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9713
|
-
"button",
|
|
9714
|
-
{
|
|
9715
|
-
type: "button",
|
|
9716
|
-
className: "rs-modal-header-back",
|
|
9717
|
-
"aria-label": "Back",
|
|
9718
|
-
onClick: onClose,
|
|
9719
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.ChevronLeftIcon, {})
|
|
9720
|
-
}
|
|
9721
|
-
) }),
|
|
9722
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: onCloseModal && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9723
|
-
"button",
|
|
9724
|
-
{
|
|
9725
|
-
type: "button",
|
|
9726
|
-
className: "rs-modal-close",
|
|
9727
|
-
"aria-label": "Close",
|
|
9728
|
-
onClick: onCloseModal,
|
|
9729
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CloseIcon, {})
|
|
9730
|
-
}
|
|
9731
|
-
) })
|
|
9732
|
-
] }),
|
|
9733
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen", children: [
|
|
9734
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-screen-body", children: [
|
|
9735
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.HistoryIcon, {}), title: "History" }),
|
|
9736
|
-
isLoading && deposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
9737
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.HistoryIcon, {}) }),
|
|
9738
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
9739
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.Spinner, { className: "rs-spinner--sm" }),
|
|
9740
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Loading history\u2026" })
|
|
9741
|
-
] })
|
|
9742
|
-
] }),
|
|
9743
|
-
error && !isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
9744
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.AlertTriangleIcon, {}) }),
|
|
9745
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
9746
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "Couldn't load history" }),
|
|
9747
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: error })
|
|
9748
|
-
] })
|
|
9749
|
-
] }),
|
|
9750
|
-
!isLoading && !error && visibleDeposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty", children: [
|
|
9751
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-glyph", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.HistoryIcon, {}) }),
|
|
9752
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-empty-text", children: [
|
|
9753
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-title", children: "No deposits yet" }),
|
|
9754
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-empty-hint", children: "Your deposit history will appear here" })
|
|
9755
|
-
] })
|
|
9756
|
-
] }),
|
|
9757
|
-
visibleDeposits.length > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-list", children: [
|
|
9758
|
-
visibleDeposits.map((deposit, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HistoryCard, { deposit }, deposit.txHash || i)),
|
|
9759
|
-
hasMore && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9760
|
-
"button",
|
|
9761
|
-
{
|
|
9762
|
-
type: "button",
|
|
9763
|
-
className: "rs-history-load-more",
|
|
9764
|
-
onClick: onLoadMore,
|
|
9765
|
-
disabled: isLoadingMore,
|
|
9766
|
-
children: isLoadingMore ? "Loading\u2026" : "Load more"
|
|
9767
|
-
}
|
|
9768
|
-
)
|
|
9769
|
-
] })
|
|
9770
|
-
] }),
|
|
9771
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.PoweredBy, {})
|
|
9772
|
-
] })
|
|
9773
|
-
]
|
|
9774
|
-
}
|
|
9775
|
-
);
|
|
9776
|
-
}
|
|
9777
|
-
function HistoryCard({ deposit }) {
|
|
9778
|
-
const explorerTxUrl = _chunkV2OBGLJDcjs.useExplorerTxUrl.call(void 0, );
|
|
9779
|
-
const [expanded, setExpanded] = _react.useState.call(void 0, false);
|
|
9780
|
-
const status = normalizeStatus(deposit.status, deposit.isSpam);
|
|
9781
|
-
const sourceChainId = resolveChainId(deposit.chain);
|
|
9782
|
-
const targetChainId = resolveChainId(deposit.targetChain);
|
|
9783
|
-
const sourceChainName = sourceChainId ? _chunk4KCSH4T3cjs.getChainName.call(void 0, sourceChainId) : null;
|
|
9784
|
-
const targetChainName = targetChainId ? _chunk4KCSH4T3cjs.getChainName.call(void 0, targetChainId) : null;
|
|
9785
|
-
const sourceChainIcon = sourceChainId ? _chunk4KCSH4T3cjs.getChainIcon.call(void 0, sourceChainId) : void 0;
|
|
9786
|
-
const targetChainIcon = targetChainId ? _chunk4KCSH4T3cjs.getChainIcon.call(void 0, targetChainId) : void 0;
|
|
9787
|
-
const sourceSymbol = resolveTokenSymbol(deposit.token, sourceChainId);
|
|
9788
|
-
const rawAmount = deposit.sourceAmount && deposit.sourceAmount !== "0" ? deposit.sourceAmount : deposit.amount;
|
|
9789
|
-
const formattedAmount = rawAmount ? formatAmount(rawAmount, deposit.token, sourceChainId) : null;
|
|
9790
|
-
const displayAmount = formattedAmount ? sourceSymbol && /^USD/.test(sourceSymbol) ? `$${Number(formattedAmount).toLocaleString("en-US", {
|
|
9791
|
-
minimumFractionDigits: 2,
|
|
9792
|
-
maximumFractionDigits: 2
|
|
9793
|
-
})}` : `${formattedAmount} ${sourceSymbol}` : "\u2014";
|
|
9794
|
-
const date = deposit.createdAt ? formatDate(deposit.createdAt) : null;
|
|
9795
|
-
const txTypeLabel = `Deposit${sourceSymbol ? ` ${sourceSymbol}` : ""}`;
|
|
9796
|
-
const srcTxHash = sourceChainId === "hypercore" ? deposit.txHash : deposit.sourceTxHash;
|
|
9797
|
-
const srcTxUrl = srcTxHash && sourceChainId ? explorerTxUrl(sourceChainId, srcTxHash) : null;
|
|
9798
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
9799
|
-
"button",
|
|
9800
|
-
{
|
|
9801
|
-
type: "button",
|
|
9802
|
-
className: `rs-history-card ${expanded ? "rs-history-card--expanded" : ""}`,
|
|
9803
|
-
onClick: () => setExpanded((v) => !v),
|
|
9804
|
-
"aria-expanded": expanded,
|
|
9805
|
-
children: [
|
|
9806
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-card-row", children: [
|
|
9807
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-card-icons", children: [
|
|
9808
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-token", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.TokenIcon, { symbol: sourceSymbol, fallback: sourceSymbol.slice(0, 2) }) }),
|
|
9809
|
-
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-chain", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CdnIcon, { src: sourceChainIcon }) })
|
|
9810
|
-
] }),
|
|
9811
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-card-text", children: [
|
|
9812
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-title", children: txTypeLabel }),
|
|
9813
|
-
date && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-date", children: date })
|
|
9814
|
-
] }),
|
|
9815
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-card-side", children: [
|
|
9816
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-card-amount", children: displayAmount }),
|
|
9817
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `rs-history-badge rs-history-badge--${status}`, children: STATUS_LABEL[status] })
|
|
9818
|
-
] })
|
|
9819
|
-
] }),
|
|
9820
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-history-card-panel", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-history-card-panel-inner", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-card-details", children: [
|
|
9821
|
-
sourceChainName && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
9822
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
9823
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-detail-value", children: [
|
|
9824
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceChainName }),
|
|
9825
|
-
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CdnIcon, { src: sourceChainIcon }) })
|
|
9826
|
-
] })
|
|
9827
|
-
] }),
|
|
9828
|
-
targetChainName && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
9829
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
|
|
9830
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-detail-value", children: [
|
|
9831
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName }),
|
|
9832
|
-
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-amount-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.CdnIcon, { src: targetChainIcon }) })
|
|
9833
|
-
] })
|
|
9834
|
-
] }),
|
|
9835
|
-
srcTxUrl && srcTxHash && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
9836
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Transaction details" }),
|
|
9837
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
9838
|
-
"a",
|
|
9839
|
-
{
|
|
9840
|
-
href: srcTxUrl,
|
|
9841
|
-
target: "_blank",
|
|
9842
|
-
rel: "noopener noreferrer",
|
|
9843
|
-
className: "rs-history-card-link",
|
|
9844
|
-
onClick: (e) => e.stopPropagation(),
|
|
9845
|
-
children: [
|
|
9846
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: shortenHash(srcTxHash) }),
|
|
9847
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.ArrowUpRightIcon, {})
|
|
9848
|
-
]
|
|
9849
|
-
}
|
|
9850
|
-
)
|
|
9851
|
-
] })
|
|
9852
|
-
] }) }) })
|
|
9853
|
-
]
|
|
9854
|
-
}
|
|
9855
|
-
);
|
|
9856
|
-
}
|
|
9857
|
-
DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
9858
|
-
|
|
9859
9644
|
// src/DepositModal.tsx
|
|
9860
9645
|
|
|
9861
|
-
var ReownDepositInner = _react.lazy.call(void 0,
|
|
9862
|
-
|
|
9863
|
-
);
|
|
9864
|
-
|
|
9865
|
-
|
|
9866
|
-
const at = a.createdAt ? Date.parse(a.createdAt) : 0;
|
|
9867
|
-
const bt = b.createdAt ? Date.parse(b.createdAt) : 0;
|
|
9868
|
-
return bt - at;
|
|
9869
|
-
});
|
|
9870
|
-
}
|
|
9646
|
+
var ReownDepositInner = _react.lazy.call(void 0, async () => {
|
|
9647
|
+
await loadReownDependencies();
|
|
9648
|
+
const module = await Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-R37SSHUF.cjs")));
|
|
9649
|
+
return { default: module.DepositModalReown };
|
|
9650
|
+
});
|
|
9871
9651
|
function buildDepositAnalyticsSessionProperties({
|
|
9872
9652
|
enableWallet = true,
|
|
9873
9653
|
enableFiatOnramp = false,
|
|
@@ -9894,7 +9674,7 @@ function buildDepositAnalyticsSessionProperties({
|
|
|
9894
9674
|
enabledFundingMethods.push("wallet");
|
|
9895
9675
|
}
|
|
9896
9676
|
if (enableQrTransfer) enabledFundingMethods.push("transfer");
|
|
9897
|
-
if (enableFiatOnramp && _optionalChain([configuredFiatIdentifiers, 'optionalAccess',
|
|
9677
|
+
if (enableFiatOnramp && _optionalChain([configuredFiatIdentifiers, 'optionalAccess', _340 => _340.length]) !== 0) {
|
|
9898
9678
|
enabledFundingMethods.push("fiat_onramp");
|
|
9899
9679
|
}
|
|
9900
9680
|
if (enableExchangeConnect) enabledFundingMethods.push("exchange_connect");
|
|
@@ -9914,7 +9694,7 @@ function buildDepositAnalyticsSessionProperties({
|
|
|
9914
9694
|
amount: defaultAmount !== void 0,
|
|
9915
9695
|
initial_asset_migration: initialAssetMigration !== void 0
|
|
9916
9696
|
},
|
|
9917
|
-
...
|
|
9697
|
+
..._chunkX4D52IZKcjs.analyticsTargetProperties.call(void 0, { targetChain, targetToken })
|
|
9918
9698
|
};
|
|
9919
9699
|
}
|
|
9920
9700
|
var WALLET_CLIENT_PROP = "walletClient";
|
|
@@ -9922,8 +9702,8 @@ function hasSuppliedWalletClient(props) {
|
|
|
9922
9702
|
return Object.prototype.hasOwnProperty.call(props, WALLET_CLIENT_PROP);
|
|
9923
9703
|
}
|
|
9924
9704
|
function DepositModal(props) {
|
|
9925
|
-
|
|
9926
|
-
|
|
9705
|
+
_chunkX4D52IZKcjs.warnRemovedProps.call(void 0, "DepositModal", props);
|
|
9706
|
+
_chunk3OOY67VJcjs.checkBackendUrl.call(void 0, "DepositModal", props.backendUrl);
|
|
9927
9707
|
const needsReown = !!props.reownAppId;
|
|
9928
9708
|
const hasWalletClientProp = hasSuppliedWalletClient(props);
|
|
9929
9709
|
if (needsReown) {
|
|
@@ -9988,39 +9768,57 @@ function DepositModalInner({
|
|
|
9988
9768
|
onUiState,
|
|
9989
9769
|
openExternally,
|
|
9990
9770
|
walletIntegration: walletIntegrationProp,
|
|
9771
|
+
signRecovery,
|
|
9991
9772
|
debug
|
|
9992
9773
|
}) {
|
|
9993
9774
|
const modalRef = _react.useRef.call(void 0, null);
|
|
9994
9775
|
const analyticsControllerRef = _react.useRef.call(void 0, null);
|
|
9776
|
+
const analyticsSessionIdRef = _react.useRef.call(void 0, null);
|
|
9995
9777
|
const previousOpenRef = _react.useRef.call(void 0, isOpen);
|
|
9996
|
-
const onReadyRef =
|
|
9997
|
-
const onUiStateRef =
|
|
9778
|
+
const onReadyRef = _chunk3OOY67VJcjs.useLatestRef.call(void 0, onReady);
|
|
9779
|
+
const onUiStateRef = _chunk3OOY67VJcjs.useLatestRef.call(void 0, onUiState);
|
|
9998
9780
|
const [currentScreen, setCurrentScreen] = _react.useState.call(void 0, "connect");
|
|
9999
9781
|
const [swappedImmersive, setSwappedImmersive] = _react.useState.call(void 0, false);
|
|
10000
9782
|
const [submitting, setSubmitting] = _react.useState.call(void 0, false);
|
|
10001
9783
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
10002
9784
|
void 0
|
|
10003
9785
|
);
|
|
10004
|
-
const
|
|
10005
|
-
const
|
|
10006
|
-
|
|
10007
|
-
|
|
10008
|
-
|
|
10009
|
-
|
|
10010
|
-
const
|
|
10011
|
-
const
|
|
10012
|
-
const
|
|
10013
|
-
const historyLoadedRef = _react.useRef.call(void 0, false);
|
|
10014
|
-
const targetChain = targetChainProp === "solana" || targetChainProp === _chunk4KCSH4T3cjs.HYPERCORE_SPOT_CAIP2 ? targetChainProp : _chunk4KCSH4T3cjs.getChainId.call(void 0, targetChainProp);
|
|
10015
|
-
const sourceChain = sourceChainProp ? _chunk4KCSH4T3cjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
10016
|
-
const rpcUrls = _chunkV2OBGLJDcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
|
|
9786
|
+
const [processingSettled, setProcessingSettled] = _react.useState.call(void 0, false);
|
|
9787
|
+
const historyButtonVisible = _chunkX4D52IZKcjs.isHistoryEntryVisible.call(void 0, {
|
|
9788
|
+
screen: currentScreen,
|
|
9789
|
+
submitting,
|
|
9790
|
+
settled: processingSettled
|
|
9791
|
+
});
|
|
9792
|
+
const targetChain = typeof targetChainProp === "string" ? targetChainProp : _chunkOY5N3E6Lcjs.getChainId.call(void 0, targetChainProp);
|
|
9793
|
+
const sourceChain = sourceChainProp ? _chunkOY5N3E6Lcjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
9794
|
+
const rpcUrls = _chunk3OOY67VJcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
|
|
10017
9795
|
const service = _react.useMemo.call(void 0,
|
|
10018
|
-
() =>
|
|
9796
|
+
() => _chunk3OOY67VJcjs.createDepositService.call(void 0, backendUrl, {
|
|
10019
9797
|
debug,
|
|
10020
9798
|
debugScope: "service:deposit"
|
|
10021
9799
|
}),
|
|
10022
9800
|
[backendUrl, debug]
|
|
10023
9801
|
);
|
|
9802
|
+
const historyAnalytics = _react.useMemo.call(void 0,
|
|
9803
|
+
() => _chunkX4D52IZKcjs.createHistoryAnalytics.call(void 0, {
|
|
9804
|
+
modal: "deposit",
|
|
9805
|
+
controllerRef: analyticsControllerRef,
|
|
9806
|
+
sessionIdRef: analyticsSessionIdRef
|
|
9807
|
+
}),
|
|
9808
|
+
[]
|
|
9809
|
+
);
|
|
9810
|
+
const history = _chunkX4D52IZKcjs.useHistoryPanel.call(void 0, {
|
|
9811
|
+
isOpen,
|
|
9812
|
+
recipient,
|
|
9813
|
+
service,
|
|
9814
|
+
canRecover: Boolean(signRecovery),
|
|
9815
|
+
analytics: historyAnalytics
|
|
9816
|
+
});
|
|
9817
|
+
const {
|
|
9818
|
+
markStale: markHistoryStale,
|
|
9819
|
+
invalidate: invalidateHistory,
|
|
9820
|
+
recoverySubmitting
|
|
9821
|
+
} = history;
|
|
10024
9822
|
const [clientSetup, setClientSetup] = _react.useState.call(void 0,
|
|
10025
9823
|
null
|
|
10026
9824
|
);
|
|
@@ -10049,20 +9847,28 @@ function DepositModalInner({
|
|
|
10049
9847
|
}, [store, targetChain, targetToken]);
|
|
10050
9848
|
_react.useEffect.call(void 0, () => {
|
|
10051
9849
|
if (!isOpen || !modalRef.current) return;
|
|
10052
|
-
return
|
|
9850
|
+
return _chunk3OOY67VJcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
10053
9851
|
}, [isOpen, theme]);
|
|
10054
9852
|
_react.useEffect.call(void 0, () => {
|
|
10055
9853
|
if (isOpen) {
|
|
10056
|
-
_optionalChain([onReadyRef, 'access',
|
|
9854
|
+
_optionalChain([onReadyRef, 'access', _341 => _341.current, 'optionalCall', _342 => _342()]);
|
|
10057
9855
|
}
|
|
10058
9856
|
}, [isOpen, onReadyRef]);
|
|
10059
9857
|
_react.useEffect.call(void 0, () => {
|
|
10060
|
-
_optionalChain([onUiStateRef, 'access',
|
|
9858
|
+
_optionalChain([onUiStateRef, 'access', _343 => _343.current, 'optionalCall', _344 => _344({
|
|
10061
9859
|
screen: currentScreen,
|
|
10062
9860
|
back: backHandler,
|
|
10063
|
-
|
|
9861
|
+
// A recovery in flight is a submission whose outcome is unknown, so a
|
|
9862
|
+
// native host's dismissal lock has to hold through it too.
|
|
9863
|
+
submitting: submitting || recoverySubmitting
|
|
10064
9864
|
})]);
|
|
10065
|
-
}, [
|
|
9865
|
+
}, [
|
|
9866
|
+
currentScreen,
|
|
9867
|
+
backHandler,
|
|
9868
|
+
submitting,
|
|
9869
|
+
recoverySubmitting,
|
|
9870
|
+
onUiStateRef
|
|
9871
|
+
]);
|
|
10066
9872
|
const handleStepChange = _react.useCallback.call(void 0,
|
|
10067
9873
|
(onBack, screen) => {
|
|
10068
9874
|
setBackHandler(() => onBack);
|
|
@@ -10070,93 +9876,28 @@ function DepositModalInner({
|
|
|
10070
9876
|
},
|
|
10071
9877
|
[]
|
|
10072
9878
|
);
|
|
10073
|
-
const
|
|
10074
|
-
async (mode = "initial") => {
|
|
10075
|
-
if (!recipient) return;
|
|
10076
|
-
const isInitial = mode === "initial";
|
|
10077
|
-
if (isInitial) {
|
|
10078
|
-
setHistoryLoading(true);
|
|
10079
|
-
} else {
|
|
10080
|
-
setHistoryLoadingMore(true);
|
|
10081
|
-
}
|
|
10082
|
-
setHistoryError(null);
|
|
10083
|
-
try {
|
|
10084
|
-
const cursor = isInitial ? null : cursorRef.current;
|
|
10085
|
-
if (!isInitial && !cursor) {
|
|
10086
|
-
setHasMoreHistory(false);
|
|
10087
|
-
return;
|
|
10088
|
-
}
|
|
10089
|
-
const result = await service.fetchDepositHistory({
|
|
10090
|
-
recipient,
|
|
10091
|
-
limit: 20,
|
|
10092
|
-
cursor: _nullishCoalesce(cursor, () => ( void 0))
|
|
10093
|
-
});
|
|
10094
|
-
const incoming = result.deposits;
|
|
10095
|
-
const nextCursor = _nullishCoalesce(result.nextCursor, () => ( null));
|
|
10096
|
-
if (isInitial) {
|
|
10097
|
-
setHistoryDeposits(sortByCreatedAtDesc(incoming));
|
|
10098
|
-
} else {
|
|
10099
|
-
setHistoryDeposits(
|
|
10100
|
-
(prev) => sortByCreatedAtDesc([...prev, ...incoming])
|
|
10101
|
-
);
|
|
10102
|
-
}
|
|
10103
|
-
cursorRef.current = nextCursor;
|
|
10104
|
-
setHasMoreHistory(Boolean(nextCursor));
|
|
10105
|
-
historyStaleRef.current = false;
|
|
10106
|
-
historyLoadedRef.current = true;
|
|
10107
|
-
} catch (err) {
|
|
10108
|
-
setHistoryError(
|
|
10109
|
-
err instanceof Error ? err.message : "Failed to load history"
|
|
10110
|
-
);
|
|
10111
|
-
} finally {
|
|
10112
|
-
if (isInitial) {
|
|
10113
|
-
setHistoryLoading(false);
|
|
10114
|
-
} else {
|
|
10115
|
-
setHistoryLoadingMore(false);
|
|
10116
|
-
}
|
|
10117
|
-
}
|
|
10118
|
-
},
|
|
10119
|
-
[recipient, service]
|
|
10120
|
-
);
|
|
10121
|
-
const handleHistoryOpen = _react.useCallback.call(void 0, () => {
|
|
10122
|
-
setHistoryOpen(true);
|
|
10123
|
-
if (!historyLoadedRef.current || historyStaleRef.current) {
|
|
10124
|
-
fetchHistory("initial");
|
|
10125
|
-
}
|
|
10126
|
-
}, [fetchHistory]);
|
|
10127
|
-
const handleHistoryClose = _react.useCallback.call(void 0, () => {
|
|
10128
|
-
setHistoryOpen(false);
|
|
10129
|
-
}, []);
|
|
10130
|
-
const handleHistoryLoadMore = _react.useCallback.call(void 0, () => {
|
|
10131
|
-
fetchHistory("more");
|
|
10132
|
-
}, [fetchHistory]);
|
|
10133
|
-
const markHistoryStale = _react.useCallback.call(void 0, () => {
|
|
10134
|
-
historyStaleRef.current = true;
|
|
10135
|
-
if (historyOpen) {
|
|
10136
|
-
fetchHistory("initial");
|
|
10137
|
-
}
|
|
10138
|
-
}, [historyOpen, fetchHistory]);
|
|
10139
|
-
const onLifecycleRef = _chunkV2OBGLJDcjs.useLatestRef.call(void 0, onLifecycle);
|
|
9879
|
+
const onLifecycleRef = _chunk3OOY67VJcjs.useLatestRef.call(void 0, onLifecycle);
|
|
10140
9880
|
const handleLifecycle = _react.useCallback.call(void 0,
|
|
10141
9881
|
(event) => {
|
|
10142
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
9882
|
+
_optionalChain([onLifecycleRef, 'access', _345 => _345.current, 'optionalCall', _346 => _346(event)]);
|
|
10143
9883
|
if (event.type === "smart-account-changed" && !event.evm && !event.solana) {
|
|
10144
|
-
|
|
9884
|
+
invalidateHistory();
|
|
10145
9885
|
}
|
|
10146
9886
|
if (event.type === "submitted" || event.type === "complete" || event.type === "failed") {
|
|
10147
9887
|
markHistoryStale();
|
|
10148
9888
|
}
|
|
10149
9889
|
},
|
|
10150
|
-
[onLifecycleRef, markHistoryStale]
|
|
9890
|
+
[onLifecycleRef, markHistoryStale, invalidateHistory]
|
|
10151
9891
|
);
|
|
10152
9892
|
const closeWithSource = _react.useCallback.call(void 0,
|
|
10153
9893
|
(source) => {
|
|
9894
|
+
if (recoverySubmitting) return;
|
|
10154
9895
|
const analytics = analyticsControllerRef.current;
|
|
10155
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
10156
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
9896
|
+
_optionalChain([analytics, 'optionalAccess', _347 => _347.abandon, 'call', _348 => _348(source === "provider_back" ? "provider_back" : "modal_close")]);
|
|
9897
|
+
_optionalChain([analytics, 'optionalAccess', _349 => _349.close, 'call', _350 => _350(source)]);
|
|
10157
9898
|
onClose();
|
|
10158
9899
|
},
|
|
10159
|
-
[onClose]
|
|
9900
|
+
[onClose, recoverySubmitting]
|
|
10160
9901
|
);
|
|
10161
9902
|
const handleModalDismiss = _react.useCallback.call(void 0,
|
|
10162
9903
|
(reason) => {
|
|
@@ -10169,24 +9910,18 @@ function DepositModalInner({
|
|
|
10169
9910
|
_react.useEffect.call(void 0, () => {
|
|
10170
9911
|
if (previousOpenRef.current && !isOpen) {
|
|
10171
9912
|
const analytics = analyticsControllerRef.current;
|
|
10172
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
10173
|
-
_optionalChain([analytics, 'optionalAccess',
|
|
9913
|
+
_optionalChain([analytics, 'optionalAccess', _351 => _351.abandon, 'call', _352 => _352("modal_close")]);
|
|
9914
|
+
_optionalChain([analytics, 'optionalAccess', _353 => _353.close, 'call', _354 => _354("host_controlled")]);
|
|
10174
9915
|
}
|
|
10175
9916
|
previousOpenRef.current = isOpen;
|
|
10176
9917
|
}, [isOpen]);
|
|
10177
9918
|
_react.useEffect.call(void 0, () => {
|
|
10178
9919
|
if (!isOpen) {
|
|
10179
|
-
setHistoryOpen(false);
|
|
10180
|
-
setHistoryDeposits([]);
|
|
10181
|
-
setHasMoreHistory(false);
|
|
10182
|
-
setHistoryError(null);
|
|
10183
|
-
cursorRef.current = null;
|
|
10184
|
-
historyStaleRef.current = false;
|
|
10185
|
-
historyLoadedRef.current = false;
|
|
10186
9920
|
setCurrentScreen("connect");
|
|
10187
9921
|
setBackHandler(void 0);
|
|
10188
9922
|
setSwappedImmersive(false);
|
|
10189
9923
|
setSubmitting(false);
|
|
9924
|
+
setProcessingSettled(false);
|
|
10190
9925
|
}
|
|
10191
9926
|
}, [isOpen]);
|
|
10192
9927
|
_react.useEffect.call(void 0, () => {
|
|
@@ -10213,20 +9948,21 @@ function DepositModalInner({
|
|
|
10213
9948
|
targetChain,
|
|
10214
9949
|
targetToken
|
|
10215
9950
|
});
|
|
10216
|
-
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
9951
|
+
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _355 => _355.showBackButton]), () => ( true));
|
|
10217
9952
|
const canGoBack = backHandler !== void 0;
|
|
10218
9953
|
const hideHeaderChrome = swappedImmersive;
|
|
10219
9954
|
const modalClassName = `rs-modal${hideHeaderChrome ? " rs-modal--swapped-iframe" : ""}`;
|
|
10220
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
10221
|
-
|
|
9955
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.ChainCatalogProvider, { service, rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9956
|
+
_chunk3OOY67VJcjs.Modal,
|
|
10222
9957
|
{
|
|
10223
9958
|
isOpen,
|
|
10224
9959
|
onClose: handleModalDismiss,
|
|
10225
9960
|
className,
|
|
10226
9961
|
inline,
|
|
10227
9962
|
closeOnOverlayClick,
|
|
9963
|
+
ariaLabel: "Deposit",
|
|
10228
9964
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
10229
|
-
|
|
9965
|
+
_chunk3OOY67VJcjs.AnalyticsSession,
|
|
10230
9966
|
{
|
|
10231
9967
|
modal: "deposit",
|
|
10232
9968
|
sessionProperties: analyticsSessionProperties,
|
|
@@ -10234,6 +9970,7 @@ function DepositModalInner({
|
|
|
10234
9970
|
backendUrl,
|
|
10235
9971
|
enableIngest: enableAnalyticsIngest,
|
|
10236
9972
|
ingestUrl: analyticsIngestUrl,
|
|
9973
|
+
sessionIdRef: analyticsSessionIdRef,
|
|
10237
9974
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
10238
9975
|
DepositAnalyticsControllerProvider,
|
|
10239
9976
|
{
|
|
@@ -10247,19 +9984,16 @@ function DepositModalInner({
|
|
|
10247
9984
|
className: "rs-modal-header-back",
|
|
10248
9985
|
"aria-label": "Go back",
|
|
10249
9986
|
onClick: backHandler,
|
|
10250
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
9987
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.ChevronLeftIcon, {})
|
|
10251
9988
|
}
|
|
10252
9989
|
) }),
|
|
10253
9990
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
|
|
10254
9991
|
historyButtonVisible && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
10255
|
-
|
|
9992
|
+
_chunkX4D52IZKcjs.HistoryEntryButton,
|
|
10256
9993
|
{
|
|
10257
|
-
|
|
10258
|
-
|
|
10259
|
-
|
|
10260
|
-
onClick: handleHistoryOpen,
|
|
10261
|
-
disabled: !recipient,
|
|
10262
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkV2OBGLJDcjs.HistoryIcon, {})
|
|
9994
|
+
badge: history.badge,
|
|
9995
|
+
onClick: history.openPanel,
|
|
9996
|
+
disabled: !recipient
|
|
10263
9997
|
}
|
|
10264
9998
|
),
|
|
10265
9999
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -10269,7 +10003,7 @@ function DepositModalInner({
|
|
|
10269
10003
|
onClick: () => closeWithSource("header_button"),
|
|
10270
10004
|
className: "rs-modal-close",
|
|
10271
10005
|
"aria-label": "Close",
|
|
10272
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
10006
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk3OOY67VJcjs.CloseIcon, {})
|
|
10273
10007
|
}
|
|
10274
10008
|
)
|
|
10275
10009
|
] })
|
|
@@ -10305,29 +10039,36 @@ function DepositModalInner({
|
|
|
10305
10039
|
onDisconnect,
|
|
10306
10040
|
onRequestConnect,
|
|
10307
10041
|
uiConfig,
|
|
10308
|
-
appFees: _optionalChain([clientSetup, 'optionalAccess',
|
|
10042
|
+
appFees: _optionalChain([clientSetup, 'optionalAccess', _356 => _356.appFees]),
|
|
10309
10043
|
appFeesResolved: clientSetup !== null,
|
|
10310
10044
|
onStepChange: handleStepChange,
|
|
10311
10045
|
onSwappedImmersiveChange: setSwappedImmersive,
|
|
10312
10046
|
openExternally,
|
|
10313
10047
|
onSubmittingChange: setSubmitting,
|
|
10048
|
+
onProcessingSettledChange: setProcessingSettled,
|
|
10314
10049
|
onClose: (source) => closeWithSource(_nullishCoalesce(source, () => ( "header_button"))),
|
|
10315
10050
|
onLifecycle: handleLifecycle,
|
|
10316
10051
|
onError,
|
|
10317
10052
|
debug
|
|
10318
10053
|
}
|
|
10319
10054
|
),
|
|
10320
|
-
|
|
10321
|
-
|
|
10055
|
+
history.isPanelOpen && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
10056
|
+
_chunkX4D52IZKcjs.HistoryOverlay,
|
|
10322
10057
|
{
|
|
10323
|
-
|
|
10324
|
-
|
|
10325
|
-
|
|
10326
|
-
|
|
10327
|
-
|
|
10328
|
-
|
|
10329
|
-
|
|
10330
|
-
onCloseModal: () => closeWithSource("header_button")
|
|
10058
|
+
controller: history,
|
|
10059
|
+
backLabel: "Deposit",
|
|
10060
|
+
recipient,
|
|
10061
|
+
backendUrl,
|
|
10062
|
+
service,
|
|
10063
|
+
signRecovery,
|
|
10064
|
+
debug,
|
|
10065
|
+
onCloseModal: () => closeWithSource("header_button"),
|
|
10066
|
+
analytics: historyAnalytics,
|
|
10067
|
+
inline,
|
|
10068
|
+
closeOnOverlayClick,
|
|
10069
|
+
enableAnalyticsIngest,
|
|
10070
|
+
analyticsIngestUrl,
|
|
10071
|
+
onEvent
|
|
10331
10072
|
}
|
|
10332
10073
|
)
|
|
10333
10074
|
] })
|
|
@@ -10342,4 +10083,5 @@ function DepositModalInner({
|
|
|
10342
10083
|
|
|
10343
10084
|
|
|
10344
10085
|
|
|
10345
|
-
|
|
10086
|
+
|
|
10087
|
+
exports.getReownDependencies = getReownDependencies; exports.DepositModal = DepositModal; exports.DepositModalInner = DepositModalInner;
|