@rhinestone/deposit-modal 0.1.47 → 0.1.48
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-DKLN3IE3.mjs → DepositModalReown-3V2EFXH5.mjs} +2 -2
- package/dist/{DepositModalReown-IUZNTZ3Y.cjs → DepositModalReown-SV6QIUTL.cjs} +3 -3
- package/dist/{WithdrawModalReown-XOFREB4D.mjs → WithdrawModalReown-FODH7PY5.mjs} +2 -2
- package/dist/{WithdrawModalReown-FGUHFUVN.cjs → WithdrawModalReown-ZSR3RP44.cjs} +3 -3
- package/dist/{chunk-LT3QKJI2.cjs → chunk-7HJ7IBRH.cjs} +43 -27
- package/dist/{chunk-QIK6ONMQ.mjs → chunk-FKNYONM2.mjs} +43 -27
- package/dist/{chunk-O3VFAUSL.mjs → chunk-HCZNF6CR.mjs} +2 -2
- package/dist/{chunk-MS2J6M5C.cjs → chunk-PW55TOFK.cjs} +33 -33
- package/dist/{chunk-7U5TNZZB.mjs → chunk-ZAQISJAP.mjs} +21 -4
- package/dist/{chunk-LOOU3NCI.cjs → chunk-ZK6VAHSB.cjs} +166 -149
- package/dist/deposit.cjs +3 -3
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +3 -3
- package/dist/reown.cjs +4 -4
- package/dist/reown.d.cts +1 -1
- package/dist/reown.d.ts +1 -1
- package/dist/reown.mjs +3 -3
- package/dist/{types-DQG7NEBI.d.ts → types-B0FLVdXb.d.ts} +6 -1
- package/dist/{types-CyUiKQ4H.d.cts → types-dY70pF2y.d.cts} +6 -1
- package/dist/withdraw.cjs +3 -3
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +2 -2
- package/package.json +1 -1
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _chunk7HJ7IBRHcjs = require('./chunk-7HJ7IBRH.cjs');
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
@@ -62,15 +62,15 @@ var _viem = require('viem');
|
|
|
62
62
|
|
|
63
63
|
var _jsxruntime = require('react/jsx-runtime');
|
|
64
64
|
async function resolveSessionOwner(eoaAddress) {
|
|
65
|
-
const localOwner =
|
|
65
|
+
const localOwner = _chunk7HJ7IBRHcjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
66
66
|
if (localOwner) {
|
|
67
67
|
return {
|
|
68
|
-
account:
|
|
68
|
+
account: _chunk7HJ7IBRHcjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
69
69
|
address: localOwner.address
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
|
-
const created =
|
|
73
|
-
|
|
72
|
+
const created = _chunk7HJ7IBRHcjs.createSessionOwnerKey.call(void 0, );
|
|
73
|
+
_chunk7HJ7IBRHcjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
74
74
|
return {
|
|
75
75
|
account: created.account,
|
|
76
76
|
address: created.address
|
|
@@ -105,7 +105,7 @@ function SetupStep({
|
|
|
105
105
|
const setup = await service.setupAccount({
|
|
106
106
|
ownerAddress: address,
|
|
107
107
|
sessionOwnerAddress: sessionOwner.address,
|
|
108
|
-
targetChain:
|
|
108
|
+
targetChain: _chunk7HJ7IBRHcjs.toEvmCaip2.call(void 0, targetChain),
|
|
109
109
|
targetToken,
|
|
110
110
|
signerAddress,
|
|
111
111
|
sessionChainIds,
|
|
@@ -132,7 +132,7 @@ function SetupStep({
|
|
|
132
132
|
primaryType: typedData.primaryType,
|
|
133
133
|
message: typedData.message
|
|
134
134
|
});
|
|
135
|
-
const sessionDetails =
|
|
135
|
+
const sessionDetails = _chunk7HJ7IBRHcjs.buildSessionDetails.call(void 0, setup.sessionDetailsUnsigned, signature);
|
|
136
136
|
setState({ type: "registering" });
|
|
137
137
|
const registerResult = await service.registerAccount({
|
|
138
138
|
address: smartAccount,
|
|
@@ -144,7 +144,7 @@ function SetupStep({
|
|
|
144
144
|
eoaAddress: address,
|
|
145
145
|
sessionOwner: sessionOwner.address,
|
|
146
146
|
target: {
|
|
147
|
-
chain:
|
|
147
|
+
chain: _chunk7HJ7IBRHcjs.toEvmCaip2.call(void 0, targetChain),
|
|
148
148
|
token: targetToken,
|
|
149
149
|
...recipient && { recipient }
|
|
150
150
|
}
|
|
@@ -203,7 +203,7 @@ function SetupStep({
|
|
|
203
203
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
204
204
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", children: [
|
|
205
205
|
isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
206
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
206
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7HJ7IBRHcjs.Spinner, { className: "rs-spinner--lg rs-text-accent" }),
|
|
207
207
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-text", children: [
|
|
208
208
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-title", children: renderStateMessage() }),
|
|
209
209
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-subtitle", children: "This may take a moment" })
|
|
@@ -240,7 +240,7 @@ function SetupStep({
|
|
|
240
240
|
] })
|
|
241
241
|
] })
|
|
242
242
|
] }),
|
|
243
|
-
isError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
243
|
+
isError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7HJ7IBRHcjs.Button, { onClick: handleRetry, variant: "default", fullWidth: true, children: "Try Again" }) })
|
|
244
244
|
] });
|
|
245
245
|
}
|
|
246
246
|
|
|
@@ -253,6 +253,7 @@ function AssetSelectStep({
|
|
|
253
253
|
publicClient,
|
|
254
254
|
defaultSourceChain,
|
|
255
255
|
defaultSourceToken,
|
|
256
|
+
allowedRoutes,
|
|
256
257
|
service,
|
|
257
258
|
onContinue,
|
|
258
259
|
onTotalBalanceComputed,
|
|
@@ -264,7 +265,7 @@ function AssetSelectStep({
|
|
|
264
265
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
265
266
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
266
267
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
267
|
-
return
|
|
268
|
+
return _chunk7HJ7IBRHcjs.getAssetId.call(void 0, {
|
|
268
269
|
chainId: defaultSourceChain,
|
|
269
270
|
token: defaultSourceToken
|
|
270
271
|
});
|
|
@@ -281,7 +282,7 @@ function AssetSelectStep({
|
|
|
281
282
|
try {
|
|
282
283
|
const portfolio = await service.fetchPortfolio(address);
|
|
283
284
|
if (!active) return;
|
|
284
|
-
const portfolioAssets =
|
|
285
|
+
const portfolioAssets = _chunk7HJ7IBRHcjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
285
286
|
setAssets(portfolioAssets);
|
|
286
287
|
const hasNative = portfolioAssets.some(
|
|
287
288
|
(asset) => asset.token.toLowerCase() === _chunkNELAYNA3cjs.NATIVE_TOKEN_ADDRESS
|
|
@@ -325,13 +326,25 @@ function AssetSelectStep({
|
|
|
325
326
|
_optionalChain([onTotalBalanceComputed, 'optionalCall', _4 => _4(total)]);
|
|
326
327
|
if (assets.length > 0) _optionalChain([onAssetsLoaded, 'optionalCall', _5 => _5(assets)]);
|
|
327
328
|
}, [assets, onTotalBalanceComputed, onAssetsLoaded]);
|
|
329
|
+
const allowedChainSet = _react.useMemo.call(void 0,
|
|
330
|
+
() => _optionalChain([allowedRoutes, 'optionalAccess', _6 => _6.sourceChains]) ? new Set(allowedRoutes.sourceChains) : null,
|
|
331
|
+
[_optionalChain([allowedRoutes, 'optionalAccess', _7 => _7.sourceChains])]
|
|
332
|
+
);
|
|
333
|
+
const allowedTokenSet = _react.useMemo.call(void 0,
|
|
334
|
+
() => _optionalChain([allowedRoutes, 'optionalAccess', _8 => _8.sourceTokens]) ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null,
|
|
335
|
+
[_optionalChain([allowedRoutes, 'optionalAccess', _9 => _9.sourceTokens])]
|
|
336
|
+
);
|
|
328
337
|
const rows = _react.useMemo.call(void 0, () => {
|
|
329
338
|
return assets.filter((a) => {
|
|
330
339
|
try {
|
|
331
|
-
|
|
340
|
+
if (BigInt(_nullishCoalesce(a.balance, () => ( "0"))) <= BigInt(0)) return false;
|
|
332
341
|
} catch (e2) {
|
|
333
342
|
return false;
|
|
334
343
|
}
|
|
344
|
+
if (allowedChainSet && !allowedChainSet.has(a.chainId)) return false;
|
|
345
|
+
if (allowedTokenSet && !allowedTokenSet.has(a.symbol.toUpperCase()))
|
|
346
|
+
return false;
|
|
347
|
+
return true;
|
|
335
348
|
}).sort((a, b) => {
|
|
336
349
|
const usdA = _nullishCoalesce(a.balanceUsd, () => ( 0));
|
|
337
350
|
const usdB = _nullishCoalesce(b.balanceUsd, () => ( 0));
|
|
@@ -342,7 +355,7 @@ function AssetSelectStep({
|
|
|
342
355
|
if (balB < balA) return -1;
|
|
343
356
|
return 0;
|
|
344
357
|
});
|
|
345
|
-
}, [assets]);
|
|
358
|
+
}, [assets, allowedChainSet, allowedTokenSet]);
|
|
346
359
|
const selectedAsset = selectedAssetId && assets.find((asset) => asset.id === selectedAssetId);
|
|
347
360
|
const formatBalance = (asset) => {
|
|
348
361
|
if (!asset.balance) return "--";
|
|
@@ -350,7 +363,7 @@ function AssetSelectStep({
|
|
|
350
363
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
351
364
|
const numeric = Number(raw);
|
|
352
365
|
if (!Number.isFinite(numeric)) return raw;
|
|
353
|
-
return
|
|
366
|
+
return _chunk7HJ7IBRHcjs.tokenFormatter.format(numeric);
|
|
354
367
|
} catch (e3) {
|
|
355
368
|
return asset.balance;
|
|
356
369
|
}
|
|
@@ -364,7 +377,7 @@ function AssetSelectStep({
|
|
|
364
377
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
365
378
|
children: [
|
|
366
379
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
367
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
380
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7HJ7IBRHcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
368
381
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
369
382
|
] }),
|
|
370
383
|
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 }) }),
|
|
@@ -454,7 +467,7 @@ function AssetSelectStep({
|
|
|
454
467
|
] })
|
|
455
468
|
] })
|
|
456
469
|
] }),
|
|
457
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ?
|
|
470
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunk7HJ7IBRHcjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
458
471
|
]
|
|
459
472
|
},
|
|
460
473
|
asset.id
|
|
@@ -464,7 +477,7 @@ function AssetSelectStep({
|
|
|
464
477
|
}
|
|
465
478
|
),
|
|
466
479
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
467
|
-
|
|
480
|
+
_chunk7HJ7IBRHcjs.Button,
|
|
468
481
|
{
|
|
469
482
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
470
483
|
disabled: !selectedAsset,
|
|
@@ -472,15 +485,15 @@ function AssetSelectStep({
|
|
|
472
485
|
children: "Continue"
|
|
473
486
|
}
|
|
474
487
|
) }),
|
|
475
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
488
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7HJ7IBRHcjs.PoweredBy, {})
|
|
476
489
|
] });
|
|
477
490
|
}
|
|
478
491
|
async function fetchNativeAssets(address, publicClient, existing) {
|
|
479
492
|
const existingIds = new Set(existing.map((asset) => asset.id));
|
|
480
|
-
const connectedChainId = _optionalChain([publicClient, 'access',
|
|
493
|
+
const connectedChainId = _optionalChain([publicClient, 'access', _10 => _10.chain, 'optionalAccess', _11 => _11.id]);
|
|
481
494
|
if (!connectedChainId) return [];
|
|
482
495
|
if (!_chunkNELAYNA3cjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
|
|
483
|
-
const id =
|
|
496
|
+
const id = _chunk7HJ7IBRHcjs.getAssetId.call(void 0, {
|
|
484
497
|
chainId: connectedChainId,
|
|
485
498
|
token: _chunkNELAYNA3cjs.NATIVE_TOKEN_ADDRESS
|
|
486
499
|
});
|
|
@@ -539,7 +552,7 @@ function AmountStep({
|
|
|
539
552
|
const [isSwitching, setIsSwitching] = _react.useState.call(void 0, false);
|
|
540
553
|
const hasAttemptedSwitch = _react.useRef.call(void 0, false);
|
|
541
554
|
const chainMismatch = Boolean(
|
|
542
|
-
_optionalChain([walletClient, 'optionalAccess',
|
|
555
|
+
_optionalChain([walletClient, 'optionalAccess', _12 => _12.chain, 'optionalAccess', _13 => _13.id]) && walletClient.chain.id !== asset.chainId
|
|
543
556
|
);
|
|
544
557
|
const targetSymbol = _chunkNELAYNA3cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
545
558
|
const isSourceStablecoin = _chunkNELAYNA3cjs.isStablecoinSymbol.call(void 0, asset.symbol);
|
|
@@ -566,7 +579,7 @@ function AmountStep({
|
|
|
566
579
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
567
580
|
if (!balanceTarget || !publicClient) return;
|
|
568
581
|
try {
|
|
569
|
-
const bal =
|
|
582
|
+
const bal = _chunk7HJ7IBRHcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
570
583
|
address: asset.token,
|
|
571
584
|
abi: _viem.erc20Abi,
|
|
572
585
|
functionName: "balanceOf",
|
|
@@ -592,7 +605,7 @@ function AmountStep({
|
|
|
592
605
|
setIsSwitching(true);
|
|
593
606
|
switchChain(asset.chainId).catch((err) => {
|
|
594
607
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
595
|
-
setError(
|
|
608
|
+
setError(_chunk7HJ7IBRHcjs.formatUserError.call(void 0, raw));
|
|
596
609
|
}).finally(() => {
|
|
597
610
|
setIsSwitching(false);
|
|
598
611
|
});
|
|
@@ -620,7 +633,7 @@ function AmountStep({
|
|
|
620
633
|
}
|
|
621
634
|
}, [balance, tokenPriceUsd, asset.decimals]);
|
|
622
635
|
_react.useEffect.call(void 0, () => {
|
|
623
|
-
_optionalChain([onBalanceUsdChange, 'optionalCall',
|
|
636
|
+
_optionalChain([onBalanceUsdChange, 'optionalCall', _14 => _14(_nullishCoalesce(balanceUsd, () => ( 0)))]);
|
|
624
637
|
}, [balanceUsd, onBalanceUsdChange]);
|
|
625
638
|
const formattedBalance = _react.useMemo.call(void 0, () => {
|
|
626
639
|
if (balance === null) return "...";
|
|
@@ -628,7 +641,7 @@ function AmountStep({
|
|
|
628
641
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
629
642
|
const numeric = Number(raw);
|
|
630
643
|
if (!Number.isFinite(numeric)) return raw;
|
|
631
|
-
return
|
|
644
|
+
return _chunk7HJ7IBRHcjs.tokenFormatter.format(numeric);
|
|
632
645
|
} catch (e8) {
|
|
633
646
|
return "...";
|
|
634
647
|
}
|
|
@@ -668,15 +681,15 @@ function AmountStep({
|
|
|
668
681
|
}
|
|
669
682
|
if (hasPricing) {
|
|
670
683
|
const usdValue = numericAmount;
|
|
671
|
-
if (_optionalChain([uiConfig, 'optionalAccess',
|
|
684
|
+
if (_optionalChain([uiConfig, 'optionalAccess', _15 => _15.maxDepositUsd]) && usdValue > uiConfig.maxDepositUsd) {
|
|
672
685
|
setError(
|
|
673
|
-
`Maximum deposit is ${
|
|
686
|
+
`Maximum deposit is ${_chunk7HJ7IBRHcjs.currencyFormatter.format(uiConfig.maxDepositUsd)}`
|
|
674
687
|
);
|
|
675
688
|
return;
|
|
676
689
|
}
|
|
677
|
-
if (_optionalChain([uiConfig, 'optionalAccess',
|
|
690
|
+
if (_optionalChain([uiConfig, 'optionalAccess', _16 => _16.minDepositUsd]) && usdValue < uiConfig.minDepositUsd) {
|
|
678
691
|
setError(
|
|
679
|
-
`Minimum deposit is ${
|
|
692
|
+
`Minimum deposit is ${_chunk7HJ7IBRHcjs.currencyFormatter.format(uiConfig.minDepositUsd)}`
|
|
680
693
|
);
|
|
681
694
|
return;
|
|
682
695
|
}
|
|
@@ -725,7 +738,7 @@ function AmountStep({
|
|
|
725
738
|
hasPricing && balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { style: { color: "var(--rs-muted-foreground)" }, children: [
|
|
726
739
|
" ",
|
|
727
740
|
"(",
|
|
728
|
-
|
|
741
|
+
_chunk7HJ7IBRHcjs.currencyFormatter.format(balanceUsd),
|
|
729
742
|
")"
|
|
730
743
|
] })
|
|
731
744
|
] }) })
|
|
@@ -884,7 +897,7 @@ function AmountStep({
|
|
|
884
897
|
] })
|
|
885
898
|
] }),
|
|
886
899
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
887
|
-
|
|
900
|
+
_chunk7HJ7IBRHcjs.Button,
|
|
888
901
|
{
|
|
889
902
|
onClick: handleContinue,
|
|
890
903
|
fullWidth: true,
|
|
@@ -892,7 +905,7 @@ function AmountStep({
|
|
|
892
905
|
children: "Continue"
|
|
893
906
|
}
|
|
894
907
|
) }),
|
|
895
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
908
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7HJ7IBRHcjs.PoweredBy, {})
|
|
896
909
|
] });
|
|
897
910
|
}
|
|
898
911
|
|
|
@@ -921,7 +934,7 @@ function ConfirmStep({
|
|
|
921
934
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
922
935
|
const [isSwitching, setIsSwitching] = _react.useState.call(void 0, false);
|
|
923
936
|
const hasAttemptedSwitch = _react.useRef.call(void 0, false);
|
|
924
|
-
const chainMismatch = _optionalChain([walletClient, 'optionalAccess',
|
|
937
|
+
const chainMismatch = _optionalChain([walletClient, 'optionalAccess', _17 => _17.chain, 'optionalAccess', _18 => _18.id]) && walletClient.chain.id !== asset.chainId;
|
|
925
938
|
const sameRoute = targetChain === asset.chainId && targetToken.toLowerCase() === asset.token.toLowerCase();
|
|
926
939
|
const targetSymbol = sameRoute ? asset.symbol : _chunkNELAYNA3cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
927
940
|
const formattedSendAmount = amount && !Number.isNaN(Number(amount)) ? Number(amount).toLocaleString("en-US", { maximumFractionDigits: 6 }) : "0";
|
|
@@ -942,7 +955,7 @@ function ConfirmStep({
|
|
|
942
955
|
setIsSwitching(true);
|
|
943
956
|
switchChain(asset.chainId).catch((err) => {
|
|
944
957
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
945
|
-
setError(
|
|
958
|
+
setError(_chunk7HJ7IBRHcjs.formatUserError.call(void 0, raw));
|
|
946
959
|
}).finally(() => {
|
|
947
960
|
setIsSwitching(false);
|
|
948
961
|
});
|
|
@@ -985,7 +998,7 @@ function ConfirmStep({
|
|
|
985
998
|
throw new Error("Wallet not properly connected");
|
|
986
999
|
}
|
|
987
1000
|
const transferTo = sameRoute ? recipient : smartAccount;
|
|
988
|
-
const hash =
|
|
1001
|
+
const hash = _chunk7HJ7IBRHcjs.isNativeAsset.call(void 0, asset) ? await walletClient.sendTransaction({
|
|
989
1002
|
account,
|
|
990
1003
|
chain,
|
|
991
1004
|
to: transferTo,
|
|
@@ -998,13 +1011,13 @@ function ConfirmStep({
|
|
|
998
1011
|
functionName: "transfer",
|
|
999
1012
|
args: [transferTo, amountUnits]
|
|
1000
1013
|
});
|
|
1001
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
1014
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _19 => _19(hash, asset.chainId, amountUnits.toString())]);
|
|
1002
1015
|
onConfirm(hash, asset.chainId, amountUnits.toString(), asset.token);
|
|
1003
1016
|
} catch (err) {
|
|
1004
1017
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
1005
|
-
const message =
|
|
1018
|
+
const message = _chunk7HJ7IBRHcjs.formatUserError.call(void 0, raw);
|
|
1006
1019
|
setError(message);
|
|
1007
|
-
_optionalChain([onError, 'optionalCall',
|
|
1020
|
+
_optionalChain([onError, 'optionalCall', _20 => _20(message, "TRANSFER_ERROR")]);
|
|
1008
1021
|
} finally {
|
|
1009
1022
|
setIsSubmitting(false);
|
|
1010
1023
|
}
|
|
@@ -1131,7 +1144,7 @@ function ConfirmStep({
|
|
|
1131
1144
|
] })
|
|
1132
1145
|
] }),
|
|
1133
1146
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1134
|
-
|
|
1147
|
+
_chunk7HJ7IBRHcjs.Button,
|
|
1135
1148
|
{
|
|
1136
1149
|
onClick: handleConfirm,
|
|
1137
1150
|
loading: isSubmitting,
|
|
@@ -1140,7 +1153,7 @@ function ConfirmStep({
|
|
|
1140
1153
|
children: "Confirm Order"
|
|
1141
1154
|
}
|
|
1142
1155
|
) }),
|
|
1143
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1156
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7HJ7IBRHcjs.PoweredBy, {})
|
|
1144
1157
|
] });
|
|
1145
1158
|
}
|
|
1146
1159
|
|
|
@@ -1265,7 +1278,7 @@ var DEFAULT_SOLANA_RPC_URL = "https://api.mainnet.solana.com";
|
|
|
1265
1278
|
var configuredSolanaRpcUrl = null;
|
|
1266
1279
|
var cachedConnections = /* @__PURE__ */ new Map();
|
|
1267
1280
|
function configureSolanaRpcUrl(rpcUrl) {
|
|
1268
|
-
const normalized = _optionalChain([rpcUrl, 'optionalAccess',
|
|
1281
|
+
const normalized = _optionalChain([rpcUrl, 'optionalAccess', _21 => _21.trim, 'call', _22 => _22()]);
|
|
1269
1282
|
configuredSolanaRpcUrl = normalized ? normalized : null;
|
|
1270
1283
|
cachedConnections.clear();
|
|
1271
1284
|
}
|
|
@@ -1400,7 +1413,7 @@ function resolveSolanaTokenMeta(token) {
|
|
|
1400
1413
|
return {};
|
|
1401
1414
|
}
|
|
1402
1415
|
function getDepositEventDetails(event) {
|
|
1403
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
1416
|
+
if (!_optionalChain([event, 'optionalAccess', _23 => _23.type]) || !isRecord(event.data)) return {};
|
|
1404
1417
|
if (event.type === "deposit-received") {
|
|
1405
1418
|
const chainId = asChainId(event.data.chain);
|
|
1406
1419
|
const token = asString(event.data.token);
|
|
@@ -1414,12 +1427,12 @@ function getDepositEventDetails(event) {
|
|
|
1414
1427
|
}
|
|
1415
1428
|
if (event.type === "bridge-started") {
|
|
1416
1429
|
const source = isRecord(event.data.source) ? event.data.source : void 0;
|
|
1417
|
-
const chainId = asChainId(_optionalChain([source, 'optionalAccess',
|
|
1418
|
-
const token = asString(_optionalChain([source, 'optionalAccess',
|
|
1430
|
+
const chainId = asChainId(_optionalChain([source, 'optionalAccess', _24 => _24.chain]));
|
|
1431
|
+
const token = asString(_optionalChain([source, 'optionalAccess', _25 => _25.asset]));
|
|
1419
1432
|
const solanaMeta = chainId === "solana" ? resolveSolanaTokenMeta(token) : {};
|
|
1420
1433
|
return {
|
|
1421
1434
|
chainId,
|
|
1422
|
-
amount: asAmount(_optionalChain([source, 'optionalAccess',
|
|
1435
|
+
amount: asAmount(_optionalChain([source, 'optionalAccess', _26 => _26.amount])),
|
|
1423
1436
|
token,
|
|
1424
1437
|
...solanaMeta
|
|
1425
1438
|
};
|
|
@@ -1472,9 +1485,9 @@ function DepositAddressStep({
|
|
|
1472
1485
|
const matched = _nullishCoalesce(SOLANA_TOKENS.find((t) => t.symbol === sourceTokenSymbol), () => ( SOLANA_TOKENS[0]));
|
|
1473
1486
|
sourceSelectionRef.current = {
|
|
1474
1487
|
chainId: "solana",
|
|
1475
|
-
token: _optionalChain([matched, 'optionalAccess',
|
|
1476
|
-
sourceSymbol: _optionalChain([matched, 'optionalAccess',
|
|
1477
|
-
sourceDecimals: _optionalChain([matched, 'optionalAccess',
|
|
1488
|
+
token: _optionalChain([matched, 'optionalAccess', _27 => _27.mint]),
|
|
1489
|
+
sourceSymbol: _optionalChain([matched, 'optionalAccess', _28 => _28.symbol]),
|
|
1490
|
+
sourceDecimals: _optionalChain([matched, 'optionalAccess', _29 => _29.decimals])
|
|
1478
1491
|
};
|
|
1479
1492
|
return;
|
|
1480
1493
|
}
|
|
@@ -1490,8 +1503,8 @@ function DepositAddressStep({
|
|
|
1490
1503
|
function handlePointerDown(event) {
|
|
1491
1504
|
const target = event.target;
|
|
1492
1505
|
if (!target) return;
|
|
1493
|
-
const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access',
|
|
1494
|
-
const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access',
|
|
1506
|
+
const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access', _30 => _30.current, 'optionalAccess', _31 => _31.contains, 'call', _32 => _32(target)]);
|
|
1507
|
+
const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access', _33 => _33.current, 'optionalAccess', _34 => _34.contains, 'call', _35 => _35(target)]);
|
|
1495
1508
|
if (clickedChainDropdown || clickedTokenDropdown) return;
|
|
1496
1509
|
setChainDropdownOpen(false);
|
|
1497
1510
|
setTokenDropdownOpen(false);
|
|
@@ -1538,10 +1551,10 @@ function DepositAddressStep({
|
|
|
1538
1551
|
const status = await service.fetchLatestStatus(smartAccount);
|
|
1539
1552
|
if (cancelled || depositHandledRef.current) return;
|
|
1540
1553
|
const event = status.lastEvent;
|
|
1541
|
-
const eventTxHash =
|
|
1554
|
+
const eventTxHash = _chunk7HJ7IBRHcjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunk7HJ7IBRHcjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
1542
1555
|
if (baselineTxHash === void 0) {
|
|
1543
1556
|
baselineTxHash = eventTxHash;
|
|
1544
|
-
} else if (eventTxHash && (!baselineTxHash || !
|
|
1557
|
+
} else if (eventTxHash && (!baselineTxHash || !_chunk7HJ7IBRHcjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHash))) {
|
|
1545
1558
|
const details = getDepositEventDetails(event);
|
|
1546
1559
|
const fallback = sourceSelectionRef.current;
|
|
1547
1560
|
const chainId = _nullishCoalesce(details.chainId, () => ( fallback.chainId));
|
|
@@ -1567,7 +1580,7 @@ function DepositAddressStep({
|
|
|
1567
1580
|
if (!cancelled) {
|
|
1568
1581
|
const msg = err instanceof Error ? err.message : "Failed to check status";
|
|
1569
1582
|
setPollingError(msg);
|
|
1570
|
-
_optionalChain([onError, 'optionalCall',
|
|
1583
|
+
_optionalChain([onError, 'optionalCall', _36 => _36(msg, "STATUS_POLL_ERROR")]);
|
|
1571
1584
|
}
|
|
1572
1585
|
}
|
|
1573
1586
|
if (!cancelled && !depositHandledRef.current) {
|
|
@@ -1764,7 +1777,7 @@ function DepositAddressStep({
|
|
|
1764
1777
|
] }),
|
|
1765
1778
|
pollingError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-error", children: pollingError })
|
|
1766
1779
|
] }) }),
|
|
1767
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1780
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7HJ7IBRHcjs.PoweredBy, {})
|
|
1768
1781
|
] });
|
|
1769
1782
|
}
|
|
1770
1783
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -1795,7 +1808,7 @@ function SolanaTokenSelectStep({
|
|
|
1795
1808
|
setError(null);
|
|
1796
1809
|
const portfolioBySymbol = {};
|
|
1797
1810
|
try {
|
|
1798
|
-
|
|
1811
|
+
_chunk7HJ7IBRHcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
|
|
1799
1812
|
solanaAddress
|
|
1800
1813
|
});
|
|
1801
1814
|
const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
|
|
@@ -1818,12 +1831,12 @@ function SolanaTokenSelectStep({
|
|
|
1818
1831
|
};
|
|
1819
1832
|
}
|
|
1820
1833
|
}
|
|
1821
|
-
|
|
1834
|
+
_chunk7HJ7IBRHcjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
|
|
1822
1835
|
symbols: Object.keys(portfolioBySymbol)
|
|
1823
1836
|
});
|
|
1824
1837
|
} catch (err) {
|
|
1825
1838
|
if (!active) return;
|
|
1826
|
-
|
|
1839
|
+
_chunk7HJ7IBRHcjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
|
|
1827
1840
|
solanaAddress
|
|
1828
1841
|
});
|
|
1829
1842
|
setError(
|
|
@@ -1848,7 +1861,7 @@ function SolanaTokenSelectStep({
|
|
|
1848
1861
|
setTokenBalances(results);
|
|
1849
1862
|
setLoading(false);
|
|
1850
1863
|
const totalUsd = results.reduce((sum, r) => sum + r.balanceUsd, 0);
|
|
1851
|
-
_optionalChain([onTotalBalanceComputed, 'optionalCall',
|
|
1864
|
+
_optionalChain([onTotalBalanceComputed, 'optionalCall', _37 => _37(totalUsd)]);
|
|
1852
1865
|
}
|
|
1853
1866
|
void loadBalances();
|
|
1854
1867
|
return () => {
|
|
@@ -1877,7 +1890,7 @@ function SolanaTokenSelectStep({
|
|
|
1877
1890
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
1878
1891
|
children: [
|
|
1879
1892
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
1880
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1893
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7HJ7IBRHcjs.Spinner, { className: "rs-text-tertiary" }),
|
|
1881
1894
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
1882
1895
|
] }),
|
|
1883
1896
|
!loading && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
@@ -1914,7 +1927,7 @@ function SolanaTokenSelectStep({
|
|
|
1914
1927
|
try {
|
|
1915
1928
|
const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
|
|
1916
1929
|
const numeric = Number(raw);
|
|
1917
|
-
formattedBalance = Number.isFinite(numeric) ?
|
|
1930
|
+
formattedBalance = Number.isFinite(numeric) ? _chunk7HJ7IBRHcjs.tokenFormatter.format(numeric) : raw;
|
|
1918
1931
|
} catch (e14) {
|
|
1919
1932
|
formattedBalance = "...";
|
|
1920
1933
|
}
|
|
@@ -1958,7 +1971,7 @@ function SolanaTokenSelectStep({
|
|
|
1958
1971
|
] })
|
|
1959
1972
|
] })
|
|
1960
1973
|
] }),
|
|
1961
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ?
|
|
1974
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunk7HJ7IBRHcjs.currencyFormatter.format(entry.balanceUsd) : `${formattedBalance} ${entry.token.symbol}` })
|
|
1962
1975
|
]
|
|
1963
1976
|
},
|
|
1964
1977
|
entry.token.symbol
|
|
@@ -1968,7 +1981,7 @@ function SolanaTokenSelectStep({
|
|
|
1968
1981
|
}
|
|
1969
1982
|
),
|
|
1970
1983
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1971
|
-
|
|
1984
|
+
_chunk7HJ7IBRHcjs.Button,
|
|
1972
1985
|
{
|
|
1973
1986
|
onClick: () => selectedEntry && onContinue(
|
|
1974
1987
|
selectedEntry.token,
|
|
@@ -1980,7 +1993,7 @@ function SolanaTokenSelectStep({
|
|
|
1980
1993
|
children: "Continue"
|
|
1981
1994
|
}
|
|
1982
1995
|
) }),
|
|
1983
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1996
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7HJ7IBRHcjs.PoweredBy, {})
|
|
1984
1997
|
] });
|
|
1985
1998
|
}
|
|
1986
1999
|
|
|
@@ -2003,14 +2016,14 @@ function SolanaAmountStep({
|
|
|
2003
2016
|
const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
|
|
2004
2017
|
const numeric = Number(raw);
|
|
2005
2018
|
if (!Number.isFinite(numeric)) return raw;
|
|
2006
|
-
return
|
|
2019
|
+
return _chunk7HJ7IBRHcjs.tokenFormatter.format(numeric);
|
|
2007
2020
|
} catch (e15) {
|
|
2008
2021
|
return "...";
|
|
2009
2022
|
}
|
|
2010
2023
|
}, [balance, token.decimals]);
|
|
2011
2024
|
const formattedBalanceUsd = _react.useMemo.call(void 0, () => {
|
|
2012
2025
|
if (!Number.isFinite(balanceUsd) || balanceUsd <= 0) return null;
|
|
2013
|
-
return
|
|
2026
|
+
return _chunk7HJ7IBRHcjs.currencyFormatter.format(balanceUsd);
|
|
2014
2027
|
}, [balanceUsd]);
|
|
2015
2028
|
const spendableBalance = _react.useMemo.call(void 0, () => {
|
|
2016
2029
|
if (!isNativeSol(token)) return balance;
|
|
@@ -2025,7 +2038,7 @@ function SolanaAmountStep({
|
|
|
2025
2038
|
const factor = 10 ** maxDecimals;
|
|
2026
2039
|
const truncated = Math.floor(value * factor) / factor;
|
|
2027
2040
|
const formatted = truncated.toFixed(maxDecimals).replace(/\.?0+$/, "");
|
|
2028
|
-
|
|
2041
|
+
_chunk7HJ7IBRHcjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
|
|
2029
2042
|
percentage,
|
|
2030
2043
|
symbol: token.symbol,
|
|
2031
2044
|
formatted
|
|
@@ -2039,7 +2052,7 @@ function SolanaAmountStep({
|
|
|
2039
2052
|
const handleContinue = () => {
|
|
2040
2053
|
const numericAmount = parseFloat(amount);
|
|
2041
2054
|
if (isNaN(numericAmount) || numericAmount <= 0) {
|
|
2042
|
-
|
|
2055
|
+
_chunk7HJ7IBRHcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2043
2056
|
amount,
|
|
2044
2057
|
reason: "nan-or-non-positive"
|
|
2045
2058
|
});
|
|
@@ -2050,7 +2063,7 @@ function SolanaAmountStep({
|
|
|
2050
2063
|
try {
|
|
2051
2064
|
amountInUnits = _viem.parseUnits.call(void 0, amount, token.decimals);
|
|
2052
2065
|
} catch (e17) {
|
|
2053
|
-
|
|
2066
|
+
_chunk7HJ7IBRHcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2054
2067
|
amount,
|
|
2055
2068
|
reason: "parse-units-failed"
|
|
2056
2069
|
});
|
|
@@ -2059,7 +2072,7 @@ function SolanaAmountStep({
|
|
|
2059
2072
|
}
|
|
2060
2073
|
if (amountInUnits > spendableBalance) {
|
|
2061
2074
|
const isReserveIssue = isNativeSol(token) && amountInUnits <= balance;
|
|
2062
|
-
|
|
2075
|
+
_chunk7HJ7IBRHcjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2063
2076
|
amount,
|
|
2064
2077
|
balance: balance.toString(),
|
|
2065
2078
|
spendableBalance: spendableBalance.toString(),
|
|
@@ -2071,7 +2084,7 @@ function SolanaAmountStep({
|
|
|
2071
2084
|
);
|
|
2072
2085
|
return;
|
|
2073
2086
|
}
|
|
2074
|
-
|
|
2087
|
+
_chunk7HJ7IBRHcjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
|
|
2075
2088
|
symbol: token.symbol,
|
|
2076
2089
|
amount,
|
|
2077
2090
|
amountInUnits: amountInUnits.toString()
|
|
@@ -2161,7 +2174,7 @@ function SolanaAmountStep({
|
|
|
2161
2174
|
] })
|
|
2162
2175
|
] }),
|
|
2163
2176
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2164
|
-
|
|
2177
|
+
_chunk7HJ7IBRHcjs.Button,
|
|
2165
2178
|
{
|
|
2166
2179
|
onClick: handleContinue,
|
|
2167
2180
|
fullWidth: true,
|
|
@@ -2169,7 +2182,7 @@ function SolanaAmountStep({
|
|
|
2169
2182
|
children: "Continue"
|
|
2170
2183
|
}
|
|
2171
2184
|
) }),
|
|
2172
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2185
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7HJ7IBRHcjs.PoweredBy, {})
|
|
2173
2186
|
] });
|
|
2174
2187
|
}
|
|
2175
2188
|
|
|
@@ -2212,7 +2225,7 @@ function SolanaConfirmStep({
|
|
|
2212
2225
|
const receiveAmount = isSameToken ? formattedReceiveAmount : `~ ${formattedReceiveAmount}`;
|
|
2213
2226
|
const handleConfirm = async () => {
|
|
2214
2227
|
if (!solanaProvider) {
|
|
2215
|
-
|
|
2228
|
+
_chunk7HJ7IBRHcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
2216
2229
|
reason: "missing-provider"
|
|
2217
2230
|
});
|
|
2218
2231
|
setError("Solana wallet not connected");
|
|
@@ -2220,7 +2233,7 @@ function SolanaConfirmStep({
|
|
|
2220
2233
|
}
|
|
2221
2234
|
const parsedAmount = parseFloat(amount);
|
|
2222
2235
|
if (isNaN(parsedAmount) || parsedAmount <= 0) {
|
|
2223
|
-
|
|
2236
|
+
_chunk7HJ7IBRHcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
2224
2237
|
reason: "invalid-amount",
|
|
2225
2238
|
amount
|
|
2226
2239
|
});
|
|
@@ -2229,7 +2242,7 @@ function SolanaConfirmStep({
|
|
|
2229
2242
|
}
|
|
2230
2243
|
setError(null);
|
|
2231
2244
|
setIsSubmitting(true);
|
|
2232
|
-
|
|
2245
|
+
_chunk7HJ7IBRHcjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
|
|
2233
2246
|
smartAccount,
|
|
2234
2247
|
solanaAddress,
|
|
2235
2248
|
solanaDepositAddress,
|
|
@@ -2238,7 +2251,7 @@ function SolanaConfirmStep({
|
|
|
2238
2251
|
});
|
|
2239
2252
|
try {
|
|
2240
2253
|
const check = await service.checkAccount(smartAccount);
|
|
2241
|
-
|
|
2254
|
+
_chunk7HJ7IBRHcjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
|
|
2242
2255
|
smartAccount,
|
|
2243
2256
|
isRegistered: check.isRegistered,
|
|
2244
2257
|
targetChain: check.targetChain,
|
|
@@ -2251,7 +2264,7 @@ function SolanaConfirmStep({
|
|
|
2251
2264
|
}
|
|
2252
2265
|
const connection = getSolanaConnection();
|
|
2253
2266
|
const amountUnits = _viem.parseUnits.call(void 0, amount, token.decimals);
|
|
2254
|
-
|
|
2267
|
+
_chunk7HJ7IBRHcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
|
|
2255
2268
|
token: token.symbol,
|
|
2256
2269
|
amount,
|
|
2257
2270
|
amountUnits: amountUnits.toString()
|
|
@@ -2268,10 +2281,10 @@ function SolanaConfirmStep({
|
|
|
2268
2281
|
token.mint,
|
|
2269
2282
|
amountUnits
|
|
2270
2283
|
);
|
|
2271
|
-
|
|
2284
|
+
_chunk7HJ7IBRHcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
2272
2285
|
token: token.symbol,
|
|
2273
2286
|
instructionCount: transaction.instructions.length,
|
|
2274
|
-
feePayer: _optionalChain([transaction, 'access',
|
|
2287
|
+
feePayer: _optionalChain([transaction, 'access', _38 => _38.feePayer, 'optionalAccess', _39 => _39.toBase58, 'call', _40 => _40()]),
|
|
2275
2288
|
recentBlockhash: transaction.recentBlockhash
|
|
2276
2289
|
});
|
|
2277
2290
|
const txHash = await sendSolanaTransaction(
|
|
@@ -2279,21 +2292,21 @@ function SolanaConfirmStep({
|
|
|
2279
2292
|
connection,
|
|
2280
2293
|
transaction
|
|
2281
2294
|
);
|
|
2282
|
-
|
|
2295
|
+
_chunk7HJ7IBRHcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
|
|
2283
2296
|
txHash,
|
|
2284
2297
|
amountUnits: amountUnits.toString()
|
|
2285
2298
|
});
|
|
2286
2299
|
onConfirm(txHash, amountUnits.toString());
|
|
2287
2300
|
} catch (err) {
|
|
2288
2301
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
2289
|
-
const message =
|
|
2290
|
-
|
|
2302
|
+
const message = _chunk7HJ7IBRHcjs.formatUserError.call(void 0, raw);
|
|
2303
|
+
_chunk7HJ7IBRHcjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
|
|
2291
2304
|
smartAccount,
|
|
2292
2305
|
token: token.symbol,
|
|
2293
2306
|
amount
|
|
2294
2307
|
});
|
|
2295
2308
|
setError(message);
|
|
2296
|
-
_optionalChain([onError, 'optionalCall',
|
|
2309
|
+
_optionalChain([onError, 'optionalCall', _41 => _41(message, "SOLANA_TRANSFER_ERROR")]);
|
|
2297
2310
|
} finally {
|
|
2298
2311
|
setIsSubmitting(false);
|
|
2299
2312
|
}
|
|
@@ -2420,7 +2433,7 @@ function SolanaConfirmStep({
|
|
|
2420
2433
|
] })
|
|
2421
2434
|
] }),
|
|
2422
2435
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2423
|
-
|
|
2436
|
+
_chunk7HJ7IBRHcjs.Button,
|
|
2424
2437
|
{
|
|
2425
2438
|
onClick: handleConfirm,
|
|
2426
2439
|
loading: isSubmitting,
|
|
@@ -2429,7 +2442,7 @@ function SolanaConfirmStep({
|
|
|
2429
2442
|
children: "Confirm Order"
|
|
2430
2443
|
}
|
|
2431
2444
|
) }),
|
|
2432
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2445
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7HJ7IBRHcjs.PoweredBy, {})
|
|
2433
2446
|
] });
|
|
2434
2447
|
}
|
|
2435
2448
|
|
|
@@ -2462,6 +2475,7 @@ function DepositFlow({
|
|
|
2462
2475
|
onRequestConnect,
|
|
2463
2476
|
connectButtonLabel,
|
|
2464
2477
|
uiConfig,
|
|
2478
|
+
allowedRoutes,
|
|
2465
2479
|
onStepChange,
|
|
2466
2480
|
onTotalBalanceChange,
|
|
2467
2481
|
onClose,
|
|
@@ -2484,13 +2498,13 @@ function DepositFlow({
|
|
|
2484
2498
|
flowModeRef.current = flowMode;
|
|
2485
2499
|
const logFlow = _react.useCallback.call(void 0,
|
|
2486
2500
|
(message, data) => {
|
|
2487
|
-
|
|
2501
|
+
_chunk7HJ7IBRHcjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
|
|
2488
2502
|
},
|
|
2489
2503
|
[debug]
|
|
2490
2504
|
);
|
|
2491
2505
|
const logFlowError = _react.useCallback.call(void 0,
|
|
2492
2506
|
(message, error, data) => {
|
|
2493
|
-
|
|
2507
|
+
_chunk7HJ7IBRHcjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
|
|
2494
2508
|
},
|
|
2495
2509
|
[debug]
|
|
2496
2510
|
);
|
|
@@ -2511,12 +2525,12 @@ function DepositFlow({
|
|
|
2511
2525
|
return null;
|
|
2512
2526
|
}, []);
|
|
2513
2527
|
const dappSwitchChain = _react.useMemo.call(void 0, () => {
|
|
2514
|
-
if (!_optionalChain([dappWalletClient, 'optionalAccess',
|
|
2528
|
+
if (!_optionalChain([dappWalletClient, 'optionalAccess', _42 => _42.switchChain])) return void 0;
|
|
2515
2529
|
return async (chainId) => {
|
|
2516
|
-
await _optionalChain([dappWalletClient, 'access',
|
|
2530
|
+
await _optionalChain([dappWalletClient, 'access', _43 => _43.switchChain, 'optionalCall', _44 => _44({ id: chainId })]);
|
|
2517
2531
|
};
|
|
2518
2532
|
}, [dappWalletClient]);
|
|
2519
|
-
const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
2533
|
+
const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _45 => _45.account, 'optionalAccess', _46 => _46.address]), () => ( null));
|
|
2520
2534
|
const walletOptions = _react.useMemo.call(void 0, () => {
|
|
2521
2535
|
const options = [];
|
|
2522
2536
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -2530,7 +2544,7 @@ function DepositFlow({
|
|
|
2530
2544
|
});
|
|
2531
2545
|
seen.add(id);
|
|
2532
2546
|
}
|
|
2533
|
-
if (_optionalChain([reownWallet, 'optionalAccess',
|
|
2547
|
+
if (_optionalChain([reownWallet, 'optionalAccess', _47 => _47.isConnected]) && reownWallet.isSolana && reownWallet.solanaAddress && dappAddress) {
|
|
2534
2548
|
const id = _nullishCoalesce(reownWallet.caipAddress, () => ( `solana:${reownWallet.solanaAddress}`));
|
|
2535
2549
|
if (!seen.has(id)) {
|
|
2536
2550
|
options.push({
|
|
@@ -2542,7 +2556,7 @@ function DepositFlow({
|
|
|
2542
2556
|
});
|
|
2543
2557
|
seen.add(id);
|
|
2544
2558
|
}
|
|
2545
|
-
} else if (_optionalChain([reownWallet, 'optionalAccess',
|
|
2559
|
+
} else if (_optionalChain([reownWallet, 'optionalAccess', _48 => _48.address]) && reownWallet.isConnected && reownWallet.walletClient && reownWallet.publicClient && !seen.has(`evm:${reownWallet.address.toLowerCase()}`)) {
|
|
2546
2560
|
const id = `evm:${reownWallet.address.toLowerCase()}`;
|
|
2547
2561
|
if (!seen.has(id)) {
|
|
2548
2562
|
options.push({
|
|
@@ -2559,19 +2573,19 @@ function DepositFlow({
|
|
|
2559
2573
|
}, [
|
|
2560
2574
|
connectedWalletAddress,
|
|
2561
2575
|
dappAddress,
|
|
2562
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2563
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2564
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2565
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2566
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2567
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2568
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2569
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2576
|
+
_optionalChain([reownWallet, 'optionalAccess', _49 => _49.address]),
|
|
2577
|
+
_optionalChain([reownWallet, 'optionalAccess', _50 => _50.isConnected]),
|
|
2578
|
+
_optionalChain([reownWallet, 'optionalAccess', _51 => _51.walletClient]),
|
|
2579
|
+
_optionalChain([reownWallet, 'optionalAccess', _52 => _52.publicClient]),
|
|
2580
|
+
_optionalChain([reownWallet, 'optionalAccess', _53 => _53.icon]),
|
|
2581
|
+
_optionalChain([reownWallet, 'optionalAccess', _54 => _54.isSolana]),
|
|
2582
|
+
_optionalChain([reownWallet, 'optionalAccess', _55 => _55.solanaAddress]),
|
|
2583
|
+
_optionalChain([reownWallet, 'optionalAccess', _56 => _56.caipAddress])
|
|
2570
2584
|
]);
|
|
2571
|
-
const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess',
|
|
2585
|
+
const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess', _57 => _57.account]) && dappAddress && !reownWallet;
|
|
2572
2586
|
const hasWalletOptions = walletOptions.length > 0;
|
|
2573
2587
|
const hasReownSession = Boolean(
|
|
2574
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2588
|
+
_optionalChain([reownWallet, 'optionalAccess', _58 => _58.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _59 => _59.address])
|
|
2575
2589
|
);
|
|
2576
2590
|
const showConnectStep = flowMode === null && !canAutoLock && !isConnectSelectionConfirmed;
|
|
2577
2591
|
const walletSelectionKey = _react.useMemo.call(void 0, () => {
|
|
@@ -2597,16 +2611,16 @@ function DepositFlow({
|
|
|
2597
2611
|
return {
|
|
2598
2612
|
ownerAddress: dappAddress,
|
|
2599
2613
|
walletClient: void 0,
|
|
2600
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
2614
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk7HJ7IBRHcjs.getPublicClient.call(void 0, targetChain))),
|
|
2601
2615
|
switchChain: void 0
|
|
2602
2616
|
};
|
|
2603
2617
|
}
|
|
2604
2618
|
if (canAutoLock) {
|
|
2605
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
2619
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _60 => _60.chain, 'optionalAccess', _61 => _61.id]), () => ( targetChain));
|
|
2606
2620
|
return {
|
|
2607
2621
|
ownerAddress: dappWalletClient.account.address,
|
|
2608
2622
|
walletClient: dappWalletClient,
|
|
2609
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
2623
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk7HJ7IBRHcjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
2610
2624
|
switchChain: dappSwitchChain
|
|
2611
2625
|
};
|
|
2612
2626
|
}
|
|
@@ -2620,24 +2634,24 @@ function DepositFlow({
|
|
|
2620
2634
|
return {
|
|
2621
2635
|
ownerAddress: dappAddress,
|
|
2622
2636
|
walletClient: void 0,
|
|
2623
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
2637
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk7HJ7IBRHcjs.getPublicClient.call(void 0, targetChain))),
|
|
2624
2638
|
switchChain: void 0
|
|
2625
2639
|
};
|
|
2626
2640
|
}
|
|
2627
|
-
if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess',
|
|
2628
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
2641
|
+
if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess', _62 => _62.account]) && selectedOption.address && dappWalletClient.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
2642
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _63 => _63.chain, 'optionalAccess', _64 => _64.id]), () => ( targetChain));
|
|
2629
2643
|
return {
|
|
2630
2644
|
ownerAddress: dappWalletClient.account.address,
|
|
2631
2645
|
walletClient: dappWalletClient,
|
|
2632
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
2646
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk7HJ7IBRHcjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
2633
2647
|
switchChain: dappSwitchChain
|
|
2634
2648
|
};
|
|
2635
2649
|
}
|
|
2636
|
-
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess',
|
|
2650
|
+
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess', _65 => _65.address]) && selectedOption.address && reownWallet.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
2637
2651
|
return {
|
|
2638
2652
|
ownerAddress: reownWallet.address,
|
|
2639
2653
|
walletClient: reownWallet.walletClient,
|
|
2640
|
-
publicClient: _nullishCoalesce(reownWallet.publicClient, () => (
|
|
2654
|
+
publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunk7HJ7IBRHcjs.getPublicClient.call(void 0, targetChain))),
|
|
2641
2655
|
switchChain: reownWallet.switchChain
|
|
2642
2656
|
};
|
|
2643
2657
|
}
|
|
@@ -2675,7 +2689,7 @@ function DepositFlow({
|
|
|
2675
2689
|
return {
|
|
2676
2690
|
ownerAddress: dappAddress,
|
|
2677
2691
|
walletClient: void 0,
|
|
2678
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
2692
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunk7HJ7IBRHcjs.getPublicClient.call(void 0, targetChain))),
|
|
2679
2693
|
switchChain: void 0
|
|
2680
2694
|
};
|
|
2681
2695
|
}
|
|
@@ -2697,7 +2711,7 @@ function DepositFlow({
|
|
|
2697
2711
|
walletSignerContext,
|
|
2698
2712
|
walletSelectionKey
|
|
2699
2713
|
]);
|
|
2700
|
-
const sessionKeyAddress = _nullishCoalesce(_nullishCoalesce(dappAddress, () => ( _optionalChain([signerContext, 'optionalAccess',
|
|
2714
|
+
const sessionKeyAddress = _nullishCoalesce(_nullishCoalesce(dappAddress, () => ( _optionalChain([signerContext, 'optionalAccess', _66 => _66.ownerAddress]))), () => ( null));
|
|
2701
2715
|
const lastTargetRef = _react.useRef.call(void 0, null);
|
|
2702
2716
|
_react.useEffect.call(void 0, () => {
|
|
2703
2717
|
const prev = lastTargetRef.current;
|
|
@@ -2773,7 +2787,7 @@ function DepositFlow({
|
|
|
2773
2787
|
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;
|
|
2774
2788
|
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;
|
|
2775
2789
|
_react.useEffect.call(void 0, () => {
|
|
2776
|
-
_optionalChain([onStepChange, 'optionalCall',
|
|
2790
|
+
_optionalChain([onStepChange, 'optionalCall', _67 => _67(stepIndex, currentBackHandler)]);
|
|
2777
2791
|
}, [stepIndex, currentBackHandler, onStepChange]);
|
|
2778
2792
|
_react.useEffect.call(void 0, () => {
|
|
2779
2793
|
logFlow("state:changed", {
|
|
@@ -2792,7 +2806,7 @@ function DepositFlow({
|
|
|
2792
2806
|
targetToken
|
|
2793
2807
|
]);
|
|
2794
2808
|
_react.useEffect.call(void 0, () => {
|
|
2795
|
-
_optionalChain([onTotalBalanceChange, 'optionalCall',
|
|
2809
|
+
_optionalChain([onTotalBalanceChange, 'optionalCall', _68 => _68(totalBalanceUsd)]);
|
|
2796
2810
|
}, [totalBalanceUsd, onTotalBalanceChange]);
|
|
2797
2811
|
const isDepositAddressMode = flowMode === "deposit-address";
|
|
2798
2812
|
const isSolanaWalletMode = flowMode === "solana-wallet";
|
|
@@ -2834,7 +2848,7 @@ function DepositFlow({
|
|
|
2834
2848
|
solanaDepositAddress
|
|
2835
2849
|
});
|
|
2836
2850
|
} else {
|
|
2837
|
-
_optionalChain([onError, 'optionalCall',
|
|
2851
|
+
_optionalChain([onError, 'optionalCall', _69 => _69({
|
|
2838
2852
|
message: "Solana deposit address not available. Please try again.",
|
|
2839
2853
|
code: "SOLANA_SETUP_FAILED"
|
|
2840
2854
|
})]);
|
|
@@ -2869,7 +2883,7 @@ function DepositFlow({
|
|
|
2869
2883
|
directTransfer
|
|
2870
2884
|
};
|
|
2871
2885
|
});
|
|
2872
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
2886
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _70 => _70({ txHash, sourceChain: chainId, amount })]);
|
|
2873
2887
|
},
|
|
2874
2888
|
[onDepositSubmitted, targetChain, targetToken]
|
|
2875
2889
|
);
|
|
@@ -2944,7 +2958,7 @@ function DepositFlow({
|
|
|
2944
2958
|
sourceDecimals: prev.token.decimals
|
|
2945
2959
|
};
|
|
2946
2960
|
});
|
|
2947
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
2961
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _71 => _71({
|
|
2948
2962
|
txHash,
|
|
2949
2963
|
sourceChain: "solana",
|
|
2950
2964
|
amount: amountUnits
|
|
@@ -2954,7 +2968,7 @@ function DepositFlow({
|
|
|
2954
2968
|
);
|
|
2955
2969
|
const handleConnected = _react.useCallback.call(void 0,
|
|
2956
2970
|
(addr, smartAccount) => {
|
|
2957
|
-
_optionalChain([onConnected, 'optionalCall',
|
|
2971
|
+
_optionalChain([onConnected, 'optionalCall', _72 => _72({ address: addr, smartAccount })]);
|
|
2958
2972
|
},
|
|
2959
2973
|
[onConnected]
|
|
2960
2974
|
);
|
|
@@ -3017,28 +3031,28 @@ function DepositFlow({
|
|
|
3017
3031
|
);
|
|
3018
3032
|
const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
|
|
3019
3033
|
(txHash, sourceChain, amount) => {
|
|
3020
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
3034
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _73 => _73({ txHash, sourceChain, amount })]);
|
|
3021
3035
|
},
|
|
3022
3036
|
[onDepositSubmitted]
|
|
3023
3037
|
);
|
|
3024
3038
|
const handleDepositComplete = _react.useCallback.call(void 0,
|
|
3025
3039
|
(txHash, destinationTxHash) => {
|
|
3026
3040
|
logFlow("deposit:complete", { txHash, destinationTxHash });
|
|
3027
|
-
_optionalChain([onDepositComplete, 'optionalCall',
|
|
3041
|
+
_optionalChain([onDepositComplete, 'optionalCall', _74 => _74({ txHash, destinationTxHash })]);
|
|
3028
3042
|
},
|
|
3029
3043
|
[logFlow, onDepositComplete]
|
|
3030
3044
|
);
|
|
3031
3045
|
const handleDepositFailed = _react.useCallback.call(void 0,
|
|
3032
3046
|
(txHash, error) => {
|
|
3033
3047
|
logFlowError("deposit:failed", error, { txHash });
|
|
3034
|
-
_optionalChain([onDepositFailed, 'optionalCall',
|
|
3048
|
+
_optionalChain([onDepositFailed, 'optionalCall', _75 => _75({ txHash, error })]);
|
|
3035
3049
|
},
|
|
3036
3050
|
[logFlowError, onDepositFailed]
|
|
3037
3051
|
);
|
|
3038
3052
|
const handleError = _react.useCallback.call(void 0,
|
|
3039
3053
|
(message, code) => {
|
|
3040
3054
|
logFlowError("flow:error", message, { code });
|
|
3041
|
-
_optionalChain([onError, 'optionalCall',
|
|
3055
|
+
_optionalChain([onError, 'optionalCall', _76 => _76({ message, code })]);
|
|
3042
3056
|
},
|
|
3043
3057
|
[logFlowError, onError]
|
|
3044
3058
|
);
|
|
@@ -3084,7 +3098,7 @@ function DepositFlow({
|
|
|
3084
3098
|
if (walletId) {
|
|
3085
3099
|
const selectedOption = walletOptions.find((o) => o.id === walletId);
|
|
3086
3100
|
setSelectedWalletId(walletId);
|
|
3087
|
-
if (_optionalChain([selectedOption, 'optionalAccess',
|
|
3101
|
+
if (_optionalChain([selectedOption, 'optionalAccess', _77 => _77.kind]) === "solana") {
|
|
3088
3102
|
handleSelectSolanaWallet();
|
|
3089
3103
|
} else {
|
|
3090
3104
|
handleSelectProvider();
|
|
@@ -3112,7 +3126,7 @@ function DepositFlow({
|
|
|
3112
3126
|
]);
|
|
3113
3127
|
if (showConnectStep) {
|
|
3114
3128
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3115
|
-
|
|
3129
|
+
_chunk7HJ7IBRHcjs.ConnectStep,
|
|
3116
3130
|
{
|
|
3117
3131
|
walletOptions,
|
|
3118
3132
|
selectedWalletId: selectedWalletIdEffective,
|
|
@@ -3131,7 +3145,7 @@ function DepositFlow({
|
|
|
3131
3145
|
const selectedOption = walletOptions.find(
|
|
3132
3146
|
(o) => o.id === selectedWalletIdEffective
|
|
3133
3147
|
);
|
|
3134
|
-
if (_optionalChain([selectedOption, 'optionalAccess',
|
|
3148
|
+
if (_optionalChain([selectedOption, 'optionalAccess', _78 => _78.kind]) === "solana") {
|
|
3135
3149
|
handleSelectSolanaWallet();
|
|
3136
3150
|
} else {
|
|
3137
3151
|
handleSelectProvider();
|
|
@@ -3172,7 +3186,7 @@ function DepositFlow({
|
|
|
3172
3186
|
}
|
|
3173
3187
|
),
|
|
3174
3188
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3175
|
-
|
|
3189
|
+
_chunk7HJ7IBRHcjs.ProcessingStep,
|
|
3176
3190
|
{
|
|
3177
3191
|
smartAccount: step.smartAccount,
|
|
3178
3192
|
txHash: step.txHash,
|
|
@@ -3197,8 +3211,8 @@ function DepositFlow({
|
|
|
3197
3211
|
}
|
|
3198
3212
|
if (isSolanaWalletMode) {
|
|
3199
3213
|
if (!sessionKeyAddress) return null;
|
|
3200
|
-
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess',
|
|
3201
|
-
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess',
|
|
3214
|
+
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess', _79 => _79.solanaAddress]);
|
|
3215
|
+
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess', _80 => _80.solanaProvider]);
|
|
3202
3216
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
3203
3217
|
step.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3204
3218
|
SetupStep,
|
|
@@ -3289,7 +3303,7 @@ function DepositFlow({
|
|
|
3289
3303
|
) })
|
|
3290
3304
|
] }) : null,
|
|
3291
3305
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3292
|
-
|
|
3306
|
+
_chunk7HJ7IBRHcjs.ProcessingStep,
|
|
3293
3307
|
{
|
|
3294
3308
|
smartAccount: step.smartAccount,
|
|
3295
3309
|
txHash: step.txHash,
|
|
@@ -3312,16 +3326,16 @@ function DepositFlow({
|
|
|
3312
3326
|
)
|
|
3313
3327
|
] });
|
|
3314
3328
|
}
|
|
3315
|
-
if (!_optionalChain([signerContext, 'optionalAccess',
|
|
3329
|
+
if (!_optionalChain([signerContext, 'optionalAccess', _81 => _81.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _82 => _82.publicClient])) {
|
|
3316
3330
|
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..." }) }) }) }) });
|
|
3317
3331
|
}
|
|
3318
3332
|
const ownerAddress = signerContext.ownerAddress;
|
|
3319
|
-
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access',
|
|
3333
|
+
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _83 => _83.walletClient, 'optionalAccess', _84 => _84.chain, 'optionalAccess', _85 => _85.id]), () => ( _optionalChain([signerContext, 'access', _86 => _86.publicClient, 'access', _87 => _87.chain, 'optionalAccess', _88 => _88.id]))), () => ( targetChain));
|
|
3320
3334
|
const getReadClientForChain = (chainId) => {
|
|
3321
|
-
if (_optionalChain([signerContext, 'access',
|
|
3335
|
+
if (_optionalChain([signerContext, 'access', _89 => _89.publicClient, 'access', _90 => _90.chain, 'optionalAccess', _91 => _91.id]) === chainId) {
|
|
3322
3336
|
return signerContext.publicClient;
|
|
3323
3337
|
}
|
|
3324
|
-
return
|
|
3338
|
+
return _chunk7HJ7IBRHcjs.getPublicClient.call(void 0, chainId);
|
|
3325
3339
|
};
|
|
3326
3340
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
3327
3341
|
step.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3348,6 +3362,7 @@ function DepositFlow({
|
|
|
3348
3362
|
publicClient: getReadClientForChain(ownerChainId),
|
|
3349
3363
|
defaultSourceChain,
|
|
3350
3364
|
defaultSourceToken,
|
|
3365
|
+
allowedRoutes,
|
|
3351
3366
|
service,
|
|
3352
3367
|
onContinue: handleAssetContinue,
|
|
3353
3368
|
onTotalBalanceComputed: handleTotalBalanceComputed,
|
|
@@ -3390,7 +3405,7 @@ function DepositFlow({
|
|
|
3390
3405
|
}
|
|
3391
3406
|
),
|
|
3392
3407
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3393
|
-
|
|
3408
|
+
_chunk7HJ7IBRHcjs.ProcessingStep,
|
|
3394
3409
|
{
|
|
3395
3410
|
smartAccount: step.smartAccount,
|
|
3396
3411
|
txHash: step.txHash,
|
|
@@ -3417,7 +3432,7 @@ function DepositFlow({
|
|
|
3417
3432
|
// src/DepositModal.tsx
|
|
3418
3433
|
|
|
3419
3434
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
3420
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
3435
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-SV6QIUTL.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
3421
3436
|
);
|
|
3422
3437
|
function DepositModal(props) {
|
|
3423
3438
|
const needsReown = !!props.reownAppId;
|
|
@@ -3454,6 +3469,7 @@ function DepositModalInner({
|
|
|
3454
3469
|
theme,
|
|
3455
3470
|
branding,
|
|
3456
3471
|
uiConfig,
|
|
3472
|
+
allowedRoutes,
|
|
3457
3473
|
className,
|
|
3458
3474
|
onReady,
|
|
3459
3475
|
onConnected,
|
|
@@ -3470,7 +3486,7 @@ function DepositModalInner({
|
|
|
3470
3486
|
const targetChain = _chunkNELAYNA3cjs.getChainId.call(void 0, targetChainProp);
|
|
3471
3487
|
const sourceChain = sourceChainProp ? _chunkNELAYNA3cjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
3472
3488
|
const service = _react.useMemo.call(void 0,
|
|
3473
|
-
() =>
|
|
3489
|
+
() => _chunk7HJ7IBRHcjs.createDepositService.call(void 0, backendUrl, {
|
|
3474
3490
|
debug,
|
|
3475
3491
|
debugScope: "service:deposit"
|
|
3476
3492
|
}),
|
|
@@ -3478,7 +3494,7 @@ function DepositModalInner({
|
|
|
3478
3494
|
);
|
|
3479
3495
|
_react.useEffect.call(void 0, () => {
|
|
3480
3496
|
if (isOpen && modalRef.current) {
|
|
3481
|
-
|
|
3497
|
+
_chunk7HJ7IBRHcjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
3482
3498
|
}
|
|
3483
3499
|
}, [isOpen, theme]);
|
|
3484
3500
|
_react.useEffect.call(void 0, () => {
|
|
@@ -3488,7 +3504,7 @@ function DepositModalInner({
|
|
|
3488
3504
|
_react.useEffect.call(void 0, () => {
|
|
3489
3505
|
if (isOpen && !hasCalledReady.current) {
|
|
3490
3506
|
hasCalledReady.current = true;
|
|
3491
|
-
_optionalChain([onReady, 'optionalCall',
|
|
3507
|
+
_optionalChain([onReady, 'optionalCall', _92 => _92()]);
|
|
3492
3508
|
}
|
|
3493
3509
|
}, [isOpen, onReady]);
|
|
3494
3510
|
_react.useEffect.call(void 0, () => {
|
|
@@ -3507,17 +3523,17 @@ function DepositModalInner({
|
|
|
3507
3523
|
setTotalBalanceUsd(balance2);
|
|
3508
3524
|
}, []);
|
|
3509
3525
|
const handleBack = _react.useCallback.call(void 0, () => {
|
|
3510
|
-
_optionalChain([backHandlerRef, 'access',
|
|
3526
|
+
_optionalChain([backHandlerRef, 'access', _93 => _93.current, 'optionalCall', _94 => _94()]);
|
|
3511
3527
|
}, []);
|
|
3512
|
-
const showLogo = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3513
|
-
const showStepper = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3514
|
-
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3515
|
-
const balance = _optionalChain([uiConfig, 'optionalAccess',
|
|
3516
|
-
const logoUrl = _nullishCoalesce(_optionalChain([branding, 'optionalAccess',
|
|
3517
|
-
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess',
|
|
3528
|
+
const showLogo = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _95 => _95.showLogo]), () => ( false));
|
|
3529
|
+
const showStepper = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _96 => _96.showStepper]), () => ( false));
|
|
3530
|
+
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _97 => _97.showBackButton]), () => ( true));
|
|
3531
|
+
const balance = _optionalChain([uiConfig, 'optionalAccess', _98 => _98.balance]);
|
|
3532
|
+
const logoUrl = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _99 => _99.logoUrl]), () => ( "https://github.com/rhinestonewtf.png"));
|
|
3533
|
+
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _100 => _100.title]), () => ( "Deposit"));
|
|
3518
3534
|
const canGoBack = currentStepIndex > 0 && currentStepIndex < 4 && backHandlerRef.current !== void 0;
|
|
3519
3535
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3520
|
-
|
|
3536
|
+
_chunk7HJ7IBRHcjs.Modal,
|
|
3521
3537
|
{
|
|
3522
3538
|
isOpen,
|
|
3523
3539
|
onClose,
|
|
@@ -3578,7 +3594,7 @@ function DepositModalInner({
|
|
|
3578
3594
|
balance.title,
|
|
3579
3595
|
":"
|
|
3580
3596
|
] }),
|
|
3581
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ?
|
|
3597
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ? _chunk7HJ7IBRHcjs.currencyFormatter.format(totalBalanceUsd) : null))) })
|
|
3582
3598
|
] })
|
|
3583
3599
|
] }),
|
|
3584
3600
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3631,6 +3647,7 @@ function DepositModalInner({
|
|
|
3631
3647
|
onRequestConnect,
|
|
3632
3648
|
connectButtonLabel,
|
|
3633
3649
|
uiConfig,
|
|
3650
|
+
allowedRoutes,
|
|
3634
3651
|
onStepChange: handleStepChange,
|
|
3635
3652
|
onTotalBalanceChange: handleTotalBalanceChange,
|
|
3636
3653
|
onClose,
|