@rhinestone/deposit-modal 0.1.64 → 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-XOLZ62BQ.mjs → DepositModalReown-RXIVPSEE.mjs} +2 -2
- package/dist/{DepositModalReown-3KQE4YU6.cjs → DepositModalReown-WFXQKZDH.cjs} +3 -3
- package/dist/{WithdrawModalReown-TD2NYW5M.mjs → WithdrawModalReown-MME7VSKX.mjs} +2 -2
- package/dist/{WithdrawModalReown-YBEUOYSV.cjs → WithdrawModalReown-PXS44GZO.cjs} +3 -3
- package/dist/{chunk-N3BZTUSJ.cjs → chunk-5GN4QU67.cjs} +551 -146
- package/dist/{chunk-P4ULLROO.cjs → chunk-75LRORPO.cjs} +38 -37
- package/dist/{chunk-MYI5WSWL.mjs → chunk-CULXRW6U.mjs} +3 -2
- package/dist/{chunk-TDTBAZNO.mjs → chunk-FWGLRTWF.mjs} +44 -0
- package/dist/{chunk-XVCPUB6K.mjs → chunk-JDO7QPPH.mjs} +465 -60
- package/dist/{chunk-5SR5N75I.cjs → chunk-JZWCK7C3.cjs} +118 -74
- 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,8 +111,10 @@ 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,
|
|
116
|
+
recipient,
|
|
117
|
+
postBridgeActions,
|
|
112
118
|
signerAddress,
|
|
113
119
|
sessionChainIds,
|
|
114
120
|
forceRegister
|
|
@@ -137,7 +143,7 @@ function SetupStep({
|
|
|
137
143
|
primaryType: typedData.primaryType,
|
|
138
144
|
message: typedData.message
|
|
139
145
|
});
|
|
140
|
-
const sessionDetails =
|
|
146
|
+
const sessionDetails = _chunkJZWCK7C3cjs.buildSessionDetails.call(void 0, setup.sessionDetailsUnsigned, signature);
|
|
141
147
|
setState({ type: "registering" });
|
|
142
148
|
const registerResult = await service.registerAccount({
|
|
143
149
|
address: smartAccount,
|
|
@@ -149,7 +155,7 @@ function SetupStep({
|
|
|
149
155
|
eoaAddress: address,
|
|
150
156
|
sessionOwner: sessionOwner.address,
|
|
151
157
|
target: {
|
|
152
|
-
chain:
|
|
158
|
+
chain: _chunkJZWCK7C3cjs.toEvmCaip2.call(void 0, targetChain),
|
|
153
159
|
token: targetToken,
|
|
154
160
|
...recipient && { recipient },
|
|
155
161
|
..._optionalChain([postBridgeActions, 'optionalAccess', _2 => _2.length]) && { postBridgeActions }
|
|
@@ -214,7 +220,7 @@ function SetupStep({
|
|
|
214
220
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
215
221
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", children: [
|
|
216
222
|
isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
217
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
223
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJZWCK7C3cjs.Spinner, { className: "rs-spinner--lg rs-text-accent" }),
|
|
218
224
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-text", children: [
|
|
219
225
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-title", children: renderStateMessage() }),
|
|
220
226
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-subtitle", children: "This may take a moment" })
|
|
@@ -251,7 +257,7 @@ function SetupStep({
|
|
|
251
257
|
] })
|
|
252
258
|
] })
|
|
253
259
|
] }),
|
|
254
|
-
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" }) })
|
|
255
261
|
] });
|
|
256
262
|
}
|
|
257
263
|
|
|
@@ -276,7 +282,7 @@ function AssetSelectStep({
|
|
|
276
282
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
277
283
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
278
284
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
279
|
-
return
|
|
285
|
+
return _chunkJZWCK7C3cjs.getAssetId.call(void 0, {
|
|
280
286
|
chainId: defaultSourceChain,
|
|
281
287
|
token: defaultSourceToken
|
|
282
288
|
});
|
|
@@ -293,7 +299,7 @@ function AssetSelectStep({
|
|
|
293
299
|
try {
|
|
294
300
|
const portfolio = await service.fetchPortfolio(address);
|
|
295
301
|
if (!active) return;
|
|
296
|
-
const portfolioAssets =
|
|
302
|
+
const portfolioAssets = _chunkJZWCK7C3cjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
297
303
|
setAssets(portfolioAssets);
|
|
298
304
|
const hasNative = portfolioAssets.some(
|
|
299
305
|
(asset) => asset.token.toLowerCase() === _chunkR6U6BHCVcjs.NATIVE_TOKEN_ADDRESS
|
|
@@ -374,7 +380,7 @@ function AssetSelectStep({
|
|
|
374
380
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
375
381
|
const numeric = Number(raw);
|
|
376
382
|
if (!Number.isFinite(numeric)) return raw;
|
|
377
|
-
return
|
|
383
|
+
return _chunkJZWCK7C3cjs.tokenFormatter.format(numeric);
|
|
378
384
|
} catch (e3) {
|
|
379
385
|
return asset.balance;
|
|
380
386
|
}
|
|
@@ -388,7 +394,7 @@ function AssetSelectStep({
|
|
|
388
394
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
389
395
|
children: [
|
|
390
396
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
391
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
397
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJZWCK7C3cjs.Spinner, { className: "rs-text-tertiary" }),
|
|
392
398
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
393
399
|
] }),
|
|
394
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 }) }),
|
|
@@ -478,7 +484,7 @@ function AssetSelectStep({
|
|
|
478
484
|
] })
|
|
479
485
|
] })
|
|
480
486
|
] }),
|
|
481
|
-
/* @__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}` : "--" })
|
|
482
488
|
]
|
|
483
489
|
},
|
|
484
490
|
asset.id
|
|
@@ -488,7 +494,7 @@ function AssetSelectStep({
|
|
|
488
494
|
}
|
|
489
495
|
),
|
|
490
496
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
491
|
-
|
|
497
|
+
_chunkJZWCK7C3cjs.Button,
|
|
492
498
|
{
|
|
493
499
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
494
500
|
disabled: !selectedAsset,
|
|
@@ -496,7 +502,7 @@ function AssetSelectStep({
|
|
|
496
502
|
children: "Continue"
|
|
497
503
|
}
|
|
498
504
|
) }),
|
|
499
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
505
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJZWCK7C3cjs.PoweredBy, {})
|
|
500
506
|
] });
|
|
501
507
|
}
|
|
502
508
|
async function fetchNativeAssets(address, publicClient, existing) {
|
|
@@ -504,7 +510,7 @@ async function fetchNativeAssets(address, publicClient, existing) {
|
|
|
504
510
|
const connectedChainId = _optionalChain([publicClient, 'access', _11 => _11.chain, 'optionalAccess', _12 => _12.id]);
|
|
505
511
|
if (!connectedChainId) return [];
|
|
506
512
|
if (!_chunkR6U6BHCVcjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
|
|
507
|
-
const id =
|
|
513
|
+
const id = _chunkJZWCK7C3cjs.getAssetId.call(void 0, {
|
|
508
514
|
chainId: connectedChainId,
|
|
509
515
|
token: _chunkR6U6BHCVcjs.NATIVE_TOKEN_ADDRESS
|
|
510
516
|
});
|
|
@@ -591,7 +597,7 @@ function AmountStep({
|
|
|
591
597
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
592
598
|
if (!balanceTarget || !publicClient) return;
|
|
593
599
|
try {
|
|
594
|
-
const bal =
|
|
600
|
+
const bal = _chunkJZWCK7C3cjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
595
601
|
address: asset.token,
|
|
596
602
|
abi: _viem.erc20Abi,
|
|
597
603
|
functionName: "balanceOf",
|
|
@@ -617,7 +623,7 @@ function AmountStep({
|
|
|
617
623
|
setIsSwitching(true);
|
|
618
624
|
switchChain(asset.chainId).catch((err) => {
|
|
619
625
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
620
|
-
setError(
|
|
626
|
+
setError(_chunkJZWCK7C3cjs.formatUserError.call(void 0, raw));
|
|
621
627
|
}).finally(() => {
|
|
622
628
|
setIsSwitching(false);
|
|
623
629
|
});
|
|
@@ -653,7 +659,7 @@ function AmountStep({
|
|
|
653
659
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
654
660
|
const numeric = Number(raw);
|
|
655
661
|
if (!Number.isFinite(numeric)) return raw;
|
|
656
|
-
return
|
|
662
|
+
return _chunkJZWCK7C3cjs.tokenFormatter.format(numeric);
|
|
657
663
|
} catch (e8) {
|
|
658
664
|
return "...";
|
|
659
665
|
}
|
|
@@ -697,7 +703,7 @@ function AmountStep({
|
|
|
697
703
|
const usdValue = numericAmount;
|
|
698
704
|
if (_optionalChain([uiConfig, 'optionalAccess', _17 => _17.maxDepositUsd]) && usdValue > uiConfig.maxDepositUsd) {
|
|
699
705
|
setError(
|
|
700
|
-
`Maximum deposit is ${
|
|
706
|
+
`Maximum deposit is ${_chunkJZWCK7C3cjs.currencyFormatter.format(uiConfig.maxDepositUsd)}`
|
|
701
707
|
);
|
|
702
708
|
return;
|
|
703
709
|
}
|
|
@@ -752,7 +758,7 @@ function AmountStep({
|
|
|
752
758
|
hasPricing && balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { style: { color: "var(--rs-muted-foreground)" }, children: [
|
|
753
759
|
" ",
|
|
754
760
|
"(",
|
|
755
|
-
|
|
761
|
+
_chunkJZWCK7C3cjs.currencyFormatter.format(balanceUsd),
|
|
756
762
|
")"
|
|
757
763
|
] })
|
|
758
764
|
] }) })
|
|
@@ -889,7 +895,7 @@ function AmountStep({
|
|
|
889
895
|
)
|
|
890
896
|
] }),
|
|
891
897
|
_optionalChain([uiConfig, 'optionalAccess', _20 => _20.minDepositUsd]) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-minimum", children: [
|
|
892
|
-
|
|
898
|
+
_chunkJZWCK7C3cjs.currencyFormatter.format(uiConfig.minDepositUsd),
|
|
893
899
|
" minimum deposit"
|
|
894
900
|
] }),
|
|
895
901
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", children: [
|
|
@@ -915,7 +921,7 @@ function AmountStep({
|
|
|
915
921
|
] })
|
|
916
922
|
] }),
|
|
917
923
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
918
|
-
|
|
924
|
+
_chunkJZWCK7C3cjs.Button,
|
|
919
925
|
{
|
|
920
926
|
onClick: handleContinue,
|
|
921
927
|
fullWidth: true,
|
|
@@ -923,7 +929,7 @@ function AmountStep({
|
|
|
923
929
|
children: _optionalChain([uiConfig, 'optionalAccess', _21 => _21.minDepositUsd]) && parseFloat(amount) > 0 && parseFloat(amount) < uiConfig.minDepositUsd ? "Update order" : "Continue"
|
|
924
930
|
}
|
|
925
931
|
) }),
|
|
926
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
932
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJZWCK7C3cjs.PoweredBy, {})
|
|
927
933
|
] });
|
|
928
934
|
}
|
|
929
935
|
|
|
@@ -973,7 +979,7 @@ function ConfirmStep({
|
|
|
973
979
|
setIsSwitching(true);
|
|
974
980
|
switchChain(asset.chainId).catch((err) => {
|
|
975
981
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
976
|
-
setError(
|
|
982
|
+
setError(_chunkJZWCK7C3cjs.formatUserError.call(void 0, raw));
|
|
977
983
|
}).finally(() => {
|
|
978
984
|
setIsSwitching(false);
|
|
979
985
|
});
|
|
@@ -1016,7 +1022,7 @@ function ConfirmStep({
|
|
|
1016
1022
|
throw new Error("Wallet not properly connected");
|
|
1017
1023
|
}
|
|
1018
1024
|
const transferTo = sameRoute ? recipient : smartAccount;
|
|
1019
|
-
const hash =
|
|
1025
|
+
const hash = _chunkJZWCK7C3cjs.isNativeAsset.call(void 0, asset) ? await walletClient.sendTransaction({
|
|
1020
1026
|
account,
|
|
1021
1027
|
chain,
|
|
1022
1028
|
to: transferTo,
|
|
@@ -1033,7 +1039,7 @@ function ConfirmStep({
|
|
|
1033
1039
|
onConfirm(hash, asset.chainId, amountUnits.toString(), asset.token);
|
|
1034
1040
|
} catch (err) {
|
|
1035
1041
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
1036
|
-
const message =
|
|
1042
|
+
const message = _chunkJZWCK7C3cjs.formatUserError.call(void 0, raw);
|
|
1037
1043
|
setError(message);
|
|
1038
1044
|
_optionalChain([onError, 'optionalCall', _25 => _25(message, "TRANSFER_ERROR")]);
|
|
1039
1045
|
} finally {
|
|
@@ -1162,7 +1168,7 @@ function ConfirmStep({
|
|
|
1162
1168
|
] })
|
|
1163
1169
|
] }),
|
|
1164
1170
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1165
|
-
|
|
1171
|
+
_chunkJZWCK7C3cjs.Button,
|
|
1166
1172
|
{
|
|
1167
1173
|
onClick: handleConfirm,
|
|
1168
1174
|
loading: isSubmitting,
|
|
@@ -1171,7 +1177,7 @@ function ConfirmStep({
|
|
|
1171
1177
|
children: "Confirm Order"
|
|
1172
1178
|
}
|
|
1173
1179
|
) }),
|
|
1174
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1180
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJZWCK7C3cjs.PoweredBy, {})
|
|
1175
1181
|
] });
|
|
1176
1182
|
}
|
|
1177
1183
|
|
|
@@ -1583,10 +1589,10 @@ function DepositAddressStep({
|
|
|
1583
1589
|
const status = await service.fetchLatestStatus(smartAccount);
|
|
1584
1590
|
if (cancelled || depositHandledRef.current) return;
|
|
1585
1591
|
const event = status.lastEvent;
|
|
1586
|
-
const eventTxHash =
|
|
1592
|
+
const eventTxHash = _chunkJZWCK7C3cjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkJZWCK7C3cjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
1587
1593
|
if (baselineTxHash === void 0) {
|
|
1588
1594
|
baselineTxHash = eventTxHash;
|
|
1589
|
-
} else if (eventTxHash && (!baselineTxHash || !
|
|
1595
|
+
} else if (eventTxHash && (!baselineTxHash || !_chunkJZWCK7C3cjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHash))) {
|
|
1590
1596
|
const details = getDepositEventDetails(event);
|
|
1591
1597
|
const fallback = sourceSelectionRef.current;
|
|
1592
1598
|
const chainId = _nullishCoalesce(details.chainId, () => ( fallback.chainId));
|
|
@@ -1809,7 +1815,7 @@ function DepositAddressStep({
|
|
|
1809
1815
|
] }),
|
|
1810
1816
|
pollingError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-error", children: pollingError })
|
|
1811
1817
|
] }) }),
|
|
1812
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1818
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJZWCK7C3cjs.PoweredBy, {})
|
|
1813
1819
|
] });
|
|
1814
1820
|
}
|
|
1815
1821
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -1840,7 +1846,7 @@ function SolanaTokenSelectStep({
|
|
|
1840
1846
|
setError(null);
|
|
1841
1847
|
const portfolioBySymbol = {};
|
|
1842
1848
|
try {
|
|
1843
|
-
|
|
1849
|
+
_chunkJZWCK7C3cjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
|
|
1844
1850
|
solanaAddress
|
|
1845
1851
|
});
|
|
1846
1852
|
const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
|
|
@@ -1863,12 +1869,12 @@ function SolanaTokenSelectStep({
|
|
|
1863
1869
|
};
|
|
1864
1870
|
}
|
|
1865
1871
|
}
|
|
1866
|
-
|
|
1872
|
+
_chunkJZWCK7C3cjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
|
|
1867
1873
|
symbols: Object.keys(portfolioBySymbol)
|
|
1868
1874
|
});
|
|
1869
1875
|
} catch (err) {
|
|
1870
1876
|
if (!active) return;
|
|
1871
|
-
|
|
1877
|
+
_chunkJZWCK7C3cjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
|
|
1872
1878
|
solanaAddress
|
|
1873
1879
|
});
|
|
1874
1880
|
setError(
|
|
@@ -1922,7 +1928,7 @@ function SolanaTokenSelectStep({
|
|
|
1922
1928
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
1923
1929
|
children: [
|
|
1924
1930
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
1925
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1931
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJZWCK7C3cjs.Spinner, { className: "rs-text-tertiary" }),
|
|
1926
1932
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
1927
1933
|
] }),
|
|
1928
1934
|
!loading && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
@@ -1959,7 +1965,7 @@ function SolanaTokenSelectStep({
|
|
|
1959
1965
|
try {
|
|
1960
1966
|
const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
|
|
1961
1967
|
const numeric = Number(raw);
|
|
1962
|
-
formattedBalance = Number.isFinite(numeric) ?
|
|
1968
|
+
formattedBalance = Number.isFinite(numeric) ? _chunkJZWCK7C3cjs.tokenFormatter.format(numeric) : raw;
|
|
1963
1969
|
} catch (e14) {
|
|
1964
1970
|
formattedBalance = "...";
|
|
1965
1971
|
}
|
|
@@ -2003,7 +2009,7 @@ function SolanaTokenSelectStep({
|
|
|
2003
2009
|
] })
|
|
2004
2010
|
] })
|
|
2005
2011
|
] }),
|
|
2006
|
-
/* @__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}` })
|
|
2007
2013
|
]
|
|
2008
2014
|
},
|
|
2009
2015
|
entry.token.symbol
|
|
@@ -2013,7 +2019,7 @@ function SolanaTokenSelectStep({
|
|
|
2013
2019
|
}
|
|
2014
2020
|
),
|
|
2015
2021
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2016
|
-
|
|
2022
|
+
_chunkJZWCK7C3cjs.Button,
|
|
2017
2023
|
{
|
|
2018
2024
|
onClick: () => selectedEntry && onContinue(
|
|
2019
2025
|
selectedEntry.token,
|
|
@@ -2025,7 +2031,7 @@ function SolanaTokenSelectStep({
|
|
|
2025
2031
|
children: "Continue"
|
|
2026
2032
|
}
|
|
2027
2033
|
) }),
|
|
2028
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2034
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJZWCK7C3cjs.PoweredBy, {})
|
|
2029
2035
|
] });
|
|
2030
2036
|
}
|
|
2031
2037
|
|
|
@@ -2073,7 +2079,7 @@ function SolanaAmountStep({
|
|
|
2073
2079
|
const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
|
|
2074
2080
|
const numeric = Number(raw);
|
|
2075
2081
|
if (!Number.isFinite(numeric)) return raw;
|
|
2076
|
-
return
|
|
2082
|
+
return _chunkJZWCK7C3cjs.tokenFormatter.format(numeric);
|
|
2077
2083
|
} catch (e16) {
|
|
2078
2084
|
return "...";
|
|
2079
2085
|
}
|
|
@@ -2091,7 +2097,7 @@ function SolanaAmountStep({
|
|
|
2091
2097
|
}, [balance, token.decimals, tokenPriceUsd, balanceUsd]);
|
|
2092
2098
|
const formattedBalanceUsd = _react.useMemo.call(void 0, () => {
|
|
2093
2099
|
if (computedBalanceUsd === null || computedBalanceUsd <= 0) return null;
|
|
2094
|
-
return
|
|
2100
|
+
return _chunkJZWCK7C3cjs.currencyFormatter.format(computedBalanceUsd);
|
|
2095
2101
|
}, [computedBalanceUsd]);
|
|
2096
2102
|
const spendableBalance = _react.useMemo.call(void 0, () => {
|
|
2097
2103
|
if (!isNativeSol(token)) return balance;
|
|
@@ -2116,7 +2122,7 @@ function SolanaAmountStep({
|
|
|
2116
2122
|
const factor = 10 ** maxDecimals;
|
|
2117
2123
|
const truncated = Math.floor(value * factor) / factor;
|
|
2118
2124
|
const formatted = truncated.toFixed(maxDecimals).replace(/\.?0+$/, "");
|
|
2119
|
-
|
|
2125
|
+
_chunkJZWCK7C3cjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
|
|
2120
2126
|
percentage,
|
|
2121
2127
|
symbol: token.symbol,
|
|
2122
2128
|
formatted
|
|
@@ -2130,7 +2136,7 @@ function SolanaAmountStep({
|
|
|
2130
2136
|
const handleContinue = () => {
|
|
2131
2137
|
const numericAmount = parseFloat(amount);
|
|
2132
2138
|
if (isNaN(numericAmount) || numericAmount <= 0) {
|
|
2133
|
-
|
|
2139
|
+
_chunkJZWCK7C3cjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2134
2140
|
amount,
|
|
2135
2141
|
reason: "nan-or-non-positive"
|
|
2136
2142
|
});
|
|
@@ -2142,7 +2148,7 @@ function SolanaAmountStep({
|
|
|
2142
2148
|
const usdValue = numericAmount;
|
|
2143
2149
|
if (_optionalChain([uiConfig, 'optionalAccess', _48 => _48.maxDepositUsd]) && usdValue > uiConfig.maxDepositUsd) {
|
|
2144
2150
|
setError(
|
|
2145
|
-
`Maximum deposit is ${
|
|
2151
|
+
`Maximum deposit is ${_chunkJZWCK7C3cjs.currencyFormatter.format(uiConfig.maxDepositUsd)}`
|
|
2146
2152
|
);
|
|
2147
2153
|
return;
|
|
2148
2154
|
}
|
|
@@ -2157,7 +2163,7 @@ function SolanaAmountStep({
|
|
|
2157
2163
|
try {
|
|
2158
2164
|
amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
|
|
2159
2165
|
} catch (e20) {
|
|
2160
|
-
|
|
2166
|
+
_chunkJZWCK7C3cjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2161
2167
|
amount,
|
|
2162
2168
|
sourceAmount: sourceAmountStr,
|
|
2163
2169
|
reason: "parse-units-failed"
|
|
@@ -2167,7 +2173,7 @@ function SolanaAmountStep({
|
|
|
2167
2173
|
}
|
|
2168
2174
|
if (amountInUnits > spendableBalance) {
|
|
2169
2175
|
const isReserveIssue = isNativeSol(token) && amountInUnits <= balance;
|
|
2170
|
-
|
|
2176
|
+
_chunkJZWCK7C3cjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2171
2177
|
amount,
|
|
2172
2178
|
balance: balance.toString(),
|
|
2173
2179
|
spendableBalance: spendableBalance.toString(),
|
|
@@ -2179,7 +2185,7 @@ function SolanaAmountStep({
|
|
|
2179
2185
|
);
|
|
2180
2186
|
return;
|
|
2181
2187
|
}
|
|
2182
|
-
|
|
2188
|
+
_chunkJZWCK7C3cjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
|
|
2183
2189
|
symbol: token.symbol,
|
|
2184
2190
|
inputAmountUsd: amount,
|
|
2185
2191
|
sourceAmount: sourceAmountStr,
|
|
@@ -2248,7 +2254,7 @@ function SolanaAmountStep({
|
|
|
2248
2254
|
)
|
|
2249
2255
|
] }),
|
|
2250
2256
|
_optionalChain([uiConfig, 'optionalAccess', _50 => _50.minDepositUsd]) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-minimum", children: [
|
|
2251
|
-
|
|
2257
|
+
_chunkJZWCK7C3cjs.currencyFormatter.format(uiConfig.minDepositUsd),
|
|
2252
2258
|
" minimum deposit"
|
|
2253
2259
|
] }),
|
|
2254
2260
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", children: [
|
|
@@ -2274,7 +2280,7 @@ function SolanaAmountStep({
|
|
|
2274
2280
|
] })
|
|
2275
2281
|
] }),
|
|
2276
2282
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2277
|
-
|
|
2283
|
+
_chunkJZWCK7C3cjs.Button,
|
|
2278
2284
|
{
|
|
2279
2285
|
onClick: handleContinue,
|
|
2280
2286
|
fullWidth: true,
|
|
@@ -2282,7 +2288,7 @@ function SolanaAmountStep({
|
|
|
2282
2288
|
children: _optionalChain([uiConfig, 'optionalAccess', _51 => _51.minDepositUsd]) && parseFloat(amount) > 0 && parseFloat(amount) < uiConfig.minDepositUsd ? "Update order" : "Continue"
|
|
2283
2289
|
}
|
|
2284
2290
|
) }),
|
|
2285
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2291
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJZWCK7C3cjs.PoweredBy, {})
|
|
2286
2292
|
] });
|
|
2287
2293
|
}
|
|
2288
2294
|
|
|
@@ -2326,7 +2332,7 @@ function SolanaConfirmStep({
|
|
|
2326
2332
|
const receiveAmount = isSameToken ? formattedReceiveAmount : `~ ${formattedReceiveAmount}`;
|
|
2327
2333
|
const handleConfirm = async () => {
|
|
2328
2334
|
if (!solanaProvider) {
|
|
2329
|
-
|
|
2335
|
+
_chunkJZWCK7C3cjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
2330
2336
|
reason: "missing-provider"
|
|
2331
2337
|
});
|
|
2332
2338
|
setError("Solana wallet not connected");
|
|
@@ -2334,7 +2340,7 @@ function SolanaConfirmStep({
|
|
|
2334
2340
|
}
|
|
2335
2341
|
const parsedAmount = parseFloat(sourceAmount);
|
|
2336
2342
|
if (isNaN(parsedAmount) || parsedAmount <= 0) {
|
|
2337
|
-
|
|
2343
|
+
_chunkJZWCK7C3cjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
2338
2344
|
reason: "invalid-amount",
|
|
2339
2345
|
sourceAmount
|
|
2340
2346
|
});
|
|
@@ -2343,7 +2349,7 @@ function SolanaConfirmStep({
|
|
|
2343
2349
|
}
|
|
2344
2350
|
setError(null);
|
|
2345
2351
|
setIsSubmitting(true);
|
|
2346
|
-
|
|
2352
|
+
_chunkJZWCK7C3cjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
|
|
2347
2353
|
smartAccount,
|
|
2348
2354
|
solanaAddress,
|
|
2349
2355
|
solanaDepositAddress,
|
|
@@ -2353,7 +2359,7 @@ function SolanaConfirmStep({
|
|
|
2353
2359
|
});
|
|
2354
2360
|
try {
|
|
2355
2361
|
const check = await service.checkAccount(smartAccount);
|
|
2356
|
-
|
|
2362
|
+
_chunkJZWCK7C3cjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
|
|
2357
2363
|
smartAccount,
|
|
2358
2364
|
isRegistered: check.isRegistered,
|
|
2359
2365
|
targetChain: check.targetChain,
|
|
@@ -2366,7 +2372,7 @@ function SolanaConfirmStep({
|
|
|
2366
2372
|
}
|
|
2367
2373
|
const connection = getSolanaConnection();
|
|
2368
2374
|
const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
|
|
2369
|
-
|
|
2375
|
+
_chunkJZWCK7C3cjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
|
|
2370
2376
|
token: token.symbol,
|
|
2371
2377
|
sourceAmount,
|
|
2372
2378
|
amountUnits: amountUnits.toString()
|
|
@@ -2383,7 +2389,7 @@ function SolanaConfirmStep({
|
|
|
2383
2389
|
token.mint,
|
|
2384
2390
|
amountUnits
|
|
2385
2391
|
);
|
|
2386
|
-
|
|
2392
|
+
_chunkJZWCK7C3cjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
2387
2393
|
token: token.symbol,
|
|
2388
2394
|
instructionCount: transaction.instructions.length,
|
|
2389
2395
|
feePayer: _optionalChain([transaction, 'access', _52 => _52.feePayer, 'optionalAccess', _53 => _53.toBase58, 'call', _54 => _54()]),
|
|
@@ -2394,15 +2400,15 @@ function SolanaConfirmStep({
|
|
|
2394
2400
|
connection,
|
|
2395
2401
|
transaction
|
|
2396
2402
|
);
|
|
2397
|
-
|
|
2403
|
+
_chunkJZWCK7C3cjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
|
|
2398
2404
|
txHash,
|
|
2399
2405
|
amountUnits: amountUnits.toString()
|
|
2400
2406
|
});
|
|
2401
2407
|
onConfirm(txHash, amountUnits.toString());
|
|
2402
2408
|
} catch (err) {
|
|
2403
2409
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
2404
|
-
const message =
|
|
2405
|
-
|
|
2410
|
+
const message = _chunkJZWCK7C3cjs.formatUserError.call(void 0, raw);
|
|
2411
|
+
_chunkJZWCK7C3cjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
|
|
2406
2412
|
smartAccount,
|
|
2407
2413
|
token: token.symbol,
|
|
2408
2414
|
sourceAmount
|
|
@@ -2535,7 +2541,7 @@ function SolanaConfirmStep({
|
|
|
2535
2541
|
] })
|
|
2536
2542
|
] }),
|
|
2537
2543
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2538
|
-
|
|
2544
|
+
_chunkJZWCK7C3cjs.Button,
|
|
2539
2545
|
{
|
|
2540
2546
|
onClick: handleConfirm,
|
|
2541
2547
|
loading: isSubmitting,
|
|
@@ -2544,7 +2550,7 @@ function SolanaConfirmStep({
|
|
|
2544
2550
|
children: "Confirm Order"
|
|
2545
2551
|
}
|
|
2546
2552
|
) }),
|
|
2547
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2553
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJZWCK7C3cjs.PoweredBy, {})
|
|
2548
2554
|
] });
|
|
2549
2555
|
}
|
|
2550
2556
|
|
|
@@ -2584,6 +2590,7 @@ function DepositFlow({
|
|
|
2584
2590
|
allowedRoutes,
|
|
2585
2591
|
onStepChange,
|
|
2586
2592
|
onTotalBalanceChange,
|
|
2593
|
+
onSmartAccountChange,
|
|
2587
2594
|
onClose,
|
|
2588
2595
|
onConnected,
|
|
2589
2596
|
onDepositSubmitted,
|
|
@@ -2593,9 +2600,10 @@ function DepositFlow({
|
|
|
2593
2600
|
onError,
|
|
2594
2601
|
debug
|
|
2595
2602
|
}) {
|
|
2596
|
-
const onStepChangeRef =
|
|
2597
|
-
const onTotalBalanceChangeRef =
|
|
2598
|
-
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);
|
|
2599
2607
|
const hasInitialReownSession = Boolean(
|
|
2600
2608
|
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _56 => _56.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _57 => _57.address]) : _optionalChain([reownWallet, 'optionalAccess', _58 => _58.address])
|
|
2601
2609
|
);
|
|
@@ -2615,13 +2623,13 @@ function DepositFlow({
|
|
|
2615
2623
|
flowModeRef.current = flowMode;
|
|
2616
2624
|
const logFlow = _react.useCallback.call(void 0,
|
|
2617
2625
|
(message, data) => {
|
|
2618
|
-
|
|
2626
|
+
_chunkJZWCK7C3cjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
|
|
2619
2627
|
},
|
|
2620
2628
|
[debug]
|
|
2621
2629
|
);
|
|
2622
2630
|
const logFlowError = _react.useCallback.call(void 0,
|
|
2623
2631
|
(message, error, data) => {
|
|
2624
|
-
|
|
2632
|
+
_chunkJZWCK7C3cjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
|
|
2625
2633
|
},
|
|
2626
2634
|
[debug]
|
|
2627
2635
|
);
|
|
@@ -2743,7 +2751,7 @@ function DepositFlow({
|
|
|
2743
2751
|
return {
|
|
2744
2752
|
ownerAddress: dappAddress,
|
|
2745
2753
|
walletClient: void 0,
|
|
2746
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
2754
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkJZWCK7C3cjs.getPublicClient.call(void 0, targetChain))),
|
|
2747
2755
|
switchChain: void 0
|
|
2748
2756
|
};
|
|
2749
2757
|
}
|
|
@@ -2752,7 +2760,7 @@ function DepositFlow({
|
|
|
2752
2760
|
return {
|
|
2753
2761
|
ownerAddress: dappWalletClient.account.address,
|
|
2754
2762
|
walletClient: dappWalletClient,
|
|
2755
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
2763
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkJZWCK7C3cjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
2756
2764
|
switchChain: dappSwitchChain
|
|
2757
2765
|
};
|
|
2758
2766
|
}
|
|
@@ -2766,7 +2774,7 @@ function DepositFlow({
|
|
|
2766
2774
|
return {
|
|
2767
2775
|
ownerAddress: dappAddress,
|
|
2768
2776
|
walletClient: void 0,
|
|
2769
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
2777
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkJZWCK7C3cjs.getPublicClient.call(void 0, targetChain))),
|
|
2770
2778
|
switchChain: void 0
|
|
2771
2779
|
};
|
|
2772
2780
|
}
|
|
@@ -2775,7 +2783,7 @@ function DepositFlow({
|
|
|
2775
2783
|
return {
|
|
2776
2784
|
ownerAddress: dappWalletClient.account.address,
|
|
2777
2785
|
walletClient: dappWalletClient,
|
|
2778
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
2786
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkJZWCK7C3cjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
2779
2787
|
switchChain: dappSwitchChain
|
|
2780
2788
|
};
|
|
2781
2789
|
}
|
|
@@ -2783,7 +2791,7 @@ function DepositFlow({
|
|
|
2783
2791
|
return {
|
|
2784
2792
|
ownerAddress: reownWallet.address,
|
|
2785
2793
|
walletClient: reownWallet.walletClient,
|
|
2786
|
-
publicClient: _nullishCoalesce(reownWallet.publicClient, () => (
|
|
2794
|
+
publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunkJZWCK7C3cjs.getPublicClient.call(void 0, targetChain))),
|
|
2787
2795
|
switchChain: reownWallet.switchChain
|
|
2788
2796
|
};
|
|
2789
2797
|
}
|
|
@@ -2821,7 +2829,7 @@ function DepositFlow({
|
|
|
2821
2829
|
return {
|
|
2822
2830
|
ownerAddress: dappAddress,
|
|
2823
2831
|
walletClient: void 0,
|
|
2824
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
2832
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkJZWCK7C3cjs.getPublicClient.call(void 0, targetChain))),
|
|
2825
2833
|
switchChain: void 0
|
|
2826
2834
|
};
|
|
2827
2835
|
}
|
|
@@ -2999,12 +3007,13 @@ function DepositFlow({
|
|
|
2999
3007
|
setStep({ type: "setup" });
|
|
3000
3008
|
}, []);
|
|
3001
3009
|
const handleNewDeposit = _react.useCallback.call(void 0, () => {
|
|
3010
|
+
_optionalChain([onSmartAccountChangeRef, 'access', _95 => _95.current, 'optionalCall', _96 => _96(null)]);
|
|
3002
3011
|
setFlowMode(null);
|
|
3003
3012
|
setStep({ type: "setup" });
|
|
3004
3013
|
setIsConnectSelectionConfirmed(false);
|
|
3005
3014
|
setSelectedWalletId(null);
|
|
3006
3015
|
hasNavigatedBackRef.current = false;
|
|
3007
|
-
}, []);
|
|
3016
|
+
}, [onSmartAccountChangeRef]);
|
|
3008
3017
|
const handleSetupComplete = _react.useCallback.call(void 0,
|
|
3009
3018
|
(smartAccount, solanaDepositAddress) => {
|
|
3010
3019
|
logFlow("setup:complete", {
|
|
@@ -3012,6 +3021,7 @@ function DepositFlow({
|
|
|
3012
3021
|
hasSolanaDepositAddress: Boolean(solanaDepositAddress),
|
|
3013
3022
|
flowMode: isDepositAddressMode ? "deposit-address" : isSolanaWalletMode ? "solana-wallet" : "wallet"
|
|
3014
3023
|
});
|
|
3024
|
+
_optionalChain([onSmartAccountChangeRef, 'access', _97 => _97.current, 'optionalCall', _98 => _98(smartAccount)]);
|
|
3015
3025
|
if (isDepositAddressMode) {
|
|
3016
3026
|
setStep({
|
|
3017
3027
|
type: "deposit-address",
|
|
@@ -3026,7 +3036,7 @@ function DepositFlow({
|
|
|
3026
3036
|
solanaDepositAddress
|
|
3027
3037
|
});
|
|
3028
3038
|
} else {
|
|
3029
|
-
_optionalChain([onError, 'optionalCall',
|
|
3039
|
+
_optionalChain([onError, 'optionalCall', _99 => _99({
|
|
3030
3040
|
message: "Solana deposit address not available. Please try again.",
|
|
3031
3041
|
code: "SOLANA_SETUP_FAILED"
|
|
3032
3042
|
})]);
|
|
@@ -3035,7 +3045,7 @@ function DepositFlow({
|
|
|
3035
3045
|
setStep({ type: "select-asset", smartAccount });
|
|
3036
3046
|
}
|
|
3037
3047
|
},
|
|
3038
|
-
[isDepositAddressMode, isSolanaWalletMode, logFlow]
|
|
3048
|
+
[isDepositAddressMode, isSolanaWalletMode, logFlow, onSmartAccountChangeRef]
|
|
3039
3049
|
);
|
|
3040
3050
|
const handleDepositAddressDetected = _react.useCallback.call(void 0,
|
|
3041
3051
|
(txHash, chainId, amount, token, sourceSymbol, sourceDecimals) => {
|
|
@@ -3061,7 +3071,7 @@ function DepositFlow({
|
|
|
3061
3071
|
directTransfer
|
|
3062
3072
|
};
|
|
3063
3073
|
});
|
|
3064
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
3074
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _100 => _100({ txHash, sourceChain: chainId, amount })]);
|
|
3065
3075
|
},
|
|
3066
3076
|
[onDepositSubmitted, targetChain, targetToken]
|
|
3067
3077
|
);
|
|
@@ -3133,7 +3143,7 @@ function DepositFlow({
|
|
|
3133
3143
|
sourceDecimals: prev.token.decimals
|
|
3134
3144
|
};
|
|
3135
3145
|
});
|
|
3136
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
3146
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _101 => _101({
|
|
3137
3147
|
txHash,
|
|
3138
3148
|
sourceChain: "solana",
|
|
3139
3149
|
amount: amountUnits
|
|
@@ -3143,13 +3153,13 @@ function DepositFlow({
|
|
|
3143
3153
|
);
|
|
3144
3154
|
const handleConnected = _react.useCallback.call(void 0,
|
|
3145
3155
|
(addr, smartAccount) => {
|
|
3146
|
-
_optionalChain([onConnected, 'optionalCall',
|
|
3156
|
+
_optionalChain([onConnected, 'optionalCall', _102 => _102({ address: addr, smartAccount })]);
|
|
3147
3157
|
},
|
|
3148
3158
|
[onConnected]
|
|
3149
3159
|
);
|
|
3150
3160
|
const handleAssetContinue = _react.useCallback.call(void 0,
|
|
3151
3161
|
(asset) => {
|
|
3152
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
3162
|
+
_optionalChain([onEvent, 'optionalCall', _103 => _103({
|
|
3153
3163
|
type: "deposit_modal_connected_wallet_select_source_cta_click",
|
|
3154
3164
|
total_balance_in_external_wallet: totalBalanceUsd,
|
|
3155
3165
|
pred_balance: totalBalanceUsd,
|
|
@@ -3214,28 +3224,28 @@ function DepositFlow({
|
|
|
3214
3224
|
);
|
|
3215
3225
|
const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
|
|
3216
3226
|
(txHash, sourceChain, amount) => {
|
|
3217
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
3227
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _104 => _104({ txHash, sourceChain, amount })]);
|
|
3218
3228
|
},
|
|
3219
3229
|
[onDepositSubmitted]
|
|
3220
3230
|
);
|
|
3221
3231
|
const handleDepositComplete = _react.useCallback.call(void 0,
|
|
3222
3232
|
(txHash, destinationTxHash, context) => {
|
|
3223
3233
|
logFlow("deposit:complete", { txHash, destinationTxHash, ...context });
|
|
3224
|
-
_optionalChain([onDepositComplete, 'optionalCall',
|
|
3234
|
+
_optionalChain([onDepositComplete, 'optionalCall', _105 => _105({ txHash, destinationTxHash, ...context })]);
|
|
3225
3235
|
},
|
|
3226
3236
|
[logFlow, onDepositComplete]
|
|
3227
3237
|
);
|
|
3228
3238
|
const handleDepositFailed = _react.useCallback.call(void 0,
|
|
3229
3239
|
(txHash, error) => {
|
|
3230
3240
|
logFlowError("deposit:failed", error, { txHash });
|
|
3231
|
-
_optionalChain([onDepositFailed, 'optionalCall',
|
|
3241
|
+
_optionalChain([onDepositFailed, 'optionalCall', _106 => _106({ txHash, error })]);
|
|
3232
3242
|
},
|
|
3233
3243
|
[logFlowError, onDepositFailed]
|
|
3234
3244
|
);
|
|
3235
3245
|
const handleError = _react.useCallback.call(void 0,
|
|
3236
3246
|
(message, code) => {
|
|
3237
3247
|
logFlowError("flow:error", message, { code });
|
|
3238
|
-
_optionalChain([onError, 'optionalCall',
|
|
3248
|
+
_optionalChain([onError, 'optionalCall', _107 => _107({ message, code })]);
|
|
3239
3249
|
},
|
|
3240
3250
|
[logFlowError, onError]
|
|
3241
3251
|
);
|
|
@@ -3292,7 +3302,7 @@ function DepositFlow({
|
|
|
3292
3302
|
if (walletId) {
|
|
3293
3303
|
const selectedOption = walletOptions.find((o) => o.id === walletId);
|
|
3294
3304
|
setSelectedWalletId(walletId);
|
|
3295
|
-
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess',
|
|
3305
|
+
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess', _108 => _108.kind]) === "solana") {
|
|
3296
3306
|
handleSelectSolanaWallet();
|
|
3297
3307
|
} else {
|
|
3298
3308
|
handleSelectProvider();
|
|
@@ -3322,7 +3332,7 @@ function DepositFlow({
|
|
|
3322
3332
|
]);
|
|
3323
3333
|
if (showConnectStep) {
|
|
3324
3334
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3325
|
-
|
|
3335
|
+
_chunkJZWCK7C3cjs.ConnectStep,
|
|
3326
3336
|
{
|
|
3327
3337
|
walletOptions,
|
|
3328
3338
|
selectedWalletId: selectedWalletIdEffective,
|
|
@@ -3341,7 +3351,7 @@ function DepositFlow({
|
|
|
3341
3351
|
const selectedOption = walletOptions.find(
|
|
3342
3352
|
(o) => o.id === selectedWalletIdEffective
|
|
3343
3353
|
);
|
|
3344
|
-
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess',
|
|
3354
|
+
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess', _109 => _109.kind]) === "solana") {
|
|
3345
3355
|
handleSelectSolanaWallet();
|
|
3346
3356
|
} else {
|
|
3347
3357
|
handleSelectProvider();
|
|
@@ -3384,7 +3394,7 @@ function DepositFlow({
|
|
|
3384
3394
|
onCopyAddress: () => {
|
|
3385
3395
|
const chainName = _chunkR6U6BHCVcjs.getChainName.call(void 0, targetChain);
|
|
3386
3396
|
const tokenSymbol = _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3387
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
3397
|
+
_optionalChain([onEvent, 'optionalCall', _110 => _110({
|
|
3388
3398
|
type: "deposit_modal_transfer_crypto_cta_click",
|
|
3389
3399
|
default_chain: chainName,
|
|
3390
3400
|
default_token: tokenSymbol,
|
|
@@ -3396,7 +3406,7 @@ function DepositFlow({
|
|
|
3396
3406
|
}
|
|
3397
3407
|
),
|
|
3398
3408
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3399
|
-
|
|
3409
|
+
_chunkJZWCK7C3cjs.ProcessingStep,
|
|
3400
3410
|
{
|
|
3401
3411
|
smartAccount: step.smartAccount,
|
|
3402
3412
|
txHash: step.txHash,
|
|
@@ -3408,7 +3418,7 @@ function DepositFlow({
|
|
|
3408
3418
|
sourceSymbol: step.sourceSymbol,
|
|
3409
3419
|
sourceDecimals: step.sourceDecimals,
|
|
3410
3420
|
waitForFinalTx,
|
|
3411
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
3421
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _111 => _111.length])),
|
|
3412
3422
|
service,
|
|
3413
3423
|
directTransfer: step.directTransfer,
|
|
3414
3424
|
onClose,
|
|
@@ -3423,8 +3433,8 @@ function DepositFlow({
|
|
|
3423
3433
|
}
|
|
3424
3434
|
if (isSolanaWalletMode) {
|
|
3425
3435
|
if (!sessionKeyAddress) return null;
|
|
3426
|
-
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess',
|
|
3427
|
-
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess',
|
|
3436
|
+
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess', _112 => _112.solanaAddress]);
|
|
3437
|
+
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess', _113 => _113.solanaProvider]);
|
|
3428
3438
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
3429
3439
|
step.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3430
3440
|
SetupStep,
|
|
@@ -3520,7 +3530,7 @@ function DepositFlow({
|
|
|
3520
3530
|
) })
|
|
3521
3531
|
] }) : null,
|
|
3522
3532
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3523
|
-
|
|
3533
|
+
_chunkJZWCK7C3cjs.ProcessingStep,
|
|
3524
3534
|
{
|
|
3525
3535
|
smartAccount: step.smartAccount,
|
|
3526
3536
|
txHash: step.txHash,
|
|
@@ -3532,7 +3542,7 @@ function DepositFlow({
|
|
|
3532
3542
|
sourceSymbol: step.sourceSymbol,
|
|
3533
3543
|
sourceDecimals: step.sourceDecimals,
|
|
3534
3544
|
waitForFinalTx,
|
|
3535
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
3545
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _114 => _114.length])),
|
|
3536
3546
|
service,
|
|
3537
3547
|
directTransfer: step.directTransfer,
|
|
3538
3548
|
onClose,
|
|
@@ -3545,16 +3555,16 @@ function DepositFlow({
|
|
|
3545
3555
|
)
|
|
3546
3556
|
] });
|
|
3547
3557
|
}
|
|
3548
|
-
if (!_optionalChain([signerContext, 'optionalAccess',
|
|
3558
|
+
if (!_optionalChain([signerContext, 'optionalAccess', _115 => _115.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _116 => _116.publicClient])) {
|
|
3549
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..." }) }) }) }) });
|
|
3550
3560
|
}
|
|
3551
3561
|
const ownerAddress = signerContext.ownerAddress;
|
|
3552
|
-
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));
|
|
3553
3563
|
const getReadClientForChain = (chainId) => {
|
|
3554
|
-
if (_optionalChain([signerContext, 'access',
|
|
3564
|
+
if (_optionalChain([signerContext, 'access', _123 => _123.publicClient, 'access', _124 => _124.chain, 'optionalAccess', _125 => _125.id]) === chainId) {
|
|
3555
3565
|
return signerContext.publicClient;
|
|
3556
3566
|
}
|
|
3557
|
-
return
|
|
3567
|
+
return _chunkJZWCK7C3cjs.getPublicClient.call(void 0, chainId);
|
|
3558
3568
|
};
|
|
3559
3569
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
3560
3570
|
step.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3605,7 +3615,7 @@ function DepositFlow({
|
|
|
3605
3615
|
onContinue: handleAmountContinue,
|
|
3606
3616
|
onCtaClick: (ctaName) => {
|
|
3607
3617
|
const receiveSymbol = _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3608
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
3618
|
+
_optionalChain([onEvent, 'optionalCall', _126 => _126({
|
|
3609
3619
|
type: "deposit_modal_connected_wallet_enter_value_cta_click",
|
|
3610
3620
|
send_token: step.asset.symbol,
|
|
3611
3621
|
receive_token: receiveSymbol,
|
|
@@ -3636,7 +3646,7 @@ function DepositFlow({
|
|
|
3636
3646
|
}
|
|
3637
3647
|
),
|
|
3638
3648
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3639
|
-
|
|
3649
|
+
_chunkJZWCK7C3cjs.ProcessingStep,
|
|
3640
3650
|
{
|
|
3641
3651
|
smartAccount: step.smartAccount,
|
|
3642
3652
|
txHash: step.txHash,
|
|
@@ -3648,7 +3658,7 @@ function DepositFlow({
|
|
|
3648
3658
|
sourceSymbol: step.sourceSymbol,
|
|
3649
3659
|
sourceDecimals: step.sourceDecimals,
|
|
3650
3660
|
waitForFinalTx,
|
|
3651
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
3661
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _127 => _127.length])),
|
|
3652
3662
|
service,
|
|
3653
3663
|
directTransfer: step.directTransfer,
|
|
3654
3664
|
onClose,
|
|
@@ -3662,10 +3672,251 @@ function DepositFlow({
|
|
|
3662
3672
|
] });
|
|
3663
3673
|
}
|
|
3664
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
|
+
|
|
3665
3916
|
// src/DepositModal.tsx
|
|
3666
3917
|
|
|
3667
3918
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
3668
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
3919
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-WFXQKZDH.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
3669
3920
|
);
|
|
3670
3921
|
function DepositModal(props) {
|
|
3671
3922
|
const needsReown = !!props.reownAppId;
|
|
@@ -3734,14 +3985,24 @@ function DepositModalInner({
|
|
|
3734
3985
|
debug
|
|
3735
3986
|
}) {
|
|
3736
3987
|
const modalRef = _react.useRef.call(void 0, null);
|
|
3737
|
-
const onReadyRef =
|
|
3988
|
+
const onReadyRef = _chunkJZWCK7C3cjs.useLatestRef.call(void 0, onReady);
|
|
3738
3989
|
const [currentStepIndex, setCurrentStepIndex] = _react.useState.call(void 0, 0);
|
|
3739
3990
|
const [totalBalanceUsd, setTotalBalanceUsd] = _react.useState.call(void 0, null);
|
|
3740
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);
|
|
3741
4002
|
const targetChain = _chunkR6U6BHCVcjs.getChainId.call(void 0, targetChainProp);
|
|
3742
4003
|
const sourceChain = sourceChainProp ? _chunkR6U6BHCVcjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
3743
4004
|
const service = _react.useMemo.call(void 0,
|
|
3744
|
-
() =>
|
|
4005
|
+
() => _chunkJZWCK7C3cjs.createDepositService.call(void 0, backendUrl, {
|
|
3745
4006
|
debug,
|
|
3746
4007
|
debugScope: "service:deposit"
|
|
3747
4008
|
}),
|
|
@@ -3749,7 +4010,7 @@ function DepositModalInner({
|
|
|
3749
4010
|
);
|
|
3750
4011
|
_react.useEffect.call(void 0, () => {
|
|
3751
4012
|
if (isOpen && modalRef.current) {
|
|
3752
|
-
|
|
4013
|
+
_chunkJZWCK7C3cjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
3753
4014
|
}
|
|
3754
4015
|
}, [isOpen, theme]);
|
|
3755
4016
|
_react.useEffect.call(void 0, () => {
|
|
@@ -3759,7 +4020,7 @@ function DepositModalInner({
|
|
|
3759
4020
|
_react.useEffect.call(void 0, () => {
|
|
3760
4021
|
if (isOpen && !hasCalledReady.current) {
|
|
3761
4022
|
hasCalledReady.current = true;
|
|
3762
|
-
_optionalChain([onReadyRef, 'access',
|
|
4023
|
+
_optionalChain([onReadyRef, 'access', _129 => _129.current, 'optionalCall', _130 => _130()]);
|
|
3763
4024
|
}
|
|
3764
4025
|
}, [isOpen, onReadyRef]);
|
|
3765
4026
|
_react.useEffect.call(void 0, () => {
|
|
@@ -3778,17 +4039,119 @@ function DepositModalInner({
|
|
|
3778
4039
|
setTotalBalanceUsd(balance2);
|
|
3779
4040
|
}, []);
|
|
3780
4041
|
const handleBack = _react.useCallback.call(void 0, () => {
|
|
3781
|
-
_optionalChain([backHandlerRef, 'access',
|
|
4042
|
+
_optionalChain([backHandlerRef, 'access', _131 => _131.current, 'optionalCall', _132 => _132()]);
|
|
3782
4043
|
}, []);
|
|
3783
|
-
const
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
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"));
|
|
3789
4152
|
const canGoBack = currentStepIndex > 0 && currentStepIndex < 4 && backHandlerRef.current !== void 0;
|
|
3790
4153
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3791
|
-
|
|
4154
|
+
_chunkJZWCK7C3cjs.Modal,
|
|
3792
4155
|
{
|
|
3793
4156
|
isOpen,
|
|
3794
4157
|
onClose,
|
|
@@ -3881,35 +4244,64 @@ function DepositModalInner({
|
|
|
3881
4244
|
balance.title,
|
|
3882
4245
|
":"
|
|
3883
4246
|
] }),
|
|
3884
|
-
/* @__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))) })
|
|
3885
4248
|
] })
|
|
3886
4249
|
] }),
|
|
3887
|
-
/* @__PURE__ */ _jsxruntime.
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
"
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
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
|
+
] })
|
|
3913
4305
|
] }),
|
|
3914
4306
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3915
4307
|
DepositFlow,
|
|
@@ -3940,15 +4332,28 @@ function DepositModalInner({
|
|
|
3940
4332
|
allowedRoutes,
|
|
3941
4333
|
onStepChange: handleStepChange,
|
|
3942
4334
|
onTotalBalanceChange: handleTotalBalanceChange,
|
|
4335
|
+
onSmartAccountChange: showHistoryButton ? handleSmartAccountChange : void 0,
|
|
3943
4336
|
onClose,
|
|
3944
4337
|
onConnected,
|
|
3945
|
-
onDepositSubmitted,
|
|
3946
|
-
onDepositComplete,
|
|
3947
|
-
onDepositFailed,
|
|
4338
|
+
onDepositSubmitted: showHistoryButton ? handleDepositSubmitted : onDepositSubmitted,
|
|
4339
|
+
onDepositComplete: showHistoryButton ? handleDepositComplete : onDepositComplete,
|
|
4340
|
+
onDepositFailed: showHistoryButton ? handleDepositFailed : onDepositFailed,
|
|
3948
4341
|
onEvent,
|
|
3949
4342
|
onError,
|
|
3950
4343
|
debug
|
|
3951
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
|
+
}
|
|
3952
4357
|
)
|
|
3953
4358
|
] })
|
|
3954
4359
|
}
|