@rhinestone/deposit-modal 0.1.65 → 0.1.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{DepositModalReown-Y4M3RA73.mjs → DepositModalReown-EYIV6APK.mjs} +3 -3
- package/dist/{DepositModalReown-6ZMLUWWD.cjs → DepositModalReown-UPYZN2XA.cjs} +4 -4
- package/dist/{WithdrawModalReown-HVBMAUPM.mjs → WithdrawModalReown-6VYKKKJN.mjs} +3 -3
- package/dist/{WithdrawModalReown-WJ5SHBV4.cjs → WithdrawModalReown-WHPQDJJJ.cjs} +4 -4
- package/dist/{chunk-RKRF7ANK.mjs → chunk-5FDIQNJJ.mjs} +22 -19
- package/dist/{chunk-4CZ7W3RS.cjs → chunk-FLVSQDP4.cjs} +181 -132
- package/dist/{chunk-GAHX5RAT.mjs → chunk-IUW3SJQT.mjs} +103 -54
- package/dist/{chunk-MGV75YLV.cjs → chunk-LTLFJPHO.cjs} +106 -103
- package/dist/{chunk-R6U6BHCV.cjs → chunk-MUWVDVY4.cjs} +13 -1
- package/dist/{chunk-IYZGLNY6.mjs → chunk-NFE5ZLD3.mjs} +1171 -374
- package/dist/{chunk-CIXHTOO3.mjs → chunk-SDZKKUCJ.mjs} +13 -1
- package/dist/{chunk-OWV4KVBM.cjs → chunk-UDKZWFCM.cjs} +1251 -454
- package/dist/constants.cjs +2 -2
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +4 -4
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +3 -3
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +4 -4
- package/dist/reown.cjs +5 -5
- package/dist/reown.d.cts +1 -1
- package/dist/reown.d.ts +1 -1
- package/dist/reown.mjs +4 -4
- package/dist/styles.css +696 -34
- package/dist/{types-BLIqLF0c.d.ts → types-DGQzvl6v.d.ts} +12 -1
- package/dist/{types-7IoN8k-P.d.cts → types-DJ1fzNC7.d.cts} +12 -1
- package/dist/withdraw.cjs +4 -4
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +3 -3
- package/package.json +5 -5
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
var _chunk4CZ7W3RScjs = require('./chunk-4CZ7W3RS.cjs');
|
|
30
29
|
|
|
31
30
|
|
|
31
|
+
var _chunkFLVSQDP4cjs = require('./chunk-FLVSQDP4.cjs');
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
@@ -42,7 +42,12 @@ var _chunk4CZ7W3RScjs = require('./chunk-4CZ7W3RS.cjs');
|
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
var _chunkMUWVDVY4cjs = require('./chunk-MUWVDVY4.cjs');
|
|
46
51
|
|
|
47
52
|
// src/DepositModal.tsx
|
|
48
53
|
|
|
@@ -57,20 +62,21 @@ var _react = require('react');
|
|
|
57
62
|
|
|
58
63
|
// src/DepositFlow.tsx
|
|
59
64
|
|
|
65
|
+
var _viem = require('viem');
|
|
60
66
|
|
|
61
67
|
// src/components/steps/SetupStep.tsx
|
|
62
68
|
|
|
63
69
|
var _jsxruntime = require('react/jsx-runtime');
|
|
64
70
|
async function resolveSessionOwner(eoaAddress) {
|
|
65
|
-
const localOwner =
|
|
71
|
+
const localOwner = _chunkFLVSQDP4cjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
66
72
|
if (localOwner) {
|
|
67
73
|
return {
|
|
68
|
-
account:
|
|
74
|
+
account: _chunkFLVSQDP4cjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
69
75
|
address: localOwner.address
|
|
70
76
|
};
|
|
71
77
|
}
|
|
72
|
-
const created =
|
|
73
|
-
|
|
78
|
+
const created = _chunkFLVSQDP4cjs.createSessionOwnerKey.call(void 0, );
|
|
79
|
+
_chunkFLVSQDP4cjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
74
80
|
return {
|
|
75
81
|
account: created.account,
|
|
76
82
|
address: created.address
|
|
@@ -85,6 +91,8 @@ function SetupStep({
|
|
|
85
91
|
sessionChainIds,
|
|
86
92
|
recipient,
|
|
87
93
|
postBridgeActions,
|
|
94
|
+
outputTokenRules,
|
|
95
|
+
rejectUnmapped,
|
|
88
96
|
forceRegister,
|
|
89
97
|
enableSolana = true,
|
|
90
98
|
service,
|
|
@@ -107,7 +115,7 @@ function SetupStep({
|
|
|
107
115
|
const setup = await service.setupAccount({
|
|
108
116
|
ownerAddress: address,
|
|
109
117
|
sessionOwnerAddress: sessionOwner.address,
|
|
110
|
-
targetChain:
|
|
118
|
+
targetChain: _chunkFLVSQDP4cjs.toEvmCaip2.call(void 0, targetChain),
|
|
111
119
|
targetToken,
|
|
112
120
|
recipient,
|
|
113
121
|
postBridgeActions,
|
|
@@ -139,7 +147,7 @@ function SetupStep({
|
|
|
139
147
|
primaryType: typedData.primaryType,
|
|
140
148
|
message: typedData.message
|
|
141
149
|
});
|
|
142
|
-
const sessionDetails =
|
|
150
|
+
const sessionDetails = _chunkFLVSQDP4cjs.buildSessionDetails.call(void 0, setup.sessionDetailsUnsigned, signature);
|
|
143
151
|
setState({ type: "registering" });
|
|
144
152
|
const registerResult = await service.registerAccount({
|
|
145
153
|
address: smartAccount,
|
|
@@ -151,14 +159,16 @@ function SetupStep({
|
|
|
151
159
|
eoaAddress: address,
|
|
152
160
|
sessionOwner: sessionOwner.address,
|
|
153
161
|
target: {
|
|
154
|
-
chain:
|
|
162
|
+
chain: _chunkFLVSQDP4cjs.toEvmCaip2.call(void 0, targetChain),
|
|
155
163
|
token: targetToken,
|
|
156
164
|
...recipient && { recipient },
|
|
157
|
-
..._optionalChain([postBridgeActions, 'optionalAccess', _2 => _2.length]) && { postBridgeActions }
|
|
165
|
+
..._optionalChain([postBridgeActions, 'optionalAccess', _2 => _2.length]) && { postBridgeActions },
|
|
166
|
+
..._optionalChain([outputTokenRules, 'optionalAccess', _3 => _3.length]) && { outputTokenRules },
|
|
167
|
+
...rejectUnmapped != null && { rejectUnmapped }
|
|
158
168
|
}
|
|
159
169
|
});
|
|
160
170
|
setState({ type: "ready", smartAccount });
|
|
161
|
-
_optionalChain([onConnected, 'optionalCall',
|
|
171
|
+
_optionalChain([onConnected, 'optionalCall', _4 => _4(address, smartAccount)]);
|
|
162
172
|
onSetupComplete(
|
|
163
173
|
smartAccount,
|
|
164
174
|
enableSolana ? registerResult.solanaDepositAddress : void 0
|
|
@@ -166,7 +176,7 @@ function SetupStep({
|
|
|
166
176
|
} catch (error) {
|
|
167
177
|
const message = error instanceof Error ? error.message : "Setup failed";
|
|
168
178
|
setState({ type: "error", message });
|
|
169
|
-
_optionalChain([onError, 'optionalCall',
|
|
179
|
+
_optionalChain([onError, 'optionalCall', _5 => _5(message, "SETUP_ERROR")]);
|
|
170
180
|
}
|
|
171
181
|
}, [
|
|
172
182
|
address,
|
|
@@ -216,7 +226,7 @@ function SetupStep({
|
|
|
216
226
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
217
227
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", children: [
|
|
218
228
|
isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
219
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
229
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFLVSQDP4cjs.Spinner, { className: "rs-spinner--lg rs-text-accent" }),
|
|
220
230
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-text", children: [
|
|
221
231
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-title", children: renderStateMessage() }),
|
|
222
232
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-subtitle", children: "This may take a moment" })
|
|
@@ -253,13 +263,13 @@ function SetupStep({
|
|
|
253
263
|
] })
|
|
254
264
|
] })
|
|
255
265
|
] }),
|
|
256
|
-
isError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
266
|
+
isError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFLVSQDP4cjs.Button, { onClick: handleRetry, variant: "default", fullWidth: true, children: "Try Again" }) })
|
|
257
267
|
] });
|
|
258
268
|
}
|
|
259
269
|
|
|
260
270
|
// src/components/steps/AssetSelectStep.tsx
|
|
261
271
|
|
|
262
|
-
|
|
272
|
+
|
|
263
273
|
|
|
264
274
|
function AssetSelectStep({
|
|
265
275
|
address,
|
|
@@ -270,7 +280,8 @@ function AssetSelectStep({
|
|
|
270
280
|
service,
|
|
271
281
|
onContinue,
|
|
272
282
|
onTotalBalanceComputed,
|
|
273
|
-
onAssetsLoaded
|
|
283
|
+
onAssetsLoaded,
|
|
284
|
+
onDisconnect
|
|
274
285
|
}) {
|
|
275
286
|
const [assets, setAssets] = _react.useState.call(void 0, []);
|
|
276
287
|
const [selectedAssetId, setSelectedAssetId] = _react.useState.call(void 0, null);
|
|
@@ -278,7 +289,7 @@ function AssetSelectStep({
|
|
|
278
289
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
279
290
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
280
291
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
281
|
-
return
|
|
292
|
+
return _chunkFLVSQDP4cjs.getAssetId.call(void 0, {
|
|
282
293
|
chainId: defaultSourceChain,
|
|
283
294
|
token: defaultSourceToken
|
|
284
295
|
});
|
|
@@ -295,10 +306,10 @@ function AssetSelectStep({
|
|
|
295
306
|
try {
|
|
296
307
|
const portfolio = await service.fetchPortfolio(address);
|
|
297
308
|
if (!active) return;
|
|
298
|
-
const portfolioAssets =
|
|
309
|
+
const portfolioAssets = _chunkFLVSQDP4cjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
299
310
|
setAssets(portfolioAssets);
|
|
300
311
|
const hasNative = portfolioAssets.some(
|
|
301
|
-
(asset) => asset.token.toLowerCase() ===
|
|
312
|
+
(asset) => asset.token.toLowerCase() === _chunkMUWVDVY4cjs.NATIVE_TOKEN_ADDRESS
|
|
302
313
|
);
|
|
303
314
|
if (!hasNative) {
|
|
304
315
|
const nativeAssets = await fetchNativeAssets(
|
|
@@ -336,16 +347,16 @@ function AssetSelectStep({
|
|
|
336
347
|
(sum, asset) => sum + (_nullishCoalesce(asset.balanceUsd, () => ( 0))),
|
|
337
348
|
0
|
|
338
349
|
);
|
|
339
|
-
_optionalChain([onTotalBalanceComputed, 'optionalCall',
|
|
340
|
-
if (assets.length > 0) _optionalChain([onAssetsLoaded, 'optionalCall',
|
|
350
|
+
_optionalChain([onTotalBalanceComputed, 'optionalCall', _6 => _6(total)]);
|
|
351
|
+
if (assets.length > 0) _optionalChain([onAssetsLoaded, 'optionalCall', _7 => _7(assets)]);
|
|
341
352
|
}, [assets, onTotalBalanceComputed, onAssetsLoaded]);
|
|
342
353
|
const allowedChainSet = _react.useMemo.call(void 0,
|
|
343
|
-
() => _optionalChain([allowedRoutes, 'optionalAccess',
|
|
344
|
-
[_optionalChain([allowedRoutes, 'optionalAccess',
|
|
354
|
+
() => _optionalChain([allowedRoutes, 'optionalAccess', _8 => _8.sourceChains]) ? new Set(allowedRoutes.sourceChains) : null,
|
|
355
|
+
[_optionalChain([allowedRoutes, 'optionalAccess', _9 => _9.sourceChains])]
|
|
345
356
|
);
|
|
346
357
|
const allowedTokenSet = _react.useMemo.call(void 0,
|
|
347
|
-
() => _optionalChain([allowedRoutes, 'optionalAccess',
|
|
348
|
-
[_optionalChain([allowedRoutes, 'optionalAccess',
|
|
358
|
+
() => _optionalChain([allowedRoutes, 'optionalAccess', _10 => _10.sourceTokens]) ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null,
|
|
359
|
+
[_optionalChain([allowedRoutes, 'optionalAccess', _11 => _11.sourceTokens])]
|
|
349
360
|
);
|
|
350
361
|
const rows = _react.useMemo.call(void 0, () => {
|
|
351
362
|
return assets.filter((a) => {
|
|
@@ -376,7 +387,7 @@ function AssetSelectStep({
|
|
|
376
387
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
377
388
|
const numeric = Number(raw);
|
|
378
389
|
if (!Number.isFinite(numeric)) return raw;
|
|
379
|
-
return
|
|
390
|
+
return _chunkFLVSQDP4cjs.tokenFormatter.format(numeric);
|
|
380
391
|
} catch (e3) {
|
|
381
392
|
return asset.balance;
|
|
382
393
|
}
|
|
@@ -390,7 +401,7 @@ function AssetSelectStep({
|
|
|
390
401
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
391
402
|
children: [
|
|
392
403
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
393
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
404
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFLVSQDP4cjs.Spinner, { className: "rs-text-tertiary" }),
|
|
394
405
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
395
406
|
] }),
|
|
396
407
|
error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-alert rs-alert--error", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-alert-text", children: error }) }),
|
|
@@ -418,14 +429,23 @@ function AssetSelectStep({
|
|
|
418
429
|
address.slice(0, 6),
|
|
419
430
|
"...",
|
|
420
431
|
address.slice(-4)
|
|
421
|
-
] })
|
|
432
|
+
] }),
|
|
433
|
+
onDisconnect && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
434
|
+
"button",
|
|
435
|
+
{
|
|
436
|
+
type: "button",
|
|
437
|
+
className: "rs-empty-disconnect",
|
|
438
|
+
onClick: onDisconnect,
|
|
439
|
+
children: "Disconnect wallet"
|
|
440
|
+
}
|
|
441
|
+
)
|
|
422
442
|
] }),
|
|
423
443
|
!loading && !error && rows.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: rows.map((asset) => {
|
|
424
444
|
const isSelected = selectedAssetId === asset.id;
|
|
425
445
|
const tokenAmount = formatBalance(asset);
|
|
426
|
-
const badge =
|
|
427
|
-
const tokenIcon =
|
|
428
|
-
const chainIcon =
|
|
446
|
+
const badge = _chunkMUWVDVY4cjs.getChainBadge.call(void 0, asset.chainId);
|
|
447
|
+
const tokenIcon = _chunkMUWVDVY4cjs.getTokenIcon.call(void 0, asset.symbol);
|
|
448
|
+
const chainIcon = _chunkMUWVDVY4cjs.getChainIcon.call(void 0, asset.chainId);
|
|
429
449
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
430
450
|
"button",
|
|
431
451
|
{
|
|
@@ -449,7 +469,7 @@ function AssetSelectStep({
|
|
|
449
469
|
"img",
|
|
450
470
|
{
|
|
451
471
|
src: chainIcon,
|
|
452
|
-
alt:
|
|
472
|
+
alt: _chunkMUWVDVY4cjs.getChainName.call(void 0, asset.chainId),
|
|
453
473
|
className: "rs-asset-chain-badge"
|
|
454
474
|
}
|
|
455
475
|
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -470,7 +490,7 @@ function AssetSelectStep({
|
|
|
470
490
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-asset-chain", children: [
|
|
471
491
|
" ",
|
|
472
492
|
"on ",
|
|
473
|
-
|
|
493
|
+
_chunkMUWVDVY4cjs.getChainName.call(void 0, asset.chainId)
|
|
474
494
|
] })
|
|
475
495
|
] }),
|
|
476
496
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-asset-balance-small", children: [
|
|
@@ -480,7 +500,7 @@ function AssetSelectStep({
|
|
|
480
500
|
] })
|
|
481
501
|
] })
|
|
482
502
|
] }),
|
|
483
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ?
|
|
503
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunkFLVSQDP4cjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
484
504
|
]
|
|
485
505
|
},
|
|
486
506
|
asset.id
|
|
@@ -490,7 +510,7 @@ function AssetSelectStep({
|
|
|
490
510
|
}
|
|
491
511
|
),
|
|
492
512
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
493
|
-
|
|
513
|
+
_chunkFLVSQDP4cjs.Button,
|
|
494
514
|
{
|
|
495
515
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
496
516
|
disabled: !selectedAsset,
|
|
@@ -498,17 +518,17 @@ function AssetSelectStep({
|
|
|
498
518
|
children: "Continue"
|
|
499
519
|
}
|
|
500
520
|
) }),
|
|
501
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
521
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFLVSQDP4cjs.PoweredBy, {})
|
|
502
522
|
] });
|
|
503
523
|
}
|
|
504
524
|
async function fetchNativeAssets(address, publicClient, existing) {
|
|
505
525
|
const existingIds = new Set(existing.map((asset) => asset.id));
|
|
506
|
-
const connectedChainId = _optionalChain([publicClient, 'access',
|
|
526
|
+
const connectedChainId = _optionalChain([publicClient, 'access', _12 => _12.chain, 'optionalAccess', _13 => _13.id]);
|
|
507
527
|
if (!connectedChainId) return [];
|
|
508
|
-
if (!
|
|
509
|
-
const id =
|
|
528
|
+
if (!_chunkMUWVDVY4cjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
|
|
529
|
+
const id = _chunkFLVSQDP4cjs.getAssetId.call(void 0, {
|
|
510
530
|
chainId: connectedChainId,
|
|
511
|
-
token:
|
|
531
|
+
token: _chunkMUWVDVY4cjs.NATIVE_TOKEN_ADDRESS
|
|
512
532
|
});
|
|
513
533
|
if (existingIds.has(id)) return [];
|
|
514
534
|
try {
|
|
@@ -517,7 +537,7 @@ async function fetchNativeAssets(address, publicClient, existing) {
|
|
|
517
537
|
{
|
|
518
538
|
id,
|
|
519
539
|
chainId: connectedChainId,
|
|
520
|
-
token:
|
|
540
|
+
token: _chunkMUWVDVY4cjs.NATIVE_TOKEN_ADDRESS,
|
|
521
541
|
symbol: "ETH",
|
|
522
542
|
name: "Ethereum",
|
|
523
543
|
decimals: 18,
|
|
@@ -566,10 +586,10 @@ function AmountStep({
|
|
|
566
586
|
const [isSwitching, setIsSwitching] = _react.useState.call(void 0, false);
|
|
567
587
|
const hasAttemptedSwitch = _react.useRef.call(void 0, false);
|
|
568
588
|
const chainMismatch = Boolean(
|
|
569
|
-
_optionalChain([walletClient, 'optionalAccess',
|
|
589
|
+
_optionalChain([walletClient, 'optionalAccess', _14 => _14.chain, 'optionalAccess', _15 => _15.id]) && walletClient.chain.id !== asset.chainId
|
|
570
590
|
);
|
|
571
|
-
const targetSymbol =
|
|
572
|
-
const isSourceStablecoin =
|
|
591
|
+
const targetSymbol = _chunkMUWVDVY4cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
592
|
+
const isSourceStablecoin = _chunkMUWVDVY4cjs.isStablecoinSymbol.call(void 0, asset.symbol);
|
|
573
593
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
574
594
|
if (tokenPriceUsdOverride !== void 0 && tokenPriceUsdOverride > 0)
|
|
575
595
|
return tokenPriceUsdOverride;
|
|
@@ -593,7 +613,7 @@ function AmountStep({
|
|
|
593
613
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
594
614
|
if (!balanceTarget || !publicClient) return;
|
|
595
615
|
try {
|
|
596
|
-
const bal =
|
|
616
|
+
const bal = _chunkFLVSQDP4cjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
597
617
|
address: asset.token,
|
|
598
618
|
abi: _viem.erc20Abi,
|
|
599
619
|
functionName: "balanceOf",
|
|
@@ -619,7 +639,7 @@ function AmountStep({
|
|
|
619
639
|
setIsSwitching(true);
|
|
620
640
|
switchChain(asset.chainId).catch((err) => {
|
|
621
641
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
622
|
-
setError(
|
|
642
|
+
setError(_chunkFLVSQDP4cjs.formatUserError.call(void 0, raw));
|
|
623
643
|
}).finally(() => {
|
|
624
644
|
setIsSwitching(false);
|
|
625
645
|
});
|
|
@@ -647,7 +667,7 @@ function AmountStep({
|
|
|
647
667
|
}
|
|
648
668
|
}, [balance, tokenPriceUsd, asset.decimals]);
|
|
649
669
|
_react.useEffect.call(void 0, () => {
|
|
650
|
-
_optionalChain([onBalanceUsdChange, 'optionalCall',
|
|
670
|
+
_optionalChain([onBalanceUsdChange, 'optionalCall', _16 => _16(_nullishCoalesce(balanceUsd, () => ( 0)))]);
|
|
651
671
|
}, [balanceUsd, onBalanceUsdChange]);
|
|
652
672
|
const formattedBalance = _react.useMemo.call(void 0, () => {
|
|
653
673
|
if (balance === null) return "...";
|
|
@@ -655,7 +675,7 @@ function AmountStep({
|
|
|
655
675
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
656
676
|
const numeric = Number(raw);
|
|
657
677
|
if (!Number.isFinite(numeric)) return raw;
|
|
658
|
-
return
|
|
678
|
+
return _chunkFLVSQDP4cjs.tokenFormatter.format(numeric);
|
|
659
679
|
} catch (e8) {
|
|
660
680
|
return "...";
|
|
661
681
|
}
|
|
@@ -663,7 +683,7 @@ function AmountStep({
|
|
|
663
683
|
const handlePresetClick = (percentage) => {
|
|
664
684
|
if (balance === null) return;
|
|
665
685
|
const ctaName = percentage === 100 ? "Max" : `${percentage}%`;
|
|
666
|
-
_optionalChain([onCtaClick, 'optionalCall',
|
|
686
|
+
_optionalChain([onCtaClick, 'optionalCall', _17 => _17(ctaName)]);
|
|
667
687
|
try {
|
|
668
688
|
const balanceUnits = Number(_viem.formatUnits.call(void 0, balance, asset.decimals));
|
|
669
689
|
if (!Number.isFinite(balanceUnits)) return;
|
|
@@ -697,13 +717,13 @@ function AmountStep({
|
|
|
697
717
|
}
|
|
698
718
|
if (hasPricing) {
|
|
699
719
|
const usdValue = numericAmount;
|
|
700
|
-
if (_optionalChain([uiConfig, 'optionalAccess',
|
|
720
|
+
if (_optionalChain([uiConfig, 'optionalAccess', _18 => _18.maxDepositUsd]) && usdValue > uiConfig.maxDepositUsd) {
|
|
701
721
|
setError(
|
|
702
|
-
`Maximum deposit is ${
|
|
722
|
+
`Maximum deposit is ${_chunkFLVSQDP4cjs.currencyFormatter.format(uiConfig.maxDepositUsd)}`
|
|
703
723
|
);
|
|
704
724
|
return;
|
|
705
725
|
}
|
|
706
|
-
if (_optionalChain([uiConfig, 'optionalAccess',
|
|
726
|
+
if (_optionalChain([uiConfig, 'optionalAccess', _19 => _19.minDepositUsd]) && usdValue < uiConfig.minDepositUsd) {
|
|
707
727
|
setAmount(uiConfig.minDepositUsd.toString());
|
|
708
728
|
setError(null);
|
|
709
729
|
return;
|
|
@@ -722,7 +742,7 @@ function AmountStep({
|
|
|
722
742
|
return;
|
|
723
743
|
}
|
|
724
744
|
setError(null);
|
|
725
|
-
_optionalChain([onCtaClick, 'optionalCall',
|
|
745
|
+
_optionalChain([onCtaClick, 'optionalCall', _20 => _20("continue")]);
|
|
726
746
|
onContinue(tokenAmountStr, amount, _nullishCoalesce(balance, () => ( void 0)));
|
|
727
747
|
};
|
|
728
748
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
@@ -754,7 +774,7 @@ function AmountStep({
|
|
|
754
774
|
hasPricing && balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { style: { color: "var(--rs-muted-foreground)" }, children: [
|
|
755
775
|
" ",
|
|
756
776
|
"(",
|
|
757
|
-
|
|
777
|
+
_chunkFLVSQDP4cjs.currencyFormatter.format(balanceUsd),
|
|
758
778
|
")"
|
|
759
779
|
] })
|
|
760
780
|
] }) })
|
|
@@ -768,26 +788,26 @@ function AmountStep({
|
|
|
768
788
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-flow-pill-label", children: "You send" }),
|
|
769
789
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-flow-pill-token", children: [
|
|
770
790
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-flow-pill-token-icon-wrapper", children: [
|
|
771
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-flow-pill-token-icon", children:
|
|
791
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-flow-pill-token-icon", children: _chunkMUWVDVY4cjs.getTokenIcon.call(void 0, asset.symbol) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
772
792
|
"img",
|
|
773
793
|
{
|
|
774
|
-
src:
|
|
794
|
+
src: _chunkMUWVDVY4cjs.getTokenIcon.call(void 0, asset.symbol),
|
|
775
795
|
alt: asset.symbol
|
|
776
796
|
}
|
|
777
797
|
) : asset.symbol.slice(0, 2) }),
|
|
778
798
|
(() => {
|
|
779
|
-
const chainIcon =
|
|
799
|
+
const chainIcon = _chunkMUWVDVY4cjs.getChainIcon.call(void 0, asset.chainId);
|
|
780
800
|
if (chainIcon) {
|
|
781
801
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
782
802
|
"img",
|
|
783
803
|
{
|
|
784
804
|
src: chainIcon,
|
|
785
|
-
alt:
|
|
805
|
+
alt: _chunkMUWVDVY4cjs.getChainName.call(void 0, asset.chainId),
|
|
786
806
|
className: "rs-flow-pill-chain-badge"
|
|
787
807
|
}
|
|
788
808
|
);
|
|
789
809
|
}
|
|
790
|
-
const badge =
|
|
810
|
+
const badge = _chunkMUWVDVY4cjs.getChainBadge.call(void 0, asset.chainId);
|
|
791
811
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
792
812
|
"div",
|
|
793
813
|
{
|
|
@@ -825,26 +845,26 @@ function AmountStep({
|
|
|
825
845
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-flow-pill-label", children: "You receive" }),
|
|
826
846
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-flow-pill-token", children: [
|
|
827
847
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-flow-pill-token-icon-wrapper", children: [
|
|
828
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-flow-pill-token-icon", children:
|
|
848
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-flow-pill-token-icon", children: _chunkMUWVDVY4cjs.getTokenIcon.call(void 0, targetSymbol) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
829
849
|
"img",
|
|
830
850
|
{
|
|
831
|
-
src:
|
|
851
|
+
src: _chunkMUWVDVY4cjs.getTokenIcon.call(void 0, targetSymbol),
|
|
832
852
|
alt: targetSymbol
|
|
833
853
|
}
|
|
834
854
|
) : targetSymbol.slice(0, 2) }),
|
|
835
855
|
(() => {
|
|
836
|
-
const chainIcon =
|
|
856
|
+
const chainIcon = _chunkMUWVDVY4cjs.getChainIcon.call(void 0, targetChain);
|
|
837
857
|
if (chainIcon) {
|
|
838
858
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
839
859
|
"img",
|
|
840
860
|
{
|
|
841
861
|
src: chainIcon,
|
|
842
|
-
alt:
|
|
862
|
+
alt: _chunkMUWVDVY4cjs.getChainName.call(void 0, targetChain),
|
|
843
863
|
className: "rs-flow-pill-chain-badge"
|
|
844
864
|
}
|
|
845
865
|
);
|
|
846
866
|
}
|
|
847
|
-
const badge =
|
|
867
|
+
const badge = _chunkMUWVDVY4cjs.getChainBadge.call(void 0, targetChain);
|
|
848
868
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
849
869
|
"div",
|
|
850
870
|
{
|
|
@@ -890,8 +910,8 @@ function AmountStep({
|
|
|
890
910
|
}
|
|
891
911
|
)
|
|
892
912
|
] }),
|
|
893
|
-
_optionalChain([uiConfig, 'optionalAccess',
|
|
894
|
-
|
|
913
|
+
_optionalChain([uiConfig, 'optionalAccess', _21 => _21.minDepositUsd]) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-minimum", children: [
|
|
914
|
+
_chunkFLVSQDP4cjs.currencyFormatter.format(uiConfig.minDepositUsd),
|
|
895
915
|
" minimum deposit"
|
|
896
916
|
] }),
|
|
897
917
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", children: [
|
|
@@ -917,15 +937,15 @@ function AmountStep({
|
|
|
917
937
|
] })
|
|
918
938
|
] }),
|
|
919
939
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
920
|
-
|
|
940
|
+
_chunkFLVSQDP4cjs.Button,
|
|
921
941
|
{
|
|
922
942
|
onClick: handleContinue,
|
|
923
943
|
fullWidth: true,
|
|
924
944
|
disabled: !amount || chainMismatch,
|
|
925
|
-
children: _optionalChain([uiConfig, 'optionalAccess',
|
|
945
|
+
children: _optionalChain([uiConfig, 'optionalAccess', _22 => _22.minDepositUsd]) && parseFloat(amount) > 0 && parseFloat(amount) < uiConfig.minDepositUsd ? "Update order" : "Continue"
|
|
926
946
|
}
|
|
927
947
|
) }),
|
|
928
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
948
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFLVSQDP4cjs.PoweredBy, {})
|
|
929
949
|
] });
|
|
930
950
|
}
|
|
931
951
|
|
|
@@ -954,9 +974,9 @@ function ConfirmStep({
|
|
|
954
974
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
955
975
|
const [isSwitching, setIsSwitching] = _react.useState.call(void 0, false);
|
|
956
976
|
const hasAttemptedSwitch = _react.useRef.call(void 0, false);
|
|
957
|
-
const chainMismatch = _optionalChain([walletClient, 'optionalAccess',
|
|
977
|
+
const chainMismatch = _optionalChain([walletClient, 'optionalAccess', _23 => _23.chain, 'optionalAccess', _24 => _24.id]) && walletClient.chain.id !== asset.chainId;
|
|
958
978
|
const sameRoute = targetChain === asset.chainId && targetToken.toLowerCase() === asset.token.toLowerCase();
|
|
959
|
-
const targetSymbol = sameRoute ? asset.symbol :
|
|
979
|
+
const targetSymbol = sameRoute ? asset.symbol : _chunkMUWVDVY4cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
960
980
|
const formattedSendAmount = amount && !Number.isNaN(Number(amount)) ? Number(amount).toLocaleString("en-US", { maximumFractionDigits: 6 }) : "0";
|
|
961
981
|
const formattedReceiveAmount = (() => {
|
|
962
982
|
if (sameRoute) return formattedSendAmount;
|
|
@@ -975,7 +995,7 @@ function ConfirmStep({
|
|
|
975
995
|
setIsSwitching(true);
|
|
976
996
|
switchChain(asset.chainId).catch((err) => {
|
|
977
997
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
978
|
-
setError(
|
|
998
|
+
setError(_chunkFLVSQDP4cjs.formatUserError.call(void 0, raw));
|
|
979
999
|
}).finally(() => {
|
|
980
1000
|
setIsSwitching(false);
|
|
981
1001
|
});
|
|
@@ -990,7 +1010,7 @@ function ConfirmStep({
|
|
|
990
1010
|
return;
|
|
991
1011
|
}
|
|
992
1012
|
if (chainMismatch) {
|
|
993
|
-
setError(`Switch to ${
|
|
1013
|
+
setError(`Switch to ${_chunkMUWVDVY4cjs.getChainName.call(void 0, asset.chainId)} to sign`);
|
|
994
1014
|
return;
|
|
995
1015
|
}
|
|
996
1016
|
const parsedAmount = parseFloat(amount);
|
|
@@ -1018,7 +1038,7 @@ function ConfirmStep({
|
|
|
1018
1038
|
throw new Error("Wallet not properly connected");
|
|
1019
1039
|
}
|
|
1020
1040
|
const transferTo = sameRoute ? recipient : smartAccount;
|
|
1021
|
-
const hash =
|
|
1041
|
+
const hash = _chunkFLVSQDP4cjs.isNativeAsset.call(void 0, asset) ? await walletClient.sendTransaction({
|
|
1022
1042
|
account,
|
|
1023
1043
|
chain,
|
|
1024
1044
|
to: transferTo,
|
|
@@ -1031,13 +1051,13 @@ function ConfirmStep({
|
|
|
1031
1051
|
functionName: "transfer",
|
|
1032
1052
|
args: [transferTo, amountUnits]
|
|
1033
1053
|
});
|
|
1034
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
1054
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _25 => _25(hash, asset.chainId, amountUnits.toString())]);
|
|
1035
1055
|
onConfirm(hash, asset.chainId, amountUnits.toString(), asset.token);
|
|
1036
1056
|
} catch (err) {
|
|
1037
1057
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
1038
|
-
const message =
|
|
1058
|
+
const message = _chunkFLVSQDP4cjs.formatUserError.call(void 0, raw);
|
|
1039
1059
|
setError(message);
|
|
1040
|
-
_optionalChain([onError, 'optionalCall',
|
|
1060
|
+
_optionalChain([onError, 'optionalCall', _26 => _26(message, "TRANSFER_ERROR")]);
|
|
1041
1061
|
} finally {
|
|
1042
1062
|
setIsSubmitting(false);
|
|
1043
1063
|
}
|
|
@@ -1054,15 +1074,15 @@ function ConfirmStep({
|
|
|
1054
1074
|
className: "rs-card-value",
|
|
1055
1075
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
1056
1076
|
children: [
|
|
1057
|
-
|
|
1077
|
+
_chunkMUWVDVY4cjs.getChainIcon.call(void 0, asset.chainId) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1058
1078
|
"img",
|
|
1059
1079
|
{
|
|
1060
|
-
src:
|
|
1080
|
+
src: _chunkMUWVDVY4cjs.getChainIcon.call(void 0, asset.chainId),
|
|
1061
1081
|
alt: "",
|
|
1062
1082
|
style: { width: 16, height: 16, borderRadius: 3 }
|
|
1063
1083
|
}
|
|
1064
1084
|
),
|
|
1065
|
-
|
|
1085
|
+
_chunkMUWVDVY4cjs.getChainName.call(void 0, asset.chainId)
|
|
1066
1086
|
]
|
|
1067
1087
|
}
|
|
1068
1088
|
)
|
|
@@ -1075,15 +1095,15 @@ function ConfirmStep({
|
|
|
1075
1095
|
className: "rs-card-value",
|
|
1076
1096
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
1077
1097
|
children: [
|
|
1078
|
-
|
|
1098
|
+
_chunkMUWVDVY4cjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1079
1099
|
"img",
|
|
1080
1100
|
{
|
|
1081
|
-
src:
|
|
1101
|
+
src: _chunkMUWVDVY4cjs.getChainIcon.call(void 0, targetChain),
|
|
1082
1102
|
alt: "",
|
|
1083
1103
|
style: { width: 16, height: 16, borderRadius: 3 }
|
|
1084
1104
|
}
|
|
1085
1105
|
),
|
|
1086
|
-
|
|
1106
|
+
_chunkMUWVDVY4cjs.getChainName.call(void 0, targetChain)
|
|
1087
1107
|
]
|
|
1088
1108
|
}
|
|
1089
1109
|
)
|
|
@@ -1102,10 +1122,10 @@ function ConfirmStep({
|
|
|
1102
1122
|
className: "rs-card-value",
|
|
1103
1123
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
1104
1124
|
children: [
|
|
1105
|
-
|
|
1125
|
+
_chunkMUWVDVY4cjs.getTokenIcon.call(void 0, asset.symbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1106
1126
|
"img",
|
|
1107
1127
|
{
|
|
1108
|
-
src:
|
|
1128
|
+
src: _chunkMUWVDVY4cjs.getTokenIcon.call(void 0, asset.symbol),
|
|
1109
1129
|
alt: "",
|
|
1110
1130
|
style: { width: 16, height: 16, borderRadius: "50%" }
|
|
1111
1131
|
}
|
|
@@ -1125,10 +1145,10 @@ function ConfirmStep({
|
|
|
1125
1145
|
className: "rs-card-value",
|
|
1126
1146
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
1127
1147
|
children: [
|
|
1128
|
-
|
|
1148
|
+
_chunkMUWVDVY4cjs.getTokenIcon.call(void 0, targetSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1129
1149
|
"img",
|
|
1130
1150
|
{
|
|
1131
|
-
src:
|
|
1151
|
+
src: _chunkMUWVDVY4cjs.getTokenIcon.call(void 0, targetSymbol),
|
|
1132
1152
|
alt: "",
|
|
1133
1153
|
style: { width: 16, height: 16, borderRadius: "50%" }
|
|
1134
1154
|
}
|
|
@@ -1164,7 +1184,7 @@ function ConfirmStep({
|
|
|
1164
1184
|
] })
|
|
1165
1185
|
] }),
|
|
1166
1186
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1167
|
-
|
|
1187
|
+
_chunkFLVSQDP4cjs.Button,
|
|
1168
1188
|
{
|
|
1169
1189
|
onClick: handleConfirm,
|
|
1170
1190
|
loading: isSubmitting,
|
|
@@ -1173,7 +1193,7 @@ function ConfirmStep({
|
|
|
1173
1193
|
children: "Confirm Order"
|
|
1174
1194
|
}
|
|
1175
1195
|
) }),
|
|
1176
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1196
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFLVSQDP4cjs.PoweredBy, {})
|
|
1177
1197
|
] });
|
|
1178
1198
|
}
|
|
1179
1199
|
|
|
@@ -1181,93 +1201,375 @@ function ConfirmStep({
|
|
|
1181
1201
|
|
|
1182
1202
|
|
|
1183
1203
|
// src/components/ui/QRCode.tsx
|
|
1184
|
-
|
|
1204
|
+
var _reactqrcodelogo = require('react-qrcode-logo');
|
|
1185
1205
|
|
|
1186
1206
|
function QRCode({ value, size = 200, iconSrc, className }) {
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1207
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className, role: "img", "aria-label": "QR Code", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1208
|
+
_reactqrcodelogo.QRCode,
|
|
1209
|
+
{
|
|
1210
|
+
value,
|
|
1211
|
+
size,
|
|
1212
|
+
qrStyle: "dots",
|
|
1213
|
+
eyeRadius: [10, 10, 10],
|
|
1214
|
+
ecLevel: "H",
|
|
1215
|
+
logoImage: iconSrc,
|
|
1216
|
+
logoWidth: size * 0.22,
|
|
1217
|
+
logoHeight: size * 0.22,
|
|
1218
|
+
logoPaddingStyle: "circle",
|
|
1219
|
+
logoPadding: 5,
|
|
1220
|
+
removeQrCodeBehindLogo: true,
|
|
1221
|
+
quietZone: 10,
|
|
1222
|
+
bgColor: "#ffffff",
|
|
1223
|
+
fgColor: "#000000"
|
|
1224
|
+
}
|
|
1225
|
+
) });
|
|
1226
|
+
}
|
|
1227
|
+
QRCode.displayName = "QRCode";
|
|
1228
|
+
|
|
1229
|
+
// src/components/ui/DepositNotification.tsx
|
|
1230
|
+
|
|
1231
|
+
|
|
1232
|
+
var INITIAL_POLL_INTERVAL = 3e3;
|
|
1233
|
+
var MAX_POLL_INTERVAL = 3e4;
|
|
1234
|
+
var BACKOFF_MULTIPLIER = 1.5;
|
|
1235
|
+
function isEventForTx(event, txHash) {
|
|
1236
|
+
const eventTxHash = _chunkFLVSQDP4cjs.getEventTxHash.call(void 0, event);
|
|
1237
|
+
if (!eventTxHash) return false;
|
|
1238
|
+
return _chunkFLVSQDP4cjs.txRefsMatch.call(void 0, eventTxHash, txHash);
|
|
1239
|
+
}
|
|
1240
|
+
function truncateHash(hash) {
|
|
1241
|
+
return `${hash.slice(0, 4)}\u2026${hash.slice(-4)}`;
|
|
1242
|
+
}
|
|
1243
|
+
function formatTimestamp(ms) {
|
|
1244
|
+
const date = new Date(ms);
|
|
1245
|
+
const months = [
|
|
1246
|
+
"Jan",
|
|
1247
|
+
"Feb",
|
|
1248
|
+
"Mar",
|
|
1249
|
+
"Apr",
|
|
1250
|
+
"May",
|
|
1251
|
+
"Jun",
|
|
1252
|
+
"Jul",
|
|
1253
|
+
"Aug",
|
|
1254
|
+
"Sep",
|
|
1255
|
+
"Oct",
|
|
1256
|
+
"Nov",
|
|
1257
|
+
"Dec"
|
|
1258
|
+
];
|
|
1259
|
+
const month = months[date.getMonth()];
|
|
1260
|
+
const day = date.getDate();
|
|
1261
|
+
const suffix = day % 10 === 1 && day !== 11 ? "st" : day % 10 === 2 && day !== 12 ? "nd" : day % 10 === 3 && day !== 13 ? "rd" : "th";
|
|
1262
|
+
const hours = String(date.getHours()).padStart(2, "0");
|
|
1263
|
+
const minutes = String(date.getMinutes()).padStart(2, "0");
|
|
1264
|
+
const seconds = String(date.getSeconds()).padStart(2, "0");
|
|
1265
|
+
return `${month} ${day}${suffix} \xB7 ${hours}:${minutes}:${seconds}`;
|
|
1266
|
+
}
|
|
1267
|
+
function formatBridgeFailedMessage(event) {
|
|
1268
|
+
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _27 => _27.data]), () => ( {}));
|
|
1269
|
+
const backendMessage = typeof eventData.message === "string" ? eventData.message.trim() : "";
|
|
1270
|
+
if (backendMessage.length > 0) {
|
|
1271
|
+
const lower = backendMessage.toLowerCase();
|
|
1272
|
+
if (lower.includes("insufficient funds")) {
|
|
1273
|
+
return "Deposit was received, but processing could not continue due to insufficient funds.";
|
|
1274
|
+
}
|
|
1275
|
+
if (lower.includes("no valid quote available")) {
|
|
1276
|
+
return "No bridge route is currently available for this transfer.";
|
|
1277
|
+
}
|
|
1278
|
+
if (lower.includes("simulation failed")) {
|
|
1279
|
+
return "Transfer processing failed during simulation.";
|
|
1280
|
+
}
|
|
1281
|
+
if (backendMessage.length > 220) {
|
|
1282
|
+
return "Transfer processing failed.";
|
|
1283
|
+
}
|
|
1284
|
+
return backendMessage;
|
|
1285
|
+
}
|
|
1286
|
+
return "Bridge failed";
|
|
1287
|
+
}
|
|
1288
|
+
var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1289
|
+
"svg",
|
|
1290
|
+
{
|
|
1291
|
+
viewBox: "0 0 24 24",
|
|
1292
|
+
fill: "none",
|
|
1293
|
+
stroke: "currentColor",
|
|
1294
|
+
strokeWidth: "2.5",
|
|
1295
|
+
className: "rs-deposit-notification-link-icon",
|
|
1296
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1297
|
+
"path",
|
|
1298
|
+
{
|
|
1299
|
+
strokeLinecap: "round",
|
|
1300
|
+
strokeLinejoin: "round",
|
|
1301
|
+
d: "M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"
|
|
1193
1302
|
}
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1303
|
+
)
|
|
1304
|
+
}
|
|
1305
|
+
);
|
|
1306
|
+
function DepositNotification({
|
|
1307
|
+
deposit,
|
|
1308
|
+
smartAccount,
|
|
1309
|
+
targetChain,
|
|
1310
|
+
targetToken,
|
|
1311
|
+
waitForFinalTx,
|
|
1312
|
+
hasPostBridgeActions,
|
|
1313
|
+
service,
|
|
1314
|
+
onComplete,
|
|
1315
|
+
onFailed,
|
|
1316
|
+
onDismiss
|
|
1317
|
+
}) {
|
|
1318
|
+
const { txHash, sourceChain, amount, token, detectedAt, directTransfer } = deposit;
|
|
1319
|
+
const [status, setStatus] = _react.useState.call(void 0,
|
|
1320
|
+
directTransfer ? "complete" : "processing"
|
|
1321
|
+
);
|
|
1322
|
+
const [expanded, setExpanded] = _react.useState.call(void 0, false);
|
|
1323
|
+
const [completedAt, setCompletedAt] = _react.useState.call(void 0,
|
|
1324
|
+
directTransfer ? detectedAt : null
|
|
1325
|
+
);
|
|
1326
|
+
const [destinationTxHash, setDestinationTxHash] = _react.useState.call(void 0,
|
|
1327
|
+
null
|
|
1328
|
+
);
|
|
1329
|
+
const pollIntervalRef = _react.useRef.call(void 0, INITIAL_POLL_INTERVAL);
|
|
1330
|
+
const pollTimeoutRef = _react.useRef.call(void 0, null);
|
|
1331
|
+
const completedRef = _react.useRef.call(void 0, _nullishCoalesce(directTransfer, () => ( false)));
|
|
1332
|
+
const depositContextRef = _chunkFLVSQDP4cjs.useLatestRef.call(void 0, {
|
|
1333
|
+
amount,
|
|
1334
|
+
sourceChain,
|
|
1335
|
+
sourceToken: token,
|
|
1336
|
+
targetChain,
|
|
1337
|
+
targetToken,
|
|
1338
|
+
waitForFinalTx,
|
|
1339
|
+
hasPostBridgeActions
|
|
1340
|
+
});
|
|
1341
|
+
const onCompleteRef = _chunkFLVSQDP4cjs.useLatestRef.call(void 0, onComplete);
|
|
1342
|
+
const onFailedRef = _chunkFLVSQDP4cjs.useLatestRef.call(void 0, onFailed);
|
|
1343
|
+
const handleComplete = _react.useCallback.call(void 0,
|
|
1344
|
+
(destTxHash) => {
|
|
1345
|
+
if (completedRef.current) return;
|
|
1346
|
+
completedRef.current = true;
|
|
1347
|
+
setDestinationTxHash(_nullishCoalesce(destTxHash, () => ( null)));
|
|
1348
|
+
setCompletedAt(Date.now());
|
|
1349
|
+
setStatus("complete");
|
|
1350
|
+
const context = depositContextRef.current;
|
|
1351
|
+
_optionalChain([onCompleteRef, 'access', _28 => _28.current, 'optionalCall', _29 => _29(txHash, destTxHash, {
|
|
1352
|
+
amount: context.amount,
|
|
1353
|
+
sourceChain: context.sourceChain,
|
|
1354
|
+
sourceToken: context.sourceToken,
|
|
1355
|
+
targetChain: context.targetChain,
|
|
1356
|
+
targetToken: context.targetToken
|
|
1357
|
+
})]);
|
|
1358
|
+
},
|
|
1359
|
+
[depositContextRef, onCompleteRef, txHash]
|
|
1360
|
+
);
|
|
1361
|
+
const handleFailed = _react.useCallback.call(void 0,
|
|
1362
|
+
(error) => {
|
|
1363
|
+
if (completedRef.current) return;
|
|
1364
|
+
completedRef.current = true;
|
|
1365
|
+
setStatus("failed");
|
|
1366
|
+
_optionalChain([onFailedRef, 'access', _30 => _30.current, 'optionalCall', _31 => _31(txHash, error)]);
|
|
1367
|
+
},
|
|
1368
|
+
[onFailedRef, txHash]
|
|
1369
|
+
);
|
|
1370
|
+
_react.useEffect.call(void 0, () => {
|
|
1371
|
+
if (directTransfer) {
|
|
1372
|
+
handleComplete(void 0);
|
|
1373
|
+
return;
|
|
1374
|
+
}
|
|
1375
|
+
if (status !== "processing") return;
|
|
1376
|
+
let isMounted = true;
|
|
1377
|
+
async function pollStatus() {
|
|
1378
|
+
try {
|
|
1379
|
+
const data = await service.fetchStatus(smartAccount, txHash);
|
|
1380
|
+
if (!isMounted) return;
|
|
1381
|
+
const lastEvent = data.lastEvent;
|
|
1382
|
+
const eventForTx = isEventForTx(lastEvent, txHash) ? lastEvent : void 0;
|
|
1383
|
+
const awaitingPostBridgeSwap = depositContextRef.current.waitForFinalTx && depositContextRef.current.hasPostBridgeActions;
|
|
1384
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _32 => _32.type]) === "post-bridge-swap-complete") {
|
|
1385
|
+
const swapTxHash = _optionalChain([eventForTx, 'access', _33 => _33.data, 'optionalAccess', _34 => _34.swap, 'optionalAccess', _35 => _35.transactionHash]);
|
|
1386
|
+
handleComplete(swapTxHash);
|
|
1387
|
+
return;
|
|
1388
|
+
}
|
|
1389
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _36 => _36.type]) === "post-bridge-swap-failed") {
|
|
1390
|
+
handleFailed(formatBridgeFailedMessage(eventForTx));
|
|
1391
|
+
return;
|
|
1392
|
+
}
|
|
1393
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _37 => _37.type]) === "bridge-complete" && !awaitingPostBridgeSwap) {
|
|
1394
|
+
const destTx = _optionalChain([eventForTx, 'access', _38 => _38.data, 'optionalAccess', _39 => _39.destination, 'optionalAccess', _40 => _40.transactionHash]);
|
|
1395
|
+
handleComplete(destTx);
|
|
1396
|
+
return;
|
|
1397
|
+
}
|
|
1398
|
+
if (!waitForFinalTx && _optionalChain([eventForTx, 'optionalAccess', _41 => _41.type]) === "bridge-started") {
|
|
1399
|
+
handleComplete(void 0);
|
|
1400
|
+
return;
|
|
1401
|
+
}
|
|
1402
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _42 => _42.type]) === "bridge-failed") {
|
|
1403
|
+
handleFailed(formatBridgeFailedMessage(eventForTx));
|
|
1404
|
+
return;
|
|
1405
|
+
}
|
|
1406
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _43 => _43.type]) === "error") {
|
|
1407
|
+
const errorMessage = _nullishCoalesce(_optionalChain([eventForTx, 'access', _44 => _44.data, 'optionalAccess', _45 => _45.message]), () => ( "Unknown error"));
|
|
1408
|
+
handleFailed(errorMessage);
|
|
1409
|
+
return;
|
|
1410
|
+
}
|
|
1411
|
+
scheduleNextPoll();
|
|
1412
|
+
} catch (e12) {
|
|
1413
|
+
scheduleNextPoll();
|
|
1197
1414
|
}
|
|
1198
|
-
}
|
|
1415
|
+
}
|
|
1416
|
+
function scheduleNextPoll() {
|
|
1417
|
+
if (!isMounted) return;
|
|
1418
|
+
pollTimeoutRef.current = setTimeout(() => {
|
|
1419
|
+
pollIntervalRef.current = Math.min(
|
|
1420
|
+
pollIntervalRef.current * BACKOFF_MULTIPLIER,
|
|
1421
|
+
MAX_POLL_INTERVAL
|
|
1422
|
+
);
|
|
1423
|
+
pollStatus();
|
|
1424
|
+
}, pollIntervalRef.current);
|
|
1425
|
+
}
|
|
1426
|
+
pollStatus();
|
|
1199
1427
|
return () => {
|
|
1200
|
-
|
|
1428
|
+
isMounted = false;
|
|
1429
|
+
if (pollTimeoutRef.current) {
|
|
1430
|
+
clearTimeout(pollTimeoutRef.current);
|
|
1431
|
+
}
|
|
1201
1432
|
};
|
|
1202
|
-
}, [
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1433
|
+
}, [
|
|
1434
|
+
directTransfer,
|
|
1435
|
+
depositContextRef,
|
|
1436
|
+
handleComplete,
|
|
1437
|
+
handleFailed,
|
|
1438
|
+
service,
|
|
1439
|
+
smartAccount,
|
|
1440
|
+
status,
|
|
1441
|
+
txHash
|
|
1442
|
+
]);
|
|
1443
|
+
const sourceExplorerUrl = _chunkMUWVDVY4cjs.getExplorerTxUrl.call(void 0, sourceChain, txHash);
|
|
1444
|
+
const destExplorerUrl = destinationTxHash ? _chunkMUWVDVY4cjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
|
|
1445
|
+
const title = status === "complete" ? "Deposit completed" : status === "failed" ? "Deposit failed" : "Deposit received and processing\u2026";
|
|
1446
|
+
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.";
|
|
1447
|
+
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,
|
|
1448
|
+
"svg",
|
|
1449
|
+
{
|
|
1450
|
+
viewBox: "0 0 24 24",
|
|
1451
|
+
fill: "none",
|
|
1452
|
+
stroke: "currentColor",
|
|
1453
|
+
strokeWidth: "3",
|
|
1454
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1455
|
+
"path",
|
|
1456
|
+
{
|
|
1457
|
+
strokeLinecap: "round",
|
|
1458
|
+
strokeLinejoin: "round",
|
|
1459
|
+
d: "M5 12l5 5L20 7"
|
|
1460
|
+
}
|
|
1461
|
+
)
|
|
1206
1462
|
}
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
continue;
|
|
1463
|
+
) }) : 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,
|
|
1464
|
+
"svg",
|
|
1465
|
+
{
|
|
1466
|
+
viewBox: "0 0 24 24",
|
|
1467
|
+
fill: "none",
|
|
1468
|
+
stroke: "currentColor",
|
|
1469
|
+
strokeWidth: "3",
|
|
1470
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1471
|
+
"path",
|
|
1472
|
+
{
|
|
1473
|
+
strokeLinecap: "round",
|
|
1474
|
+
strokeLinejoin: "round",
|
|
1475
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
1221
1476
|
}
|
|
1222
|
-
|
|
1223
|
-
const y = row * cellSize;
|
|
1224
|
-
paths.push(`M${x},${y}h${cellSize}v${cellSize}h${-cellSize}z`);
|
|
1225
|
-
}
|
|
1477
|
+
)
|
|
1226
1478
|
}
|
|
1227
|
-
|
|
1228
|
-
}, [createQrCode, value, size, iconSrc]);
|
|
1229
|
-
const iconSize = size * 0.22;
|
|
1230
|
-
const iconOffset = (size - iconSize) / 2;
|
|
1479
|
+
) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--processing", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFLVSQDP4cjs.Spinner, {}) });
|
|
1231
1480
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1232
|
-
"
|
|
1481
|
+
"div",
|
|
1233
1482
|
{
|
|
1234
|
-
|
|
1235
|
-
width: size,
|
|
1236
|
-
height: size,
|
|
1237
|
-
className,
|
|
1238
|
-
role: "img",
|
|
1239
|
-
"aria-label": "QR Code",
|
|
1483
|
+
className: `rs-deposit-notification rs-deposit-notification--${status}`,
|
|
1240
1484
|
children: [
|
|
1241
|
-
/* @__PURE__ */ _jsxruntime.
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
"
|
|
1246
|
-
|
|
1247
|
-
x: iconOffset - 4,
|
|
1248
|
-
y: iconOffset - 4,
|
|
1249
|
-
width: iconSize + 8,
|
|
1250
|
-
height: iconSize + 8,
|
|
1251
|
-
fill: "white",
|
|
1252
|
-
rx: 8
|
|
1253
|
-
}
|
|
1254
|
-
),
|
|
1485
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-notification-header", children: [
|
|
1486
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-icon", children: statusIcon }),
|
|
1487
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-notification-content", children: [
|
|
1488
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-title", children: title }),
|
|
1489
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-subtitle", children: subtitle })
|
|
1490
|
+
] }),
|
|
1255
1491
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1256
|
-
"
|
|
1492
|
+
"button",
|
|
1257
1493
|
{
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1494
|
+
type: "button",
|
|
1495
|
+
className: "rs-deposit-notification-close",
|
|
1496
|
+
onClick: () => onDismiss(deposit.id),
|
|
1497
|
+
"aria-label": "Dismiss",
|
|
1498
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1499
|
+
"svg",
|
|
1500
|
+
{
|
|
1501
|
+
viewBox: "0 0 24 24",
|
|
1502
|
+
fill: "none",
|
|
1503
|
+
stroke: "currentColor",
|
|
1504
|
+
strokeWidth: "2",
|
|
1505
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1506
|
+
"path",
|
|
1507
|
+
{
|
|
1508
|
+
strokeLinecap: "round",
|
|
1509
|
+
strokeLinejoin: "round",
|
|
1510
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
1511
|
+
}
|
|
1512
|
+
)
|
|
1513
|
+
}
|
|
1514
|
+
)
|
|
1263
1515
|
}
|
|
1264
1516
|
)
|
|
1265
|
-
] })
|
|
1517
|
+
] }),
|
|
1518
|
+
expanded && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-notification-details", children: [
|
|
1519
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-notification-row", children: [
|
|
1520
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-deposit-notification-label", children: "Deposit tx" }),
|
|
1521
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-deposit-notification-value", children: sourceExplorerUrl ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1522
|
+
"a",
|
|
1523
|
+
{
|
|
1524
|
+
href: sourceExplorerUrl,
|
|
1525
|
+
target: "_blank",
|
|
1526
|
+
rel: "noopener noreferrer",
|
|
1527
|
+
className: "rs-deposit-notification-link",
|
|
1528
|
+
children: [
|
|
1529
|
+
truncateHash(txHash),
|
|
1530
|
+
txLinkIcon
|
|
1531
|
+
]
|
|
1532
|
+
}
|
|
1533
|
+
) : truncateHash(txHash) })
|
|
1534
|
+
] }),
|
|
1535
|
+
destinationTxHash && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-notification-row", children: [
|
|
1536
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-deposit-notification-label", children: "Completion tx" }),
|
|
1537
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-deposit-notification-value", children: destExplorerUrl ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1538
|
+
"a",
|
|
1539
|
+
{
|
|
1540
|
+
href: destExplorerUrl,
|
|
1541
|
+
target: "_blank",
|
|
1542
|
+
rel: "noopener noreferrer",
|
|
1543
|
+
className: "rs-deposit-notification-link",
|
|
1544
|
+
children: [
|
|
1545
|
+
truncateHash(destinationTxHash),
|
|
1546
|
+
txLinkIcon
|
|
1547
|
+
]
|
|
1548
|
+
}
|
|
1549
|
+
) : truncateHash(destinationTxHash) })
|
|
1550
|
+
] }),
|
|
1551
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-notification-row", children: [
|
|
1552
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-deposit-notification-label", children: "Order submitted" }),
|
|
1553
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-deposit-notification-value", children: formatTimestamp(detectedAt) })
|
|
1554
|
+
] }),
|
|
1555
|
+
completedAt && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-notification-row", children: [
|
|
1556
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-deposit-notification-label", children: "Order filled" }),
|
|
1557
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-deposit-notification-value", children: formatTimestamp(completedAt) })
|
|
1558
|
+
] })
|
|
1559
|
+
] }),
|
|
1560
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1561
|
+
"button",
|
|
1562
|
+
{
|
|
1563
|
+
type: "button",
|
|
1564
|
+
className: "rs-deposit-notification-toggle",
|
|
1565
|
+
onClick: () => setExpanded(!expanded),
|
|
1566
|
+
children: expanded ? "See less" : "See more"
|
|
1567
|
+
}
|
|
1568
|
+
)
|
|
1266
1569
|
]
|
|
1267
1570
|
}
|
|
1268
1571
|
);
|
|
1269
1572
|
}
|
|
1270
|
-
QRCode.displayName = "QRCode";
|
|
1271
1573
|
|
|
1272
1574
|
// src/core/solana.ts
|
|
1273
1575
|
|
|
@@ -1298,7 +1600,7 @@ var DEFAULT_SOLANA_RPC_URL = "https://api.mainnet.solana.com";
|
|
|
1298
1600
|
var configuredSolanaRpcUrl = null;
|
|
1299
1601
|
var cachedConnections = /* @__PURE__ */ new Map();
|
|
1300
1602
|
function configureSolanaRpcUrl(rpcUrl) {
|
|
1301
|
-
const normalized = _optionalChain([rpcUrl, 'optionalAccess',
|
|
1603
|
+
const normalized = _optionalChain([rpcUrl, 'optionalAccess', _46 => _46.trim, 'call', _47 => _47()]);
|
|
1302
1604
|
configuredSolanaRpcUrl = normalized ? normalized : null;
|
|
1303
1605
|
cachedConnections.clear();
|
|
1304
1606
|
}
|
|
@@ -1433,7 +1735,7 @@ function resolveSolanaTokenMeta(token) {
|
|
|
1433
1735
|
return {};
|
|
1434
1736
|
}
|
|
1435
1737
|
function getDepositEventDetails(event) {
|
|
1436
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
1738
|
+
if (!_optionalChain([event, 'optionalAccess', _48 => _48.type]) || !isRecord(event.data)) return {};
|
|
1437
1739
|
if (event.type === "deposit-received") {
|
|
1438
1740
|
const chainId = asChainId(event.data.chain);
|
|
1439
1741
|
const token = asString(event.data.token);
|
|
@@ -1447,50 +1749,61 @@ function getDepositEventDetails(event) {
|
|
|
1447
1749
|
}
|
|
1448
1750
|
if (event.type === "bridge-started") {
|
|
1449
1751
|
const source = isRecord(event.data.source) ? event.data.source : void 0;
|
|
1450
|
-
const chainId = asChainId(_optionalChain([source, 'optionalAccess',
|
|
1451
|
-
const token = asString(_optionalChain([source, 'optionalAccess',
|
|
1752
|
+
const chainId = asChainId(_optionalChain([source, 'optionalAccess', _49 => _49.chain]));
|
|
1753
|
+
const token = asString(_optionalChain([source, 'optionalAccess', _50 => _50.asset]));
|
|
1452
1754
|
const solanaMeta = chainId === "solana" ? resolveSolanaTokenMeta(token) : {};
|
|
1453
1755
|
return {
|
|
1454
1756
|
chainId,
|
|
1455
|
-
amount: asAmount(_optionalChain([source, 'optionalAccess',
|
|
1757
|
+
amount: asAmount(_optionalChain([source, 'optionalAccess', _51 => _51.amount])),
|
|
1456
1758
|
token,
|
|
1457
1759
|
...solanaMeta
|
|
1458
1760
|
};
|
|
1459
1761
|
}
|
|
1460
1762
|
return {};
|
|
1461
1763
|
}
|
|
1764
|
+
function isSameRoute(sourceChain, sourceToken, targetChain, targetToken) {
|
|
1765
|
+
return sourceChain === targetChain && sourceToken.toLowerCase() === targetToken.toLowerCase();
|
|
1766
|
+
}
|
|
1462
1767
|
function DepositAddressStep({
|
|
1463
1768
|
smartAccount,
|
|
1464
1769
|
solanaDepositAddress,
|
|
1465
1770
|
service,
|
|
1466
1771
|
allowedRoutes,
|
|
1467
|
-
|
|
1772
|
+
targetChain,
|
|
1773
|
+
targetToken,
|
|
1774
|
+
waitForFinalTx,
|
|
1775
|
+
hasPostBridgeActions,
|
|
1776
|
+
onDepositSubmitted,
|
|
1777
|
+
onDepositComplete,
|
|
1778
|
+
onDepositFailed,
|
|
1468
1779
|
onCopyAddress,
|
|
1469
1780
|
onError
|
|
1470
1781
|
}) {
|
|
1471
1782
|
const hasSolana = Boolean(solanaDepositAddress);
|
|
1472
1783
|
const allowedChainSet = _react.useMemo.call(void 0,
|
|
1473
|
-
() => _optionalChain([allowedRoutes, 'optionalAccess',
|
|
1474
|
-
[_optionalChain([allowedRoutes, 'optionalAccess',
|
|
1784
|
+
() => _optionalChain([allowedRoutes, 'optionalAccess', _52 => _52.sourceChains]) ? new Set(allowedRoutes.sourceChains) : null,
|
|
1785
|
+
[_optionalChain([allowedRoutes, 'optionalAccess', _53 => _53.sourceChains])]
|
|
1475
1786
|
);
|
|
1476
1787
|
const allowedTokenSet = _react.useMemo.call(void 0,
|
|
1477
|
-
() => _optionalChain([allowedRoutes, 'optionalAccess',
|
|
1478
|
-
[_optionalChain([allowedRoutes, 'optionalAccess',
|
|
1788
|
+
() => _optionalChain([allowedRoutes, 'optionalAccess', _54 => _54.sourceTokens]) ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null,
|
|
1789
|
+
[_optionalChain([allowedRoutes, 'optionalAccess', _55 => _55.sourceTokens])]
|
|
1479
1790
|
);
|
|
1480
1791
|
const evmChainIds = _react.useMemo.call(void 0, () => {
|
|
1481
|
-
const all =
|
|
1792
|
+
const all = _chunkMUWVDVY4cjs.getSupportedChainIds.call(void 0, );
|
|
1482
1793
|
return allowedChainSet ? all.filter((id) => allowedChainSet.has(id)) : all;
|
|
1483
1794
|
}, [allowedChainSet]);
|
|
1484
|
-
const chainOptions = _react.useMemo.call(void 0,
|
|
1485
|
-
()
|
|
1486
|
-
[evmChainIds
|
|
1487
|
-
|
|
1795
|
+
const chainOptions = _react.useMemo.call(void 0, () => {
|
|
1796
|
+
if (!hasSolana) return evmChainIds;
|
|
1797
|
+
const options = [...evmChainIds];
|
|
1798
|
+
options.splice(1, 0, "solana");
|
|
1799
|
+
return options;
|
|
1800
|
+
}, [evmChainIds, hasSolana]);
|
|
1488
1801
|
const BASE_CHAIN_ID = 8453;
|
|
1489
1802
|
const defaultChainId = evmChainIds.includes(BASE_CHAIN_ID) ? BASE_CHAIN_ID : evmChainIds[0];
|
|
1490
1803
|
const [sourceChainId, setSourceChainId] = _react.useState.call(void 0, defaultChainId);
|
|
1491
1804
|
const isSolana = sourceChainId === "solana";
|
|
1492
1805
|
const tokensForChain = _react.useMemo.call(void 0, () => {
|
|
1493
|
-
const all = isSolana ? SOLANA_TOKENS.map((t) => t.symbol) :
|
|
1806
|
+
const all = isSolana ? SOLANA_TOKENS.map((t) => t.symbol) : _chunkMUWVDVY4cjs.getTargetTokenSymbolsForChain.call(void 0, sourceChainId);
|
|
1494
1807
|
return allowedTokenSet ? all.filter((s) => allowedTokenSet.has(s.toUpperCase())) : all;
|
|
1495
1808
|
}, [sourceChainId, isSolana, allowedTokenSet]);
|
|
1496
1809
|
const defaultToken = tokensForChain.includes("USDC") ? "USDC" : _nullishCoalesce(tokensForChain[0], () => ( "USDC"));
|
|
@@ -1507,10 +1820,13 @@ function DepositAddressStep({
|
|
|
1507
1820
|
const [tokenDropdownOpen, setTokenDropdownOpen] = _react.useState.call(void 0, false);
|
|
1508
1821
|
const chainDropdownRef = _react.useRef.call(void 0, null);
|
|
1509
1822
|
const tokenDropdownRef = _react.useRef.call(void 0, null);
|
|
1510
|
-
const
|
|
1823
|
+
const [notifications, setNotifications] = _react.useState.call(void 0, []);
|
|
1824
|
+
const isTrackingRef = _react.useRef.call(void 0, false);
|
|
1825
|
+
const baselineTxHashRef = _react.useRef.call(void 0, void 0);
|
|
1826
|
+
const notificationIdRef = _react.useRef.call(void 0, 0);
|
|
1511
1827
|
const sourceSelectionRef = _react.useRef.call(void 0, {
|
|
1512
1828
|
chainId: defaultChainId,
|
|
1513
|
-
token: typeof defaultChainId === "number" ?
|
|
1829
|
+
token: typeof defaultChainId === "number" ? _chunkMUWVDVY4cjs.getTokenAddress.call(void 0, defaultToken, defaultChainId) : void 0,
|
|
1514
1830
|
sourceSymbol: defaultToken
|
|
1515
1831
|
});
|
|
1516
1832
|
_react.useEffect.call(void 0, () => {
|
|
@@ -1518,15 +1834,15 @@ function DepositAddressStep({
|
|
|
1518
1834
|
const matched = _nullishCoalesce(SOLANA_TOKENS.find((t) => t.symbol === sourceTokenSymbol), () => ( SOLANA_TOKENS[0]));
|
|
1519
1835
|
sourceSelectionRef.current = {
|
|
1520
1836
|
chainId: "solana",
|
|
1521
|
-
token: _optionalChain([matched, 'optionalAccess',
|
|
1522
|
-
sourceSymbol: _optionalChain([matched, 'optionalAccess',
|
|
1523
|
-
sourceDecimals: _optionalChain([matched, 'optionalAccess',
|
|
1837
|
+
token: _optionalChain([matched, 'optionalAccess', _56 => _56.mint]),
|
|
1838
|
+
sourceSymbol: _optionalChain([matched, 'optionalAccess', _57 => _57.symbol]),
|
|
1839
|
+
sourceDecimals: _optionalChain([matched, 'optionalAccess', _58 => _58.decimals])
|
|
1524
1840
|
};
|
|
1525
1841
|
return;
|
|
1526
1842
|
}
|
|
1527
1843
|
sourceSelectionRef.current = {
|
|
1528
1844
|
chainId: sourceChainId,
|
|
1529
|
-
token:
|
|
1845
|
+
token: _chunkMUWVDVY4cjs.getTokenAddress.call(void 0, sourceTokenSymbol, sourceChainId),
|
|
1530
1846
|
sourceSymbol: sourceTokenSymbol
|
|
1531
1847
|
};
|
|
1532
1848
|
}, [sourceChainId, sourceTokenSymbol, isSolana]);
|
|
@@ -1536,8 +1852,8 @@ function DepositAddressStep({
|
|
|
1536
1852
|
function handlePointerDown(event) {
|
|
1537
1853
|
const target = event.target;
|
|
1538
1854
|
if (!target) return;
|
|
1539
|
-
const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access',
|
|
1540
|
-
const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access',
|
|
1855
|
+
const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access', _59 => _59.current, 'optionalAccess', _60 => _60.contains, 'call', _61 => _61(target)]);
|
|
1856
|
+
const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access', _62 => _62.current, 'optionalAccess', _63 => _63.contains, 'call', _64 => _64(target)]);
|
|
1541
1857
|
if (clickedChainDropdown || clickedTokenDropdown) return;
|
|
1542
1858
|
setChainDropdownOpen(false);
|
|
1543
1859
|
setTokenDropdownOpen(false);
|
|
@@ -1550,12 +1866,12 @@ function DepositAddressStep({
|
|
|
1550
1866
|
};
|
|
1551
1867
|
}, [chainDropdownOpen, tokenDropdownOpen]);
|
|
1552
1868
|
const handleCopy = _react.useCallback.call(void 0, async () => {
|
|
1553
|
-
_optionalChain([onCopyAddress, 'optionalCall',
|
|
1869
|
+
_optionalChain([onCopyAddress, 'optionalCall', _65 => _65()]);
|
|
1554
1870
|
try {
|
|
1555
1871
|
await navigator.clipboard.writeText(displayAddress);
|
|
1556
1872
|
setCopied(true);
|
|
1557
1873
|
setTimeout(() => setCopied(false), 2e3);
|
|
1558
|
-
} catch (
|
|
1874
|
+
} catch (e13) {
|
|
1559
1875
|
const textarea = document.createElement("textarea");
|
|
1560
1876
|
textarea.value = displayAddress;
|
|
1561
1877
|
textarea.style.position = "fixed";
|
|
@@ -1573,22 +1889,46 @@ function DepositAddressStep({
|
|
|
1573
1889
|
setChainDropdownOpen(false);
|
|
1574
1890
|
setTokenDropdownOpen(false);
|
|
1575
1891
|
}, [sourceChainId]);
|
|
1892
|
+
const onDepositSubmittedRef = _react.useRef.call(void 0, onDepositSubmitted);
|
|
1893
|
+
onDepositSubmittedRef.current = onDepositSubmitted;
|
|
1894
|
+
const onDepositCompleteRef = _react.useRef.call(void 0, onDepositComplete);
|
|
1895
|
+
onDepositCompleteRef.current = onDepositComplete;
|
|
1896
|
+
const onDepositFailedRef = _react.useRef.call(void 0, onDepositFailed);
|
|
1897
|
+
onDepositFailedRef.current = onDepositFailed;
|
|
1898
|
+
const onErrorRef = _react.useRef.call(void 0, onError);
|
|
1899
|
+
onErrorRef.current = onError;
|
|
1900
|
+
const targetChainRef = _react.useRef.call(void 0, targetChain);
|
|
1901
|
+
targetChainRef.current = targetChain;
|
|
1902
|
+
const targetTokenRef = _react.useRef.call(void 0, targetToken);
|
|
1903
|
+
targetTokenRef.current = targetToken;
|
|
1576
1904
|
_react.useEffect.call(void 0, () => {
|
|
1577
|
-
|
|
1905
|
+
baselineTxHashRef.current = void 0;
|
|
1906
|
+
isTrackingRef.current = false;
|
|
1578
1907
|
setPollingError(null);
|
|
1579
1908
|
let timeoutId;
|
|
1580
1909
|
let cancelled = false;
|
|
1581
|
-
let baselineTxHash = void 0;
|
|
1582
1910
|
async function poll() {
|
|
1583
|
-
if (cancelled
|
|
1911
|
+
if (cancelled) return;
|
|
1912
|
+
if (isTrackingRef.current) {
|
|
1913
|
+
if (!cancelled) {
|
|
1914
|
+
timeoutId = setTimeout(poll, POLL_INTERVAL_MS);
|
|
1915
|
+
}
|
|
1916
|
+
return;
|
|
1917
|
+
}
|
|
1584
1918
|
try {
|
|
1585
1919
|
const status = await service.fetchLatestStatus(smartAccount);
|
|
1586
|
-
if (cancelled
|
|
1920
|
+
if (cancelled) return;
|
|
1921
|
+
if (isTrackingRef.current) {
|
|
1922
|
+
if (!cancelled) {
|
|
1923
|
+
timeoutId = setTimeout(poll, POLL_INTERVAL_MS);
|
|
1924
|
+
}
|
|
1925
|
+
return;
|
|
1926
|
+
}
|
|
1587
1927
|
const event = status.lastEvent;
|
|
1588
|
-
const eventTxHash =
|
|
1589
|
-
if (
|
|
1590
|
-
|
|
1591
|
-
} else if (eventTxHash && (!
|
|
1928
|
+
const eventTxHash = _chunkFLVSQDP4cjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkFLVSQDP4cjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
1929
|
+
if (baselineTxHashRef.current === void 0) {
|
|
1930
|
+
baselineTxHashRef.current = eventTxHash;
|
|
1931
|
+
} else if (eventTxHash && (!baselineTxHashRef.current || !_chunkFLVSQDP4cjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
|
|
1592
1932
|
const details = getDepositEventDetails(event);
|
|
1593
1933
|
const fallback = sourceSelectionRef.current;
|
|
1594
1934
|
const chainId = _nullishCoalesce(details.chainId, () => ( fallback.chainId));
|
|
@@ -1597,16 +1937,33 @@ function DepositAddressStep({
|
|
|
1597
1937
|
const sourceSymbol = _nullishCoalesce(details.sourceSymbol, () => ( fallback.sourceSymbol));
|
|
1598
1938
|
const sourceDecimals = _nullishCoalesce(details.sourceDecimals, () => ( fallback.sourceDecimals));
|
|
1599
1939
|
if (token) {
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1940
|
+
baselineTxHashRef.current = eventTxHash;
|
|
1941
|
+
isTrackingRef.current = true;
|
|
1942
|
+
const isEvmToken = /^0x[a-fA-F0-9]{40}$/.test(token);
|
|
1943
|
+
const directTransfer = typeof chainId === "number" && isEvmToken && isSameRoute(
|
|
1603
1944
|
chainId,
|
|
1945
|
+
token,
|
|
1946
|
+
targetChainRef.current,
|
|
1947
|
+
targetTokenRef.current
|
|
1948
|
+
);
|
|
1949
|
+
const id = String(++notificationIdRef.current);
|
|
1950
|
+
const notification = {
|
|
1951
|
+
id,
|
|
1952
|
+
txHash: eventTxHash,
|
|
1953
|
+
sourceChain: chainId,
|
|
1604
1954
|
amount,
|
|
1605
1955
|
token,
|
|
1606
1956
|
sourceSymbol,
|
|
1607
|
-
sourceDecimals
|
|
1608
|
-
|
|
1609
|
-
|
|
1957
|
+
sourceDecimals,
|
|
1958
|
+
detectedAt: Date.now(),
|
|
1959
|
+
directTransfer
|
|
1960
|
+
};
|
|
1961
|
+
setNotifications((prev) => [notification, ...prev]);
|
|
1962
|
+
_optionalChain([onDepositSubmittedRef, 'access', _66 => _66.current, 'optionalCall', _67 => _67({
|
|
1963
|
+
txHash: eventTxHash,
|
|
1964
|
+
sourceChain: chainId,
|
|
1965
|
+
amount
|
|
1966
|
+
})]);
|
|
1610
1967
|
}
|
|
1611
1968
|
}
|
|
1612
1969
|
setPollingError(null);
|
|
@@ -1614,10 +1971,10 @@ function DepositAddressStep({
|
|
|
1614
1971
|
if (!cancelled) {
|
|
1615
1972
|
const msg = err instanceof Error ? err.message : "Failed to check status";
|
|
1616
1973
|
setPollingError(msg);
|
|
1617
|
-
_optionalChain([
|
|
1974
|
+
_optionalChain([onErrorRef, 'access', _68 => _68.current, 'optionalCall', _69 => _69(msg, "STATUS_POLL_ERROR")]);
|
|
1618
1975
|
}
|
|
1619
1976
|
}
|
|
1620
|
-
if (!cancelled
|
|
1977
|
+
if (!cancelled) {
|
|
1621
1978
|
timeoutId = setTimeout(poll, POLL_INTERVAL_MS);
|
|
1622
1979
|
}
|
|
1623
1980
|
}
|
|
@@ -1626,13 +1983,30 @@ function DepositAddressStep({
|
|
|
1626
1983
|
cancelled = true;
|
|
1627
1984
|
clearTimeout(timeoutId);
|
|
1628
1985
|
};
|
|
1629
|
-
}, [smartAccount, service
|
|
1630
|
-
const
|
|
1631
|
-
|
|
1986
|
+
}, [smartAccount, service]);
|
|
1987
|
+
const handleNotificationComplete = _react.useCallback.call(void 0,
|
|
1988
|
+
(txHash, destinationTxHash, context) => {
|
|
1989
|
+
isTrackingRef.current = false;
|
|
1990
|
+
_optionalChain([onDepositCompleteRef, 'access', _70 => _70.current, 'optionalCall', _71 => _71(txHash, destinationTxHash, context)]);
|
|
1991
|
+
},
|
|
1992
|
+
[]
|
|
1993
|
+
);
|
|
1994
|
+
const handleNotificationFailed = _react.useCallback.call(void 0,
|
|
1995
|
+
(txHash, error) => {
|
|
1996
|
+
isTrackingRef.current = false;
|
|
1997
|
+
_optionalChain([onDepositFailedRef, 'access', _72 => _72.current, 'optionalCall', _73 => _73(txHash, error)]);
|
|
1998
|
+
},
|
|
1999
|
+
[]
|
|
2000
|
+
);
|
|
2001
|
+
const handleNotificationDismiss = _react.useCallback.call(void 0, (id) => {
|
|
2002
|
+
setNotifications((prev) => prev.filter((n) => n.id !== id));
|
|
2003
|
+
}, []);
|
|
2004
|
+
const qrIconSrc = _chunkMUWVDVY4cjs.getChainIcon.call(void 0, sourceChainId);
|
|
2005
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step rs-step--with-notifications", children: [
|
|
1632
2006
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-body", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address", children: [
|
|
1633
2007
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", children: [
|
|
1634
2008
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", ref: chainDropdownRef, children: [
|
|
1635
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "
|
|
2009
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
1636
2010
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1637
2011
|
"button",
|
|
1638
2012
|
{
|
|
@@ -1643,15 +2017,15 @@ function DepositAddressStep({
|
|
|
1643
2017
|
setTokenDropdownOpen(false);
|
|
1644
2018
|
},
|
|
1645
2019
|
children: [
|
|
1646
|
-
|
|
2020
|
+
_chunkMUWVDVY4cjs.getChainIcon.call(void 0, sourceChainId) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1647
2021
|
"img",
|
|
1648
2022
|
{
|
|
1649
|
-
src:
|
|
2023
|
+
src: _chunkMUWVDVY4cjs.getChainIcon.call(void 0, sourceChainId),
|
|
1650
2024
|
alt: "",
|
|
1651
2025
|
className: "rs-deposit-address-dropdown-icon"
|
|
1652
2026
|
}
|
|
1653
2027
|
),
|
|
1654
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children:
|
|
2028
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunkMUWVDVY4cjs.getChainName.call(void 0, sourceChainId) }),
|
|
1655
2029
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1656
2030
|
"svg",
|
|
1657
2031
|
{
|
|
@@ -1683,22 +2057,22 @@ function DepositAddressStep({
|
|
|
1683
2057
|
setChainDropdownOpen(false);
|
|
1684
2058
|
},
|
|
1685
2059
|
children: [
|
|
1686
|
-
|
|
2060
|
+
_chunkMUWVDVY4cjs.getChainIcon.call(void 0, chainId) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1687
2061
|
"img",
|
|
1688
2062
|
{
|
|
1689
|
-
src:
|
|
2063
|
+
src: _chunkMUWVDVY4cjs.getChainIcon.call(void 0, chainId),
|
|
1690
2064
|
alt: "",
|
|
1691
2065
|
className: "rs-deposit-address-dropdown-icon"
|
|
1692
2066
|
}
|
|
1693
2067
|
),
|
|
1694
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children:
|
|
2068
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: _chunkMUWVDVY4cjs.getChainName.call(void 0, chainId) })
|
|
1695
2069
|
]
|
|
1696
2070
|
},
|
|
1697
2071
|
String(chainId)
|
|
1698
2072
|
)) })
|
|
1699
2073
|
] }),
|
|
1700
2074
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", ref: tokenDropdownRef, children: [
|
|
1701
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "
|
|
2075
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported token" }),
|
|
1702
2076
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1703
2077
|
"button",
|
|
1704
2078
|
{
|
|
@@ -1709,10 +2083,10 @@ function DepositAddressStep({
|
|
|
1709
2083
|
setChainDropdownOpen(false);
|
|
1710
2084
|
},
|
|
1711
2085
|
children: [
|
|
1712
|
-
|
|
2086
|
+
_chunkMUWVDVY4cjs.getTokenIcon.call(void 0, sourceTokenSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1713
2087
|
"img",
|
|
1714
2088
|
{
|
|
1715
|
-
src:
|
|
2089
|
+
src: _chunkMUWVDVY4cjs.getTokenIcon.call(void 0, sourceTokenSymbol),
|
|
1716
2090
|
alt: "",
|
|
1717
2091
|
className: "rs-deposit-address-dropdown-icon"
|
|
1718
2092
|
}
|
|
@@ -1749,10 +2123,10 @@ function DepositAddressStep({
|
|
|
1749
2123
|
setTokenDropdownOpen(false);
|
|
1750
2124
|
},
|
|
1751
2125
|
children: [
|
|
1752
|
-
|
|
2126
|
+
_chunkMUWVDVY4cjs.getTokenIcon.call(void 0, symbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1753
2127
|
"img",
|
|
1754
2128
|
{
|
|
1755
|
-
src:
|
|
2129
|
+
src: _chunkMUWVDVY4cjs.getTokenIcon.call(void 0, symbol),
|
|
1756
2130
|
alt: "",
|
|
1757
2131
|
className: "rs-deposit-address-dropdown-icon"
|
|
1758
2132
|
}
|
|
@@ -1764,7 +2138,7 @@ function DepositAddressStep({
|
|
|
1764
2138
|
)) })
|
|
1765
2139
|
] })
|
|
1766
2140
|
] }),
|
|
1767
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-qr", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, QRCode, { value: displayAddress, size:
|
|
2141
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-qr", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, QRCode, { value: displayAddress, size: 150, iconSrc: qrIconSrc }) }),
|
|
1768
2142
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-info", children: [
|
|
1769
2143
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-label", children: [
|
|
1770
2144
|
"Your ",
|
|
@@ -1811,7 +2185,23 @@ function DepositAddressStep({
|
|
|
1811
2185
|
] }),
|
|
1812
2186
|
pollingError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-error", children: pollingError })
|
|
1813
2187
|
] }) }),
|
|
1814
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2188
|
+
notifications.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notifications", children: notifications.map((deposit) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2189
|
+
DepositNotification,
|
|
2190
|
+
{
|
|
2191
|
+
deposit,
|
|
2192
|
+
smartAccount,
|
|
2193
|
+
targetChain,
|
|
2194
|
+
targetToken,
|
|
2195
|
+
waitForFinalTx,
|
|
2196
|
+
hasPostBridgeActions,
|
|
2197
|
+
service,
|
|
2198
|
+
onComplete: handleNotificationComplete,
|
|
2199
|
+
onFailed: handleNotificationFailed,
|
|
2200
|
+
onDismiss: handleNotificationDismiss
|
|
2201
|
+
},
|
|
2202
|
+
deposit.id
|
|
2203
|
+
)) }),
|
|
2204
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFLVSQDP4cjs.PoweredBy, {})
|
|
1815
2205
|
] });
|
|
1816
2206
|
}
|
|
1817
2207
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -1842,7 +2232,7 @@ function SolanaTokenSelectStep({
|
|
|
1842
2232
|
setError(null);
|
|
1843
2233
|
const portfolioBySymbol = {};
|
|
1844
2234
|
try {
|
|
1845
|
-
|
|
2235
|
+
_chunkFLVSQDP4cjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
|
|
1846
2236
|
solanaAddress
|
|
1847
2237
|
});
|
|
1848
2238
|
const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
|
|
@@ -1853,7 +2243,7 @@ function SolanaTokenSelectStep({
|
|
|
1853
2243
|
let parsed = 0n;
|
|
1854
2244
|
try {
|
|
1855
2245
|
parsed = BigInt(t.balance || "0");
|
|
1856
|
-
} catch (
|
|
2246
|
+
} catch (e14) {
|
|
1857
2247
|
parsed = 0n;
|
|
1858
2248
|
}
|
|
1859
2249
|
if (parsed <= 0n) continue;
|
|
@@ -1865,12 +2255,12 @@ function SolanaTokenSelectStep({
|
|
|
1865
2255
|
};
|
|
1866
2256
|
}
|
|
1867
2257
|
}
|
|
1868
|
-
|
|
2258
|
+
_chunkFLVSQDP4cjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
|
|
1869
2259
|
symbols: Object.keys(portfolioBySymbol)
|
|
1870
2260
|
});
|
|
1871
2261
|
} catch (err) {
|
|
1872
2262
|
if (!active) return;
|
|
1873
|
-
|
|
2263
|
+
_chunkFLVSQDP4cjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
|
|
1874
2264
|
solanaAddress
|
|
1875
2265
|
});
|
|
1876
2266
|
setError(
|
|
@@ -1895,7 +2285,7 @@ function SolanaTokenSelectStep({
|
|
|
1895
2285
|
setTokenBalances(results);
|
|
1896
2286
|
setLoading(false);
|
|
1897
2287
|
const totalUsd = results.reduce((sum, r) => sum + r.balanceUsd, 0);
|
|
1898
|
-
_optionalChain([onTotalBalanceComputed, 'optionalCall',
|
|
2288
|
+
_optionalChain([onTotalBalanceComputed, 'optionalCall', _74 => _74(totalUsd)]);
|
|
1899
2289
|
}
|
|
1900
2290
|
void loadBalances();
|
|
1901
2291
|
return () => {
|
|
@@ -1924,7 +2314,7 @@ function SolanaTokenSelectStep({
|
|
|
1924
2314
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
1925
2315
|
children: [
|
|
1926
2316
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
1927
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2317
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFLVSQDP4cjs.Spinner, { className: "rs-text-tertiary" }),
|
|
1928
2318
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
1929
2319
|
] }),
|
|
1930
2320
|
!loading && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
@@ -1955,14 +2345,14 @@ function SolanaTokenSelectStep({
|
|
|
1955
2345
|
] }),
|
|
1956
2346
|
!loading && rows.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-list", children: rows.map((entry) => {
|
|
1957
2347
|
const isSelected = selectedSymbol === entry.token.symbol;
|
|
1958
|
-
const tokenIcon =
|
|
1959
|
-
const chainIcon =
|
|
2348
|
+
const tokenIcon = _chunkMUWVDVY4cjs.getTokenIcon.call(void 0, entry.token.symbol);
|
|
2349
|
+
const chainIcon = _chunkMUWVDVY4cjs.getChainIcon.call(void 0, "solana");
|
|
1960
2350
|
let formattedBalance;
|
|
1961
2351
|
try {
|
|
1962
2352
|
const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
|
|
1963
2353
|
const numeric = Number(raw);
|
|
1964
|
-
formattedBalance = Number.isFinite(numeric) ?
|
|
1965
|
-
} catch (
|
|
2354
|
+
formattedBalance = Number.isFinite(numeric) ? _chunkFLVSQDP4cjs.tokenFormatter.format(numeric) : raw;
|
|
2355
|
+
} catch (e15) {
|
|
1966
2356
|
formattedBalance = "...";
|
|
1967
2357
|
}
|
|
1968
2358
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
@@ -2005,7 +2395,7 @@ function SolanaTokenSelectStep({
|
|
|
2005
2395
|
] })
|
|
2006
2396
|
] })
|
|
2007
2397
|
] }),
|
|
2008
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ?
|
|
2398
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunkFLVSQDP4cjs.currencyFormatter.format(entry.balanceUsd) : `${formattedBalance} ${entry.token.symbol}` })
|
|
2009
2399
|
]
|
|
2010
2400
|
},
|
|
2011
2401
|
entry.token.symbol
|
|
@@ -2015,7 +2405,7 @@ function SolanaTokenSelectStep({
|
|
|
2015
2405
|
}
|
|
2016
2406
|
),
|
|
2017
2407
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2018
|
-
|
|
2408
|
+
_chunkFLVSQDP4cjs.Button,
|
|
2019
2409
|
{
|
|
2020
2410
|
onClick: () => selectedEntry && onContinue(
|
|
2021
2411
|
selectedEntry.token,
|
|
@@ -2027,7 +2417,7 @@ function SolanaTokenSelectStep({
|
|
|
2027
2417
|
children: "Continue"
|
|
2028
2418
|
}
|
|
2029
2419
|
) }),
|
|
2030
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2420
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFLVSQDP4cjs.PoweredBy, {})
|
|
2031
2421
|
] });
|
|
2032
2422
|
}
|
|
2033
2423
|
|
|
@@ -2047,7 +2437,7 @@ function SolanaAmountStep({
|
|
|
2047
2437
|
}) {
|
|
2048
2438
|
const [amount, setAmount] = _react.useState.call(void 0, "");
|
|
2049
2439
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
2050
|
-
const isSourceStablecoin =
|
|
2440
|
+
const isSourceStablecoin = _chunkMUWVDVY4cjs.isStablecoinSymbol.call(void 0, token.symbol);
|
|
2051
2441
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
2052
2442
|
if (isSourceStablecoin) return 1;
|
|
2053
2443
|
try {
|
|
@@ -2057,7 +2447,7 @@ function SolanaAmountStep({
|
|
|
2057
2447
|
}
|
|
2058
2448
|
const price = balanceUsd / balanceUnits;
|
|
2059
2449
|
return price > 0 ? price : null;
|
|
2060
|
-
} catch (
|
|
2450
|
+
} catch (e16) {
|
|
2061
2451
|
return null;
|
|
2062
2452
|
}
|
|
2063
2453
|
}, [isSourceStablecoin, balance, token.decimals, balanceUsd]);
|
|
@@ -2075,8 +2465,8 @@ function SolanaAmountStep({
|
|
|
2075
2465
|
const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
|
|
2076
2466
|
const numeric = Number(raw);
|
|
2077
2467
|
if (!Number.isFinite(numeric)) return raw;
|
|
2078
|
-
return
|
|
2079
|
-
} catch (
|
|
2468
|
+
return _chunkFLVSQDP4cjs.tokenFormatter.format(numeric);
|
|
2469
|
+
} catch (e17) {
|
|
2080
2470
|
return "...";
|
|
2081
2471
|
}
|
|
2082
2472
|
}, [balance, token.decimals]);
|
|
@@ -2087,13 +2477,13 @@ function SolanaAmountStep({
|
|
|
2087
2477
|
if (tokenPriceUsd !== null) return balanceUnits * tokenPriceUsd;
|
|
2088
2478
|
if (Number.isFinite(balanceUsd) && balanceUsd > 0) return balanceUsd;
|
|
2089
2479
|
return null;
|
|
2090
|
-
} catch (
|
|
2480
|
+
} catch (e18) {
|
|
2091
2481
|
return null;
|
|
2092
2482
|
}
|
|
2093
2483
|
}, [balance, token.decimals, tokenPriceUsd, balanceUsd]);
|
|
2094
2484
|
const formattedBalanceUsd = _react.useMemo.call(void 0, () => {
|
|
2095
2485
|
if (computedBalanceUsd === null || computedBalanceUsd <= 0) return null;
|
|
2096
|
-
return
|
|
2486
|
+
return _chunkFLVSQDP4cjs.currencyFormatter.format(computedBalanceUsd);
|
|
2097
2487
|
}, [computedBalanceUsd]);
|
|
2098
2488
|
const spendableBalance = _react.useMemo.call(void 0, () => {
|
|
2099
2489
|
if (!isNativeSol(token)) return balance;
|
|
@@ -2105,7 +2495,7 @@ function SolanaAmountStep({
|
|
|
2105
2495
|
if (!Number.isFinite(spendableUnits) || spendableUnits < 0) return null;
|
|
2106
2496
|
if (tokenPriceUsd !== null) return spendableUnits * tokenPriceUsd;
|
|
2107
2497
|
return null;
|
|
2108
|
-
} catch (
|
|
2498
|
+
} catch (e19) {
|
|
2109
2499
|
return null;
|
|
2110
2500
|
}
|
|
2111
2501
|
}, [spendableBalance, token.decimals, tokenPriceUsd]);
|
|
@@ -2118,13 +2508,13 @@ function SolanaAmountStep({
|
|
|
2118
2508
|
const factor = 10 ** maxDecimals;
|
|
2119
2509
|
const truncated = Math.floor(value * factor) / factor;
|
|
2120
2510
|
const formatted = truncated.toFixed(maxDecimals).replace(/\.?0+$/, "");
|
|
2121
|
-
|
|
2511
|
+
_chunkFLVSQDP4cjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
|
|
2122
2512
|
percentage,
|
|
2123
2513
|
symbol: token.symbol,
|
|
2124
2514
|
formatted
|
|
2125
2515
|
});
|
|
2126
2516
|
setAmount(formatted);
|
|
2127
|
-
} catch (
|
|
2517
|
+
} catch (e20) {
|
|
2128
2518
|
return;
|
|
2129
2519
|
}
|
|
2130
2520
|
if (error) setError(null);
|
|
@@ -2132,7 +2522,7 @@ function SolanaAmountStep({
|
|
|
2132
2522
|
const handleContinue = () => {
|
|
2133
2523
|
const numericAmount = parseFloat(amount);
|
|
2134
2524
|
if (isNaN(numericAmount) || numericAmount <= 0) {
|
|
2135
|
-
|
|
2525
|
+
_chunkFLVSQDP4cjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2136
2526
|
amount,
|
|
2137
2527
|
reason: "nan-or-non-positive"
|
|
2138
2528
|
});
|
|
@@ -2142,13 +2532,13 @@ function SolanaAmountStep({
|
|
|
2142
2532
|
const sourceAmount = isSourceStablecoin || !hasPricing ? numericAmount : numericAmount / tokenPriceUsd;
|
|
2143
2533
|
if (hasPricing) {
|
|
2144
2534
|
const usdValue = numericAmount;
|
|
2145
|
-
if (_optionalChain([uiConfig, 'optionalAccess',
|
|
2535
|
+
if (_optionalChain([uiConfig, 'optionalAccess', _75 => _75.maxDepositUsd]) && usdValue > uiConfig.maxDepositUsd) {
|
|
2146
2536
|
setError(
|
|
2147
|
-
`Maximum deposit is ${
|
|
2537
|
+
`Maximum deposit is ${_chunkFLVSQDP4cjs.currencyFormatter.format(uiConfig.maxDepositUsd)}`
|
|
2148
2538
|
);
|
|
2149
2539
|
return;
|
|
2150
2540
|
}
|
|
2151
|
-
if (_optionalChain([uiConfig, 'optionalAccess',
|
|
2541
|
+
if (_optionalChain([uiConfig, 'optionalAccess', _76 => _76.minDepositUsd]) && usdValue < uiConfig.minDepositUsd) {
|
|
2152
2542
|
setAmount(uiConfig.minDepositUsd.toString());
|
|
2153
2543
|
setError(null);
|
|
2154
2544
|
return;
|
|
@@ -2158,8 +2548,8 @@ function SolanaAmountStep({
|
|
|
2158
2548
|
let amountInUnits;
|
|
2159
2549
|
try {
|
|
2160
2550
|
amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
|
|
2161
|
-
} catch (
|
|
2162
|
-
|
|
2551
|
+
} catch (e21) {
|
|
2552
|
+
_chunkFLVSQDP4cjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2163
2553
|
amount,
|
|
2164
2554
|
sourceAmount: sourceAmountStr,
|
|
2165
2555
|
reason: "parse-units-failed"
|
|
@@ -2169,7 +2559,7 @@ function SolanaAmountStep({
|
|
|
2169
2559
|
}
|
|
2170
2560
|
if (amountInUnits > spendableBalance) {
|
|
2171
2561
|
const isReserveIssue = isNativeSol(token) && amountInUnits <= balance;
|
|
2172
|
-
|
|
2562
|
+
_chunkFLVSQDP4cjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2173
2563
|
amount,
|
|
2174
2564
|
balance: balance.toString(),
|
|
2175
2565
|
spendableBalance: spendableBalance.toString(),
|
|
@@ -2181,7 +2571,7 @@ function SolanaAmountStep({
|
|
|
2181
2571
|
);
|
|
2182
2572
|
return;
|
|
2183
2573
|
}
|
|
2184
|
-
|
|
2574
|
+
_chunkFLVSQDP4cjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
|
|
2185
2575
|
symbol: token.symbol,
|
|
2186
2576
|
inputAmountUsd: amount,
|
|
2187
2577
|
sourceAmount: sourceAmountStr,
|
|
@@ -2249,8 +2639,8 @@ function SolanaAmountStep({
|
|
|
2249
2639
|
}
|
|
2250
2640
|
)
|
|
2251
2641
|
] }),
|
|
2252
|
-
_optionalChain([uiConfig, 'optionalAccess',
|
|
2253
|
-
|
|
2642
|
+
_optionalChain([uiConfig, 'optionalAccess', _77 => _77.minDepositUsd]) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-minimum", children: [
|
|
2643
|
+
_chunkFLVSQDP4cjs.currencyFormatter.format(uiConfig.minDepositUsd),
|
|
2254
2644
|
" minimum deposit"
|
|
2255
2645
|
] }),
|
|
2256
2646
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", children: [
|
|
@@ -2276,15 +2666,15 @@ function SolanaAmountStep({
|
|
|
2276
2666
|
] })
|
|
2277
2667
|
] }),
|
|
2278
2668
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2279
|
-
|
|
2669
|
+
_chunkFLVSQDP4cjs.Button,
|
|
2280
2670
|
{
|
|
2281
2671
|
onClick: handleContinue,
|
|
2282
2672
|
fullWidth: true,
|
|
2283
2673
|
disabled: !amount,
|
|
2284
|
-
children: _optionalChain([uiConfig, 'optionalAccess',
|
|
2674
|
+
children: _optionalChain([uiConfig, 'optionalAccess', _78 => _78.minDepositUsd]) && parseFloat(amount) > 0 && parseFloat(amount) < uiConfig.minDepositUsd ? "Update order" : "Continue"
|
|
2285
2675
|
}
|
|
2286
2676
|
) }),
|
|
2287
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2677
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFLVSQDP4cjs.PoweredBy, {})
|
|
2288
2678
|
] });
|
|
2289
2679
|
}
|
|
2290
2680
|
|
|
@@ -2311,7 +2701,7 @@ function SolanaConfirmStep({
|
|
|
2311
2701
|
}) {
|
|
2312
2702
|
const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
|
|
2313
2703
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
2314
|
-
const targetSymbol =
|
|
2704
|
+
const targetSymbol = _chunkMUWVDVY4cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
2315
2705
|
const isSameToken = token.symbol.toUpperCase() === targetSymbol.toUpperCase();
|
|
2316
2706
|
const formattedAmount = sourceAmount && !Number.isNaN(Number(sourceAmount)) ? Number(sourceAmount).toLocaleString("en-US", { maximumFractionDigits: 6 }) : "0";
|
|
2317
2707
|
const formattedReceiveAmount = (() => {
|
|
@@ -2328,7 +2718,7 @@ function SolanaConfirmStep({
|
|
|
2328
2718
|
const receiveAmount = isSameToken ? formattedReceiveAmount : `~ ${formattedReceiveAmount}`;
|
|
2329
2719
|
const handleConfirm = async () => {
|
|
2330
2720
|
if (!solanaProvider) {
|
|
2331
|
-
|
|
2721
|
+
_chunkFLVSQDP4cjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
2332
2722
|
reason: "missing-provider"
|
|
2333
2723
|
});
|
|
2334
2724
|
setError("Solana wallet not connected");
|
|
@@ -2336,7 +2726,7 @@ function SolanaConfirmStep({
|
|
|
2336
2726
|
}
|
|
2337
2727
|
const parsedAmount = parseFloat(sourceAmount);
|
|
2338
2728
|
if (isNaN(parsedAmount) || parsedAmount <= 0) {
|
|
2339
|
-
|
|
2729
|
+
_chunkFLVSQDP4cjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
2340
2730
|
reason: "invalid-amount",
|
|
2341
2731
|
sourceAmount
|
|
2342
2732
|
});
|
|
@@ -2345,7 +2735,7 @@ function SolanaConfirmStep({
|
|
|
2345
2735
|
}
|
|
2346
2736
|
setError(null);
|
|
2347
2737
|
setIsSubmitting(true);
|
|
2348
|
-
|
|
2738
|
+
_chunkFLVSQDP4cjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
|
|
2349
2739
|
smartAccount,
|
|
2350
2740
|
solanaAddress,
|
|
2351
2741
|
solanaDepositAddress,
|
|
@@ -2355,7 +2745,7 @@ function SolanaConfirmStep({
|
|
|
2355
2745
|
});
|
|
2356
2746
|
try {
|
|
2357
2747
|
const check = await service.checkAccount(smartAccount);
|
|
2358
|
-
|
|
2748
|
+
_chunkFLVSQDP4cjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
|
|
2359
2749
|
smartAccount,
|
|
2360
2750
|
isRegistered: check.isRegistered,
|
|
2361
2751
|
targetChain: check.targetChain,
|
|
@@ -2368,7 +2758,7 @@ function SolanaConfirmStep({
|
|
|
2368
2758
|
}
|
|
2369
2759
|
const connection = getSolanaConnection();
|
|
2370
2760
|
const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
|
|
2371
|
-
|
|
2761
|
+
_chunkFLVSQDP4cjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
|
|
2372
2762
|
token: token.symbol,
|
|
2373
2763
|
sourceAmount,
|
|
2374
2764
|
amountUnits: amountUnits.toString()
|
|
@@ -2385,10 +2775,10 @@ function SolanaConfirmStep({
|
|
|
2385
2775
|
token.mint,
|
|
2386
2776
|
amountUnits
|
|
2387
2777
|
);
|
|
2388
|
-
|
|
2778
|
+
_chunkFLVSQDP4cjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
2389
2779
|
token: token.symbol,
|
|
2390
2780
|
instructionCount: transaction.instructions.length,
|
|
2391
|
-
feePayer: _optionalChain([transaction, 'access',
|
|
2781
|
+
feePayer: _optionalChain([transaction, 'access', _79 => _79.feePayer, 'optionalAccess', _80 => _80.toBase58, 'call', _81 => _81()]),
|
|
2392
2782
|
recentBlockhash: transaction.recentBlockhash
|
|
2393
2783
|
});
|
|
2394
2784
|
const txHash = await sendSolanaTransaction(
|
|
@@ -2396,21 +2786,21 @@ function SolanaConfirmStep({
|
|
|
2396
2786
|
connection,
|
|
2397
2787
|
transaction
|
|
2398
2788
|
);
|
|
2399
|
-
|
|
2789
|
+
_chunkFLVSQDP4cjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
|
|
2400
2790
|
txHash,
|
|
2401
2791
|
amountUnits: amountUnits.toString()
|
|
2402
2792
|
});
|
|
2403
2793
|
onConfirm(txHash, amountUnits.toString());
|
|
2404
2794
|
} catch (err) {
|
|
2405
2795
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
2406
|
-
const message =
|
|
2407
|
-
|
|
2796
|
+
const message = _chunkFLVSQDP4cjs.formatUserError.call(void 0, raw);
|
|
2797
|
+
_chunkFLVSQDP4cjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
|
|
2408
2798
|
smartAccount,
|
|
2409
2799
|
token: token.symbol,
|
|
2410
2800
|
sourceAmount
|
|
2411
2801
|
});
|
|
2412
2802
|
setError(message);
|
|
2413
|
-
_optionalChain([onError, 'optionalCall',
|
|
2803
|
+
_optionalChain([onError, 'optionalCall', _82 => _82(message, "SOLANA_TRANSFER_ERROR")]);
|
|
2414
2804
|
} finally {
|
|
2415
2805
|
setIsSubmitting(false);
|
|
2416
2806
|
}
|
|
@@ -2427,15 +2817,15 @@ function SolanaConfirmStep({
|
|
|
2427
2817
|
className: "rs-card-value",
|
|
2428
2818
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
2429
2819
|
children: [
|
|
2430
|
-
|
|
2820
|
+
_chunkMUWVDVY4cjs.getChainIcon.call(void 0, "solana") && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2431
2821
|
"img",
|
|
2432
2822
|
{
|
|
2433
|
-
src:
|
|
2823
|
+
src: _chunkMUWVDVY4cjs.getChainIcon.call(void 0, "solana"),
|
|
2434
2824
|
alt: "",
|
|
2435
2825
|
style: { width: 16, height: 16, borderRadius: 3 }
|
|
2436
2826
|
}
|
|
2437
2827
|
),
|
|
2438
|
-
|
|
2828
|
+
_chunkMUWVDVY4cjs.getChainName.call(void 0, "solana")
|
|
2439
2829
|
]
|
|
2440
2830
|
}
|
|
2441
2831
|
)
|
|
@@ -2448,15 +2838,15 @@ function SolanaConfirmStep({
|
|
|
2448
2838
|
className: "rs-card-value",
|
|
2449
2839
|
style: { display: "flex", alignItems: "center", gap: 8 },
|
|
2450
2840
|
children: [
|
|
2451
|
-
|
|
2841
|
+
_chunkMUWVDVY4cjs.getChainIcon.call(void 0, targetChain) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2452
2842
|
"img",
|
|
2453
2843
|
{
|
|
2454
|
-
src:
|
|
2844
|
+
src: _chunkMUWVDVY4cjs.getChainIcon.call(void 0, targetChain),
|
|
2455
2845
|
alt: "",
|
|
2456
2846
|
style: { width: 16, height: 16, borderRadius: 3 }
|
|
2457
2847
|
}
|
|
2458
2848
|
),
|
|
2459
|
-
|
|
2849
|
+
_chunkMUWVDVY4cjs.getChainName.call(void 0, targetChain)
|
|
2460
2850
|
]
|
|
2461
2851
|
}
|
|
2462
2852
|
)
|
|
@@ -2475,10 +2865,10 @@ function SolanaConfirmStep({
|
|
|
2475
2865
|
className: "rs-card-value",
|
|
2476
2866
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
2477
2867
|
children: [
|
|
2478
|
-
|
|
2868
|
+
_chunkMUWVDVY4cjs.getTokenIcon.call(void 0, token.symbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2479
2869
|
"img",
|
|
2480
2870
|
{
|
|
2481
|
-
src:
|
|
2871
|
+
src: _chunkMUWVDVY4cjs.getTokenIcon.call(void 0, token.symbol),
|
|
2482
2872
|
alt: "",
|
|
2483
2873
|
style: { width: 16, height: 16, borderRadius: "50%" }
|
|
2484
2874
|
}
|
|
@@ -2498,10 +2888,10 @@ function SolanaConfirmStep({
|
|
|
2498
2888
|
className: "rs-card-value",
|
|
2499
2889
|
style: { display: "flex", alignItems: "center", gap: 6 },
|
|
2500
2890
|
children: [
|
|
2501
|
-
|
|
2891
|
+
_chunkMUWVDVY4cjs.getTokenIcon.call(void 0, targetSymbol) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2502
2892
|
"img",
|
|
2503
2893
|
{
|
|
2504
|
-
src:
|
|
2894
|
+
src: _chunkMUWVDVY4cjs.getTokenIcon.call(void 0, targetSymbol),
|
|
2505
2895
|
alt: "",
|
|
2506
2896
|
style: { width: 16, height: 16, borderRadius: "50%" }
|
|
2507
2897
|
}
|
|
@@ -2537,7 +2927,7 @@ function SolanaConfirmStep({
|
|
|
2537
2927
|
] })
|
|
2538
2928
|
] }),
|
|
2539
2929
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2540
|
-
|
|
2930
|
+
_chunkFLVSQDP4cjs.Button,
|
|
2541
2931
|
{
|
|
2542
2932
|
onClick: handleConfirm,
|
|
2543
2933
|
loading: isSubmitting,
|
|
@@ -2546,14 +2936,14 @@ function SolanaConfirmStep({
|
|
|
2546
2936
|
children: "Confirm Order"
|
|
2547
2937
|
}
|
|
2548
2938
|
) }),
|
|
2549
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2939
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkFLVSQDP4cjs.PoweredBy, {})
|
|
2550
2940
|
] });
|
|
2551
2941
|
}
|
|
2552
2942
|
|
|
2553
2943
|
// src/DepositFlow.tsx
|
|
2554
2944
|
|
|
2555
2945
|
var QR_AUTO_ADVANCE_HYDRATION_GRACE_MS = 1e3;
|
|
2556
|
-
function
|
|
2946
|
+
function isSameRoute2(sourceChain, sourceToken, targetChain, targetToken) {
|
|
2557
2947
|
return sourceChain === targetChain && sourceToken.toLowerCase() === targetToken.toLowerCase();
|
|
2558
2948
|
}
|
|
2559
2949
|
function getAddressKey(address) {
|
|
@@ -2572,7 +2962,9 @@ function DepositFlow({
|
|
|
2572
2962
|
amount: defaultAmount,
|
|
2573
2963
|
recipient,
|
|
2574
2964
|
postBridgeActions,
|
|
2575
|
-
|
|
2965
|
+
outputTokenRules,
|
|
2966
|
+
rejectUnmapped,
|
|
2967
|
+
signerAddress = _chunkMUWVDVY4cjs.DEFAULT_SIGNER_ADDRESS,
|
|
2576
2968
|
sessionChainIds,
|
|
2577
2969
|
forceRegister = false,
|
|
2578
2970
|
waitForFinalTx = true,
|
|
@@ -2586,6 +2978,7 @@ function DepositFlow({
|
|
|
2586
2978
|
allowedRoutes,
|
|
2587
2979
|
onStepChange,
|
|
2588
2980
|
onTotalBalanceChange,
|
|
2981
|
+
onSmartAccountChange,
|
|
2589
2982
|
onClose,
|
|
2590
2983
|
onConnected,
|
|
2591
2984
|
onDepositSubmitted,
|
|
@@ -2595,11 +2988,16 @@ function DepositFlow({
|
|
|
2595
2988
|
onError,
|
|
2596
2989
|
debug
|
|
2597
2990
|
}) {
|
|
2598
|
-
const onStepChangeRef =
|
|
2599
|
-
const onTotalBalanceChangeRef =
|
|
2600
|
-
const
|
|
2991
|
+
const onStepChangeRef = _chunkFLVSQDP4cjs.useLatestRef.call(void 0, onStepChange);
|
|
2992
|
+
const onTotalBalanceChangeRef = _chunkFLVSQDP4cjs.useLatestRef.call(void 0, onTotalBalanceChange);
|
|
2993
|
+
const onSmartAccountChangeRef = _chunkFLVSQDP4cjs.useLatestRef.call(void 0, onSmartAccountChange);
|
|
2994
|
+
const onEventRef = _chunkFLVSQDP4cjs.useLatestRef.call(void 0, onEvent);
|
|
2995
|
+
const onDepositSubmittedRef = _chunkFLVSQDP4cjs.useLatestRef.call(void 0, onDepositSubmitted);
|
|
2996
|
+
const onDepositCompleteRef = _chunkFLVSQDP4cjs.useLatestRef.call(void 0, onDepositComplete);
|
|
2997
|
+
const onDepositFailedRef = _chunkFLVSQDP4cjs.useLatestRef.call(void 0, onDepositFailed);
|
|
2998
|
+
const onErrorRef = _chunkFLVSQDP4cjs.useLatestRef.call(void 0, onError);
|
|
2601
2999
|
const hasInitialReownSession = Boolean(
|
|
2602
|
-
enableSolana ? _optionalChain([reownWallet, 'optionalAccess',
|
|
3000
|
+
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _83 => _83.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _84 => _84.address]) : _optionalChain([reownWallet, 'optionalAccess', _85 => _85.address])
|
|
2603
3001
|
);
|
|
2604
3002
|
const hasInitialWalletHydrationPending = Boolean(
|
|
2605
3003
|
dappAddress && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasInitialReownSession && !reownWallet.isReady)
|
|
@@ -2617,13 +3015,13 @@ function DepositFlow({
|
|
|
2617
3015
|
flowModeRef.current = flowMode;
|
|
2618
3016
|
const logFlow = _react.useCallback.call(void 0,
|
|
2619
3017
|
(message, data) => {
|
|
2620
|
-
|
|
3018
|
+
_chunkFLVSQDP4cjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
|
|
2621
3019
|
},
|
|
2622
3020
|
[debug]
|
|
2623
3021
|
);
|
|
2624
3022
|
const logFlowError = _react.useCallback.call(void 0,
|
|
2625
3023
|
(message, error, data) => {
|
|
2626
|
-
|
|
3024
|
+
_chunkFLVSQDP4cjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
|
|
2627
3025
|
},
|
|
2628
3026
|
[debug]
|
|
2629
3027
|
);
|
|
@@ -2635,21 +3033,23 @@ function DepositFlow({
|
|
|
2635
3033
|
for (const asset of portfolioAssetsRef.current) {
|
|
2636
3034
|
if (asset.symbol.toLowerCase() === sym && asset.balanceUsd && asset.balance) {
|
|
2637
3035
|
try {
|
|
2638
|
-
const balanceUnits = Number(
|
|
3036
|
+
const balanceUnits = Number(
|
|
3037
|
+
_viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals)
|
|
3038
|
+
);
|
|
2639
3039
|
if (balanceUnits > 0) return asset.balanceUsd / balanceUnits;
|
|
2640
|
-
} catch (
|
|
3040
|
+
} catch (e22) {
|
|
2641
3041
|
}
|
|
2642
3042
|
}
|
|
2643
3043
|
}
|
|
2644
3044
|
return null;
|
|
2645
3045
|
}, []);
|
|
2646
3046
|
const dappSwitchChain = _react.useMemo.call(void 0, () => {
|
|
2647
|
-
if (!_optionalChain([dappWalletClient, 'optionalAccess',
|
|
3047
|
+
if (!_optionalChain([dappWalletClient, 'optionalAccess', _86 => _86.switchChain])) return void 0;
|
|
2648
3048
|
return async (chainId) => {
|
|
2649
|
-
await _optionalChain([dappWalletClient, 'access',
|
|
3049
|
+
await _optionalChain([dappWalletClient, 'access', _87 => _87.switchChain, 'optionalCall', _88 => _88({ id: chainId })]);
|
|
2650
3050
|
};
|
|
2651
3051
|
}, [dappWalletClient]);
|
|
2652
|
-
const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
3052
|
+
const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _89 => _89.account, 'optionalAccess', _90 => _90.address]), () => ( null));
|
|
2653
3053
|
const walletOptions = _react.useMemo.call(void 0, () => {
|
|
2654
3054
|
const options = [];
|
|
2655
3055
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -2663,7 +3063,7 @@ function DepositFlow({
|
|
|
2663
3063
|
});
|
|
2664
3064
|
seen.add(id);
|
|
2665
3065
|
}
|
|
2666
|
-
if (enableSolana && _optionalChain([reownWallet, 'optionalAccess',
|
|
3066
|
+
if (enableSolana && _optionalChain([reownWallet, 'optionalAccess', _91 => _91.isConnected]) && reownWallet.isSolana && reownWallet.solanaAddress && dappAddress) {
|
|
2667
3067
|
const id = _nullishCoalesce(reownWallet.caipAddress, () => ( `solana:${reownWallet.solanaAddress}`));
|
|
2668
3068
|
if (!seen.has(id)) {
|
|
2669
3069
|
options.push({
|
|
@@ -2675,7 +3075,7 @@ function DepositFlow({
|
|
|
2675
3075
|
});
|
|
2676
3076
|
seen.add(id);
|
|
2677
3077
|
}
|
|
2678
|
-
} else if (_optionalChain([reownWallet, 'optionalAccess',
|
|
3078
|
+
} else if (_optionalChain([reownWallet, 'optionalAccess', _92 => _92.address]) && reownWallet.isConnected && reownWallet.walletClient && reownWallet.publicClient && !seen.has(`evm:${reownWallet.address.toLowerCase()}`)) {
|
|
2679
3079
|
const id = `evm:${reownWallet.address.toLowerCase()}`;
|
|
2680
3080
|
if (!seen.has(id)) {
|
|
2681
3081
|
options.push({
|
|
@@ -2692,20 +3092,20 @@ function DepositFlow({
|
|
|
2692
3092
|
}, [
|
|
2693
3093
|
connectedWalletAddress,
|
|
2694
3094
|
dappAddress,
|
|
2695
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2696
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2697
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2698
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2699
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
3095
|
+
_optionalChain([reownWallet, 'optionalAccess', _93 => _93.address]),
|
|
3096
|
+
_optionalChain([reownWallet, 'optionalAccess', _94 => _94.isConnected]),
|
|
3097
|
+
_optionalChain([reownWallet, 'optionalAccess', _95 => _95.walletClient]),
|
|
3098
|
+
_optionalChain([reownWallet, 'optionalAccess', _96 => _96.publicClient]),
|
|
3099
|
+
_optionalChain([reownWallet, 'optionalAccess', _97 => _97.icon]),
|
|
2700
3100
|
enableSolana,
|
|
2701
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2702
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2703
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
3101
|
+
_optionalChain([reownWallet, 'optionalAccess', _98 => _98.isSolana]),
|
|
3102
|
+
_optionalChain([reownWallet, 'optionalAccess', _99 => _99.solanaAddress]),
|
|
3103
|
+
_optionalChain([reownWallet, 'optionalAccess', _100 => _100.caipAddress])
|
|
2704
3104
|
]);
|
|
2705
|
-
const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess',
|
|
3105
|
+
const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess', _101 => _101.account]) && dappAddress && !reownWallet;
|
|
2706
3106
|
const hasWalletOptions = walletOptions.length > 0;
|
|
2707
3107
|
const hasReownSession = Boolean(
|
|
2708
|
-
enableSolana ? _optionalChain([reownWallet, 'optionalAccess',
|
|
3108
|
+
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _102 => _102.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _103 => _103.address]) : _optionalChain([reownWallet, 'optionalAccess', _104 => _104.address])
|
|
2709
3109
|
);
|
|
2710
3110
|
const isWalletHydrationPending = Boolean(
|
|
2711
3111
|
dappAddress && !hasWalletOptions && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasReownSession && !reownWallet.isReady)
|
|
@@ -2745,16 +3145,16 @@ function DepositFlow({
|
|
|
2745
3145
|
return {
|
|
2746
3146
|
ownerAddress: dappAddress,
|
|
2747
3147
|
walletClient: void 0,
|
|
2748
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
3148
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkFLVSQDP4cjs.getPublicClient.call(void 0, targetChain))),
|
|
2749
3149
|
switchChain: void 0
|
|
2750
3150
|
};
|
|
2751
3151
|
}
|
|
2752
3152
|
if (canAutoLock) {
|
|
2753
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
3153
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _105 => _105.chain, 'optionalAccess', _106 => _106.id]), () => ( targetChain));
|
|
2754
3154
|
return {
|
|
2755
3155
|
ownerAddress: dappWalletClient.account.address,
|
|
2756
3156
|
walletClient: dappWalletClient,
|
|
2757
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
3157
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkFLVSQDP4cjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
2758
3158
|
switchChain: dappSwitchChain
|
|
2759
3159
|
};
|
|
2760
3160
|
}
|
|
@@ -2768,24 +3168,24 @@ function DepositFlow({
|
|
|
2768
3168
|
return {
|
|
2769
3169
|
ownerAddress: dappAddress,
|
|
2770
3170
|
walletClient: void 0,
|
|
2771
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
3171
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkFLVSQDP4cjs.getPublicClient.call(void 0, targetChain))),
|
|
2772
3172
|
switchChain: void 0
|
|
2773
3173
|
};
|
|
2774
3174
|
}
|
|
2775
|
-
if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess',
|
|
2776
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
3175
|
+
if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess', _107 => _107.account]) && selectedOption.address && dappWalletClient.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
3176
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _108 => _108.chain, 'optionalAccess', _109 => _109.id]), () => ( targetChain));
|
|
2777
3177
|
return {
|
|
2778
3178
|
ownerAddress: dappWalletClient.account.address,
|
|
2779
3179
|
walletClient: dappWalletClient,
|
|
2780
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
3180
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkFLVSQDP4cjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
2781
3181
|
switchChain: dappSwitchChain
|
|
2782
3182
|
};
|
|
2783
3183
|
}
|
|
2784
|
-
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess',
|
|
3184
|
+
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess', _110 => _110.address]) && selectedOption.address && reownWallet.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
2785
3185
|
return {
|
|
2786
3186
|
ownerAddress: reownWallet.address,
|
|
2787
3187
|
walletClient: reownWallet.walletClient,
|
|
2788
|
-
publicClient: _nullishCoalesce(reownWallet.publicClient, () => (
|
|
3188
|
+
publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunkFLVSQDP4cjs.getPublicClient.call(void 0, targetChain))),
|
|
2789
3189
|
switchChain: reownWallet.switchChain
|
|
2790
3190
|
};
|
|
2791
3191
|
}
|
|
@@ -2823,7 +3223,7 @@ function DepositFlow({
|
|
|
2823
3223
|
return {
|
|
2824
3224
|
ownerAddress: dappAddress,
|
|
2825
3225
|
walletClient: void 0,
|
|
2826
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
3226
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkFLVSQDP4cjs.getPublicClient.call(void 0, targetChain))),
|
|
2827
3227
|
switchChain: void 0
|
|
2828
3228
|
};
|
|
2829
3229
|
}
|
|
@@ -2845,7 +3245,7 @@ function DepositFlow({
|
|
|
2845
3245
|
walletSignerContext,
|
|
2846
3246
|
walletSelectionKey
|
|
2847
3247
|
]);
|
|
2848
|
-
const sessionKeyAddress = _nullishCoalesce(_nullishCoalesce(dappAddress, () => ( _optionalChain([signerContext, 'optionalAccess',
|
|
3248
|
+
const sessionKeyAddress = _nullishCoalesce(_nullishCoalesce(dappAddress, () => ( _optionalChain([signerContext, 'optionalAccess', _111 => _111.ownerAddress]))), () => ( null));
|
|
2849
3249
|
const lastTargetRef = _react.useRef.call(void 0, null);
|
|
2850
3250
|
_react.useEffect.call(void 0, () => {
|
|
2851
3251
|
const prev = lastTargetRef.current;
|
|
@@ -2922,7 +3322,7 @@ function DepositFlow({
|
|
|
2922
3322
|
const stepIndex = step.type === "setup" ? 0 : step.type === "deposit-address" ? 1 : step.type === "select-asset" ? 1 : step.type === "solana-token-select" ? 1 : step.type === "solana-amount" ? 2 : step.type === "amount" ? 2 : step.type === "confirm" ? 3 : step.type === "solana-confirm" ? 3 : 4;
|
|
2923
3323
|
const currentBackHandler = step.type === "deposit-address" ? handleBackFromDepositAddress : step.type === "select-asset" && signerContext && !canAutoLock ? handleBackFromSelectAsset : step.type === "solana-token-select" ? handleBackFromSolanaTokenSelect : step.type === "solana-amount" ? handleBackFromSolanaAmount : step.type === "solana-confirm" ? handleBackFromSolanaConfirm : step.type === "amount" ? handleBackFromAmount : step.type === "confirm" ? handleBackFromConfirm : void 0;
|
|
2924
3324
|
_react.useEffect.call(void 0, () => {
|
|
2925
|
-
_optionalChain([onStepChangeRef, 'access',
|
|
3325
|
+
_optionalChain([onStepChangeRef, 'access', _112 => _112.current, 'optionalCall', _113 => _113(stepIndex, currentBackHandler)]);
|
|
2926
3326
|
}, [stepIndex, currentBackHandler, onStepChangeRef]);
|
|
2927
3327
|
const stepSendToken = step.type === "amount" ? step.asset.symbol : null;
|
|
2928
3328
|
const stepOpenEventKey = step.type === "select-asset" ? "select-asset" : step.type === "deposit-address" ? "deposit-address" : step.type === "amount" && stepSendToken ? `amount:${stepSendToken.toLowerCase()}` : null;
|
|
@@ -2937,23 +3337,23 @@ function DepositFlow({
|
|
|
2937
3337
|
}
|
|
2938
3338
|
lastStepOpenEventKeyRef.current = stepOpenEventKey;
|
|
2939
3339
|
if (step.type === "select-asset") {
|
|
2940
|
-
_optionalChain([onEventRef, 'access',
|
|
3340
|
+
_optionalChain([onEventRef, 'access', _114 => _114.current, 'optionalCall', _115 => _115({
|
|
2941
3341
|
type: "deposit_modal_connected_wallet_select_source_open",
|
|
2942
3342
|
total_balance_in_external_wallet: totalBalanceUsd,
|
|
2943
3343
|
pred_balance: totalBalanceUsd
|
|
2944
3344
|
})]);
|
|
2945
3345
|
} else if (step.type === "deposit-address") {
|
|
2946
|
-
const chainName =
|
|
2947
|
-
const tokenSymbol =
|
|
2948
|
-
_optionalChain([onEventRef, 'access',
|
|
3346
|
+
const chainName = _chunkMUWVDVY4cjs.getChainName.call(void 0, targetChain);
|
|
3347
|
+
const tokenSymbol = _chunkMUWVDVY4cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3348
|
+
_optionalChain([onEventRef, 'access', _116 => _116.current, 'optionalCall', _117 => _117({
|
|
2949
3349
|
type: "deposit_modal_transfer_crypto_open",
|
|
2950
3350
|
default_chain: chainName,
|
|
2951
3351
|
default_token: tokenSymbol,
|
|
2952
3352
|
pred_balance: totalBalanceUsd
|
|
2953
3353
|
})]);
|
|
2954
3354
|
} else if (step.type === "amount" && stepSendToken) {
|
|
2955
|
-
const receiveSymbol =
|
|
2956
|
-
_optionalChain([onEventRef, 'access',
|
|
3355
|
+
const receiveSymbol = _chunkMUWVDVY4cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3356
|
+
_optionalChain([onEventRef, 'access', _118 => _118.current, 'optionalCall', _119 => _119({
|
|
2957
3357
|
type: "deposit_modal_connected_wallet_enter_value_open",
|
|
2958
3358
|
send_token: stepSendToken,
|
|
2959
3359
|
receive_token: receiveSymbol,
|
|
@@ -2986,7 +3386,7 @@ function DepositFlow({
|
|
|
2986
3386
|
targetToken
|
|
2987
3387
|
]);
|
|
2988
3388
|
_react.useEffect.call(void 0, () => {
|
|
2989
|
-
_optionalChain([onTotalBalanceChangeRef, 'access',
|
|
3389
|
+
_optionalChain([onTotalBalanceChangeRef, 'access', _120 => _120.current, 'optionalCall', _121 => _121(totalBalanceUsd)]);
|
|
2990
3390
|
}, [totalBalanceUsd, onTotalBalanceChangeRef]);
|
|
2991
3391
|
const isDepositAddressMode = flowMode === "deposit-address";
|
|
2992
3392
|
const isSolanaWalletMode = flowMode === "solana-wallet";
|
|
@@ -3001,12 +3401,13 @@ function DepositFlow({
|
|
|
3001
3401
|
setStep({ type: "setup" });
|
|
3002
3402
|
}, []);
|
|
3003
3403
|
const handleNewDeposit = _react.useCallback.call(void 0, () => {
|
|
3404
|
+
_optionalChain([onSmartAccountChangeRef, 'access', _122 => _122.current, 'optionalCall', _123 => _123(null)]);
|
|
3004
3405
|
setFlowMode(null);
|
|
3005
3406
|
setStep({ type: "setup" });
|
|
3006
3407
|
setIsConnectSelectionConfirmed(false);
|
|
3007
3408
|
setSelectedWalletId(null);
|
|
3008
3409
|
hasNavigatedBackRef.current = false;
|
|
3009
|
-
}, []);
|
|
3410
|
+
}, [onSmartAccountChangeRef]);
|
|
3010
3411
|
const handleSetupComplete = _react.useCallback.call(void 0,
|
|
3011
3412
|
(smartAccount, solanaDepositAddress) => {
|
|
3012
3413
|
logFlow("setup:complete", {
|
|
@@ -3014,6 +3415,7 @@ function DepositFlow({
|
|
|
3014
3415
|
hasSolanaDepositAddress: Boolean(solanaDepositAddress),
|
|
3015
3416
|
flowMode: isDepositAddressMode ? "deposit-address" : isSolanaWalletMode ? "solana-wallet" : "wallet"
|
|
3016
3417
|
});
|
|
3418
|
+
_optionalChain([onSmartAccountChangeRef, 'access', _124 => _124.current, 'optionalCall', _125 => _125(smartAccount)]);
|
|
3017
3419
|
if (isDepositAddressMode) {
|
|
3018
3420
|
setStep({
|
|
3019
3421
|
type: "deposit-address",
|
|
@@ -3028,7 +3430,7 @@ function DepositFlow({
|
|
|
3028
3430
|
solanaDepositAddress
|
|
3029
3431
|
});
|
|
3030
3432
|
} else {
|
|
3031
|
-
_optionalChain([onError, 'optionalCall',
|
|
3433
|
+
_optionalChain([onError, 'optionalCall', _126 => _126({
|
|
3032
3434
|
message: "Solana deposit address not available. Please try again.",
|
|
3033
3435
|
code: "SOLANA_SETUP_FAILED"
|
|
3034
3436
|
})]);
|
|
@@ -3037,35 +3439,18 @@ function DepositFlow({
|
|
|
3037
3439
|
setStep({ type: "select-asset", smartAccount });
|
|
3038
3440
|
}
|
|
3039
3441
|
},
|
|
3040
|
-
[isDepositAddressMode, isSolanaWalletMode, logFlow]
|
|
3442
|
+
[isDepositAddressMode, isSolanaWalletMode, logFlow, onSmartAccountChangeRef]
|
|
3041
3443
|
);
|
|
3042
|
-
const
|
|
3043
|
-
(
|
|
3444
|
+
const handleDepositAddressSubmitted = _react.useCallback.call(void 0,
|
|
3445
|
+
(data) => {
|
|
3044
3446
|
logFlow("deposit-address:detected", {
|
|
3045
|
-
txHash,
|
|
3046
|
-
sourceChain:
|
|
3047
|
-
|
|
3048
|
-
amount
|
|
3049
|
-
});
|
|
3050
|
-
setStep((prev) => {
|
|
3051
|
-
if (prev.type !== "deposit-address") return prev;
|
|
3052
|
-
const isEvmToken = /^0x[a-fA-F0-9]{40}$/.test(token);
|
|
3053
|
-
const directTransfer = typeof chainId === "number" && isEvmToken && isSameRoute(chainId, token, targetChain, targetToken);
|
|
3054
|
-
return {
|
|
3055
|
-
type: "processing",
|
|
3056
|
-
smartAccount: prev.smartAccount,
|
|
3057
|
-
txHash,
|
|
3058
|
-
sourceChain: chainId,
|
|
3059
|
-
sourceToken: token,
|
|
3060
|
-
amount,
|
|
3061
|
-
sourceSymbol,
|
|
3062
|
-
sourceDecimals,
|
|
3063
|
-
directTransfer
|
|
3064
|
-
};
|
|
3447
|
+
txHash: data.txHash,
|
|
3448
|
+
sourceChain: data.sourceChain,
|
|
3449
|
+
amount: data.amount
|
|
3065
3450
|
});
|
|
3066
|
-
_optionalChain([
|
|
3451
|
+
_optionalChain([onDepositSubmittedRef, 'access', _127 => _127.current, 'optionalCall', _128 => _128(data)]);
|
|
3067
3452
|
},
|
|
3068
|
-
[
|
|
3453
|
+
[logFlow, onDepositSubmittedRef]
|
|
3069
3454
|
);
|
|
3070
3455
|
const handleSolanaTokenContinue = _react.useCallback.call(void 0,
|
|
3071
3456
|
(token, balance, balanceUsd) => {
|
|
@@ -3087,8 +3472,8 @@ function DepositFlow({
|
|
|
3087
3472
|
);
|
|
3088
3473
|
const handleSolanaAmountContinue = _react.useCallback.call(void 0,
|
|
3089
3474
|
(token, sourceAmount, inputAmountUsd) => {
|
|
3090
|
-
const targetSym =
|
|
3091
|
-
const isTargetStable =
|
|
3475
|
+
const targetSym = _chunkMUWVDVY4cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3476
|
+
const isTargetStable = _chunkMUWVDVY4cjs.isStablecoinSymbol.call(void 0, targetSym);
|
|
3092
3477
|
const targetTokenPriceUsd = isTargetStable ? 1 : getTokenPriceUsd(targetSym);
|
|
3093
3478
|
logFlow("solana:amount:continue", {
|
|
3094
3479
|
token: token.symbol,
|
|
@@ -3135,7 +3520,7 @@ function DepositFlow({
|
|
|
3135
3520
|
sourceDecimals: prev.token.decimals
|
|
3136
3521
|
};
|
|
3137
3522
|
});
|
|
3138
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
3523
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _129 => _129({
|
|
3139
3524
|
txHash,
|
|
3140
3525
|
sourceChain: "solana",
|
|
3141
3526
|
amount: amountUnits
|
|
@@ -3145,13 +3530,13 @@ function DepositFlow({
|
|
|
3145
3530
|
);
|
|
3146
3531
|
const handleConnected = _react.useCallback.call(void 0,
|
|
3147
3532
|
(addr, smartAccount) => {
|
|
3148
|
-
_optionalChain([onConnected, 'optionalCall',
|
|
3533
|
+
_optionalChain([onConnected, 'optionalCall', _130 => _130({ address: addr, smartAccount })]);
|
|
3149
3534
|
},
|
|
3150
3535
|
[onConnected]
|
|
3151
3536
|
);
|
|
3152
3537
|
const handleAssetContinue = _react.useCallback.call(void 0,
|
|
3153
3538
|
(asset) => {
|
|
3154
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
3539
|
+
_optionalChain([onEvent, 'optionalCall', _131 => _131({
|
|
3155
3540
|
type: "deposit_modal_connected_wallet_select_source_cta_click",
|
|
3156
3541
|
total_balance_in_external_wallet: totalBalanceUsd,
|
|
3157
3542
|
pred_balance: totalBalanceUsd,
|
|
@@ -3173,8 +3558,8 @@ function DepositFlow({
|
|
|
3173
3558
|
);
|
|
3174
3559
|
const handleAmountContinue = _react.useCallback.call(void 0,
|
|
3175
3560
|
(amount, targetAmount, balance) => {
|
|
3176
|
-
const targetSym =
|
|
3177
|
-
const isTargetStable =
|
|
3561
|
+
const targetSym = _chunkMUWVDVY4cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3562
|
+
const isTargetStable = _chunkMUWVDVY4cjs.isStablecoinSymbol.call(void 0, targetSym);
|
|
3178
3563
|
const targetTokenPriceUsd = isTargetStable ? 1 : getTokenPriceUsd(targetSym);
|
|
3179
3564
|
setStep((prev) => {
|
|
3180
3565
|
if (prev.type !== "amount") return prev;
|
|
@@ -3208,7 +3593,7 @@ function DepositFlow({
|
|
|
3208
3593
|
sourceChain: chainId,
|
|
3209
3594
|
sourceToken: token,
|
|
3210
3595
|
amount,
|
|
3211
|
-
directTransfer:
|
|
3596
|
+
directTransfer: isSameRoute2(chainId, token, targetChain, targetToken)
|
|
3212
3597
|
};
|
|
3213
3598
|
});
|
|
3214
3599
|
},
|
|
@@ -3216,30 +3601,30 @@ function DepositFlow({
|
|
|
3216
3601
|
);
|
|
3217
3602
|
const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
|
|
3218
3603
|
(txHash, sourceChain, amount) => {
|
|
3219
|
-
_optionalChain([
|
|
3604
|
+
_optionalChain([onDepositSubmittedRef, 'access', _132 => _132.current, 'optionalCall', _133 => _133({ txHash, sourceChain, amount })]);
|
|
3220
3605
|
},
|
|
3221
|
-
[
|
|
3606
|
+
[onDepositSubmittedRef]
|
|
3222
3607
|
);
|
|
3223
3608
|
const handleDepositComplete = _react.useCallback.call(void 0,
|
|
3224
3609
|
(txHash, destinationTxHash, context) => {
|
|
3225
3610
|
logFlow("deposit:complete", { txHash, destinationTxHash, ...context });
|
|
3226
|
-
_optionalChain([
|
|
3611
|
+
_optionalChain([onDepositCompleteRef, 'access', _134 => _134.current, 'optionalCall', _135 => _135({ txHash, destinationTxHash, ...context })]);
|
|
3227
3612
|
},
|
|
3228
|
-
[logFlow,
|
|
3613
|
+
[logFlow, onDepositCompleteRef]
|
|
3229
3614
|
);
|
|
3230
3615
|
const handleDepositFailed = _react.useCallback.call(void 0,
|
|
3231
3616
|
(txHash, error) => {
|
|
3232
3617
|
logFlowError("deposit:failed", error, { txHash });
|
|
3233
|
-
_optionalChain([
|
|
3618
|
+
_optionalChain([onDepositFailedRef, 'access', _136 => _136.current, 'optionalCall', _137 => _137({ txHash, error })]);
|
|
3234
3619
|
},
|
|
3235
|
-
[logFlowError,
|
|
3620
|
+
[logFlowError, onDepositFailedRef]
|
|
3236
3621
|
);
|
|
3237
3622
|
const handleError = _react.useCallback.call(void 0,
|
|
3238
3623
|
(message, code) => {
|
|
3239
3624
|
logFlowError("flow:error", message, { code });
|
|
3240
|
-
_optionalChain([
|
|
3625
|
+
_optionalChain([onErrorRef, 'access', _138 => _138.current, 'optionalCall', _139 => _139({ message, code })]);
|
|
3241
3626
|
},
|
|
3242
|
-
[logFlowError,
|
|
3627
|
+
[logFlowError, onErrorRef]
|
|
3243
3628
|
);
|
|
3244
3629
|
const handleTotalBalanceComputed = _react.useCallback.call(void 0, (total) => {
|
|
3245
3630
|
setTotalBalanceUsd(total);
|
|
@@ -3294,7 +3679,7 @@ function DepositFlow({
|
|
|
3294
3679
|
if (walletId) {
|
|
3295
3680
|
const selectedOption = walletOptions.find((o) => o.id === walletId);
|
|
3296
3681
|
setSelectedWalletId(walletId);
|
|
3297
|
-
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess',
|
|
3682
|
+
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess', _140 => _140.kind]) === "solana") {
|
|
3298
3683
|
handleSelectSolanaWallet();
|
|
3299
3684
|
} else {
|
|
3300
3685
|
handleSelectProvider();
|
|
@@ -3324,7 +3709,7 @@ function DepositFlow({
|
|
|
3324
3709
|
]);
|
|
3325
3710
|
if (showConnectStep) {
|
|
3326
3711
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3327
|
-
|
|
3712
|
+
_chunkFLVSQDP4cjs.ConnectStep,
|
|
3328
3713
|
{
|
|
3329
3714
|
walletOptions,
|
|
3330
3715
|
selectedWalletId: selectedWalletIdEffective,
|
|
@@ -3343,7 +3728,7 @@ function DepositFlow({
|
|
|
3343
3728
|
const selectedOption = walletOptions.find(
|
|
3344
3729
|
(o) => o.id === selectedWalletIdEffective
|
|
3345
3730
|
);
|
|
3346
|
-
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess',
|
|
3731
|
+
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess', _141 => _141.kind]) === "solana") {
|
|
3347
3732
|
handleSelectSolanaWallet();
|
|
3348
3733
|
} else {
|
|
3349
3734
|
handleSelectProvider();
|
|
@@ -3367,6 +3752,8 @@ function DepositFlow({
|
|
|
3367
3752
|
sessionChainIds,
|
|
3368
3753
|
recipient,
|
|
3369
3754
|
postBridgeActions,
|
|
3755
|
+
outputTokenRules,
|
|
3756
|
+
rejectUnmapped,
|
|
3370
3757
|
forceRegister,
|
|
3371
3758
|
enableSolana,
|
|
3372
3759
|
service,
|
|
@@ -3382,11 +3769,17 @@ function DepositFlow({
|
|
|
3382
3769
|
solanaDepositAddress: enableSolana ? step.solanaDepositAddress : void 0,
|
|
3383
3770
|
service,
|
|
3384
3771
|
allowedRoutes,
|
|
3385
|
-
|
|
3772
|
+
targetChain,
|
|
3773
|
+
targetToken,
|
|
3774
|
+
waitForFinalTx,
|
|
3775
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _142 => _142.length])),
|
|
3776
|
+
onDepositSubmitted: handleDepositAddressSubmitted,
|
|
3777
|
+
onDepositComplete: handleDepositComplete,
|
|
3778
|
+
onDepositFailed: handleDepositFailed,
|
|
3386
3779
|
onCopyAddress: () => {
|
|
3387
|
-
const chainName =
|
|
3388
|
-
const tokenSymbol =
|
|
3389
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
3780
|
+
const chainName = _chunkMUWVDVY4cjs.getChainName.call(void 0, targetChain);
|
|
3781
|
+
const tokenSymbol = _chunkMUWVDVY4cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3782
|
+
_optionalChain([onEvent, 'optionalCall', _143 => _143({
|
|
3390
3783
|
type: "deposit_modal_transfer_crypto_cta_click",
|
|
3391
3784
|
default_chain: chainName,
|
|
3392
3785
|
default_token: tokenSymbol,
|
|
@@ -3394,29 +3787,6 @@ function DepositFlow({
|
|
|
3394
3787
|
cta_name: "copy"
|
|
3395
3788
|
})]);
|
|
3396
3789
|
},
|
|
3397
|
-
onError: handleError
|
|
3398
|
-
}
|
|
3399
|
-
),
|
|
3400
|
-
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3401
|
-
_chunk4CZ7W3RScjs.ProcessingStep,
|
|
3402
|
-
{
|
|
3403
|
-
smartAccount: step.smartAccount,
|
|
3404
|
-
txHash: step.txHash,
|
|
3405
|
-
sourceChain: step.sourceChain,
|
|
3406
|
-
sourceToken: step.sourceToken,
|
|
3407
|
-
targetChain,
|
|
3408
|
-
targetToken,
|
|
3409
|
-
amount: step.amount,
|
|
3410
|
-
sourceSymbol: step.sourceSymbol,
|
|
3411
|
-
sourceDecimals: step.sourceDecimals,
|
|
3412
|
-
waitForFinalTx,
|
|
3413
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _107 => _107.length])),
|
|
3414
|
-
service,
|
|
3415
|
-
directTransfer: step.directTransfer,
|
|
3416
|
-
onClose,
|
|
3417
|
-
onNewDeposit: handleNewDeposit,
|
|
3418
|
-
onDepositComplete: handleDepositComplete,
|
|
3419
|
-
onDepositFailed: handleDepositFailed,
|
|
3420
3790
|
onError: handleError,
|
|
3421
3791
|
debug
|
|
3422
3792
|
}
|
|
@@ -3425,8 +3795,8 @@ function DepositFlow({
|
|
|
3425
3795
|
}
|
|
3426
3796
|
if (isSolanaWalletMode) {
|
|
3427
3797
|
if (!sessionKeyAddress) return null;
|
|
3428
|
-
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess',
|
|
3429
|
-
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess',
|
|
3798
|
+
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess', _144 => _144.solanaAddress]);
|
|
3799
|
+
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess', _145 => _145.solanaProvider]);
|
|
3430
3800
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
3431
3801
|
step.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3432
3802
|
SetupStep,
|
|
@@ -3438,6 +3808,8 @@ function DepositFlow({
|
|
|
3438
3808
|
sessionChainIds,
|
|
3439
3809
|
recipient,
|
|
3440
3810
|
postBridgeActions,
|
|
3811
|
+
outputTokenRules,
|
|
3812
|
+
rejectUnmapped,
|
|
3441
3813
|
forceRegister,
|
|
3442
3814
|
enableSolana,
|
|
3443
3815
|
service,
|
|
@@ -3522,7 +3894,7 @@ function DepositFlow({
|
|
|
3522
3894
|
) })
|
|
3523
3895
|
] }) : null,
|
|
3524
3896
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3525
|
-
|
|
3897
|
+
_chunkFLVSQDP4cjs.ProcessingStep,
|
|
3526
3898
|
{
|
|
3527
3899
|
smartAccount: step.smartAccount,
|
|
3528
3900
|
txHash: step.txHash,
|
|
@@ -3534,7 +3906,7 @@ function DepositFlow({
|
|
|
3534
3906
|
sourceSymbol: step.sourceSymbol,
|
|
3535
3907
|
sourceDecimals: step.sourceDecimals,
|
|
3536
3908
|
waitForFinalTx,
|
|
3537
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
3909
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _146 => _146.length])),
|
|
3538
3910
|
service,
|
|
3539
3911
|
directTransfer: step.directTransfer,
|
|
3540
3912
|
onClose,
|
|
@@ -3547,16 +3919,16 @@ function DepositFlow({
|
|
|
3547
3919
|
)
|
|
3548
3920
|
] });
|
|
3549
3921
|
}
|
|
3550
|
-
if (!_optionalChain([signerContext, 'optionalAccess',
|
|
3922
|
+
if (!_optionalChain([signerContext, 'optionalAccess', _147 => _147.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _148 => _148.publicClient])) {
|
|
3551
3923
|
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..." }) }) }) }) });
|
|
3552
3924
|
}
|
|
3553
3925
|
const ownerAddress = signerContext.ownerAddress;
|
|
3554
|
-
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access',
|
|
3926
|
+
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _149 => _149.walletClient, 'optionalAccess', _150 => _150.chain, 'optionalAccess', _151 => _151.id]), () => ( _optionalChain([signerContext, 'access', _152 => _152.publicClient, 'access', _153 => _153.chain, 'optionalAccess', _154 => _154.id]))), () => ( targetChain));
|
|
3555
3927
|
const getReadClientForChain = (chainId) => {
|
|
3556
|
-
if (_optionalChain([signerContext, 'access',
|
|
3928
|
+
if (_optionalChain([signerContext, 'access', _155 => _155.publicClient, 'access', _156 => _156.chain, 'optionalAccess', _157 => _157.id]) === chainId) {
|
|
3557
3929
|
return signerContext.publicClient;
|
|
3558
3930
|
}
|
|
3559
|
-
return
|
|
3931
|
+
return _chunkFLVSQDP4cjs.getPublicClient.call(void 0, chainId);
|
|
3560
3932
|
};
|
|
3561
3933
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
3562
3934
|
step.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3570,6 +3942,8 @@ function DepositFlow({
|
|
|
3570
3942
|
sessionChainIds,
|
|
3571
3943
|
recipient,
|
|
3572
3944
|
postBridgeActions,
|
|
3945
|
+
outputTokenRules,
|
|
3946
|
+
rejectUnmapped,
|
|
3573
3947
|
forceRegister,
|
|
3574
3948
|
enableSolana,
|
|
3575
3949
|
service,
|
|
@@ -3589,7 +3963,11 @@ function DepositFlow({
|
|
|
3589
3963
|
service,
|
|
3590
3964
|
onContinue: handleAssetContinue,
|
|
3591
3965
|
onTotalBalanceComputed: handleTotalBalanceComputed,
|
|
3592
|
-
onAssetsLoaded: handleAssetsLoaded
|
|
3966
|
+
onAssetsLoaded: handleAssetsLoaded,
|
|
3967
|
+
onDisconnect: onDisconnect ? () => {
|
|
3968
|
+
onDisconnect();
|
|
3969
|
+
handleBackFromSelectAsset();
|
|
3970
|
+
} : void 0
|
|
3593
3971
|
}
|
|
3594
3972
|
),
|
|
3595
3973
|
step.type === "amount" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3606,8 +3984,8 @@ function DepositFlow({
|
|
|
3606
3984
|
uiConfig,
|
|
3607
3985
|
onContinue: handleAmountContinue,
|
|
3608
3986
|
onCtaClick: (ctaName) => {
|
|
3609
|
-
const receiveSymbol =
|
|
3610
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
3987
|
+
const receiveSymbol = _chunkMUWVDVY4cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3988
|
+
_optionalChain([onEvent, 'optionalCall', _158 => _158({
|
|
3611
3989
|
type: "deposit_modal_connected_wallet_enter_value_cta_click",
|
|
3612
3990
|
send_token: step.asset.symbol,
|
|
3613
3991
|
receive_token: receiveSymbol,
|
|
@@ -3638,7 +4016,7 @@ function DepositFlow({
|
|
|
3638
4016
|
}
|
|
3639
4017
|
),
|
|
3640
4018
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3641
|
-
|
|
4019
|
+
_chunkFLVSQDP4cjs.ProcessingStep,
|
|
3642
4020
|
{
|
|
3643
4021
|
smartAccount: step.smartAccount,
|
|
3644
4022
|
txHash: step.txHash,
|
|
@@ -3650,7 +4028,7 @@ function DepositFlow({
|
|
|
3650
4028
|
sourceSymbol: step.sourceSymbol,
|
|
3651
4029
|
sourceDecimals: step.sourceDecimals,
|
|
3652
4030
|
waitForFinalTx,
|
|
3653
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
4031
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _159 => _159.length])),
|
|
3654
4032
|
service,
|
|
3655
4033
|
directTransfer: step.directTransfer,
|
|
3656
4034
|
onClose,
|
|
@@ -3664,10 +4042,273 @@ function DepositFlow({
|
|
|
3664
4042
|
] });
|
|
3665
4043
|
}
|
|
3666
4044
|
|
|
4045
|
+
// src/components/history/DepositHistoryPanel.tsx
|
|
4046
|
+
|
|
4047
|
+
|
|
4048
|
+
function shortenHash(hash) {
|
|
4049
|
+
if (hash.length <= 14) return hash;
|
|
4050
|
+
return `${hash.slice(0, 6)}\u2026${hash.slice(-4)}`;
|
|
4051
|
+
}
|
|
4052
|
+
function formatTimestamp2(iso) {
|
|
4053
|
+
try {
|
|
4054
|
+
const date = new Date(iso);
|
|
4055
|
+
if (Number.isNaN(date.getTime())) return iso;
|
|
4056
|
+
const now = /* @__PURE__ */ new Date();
|
|
4057
|
+
const diffMs = now.getTime() - date.getTime();
|
|
4058
|
+
const diffMin = Math.floor(diffMs / 6e4);
|
|
4059
|
+
if (diffMin < 1) return "Just now";
|
|
4060
|
+
if (diffMin < 60) return `${diffMin}m ago`;
|
|
4061
|
+
const diffHr = Math.floor(diffMin / 60);
|
|
4062
|
+
if (diffHr < 24) return `${diffHr}h ago`;
|
|
4063
|
+
const diffDay = Math.floor(diffHr / 24);
|
|
4064
|
+
if (diffDay < 7) return `${diffDay}d ago`;
|
|
4065
|
+
return date.toLocaleDateString("en-US", {
|
|
4066
|
+
month: "short",
|
|
4067
|
+
day: "numeric"
|
|
4068
|
+
});
|
|
4069
|
+
} catch (e23) {
|
|
4070
|
+
return iso;
|
|
4071
|
+
}
|
|
4072
|
+
}
|
|
4073
|
+
function resolveChainId(value) {
|
|
4074
|
+
if (value === void 0 || value === null) return null;
|
|
4075
|
+
if (typeof value === "number") return value;
|
|
4076
|
+
if (_chunkFLVSQDP4cjs.isSolanaCaip2.call(void 0, value) || value === "solana") return "solana";
|
|
4077
|
+
const parsed = _chunkFLVSQDP4cjs.parseEvmChainId.call(void 0, value);
|
|
4078
|
+
if (parsed !== null) return parsed;
|
|
4079
|
+
const num = Number(value);
|
|
4080
|
+
return Number.isFinite(num) ? num : null;
|
|
4081
|
+
}
|
|
4082
|
+
function resolveTokenSymbol(token, chainId) {
|
|
4083
|
+
if (!token) return "";
|
|
4084
|
+
if (chainId === "solana") {
|
|
4085
|
+
const normalized = token.toLowerCase();
|
|
4086
|
+
const matched = SOLANA_TOKENS.find(
|
|
4087
|
+
(entry) => entry.mint.toLowerCase() === normalized
|
|
4088
|
+
);
|
|
4089
|
+
if (matched) return matched.symbol;
|
|
4090
|
+
if (normalized === "native" || normalized === "11111111111111111111111111111111" || normalized === "so11111111111111111111111111111111111111112") {
|
|
4091
|
+
return "SOL";
|
|
4092
|
+
}
|
|
4093
|
+
}
|
|
4094
|
+
if (chainId !== null && chainId !== void 0 && chainId !== "solana" && /^0x[a-fA-F0-9]{40}$/.test(token)) {
|
|
4095
|
+
const sym = _chunkMUWVDVY4cjs.getTokenSymbol.call(void 0, token, chainId);
|
|
4096
|
+
if (sym !== "Token") return sym;
|
|
4097
|
+
}
|
|
4098
|
+
return shortenHash(token);
|
|
4099
|
+
}
|
|
4100
|
+
function formatAmount(rawAmount, token, chainId) {
|
|
4101
|
+
if (!rawAmount) return "";
|
|
4102
|
+
let decimals = 18;
|
|
4103
|
+
if (token && chainId !== null && chainId !== void 0) {
|
|
4104
|
+
if (chainId === "solana") {
|
|
4105
|
+
const normalized = token.toLowerCase();
|
|
4106
|
+
const matched = SOLANA_TOKENS.find(
|
|
4107
|
+
(entry) => entry.mint.toLowerCase() === normalized
|
|
4108
|
+
);
|
|
4109
|
+
if (matched) {
|
|
4110
|
+
decimals = matched.decimals;
|
|
4111
|
+
} else if (normalized === "native" || normalized === "11111111111111111111111111111111" || normalized === "so11111111111111111111111111111111111111112") {
|
|
4112
|
+
decimals = 9;
|
|
4113
|
+
}
|
|
4114
|
+
} else if (/^0x[a-fA-F0-9]{40}$/.test(token)) {
|
|
4115
|
+
decimals = _chunkMUWVDVY4cjs.getTokenDecimalsByAddress.call(void 0, token, chainId);
|
|
4116
|
+
}
|
|
4117
|
+
}
|
|
4118
|
+
try {
|
|
4119
|
+
const raw = BigInt(rawAmount);
|
|
4120
|
+
const divisor = 10n ** BigInt(decimals);
|
|
4121
|
+
const whole = raw / divisor;
|
|
4122
|
+
const remainder = raw % divisor;
|
|
4123
|
+
if (remainder === 0n) return whole.toString();
|
|
4124
|
+
const fracStr = remainder.toString().padStart(decimals, "0");
|
|
4125
|
+
const trimmed = fracStr.slice(0, 6).replace(/0+$/, "");
|
|
4126
|
+
if (!trimmed) return whole.toString();
|
|
4127
|
+
return `${whole}.${trimmed}`;
|
|
4128
|
+
} catch (e24) {
|
|
4129
|
+
return rawAmount;
|
|
4130
|
+
}
|
|
4131
|
+
}
|
|
4132
|
+
function getTxExplorerUrl(txHash, chainId) {
|
|
4133
|
+
if (!chainId) return null;
|
|
4134
|
+
const base = _chunkMUWVDVY4cjs.getExplorerUrl.call(void 0, chainId);
|
|
4135
|
+
if (!base) return null;
|
|
4136
|
+
return `${base}/tx/${txHash}`;
|
|
4137
|
+
}
|
|
4138
|
+
function normalizeStatus(raw) {
|
|
4139
|
+
const lower = raw.toLowerCase();
|
|
4140
|
+
if (lower === "completed" || lower === "complete" || lower === "bridge-complete" || lower === "processed") return "completed";
|
|
4141
|
+
if (lower === "failed" || lower === "error" || lower === "bridge-failed") return "failed";
|
|
4142
|
+
if (lower === "processing" || lower === "submitted" || lower === "bridging") return "processing";
|
|
4143
|
+
return "pending";
|
|
4144
|
+
}
|
|
4145
|
+
var STATUS_LABEL = {
|
|
4146
|
+
pending: "Pending",
|
|
4147
|
+
processing: "Processing",
|
|
4148
|
+
completed: "Completed",
|
|
4149
|
+
failed: "Failed"
|
|
4150
|
+
};
|
|
4151
|
+
function ExternalLinkIcon() {
|
|
4152
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: "rs-history-ext-icon", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 1.5H2.25A.75.75 0 0 0 1.5 2.25v7.5c0 .414.336.75.75.75h7.5a.75.75 0 0 0 .75-.75V7.5m-3-6h3m0 0v3m0-3L6 6" }) });
|
|
4153
|
+
}
|
|
4154
|
+
function DepositHistoryPanel({
|
|
4155
|
+
deposits,
|
|
4156
|
+
isLoading,
|
|
4157
|
+
error,
|
|
4158
|
+
hasMore,
|
|
4159
|
+
isLoadingMore,
|
|
4160
|
+
onLoadMore,
|
|
4161
|
+
onClose
|
|
4162
|
+
}) {
|
|
4163
|
+
const handleKeyDown = _react.useCallback.call(void 0,
|
|
4164
|
+
(e) => {
|
|
4165
|
+
if (e.key === "Escape") {
|
|
4166
|
+
e.stopPropagation();
|
|
4167
|
+
onClose();
|
|
4168
|
+
}
|
|
4169
|
+
},
|
|
4170
|
+
[onClose]
|
|
4171
|
+
);
|
|
4172
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4173
|
+
"div",
|
|
4174
|
+
{
|
|
4175
|
+
className: "rs-history-panel",
|
|
4176
|
+
role: "dialog",
|
|
4177
|
+
"aria-label": "Deposit history",
|
|
4178
|
+
onKeyDown: handleKeyDown,
|
|
4179
|
+
children: [
|
|
4180
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-header", children: [
|
|
4181
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4182
|
+
"button",
|
|
4183
|
+
{
|
|
4184
|
+
type: "button",
|
|
4185
|
+
className: "rs-history-back",
|
|
4186
|
+
"aria-label": "Close history",
|
|
4187
|
+
onClick: onClose,
|
|
4188
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 19.5L8.25 12l7.5-7.5" }) })
|
|
4189
|
+
}
|
|
4190
|
+
),
|
|
4191
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-header-title", children: "History" }),
|
|
4192
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-history-header-spacer" })
|
|
4193
|
+
] }),
|
|
4194
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-body", children: [
|
|
4195
|
+
isLoading && deposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-state", children: [
|
|
4196
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-history-spinner", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M12 2v4m0 12v4m-7.07-3.93l2.83-2.83m8.48-8.48l2.83-2.83M2 12h4m12 0h4M4.93 4.93l2.83 2.83m8.48 8.48l2.83 2.83", strokeLinecap: "round" }) }) }),
|
|
4197
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-state-text", children: "Loading history..." })
|
|
4198
|
+
] }),
|
|
4199
|
+
error && !isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-state", children: [
|
|
4200
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-history-state-icon rs-history-state-icon--error", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
4201
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "12", cy: "12", r: "10" }),
|
|
4202
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", d: "M12 8v4m0 4h.01" })
|
|
4203
|
+
] }) }),
|
|
4204
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-state-text", children: error })
|
|
4205
|
+
] }),
|
|
4206
|
+
!isLoading && !error && deposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-state", children: [
|
|
4207
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-history-state-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" }) }) }),
|
|
4208
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-state-text", children: "No deposits yet" }),
|
|
4209
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-state-hint", children: "Your deposit history will appear here" })
|
|
4210
|
+
] }),
|
|
4211
|
+
deposits.length > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-list", children: [
|
|
4212
|
+
deposits.map((deposit, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HistoryRow, { deposit }, deposit.txHash || i)),
|
|
4213
|
+
hasMore && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4214
|
+
"button",
|
|
4215
|
+
{
|
|
4216
|
+
type: "button",
|
|
4217
|
+
className: "rs-history-load-more",
|
|
4218
|
+
onClick: onLoadMore,
|
|
4219
|
+
disabled: isLoadingMore,
|
|
4220
|
+
children: isLoadingMore ? "Loading..." : "Load more"
|
|
4221
|
+
}
|
|
4222
|
+
)
|
|
4223
|
+
] })
|
|
4224
|
+
] })
|
|
4225
|
+
]
|
|
4226
|
+
}
|
|
4227
|
+
);
|
|
4228
|
+
}
|
|
4229
|
+
function HistoryRow({ deposit }) {
|
|
4230
|
+
const status = normalizeStatus(deposit.status);
|
|
4231
|
+
const sourceChainId = resolveChainId(deposit.chain);
|
|
4232
|
+
const targetChainId = resolveChainId(deposit.targetChain);
|
|
4233
|
+
const sourceChainName = sourceChainId ? _chunkMUWVDVY4cjs.getChainName.call(void 0, sourceChainId) : null;
|
|
4234
|
+
const targetChainName = targetChainId ? _chunkMUWVDVY4cjs.getChainName.call(void 0, targetChainId) : null;
|
|
4235
|
+
const sourceChainIcon = sourceChainId ? _chunkMUWVDVY4cjs.getChainIcon.call(void 0, sourceChainId) : void 0;
|
|
4236
|
+
const targetChainIcon = targetChainId ? _chunkMUWVDVY4cjs.getChainIcon.call(void 0, targetChainId) : void 0;
|
|
4237
|
+
const sourceSymbol = resolveTokenSymbol(deposit.token, sourceChainId);
|
|
4238
|
+
const targetSymbol = resolveTokenSymbol(deposit.targetToken, targetChainId);
|
|
4239
|
+
const rawAmount = _nullishCoalesce(deposit.sourceAmount, () => ( deposit.amount));
|
|
4240
|
+
const formattedAmount = rawAmount ? formatAmount(rawAmount, deposit.token, sourceChainId) : null;
|
|
4241
|
+
const timestamp = deposit.createdAt ? formatTimestamp2(deposit.createdAt) : null;
|
|
4242
|
+
const srcTxUrl = deposit.sourceTxHash ? getTxExplorerUrl(deposit.sourceTxHash, sourceChainId) : null;
|
|
4243
|
+
const dstTxUrl = deposit.destinationTxHash ? getTxExplorerUrl(deposit.destinationTxHash, targetChainId) : null;
|
|
4244
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-row", children: [
|
|
4245
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-row-primary", children: [
|
|
4246
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-route", children: [
|
|
4247
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-history-chain", children: [
|
|
4248
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: sourceChainIcon, alt: "", className: "rs-history-chain-icon" }),
|
|
4249
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-chain-name", children: _nullishCoalesce(sourceChainName, () => ( "Unknown")) })
|
|
4250
|
+
] }),
|
|
4251
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: "rs-history-route-arrow", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M2.5 6h7m0 0L7 3.5M9.5 6 7 8.5" }) }),
|
|
4252
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-history-chain", children: [
|
|
4253
|
+
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: targetChainIcon, alt: "", className: "rs-history-chain-icon" }),
|
|
4254
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-chain-name", children: _nullishCoalesce(targetChainName, () => ( "Unknown")) })
|
|
4255
|
+
] })
|
|
4256
|
+
] }),
|
|
4257
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: `rs-history-status rs-history-status--${status}`, children: [
|
|
4258
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `rs-history-dot rs-history-dot--${status}` }),
|
|
4259
|
+
STATUS_LABEL[status]
|
|
4260
|
+
] })
|
|
4261
|
+
] }),
|
|
4262
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-row-secondary", children: [
|
|
4263
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-amount", children: formattedAmount ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
4264
|
+
formattedAmount,
|
|
4265
|
+
" ",
|
|
4266
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-token", children: sourceSymbol }),
|
|
4267
|
+
targetSymbol && sourceSymbol !== targetSymbol && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-history-token-target", children: [
|
|
4268
|
+
" \u2192 ",
|
|
4269
|
+
targetSymbol
|
|
4270
|
+
] })
|
|
4271
|
+
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-no-amount", children: "\u2014" }) }),
|
|
4272
|
+
timestamp && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-time", children: timestamp })
|
|
4273
|
+
] }),
|
|
4274
|
+
(srcTxUrl || dstTxUrl) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-row-links", children: [
|
|
4275
|
+
srcTxUrl && deposit.sourceTxHash && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4276
|
+
"a",
|
|
4277
|
+
{
|
|
4278
|
+
href: srcTxUrl,
|
|
4279
|
+
target: "_blank",
|
|
4280
|
+
rel: "noopener noreferrer",
|
|
4281
|
+
className: "rs-history-tx-link",
|
|
4282
|
+
title: deposit.sourceTxHash,
|
|
4283
|
+
children: [
|
|
4284
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-tx-hash", children: shortenHash(deposit.sourceTxHash) }),
|
|
4285
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExternalLinkIcon, {})
|
|
4286
|
+
]
|
|
4287
|
+
}
|
|
4288
|
+
),
|
|
4289
|
+
dstTxUrl && deposit.destinationTxHash && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4290
|
+
"a",
|
|
4291
|
+
{
|
|
4292
|
+
href: dstTxUrl,
|
|
4293
|
+
target: "_blank",
|
|
4294
|
+
rel: "noopener noreferrer",
|
|
4295
|
+
className: "rs-history-tx-link",
|
|
4296
|
+
title: deposit.destinationTxHash,
|
|
4297
|
+
children: [
|
|
4298
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-tx-hash", children: shortenHash(deposit.destinationTxHash) }),
|
|
4299
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExternalLinkIcon, {})
|
|
4300
|
+
]
|
|
4301
|
+
}
|
|
4302
|
+
)
|
|
4303
|
+
] })
|
|
4304
|
+
] });
|
|
4305
|
+
}
|
|
4306
|
+
DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
4307
|
+
|
|
3667
4308
|
// src/DepositModal.tsx
|
|
3668
4309
|
|
|
3669
4310
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
3670
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
4311
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-UPYZN2XA.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
3671
4312
|
);
|
|
3672
4313
|
function DepositModal(props) {
|
|
3673
4314
|
const needsReown = !!props.reownAppId;
|
|
@@ -3708,14 +4349,16 @@ function DepositModalInner({
|
|
|
3708
4349
|
sourceToken,
|
|
3709
4350
|
defaultAmount,
|
|
3710
4351
|
recipient,
|
|
3711
|
-
backendUrl =
|
|
4352
|
+
backendUrl = _chunkMUWVDVY4cjs.DEFAULT_BACKEND_URL,
|
|
3712
4353
|
solanaRpcUrl,
|
|
3713
|
-
signerAddress =
|
|
4354
|
+
signerAddress = _chunkMUWVDVY4cjs.DEFAULT_SIGNER_ADDRESS,
|
|
3714
4355
|
sessionChainIds,
|
|
3715
4356
|
forceRegister = false,
|
|
3716
4357
|
waitForFinalTx = true,
|
|
3717
4358
|
enableSolana = true,
|
|
3718
4359
|
postBridgeActions,
|
|
4360
|
+
outputTokenRules,
|
|
4361
|
+
rejectUnmapped,
|
|
3719
4362
|
reownWallet,
|
|
3720
4363
|
onConnect,
|
|
3721
4364
|
onDisconnect,
|
|
@@ -3736,14 +4379,24 @@ function DepositModalInner({
|
|
|
3736
4379
|
debug
|
|
3737
4380
|
}) {
|
|
3738
4381
|
const modalRef = _react.useRef.call(void 0, null);
|
|
3739
|
-
const onReadyRef =
|
|
4382
|
+
const onReadyRef = _chunkFLVSQDP4cjs.useLatestRef.call(void 0, onReady);
|
|
3740
4383
|
const [currentStepIndex, setCurrentStepIndex] = _react.useState.call(void 0, 0);
|
|
3741
4384
|
const [totalBalanceUsd, setTotalBalanceUsd] = _react.useState.call(void 0, null);
|
|
3742
4385
|
const backHandlerRef = _react.useRef.call(void 0, void 0);
|
|
3743
|
-
const
|
|
3744
|
-
const
|
|
4386
|
+
const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _160 => _160.showHistoryButton]), () => ( false));
|
|
4387
|
+
const [activeSmartAccount, setActiveSmartAccount] = _react.useState.call(void 0, null);
|
|
4388
|
+
const [historyOpen, setHistoryOpen] = _react.useState.call(void 0, false);
|
|
4389
|
+
const [historyDeposits, setHistoryDeposits] = _react.useState.call(void 0, []);
|
|
4390
|
+
const [historyNextCursor, setHistoryNextCursor] = _react.useState.call(void 0, null);
|
|
4391
|
+
const [historyLoading, setHistoryLoading] = _react.useState.call(void 0, false);
|
|
4392
|
+
const [historyLoadingMore, setHistoryLoadingMore] = _react.useState.call(void 0, false);
|
|
4393
|
+
const [historyError, setHistoryError] = _react.useState.call(void 0, null);
|
|
4394
|
+
const historyStaleRef = _react.useRef.call(void 0, false);
|
|
4395
|
+
const historyLoadedRef = _react.useRef.call(void 0, false);
|
|
4396
|
+
const targetChain = _chunkMUWVDVY4cjs.getChainId.call(void 0, targetChainProp);
|
|
4397
|
+
const sourceChain = sourceChainProp ? _chunkMUWVDVY4cjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
3745
4398
|
const service = _react.useMemo.call(void 0,
|
|
3746
|
-
() =>
|
|
4399
|
+
() => _chunkFLVSQDP4cjs.createDepositService.call(void 0, backendUrl, {
|
|
3747
4400
|
debug,
|
|
3748
4401
|
debugScope: "service:deposit"
|
|
3749
4402
|
}),
|
|
@@ -3751,17 +4404,15 @@ function DepositModalInner({
|
|
|
3751
4404
|
);
|
|
3752
4405
|
_react.useEffect.call(void 0, () => {
|
|
3753
4406
|
if (isOpen && modalRef.current) {
|
|
3754
|
-
|
|
4407
|
+
_chunkFLVSQDP4cjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
3755
4408
|
}
|
|
3756
4409
|
}, [isOpen, theme]);
|
|
3757
4410
|
_react.useEffect.call(void 0, () => {
|
|
3758
4411
|
configureSolanaRpcUrl(solanaRpcUrl);
|
|
3759
4412
|
}, [solanaRpcUrl]);
|
|
3760
|
-
const hasCalledReady = _react.useRef.call(void 0, false);
|
|
3761
4413
|
_react.useEffect.call(void 0, () => {
|
|
3762
|
-
if (isOpen
|
|
3763
|
-
|
|
3764
|
-
_optionalChain([onReadyRef, 'access', _124 => _124.current, 'optionalCall', _125 => _125()]);
|
|
4414
|
+
if (isOpen) {
|
|
4415
|
+
_optionalChain([onReadyRef, 'access', _161 => _161.current, 'optionalCall', _162 => _162()]);
|
|
3765
4416
|
}
|
|
3766
4417
|
}, [isOpen, onReadyRef]);
|
|
3767
4418
|
_react.useEffect.call(void 0, () => {
|
|
@@ -3780,17 +4431,119 @@ function DepositModalInner({
|
|
|
3780
4431
|
setTotalBalanceUsd(balance2);
|
|
3781
4432
|
}, []);
|
|
3782
4433
|
const handleBack = _react.useCallback.call(void 0, () => {
|
|
3783
|
-
_optionalChain([backHandlerRef, 'access',
|
|
4434
|
+
_optionalChain([backHandlerRef, 'access', _163 => _163.current, 'optionalCall', _164 => _164()]);
|
|
4435
|
+
}, []);
|
|
4436
|
+
const handleSmartAccountChange = _react.useCallback.call(void 0,
|
|
4437
|
+
(account) => {
|
|
4438
|
+
setActiveSmartAccount(account);
|
|
4439
|
+
if (!account) {
|
|
4440
|
+
historyStaleRef.current = true;
|
|
4441
|
+
}
|
|
4442
|
+
},
|
|
4443
|
+
[]
|
|
4444
|
+
);
|
|
4445
|
+
const fetchHistory = _react.useCallback.call(void 0,
|
|
4446
|
+
async (cursor) => {
|
|
4447
|
+
if (!activeSmartAccount) return;
|
|
4448
|
+
const isInitial = !cursor;
|
|
4449
|
+
if (isInitial) {
|
|
4450
|
+
setHistoryLoading(true);
|
|
4451
|
+
} else {
|
|
4452
|
+
setHistoryLoadingMore(true);
|
|
4453
|
+
}
|
|
4454
|
+
setHistoryError(null);
|
|
4455
|
+
try {
|
|
4456
|
+
const result = await service.fetchDepositHistory({
|
|
4457
|
+
account: activeSmartAccount,
|
|
4458
|
+
limit: 20,
|
|
4459
|
+
cursor
|
|
4460
|
+
});
|
|
4461
|
+
if (isInitial) {
|
|
4462
|
+
setHistoryDeposits(result.deposits);
|
|
4463
|
+
} else {
|
|
4464
|
+
setHistoryDeposits((prev) => [...prev, ...result.deposits]);
|
|
4465
|
+
}
|
|
4466
|
+
setHistoryNextCursor(_nullishCoalesce(result.nextCursor, () => ( null)));
|
|
4467
|
+
historyStaleRef.current = false;
|
|
4468
|
+
historyLoadedRef.current = true;
|
|
4469
|
+
} catch (err) {
|
|
4470
|
+
setHistoryError(
|
|
4471
|
+
err instanceof Error ? err.message : "Failed to load history"
|
|
4472
|
+
);
|
|
4473
|
+
} finally {
|
|
4474
|
+
if (isInitial) {
|
|
4475
|
+
setHistoryLoading(false);
|
|
4476
|
+
} else {
|
|
4477
|
+
setHistoryLoadingMore(false);
|
|
4478
|
+
}
|
|
4479
|
+
}
|
|
4480
|
+
},
|
|
4481
|
+
[activeSmartAccount, service]
|
|
4482
|
+
);
|
|
4483
|
+
const handleHistoryOpen = _react.useCallback.call(void 0, () => {
|
|
4484
|
+
setHistoryOpen(true);
|
|
4485
|
+
if (!historyLoadedRef.current || historyStaleRef.current) {
|
|
4486
|
+
fetchHistory();
|
|
4487
|
+
}
|
|
4488
|
+
}, [fetchHistory]);
|
|
4489
|
+
const handleHistoryClose = _react.useCallback.call(void 0, () => {
|
|
4490
|
+
setHistoryOpen(false);
|
|
3784
4491
|
}, []);
|
|
3785
|
-
const
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
const
|
|
4492
|
+
const handleHistoryLoadMore = _react.useCallback.call(void 0, () => {
|
|
4493
|
+
if (historyNextCursor) {
|
|
4494
|
+
fetchHistory(historyNextCursor);
|
|
4495
|
+
}
|
|
4496
|
+
}, [fetchHistory, historyNextCursor]);
|
|
4497
|
+
const markHistoryStale = _react.useCallback.call(void 0, () => {
|
|
4498
|
+
historyStaleRef.current = true;
|
|
4499
|
+
if (historyOpen) {
|
|
4500
|
+
fetchHistory();
|
|
4501
|
+
}
|
|
4502
|
+
}, [historyOpen, fetchHistory]);
|
|
4503
|
+
const onDepositSubmittedRef = _chunkFLVSQDP4cjs.useLatestRef.call(void 0, onDepositSubmitted);
|
|
4504
|
+
const onDepositCompleteRef = _chunkFLVSQDP4cjs.useLatestRef.call(void 0, onDepositComplete);
|
|
4505
|
+
const onDepositFailedRef = _chunkFLVSQDP4cjs.useLatestRef.call(void 0, onDepositFailed);
|
|
4506
|
+
const handleDepositSubmitted = _react.useCallback.call(void 0,
|
|
4507
|
+
(data) => {
|
|
4508
|
+
_optionalChain([onDepositSubmittedRef, 'access', _165 => _165.current, 'optionalCall', _166 => _166(data)]);
|
|
4509
|
+
if (showHistoryButton) markHistoryStale();
|
|
4510
|
+
},
|
|
4511
|
+
[onDepositSubmittedRef, showHistoryButton, markHistoryStale]
|
|
4512
|
+
);
|
|
4513
|
+
const handleDepositComplete = _react.useCallback.call(void 0,
|
|
4514
|
+
(data) => {
|
|
4515
|
+
_optionalChain([onDepositCompleteRef, 'access', _167 => _167.current, 'optionalCall', _168 => _168(data)]);
|
|
4516
|
+
if (showHistoryButton) markHistoryStale();
|
|
4517
|
+
},
|
|
4518
|
+
[onDepositCompleteRef, showHistoryButton, markHistoryStale]
|
|
4519
|
+
);
|
|
4520
|
+
const handleDepositFailed = _react.useCallback.call(void 0,
|
|
4521
|
+
(data) => {
|
|
4522
|
+
_optionalChain([onDepositFailedRef, 'access', _169 => _169.current, 'optionalCall', _170 => _170(data)]);
|
|
4523
|
+
if (showHistoryButton) markHistoryStale();
|
|
4524
|
+
},
|
|
4525
|
+
[onDepositFailedRef, showHistoryButton, markHistoryStale]
|
|
4526
|
+
);
|
|
4527
|
+
_react.useEffect.call(void 0, () => {
|
|
4528
|
+
if (!isOpen) {
|
|
4529
|
+
setHistoryOpen(false);
|
|
4530
|
+
setHistoryDeposits([]);
|
|
4531
|
+
setHistoryNextCursor(null);
|
|
4532
|
+
setHistoryError(null);
|
|
4533
|
+
setActiveSmartAccount(null);
|
|
4534
|
+
historyStaleRef.current = false;
|
|
4535
|
+
historyLoadedRef.current = false;
|
|
4536
|
+
}
|
|
4537
|
+
}, [isOpen]);
|
|
4538
|
+
const showLogo = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _171 => _171.showLogo]), () => ( false));
|
|
4539
|
+
const showStepper = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _172 => _172.showStepper]), () => ( false));
|
|
4540
|
+
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _173 => _173.showBackButton]), () => ( true));
|
|
4541
|
+
const balance = _optionalChain([uiConfig, 'optionalAccess', _174 => _174.balance]);
|
|
4542
|
+
const logoUrl = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _175 => _175.logoUrl]), () => ( "https://github.com/rhinestonewtf.png"));
|
|
4543
|
+
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _176 => _176.title]), () => ( "Deposit"));
|
|
3791
4544
|
const canGoBack = currentStepIndex > 0 && currentStepIndex < 4 && backHandlerRef.current !== void 0;
|
|
3792
4545
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3793
|
-
|
|
4546
|
+
_chunkFLVSQDP4cjs.Modal,
|
|
3794
4547
|
{
|
|
3795
4548
|
isOpen,
|
|
3796
4549
|
onClose,
|
|
@@ -3883,35 +4636,64 @@ function DepositModalInner({
|
|
|
3883
4636
|
balance.title,
|
|
3884
4637
|
":"
|
|
3885
4638
|
] }),
|
|
3886
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ?
|
|
4639
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ? _chunkFLVSQDP4cjs.currencyFormatter.format(totalBalanceUsd) : null))) })
|
|
3887
4640
|
] })
|
|
3888
4641
|
] }),
|
|
3889
|
-
/* @__PURE__ */ _jsxruntime.
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
"
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
4642
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
|
|
4643
|
+
showHistoryButton && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4644
|
+
"button",
|
|
4645
|
+
{
|
|
4646
|
+
type: "button",
|
|
4647
|
+
className: "rs-modal-header-history",
|
|
4648
|
+
"aria-label": "Deposit history",
|
|
4649
|
+
onClick: handleHistoryOpen,
|
|
4650
|
+
disabled: !activeSmartAccount,
|
|
4651
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4652
|
+
"svg",
|
|
4653
|
+
{
|
|
4654
|
+
viewBox: "0 0 24 24",
|
|
4655
|
+
fill: "none",
|
|
4656
|
+
stroke: "currentColor",
|
|
4657
|
+
strokeWidth: "1.75",
|
|
4658
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4659
|
+
"path",
|
|
4660
|
+
{
|
|
4661
|
+
strokeLinecap: "round",
|
|
4662
|
+
strokeLinejoin: "round",
|
|
4663
|
+
d: "M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"
|
|
4664
|
+
}
|
|
4665
|
+
)
|
|
4666
|
+
}
|
|
4667
|
+
)
|
|
4668
|
+
}
|
|
4669
|
+
),
|
|
4670
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4671
|
+
"button",
|
|
4672
|
+
{
|
|
4673
|
+
type: "button",
|
|
4674
|
+
onClick: onClose,
|
|
4675
|
+
className: "rs-modal-close",
|
|
4676
|
+
"aria-label": "Close",
|
|
4677
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4678
|
+
"svg",
|
|
4679
|
+
{
|
|
4680
|
+
viewBox: "0 0 24 24",
|
|
4681
|
+
fill: "none",
|
|
4682
|
+
stroke: "currentColor",
|
|
4683
|
+
strokeWidth: "2",
|
|
4684
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4685
|
+
"path",
|
|
4686
|
+
{
|
|
4687
|
+
strokeLinecap: "round",
|
|
4688
|
+
strokeLinejoin: "round",
|
|
4689
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
4690
|
+
}
|
|
4691
|
+
)
|
|
4692
|
+
}
|
|
4693
|
+
)
|
|
4694
|
+
}
|
|
4695
|
+
)
|
|
4696
|
+
] })
|
|
3915
4697
|
] }),
|
|
3916
4698
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3917
4699
|
DepositFlow,
|
|
@@ -3928,6 +4710,8 @@ function DepositModalInner({
|
|
|
3928
4710
|
amount: defaultAmount,
|
|
3929
4711
|
recipient,
|
|
3930
4712
|
postBridgeActions,
|
|
4713
|
+
outputTokenRules,
|
|
4714
|
+
rejectUnmapped,
|
|
3931
4715
|
signerAddress,
|
|
3932
4716
|
sessionChainIds,
|
|
3933
4717
|
forceRegister,
|
|
@@ -3942,15 +4726,28 @@ function DepositModalInner({
|
|
|
3942
4726
|
allowedRoutes,
|
|
3943
4727
|
onStepChange: handleStepChange,
|
|
3944
4728
|
onTotalBalanceChange: handleTotalBalanceChange,
|
|
4729
|
+
onSmartAccountChange: showHistoryButton ? handleSmartAccountChange : void 0,
|
|
3945
4730
|
onClose,
|
|
3946
4731
|
onConnected,
|
|
3947
|
-
onDepositSubmitted,
|
|
3948
|
-
onDepositComplete,
|
|
3949
|
-
onDepositFailed,
|
|
4732
|
+
onDepositSubmitted: showHistoryButton ? handleDepositSubmitted : onDepositSubmitted,
|
|
4733
|
+
onDepositComplete: showHistoryButton ? handleDepositComplete : onDepositComplete,
|
|
4734
|
+
onDepositFailed: showHistoryButton ? handleDepositFailed : onDepositFailed,
|
|
3950
4735
|
onEvent,
|
|
3951
4736
|
onError,
|
|
3952
4737
|
debug
|
|
3953
4738
|
}
|
|
4739
|
+
),
|
|
4740
|
+
showHistoryButton && historyOpen && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4741
|
+
DepositHistoryPanel,
|
|
4742
|
+
{
|
|
4743
|
+
deposits: historyDeposits,
|
|
4744
|
+
isLoading: historyLoading,
|
|
4745
|
+
error: historyError,
|
|
4746
|
+
hasMore: Boolean(historyNextCursor),
|
|
4747
|
+
isLoadingMore: historyLoadingMore,
|
|
4748
|
+
onLoadMore: handleHistoryLoadMore,
|
|
4749
|
+
onClose: handleHistoryClose
|
|
4750
|
+
}
|
|
3954
4751
|
)
|
|
3955
4752
|
] })
|
|
3956
4753
|
}
|