@rhinestone/deposit-modal 0.1.65 → 0.1.66
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-RXIVPSEE.mjs} +2 -2
- package/dist/{DepositModalReown-6ZMLUWWD.cjs → DepositModalReown-WFXQKZDH.cjs} +3 -3
- package/dist/{WithdrawModalReown-HVBMAUPM.mjs → WithdrawModalReown-MME7VSKX.mjs} +2 -2
- package/dist/{WithdrawModalReown-WJ5SHBV4.cjs → WithdrawModalReown-PXS44GZO.cjs} +3 -3
- package/dist/{chunk-OWV4KVBM.cjs → chunk-5GN4QU67.cjs} +549 -146
- package/dist/{chunk-MGV75YLV.cjs → chunk-75LRORPO.cjs} +37 -37
- package/dist/{chunk-RKRF7ANK.mjs → chunk-CULXRW6U.mjs} +2 -2
- package/dist/{chunk-GAHX5RAT.mjs → chunk-FWGLRTWF.mjs} +42 -0
- package/dist/{chunk-IYZGLNY6.mjs → chunk-JDO7QPPH.mjs} +463 -60
- package/dist/{chunk-4CZ7W3RS.cjs → chunk-JZWCK7C3.cjs} +108 -66
- 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/styles.css +432 -1
- package/dist/{types-7IoN8k-P.d.cts → types-DjaZ9sa8.d.cts} +1 -0
- package/dist/{types-BLIqLF0c.d.ts → types-ymKENnUK.d.ts} +1 -0
- 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
|
@@ -26,7 +26,11 @@
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
var _chunkJZWCK7C3cjs = require('./chunk-JZWCK7C3.cjs');
|
|
32
|
+
|
|
33
|
+
|
|
30
34
|
|
|
31
35
|
|
|
32
36
|
|
|
@@ -62,15 +66,15 @@ var _react = require('react');
|
|
|
62
66
|
|
|
63
67
|
var _jsxruntime = require('react/jsx-runtime');
|
|
64
68
|
async function resolveSessionOwner(eoaAddress) {
|
|
65
|
-
const localOwner =
|
|
69
|
+
const localOwner = _chunkJZWCK7C3cjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
66
70
|
if (localOwner) {
|
|
67
71
|
return {
|
|
68
|
-
account:
|
|
72
|
+
account: _chunkJZWCK7C3cjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
69
73
|
address: localOwner.address
|
|
70
74
|
};
|
|
71
75
|
}
|
|
72
|
-
const created =
|
|
73
|
-
|
|
76
|
+
const created = _chunkJZWCK7C3cjs.createSessionOwnerKey.call(void 0, );
|
|
77
|
+
_chunkJZWCK7C3cjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
74
78
|
return {
|
|
75
79
|
account: created.account,
|
|
76
80
|
address: created.address
|
|
@@ -107,7 +111,7 @@ function SetupStep({
|
|
|
107
111
|
const setup = await service.setupAccount({
|
|
108
112
|
ownerAddress: address,
|
|
109
113
|
sessionOwnerAddress: sessionOwner.address,
|
|
110
|
-
targetChain:
|
|
114
|
+
targetChain: _chunkJZWCK7C3cjs.toEvmCaip2.call(void 0, targetChain),
|
|
111
115
|
targetToken,
|
|
112
116
|
recipient,
|
|
113
117
|
postBridgeActions,
|
|
@@ -139,7 +143,7 @@ function SetupStep({
|
|
|
139
143
|
primaryType: typedData.primaryType,
|
|
140
144
|
message: typedData.message
|
|
141
145
|
});
|
|
142
|
-
const sessionDetails =
|
|
146
|
+
const sessionDetails = _chunkJZWCK7C3cjs.buildSessionDetails.call(void 0, setup.sessionDetailsUnsigned, signature);
|
|
143
147
|
setState({ type: "registering" });
|
|
144
148
|
const registerResult = await service.registerAccount({
|
|
145
149
|
address: smartAccount,
|
|
@@ -151,7 +155,7 @@ function SetupStep({
|
|
|
151
155
|
eoaAddress: address,
|
|
152
156
|
sessionOwner: sessionOwner.address,
|
|
153
157
|
target: {
|
|
154
|
-
chain:
|
|
158
|
+
chain: _chunkJZWCK7C3cjs.toEvmCaip2.call(void 0, targetChain),
|
|
155
159
|
token: targetToken,
|
|
156
160
|
...recipient && { recipient },
|
|
157
161
|
..._optionalChain([postBridgeActions, 'optionalAccess', _2 => _2.length]) && { postBridgeActions }
|
|
@@ -216,7 +220,7 @@ function SetupStep({
|
|
|
216
220
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
217
221
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", children: [
|
|
218
222
|
isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
219
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
223
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJZWCK7C3cjs.Spinner, { className: "rs-spinner--lg rs-text-accent" }),
|
|
220
224
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-text", children: [
|
|
221
225
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-title", children: renderStateMessage() }),
|
|
222
226
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-subtitle", children: "This may take a moment" })
|
|
@@ -253,7 +257,7 @@ function SetupStep({
|
|
|
253
257
|
] })
|
|
254
258
|
] })
|
|
255
259
|
] }),
|
|
256
|
-
isError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
260
|
+
isError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJZWCK7C3cjs.Button, { onClick: handleRetry, variant: "default", fullWidth: true, children: "Try Again" }) })
|
|
257
261
|
] });
|
|
258
262
|
}
|
|
259
263
|
|
|
@@ -278,7 +282,7 @@ function AssetSelectStep({
|
|
|
278
282
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
279
283
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
280
284
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
281
|
-
return
|
|
285
|
+
return _chunkJZWCK7C3cjs.getAssetId.call(void 0, {
|
|
282
286
|
chainId: defaultSourceChain,
|
|
283
287
|
token: defaultSourceToken
|
|
284
288
|
});
|
|
@@ -295,7 +299,7 @@ function AssetSelectStep({
|
|
|
295
299
|
try {
|
|
296
300
|
const portfolio = await service.fetchPortfolio(address);
|
|
297
301
|
if (!active) return;
|
|
298
|
-
const portfolioAssets =
|
|
302
|
+
const portfolioAssets = _chunkJZWCK7C3cjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
299
303
|
setAssets(portfolioAssets);
|
|
300
304
|
const hasNative = portfolioAssets.some(
|
|
301
305
|
(asset) => asset.token.toLowerCase() === _chunkR6U6BHCVcjs.NATIVE_TOKEN_ADDRESS
|
|
@@ -376,7 +380,7 @@ function AssetSelectStep({
|
|
|
376
380
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
377
381
|
const numeric = Number(raw);
|
|
378
382
|
if (!Number.isFinite(numeric)) return raw;
|
|
379
|
-
return
|
|
383
|
+
return _chunkJZWCK7C3cjs.tokenFormatter.format(numeric);
|
|
380
384
|
} catch (e3) {
|
|
381
385
|
return asset.balance;
|
|
382
386
|
}
|
|
@@ -390,7 +394,7 @@ function AssetSelectStep({
|
|
|
390
394
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
391
395
|
children: [
|
|
392
396
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
393
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
397
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJZWCK7C3cjs.Spinner, { className: "rs-text-tertiary" }),
|
|
394
398
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
395
399
|
] }),
|
|
396
400
|
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 }) }),
|
|
@@ -480,7 +484,7 @@ function AssetSelectStep({
|
|
|
480
484
|
] })
|
|
481
485
|
] })
|
|
482
486
|
] }),
|
|
483
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ?
|
|
487
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunkJZWCK7C3cjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
484
488
|
]
|
|
485
489
|
},
|
|
486
490
|
asset.id
|
|
@@ -490,7 +494,7 @@ function AssetSelectStep({
|
|
|
490
494
|
}
|
|
491
495
|
),
|
|
492
496
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
493
|
-
|
|
497
|
+
_chunkJZWCK7C3cjs.Button,
|
|
494
498
|
{
|
|
495
499
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
496
500
|
disabled: !selectedAsset,
|
|
@@ -498,7 +502,7 @@ function AssetSelectStep({
|
|
|
498
502
|
children: "Continue"
|
|
499
503
|
}
|
|
500
504
|
) }),
|
|
501
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
505
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJZWCK7C3cjs.PoweredBy, {})
|
|
502
506
|
] });
|
|
503
507
|
}
|
|
504
508
|
async function fetchNativeAssets(address, publicClient, existing) {
|
|
@@ -506,7 +510,7 @@ async function fetchNativeAssets(address, publicClient, existing) {
|
|
|
506
510
|
const connectedChainId = _optionalChain([publicClient, 'access', _11 => _11.chain, 'optionalAccess', _12 => _12.id]);
|
|
507
511
|
if (!connectedChainId) return [];
|
|
508
512
|
if (!_chunkR6U6BHCVcjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
|
|
509
|
-
const id =
|
|
513
|
+
const id = _chunkJZWCK7C3cjs.getAssetId.call(void 0, {
|
|
510
514
|
chainId: connectedChainId,
|
|
511
515
|
token: _chunkR6U6BHCVcjs.NATIVE_TOKEN_ADDRESS
|
|
512
516
|
});
|
|
@@ -593,7 +597,7 @@ function AmountStep({
|
|
|
593
597
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
594
598
|
if (!balanceTarget || !publicClient) return;
|
|
595
599
|
try {
|
|
596
|
-
const bal =
|
|
600
|
+
const bal = _chunkJZWCK7C3cjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
597
601
|
address: asset.token,
|
|
598
602
|
abi: _viem.erc20Abi,
|
|
599
603
|
functionName: "balanceOf",
|
|
@@ -619,7 +623,7 @@ function AmountStep({
|
|
|
619
623
|
setIsSwitching(true);
|
|
620
624
|
switchChain(asset.chainId).catch((err) => {
|
|
621
625
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
622
|
-
setError(
|
|
626
|
+
setError(_chunkJZWCK7C3cjs.formatUserError.call(void 0, raw));
|
|
623
627
|
}).finally(() => {
|
|
624
628
|
setIsSwitching(false);
|
|
625
629
|
});
|
|
@@ -655,7 +659,7 @@ function AmountStep({
|
|
|
655
659
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
656
660
|
const numeric = Number(raw);
|
|
657
661
|
if (!Number.isFinite(numeric)) return raw;
|
|
658
|
-
return
|
|
662
|
+
return _chunkJZWCK7C3cjs.tokenFormatter.format(numeric);
|
|
659
663
|
} catch (e8) {
|
|
660
664
|
return "...";
|
|
661
665
|
}
|
|
@@ -699,7 +703,7 @@ function AmountStep({
|
|
|
699
703
|
const usdValue = numericAmount;
|
|
700
704
|
if (_optionalChain([uiConfig, 'optionalAccess', _17 => _17.maxDepositUsd]) && usdValue > uiConfig.maxDepositUsd) {
|
|
701
705
|
setError(
|
|
702
|
-
`Maximum deposit is ${
|
|
706
|
+
`Maximum deposit is ${_chunkJZWCK7C3cjs.currencyFormatter.format(uiConfig.maxDepositUsd)}`
|
|
703
707
|
);
|
|
704
708
|
return;
|
|
705
709
|
}
|
|
@@ -754,7 +758,7 @@ function AmountStep({
|
|
|
754
758
|
hasPricing && balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { style: { color: "var(--rs-muted-foreground)" }, children: [
|
|
755
759
|
" ",
|
|
756
760
|
"(",
|
|
757
|
-
|
|
761
|
+
_chunkJZWCK7C3cjs.currencyFormatter.format(balanceUsd),
|
|
758
762
|
")"
|
|
759
763
|
] })
|
|
760
764
|
] }) })
|
|
@@ -891,7 +895,7 @@ function AmountStep({
|
|
|
891
895
|
)
|
|
892
896
|
] }),
|
|
893
897
|
_optionalChain([uiConfig, 'optionalAccess', _20 => _20.minDepositUsd]) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-minimum", children: [
|
|
894
|
-
|
|
898
|
+
_chunkJZWCK7C3cjs.currencyFormatter.format(uiConfig.minDepositUsd),
|
|
895
899
|
" minimum deposit"
|
|
896
900
|
] }),
|
|
897
901
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", children: [
|
|
@@ -917,7 +921,7 @@ function AmountStep({
|
|
|
917
921
|
] })
|
|
918
922
|
] }),
|
|
919
923
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
920
|
-
|
|
924
|
+
_chunkJZWCK7C3cjs.Button,
|
|
921
925
|
{
|
|
922
926
|
onClick: handleContinue,
|
|
923
927
|
fullWidth: true,
|
|
@@ -925,7 +929,7 @@ function AmountStep({
|
|
|
925
929
|
children: _optionalChain([uiConfig, 'optionalAccess', _21 => _21.minDepositUsd]) && parseFloat(amount) > 0 && parseFloat(amount) < uiConfig.minDepositUsd ? "Update order" : "Continue"
|
|
926
930
|
}
|
|
927
931
|
) }),
|
|
928
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
932
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJZWCK7C3cjs.PoweredBy, {})
|
|
929
933
|
] });
|
|
930
934
|
}
|
|
931
935
|
|
|
@@ -975,7 +979,7 @@ function ConfirmStep({
|
|
|
975
979
|
setIsSwitching(true);
|
|
976
980
|
switchChain(asset.chainId).catch((err) => {
|
|
977
981
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
978
|
-
setError(
|
|
982
|
+
setError(_chunkJZWCK7C3cjs.formatUserError.call(void 0, raw));
|
|
979
983
|
}).finally(() => {
|
|
980
984
|
setIsSwitching(false);
|
|
981
985
|
});
|
|
@@ -1018,7 +1022,7 @@ function ConfirmStep({
|
|
|
1018
1022
|
throw new Error("Wallet not properly connected");
|
|
1019
1023
|
}
|
|
1020
1024
|
const transferTo = sameRoute ? recipient : smartAccount;
|
|
1021
|
-
const hash =
|
|
1025
|
+
const hash = _chunkJZWCK7C3cjs.isNativeAsset.call(void 0, asset) ? await walletClient.sendTransaction({
|
|
1022
1026
|
account,
|
|
1023
1027
|
chain,
|
|
1024
1028
|
to: transferTo,
|
|
@@ -1035,7 +1039,7 @@ function ConfirmStep({
|
|
|
1035
1039
|
onConfirm(hash, asset.chainId, amountUnits.toString(), asset.token);
|
|
1036
1040
|
} catch (err) {
|
|
1037
1041
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
1038
|
-
const message =
|
|
1042
|
+
const message = _chunkJZWCK7C3cjs.formatUserError.call(void 0, raw);
|
|
1039
1043
|
setError(message);
|
|
1040
1044
|
_optionalChain([onError, 'optionalCall', _25 => _25(message, "TRANSFER_ERROR")]);
|
|
1041
1045
|
} finally {
|
|
@@ -1164,7 +1168,7 @@ function ConfirmStep({
|
|
|
1164
1168
|
] })
|
|
1165
1169
|
] }),
|
|
1166
1170
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1167
|
-
|
|
1171
|
+
_chunkJZWCK7C3cjs.Button,
|
|
1168
1172
|
{
|
|
1169
1173
|
onClick: handleConfirm,
|
|
1170
1174
|
loading: isSubmitting,
|
|
@@ -1173,7 +1177,7 @@ function ConfirmStep({
|
|
|
1173
1177
|
children: "Confirm Order"
|
|
1174
1178
|
}
|
|
1175
1179
|
) }),
|
|
1176
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1180
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJZWCK7C3cjs.PoweredBy, {})
|
|
1177
1181
|
] });
|
|
1178
1182
|
}
|
|
1179
1183
|
|
|
@@ -1585,10 +1589,10 @@ function DepositAddressStep({
|
|
|
1585
1589
|
const status = await service.fetchLatestStatus(smartAccount);
|
|
1586
1590
|
if (cancelled || depositHandledRef.current) return;
|
|
1587
1591
|
const event = status.lastEvent;
|
|
1588
|
-
const eventTxHash =
|
|
1592
|
+
const eventTxHash = _chunkJZWCK7C3cjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkJZWCK7C3cjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
1589
1593
|
if (baselineTxHash === void 0) {
|
|
1590
1594
|
baselineTxHash = eventTxHash;
|
|
1591
|
-
} else if (eventTxHash && (!baselineTxHash || !
|
|
1595
|
+
} else if (eventTxHash && (!baselineTxHash || !_chunkJZWCK7C3cjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHash))) {
|
|
1592
1596
|
const details = getDepositEventDetails(event);
|
|
1593
1597
|
const fallback = sourceSelectionRef.current;
|
|
1594
1598
|
const chainId = _nullishCoalesce(details.chainId, () => ( fallback.chainId));
|
|
@@ -1811,7 +1815,7 @@ function DepositAddressStep({
|
|
|
1811
1815
|
] }),
|
|
1812
1816
|
pollingError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-error", children: pollingError })
|
|
1813
1817
|
] }) }),
|
|
1814
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1818
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJZWCK7C3cjs.PoweredBy, {})
|
|
1815
1819
|
] });
|
|
1816
1820
|
}
|
|
1817
1821
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -1842,7 +1846,7 @@ function SolanaTokenSelectStep({
|
|
|
1842
1846
|
setError(null);
|
|
1843
1847
|
const portfolioBySymbol = {};
|
|
1844
1848
|
try {
|
|
1845
|
-
|
|
1849
|
+
_chunkJZWCK7C3cjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
|
|
1846
1850
|
solanaAddress
|
|
1847
1851
|
});
|
|
1848
1852
|
const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
|
|
@@ -1865,12 +1869,12 @@ function SolanaTokenSelectStep({
|
|
|
1865
1869
|
};
|
|
1866
1870
|
}
|
|
1867
1871
|
}
|
|
1868
|
-
|
|
1872
|
+
_chunkJZWCK7C3cjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
|
|
1869
1873
|
symbols: Object.keys(portfolioBySymbol)
|
|
1870
1874
|
});
|
|
1871
1875
|
} catch (err) {
|
|
1872
1876
|
if (!active) return;
|
|
1873
|
-
|
|
1877
|
+
_chunkJZWCK7C3cjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
|
|
1874
1878
|
solanaAddress
|
|
1875
1879
|
});
|
|
1876
1880
|
setError(
|
|
@@ -1924,7 +1928,7 @@ function SolanaTokenSelectStep({
|
|
|
1924
1928
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
1925
1929
|
children: [
|
|
1926
1930
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
1927
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1931
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJZWCK7C3cjs.Spinner, { className: "rs-text-tertiary" }),
|
|
1928
1932
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
1929
1933
|
] }),
|
|
1930
1934
|
!loading && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
@@ -1961,7 +1965,7 @@ function SolanaTokenSelectStep({
|
|
|
1961
1965
|
try {
|
|
1962
1966
|
const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
|
|
1963
1967
|
const numeric = Number(raw);
|
|
1964
|
-
formattedBalance = Number.isFinite(numeric) ?
|
|
1968
|
+
formattedBalance = Number.isFinite(numeric) ? _chunkJZWCK7C3cjs.tokenFormatter.format(numeric) : raw;
|
|
1965
1969
|
} catch (e14) {
|
|
1966
1970
|
formattedBalance = "...";
|
|
1967
1971
|
}
|
|
@@ -2005,7 +2009,7 @@ function SolanaTokenSelectStep({
|
|
|
2005
2009
|
] })
|
|
2006
2010
|
] })
|
|
2007
2011
|
] }),
|
|
2008
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ?
|
|
2012
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunkJZWCK7C3cjs.currencyFormatter.format(entry.balanceUsd) : `${formattedBalance} ${entry.token.symbol}` })
|
|
2009
2013
|
]
|
|
2010
2014
|
},
|
|
2011
2015
|
entry.token.symbol
|
|
@@ -2015,7 +2019,7 @@ function SolanaTokenSelectStep({
|
|
|
2015
2019
|
}
|
|
2016
2020
|
),
|
|
2017
2021
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2018
|
-
|
|
2022
|
+
_chunkJZWCK7C3cjs.Button,
|
|
2019
2023
|
{
|
|
2020
2024
|
onClick: () => selectedEntry && onContinue(
|
|
2021
2025
|
selectedEntry.token,
|
|
@@ -2027,7 +2031,7 @@ function SolanaTokenSelectStep({
|
|
|
2027
2031
|
children: "Continue"
|
|
2028
2032
|
}
|
|
2029
2033
|
) }),
|
|
2030
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2034
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJZWCK7C3cjs.PoweredBy, {})
|
|
2031
2035
|
] });
|
|
2032
2036
|
}
|
|
2033
2037
|
|
|
@@ -2075,7 +2079,7 @@ function SolanaAmountStep({
|
|
|
2075
2079
|
const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
|
|
2076
2080
|
const numeric = Number(raw);
|
|
2077
2081
|
if (!Number.isFinite(numeric)) return raw;
|
|
2078
|
-
return
|
|
2082
|
+
return _chunkJZWCK7C3cjs.tokenFormatter.format(numeric);
|
|
2079
2083
|
} catch (e16) {
|
|
2080
2084
|
return "...";
|
|
2081
2085
|
}
|
|
@@ -2093,7 +2097,7 @@ function SolanaAmountStep({
|
|
|
2093
2097
|
}, [balance, token.decimals, tokenPriceUsd, balanceUsd]);
|
|
2094
2098
|
const formattedBalanceUsd = _react.useMemo.call(void 0, () => {
|
|
2095
2099
|
if (computedBalanceUsd === null || computedBalanceUsd <= 0) return null;
|
|
2096
|
-
return
|
|
2100
|
+
return _chunkJZWCK7C3cjs.currencyFormatter.format(computedBalanceUsd);
|
|
2097
2101
|
}, [computedBalanceUsd]);
|
|
2098
2102
|
const spendableBalance = _react.useMemo.call(void 0, () => {
|
|
2099
2103
|
if (!isNativeSol(token)) return balance;
|
|
@@ -2118,7 +2122,7 @@ function SolanaAmountStep({
|
|
|
2118
2122
|
const factor = 10 ** maxDecimals;
|
|
2119
2123
|
const truncated = Math.floor(value * factor) / factor;
|
|
2120
2124
|
const formatted = truncated.toFixed(maxDecimals).replace(/\.?0+$/, "");
|
|
2121
|
-
|
|
2125
|
+
_chunkJZWCK7C3cjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
|
|
2122
2126
|
percentage,
|
|
2123
2127
|
symbol: token.symbol,
|
|
2124
2128
|
formatted
|
|
@@ -2132,7 +2136,7 @@ function SolanaAmountStep({
|
|
|
2132
2136
|
const handleContinue = () => {
|
|
2133
2137
|
const numericAmount = parseFloat(amount);
|
|
2134
2138
|
if (isNaN(numericAmount) || numericAmount <= 0) {
|
|
2135
|
-
|
|
2139
|
+
_chunkJZWCK7C3cjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2136
2140
|
amount,
|
|
2137
2141
|
reason: "nan-or-non-positive"
|
|
2138
2142
|
});
|
|
@@ -2144,7 +2148,7 @@ function SolanaAmountStep({
|
|
|
2144
2148
|
const usdValue = numericAmount;
|
|
2145
2149
|
if (_optionalChain([uiConfig, 'optionalAccess', _48 => _48.maxDepositUsd]) && usdValue > uiConfig.maxDepositUsd) {
|
|
2146
2150
|
setError(
|
|
2147
|
-
`Maximum deposit is ${
|
|
2151
|
+
`Maximum deposit is ${_chunkJZWCK7C3cjs.currencyFormatter.format(uiConfig.maxDepositUsd)}`
|
|
2148
2152
|
);
|
|
2149
2153
|
return;
|
|
2150
2154
|
}
|
|
@@ -2159,7 +2163,7 @@ function SolanaAmountStep({
|
|
|
2159
2163
|
try {
|
|
2160
2164
|
amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
|
|
2161
2165
|
} catch (e20) {
|
|
2162
|
-
|
|
2166
|
+
_chunkJZWCK7C3cjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2163
2167
|
amount,
|
|
2164
2168
|
sourceAmount: sourceAmountStr,
|
|
2165
2169
|
reason: "parse-units-failed"
|
|
@@ -2169,7 +2173,7 @@ function SolanaAmountStep({
|
|
|
2169
2173
|
}
|
|
2170
2174
|
if (amountInUnits > spendableBalance) {
|
|
2171
2175
|
const isReserveIssue = isNativeSol(token) && amountInUnits <= balance;
|
|
2172
|
-
|
|
2176
|
+
_chunkJZWCK7C3cjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2173
2177
|
amount,
|
|
2174
2178
|
balance: balance.toString(),
|
|
2175
2179
|
spendableBalance: spendableBalance.toString(),
|
|
@@ -2181,7 +2185,7 @@ function SolanaAmountStep({
|
|
|
2181
2185
|
);
|
|
2182
2186
|
return;
|
|
2183
2187
|
}
|
|
2184
|
-
|
|
2188
|
+
_chunkJZWCK7C3cjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
|
|
2185
2189
|
symbol: token.symbol,
|
|
2186
2190
|
inputAmountUsd: amount,
|
|
2187
2191
|
sourceAmount: sourceAmountStr,
|
|
@@ -2250,7 +2254,7 @@ function SolanaAmountStep({
|
|
|
2250
2254
|
)
|
|
2251
2255
|
] }),
|
|
2252
2256
|
_optionalChain([uiConfig, 'optionalAccess', _50 => _50.minDepositUsd]) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-minimum", children: [
|
|
2253
|
-
|
|
2257
|
+
_chunkJZWCK7C3cjs.currencyFormatter.format(uiConfig.minDepositUsd),
|
|
2254
2258
|
" minimum deposit"
|
|
2255
2259
|
] }),
|
|
2256
2260
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", children: [
|
|
@@ -2276,7 +2280,7 @@ function SolanaAmountStep({
|
|
|
2276
2280
|
] })
|
|
2277
2281
|
] }),
|
|
2278
2282
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2279
|
-
|
|
2283
|
+
_chunkJZWCK7C3cjs.Button,
|
|
2280
2284
|
{
|
|
2281
2285
|
onClick: handleContinue,
|
|
2282
2286
|
fullWidth: true,
|
|
@@ -2284,7 +2288,7 @@ function SolanaAmountStep({
|
|
|
2284
2288
|
children: _optionalChain([uiConfig, 'optionalAccess', _51 => _51.minDepositUsd]) && parseFloat(amount) > 0 && parseFloat(amount) < uiConfig.minDepositUsd ? "Update order" : "Continue"
|
|
2285
2289
|
}
|
|
2286
2290
|
) }),
|
|
2287
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2291
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJZWCK7C3cjs.PoweredBy, {})
|
|
2288
2292
|
] });
|
|
2289
2293
|
}
|
|
2290
2294
|
|
|
@@ -2328,7 +2332,7 @@ function SolanaConfirmStep({
|
|
|
2328
2332
|
const receiveAmount = isSameToken ? formattedReceiveAmount : `~ ${formattedReceiveAmount}`;
|
|
2329
2333
|
const handleConfirm = async () => {
|
|
2330
2334
|
if (!solanaProvider) {
|
|
2331
|
-
|
|
2335
|
+
_chunkJZWCK7C3cjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
2332
2336
|
reason: "missing-provider"
|
|
2333
2337
|
});
|
|
2334
2338
|
setError("Solana wallet not connected");
|
|
@@ -2336,7 +2340,7 @@ function SolanaConfirmStep({
|
|
|
2336
2340
|
}
|
|
2337
2341
|
const parsedAmount = parseFloat(sourceAmount);
|
|
2338
2342
|
if (isNaN(parsedAmount) || parsedAmount <= 0) {
|
|
2339
|
-
|
|
2343
|
+
_chunkJZWCK7C3cjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
2340
2344
|
reason: "invalid-amount",
|
|
2341
2345
|
sourceAmount
|
|
2342
2346
|
});
|
|
@@ -2345,7 +2349,7 @@ function SolanaConfirmStep({
|
|
|
2345
2349
|
}
|
|
2346
2350
|
setError(null);
|
|
2347
2351
|
setIsSubmitting(true);
|
|
2348
|
-
|
|
2352
|
+
_chunkJZWCK7C3cjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
|
|
2349
2353
|
smartAccount,
|
|
2350
2354
|
solanaAddress,
|
|
2351
2355
|
solanaDepositAddress,
|
|
@@ -2355,7 +2359,7 @@ function SolanaConfirmStep({
|
|
|
2355
2359
|
});
|
|
2356
2360
|
try {
|
|
2357
2361
|
const check = await service.checkAccount(smartAccount);
|
|
2358
|
-
|
|
2362
|
+
_chunkJZWCK7C3cjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
|
|
2359
2363
|
smartAccount,
|
|
2360
2364
|
isRegistered: check.isRegistered,
|
|
2361
2365
|
targetChain: check.targetChain,
|
|
@@ -2368,7 +2372,7 @@ function SolanaConfirmStep({
|
|
|
2368
2372
|
}
|
|
2369
2373
|
const connection = getSolanaConnection();
|
|
2370
2374
|
const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
|
|
2371
|
-
|
|
2375
|
+
_chunkJZWCK7C3cjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
|
|
2372
2376
|
token: token.symbol,
|
|
2373
2377
|
sourceAmount,
|
|
2374
2378
|
amountUnits: amountUnits.toString()
|
|
@@ -2385,7 +2389,7 @@ function SolanaConfirmStep({
|
|
|
2385
2389
|
token.mint,
|
|
2386
2390
|
amountUnits
|
|
2387
2391
|
);
|
|
2388
|
-
|
|
2392
|
+
_chunkJZWCK7C3cjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
2389
2393
|
token: token.symbol,
|
|
2390
2394
|
instructionCount: transaction.instructions.length,
|
|
2391
2395
|
feePayer: _optionalChain([transaction, 'access', _52 => _52.feePayer, 'optionalAccess', _53 => _53.toBase58, 'call', _54 => _54()]),
|
|
@@ -2396,15 +2400,15 @@ function SolanaConfirmStep({
|
|
|
2396
2400
|
connection,
|
|
2397
2401
|
transaction
|
|
2398
2402
|
);
|
|
2399
|
-
|
|
2403
|
+
_chunkJZWCK7C3cjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
|
|
2400
2404
|
txHash,
|
|
2401
2405
|
amountUnits: amountUnits.toString()
|
|
2402
2406
|
});
|
|
2403
2407
|
onConfirm(txHash, amountUnits.toString());
|
|
2404
2408
|
} catch (err) {
|
|
2405
2409
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
2406
|
-
const message =
|
|
2407
|
-
|
|
2410
|
+
const message = _chunkJZWCK7C3cjs.formatUserError.call(void 0, raw);
|
|
2411
|
+
_chunkJZWCK7C3cjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
|
|
2408
2412
|
smartAccount,
|
|
2409
2413
|
token: token.symbol,
|
|
2410
2414
|
sourceAmount
|
|
@@ -2537,7 +2541,7 @@ function SolanaConfirmStep({
|
|
|
2537
2541
|
] })
|
|
2538
2542
|
] }),
|
|
2539
2543
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2540
|
-
|
|
2544
|
+
_chunkJZWCK7C3cjs.Button,
|
|
2541
2545
|
{
|
|
2542
2546
|
onClick: handleConfirm,
|
|
2543
2547
|
loading: isSubmitting,
|
|
@@ -2546,7 +2550,7 @@ function SolanaConfirmStep({
|
|
|
2546
2550
|
children: "Confirm Order"
|
|
2547
2551
|
}
|
|
2548
2552
|
) }),
|
|
2549
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2553
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJZWCK7C3cjs.PoweredBy, {})
|
|
2550
2554
|
] });
|
|
2551
2555
|
}
|
|
2552
2556
|
|
|
@@ -2586,6 +2590,7 @@ function DepositFlow({
|
|
|
2586
2590
|
allowedRoutes,
|
|
2587
2591
|
onStepChange,
|
|
2588
2592
|
onTotalBalanceChange,
|
|
2593
|
+
onSmartAccountChange,
|
|
2589
2594
|
onClose,
|
|
2590
2595
|
onConnected,
|
|
2591
2596
|
onDepositSubmitted,
|
|
@@ -2595,9 +2600,10 @@ function DepositFlow({
|
|
|
2595
2600
|
onError,
|
|
2596
2601
|
debug
|
|
2597
2602
|
}) {
|
|
2598
|
-
const onStepChangeRef =
|
|
2599
|
-
const onTotalBalanceChangeRef =
|
|
2600
|
-
const
|
|
2603
|
+
const onStepChangeRef = _chunkJZWCK7C3cjs.useLatestRef.call(void 0, onStepChange);
|
|
2604
|
+
const onTotalBalanceChangeRef = _chunkJZWCK7C3cjs.useLatestRef.call(void 0, onTotalBalanceChange);
|
|
2605
|
+
const onSmartAccountChangeRef = _chunkJZWCK7C3cjs.useLatestRef.call(void 0, onSmartAccountChange);
|
|
2606
|
+
const onEventRef = _chunkJZWCK7C3cjs.useLatestRef.call(void 0, onEvent);
|
|
2601
2607
|
const hasInitialReownSession = Boolean(
|
|
2602
2608
|
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _56 => _56.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _57 => _57.address]) : _optionalChain([reownWallet, 'optionalAccess', _58 => _58.address])
|
|
2603
2609
|
);
|
|
@@ -2617,13 +2623,13 @@ function DepositFlow({
|
|
|
2617
2623
|
flowModeRef.current = flowMode;
|
|
2618
2624
|
const logFlow = _react.useCallback.call(void 0,
|
|
2619
2625
|
(message, data) => {
|
|
2620
|
-
|
|
2626
|
+
_chunkJZWCK7C3cjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
|
|
2621
2627
|
},
|
|
2622
2628
|
[debug]
|
|
2623
2629
|
);
|
|
2624
2630
|
const logFlowError = _react.useCallback.call(void 0,
|
|
2625
2631
|
(message, error, data) => {
|
|
2626
|
-
|
|
2632
|
+
_chunkJZWCK7C3cjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
|
|
2627
2633
|
},
|
|
2628
2634
|
[debug]
|
|
2629
2635
|
);
|
|
@@ -2745,7 +2751,7 @@ function DepositFlow({
|
|
|
2745
2751
|
return {
|
|
2746
2752
|
ownerAddress: dappAddress,
|
|
2747
2753
|
walletClient: void 0,
|
|
2748
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
2754
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkJZWCK7C3cjs.getPublicClient.call(void 0, targetChain))),
|
|
2749
2755
|
switchChain: void 0
|
|
2750
2756
|
};
|
|
2751
2757
|
}
|
|
@@ -2754,7 +2760,7 @@ function DepositFlow({
|
|
|
2754
2760
|
return {
|
|
2755
2761
|
ownerAddress: dappWalletClient.account.address,
|
|
2756
2762
|
walletClient: dappWalletClient,
|
|
2757
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
2763
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkJZWCK7C3cjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
2758
2764
|
switchChain: dappSwitchChain
|
|
2759
2765
|
};
|
|
2760
2766
|
}
|
|
@@ -2768,7 +2774,7 @@ function DepositFlow({
|
|
|
2768
2774
|
return {
|
|
2769
2775
|
ownerAddress: dappAddress,
|
|
2770
2776
|
walletClient: void 0,
|
|
2771
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
2777
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkJZWCK7C3cjs.getPublicClient.call(void 0, targetChain))),
|
|
2772
2778
|
switchChain: void 0
|
|
2773
2779
|
};
|
|
2774
2780
|
}
|
|
@@ -2777,7 +2783,7 @@ function DepositFlow({
|
|
|
2777
2783
|
return {
|
|
2778
2784
|
ownerAddress: dappWalletClient.account.address,
|
|
2779
2785
|
walletClient: dappWalletClient,
|
|
2780
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
2786
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkJZWCK7C3cjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
2781
2787
|
switchChain: dappSwitchChain
|
|
2782
2788
|
};
|
|
2783
2789
|
}
|
|
@@ -2785,7 +2791,7 @@ function DepositFlow({
|
|
|
2785
2791
|
return {
|
|
2786
2792
|
ownerAddress: reownWallet.address,
|
|
2787
2793
|
walletClient: reownWallet.walletClient,
|
|
2788
|
-
publicClient: _nullishCoalesce(reownWallet.publicClient, () => (
|
|
2794
|
+
publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunkJZWCK7C3cjs.getPublicClient.call(void 0, targetChain))),
|
|
2789
2795
|
switchChain: reownWallet.switchChain
|
|
2790
2796
|
};
|
|
2791
2797
|
}
|
|
@@ -2823,7 +2829,7 @@ function DepositFlow({
|
|
|
2823
2829
|
return {
|
|
2824
2830
|
ownerAddress: dappAddress,
|
|
2825
2831
|
walletClient: void 0,
|
|
2826
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
2832
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkJZWCK7C3cjs.getPublicClient.call(void 0, targetChain))),
|
|
2827
2833
|
switchChain: void 0
|
|
2828
2834
|
};
|
|
2829
2835
|
}
|
|
@@ -3001,12 +3007,13 @@ function DepositFlow({
|
|
|
3001
3007
|
setStep({ type: "setup" });
|
|
3002
3008
|
}, []);
|
|
3003
3009
|
const handleNewDeposit = _react.useCallback.call(void 0, () => {
|
|
3010
|
+
_optionalChain([onSmartAccountChangeRef, 'access', _95 => _95.current, 'optionalCall', _96 => _96(null)]);
|
|
3004
3011
|
setFlowMode(null);
|
|
3005
3012
|
setStep({ type: "setup" });
|
|
3006
3013
|
setIsConnectSelectionConfirmed(false);
|
|
3007
3014
|
setSelectedWalletId(null);
|
|
3008
3015
|
hasNavigatedBackRef.current = false;
|
|
3009
|
-
}, []);
|
|
3016
|
+
}, [onSmartAccountChangeRef]);
|
|
3010
3017
|
const handleSetupComplete = _react.useCallback.call(void 0,
|
|
3011
3018
|
(smartAccount, solanaDepositAddress) => {
|
|
3012
3019
|
logFlow("setup:complete", {
|
|
@@ -3014,6 +3021,7 @@ function DepositFlow({
|
|
|
3014
3021
|
hasSolanaDepositAddress: Boolean(solanaDepositAddress),
|
|
3015
3022
|
flowMode: isDepositAddressMode ? "deposit-address" : isSolanaWalletMode ? "solana-wallet" : "wallet"
|
|
3016
3023
|
});
|
|
3024
|
+
_optionalChain([onSmartAccountChangeRef, 'access', _97 => _97.current, 'optionalCall', _98 => _98(smartAccount)]);
|
|
3017
3025
|
if (isDepositAddressMode) {
|
|
3018
3026
|
setStep({
|
|
3019
3027
|
type: "deposit-address",
|
|
@@ -3028,7 +3036,7 @@ function DepositFlow({
|
|
|
3028
3036
|
solanaDepositAddress
|
|
3029
3037
|
});
|
|
3030
3038
|
} else {
|
|
3031
|
-
_optionalChain([onError, 'optionalCall',
|
|
3039
|
+
_optionalChain([onError, 'optionalCall', _99 => _99({
|
|
3032
3040
|
message: "Solana deposit address not available. Please try again.",
|
|
3033
3041
|
code: "SOLANA_SETUP_FAILED"
|
|
3034
3042
|
})]);
|
|
@@ -3037,7 +3045,7 @@ function DepositFlow({
|
|
|
3037
3045
|
setStep({ type: "select-asset", smartAccount });
|
|
3038
3046
|
}
|
|
3039
3047
|
},
|
|
3040
|
-
[isDepositAddressMode, isSolanaWalletMode, logFlow]
|
|
3048
|
+
[isDepositAddressMode, isSolanaWalletMode, logFlow, onSmartAccountChangeRef]
|
|
3041
3049
|
);
|
|
3042
3050
|
const handleDepositAddressDetected = _react.useCallback.call(void 0,
|
|
3043
3051
|
(txHash, chainId, amount, token, sourceSymbol, sourceDecimals) => {
|
|
@@ -3063,7 +3071,7 @@ function DepositFlow({
|
|
|
3063
3071
|
directTransfer
|
|
3064
3072
|
};
|
|
3065
3073
|
});
|
|
3066
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
3074
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _100 => _100({ txHash, sourceChain: chainId, amount })]);
|
|
3067
3075
|
},
|
|
3068
3076
|
[onDepositSubmitted, targetChain, targetToken]
|
|
3069
3077
|
);
|
|
@@ -3135,7 +3143,7 @@ function DepositFlow({
|
|
|
3135
3143
|
sourceDecimals: prev.token.decimals
|
|
3136
3144
|
};
|
|
3137
3145
|
});
|
|
3138
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
3146
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _101 => _101({
|
|
3139
3147
|
txHash,
|
|
3140
3148
|
sourceChain: "solana",
|
|
3141
3149
|
amount: amountUnits
|
|
@@ -3145,13 +3153,13 @@ function DepositFlow({
|
|
|
3145
3153
|
);
|
|
3146
3154
|
const handleConnected = _react.useCallback.call(void 0,
|
|
3147
3155
|
(addr, smartAccount) => {
|
|
3148
|
-
_optionalChain([onConnected, 'optionalCall',
|
|
3156
|
+
_optionalChain([onConnected, 'optionalCall', _102 => _102({ address: addr, smartAccount })]);
|
|
3149
3157
|
},
|
|
3150
3158
|
[onConnected]
|
|
3151
3159
|
);
|
|
3152
3160
|
const handleAssetContinue = _react.useCallback.call(void 0,
|
|
3153
3161
|
(asset) => {
|
|
3154
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
3162
|
+
_optionalChain([onEvent, 'optionalCall', _103 => _103({
|
|
3155
3163
|
type: "deposit_modal_connected_wallet_select_source_cta_click",
|
|
3156
3164
|
total_balance_in_external_wallet: totalBalanceUsd,
|
|
3157
3165
|
pred_balance: totalBalanceUsd,
|
|
@@ -3216,28 +3224,28 @@ function DepositFlow({
|
|
|
3216
3224
|
);
|
|
3217
3225
|
const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
|
|
3218
3226
|
(txHash, sourceChain, amount) => {
|
|
3219
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
3227
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _104 => _104({ txHash, sourceChain, amount })]);
|
|
3220
3228
|
},
|
|
3221
3229
|
[onDepositSubmitted]
|
|
3222
3230
|
);
|
|
3223
3231
|
const handleDepositComplete = _react.useCallback.call(void 0,
|
|
3224
3232
|
(txHash, destinationTxHash, context) => {
|
|
3225
3233
|
logFlow("deposit:complete", { txHash, destinationTxHash, ...context });
|
|
3226
|
-
_optionalChain([onDepositComplete, 'optionalCall',
|
|
3234
|
+
_optionalChain([onDepositComplete, 'optionalCall', _105 => _105({ txHash, destinationTxHash, ...context })]);
|
|
3227
3235
|
},
|
|
3228
3236
|
[logFlow, onDepositComplete]
|
|
3229
3237
|
);
|
|
3230
3238
|
const handleDepositFailed = _react.useCallback.call(void 0,
|
|
3231
3239
|
(txHash, error) => {
|
|
3232
3240
|
logFlowError("deposit:failed", error, { txHash });
|
|
3233
|
-
_optionalChain([onDepositFailed, 'optionalCall',
|
|
3241
|
+
_optionalChain([onDepositFailed, 'optionalCall', _106 => _106({ txHash, error })]);
|
|
3234
3242
|
},
|
|
3235
3243
|
[logFlowError, onDepositFailed]
|
|
3236
3244
|
);
|
|
3237
3245
|
const handleError = _react.useCallback.call(void 0,
|
|
3238
3246
|
(message, code) => {
|
|
3239
3247
|
logFlowError("flow:error", message, { code });
|
|
3240
|
-
_optionalChain([onError, 'optionalCall',
|
|
3248
|
+
_optionalChain([onError, 'optionalCall', _107 => _107({ message, code })]);
|
|
3241
3249
|
},
|
|
3242
3250
|
[logFlowError, onError]
|
|
3243
3251
|
);
|
|
@@ -3294,7 +3302,7 @@ function DepositFlow({
|
|
|
3294
3302
|
if (walletId) {
|
|
3295
3303
|
const selectedOption = walletOptions.find((o) => o.id === walletId);
|
|
3296
3304
|
setSelectedWalletId(walletId);
|
|
3297
|
-
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess',
|
|
3305
|
+
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess', _108 => _108.kind]) === "solana") {
|
|
3298
3306
|
handleSelectSolanaWallet();
|
|
3299
3307
|
} else {
|
|
3300
3308
|
handleSelectProvider();
|
|
@@ -3324,7 +3332,7 @@ function DepositFlow({
|
|
|
3324
3332
|
]);
|
|
3325
3333
|
if (showConnectStep) {
|
|
3326
3334
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3327
|
-
|
|
3335
|
+
_chunkJZWCK7C3cjs.ConnectStep,
|
|
3328
3336
|
{
|
|
3329
3337
|
walletOptions,
|
|
3330
3338
|
selectedWalletId: selectedWalletIdEffective,
|
|
@@ -3343,7 +3351,7 @@ function DepositFlow({
|
|
|
3343
3351
|
const selectedOption = walletOptions.find(
|
|
3344
3352
|
(o) => o.id === selectedWalletIdEffective
|
|
3345
3353
|
);
|
|
3346
|
-
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess',
|
|
3354
|
+
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess', _109 => _109.kind]) === "solana") {
|
|
3347
3355
|
handleSelectSolanaWallet();
|
|
3348
3356
|
} else {
|
|
3349
3357
|
handleSelectProvider();
|
|
@@ -3386,7 +3394,7 @@ function DepositFlow({
|
|
|
3386
3394
|
onCopyAddress: () => {
|
|
3387
3395
|
const chainName = _chunkR6U6BHCVcjs.getChainName.call(void 0, targetChain);
|
|
3388
3396
|
const tokenSymbol = _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3389
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
3397
|
+
_optionalChain([onEvent, 'optionalCall', _110 => _110({
|
|
3390
3398
|
type: "deposit_modal_transfer_crypto_cta_click",
|
|
3391
3399
|
default_chain: chainName,
|
|
3392
3400
|
default_token: tokenSymbol,
|
|
@@ -3398,7 +3406,7 @@ function DepositFlow({
|
|
|
3398
3406
|
}
|
|
3399
3407
|
),
|
|
3400
3408
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3401
|
-
|
|
3409
|
+
_chunkJZWCK7C3cjs.ProcessingStep,
|
|
3402
3410
|
{
|
|
3403
3411
|
smartAccount: step.smartAccount,
|
|
3404
3412
|
txHash: step.txHash,
|
|
@@ -3410,7 +3418,7 @@ function DepositFlow({
|
|
|
3410
3418
|
sourceSymbol: step.sourceSymbol,
|
|
3411
3419
|
sourceDecimals: step.sourceDecimals,
|
|
3412
3420
|
waitForFinalTx,
|
|
3413
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
3421
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _111 => _111.length])),
|
|
3414
3422
|
service,
|
|
3415
3423
|
directTransfer: step.directTransfer,
|
|
3416
3424
|
onClose,
|
|
@@ -3425,8 +3433,8 @@ function DepositFlow({
|
|
|
3425
3433
|
}
|
|
3426
3434
|
if (isSolanaWalletMode) {
|
|
3427
3435
|
if (!sessionKeyAddress) return null;
|
|
3428
|
-
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess',
|
|
3429
|
-
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess',
|
|
3436
|
+
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess', _112 => _112.solanaAddress]);
|
|
3437
|
+
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess', _113 => _113.solanaProvider]);
|
|
3430
3438
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
3431
3439
|
step.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3432
3440
|
SetupStep,
|
|
@@ -3522,7 +3530,7 @@ function DepositFlow({
|
|
|
3522
3530
|
) })
|
|
3523
3531
|
] }) : null,
|
|
3524
3532
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3525
|
-
|
|
3533
|
+
_chunkJZWCK7C3cjs.ProcessingStep,
|
|
3526
3534
|
{
|
|
3527
3535
|
smartAccount: step.smartAccount,
|
|
3528
3536
|
txHash: step.txHash,
|
|
@@ -3534,7 +3542,7 @@ function DepositFlow({
|
|
|
3534
3542
|
sourceSymbol: step.sourceSymbol,
|
|
3535
3543
|
sourceDecimals: step.sourceDecimals,
|
|
3536
3544
|
waitForFinalTx,
|
|
3537
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
3545
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _114 => _114.length])),
|
|
3538
3546
|
service,
|
|
3539
3547
|
directTransfer: step.directTransfer,
|
|
3540
3548
|
onClose,
|
|
@@ -3547,16 +3555,16 @@ function DepositFlow({
|
|
|
3547
3555
|
)
|
|
3548
3556
|
] });
|
|
3549
3557
|
}
|
|
3550
|
-
if (!_optionalChain([signerContext, 'optionalAccess',
|
|
3558
|
+
if (!_optionalChain([signerContext, 'optionalAccess', _115 => _115.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _116 => _116.publicClient])) {
|
|
3551
3559
|
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
3560
|
}
|
|
3553
3561
|
const ownerAddress = signerContext.ownerAddress;
|
|
3554
|
-
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access',
|
|
3562
|
+
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _117 => _117.walletClient, 'optionalAccess', _118 => _118.chain, 'optionalAccess', _119 => _119.id]), () => ( _optionalChain([signerContext, 'access', _120 => _120.publicClient, 'access', _121 => _121.chain, 'optionalAccess', _122 => _122.id]))), () => ( targetChain));
|
|
3555
3563
|
const getReadClientForChain = (chainId) => {
|
|
3556
|
-
if (_optionalChain([signerContext, 'access',
|
|
3564
|
+
if (_optionalChain([signerContext, 'access', _123 => _123.publicClient, 'access', _124 => _124.chain, 'optionalAccess', _125 => _125.id]) === chainId) {
|
|
3557
3565
|
return signerContext.publicClient;
|
|
3558
3566
|
}
|
|
3559
|
-
return
|
|
3567
|
+
return _chunkJZWCK7C3cjs.getPublicClient.call(void 0, chainId);
|
|
3560
3568
|
};
|
|
3561
3569
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
3562
3570
|
step.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3607,7 +3615,7 @@ function DepositFlow({
|
|
|
3607
3615
|
onContinue: handleAmountContinue,
|
|
3608
3616
|
onCtaClick: (ctaName) => {
|
|
3609
3617
|
const receiveSymbol = _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3610
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
3618
|
+
_optionalChain([onEvent, 'optionalCall', _126 => _126({
|
|
3611
3619
|
type: "deposit_modal_connected_wallet_enter_value_cta_click",
|
|
3612
3620
|
send_token: step.asset.symbol,
|
|
3613
3621
|
receive_token: receiveSymbol,
|
|
@@ -3638,7 +3646,7 @@ function DepositFlow({
|
|
|
3638
3646
|
}
|
|
3639
3647
|
),
|
|
3640
3648
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3641
|
-
|
|
3649
|
+
_chunkJZWCK7C3cjs.ProcessingStep,
|
|
3642
3650
|
{
|
|
3643
3651
|
smartAccount: step.smartAccount,
|
|
3644
3652
|
txHash: step.txHash,
|
|
@@ -3650,7 +3658,7 @@ function DepositFlow({
|
|
|
3650
3658
|
sourceSymbol: step.sourceSymbol,
|
|
3651
3659
|
sourceDecimals: step.sourceDecimals,
|
|
3652
3660
|
waitForFinalTx,
|
|
3653
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
3661
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _127 => _127.length])),
|
|
3654
3662
|
service,
|
|
3655
3663
|
directTransfer: step.directTransfer,
|
|
3656
3664
|
onClose,
|
|
@@ -3664,10 +3672,251 @@ function DepositFlow({
|
|
|
3664
3672
|
] });
|
|
3665
3673
|
}
|
|
3666
3674
|
|
|
3675
|
+
// src/components/history/DepositHistoryPanel.tsx
|
|
3676
|
+
|
|
3677
|
+
|
|
3678
|
+
function shortenHash(hash) {
|
|
3679
|
+
if (hash.length <= 14) return hash;
|
|
3680
|
+
return `${hash.slice(0, 6)}\u2026${hash.slice(-4)}`;
|
|
3681
|
+
}
|
|
3682
|
+
function formatTimestamp(iso) {
|
|
3683
|
+
try {
|
|
3684
|
+
const date = new Date(iso);
|
|
3685
|
+
if (Number.isNaN(date.getTime())) return iso;
|
|
3686
|
+
const now = /* @__PURE__ */ new Date();
|
|
3687
|
+
const diffMs = now.getTime() - date.getTime();
|
|
3688
|
+
const diffMin = Math.floor(diffMs / 6e4);
|
|
3689
|
+
if (diffMin < 1) return "Just now";
|
|
3690
|
+
if (diffMin < 60) return `${diffMin}m ago`;
|
|
3691
|
+
const diffHr = Math.floor(diffMin / 60);
|
|
3692
|
+
if (diffHr < 24) return `${diffHr}h ago`;
|
|
3693
|
+
const diffDay = Math.floor(diffHr / 24);
|
|
3694
|
+
if (diffDay < 7) return `${diffDay}d ago`;
|
|
3695
|
+
return date.toLocaleDateString("en-US", {
|
|
3696
|
+
month: "short",
|
|
3697
|
+
day: "numeric"
|
|
3698
|
+
});
|
|
3699
|
+
} catch (e22) {
|
|
3700
|
+
return iso;
|
|
3701
|
+
}
|
|
3702
|
+
}
|
|
3703
|
+
function resolveChainId(value) {
|
|
3704
|
+
if (value === void 0 || value === null) return null;
|
|
3705
|
+
if (typeof value === "number") return value;
|
|
3706
|
+
if (_chunkJZWCK7C3cjs.isSolanaCaip2.call(void 0, value) || value === "solana") return "solana";
|
|
3707
|
+
const parsed = _chunkJZWCK7C3cjs.parseEvmChainId.call(void 0, value);
|
|
3708
|
+
if (parsed !== null) return parsed;
|
|
3709
|
+
const num = Number(value);
|
|
3710
|
+
return Number.isFinite(num) ? num : null;
|
|
3711
|
+
}
|
|
3712
|
+
function resolveTokenSymbol(token, chainId) {
|
|
3713
|
+
if (!token) return "";
|
|
3714
|
+
if (chainId !== null && chainId !== void 0 && chainId !== "solana" && /^0x[a-fA-F0-9]{40}$/.test(token)) {
|
|
3715
|
+
const sym = _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, token, chainId);
|
|
3716
|
+
if (sym !== "Token") return sym;
|
|
3717
|
+
}
|
|
3718
|
+
return shortenHash(token);
|
|
3719
|
+
}
|
|
3720
|
+
function formatAmount(rawAmount, token, chainId) {
|
|
3721
|
+
if (!rawAmount) return "";
|
|
3722
|
+
let decimals = 18;
|
|
3723
|
+
if (token && chainId !== null && chainId !== void 0 && chainId !== "solana" && /^0x[a-fA-F0-9]{40}$/.test(token)) {
|
|
3724
|
+
decimals = _chunkR6U6BHCVcjs.getTokenDecimalsByAddress.call(void 0, token, chainId);
|
|
3725
|
+
}
|
|
3726
|
+
try {
|
|
3727
|
+
const raw = BigInt(rawAmount);
|
|
3728
|
+
const divisor = BigInt(10 ** decimals);
|
|
3729
|
+
const whole = raw / divisor;
|
|
3730
|
+
const remainder = raw % divisor;
|
|
3731
|
+
if (remainder === 0n) return whole.toString();
|
|
3732
|
+
const fracStr = remainder.toString().padStart(decimals, "0");
|
|
3733
|
+
const trimmed = fracStr.slice(0, 6).replace(/0+$/, "");
|
|
3734
|
+
if (!trimmed) return whole.toString();
|
|
3735
|
+
return `${whole}.${trimmed}`;
|
|
3736
|
+
} catch (e23) {
|
|
3737
|
+
return rawAmount;
|
|
3738
|
+
}
|
|
3739
|
+
}
|
|
3740
|
+
function getTxExplorerUrl(txHash, chainId) {
|
|
3741
|
+
if (!chainId) return null;
|
|
3742
|
+
const base = _chunkR6U6BHCVcjs.getExplorerUrl.call(void 0, chainId);
|
|
3743
|
+
if (!base) return null;
|
|
3744
|
+
return `${base}/tx/${txHash}`;
|
|
3745
|
+
}
|
|
3746
|
+
function normalizeStatus(raw) {
|
|
3747
|
+
const lower = raw.toLowerCase();
|
|
3748
|
+
if (lower === "completed" || lower === "complete" || lower === "bridge-complete" || lower === "processed") return "completed";
|
|
3749
|
+
if (lower === "failed" || lower === "error" || lower === "bridge-failed") return "failed";
|
|
3750
|
+
if (lower === "processing" || lower === "submitted" || lower === "bridging") return "processing";
|
|
3751
|
+
return "pending";
|
|
3752
|
+
}
|
|
3753
|
+
var STATUS_LABEL = {
|
|
3754
|
+
pending: "Pending",
|
|
3755
|
+
processing: "Processing",
|
|
3756
|
+
completed: "Completed",
|
|
3757
|
+
failed: "Failed"
|
|
3758
|
+
};
|
|
3759
|
+
function ExternalLinkIcon() {
|
|
3760
|
+
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" }) });
|
|
3761
|
+
}
|
|
3762
|
+
function DepositHistoryPanel({
|
|
3763
|
+
deposits,
|
|
3764
|
+
isLoading,
|
|
3765
|
+
error,
|
|
3766
|
+
hasMore,
|
|
3767
|
+
isLoadingMore,
|
|
3768
|
+
onLoadMore,
|
|
3769
|
+
onClose
|
|
3770
|
+
}) {
|
|
3771
|
+
const handleKeyDown = _react.useCallback.call(void 0,
|
|
3772
|
+
(e) => {
|
|
3773
|
+
if (e.key === "Escape") {
|
|
3774
|
+
e.stopPropagation();
|
|
3775
|
+
onClose();
|
|
3776
|
+
}
|
|
3777
|
+
},
|
|
3778
|
+
[onClose]
|
|
3779
|
+
);
|
|
3780
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3781
|
+
"div",
|
|
3782
|
+
{
|
|
3783
|
+
className: "rs-history-panel",
|
|
3784
|
+
role: "dialog",
|
|
3785
|
+
"aria-label": "Deposit history",
|
|
3786
|
+
onKeyDown: handleKeyDown,
|
|
3787
|
+
children: [
|
|
3788
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-header", children: [
|
|
3789
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3790
|
+
"button",
|
|
3791
|
+
{
|
|
3792
|
+
type: "button",
|
|
3793
|
+
className: "rs-history-back",
|
|
3794
|
+
"aria-label": "Close history",
|
|
3795
|
+
onClick: onClose,
|
|
3796
|
+
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" }) })
|
|
3797
|
+
}
|
|
3798
|
+
),
|
|
3799
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-header-title", children: "History" }),
|
|
3800
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-history-header-spacer" })
|
|
3801
|
+
] }),
|
|
3802
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-body", children: [
|
|
3803
|
+
isLoading && deposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-state", children: [
|
|
3804
|
+
/* @__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" }) }) }),
|
|
3805
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-state-text", children: "Loading history..." })
|
|
3806
|
+
] }),
|
|
3807
|
+
error && !isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-state", children: [
|
|
3808
|
+
/* @__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: [
|
|
3809
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "12", cy: "12", r: "10" }),
|
|
3810
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", d: "M12 8v4m0 4h.01" })
|
|
3811
|
+
] }) }),
|
|
3812
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-state-text", children: error })
|
|
3813
|
+
] }),
|
|
3814
|
+
!isLoading && !error && deposits.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-state", children: [
|
|
3815
|
+
/* @__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" }) }) }),
|
|
3816
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-state-text", children: "No deposits yet" }),
|
|
3817
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-state-hint", children: "Your deposit history will appear here" })
|
|
3818
|
+
] }),
|
|
3819
|
+
deposits.length > 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-list", children: [
|
|
3820
|
+
deposits.map((deposit, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HistoryRow, { deposit }, deposit.txHash || i)),
|
|
3821
|
+
hasMore && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3822
|
+
"button",
|
|
3823
|
+
{
|
|
3824
|
+
type: "button",
|
|
3825
|
+
className: "rs-history-load-more",
|
|
3826
|
+
onClick: onLoadMore,
|
|
3827
|
+
disabled: isLoadingMore,
|
|
3828
|
+
children: isLoadingMore ? "Loading..." : "Load more"
|
|
3829
|
+
}
|
|
3830
|
+
)
|
|
3831
|
+
] })
|
|
3832
|
+
] })
|
|
3833
|
+
]
|
|
3834
|
+
}
|
|
3835
|
+
);
|
|
3836
|
+
}
|
|
3837
|
+
function HistoryRow({ deposit }) {
|
|
3838
|
+
const status = normalizeStatus(deposit.status);
|
|
3839
|
+
const sourceChainId = resolveChainId(deposit.chain);
|
|
3840
|
+
const targetChainId = resolveChainId(deposit.targetChain);
|
|
3841
|
+
const sourceChainName = sourceChainId ? _chunkR6U6BHCVcjs.getChainName.call(void 0, sourceChainId) : null;
|
|
3842
|
+
const targetChainName = targetChainId ? _chunkR6U6BHCVcjs.getChainName.call(void 0, targetChainId) : null;
|
|
3843
|
+
const sourceChainIcon = sourceChainId ? _chunkR6U6BHCVcjs.getChainIcon.call(void 0, sourceChainId) : void 0;
|
|
3844
|
+
const targetChainIcon = targetChainId ? _chunkR6U6BHCVcjs.getChainIcon.call(void 0, targetChainId) : void 0;
|
|
3845
|
+
const sourceSymbol = resolveTokenSymbol(deposit.token, sourceChainId);
|
|
3846
|
+
const targetSymbol = resolveTokenSymbol(deposit.targetToken, targetChainId);
|
|
3847
|
+
const rawAmount = _nullishCoalesce(deposit.sourceAmount, () => ( deposit.amount));
|
|
3848
|
+
const formattedAmount = rawAmount ? formatAmount(rawAmount, deposit.token, sourceChainId) : null;
|
|
3849
|
+
const timestamp = deposit.createdAt ? formatTimestamp(deposit.createdAt) : null;
|
|
3850
|
+
const srcTxUrl = deposit.sourceTxHash ? getTxExplorerUrl(deposit.sourceTxHash, sourceChainId) : null;
|
|
3851
|
+
const dstTxUrl = deposit.destinationTxHash ? getTxExplorerUrl(deposit.destinationTxHash, targetChainId) : null;
|
|
3852
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-row", children: [
|
|
3853
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-row-primary", children: [
|
|
3854
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-route", children: [
|
|
3855
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-history-chain", children: [
|
|
3856
|
+
sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: sourceChainIcon, alt: "", className: "rs-history-chain-icon" }),
|
|
3857
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-chain-name", children: _nullishCoalesce(sourceChainName, () => ( "Unknown")) })
|
|
3858
|
+
] }),
|
|
3859
|
+
/* @__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" }) }),
|
|
3860
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-history-chain", children: [
|
|
3861
|
+
targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: targetChainIcon, alt: "", className: "rs-history-chain-icon" }),
|
|
3862
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-chain-name", children: _nullishCoalesce(targetChainName, () => ( "Unknown")) })
|
|
3863
|
+
] })
|
|
3864
|
+
] }),
|
|
3865
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: `rs-history-status rs-history-status--${status}`, children: [
|
|
3866
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `rs-history-dot rs-history-dot--${status}` }),
|
|
3867
|
+
STATUS_LABEL[status]
|
|
3868
|
+
] })
|
|
3869
|
+
] }),
|
|
3870
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-row-secondary", children: [
|
|
3871
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-amount", children: formattedAmount ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
3872
|
+
formattedAmount,
|
|
3873
|
+
" ",
|
|
3874
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-token", children: sourceSymbol }),
|
|
3875
|
+
targetSymbol && sourceSymbol !== targetSymbol && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-history-token-target", children: [
|
|
3876
|
+
" \u2192 ",
|
|
3877
|
+
targetSymbol
|
|
3878
|
+
] })
|
|
3879
|
+
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-no-amount", children: "\u2014" }) }),
|
|
3880
|
+
timestamp && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-time", children: timestamp })
|
|
3881
|
+
] }),
|
|
3882
|
+
(srcTxUrl || dstTxUrl) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-row-links", children: [
|
|
3883
|
+
srcTxUrl && deposit.sourceTxHash && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3884
|
+
"a",
|
|
3885
|
+
{
|
|
3886
|
+
href: srcTxUrl,
|
|
3887
|
+
target: "_blank",
|
|
3888
|
+
rel: "noopener noreferrer",
|
|
3889
|
+
className: "rs-history-tx-link",
|
|
3890
|
+
title: deposit.sourceTxHash,
|
|
3891
|
+
children: [
|
|
3892
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-tx-hash", children: shortenHash(deposit.sourceTxHash) }),
|
|
3893
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExternalLinkIcon, {})
|
|
3894
|
+
]
|
|
3895
|
+
}
|
|
3896
|
+
),
|
|
3897
|
+
dstTxUrl && deposit.destinationTxHash && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3898
|
+
"a",
|
|
3899
|
+
{
|
|
3900
|
+
href: dstTxUrl,
|
|
3901
|
+
target: "_blank",
|
|
3902
|
+
rel: "noopener noreferrer",
|
|
3903
|
+
className: "rs-history-tx-link",
|
|
3904
|
+
title: deposit.destinationTxHash,
|
|
3905
|
+
children: [
|
|
3906
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-history-tx-hash", children: shortenHash(deposit.destinationTxHash) }),
|
|
3907
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExternalLinkIcon, {})
|
|
3908
|
+
]
|
|
3909
|
+
}
|
|
3910
|
+
)
|
|
3911
|
+
] })
|
|
3912
|
+
] });
|
|
3913
|
+
}
|
|
3914
|
+
DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
3915
|
+
|
|
3667
3916
|
// src/DepositModal.tsx
|
|
3668
3917
|
|
|
3669
3918
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
3670
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
3919
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-WFXQKZDH.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
3671
3920
|
);
|
|
3672
3921
|
function DepositModal(props) {
|
|
3673
3922
|
const needsReown = !!props.reownAppId;
|
|
@@ -3736,14 +3985,24 @@ function DepositModalInner({
|
|
|
3736
3985
|
debug
|
|
3737
3986
|
}) {
|
|
3738
3987
|
const modalRef = _react.useRef.call(void 0, null);
|
|
3739
|
-
const onReadyRef =
|
|
3988
|
+
const onReadyRef = _chunkJZWCK7C3cjs.useLatestRef.call(void 0, onReady);
|
|
3740
3989
|
const [currentStepIndex, setCurrentStepIndex] = _react.useState.call(void 0, 0);
|
|
3741
3990
|
const [totalBalanceUsd, setTotalBalanceUsd] = _react.useState.call(void 0, null);
|
|
3742
3991
|
const backHandlerRef = _react.useRef.call(void 0, void 0);
|
|
3992
|
+
const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _128 => _128.showHistoryButton]), () => ( false));
|
|
3993
|
+
const [activeSmartAccount, setActiveSmartAccount] = _react.useState.call(void 0, null);
|
|
3994
|
+
const [historyOpen, setHistoryOpen] = _react.useState.call(void 0, false);
|
|
3995
|
+
const [historyDeposits, setHistoryDeposits] = _react.useState.call(void 0, []);
|
|
3996
|
+
const [historyNextCursor, setHistoryNextCursor] = _react.useState.call(void 0, null);
|
|
3997
|
+
const [historyLoading, setHistoryLoading] = _react.useState.call(void 0, false);
|
|
3998
|
+
const [historyLoadingMore, setHistoryLoadingMore] = _react.useState.call(void 0, false);
|
|
3999
|
+
const [historyError, setHistoryError] = _react.useState.call(void 0, null);
|
|
4000
|
+
const historyStaleRef = _react.useRef.call(void 0, false);
|
|
4001
|
+
const historyLoadedRef = _react.useRef.call(void 0, false);
|
|
3743
4002
|
const targetChain = _chunkR6U6BHCVcjs.getChainId.call(void 0, targetChainProp);
|
|
3744
4003
|
const sourceChain = sourceChainProp ? _chunkR6U6BHCVcjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
3745
4004
|
const service = _react.useMemo.call(void 0,
|
|
3746
|
-
() =>
|
|
4005
|
+
() => _chunkJZWCK7C3cjs.createDepositService.call(void 0, backendUrl, {
|
|
3747
4006
|
debug,
|
|
3748
4007
|
debugScope: "service:deposit"
|
|
3749
4008
|
}),
|
|
@@ -3751,7 +4010,7 @@ function DepositModalInner({
|
|
|
3751
4010
|
);
|
|
3752
4011
|
_react.useEffect.call(void 0, () => {
|
|
3753
4012
|
if (isOpen && modalRef.current) {
|
|
3754
|
-
|
|
4013
|
+
_chunkJZWCK7C3cjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
3755
4014
|
}
|
|
3756
4015
|
}, [isOpen, theme]);
|
|
3757
4016
|
_react.useEffect.call(void 0, () => {
|
|
@@ -3761,7 +4020,7 @@ function DepositModalInner({
|
|
|
3761
4020
|
_react.useEffect.call(void 0, () => {
|
|
3762
4021
|
if (isOpen && !hasCalledReady.current) {
|
|
3763
4022
|
hasCalledReady.current = true;
|
|
3764
|
-
_optionalChain([onReadyRef, 'access',
|
|
4023
|
+
_optionalChain([onReadyRef, 'access', _129 => _129.current, 'optionalCall', _130 => _130()]);
|
|
3765
4024
|
}
|
|
3766
4025
|
}, [isOpen, onReadyRef]);
|
|
3767
4026
|
_react.useEffect.call(void 0, () => {
|
|
@@ -3780,17 +4039,119 @@ function DepositModalInner({
|
|
|
3780
4039
|
setTotalBalanceUsd(balance2);
|
|
3781
4040
|
}, []);
|
|
3782
4041
|
const handleBack = _react.useCallback.call(void 0, () => {
|
|
3783
|
-
_optionalChain([backHandlerRef, 'access',
|
|
4042
|
+
_optionalChain([backHandlerRef, 'access', _131 => _131.current, 'optionalCall', _132 => _132()]);
|
|
3784
4043
|
}, []);
|
|
3785
|
-
const
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
4044
|
+
const handleSmartAccountChange = _react.useCallback.call(void 0,
|
|
4045
|
+
(account) => {
|
|
4046
|
+
setActiveSmartAccount(account);
|
|
4047
|
+
if (!account) {
|
|
4048
|
+
historyStaleRef.current = true;
|
|
4049
|
+
}
|
|
4050
|
+
},
|
|
4051
|
+
[]
|
|
4052
|
+
);
|
|
4053
|
+
const fetchHistory = _react.useCallback.call(void 0,
|
|
4054
|
+
async (cursor) => {
|
|
4055
|
+
if (!activeSmartAccount) return;
|
|
4056
|
+
const isInitial = !cursor;
|
|
4057
|
+
if (isInitial) {
|
|
4058
|
+
setHistoryLoading(true);
|
|
4059
|
+
} else {
|
|
4060
|
+
setHistoryLoadingMore(true);
|
|
4061
|
+
}
|
|
4062
|
+
setHistoryError(null);
|
|
4063
|
+
try {
|
|
4064
|
+
const result = await service.fetchDepositHistory({
|
|
4065
|
+
account: activeSmartAccount,
|
|
4066
|
+
limit: 20,
|
|
4067
|
+
cursor
|
|
4068
|
+
});
|
|
4069
|
+
if (isInitial) {
|
|
4070
|
+
setHistoryDeposits(result.deposits);
|
|
4071
|
+
} else {
|
|
4072
|
+
setHistoryDeposits((prev) => [...prev, ...result.deposits]);
|
|
4073
|
+
}
|
|
4074
|
+
setHistoryNextCursor(_nullishCoalesce(result.nextCursor, () => ( null)));
|
|
4075
|
+
historyStaleRef.current = false;
|
|
4076
|
+
historyLoadedRef.current = true;
|
|
4077
|
+
} catch (err) {
|
|
4078
|
+
setHistoryError(
|
|
4079
|
+
err instanceof Error ? err.message : "Failed to load history"
|
|
4080
|
+
);
|
|
4081
|
+
} finally {
|
|
4082
|
+
if (isInitial) {
|
|
4083
|
+
setHistoryLoading(false);
|
|
4084
|
+
} else {
|
|
4085
|
+
setHistoryLoadingMore(false);
|
|
4086
|
+
}
|
|
4087
|
+
}
|
|
4088
|
+
},
|
|
4089
|
+
[activeSmartAccount, service]
|
|
4090
|
+
);
|
|
4091
|
+
const handleHistoryOpen = _react.useCallback.call(void 0, () => {
|
|
4092
|
+
setHistoryOpen(true);
|
|
4093
|
+
if (!historyLoadedRef.current || historyStaleRef.current) {
|
|
4094
|
+
fetchHistory();
|
|
4095
|
+
}
|
|
4096
|
+
}, [fetchHistory]);
|
|
4097
|
+
const handleHistoryClose = _react.useCallback.call(void 0, () => {
|
|
4098
|
+
setHistoryOpen(false);
|
|
4099
|
+
}, []);
|
|
4100
|
+
const handleHistoryLoadMore = _react.useCallback.call(void 0, () => {
|
|
4101
|
+
if (historyNextCursor) {
|
|
4102
|
+
fetchHistory(historyNextCursor);
|
|
4103
|
+
}
|
|
4104
|
+
}, [fetchHistory, historyNextCursor]);
|
|
4105
|
+
const markHistoryStale = _react.useCallback.call(void 0, () => {
|
|
4106
|
+
historyStaleRef.current = true;
|
|
4107
|
+
if (historyOpen) {
|
|
4108
|
+
fetchHistory();
|
|
4109
|
+
}
|
|
4110
|
+
}, [historyOpen, fetchHistory]);
|
|
4111
|
+
const onDepositSubmittedRef = _chunkJZWCK7C3cjs.useLatestRef.call(void 0, onDepositSubmitted);
|
|
4112
|
+
const onDepositCompleteRef = _chunkJZWCK7C3cjs.useLatestRef.call(void 0, onDepositComplete);
|
|
4113
|
+
const onDepositFailedRef = _chunkJZWCK7C3cjs.useLatestRef.call(void 0, onDepositFailed);
|
|
4114
|
+
const handleDepositSubmitted = _react.useCallback.call(void 0,
|
|
4115
|
+
(data) => {
|
|
4116
|
+
_optionalChain([onDepositSubmittedRef, 'access', _133 => _133.current, 'optionalCall', _134 => _134(data)]);
|
|
4117
|
+
if (showHistoryButton) markHistoryStale();
|
|
4118
|
+
},
|
|
4119
|
+
[onDepositSubmittedRef, showHistoryButton, markHistoryStale]
|
|
4120
|
+
);
|
|
4121
|
+
const handleDepositComplete = _react.useCallback.call(void 0,
|
|
4122
|
+
(data) => {
|
|
4123
|
+
_optionalChain([onDepositCompleteRef, 'access', _135 => _135.current, 'optionalCall', _136 => _136(data)]);
|
|
4124
|
+
if (showHistoryButton) markHistoryStale();
|
|
4125
|
+
},
|
|
4126
|
+
[onDepositCompleteRef, showHistoryButton, markHistoryStale]
|
|
4127
|
+
);
|
|
4128
|
+
const handleDepositFailed = _react.useCallback.call(void 0,
|
|
4129
|
+
(data) => {
|
|
4130
|
+
_optionalChain([onDepositFailedRef, 'access', _137 => _137.current, 'optionalCall', _138 => _138(data)]);
|
|
4131
|
+
if (showHistoryButton) markHistoryStale();
|
|
4132
|
+
},
|
|
4133
|
+
[onDepositFailedRef, showHistoryButton, markHistoryStale]
|
|
4134
|
+
);
|
|
4135
|
+
_react.useEffect.call(void 0, () => {
|
|
4136
|
+
if (!isOpen) {
|
|
4137
|
+
setHistoryOpen(false);
|
|
4138
|
+
setHistoryDeposits([]);
|
|
4139
|
+
setHistoryNextCursor(null);
|
|
4140
|
+
setHistoryError(null);
|
|
4141
|
+
setActiveSmartAccount(null);
|
|
4142
|
+
historyStaleRef.current = false;
|
|
4143
|
+
historyLoadedRef.current = false;
|
|
4144
|
+
}
|
|
4145
|
+
}, [isOpen]);
|
|
4146
|
+
const showLogo = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _139 => _139.showLogo]), () => ( false));
|
|
4147
|
+
const showStepper = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _140 => _140.showStepper]), () => ( false));
|
|
4148
|
+
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _141 => _141.showBackButton]), () => ( true));
|
|
4149
|
+
const balance = _optionalChain([uiConfig, 'optionalAccess', _142 => _142.balance]);
|
|
4150
|
+
const logoUrl = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _143 => _143.logoUrl]), () => ( "https://github.com/rhinestonewtf.png"));
|
|
4151
|
+
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _144 => _144.title]), () => ( "Deposit"));
|
|
3791
4152
|
const canGoBack = currentStepIndex > 0 && currentStepIndex < 4 && backHandlerRef.current !== void 0;
|
|
3792
4153
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3793
|
-
|
|
4154
|
+
_chunkJZWCK7C3cjs.Modal,
|
|
3794
4155
|
{
|
|
3795
4156
|
isOpen,
|
|
3796
4157
|
onClose,
|
|
@@ -3883,35 +4244,64 @@ function DepositModalInner({
|
|
|
3883
4244
|
balance.title,
|
|
3884
4245
|
":"
|
|
3885
4246
|
] }),
|
|
3886
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ?
|
|
4247
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ? _chunkJZWCK7C3cjs.currencyFormatter.format(totalBalanceUsd) : null))) })
|
|
3887
4248
|
] })
|
|
3888
4249
|
] }),
|
|
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
|
-
|
|
4250
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
|
|
4251
|
+
showHistoryButton && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4252
|
+
"button",
|
|
4253
|
+
{
|
|
4254
|
+
type: "button",
|
|
4255
|
+
className: "rs-modal-header-history",
|
|
4256
|
+
"aria-label": "Deposit history",
|
|
4257
|
+
onClick: handleHistoryOpen,
|
|
4258
|
+
disabled: !activeSmartAccount,
|
|
4259
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4260
|
+
"svg",
|
|
4261
|
+
{
|
|
4262
|
+
viewBox: "0 0 24 24",
|
|
4263
|
+
fill: "none",
|
|
4264
|
+
stroke: "currentColor",
|
|
4265
|
+
strokeWidth: "1.75",
|
|
4266
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4267
|
+
"path",
|
|
4268
|
+
{
|
|
4269
|
+
strokeLinecap: "round",
|
|
4270
|
+
strokeLinejoin: "round",
|
|
4271
|
+
d: "M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"
|
|
4272
|
+
}
|
|
4273
|
+
)
|
|
4274
|
+
}
|
|
4275
|
+
)
|
|
4276
|
+
}
|
|
4277
|
+
),
|
|
4278
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4279
|
+
"button",
|
|
4280
|
+
{
|
|
4281
|
+
type: "button",
|
|
4282
|
+
onClick: onClose,
|
|
4283
|
+
className: "rs-modal-close",
|
|
4284
|
+
"aria-label": "Close",
|
|
4285
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4286
|
+
"svg",
|
|
4287
|
+
{
|
|
4288
|
+
viewBox: "0 0 24 24",
|
|
4289
|
+
fill: "none",
|
|
4290
|
+
stroke: "currentColor",
|
|
4291
|
+
strokeWidth: "2",
|
|
4292
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4293
|
+
"path",
|
|
4294
|
+
{
|
|
4295
|
+
strokeLinecap: "round",
|
|
4296
|
+
strokeLinejoin: "round",
|
|
4297
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
4298
|
+
}
|
|
4299
|
+
)
|
|
4300
|
+
}
|
|
4301
|
+
)
|
|
4302
|
+
}
|
|
4303
|
+
)
|
|
4304
|
+
] })
|
|
3915
4305
|
] }),
|
|
3916
4306
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3917
4307
|
DepositFlow,
|
|
@@ -3942,15 +4332,28 @@ function DepositModalInner({
|
|
|
3942
4332
|
allowedRoutes,
|
|
3943
4333
|
onStepChange: handleStepChange,
|
|
3944
4334
|
onTotalBalanceChange: handleTotalBalanceChange,
|
|
4335
|
+
onSmartAccountChange: showHistoryButton ? handleSmartAccountChange : void 0,
|
|
3945
4336
|
onClose,
|
|
3946
4337
|
onConnected,
|
|
3947
|
-
onDepositSubmitted,
|
|
3948
|
-
onDepositComplete,
|
|
3949
|
-
onDepositFailed,
|
|
4338
|
+
onDepositSubmitted: showHistoryButton ? handleDepositSubmitted : onDepositSubmitted,
|
|
4339
|
+
onDepositComplete: showHistoryButton ? handleDepositComplete : onDepositComplete,
|
|
4340
|
+
onDepositFailed: showHistoryButton ? handleDepositFailed : onDepositFailed,
|
|
3950
4341
|
onEvent,
|
|
3951
4342
|
onError,
|
|
3952
4343
|
debug
|
|
3953
4344
|
}
|
|
4345
|
+
),
|
|
4346
|
+
showHistoryButton && historyOpen && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4347
|
+
DepositHistoryPanel,
|
|
4348
|
+
{
|
|
4349
|
+
deposits: historyDeposits,
|
|
4350
|
+
isLoading: historyLoading,
|
|
4351
|
+
error: historyError,
|
|
4352
|
+
hasMore: Boolean(historyNextCursor),
|
|
4353
|
+
isLoadingMore: historyLoadingMore,
|
|
4354
|
+
onLoadMore: handleHistoryLoadMore,
|
|
4355
|
+
onClose: handleHistoryClose
|
|
4356
|
+
}
|
|
3954
4357
|
)
|
|
3955
4358
|
] })
|
|
3956
4359
|
}
|