@rhinestone/deposit-modal 0.2.1 → 0.2.3
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-MMDTCHQL.cjs → DepositModalReown-QPJ5TT57.cjs} +3 -3
- package/dist/{DepositModalReown-IIEXOTKU.mjs → DepositModalReown-SJHEU6RQ.mjs} +2 -2
- package/dist/{WithdrawModalReown-HXTXSZCJ.cjs → WithdrawModalReown-KGKKBTC7.cjs} +3 -3
- package/dist/{WithdrawModalReown-URF6AERQ.mjs → WithdrawModalReown-RUJZCQ4C.mjs} +2 -2
- package/dist/{chunk-7TEGUTU4.cjs → chunk-5EU7N73M.cjs} +42 -42
- package/dist/{chunk-HTYUCLJP.mjs → chunk-DGT2DZXN.mjs} +117 -35
- package/dist/{chunk-3CRG5NPG.mjs → chunk-JRNGXHWQ.mjs} +6 -2
- package/dist/{chunk-TKTOPC2W.mjs → chunk-MKO5TNVQ.mjs} +2 -2
- package/dist/{chunk-XW4M7WDI.cjs → chunk-T2KOQH57.cjs} +6 -2
- package/dist/{chunk-PZ3GVS3D.cjs → chunk-TYJEZX6S.cjs} +216 -134
- package/dist/deposit.cjs +3 -3
- package/dist/deposit.mjs +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.mjs +3 -3
- package/dist/reown.cjs +4 -4
- package/dist/reown.mjs +3 -3
- package/dist/styles.css +10 -0
- package/dist/withdraw.cjs +3 -3
- package/dist/withdraw.mjs +2 -2
- package/package.json +1 -1
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
var
|
|
31
|
+
var _chunkT2KOQH57cjs = require('./chunk-T2KOQH57.cjs');
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
@@ -68,15 +68,15 @@ var _viem = require('viem');
|
|
|
68
68
|
|
|
69
69
|
var _jsxruntime = require('react/jsx-runtime');
|
|
70
70
|
async function resolveSessionOwner(eoaAddress) {
|
|
71
|
-
const localOwner =
|
|
71
|
+
const localOwner = _chunkT2KOQH57cjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
72
72
|
if (localOwner) {
|
|
73
73
|
return {
|
|
74
|
-
account:
|
|
74
|
+
account: _chunkT2KOQH57cjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
75
75
|
address: localOwner.address
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
const created =
|
|
79
|
-
|
|
78
|
+
const created = _chunkT2KOQH57cjs.createSessionOwnerKey.call(void 0, );
|
|
79
|
+
_chunkT2KOQH57cjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
80
80
|
return {
|
|
81
81
|
account: created.account,
|
|
82
82
|
address: created.address
|
|
@@ -115,7 +115,7 @@ function SetupStep({
|
|
|
115
115
|
const setup = await service.setupAccount({
|
|
116
116
|
ownerAddress: address,
|
|
117
117
|
sessionOwnerAddress: sessionOwner.address,
|
|
118
|
-
targetChain:
|
|
118
|
+
targetChain: _chunkT2KOQH57cjs.toEvmCaip2.call(void 0, targetChain),
|
|
119
119
|
targetToken,
|
|
120
120
|
recipient,
|
|
121
121
|
postBridgeActions,
|
|
@@ -149,7 +149,7 @@ function SetupStep({
|
|
|
149
149
|
primaryType: typedData.primaryType,
|
|
150
150
|
message: typedData.message
|
|
151
151
|
});
|
|
152
|
-
const sessionDetails =
|
|
152
|
+
const sessionDetails = _chunkT2KOQH57cjs.buildSessionDetails.call(void 0, setup.sessionDetailsUnsigned, signature);
|
|
153
153
|
setState({ type: "registering" });
|
|
154
154
|
const registerResult = await service.registerAccount({
|
|
155
155
|
address: smartAccount,
|
|
@@ -161,7 +161,7 @@ function SetupStep({
|
|
|
161
161
|
eoaAddress: address,
|
|
162
162
|
sessionOwner: sessionOwner.address,
|
|
163
163
|
target: {
|
|
164
|
-
chain:
|
|
164
|
+
chain: _chunkT2KOQH57cjs.toEvmCaip2.call(void 0, targetChain),
|
|
165
165
|
token: targetToken,
|
|
166
166
|
...recipient && { recipient },
|
|
167
167
|
..._optionalChain([postBridgeActions, 'optionalAccess', _2 => _2.length]) && { postBridgeActions },
|
|
@@ -230,7 +230,7 @@ function SetupStep({
|
|
|
230
230
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
231
231
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", children: [
|
|
232
232
|
isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
233
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
233
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT2KOQH57cjs.Spinner, { className: "rs-spinner--lg rs-text-accent" }),
|
|
234
234
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-text", children: [
|
|
235
235
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-title", children: renderStateMessage() }),
|
|
236
236
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-subtitle", children: "This may take a moment" })
|
|
@@ -267,7 +267,7 @@ function SetupStep({
|
|
|
267
267
|
] })
|
|
268
268
|
] })
|
|
269
269
|
] }),
|
|
270
|
-
isError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
270
|
+
isError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT2KOQH57cjs.Button, { onClick: handleRetry, variant: "default", fullWidth: true, children: "Try Again" }) })
|
|
271
271
|
] });
|
|
272
272
|
}
|
|
273
273
|
|
|
@@ -293,7 +293,7 @@ function AssetSelectStep({
|
|
|
293
293
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
294
294
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
295
295
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
296
|
-
return
|
|
296
|
+
return _chunkT2KOQH57cjs.getAssetId.call(void 0, {
|
|
297
297
|
chainId: defaultSourceChain,
|
|
298
298
|
token: defaultSourceToken
|
|
299
299
|
});
|
|
@@ -310,7 +310,7 @@ function AssetSelectStep({
|
|
|
310
310
|
try {
|
|
311
311
|
const portfolio = await service.fetchPortfolio(address);
|
|
312
312
|
if (!active) return;
|
|
313
|
-
const portfolioAssets =
|
|
313
|
+
const portfolioAssets = _chunkT2KOQH57cjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
314
314
|
setAssets(portfolioAssets);
|
|
315
315
|
const hasNative = portfolioAssets.some(
|
|
316
316
|
(asset) => asset.token.toLowerCase() === _chunkMUWVDVY4cjs.NATIVE_TOKEN_ADDRESS
|
|
@@ -391,7 +391,7 @@ function AssetSelectStep({
|
|
|
391
391
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
392
392
|
const numeric = Number(raw);
|
|
393
393
|
if (!Number.isFinite(numeric)) return raw;
|
|
394
|
-
return
|
|
394
|
+
return _chunkT2KOQH57cjs.tokenFormatter.format(numeric);
|
|
395
395
|
} catch (e3) {
|
|
396
396
|
return asset.balance;
|
|
397
397
|
}
|
|
@@ -405,7 +405,7 @@ function AssetSelectStep({
|
|
|
405
405
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
406
406
|
children: [
|
|
407
407
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
408
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
408
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT2KOQH57cjs.Spinner, { className: "rs-text-tertiary" }),
|
|
409
409
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
410
410
|
] }),
|
|
411
411
|
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 }) }),
|
|
@@ -504,7 +504,7 @@ function AssetSelectStep({
|
|
|
504
504
|
] })
|
|
505
505
|
] })
|
|
506
506
|
] }),
|
|
507
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ?
|
|
507
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: asset.balanceUsd !== void 0 && asset.balanceUsd > 0 ? _chunkT2KOQH57cjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
508
508
|
]
|
|
509
509
|
},
|
|
510
510
|
asset.id
|
|
@@ -514,7 +514,7 @@ function AssetSelectStep({
|
|
|
514
514
|
}
|
|
515
515
|
),
|
|
516
516
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
517
|
-
|
|
517
|
+
_chunkT2KOQH57cjs.Button,
|
|
518
518
|
{
|
|
519
519
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
520
520
|
disabled: !selectedAsset,
|
|
@@ -522,7 +522,7 @@ function AssetSelectStep({
|
|
|
522
522
|
children: "Continue"
|
|
523
523
|
}
|
|
524
524
|
) }),
|
|
525
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
525
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT2KOQH57cjs.PoweredBy, {})
|
|
526
526
|
] });
|
|
527
527
|
}
|
|
528
528
|
async function fetchNativeAssets(address, publicClient, existing) {
|
|
@@ -530,7 +530,7 @@ async function fetchNativeAssets(address, publicClient, existing) {
|
|
|
530
530
|
const connectedChainId = _optionalChain([publicClient, 'access', _12 => _12.chain, 'optionalAccess', _13 => _13.id]);
|
|
531
531
|
if (!connectedChainId) return [];
|
|
532
532
|
if (!_chunkMUWVDVY4cjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
|
|
533
|
-
const id =
|
|
533
|
+
const id = _chunkT2KOQH57cjs.getAssetId.call(void 0, {
|
|
534
534
|
chainId: connectedChainId,
|
|
535
535
|
token: _chunkMUWVDVY4cjs.NATIVE_TOKEN_ADDRESS
|
|
536
536
|
});
|
|
@@ -619,7 +619,7 @@ function AmountStep({
|
|
|
619
619
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
620
620
|
if (!balanceTarget || !publicClient) return;
|
|
621
621
|
try {
|
|
622
|
-
const bal =
|
|
622
|
+
const bal = _chunkT2KOQH57cjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
623
623
|
address: asset.token,
|
|
624
624
|
abi: _viem.erc20Abi,
|
|
625
625
|
functionName: "balanceOf",
|
|
@@ -645,7 +645,7 @@ function AmountStep({
|
|
|
645
645
|
setIsSwitching(true);
|
|
646
646
|
switchChain(asset.chainId).catch((err) => {
|
|
647
647
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
648
|
-
setError(
|
|
648
|
+
setError(_chunkT2KOQH57cjs.formatUserError.call(void 0, raw));
|
|
649
649
|
}).finally(() => {
|
|
650
650
|
setIsSwitching(false);
|
|
651
651
|
});
|
|
@@ -681,7 +681,7 @@ function AmountStep({
|
|
|
681
681
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
682
682
|
const numeric = Number(raw);
|
|
683
683
|
if (!Number.isFinite(numeric)) return raw;
|
|
684
|
-
return
|
|
684
|
+
return _chunkT2KOQH57cjs.tokenFormatter.format(numeric);
|
|
685
685
|
} catch (e8) {
|
|
686
686
|
return "...";
|
|
687
687
|
}
|
|
@@ -725,7 +725,7 @@ function AmountStep({
|
|
|
725
725
|
const usdValue = numericAmount;
|
|
726
726
|
if (_optionalChain([uiConfig, 'optionalAccess', _18 => _18.maxDepositUsd]) && usdValue > uiConfig.maxDepositUsd) {
|
|
727
727
|
setError(
|
|
728
|
-
`Maximum deposit is ${
|
|
728
|
+
`Maximum deposit is ${_chunkT2KOQH57cjs.currencyFormatter.format(uiConfig.maxDepositUsd)}`
|
|
729
729
|
);
|
|
730
730
|
return;
|
|
731
731
|
}
|
|
@@ -807,7 +807,7 @@ function AmountStep({
|
|
|
807
807
|
hasPricing && balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { style: { color: "var(--rs-muted-foreground)" }, children: [
|
|
808
808
|
" ",
|
|
809
809
|
"(",
|
|
810
|
-
|
|
810
|
+
_chunkT2KOQH57cjs.currencyFormatter.format(balanceUsd),
|
|
811
811
|
")"
|
|
812
812
|
] })
|
|
813
813
|
] }) })
|
|
@@ -944,7 +944,7 @@ function AmountStep({
|
|
|
944
944
|
)
|
|
945
945
|
] }),
|
|
946
946
|
_optionalChain([uiConfig, 'optionalAccess', _21 => _21.minDepositUsd]) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-minimum", children: [
|
|
947
|
-
|
|
947
|
+
_chunkT2KOQH57cjs.currencyFormatter.format(uiConfig.minDepositUsd),
|
|
948
948
|
" minimum deposit"
|
|
949
949
|
] }),
|
|
950
950
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", children: [
|
|
@@ -970,7 +970,7 @@ function AmountStep({
|
|
|
970
970
|
] })
|
|
971
971
|
] }),
|
|
972
972
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
973
|
-
|
|
973
|
+
_chunkT2KOQH57cjs.Button,
|
|
974
974
|
{
|
|
975
975
|
onClick: handleContinue,
|
|
976
976
|
fullWidth: true,
|
|
@@ -978,7 +978,7 @@ function AmountStep({
|
|
|
978
978
|
children: isCheckingLiquidity ? "Checking liquidity\u2026" : _optionalChain([uiConfig, 'optionalAccess', _22 => _22.minDepositUsd]) && parseFloat(amount) > 0 && parseFloat(amount) < uiConfig.minDepositUsd ? "Update order" : "Continue"
|
|
979
979
|
}
|
|
980
980
|
) }),
|
|
981
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
981
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT2KOQH57cjs.PoweredBy, {})
|
|
982
982
|
] });
|
|
983
983
|
}
|
|
984
984
|
|
|
@@ -1029,7 +1029,7 @@ function ConfirmStep({
|
|
|
1029
1029
|
setIsSwitching(true);
|
|
1030
1030
|
switchChain(asset.chainId).catch((err) => {
|
|
1031
1031
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
1032
|
-
setError(
|
|
1032
|
+
setError(_chunkT2KOQH57cjs.formatUserError.call(void 0, raw));
|
|
1033
1033
|
}).finally(() => {
|
|
1034
1034
|
setIsSwitching(false);
|
|
1035
1035
|
});
|
|
@@ -1072,7 +1072,7 @@ function ConfirmStep({
|
|
|
1072
1072
|
throw new Error("Wallet not properly connected");
|
|
1073
1073
|
}
|
|
1074
1074
|
const transferTo = sameRoute ? recipient : smartAccount;
|
|
1075
|
-
const hash =
|
|
1075
|
+
const hash = _chunkT2KOQH57cjs.isNativeAsset.call(void 0, asset) ? await walletClient.sendTransaction({
|
|
1076
1076
|
account,
|
|
1077
1077
|
chain,
|
|
1078
1078
|
to: transferTo,
|
|
@@ -1089,7 +1089,7 @@ function ConfirmStep({
|
|
|
1089
1089
|
onConfirm(hash, asset.chainId, amountUnits.toString(), asset.token);
|
|
1090
1090
|
} catch (err) {
|
|
1091
1091
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
1092
|
-
const message =
|
|
1092
|
+
const message = _chunkT2KOQH57cjs.formatUserError.call(void 0, raw);
|
|
1093
1093
|
setError(message);
|
|
1094
1094
|
_optionalChain([onError, 'optionalCall', _26 => _26(message, "TRANSFER_ERROR")]);
|
|
1095
1095
|
} finally {
|
|
@@ -1231,7 +1231,7 @@ function ConfirmStep({
|
|
|
1231
1231
|
] })
|
|
1232
1232
|
] }),
|
|
1233
1233
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1234
|
-
|
|
1234
|
+
_chunkT2KOQH57cjs.Button,
|
|
1235
1235
|
{
|
|
1236
1236
|
onClick: handleConfirm,
|
|
1237
1237
|
loading: isSubmitting,
|
|
@@ -1240,7 +1240,7 @@ function ConfirmStep({
|
|
|
1240
1240
|
children: "Confirm Order"
|
|
1241
1241
|
}
|
|
1242
1242
|
) }),
|
|
1243
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1243
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT2KOQH57cjs.PoweredBy, {})
|
|
1244
1244
|
] });
|
|
1245
1245
|
}
|
|
1246
1246
|
|
|
@@ -1378,9 +1378,9 @@ var INITIAL_POLL_INTERVAL = 3e3;
|
|
|
1378
1378
|
var MAX_POLL_INTERVAL = 3e4;
|
|
1379
1379
|
var BACKOFF_MULTIPLIER = 1.5;
|
|
1380
1380
|
function isEventForTx(event, txHash) {
|
|
1381
|
-
const eventTxHash =
|
|
1381
|
+
const eventTxHash = _chunkT2KOQH57cjs.getEventTxHash.call(void 0, event);
|
|
1382
1382
|
if (!eventTxHash) return false;
|
|
1383
|
-
return
|
|
1383
|
+
return _chunkT2KOQH57cjs.txRefsMatch.call(void 0, eventTxHash, txHash);
|
|
1384
1384
|
}
|
|
1385
1385
|
function truncateHash(hash) {
|
|
1386
1386
|
return `${hash.slice(0, 4)}\u2026${hash.slice(-4)}`;
|
|
@@ -1451,6 +1451,7 @@ var txLinkIcon = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
|
1451
1451
|
function DepositNotification({
|
|
1452
1452
|
deposit,
|
|
1453
1453
|
smartAccount,
|
|
1454
|
+
solanaDepositAddress,
|
|
1454
1455
|
targetChain,
|
|
1455
1456
|
targetToken,
|
|
1456
1457
|
waitForFinalTx,
|
|
@@ -1474,7 +1475,7 @@ function DepositNotification({
|
|
|
1474
1475
|
const pollIntervalRef = _react.useRef.call(void 0, INITIAL_POLL_INTERVAL);
|
|
1475
1476
|
const pollTimeoutRef = _react.useRef.call(void 0, null);
|
|
1476
1477
|
const completedRef = _react.useRef.call(void 0, _nullishCoalesce(directTransfer, () => ( false)));
|
|
1477
|
-
const depositContextRef =
|
|
1478
|
+
const depositContextRef = _chunkT2KOQH57cjs.useLatestRef.call(void 0, {
|
|
1478
1479
|
amount,
|
|
1479
1480
|
sourceChain,
|
|
1480
1481
|
sourceToken: token,
|
|
@@ -1483,8 +1484,8 @@ function DepositNotification({
|
|
|
1483
1484
|
waitForFinalTx,
|
|
1484
1485
|
hasPostBridgeActions
|
|
1485
1486
|
});
|
|
1486
|
-
const onCompleteRef =
|
|
1487
|
-
const onFailedRef =
|
|
1487
|
+
const onCompleteRef = _chunkT2KOQH57cjs.useLatestRef.call(void 0, onComplete);
|
|
1488
|
+
const onFailedRef = _chunkT2KOQH57cjs.useLatestRef.call(void 0, onFailed);
|
|
1488
1489
|
const handleComplete = _react.useCallback.call(void 0,
|
|
1489
1490
|
(destTxHash) => {
|
|
1490
1491
|
if (completedRef.current) return;
|
|
@@ -1521,7 +1522,8 @@ function DepositNotification({
|
|
|
1521
1522
|
let isMounted = true;
|
|
1522
1523
|
async function pollStatus() {
|
|
1523
1524
|
try {
|
|
1524
|
-
const
|
|
1525
|
+
const account = sourceChain === "solana" && solanaDepositAddress ? solanaDepositAddress : smartAccount;
|
|
1526
|
+
const data = await service.fetchStatus(account, txHash);
|
|
1525
1527
|
if (!isMounted) return;
|
|
1526
1528
|
const lastEvent = data.lastEvent;
|
|
1527
1529
|
const eventForTx = isEventForTx(lastEvent, txHash) ? lastEvent : void 0;
|
|
@@ -1582,6 +1584,8 @@ function DepositNotification({
|
|
|
1582
1584
|
handleFailed,
|
|
1583
1585
|
service,
|
|
1584
1586
|
smartAccount,
|
|
1587
|
+
solanaDepositAddress,
|
|
1588
|
+
sourceChain,
|
|
1585
1589
|
status,
|
|
1586
1590
|
txHash
|
|
1587
1591
|
]);
|
|
@@ -1621,7 +1625,7 @@ function DepositNotification({
|
|
|
1621
1625
|
}
|
|
1622
1626
|
)
|
|
1623
1627
|
}
|
|
1624
|
-
) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--processing", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1628
|
+
) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--processing", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT2KOQH57cjs.Spinner, {}) });
|
|
1625
1629
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1626
1630
|
"div",
|
|
1627
1631
|
{
|
|
@@ -2140,10 +2144,10 @@ function DepositAddressStep({
|
|
|
2140
2144
|
return;
|
|
2141
2145
|
}
|
|
2142
2146
|
const event = status.lastEvent;
|
|
2143
|
-
const eventTxHash =
|
|
2147
|
+
const eventTxHash = _chunkT2KOQH57cjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkT2KOQH57cjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
2144
2148
|
if (baselineTxHashRef.current === void 0) {
|
|
2145
2149
|
baselineTxHashRef.current = eventTxHash;
|
|
2146
|
-
} else if (eventTxHash && (!baselineTxHashRef.current || !
|
|
2150
|
+
} else if (eventTxHash && (!baselineTxHashRef.current || !_chunkT2KOQH57cjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
|
|
2147
2151
|
const details = getDepositEventDetails(event);
|
|
2148
2152
|
const fallback = sourceSelectionRef.current;
|
|
2149
2153
|
const chainId = _nullishCoalesce(details.chainId, () => ( fallback.chainId));
|
|
@@ -2377,9 +2381,29 @@ function DepositAddressStep({
|
|
|
2377
2381
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-qr", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, QRCode, { value: displayAddress, size: 150, iconSrc: qrIconSrc }) }),
|
|
2378
2382
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-info", children: [
|
|
2379
2383
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-label", children: [
|
|
2380
|
-
"Your ",
|
|
2381
|
-
|
|
2382
|
-
|
|
2384
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Your deposit address" }),
|
|
2385
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, Tooltip, { content: "Send any accepted token to this address and it will auto swap to your account.", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2386
|
+
"svg",
|
|
2387
|
+
{
|
|
2388
|
+
className: "rs-deposit-address-label-icon",
|
|
2389
|
+
viewBox: "0 0 24 24",
|
|
2390
|
+
fill: "none",
|
|
2391
|
+
stroke: "currentColor",
|
|
2392
|
+
strokeWidth: "2",
|
|
2393
|
+
"aria-hidden": "true",
|
|
2394
|
+
children: [
|
|
2395
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "12", cy: "12", r: "9" }),
|
|
2396
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2397
|
+
"path",
|
|
2398
|
+
{
|
|
2399
|
+
strokeLinecap: "round",
|
|
2400
|
+
strokeLinejoin: "round",
|
|
2401
|
+
d: "M12 8h.01M11 12h1v4h1"
|
|
2402
|
+
}
|
|
2403
|
+
)
|
|
2404
|
+
]
|
|
2405
|
+
}
|
|
2406
|
+
) })
|
|
2383
2407
|
] }),
|
|
2384
2408
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-value", children: displayAddress }),
|
|
2385
2409
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
@@ -2544,6 +2568,7 @@ function DepositAddressStep({
|
|
|
2544
2568
|
{
|
|
2545
2569
|
deposit,
|
|
2546
2570
|
smartAccount,
|
|
2571
|
+
solanaDepositAddress,
|
|
2547
2572
|
targetChain,
|
|
2548
2573
|
targetToken,
|
|
2549
2574
|
waitForFinalTx,
|
|
@@ -2555,7 +2580,7 @@ function DepositAddressStep({
|
|
|
2555
2580
|
},
|
|
2556
2581
|
deposit.id
|
|
2557
2582
|
)) }),
|
|
2558
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2583
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT2KOQH57cjs.PoweredBy, {})
|
|
2559
2584
|
] });
|
|
2560
2585
|
}
|
|
2561
2586
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -2586,7 +2611,7 @@ function SolanaTokenSelectStep({
|
|
|
2586
2611
|
setError(null);
|
|
2587
2612
|
const portfolioBySymbol = {};
|
|
2588
2613
|
try {
|
|
2589
|
-
|
|
2614
|
+
_chunkT2KOQH57cjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
|
|
2590
2615
|
solanaAddress
|
|
2591
2616
|
});
|
|
2592
2617
|
const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
|
|
@@ -2609,12 +2634,12 @@ function SolanaTokenSelectStep({
|
|
|
2609
2634
|
};
|
|
2610
2635
|
}
|
|
2611
2636
|
}
|
|
2612
|
-
|
|
2637
|
+
_chunkT2KOQH57cjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
|
|
2613
2638
|
symbols: Object.keys(portfolioBySymbol)
|
|
2614
2639
|
});
|
|
2615
2640
|
} catch (err) {
|
|
2616
2641
|
if (!active) return;
|
|
2617
|
-
|
|
2642
|
+
_chunkT2KOQH57cjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
|
|
2618
2643
|
solanaAddress
|
|
2619
2644
|
});
|
|
2620
2645
|
setError(
|
|
@@ -2668,7 +2693,7 @@ function SolanaTokenSelectStep({
|
|
|
2668
2693
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
2669
2694
|
children: [
|
|
2670
2695
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
2671
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2696
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT2KOQH57cjs.Spinner, { className: "rs-text-tertiary" }),
|
|
2672
2697
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
2673
2698
|
] }),
|
|
2674
2699
|
!loading && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
@@ -2705,7 +2730,7 @@ function SolanaTokenSelectStep({
|
|
|
2705
2730
|
try {
|
|
2706
2731
|
const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
|
|
2707
2732
|
const numeric = Number(raw);
|
|
2708
|
-
formattedBalance = Number.isFinite(numeric) ?
|
|
2733
|
+
formattedBalance = Number.isFinite(numeric) ? _chunkT2KOQH57cjs.tokenFormatter.format(numeric) : raw;
|
|
2709
2734
|
} catch (e16) {
|
|
2710
2735
|
formattedBalance = "...";
|
|
2711
2736
|
}
|
|
@@ -2749,7 +2774,7 @@ function SolanaTokenSelectStep({
|
|
|
2749
2774
|
] })
|
|
2750
2775
|
] })
|
|
2751
2776
|
] }),
|
|
2752
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ?
|
|
2777
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunkT2KOQH57cjs.currencyFormatter.format(entry.balanceUsd) : `${formattedBalance} ${entry.token.symbol}` })
|
|
2753
2778
|
]
|
|
2754
2779
|
},
|
|
2755
2780
|
entry.token.symbol
|
|
@@ -2759,7 +2784,7 @@ function SolanaTokenSelectStep({
|
|
|
2759
2784
|
}
|
|
2760
2785
|
),
|
|
2761
2786
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2762
|
-
|
|
2787
|
+
_chunkT2KOQH57cjs.Button,
|
|
2763
2788
|
{
|
|
2764
2789
|
onClick: () => selectedEntry && onContinue(
|
|
2765
2790
|
selectedEntry.token,
|
|
@@ -2771,7 +2796,7 @@ function SolanaTokenSelectStep({
|
|
|
2771
2796
|
children: "Continue"
|
|
2772
2797
|
}
|
|
2773
2798
|
) }),
|
|
2774
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2799
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT2KOQH57cjs.PoweredBy, {})
|
|
2775
2800
|
] });
|
|
2776
2801
|
}
|
|
2777
2802
|
|
|
@@ -2819,7 +2844,7 @@ function SolanaAmountStep({
|
|
|
2819
2844
|
const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
|
|
2820
2845
|
const numeric = Number(raw);
|
|
2821
2846
|
if (!Number.isFinite(numeric)) return raw;
|
|
2822
|
-
return
|
|
2847
|
+
return _chunkT2KOQH57cjs.tokenFormatter.format(numeric);
|
|
2823
2848
|
} catch (e18) {
|
|
2824
2849
|
return "...";
|
|
2825
2850
|
}
|
|
@@ -2837,7 +2862,7 @@ function SolanaAmountStep({
|
|
|
2837
2862
|
}, [balance, token.decimals, tokenPriceUsd, balanceUsd]);
|
|
2838
2863
|
const formattedBalanceUsd = _react.useMemo.call(void 0, () => {
|
|
2839
2864
|
if (computedBalanceUsd === null || computedBalanceUsd <= 0) return null;
|
|
2840
|
-
return
|
|
2865
|
+
return _chunkT2KOQH57cjs.currencyFormatter.format(computedBalanceUsd);
|
|
2841
2866
|
}, [computedBalanceUsd]);
|
|
2842
2867
|
const spendableBalance = _react.useMemo.call(void 0, () => {
|
|
2843
2868
|
if (!isNativeSol(token)) return balance;
|
|
@@ -2862,7 +2887,7 @@ function SolanaAmountStep({
|
|
|
2862
2887
|
const factor = 10 ** maxDecimals;
|
|
2863
2888
|
const truncated = Math.floor(value * factor) / factor;
|
|
2864
2889
|
const formatted = truncated.toFixed(maxDecimals).replace(/\.?0+$/, "");
|
|
2865
|
-
|
|
2890
|
+
_chunkT2KOQH57cjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
|
|
2866
2891
|
percentage,
|
|
2867
2892
|
symbol: token.symbol,
|
|
2868
2893
|
formatted
|
|
@@ -2876,7 +2901,7 @@ function SolanaAmountStep({
|
|
|
2876
2901
|
const handleContinue = () => {
|
|
2877
2902
|
const numericAmount = parseFloat(amount);
|
|
2878
2903
|
if (isNaN(numericAmount) || numericAmount <= 0) {
|
|
2879
|
-
|
|
2904
|
+
_chunkT2KOQH57cjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2880
2905
|
amount,
|
|
2881
2906
|
reason: "nan-or-non-positive"
|
|
2882
2907
|
});
|
|
@@ -2888,7 +2913,7 @@ function SolanaAmountStep({
|
|
|
2888
2913
|
const usdValue = numericAmount;
|
|
2889
2914
|
if (_optionalChain([uiConfig, 'optionalAccess', _82 => _82.maxDepositUsd]) && usdValue > uiConfig.maxDepositUsd) {
|
|
2890
2915
|
setError(
|
|
2891
|
-
`Maximum deposit is ${
|
|
2916
|
+
`Maximum deposit is ${_chunkT2KOQH57cjs.currencyFormatter.format(uiConfig.maxDepositUsd)}`
|
|
2892
2917
|
);
|
|
2893
2918
|
return;
|
|
2894
2919
|
}
|
|
@@ -2903,7 +2928,7 @@ function SolanaAmountStep({
|
|
|
2903
2928
|
try {
|
|
2904
2929
|
amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
|
|
2905
2930
|
} catch (e22) {
|
|
2906
|
-
|
|
2931
|
+
_chunkT2KOQH57cjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2907
2932
|
amount,
|
|
2908
2933
|
sourceAmount: sourceAmountStr,
|
|
2909
2934
|
reason: "parse-units-failed"
|
|
@@ -2913,7 +2938,7 @@ function SolanaAmountStep({
|
|
|
2913
2938
|
}
|
|
2914
2939
|
if (amountInUnits > spendableBalance) {
|
|
2915
2940
|
const isReserveIssue = isNativeSol(token) && amountInUnits <= balance;
|
|
2916
|
-
|
|
2941
|
+
_chunkT2KOQH57cjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2917
2942
|
amount,
|
|
2918
2943
|
balance: balance.toString(),
|
|
2919
2944
|
spendableBalance: spendableBalance.toString(),
|
|
@@ -2925,7 +2950,7 @@ function SolanaAmountStep({
|
|
|
2925
2950
|
);
|
|
2926
2951
|
return;
|
|
2927
2952
|
}
|
|
2928
|
-
|
|
2953
|
+
_chunkT2KOQH57cjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
|
|
2929
2954
|
symbol: token.symbol,
|
|
2930
2955
|
inputAmountUsd: amount,
|
|
2931
2956
|
sourceAmount: sourceAmountStr,
|
|
@@ -2994,7 +3019,7 @@ function SolanaAmountStep({
|
|
|
2994
3019
|
)
|
|
2995
3020
|
] }),
|
|
2996
3021
|
_optionalChain([uiConfig, 'optionalAccess', _84 => _84.minDepositUsd]) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-minimum", children: [
|
|
2997
|
-
|
|
3022
|
+
_chunkT2KOQH57cjs.currencyFormatter.format(uiConfig.minDepositUsd),
|
|
2998
3023
|
" minimum deposit"
|
|
2999
3024
|
] }),
|
|
3000
3025
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", children: [
|
|
@@ -3020,7 +3045,7 @@ function SolanaAmountStep({
|
|
|
3020
3045
|
] })
|
|
3021
3046
|
] }),
|
|
3022
3047
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3023
|
-
|
|
3048
|
+
_chunkT2KOQH57cjs.Button,
|
|
3024
3049
|
{
|
|
3025
3050
|
onClick: handleContinue,
|
|
3026
3051
|
fullWidth: true,
|
|
@@ -3028,7 +3053,7 @@ function SolanaAmountStep({
|
|
|
3028
3053
|
children: _optionalChain([uiConfig, 'optionalAccess', _85 => _85.minDepositUsd]) && parseFloat(amount) > 0 && parseFloat(amount) < uiConfig.minDepositUsd ? "Update order" : "Continue"
|
|
3029
3054
|
}
|
|
3030
3055
|
) }),
|
|
3031
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3056
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT2KOQH57cjs.PoweredBy, {})
|
|
3032
3057
|
] });
|
|
3033
3058
|
}
|
|
3034
3059
|
|
|
@@ -3072,7 +3097,7 @@ function SolanaConfirmStep({
|
|
|
3072
3097
|
const receiveAmount = isSameToken ? formattedReceiveAmount : `~ ${formattedReceiveAmount}`;
|
|
3073
3098
|
const handleConfirm = async () => {
|
|
3074
3099
|
if (!solanaProvider) {
|
|
3075
|
-
|
|
3100
|
+
_chunkT2KOQH57cjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
3076
3101
|
reason: "missing-provider"
|
|
3077
3102
|
});
|
|
3078
3103
|
setError("Solana wallet not connected");
|
|
@@ -3080,7 +3105,7 @@ function SolanaConfirmStep({
|
|
|
3080
3105
|
}
|
|
3081
3106
|
const parsedAmount = parseFloat(sourceAmount);
|
|
3082
3107
|
if (isNaN(parsedAmount) || parsedAmount <= 0) {
|
|
3083
|
-
|
|
3108
|
+
_chunkT2KOQH57cjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
3084
3109
|
reason: "invalid-amount",
|
|
3085
3110
|
sourceAmount
|
|
3086
3111
|
});
|
|
@@ -3089,7 +3114,7 @@ function SolanaConfirmStep({
|
|
|
3089
3114
|
}
|
|
3090
3115
|
setError(null);
|
|
3091
3116
|
setIsSubmitting(true);
|
|
3092
|
-
|
|
3117
|
+
_chunkT2KOQH57cjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
|
|
3093
3118
|
smartAccount,
|
|
3094
3119
|
solanaAddress,
|
|
3095
3120
|
solanaDepositAddress,
|
|
@@ -3099,7 +3124,7 @@ function SolanaConfirmStep({
|
|
|
3099
3124
|
});
|
|
3100
3125
|
try {
|
|
3101
3126
|
const check = await service.checkAccount(smartAccount);
|
|
3102
|
-
|
|
3127
|
+
_chunkT2KOQH57cjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
|
|
3103
3128
|
smartAccount,
|
|
3104
3129
|
isRegistered: check.isRegistered,
|
|
3105
3130
|
targetChain: check.targetChain,
|
|
@@ -3112,7 +3137,7 @@ function SolanaConfirmStep({
|
|
|
3112
3137
|
}
|
|
3113
3138
|
const connection = getSolanaConnection();
|
|
3114
3139
|
const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
|
|
3115
|
-
|
|
3140
|
+
_chunkT2KOQH57cjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
|
|
3116
3141
|
token: token.symbol,
|
|
3117
3142
|
sourceAmount,
|
|
3118
3143
|
amountUnits: amountUnits.toString()
|
|
@@ -3129,7 +3154,7 @@ function SolanaConfirmStep({
|
|
|
3129
3154
|
token.mint,
|
|
3130
3155
|
amountUnits
|
|
3131
3156
|
);
|
|
3132
|
-
|
|
3157
|
+
_chunkT2KOQH57cjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
3133
3158
|
token: token.symbol,
|
|
3134
3159
|
instructionCount: transaction.instructions.length,
|
|
3135
3160
|
feePayer: _optionalChain([transaction, 'access', _86 => _86.feePayer, 'optionalAccess', _87 => _87.toBase58, 'call', _88 => _88()]),
|
|
@@ -3140,15 +3165,15 @@ function SolanaConfirmStep({
|
|
|
3140
3165
|
connection,
|
|
3141
3166
|
transaction
|
|
3142
3167
|
);
|
|
3143
|
-
|
|
3168
|
+
_chunkT2KOQH57cjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
|
|
3144
3169
|
txHash,
|
|
3145
3170
|
amountUnits: amountUnits.toString()
|
|
3146
3171
|
});
|
|
3147
3172
|
onConfirm(txHash, amountUnits.toString());
|
|
3148
3173
|
} catch (err) {
|
|
3149
3174
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
3150
|
-
const message =
|
|
3151
|
-
|
|
3175
|
+
const message = _chunkT2KOQH57cjs.formatUserError.call(void 0, raw);
|
|
3176
|
+
_chunkT2KOQH57cjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
|
|
3152
3177
|
smartAccount,
|
|
3153
3178
|
token: token.symbol,
|
|
3154
3179
|
sourceAmount
|
|
@@ -3281,7 +3306,7 @@ function SolanaConfirmStep({
|
|
|
3281
3306
|
] })
|
|
3282
3307
|
] }),
|
|
3283
3308
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3284
|
-
|
|
3309
|
+
_chunkT2KOQH57cjs.Button,
|
|
3285
3310
|
{
|
|
3286
3311
|
onClick: handleConfirm,
|
|
3287
3312
|
loading: isSubmitting,
|
|
@@ -3290,7 +3315,7 @@ function SolanaConfirmStep({
|
|
|
3290
3315
|
children: "Confirm Order"
|
|
3291
3316
|
}
|
|
3292
3317
|
) }),
|
|
3293
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3318
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkT2KOQH57cjs.PoweredBy, {})
|
|
3294
3319
|
] });
|
|
3295
3320
|
}
|
|
3296
3321
|
|
|
@@ -3342,14 +3367,14 @@ function DepositFlow({
|
|
|
3342
3367
|
onError,
|
|
3343
3368
|
debug
|
|
3344
3369
|
}) {
|
|
3345
|
-
const onStepChangeRef =
|
|
3346
|
-
const onTotalBalanceChangeRef =
|
|
3347
|
-
const onSmartAccountChangeRef =
|
|
3348
|
-
const onEventRef =
|
|
3349
|
-
const onDepositSubmittedRef =
|
|
3350
|
-
const onDepositCompleteRef =
|
|
3351
|
-
const onDepositFailedRef =
|
|
3352
|
-
const onErrorRef =
|
|
3370
|
+
const onStepChangeRef = _chunkT2KOQH57cjs.useLatestRef.call(void 0, onStepChange);
|
|
3371
|
+
const onTotalBalanceChangeRef = _chunkT2KOQH57cjs.useLatestRef.call(void 0, onTotalBalanceChange);
|
|
3372
|
+
const onSmartAccountChangeRef = _chunkT2KOQH57cjs.useLatestRef.call(void 0, onSmartAccountChange);
|
|
3373
|
+
const onEventRef = _chunkT2KOQH57cjs.useLatestRef.call(void 0, onEvent);
|
|
3374
|
+
const onDepositSubmittedRef = _chunkT2KOQH57cjs.useLatestRef.call(void 0, onDepositSubmitted);
|
|
3375
|
+
const onDepositCompleteRef = _chunkT2KOQH57cjs.useLatestRef.call(void 0, onDepositComplete);
|
|
3376
|
+
const onDepositFailedRef = _chunkT2KOQH57cjs.useLatestRef.call(void 0, onDepositFailed);
|
|
3377
|
+
const onErrorRef = _chunkT2KOQH57cjs.useLatestRef.call(void 0, onError);
|
|
3353
3378
|
const hasInitialReownSession = Boolean(
|
|
3354
3379
|
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _90 => _90.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _91 => _91.address]) : _optionalChain([reownWallet, 'optionalAccess', _92 => _92.address])
|
|
3355
3380
|
);
|
|
@@ -3369,13 +3394,13 @@ function DepositFlow({
|
|
|
3369
3394
|
flowModeRef.current = flowMode;
|
|
3370
3395
|
const logFlow = _react.useCallback.call(void 0,
|
|
3371
3396
|
(message, data) => {
|
|
3372
|
-
|
|
3397
|
+
_chunkT2KOQH57cjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
|
|
3373
3398
|
},
|
|
3374
3399
|
[debug]
|
|
3375
3400
|
);
|
|
3376
3401
|
const logFlowError = _react.useCallback.call(void 0,
|
|
3377
3402
|
(message, error, data) => {
|
|
3378
|
-
|
|
3403
|
+
_chunkT2KOQH57cjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
|
|
3379
3404
|
},
|
|
3380
3405
|
[debug]
|
|
3381
3406
|
);
|
|
@@ -3499,7 +3524,7 @@ function DepositFlow({
|
|
|
3499
3524
|
return {
|
|
3500
3525
|
ownerAddress: dappAddress,
|
|
3501
3526
|
walletClient: void 0,
|
|
3502
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
3527
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkT2KOQH57cjs.getPublicClient.call(void 0, targetChain))),
|
|
3503
3528
|
switchChain: void 0
|
|
3504
3529
|
};
|
|
3505
3530
|
}
|
|
@@ -3508,7 +3533,7 @@ function DepositFlow({
|
|
|
3508
3533
|
return {
|
|
3509
3534
|
ownerAddress: dappWalletClient.account.address,
|
|
3510
3535
|
walletClient: dappWalletClient,
|
|
3511
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
3536
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkT2KOQH57cjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
3512
3537
|
switchChain: dappSwitchChain
|
|
3513
3538
|
};
|
|
3514
3539
|
}
|
|
@@ -3522,7 +3547,7 @@ function DepositFlow({
|
|
|
3522
3547
|
return {
|
|
3523
3548
|
ownerAddress: dappAddress,
|
|
3524
3549
|
walletClient: void 0,
|
|
3525
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
3550
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkT2KOQH57cjs.getPublicClient.call(void 0, targetChain))),
|
|
3526
3551
|
switchChain: void 0
|
|
3527
3552
|
};
|
|
3528
3553
|
}
|
|
@@ -3531,7 +3556,7 @@ function DepositFlow({
|
|
|
3531
3556
|
return {
|
|
3532
3557
|
ownerAddress: dappWalletClient.account.address,
|
|
3533
3558
|
walletClient: dappWalletClient,
|
|
3534
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
3559
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkT2KOQH57cjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
3535
3560
|
switchChain: dappSwitchChain
|
|
3536
3561
|
};
|
|
3537
3562
|
}
|
|
@@ -3539,7 +3564,7 @@ function DepositFlow({
|
|
|
3539
3564
|
return {
|
|
3540
3565
|
ownerAddress: reownWallet.address,
|
|
3541
3566
|
walletClient: reownWallet.walletClient,
|
|
3542
|
-
publicClient: _nullishCoalesce(reownWallet.publicClient, () => (
|
|
3567
|
+
publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunkT2KOQH57cjs.getPublicClient.call(void 0, targetChain))),
|
|
3543
3568
|
switchChain: reownWallet.switchChain
|
|
3544
3569
|
};
|
|
3545
3570
|
}
|
|
@@ -3577,7 +3602,7 @@ function DepositFlow({
|
|
|
3577
3602
|
return {
|
|
3578
3603
|
ownerAddress: dappAddress,
|
|
3579
3604
|
walletClient: void 0,
|
|
3580
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
3605
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkT2KOQH57cjs.getPublicClient.call(void 0, targetChain))),
|
|
3581
3606
|
switchChain: void 0
|
|
3582
3607
|
};
|
|
3583
3608
|
}
|
|
@@ -3755,7 +3780,7 @@ function DepositFlow({
|
|
|
3755
3780
|
setStep({ type: "setup" });
|
|
3756
3781
|
}, []);
|
|
3757
3782
|
const handleNewDeposit = _react.useCallback.call(void 0, () => {
|
|
3758
|
-
_optionalChain([onSmartAccountChangeRef, 'access', _129 => _129.current, 'optionalCall', _130 => _130(null)]);
|
|
3783
|
+
_optionalChain([onSmartAccountChangeRef, 'access', _129 => _129.current, 'optionalCall', _130 => _130({ evm: null, solana: null })]);
|
|
3759
3784
|
setFlowMode(null);
|
|
3760
3785
|
setStep({ type: "setup" });
|
|
3761
3786
|
setIsConnectSelectionConfirmed(false);
|
|
@@ -3769,7 +3794,10 @@ function DepositFlow({
|
|
|
3769
3794
|
hasSolanaDepositAddress: Boolean(solanaDepositAddress),
|
|
3770
3795
|
flowMode: isDepositAddressMode ? "deposit-address" : isSolanaWalletMode ? "solana-wallet" : "wallet"
|
|
3771
3796
|
});
|
|
3772
|
-
_optionalChain([onSmartAccountChangeRef, 'access', _131 => _131.current, 'optionalCall', _132 => _132(
|
|
3797
|
+
_optionalChain([onSmartAccountChangeRef, 'access', _131 => _131.current, 'optionalCall', _132 => _132({
|
|
3798
|
+
evm: smartAccount,
|
|
3799
|
+
solana: _nullishCoalesce(solanaDepositAddress, () => ( null))
|
|
3800
|
+
})]);
|
|
3773
3801
|
if (isDepositAddressMode) {
|
|
3774
3802
|
setStep({
|
|
3775
3803
|
type: "deposit-address",
|
|
@@ -3866,6 +3894,7 @@ function DepositFlow({
|
|
|
3866
3894
|
return {
|
|
3867
3895
|
type: "processing",
|
|
3868
3896
|
smartAccount: prev.smartAccount,
|
|
3897
|
+
solanaDepositAddress: prev.solanaDepositAddress,
|
|
3869
3898
|
txHash,
|
|
3870
3899
|
sourceChain: "solana",
|
|
3871
3900
|
sourceToken: prev.token.mint,
|
|
@@ -4064,7 +4093,7 @@ function DepositFlow({
|
|
|
4064
4093
|
]);
|
|
4065
4094
|
if (showConnectStep) {
|
|
4066
4095
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4067
|
-
|
|
4096
|
+
_chunkT2KOQH57cjs.ConnectStep,
|
|
4068
4097
|
{
|
|
4069
4098
|
walletOptions,
|
|
4070
4099
|
selectedWalletId: selectedWalletIdEffective,
|
|
@@ -4250,9 +4279,10 @@ function DepositFlow({
|
|
|
4250
4279
|
) })
|
|
4251
4280
|
] }) : null,
|
|
4252
4281
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4253
|
-
|
|
4282
|
+
_chunkT2KOQH57cjs.ProcessingStep,
|
|
4254
4283
|
{
|
|
4255
4284
|
smartAccount: step.smartAccount,
|
|
4285
|
+
solanaDepositAddress: step.solanaDepositAddress,
|
|
4256
4286
|
txHash: step.txHash,
|
|
4257
4287
|
sourceChain: step.sourceChain,
|
|
4258
4288
|
sourceToken: step.sourceToken,
|
|
@@ -4284,7 +4314,7 @@ function DepositFlow({
|
|
|
4284
4314
|
if (_optionalChain([signerContext, 'access', _162 => _162.publicClient, 'access', _163 => _163.chain, 'optionalAccess', _164 => _164.id]) === chainId) {
|
|
4285
4315
|
return signerContext.publicClient;
|
|
4286
4316
|
}
|
|
4287
|
-
return
|
|
4317
|
+
return _chunkT2KOQH57cjs.getPublicClient.call(void 0, chainId);
|
|
4288
4318
|
};
|
|
4289
4319
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
4290
4320
|
step.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -4374,9 +4404,10 @@ function DepositFlow({
|
|
|
4374
4404
|
}
|
|
4375
4405
|
),
|
|
4376
4406
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4377
|
-
|
|
4407
|
+
_chunkT2KOQH57cjs.ProcessingStep,
|
|
4378
4408
|
{
|
|
4379
4409
|
smartAccount: step.smartAccount,
|
|
4410
|
+
solanaDepositAddress: step.solanaDepositAddress,
|
|
4380
4411
|
txHash: step.txHash,
|
|
4381
4412
|
sourceChain: step.sourceChain,
|
|
4382
4413
|
sourceToken: step.sourceToken,
|
|
@@ -4431,8 +4462,8 @@ function formatTimestamp2(iso) {
|
|
|
4431
4462
|
function resolveChainId(value) {
|
|
4432
4463
|
if (value === void 0 || value === null) return null;
|
|
4433
4464
|
if (typeof value === "number") return value;
|
|
4434
|
-
if (
|
|
4435
|
-
const parsed =
|
|
4465
|
+
if (_chunkT2KOQH57cjs.isSolanaCaip2.call(void 0, value) || value === "solana") return "solana";
|
|
4466
|
+
const parsed = _chunkT2KOQH57cjs.parseEvmChainId.call(void 0, value);
|
|
4436
4467
|
if (parsed !== null) return parsed;
|
|
4437
4468
|
const num = Number(value);
|
|
4438
4469
|
return Number.isFinite(num) ? num : null;
|
|
@@ -4669,8 +4700,15 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
|
4669
4700
|
// src/DepositModal.tsx
|
|
4670
4701
|
|
|
4671
4702
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
4672
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
4703
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-QPJ5TT57.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
4673
4704
|
);
|
|
4705
|
+
function sortByCreatedAtDesc(items) {
|
|
4706
|
+
return [...items].sort((a, b) => {
|
|
4707
|
+
const at = a.createdAt ? Date.parse(a.createdAt) : 0;
|
|
4708
|
+
const bt = b.createdAt ? Date.parse(b.createdAt) : 0;
|
|
4709
|
+
return bt - at;
|
|
4710
|
+
});
|
|
4711
|
+
}
|
|
4674
4712
|
function DepositModal(props) {
|
|
4675
4713
|
const needsReown = !!props.reownAppId;
|
|
4676
4714
|
const hasDappWalletClientProp = Object.prototype.hasOwnProperty.call(
|
|
@@ -4740,24 +4778,29 @@ function DepositModalInner({
|
|
|
4740
4778
|
debug
|
|
4741
4779
|
}) {
|
|
4742
4780
|
const modalRef = _react.useRef.call(void 0, null);
|
|
4743
|
-
const onReadyRef =
|
|
4781
|
+
const onReadyRef = _chunkT2KOQH57cjs.useLatestRef.call(void 0, onReady);
|
|
4744
4782
|
const [currentStepIndex, setCurrentStepIndex] = _react.useState.call(void 0, 0);
|
|
4745
4783
|
const [totalBalanceUsd, setTotalBalanceUsd] = _react.useState.call(void 0, null);
|
|
4746
4784
|
const backHandlerRef = _react.useRef.call(void 0, void 0);
|
|
4747
4785
|
const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _167 => _167.showHistoryButton]), () => ( false));
|
|
4748
|
-
const [
|
|
4786
|
+
const [activeEvmAccount, setActiveEvmAccount] = _react.useState.call(void 0, null);
|
|
4787
|
+
const [activeSolanaAccount, setActiveSolanaAccount] = _react.useState.call(void 0,
|
|
4788
|
+
null
|
|
4789
|
+
);
|
|
4749
4790
|
const [historyOpen, setHistoryOpen] = _react.useState.call(void 0, false);
|
|
4750
4791
|
const [historyDeposits, setHistoryDeposits] = _react.useState.call(void 0, []);
|
|
4751
|
-
const [
|
|
4792
|
+
const [hasMoreHistory, setHasMoreHistory] = _react.useState.call(void 0, false);
|
|
4752
4793
|
const [historyLoading, setHistoryLoading] = _react.useState.call(void 0, false);
|
|
4753
4794
|
const [historyLoadingMore, setHistoryLoadingMore] = _react.useState.call(void 0, false);
|
|
4754
4795
|
const [historyError, setHistoryError] = _react.useState.call(void 0, null);
|
|
4796
|
+
const evmCursorRef = _react.useRef.call(void 0, null);
|
|
4797
|
+
const solanaCursorRef = _react.useRef.call(void 0, null);
|
|
4755
4798
|
const historyStaleRef = _react.useRef.call(void 0, false);
|
|
4756
4799
|
const historyLoadedRef = _react.useRef.call(void 0, false);
|
|
4757
4800
|
const targetChain = _chunkMUWVDVY4cjs.getChainId.call(void 0, targetChainProp);
|
|
4758
4801
|
const sourceChain = sourceChainProp ? _chunkMUWVDVY4cjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
4759
4802
|
const service = _react.useMemo.call(void 0,
|
|
4760
|
-
() =>
|
|
4803
|
+
() => _chunkT2KOQH57cjs.createDepositService.call(void 0, backendUrl, {
|
|
4761
4804
|
debug,
|
|
4762
4805
|
debugScope: "service:deposit"
|
|
4763
4806
|
}),
|
|
@@ -4765,7 +4808,7 @@ function DepositModalInner({
|
|
|
4765
4808
|
);
|
|
4766
4809
|
_react.useEffect.call(void 0, () => {
|
|
4767
4810
|
if (isOpen && modalRef.current) {
|
|
4768
|
-
|
|
4811
|
+
_chunkT2KOQH57cjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
4769
4812
|
}
|
|
4770
4813
|
}, [isOpen, theme]);
|
|
4771
4814
|
_react.useEffect.call(void 0, () => {
|
|
@@ -4795,18 +4838,19 @@ function DepositModalInner({
|
|
|
4795
4838
|
_optionalChain([backHandlerRef, 'access', _170 => _170.current, 'optionalCall', _171 => _171()]);
|
|
4796
4839
|
}, []);
|
|
4797
4840
|
const handleSmartAccountChange = _react.useCallback.call(void 0,
|
|
4798
|
-
(
|
|
4799
|
-
|
|
4800
|
-
|
|
4841
|
+
({ evm, solana }) => {
|
|
4842
|
+
setActiveEvmAccount(evm);
|
|
4843
|
+
setActiveSolanaAccount(solana);
|
|
4844
|
+
if (!evm && !solana) {
|
|
4801
4845
|
historyStaleRef.current = true;
|
|
4802
4846
|
}
|
|
4803
4847
|
},
|
|
4804
4848
|
[]
|
|
4805
4849
|
);
|
|
4806
4850
|
const fetchHistory = _react.useCallback.call(void 0,
|
|
4807
|
-
async (
|
|
4808
|
-
if (!
|
|
4809
|
-
const isInitial =
|
|
4851
|
+
async (mode = "initial") => {
|
|
4852
|
+
if (!activeEvmAccount && !activeSolanaAccount) return;
|
|
4853
|
+
const isInitial = mode === "initial";
|
|
4810
4854
|
if (isInitial) {
|
|
4811
4855
|
setHistoryLoading(true);
|
|
4812
4856
|
} else {
|
|
@@ -4814,17 +4858,54 @@ function DepositModalInner({
|
|
|
4814
4858
|
}
|
|
4815
4859
|
setHistoryError(null);
|
|
4816
4860
|
try {
|
|
4817
|
-
const
|
|
4818
|
-
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4861
|
+
const evmCursor = isInitial ? null : evmCursorRef.current;
|
|
4862
|
+
const solanaCursor = isInitial ? null : solanaCursorRef.current;
|
|
4863
|
+
const requests = [];
|
|
4864
|
+
if (activeEvmAccount && (isInitial || evmCursor)) {
|
|
4865
|
+
requests.push(
|
|
4866
|
+
service.fetchDepositHistory({
|
|
4867
|
+
account: activeEvmAccount,
|
|
4868
|
+
limit: 20,
|
|
4869
|
+
cursor: _nullishCoalesce(evmCursor, () => ( void 0))
|
|
4870
|
+
}).then((r) => ({
|
|
4871
|
+
deposits: r.deposits,
|
|
4872
|
+
nextCursor: _nullishCoalesce(r.nextCursor, () => ( null)),
|
|
4873
|
+
source: "evm"
|
|
4874
|
+
}))
|
|
4875
|
+
);
|
|
4876
|
+
}
|
|
4877
|
+
if (activeSolanaAccount && (isInitial || solanaCursor)) {
|
|
4878
|
+
requests.push(
|
|
4879
|
+
service.fetchDepositHistory({
|
|
4880
|
+
account: activeSolanaAccount,
|
|
4881
|
+
limit: 20,
|
|
4882
|
+
cursor: _nullishCoalesce(solanaCursor, () => ( void 0))
|
|
4883
|
+
}).then((r) => ({
|
|
4884
|
+
deposits: r.deposits,
|
|
4885
|
+
nextCursor: _nullishCoalesce(r.nextCursor, () => ( null)),
|
|
4886
|
+
source: "solana"
|
|
4887
|
+
}))
|
|
4888
|
+
);
|
|
4889
|
+
}
|
|
4890
|
+
const results = await Promise.all(requests);
|
|
4891
|
+
let nextEvm = isInitial ? null : evmCursor;
|
|
4892
|
+
let nextSolana = isInitial ? null : solanaCursor;
|
|
4893
|
+
const incoming = [];
|
|
4894
|
+
for (const r of results) {
|
|
4895
|
+
incoming.push(...r.deposits);
|
|
4896
|
+
if (r.source === "evm") nextEvm = r.nextCursor;
|
|
4897
|
+
else nextSolana = r.nextCursor;
|
|
4898
|
+
}
|
|
4822
4899
|
if (isInitial) {
|
|
4823
|
-
setHistoryDeposits(
|
|
4900
|
+
setHistoryDeposits(sortByCreatedAtDesc(incoming));
|
|
4824
4901
|
} else {
|
|
4825
|
-
setHistoryDeposits(
|
|
4902
|
+
setHistoryDeposits(
|
|
4903
|
+
(prev) => sortByCreatedAtDesc([...prev, ...incoming])
|
|
4904
|
+
);
|
|
4826
4905
|
}
|
|
4827
|
-
|
|
4906
|
+
evmCursorRef.current = nextEvm;
|
|
4907
|
+
solanaCursorRef.current = nextSolana;
|
|
4908
|
+
setHasMoreHistory(Boolean(nextEvm || nextSolana));
|
|
4828
4909
|
historyStaleRef.current = false;
|
|
4829
4910
|
historyLoadedRef.current = true;
|
|
4830
4911
|
} catch (err) {
|
|
@@ -4839,31 +4920,29 @@ function DepositModalInner({
|
|
|
4839
4920
|
}
|
|
4840
4921
|
}
|
|
4841
4922
|
},
|
|
4842
|
-
[
|
|
4923
|
+
[activeEvmAccount, activeSolanaAccount, service]
|
|
4843
4924
|
);
|
|
4844
4925
|
const handleHistoryOpen = _react.useCallback.call(void 0, () => {
|
|
4845
4926
|
setHistoryOpen(true);
|
|
4846
4927
|
if (!historyLoadedRef.current || historyStaleRef.current) {
|
|
4847
|
-
fetchHistory();
|
|
4928
|
+
fetchHistory("initial");
|
|
4848
4929
|
}
|
|
4849
4930
|
}, [fetchHistory]);
|
|
4850
4931
|
const handleHistoryClose = _react.useCallback.call(void 0, () => {
|
|
4851
4932
|
setHistoryOpen(false);
|
|
4852
4933
|
}, []);
|
|
4853
4934
|
const handleHistoryLoadMore = _react.useCallback.call(void 0, () => {
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
}
|
|
4857
|
-
}, [fetchHistory, historyNextCursor]);
|
|
4935
|
+
fetchHistory("more");
|
|
4936
|
+
}, [fetchHistory]);
|
|
4858
4937
|
const markHistoryStale = _react.useCallback.call(void 0, () => {
|
|
4859
4938
|
historyStaleRef.current = true;
|
|
4860
4939
|
if (historyOpen) {
|
|
4861
|
-
fetchHistory();
|
|
4940
|
+
fetchHistory("initial");
|
|
4862
4941
|
}
|
|
4863
4942
|
}, [historyOpen, fetchHistory]);
|
|
4864
|
-
const onDepositSubmittedRef =
|
|
4865
|
-
const onDepositCompleteRef =
|
|
4866
|
-
const onDepositFailedRef =
|
|
4943
|
+
const onDepositSubmittedRef = _chunkT2KOQH57cjs.useLatestRef.call(void 0, onDepositSubmitted);
|
|
4944
|
+
const onDepositCompleteRef = _chunkT2KOQH57cjs.useLatestRef.call(void 0, onDepositComplete);
|
|
4945
|
+
const onDepositFailedRef = _chunkT2KOQH57cjs.useLatestRef.call(void 0, onDepositFailed);
|
|
4867
4946
|
const handleDepositSubmitted = _react.useCallback.call(void 0,
|
|
4868
4947
|
(data) => {
|
|
4869
4948
|
_optionalChain([onDepositSubmittedRef, 'access', _172 => _172.current, 'optionalCall', _173 => _173(data)]);
|
|
@@ -4889,9 +4968,12 @@ function DepositModalInner({
|
|
|
4889
4968
|
if (!isOpen) {
|
|
4890
4969
|
setHistoryOpen(false);
|
|
4891
4970
|
setHistoryDeposits([]);
|
|
4892
|
-
|
|
4971
|
+
setHasMoreHistory(false);
|
|
4893
4972
|
setHistoryError(null);
|
|
4894
|
-
|
|
4973
|
+
setActiveEvmAccount(null);
|
|
4974
|
+
setActiveSolanaAccount(null);
|
|
4975
|
+
evmCursorRef.current = null;
|
|
4976
|
+
solanaCursorRef.current = null;
|
|
4895
4977
|
historyStaleRef.current = false;
|
|
4896
4978
|
historyLoadedRef.current = false;
|
|
4897
4979
|
}
|
|
@@ -4904,7 +4986,7 @@ function DepositModalInner({
|
|
|
4904
4986
|
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _183 => _183.title]), () => ( "Deposit"));
|
|
4905
4987
|
const canGoBack = currentStepIndex > 0 && currentStepIndex < 4 && backHandlerRef.current !== void 0;
|
|
4906
4988
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4907
|
-
|
|
4989
|
+
_chunkT2KOQH57cjs.Modal,
|
|
4908
4990
|
{
|
|
4909
4991
|
isOpen,
|
|
4910
4992
|
onClose,
|
|
@@ -4997,7 +5079,7 @@ function DepositModalInner({
|
|
|
4997
5079
|
balance.title,
|
|
4998
5080
|
":"
|
|
4999
5081
|
] }),
|
|
5000
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ?
|
|
5082
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ? _chunkT2KOQH57cjs.currencyFormatter.format(totalBalanceUsd) : null))) })
|
|
5001
5083
|
] })
|
|
5002
5084
|
] }),
|
|
5003
5085
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
|
|
@@ -5008,7 +5090,7 @@ function DepositModalInner({
|
|
|
5008
5090
|
className: "rs-modal-header-history",
|
|
5009
5091
|
"aria-label": "Deposit history",
|
|
5010
5092
|
onClick: handleHistoryOpen,
|
|
5011
|
-
disabled: !
|
|
5093
|
+
disabled: !activeEvmAccount && !activeSolanaAccount,
|
|
5012
5094
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5013
5095
|
"svg",
|
|
5014
5096
|
{
|
|
@@ -5104,7 +5186,7 @@ function DepositModalInner({
|
|
|
5104
5186
|
deposits: historyDeposits,
|
|
5105
5187
|
isLoading: historyLoading,
|
|
5106
5188
|
error: historyError,
|
|
5107
|
-
hasMore:
|
|
5189
|
+
hasMore: hasMoreHistory,
|
|
5108
5190
|
isLoadingMore: historyLoadingMore,
|
|
5109
5191
|
onLoadMore: handleHistoryLoadMore,
|
|
5110
5192
|
onClose: handleHistoryClose
|