@rhinestone/deposit-modal 0.1.67 → 0.1.69
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-UPYZN2XA.cjs → DepositModalReown-3GU5B776.cjs} +6 -6
- package/dist/{DepositModalReown-EYIV6APK.mjs → DepositModalReown-WN2E3EQ3.mjs} +3 -3
- package/dist/{WithdrawModalReown-6VYKKKJN.mjs → WithdrawModalReown-6ZBCJOPK.mjs} +3 -3
- package/dist/{WithdrawModalReown-WHPQDJJJ.cjs → WithdrawModalReown-WIV5IEIW.cjs} +6 -6
- package/dist/{chunk-LTLFJPHO.cjs → chunk-2ATEEBQZ.cjs} +52 -47
- package/dist/{chunk-NFE5ZLD3.mjs → chunk-3RV2B6JM.mjs} +616 -394
- package/dist/{chunk-MBURQ26S.mjs → chunk-5YXAQB6A.mjs} +10 -0
- package/dist/{chunk-UDKZWFCM.cjs → chunk-6W42ROAB.cjs} +423 -201
- package/dist/{chunk-IUW3SJQT.mjs → chunk-DA3XVDNQ.mjs} +84 -16
- package/dist/{chunk-5FDIQNJJ.mjs → chunk-P3CGKXXZ.mjs} +12 -7
- package/dist/{chunk-FLVSQDP4.cjs → chunk-TCILEYM5.cjs} +152 -84
- package/dist/{chunk-N2Y34LQO.cjs → chunk-YQFH2WSW.cjs} +11 -1
- package/dist/deposit.cjs +3 -3
- package/dist/deposit.mjs +2 -2
- package/dist/index.cjs +8 -4
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +7 -3
- package/dist/reown.cjs +8 -4
- package/dist/reown.d.cts +4 -0
- package/dist/reown.d.ts +4 -0
- package/dist/reown.mjs +8 -4
- package/dist/styles.css +197 -4
- 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 _chunkTCILEYM5cjs = require('./chunk-TCILEYM5.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 = _chunkTCILEYM5cjs.loadSessionOwnerFromStorage.call(void 0, eoaAddress);
|
|
72
72
|
if (localOwner) {
|
|
73
73
|
return {
|
|
74
|
-
account:
|
|
74
|
+
account: _chunkTCILEYM5cjs.accountFromPrivateKey.call(void 0, localOwner.privateKey),
|
|
75
75
|
address: localOwner.address
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
const created =
|
|
79
|
-
|
|
78
|
+
const created = _chunkTCILEYM5cjs.createSessionOwnerKey.call(void 0, );
|
|
79
|
+
_chunkTCILEYM5cjs.saveSessionOwnerToStorage.call(void 0, eoaAddress, created.privateKey, created.address);
|
|
80
80
|
return {
|
|
81
81
|
account: created.account,
|
|
82
82
|
address: created.address
|
|
@@ -115,10 +115,12 @@ function SetupStep({
|
|
|
115
115
|
const setup = await service.setupAccount({
|
|
116
116
|
ownerAddress: address,
|
|
117
117
|
sessionOwnerAddress: sessionOwner.address,
|
|
118
|
-
targetChain:
|
|
118
|
+
targetChain: _chunkTCILEYM5cjs.toEvmCaip2.call(void 0, targetChain),
|
|
119
119
|
targetToken,
|
|
120
120
|
recipient,
|
|
121
121
|
postBridgeActions,
|
|
122
|
+
outputTokenRules,
|
|
123
|
+
rejectUnmapped,
|
|
122
124
|
signerAddress,
|
|
123
125
|
sessionChainIds,
|
|
124
126
|
forceRegister
|
|
@@ -147,7 +149,7 @@ function SetupStep({
|
|
|
147
149
|
primaryType: typedData.primaryType,
|
|
148
150
|
message: typedData.message
|
|
149
151
|
});
|
|
150
|
-
const sessionDetails =
|
|
152
|
+
const sessionDetails = _chunkTCILEYM5cjs.buildSessionDetails.call(void 0, setup.sessionDetailsUnsigned, signature);
|
|
151
153
|
setState({ type: "registering" });
|
|
152
154
|
const registerResult = await service.registerAccount({
|
|
153
155
|
address: smartAccount,
|
|
@@ -159,7 +161,7 @@ function SetupStep({
|
|
|
159
161
|
eoaAddress: address,
|
|
160
162
|
sessionOwner: sessionOwner.address,
|
|
161
163
|
target: {
|
|
162
|
-
chain:
|
|
164
|
+
chain: _chunkTCILEYM5cjs.toEvmCaip2.call(void 0, targetChain),
|
|
163
165
|
token: targetToken,
|
|
164
166
|
...recipient && { recipient },
|
|
165
167
|
..._optionalChain([postBridgeActions, 'optionalAccess', _2 => _2.length]) && { postBridgeActions },
|
|
@@ -187,6 +189,8 @@ function SetupStep({
|
|
|
187
189
|
sessionChainIds,
|
|
188
190
|
recipient,
|
|
189
191
|
postBridgeActions,
|
|
192
|
+
outputTokenRules,
|
|
193
|
+
rejectUnmapped,
|
|
190
194
|
forceRegister,
|
|
191
195
|
enableSolana,
|
|
192
196
|
service,
|
|
@@ -226,7 +230,7 @@ function SetupStep({
|
|
|
226
230
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
227
231
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", children: [
|
|
228
232
|
isLoading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
229
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
233
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkTCILEYM5cjs.Spinner, { className: "rs-spinner--lg rs-text-accent" }),
|
|
230
234
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-text", children: [
|
|
231
235
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-title", children: renderStateMessage() }),
|
|
232
236
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-loading-subtitle", children: "This may take a moment" })
|
|
@@ -263,7 +267,7 @@ function SetupStep({
|
|
|
263
267
|
] })
|
|
264
268
|
] })
|
|
265
269
|
] }),
|
|
266
|
-
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, _chunkTCILEYM5cjs.Button, { onClick: handleRetry, variant: "default", fullWidth: true, children: "Try Again" }) })
|
|
267
271
|
] });
|
|
268
272
|
}
|
|
269
273
|
|
|
@@ -289,7 +293,7 @@ function AssetSelectStep({
|
|
|
289
293
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
290
294
|
const defaultAssetId = _react.useMemo.call(void 0, () => {
|
|
291
295
|
if (!defaultSourceChain || !defaultSourceToken) return null;
|
|
292
|
-
return
|
|
296
|
+
return _chunkTCILEYM5cjs.getAssetId.call(void 0, {
|
|
293
297
|
chainId: defaultSourceChain,
|
|
294
298
|
token: defaultSourceToken
|
|
295
299
|
});
|
|
@@ -306,7 +310,7 @@ function AssetSelectStep({
|
|
|
306
310
|
try {
|
|
307
311
|
const portfolio = await service.fetchPortfolio(address);
|
|
308
312
|
if (!active) return;
|
|
309
|
-
const portfolioAssets =
|
|
313
|
+
const portfolioAssets = _chunkTCILEYM5cjs.portfolioToAssets.call(void 0, portfolio.tokens);
|
|
310
314
|
setAssets(portfolioAssets);
|
|
311
315
|
const hasNative = portfolioAssets.some(
|
|
312
316
|
(asset) => asset.token.toLowerCase() === _chunkMUWVDVY4cjs.NATIVE_TOKEN_ADDRESS
|
|
@@ -387,7 +391,7 @@ function AssetSelectStep({
|
|
|
387
391
|
const raw = _viem.formatUnits.call(void 0, BigInt(asset.balance), asset.decimals);
|
|
388
392
|
const numeric = Number(raw);
|
|
389
393
|
if (!Number.isFinite(numeric)) return raw;
|
|
390
|
-
return
|
|
394
|
+
return _chunkTCILEYM5cjs.tokenFormatter.format(numeric);
|
|
391
395
|
} catch (e3) {
|
|
392
396
|
return asset.balance;
|
|
393
397
|
}
|
|
@@ -401,7 +405,7 @@ function AssetSelectStep({
|
|
|
401
405
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
402
406
|
children: [
|
|
403
407
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
404
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
408
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkTCILEYM5cjs.Spinner, { className: "rs-text-tertiary" }),
|
|
405
409
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
406
410
|
] }),
|
|
407
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 }) }),
|
|
@@ -500,7 +504,7 @@ function AssetSelectStep({
|
|
|
500
504
|
] })
|
|
501
505
|
] })
|
|
502
506
|
] }),
|
|
503
|
-
/* @__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 ? _chunkTCILEYM5cjs.currencyFormatter.format(asset.balanceUsd) : tokenAmount !== "--" ? `${tokenAmount} ${asset.symbol}` : "--" })
|
|
504
508
|
]
|
|
505
509
|
},
|
|
506
510
|
asset.id
|
|
@@ -510,7 +514,7 @@ function AssetSelectStep({
|
|
|
510
514
|
}
|
|
511
515
|
),
|
|
512
516
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
513
|
-
|
|
517
|
+
_chunkTCILEYM5cjs.Button,
|
|
514
518
|
{
|
|
515
519
|
onClick: () => selectedAsset && onContinue(selectedAsset),
|
|
516
520
|
disabled: !selectedAsset,
|
|
@@ -518,7 +522,7 @@ function AssetSelectStep({
|
|
|
518
522
|
children: "Continue"
|
|
519
523
|
}
|
|
520
524
|
) }),
|
|
521
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
525
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkTCILEYM5cjs.PoweredBy, {})
|
|
522
526
|
] });
|
|
523
527
|
}
|
|
524
528
|
async function fetchNativeAssets(address, publicClient, existing) {
|
|
@@ -526,7 +530,7 @@ async function fetchNativeAssets(address, publicClient, existing) {
|
|
|
526
530
|
const connectedChainId = _optionalChain([publicClient, 'access', _12 => _12.chain, 'optionalAccess', _13 => _13.id]);
|
|
527
531
|
if (!connectedChainId) return [];
|
|
528
532
|
if (!_chunkMUWVDVY4cjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
|
|
529
|
-
const id =
|
|
533
|
+
const id = _chunkTCILEYM5cjs.getAssetId.call(void 0, {
|
|
530
534
|
chainId: connectedChainId,
|
|
531
535
|
token: _chunkMUWVDVY4cjs.NATIVE_TOKEN_ADDRESS
|
|
532
536
|
});
|
|
@@ -613,7 +617,7 @@ function AmountStep({
|
|
|
613
617
|
const balanceTarget = _nullishCoalesce(balanceAddress, () => ( address));
|
|
614
618
|
if (!balanceTarget || !publicClient) return;
|
|
615
619
|
try {
|
|
616
|
-
const bal =
|
|
620
|
+
const bal = _chunkTCILEYM5cjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: balanceTarget }) : await publicClient.readContract({
|
|
617
621
|
address: asset.token,
|
|
618
622
|
abi: _viem.erc20Abi,
|
|
619
623
|
functionName: "balanceOf",
|
|
@@ -639,7 +643,7 @@ function AmountStep({
|
|
|
639
643
|
setIsSwitching(true);
|
|
640
644
|
switchChain(asset.chainId).catch((err) => {
|
|
641
645
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
642
|
-
setError(
|
|
646
|
+
setError(_chunkTCILEYM5cjs.formatUserError.call(void 0, raw));
|
|
643
647
|
}).finally(() => {
|
|
644
648
|
setIsSwitching(false);
|
|
645
649
|
});
|
|
@@ -675,7 +679,7 @@ function AmountStep({
|
|
|
675
679
|
const raw = _viem.formatUnits.call(void 0, balance, asset.decimals);
|
|
676
680
|
const numeric = Number(raw);
|
|
677
681
|
if (!Number.isFinite(numeric)) return raw;
|
|
678
|
-
return
|
|
682
|
+
return _chunkTCILEYM5cjs.tokenFormatter.format(numeric);
|
|
679
683
|
} catch (e8) {
|
|
680
684
|
return "...";
|
|
681
685
|
}
|
|
@@ -719,7 +723,7 @@ function AmountStep({
|
|
|
719
723
|
const usdValue = numericAmount;
|
|
720
724
|
if (_optionalChain([uiConfig, 'optionalAccess', _18 => _18.maxDepositUsd]) && usdValue > uiConfig.maxDepositUsd) {
|
|
721
725
|
setError(
|
|
722
|
-
`Maximum deposit is ${
|
|
726
|
+
`Maximum deposit is ${_chunkTCILEYM5cjs.currencyFormatter.format(uiConfig.maxDepositUsd)}`
|
|
723
727
|
);
|
|
724
728
|
return;
|
|
725
729
|
}
|
|
@@ -774,7 +778,7 @@ function AmountStep({
|
|
|
774
778
|
hasPricing && balanceUsd !== null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { style: { color: "var(--rs-muted-foreground)" }, children: [
|
|
775
779
|
" ",
|
|
776
780
|
"(",
|
|
777
|
-
|
|
781
|
+
_chunkTCILEYM5cjs.currencyFormatter.format(balanceUsd),
|
|
778
782
|
")"
|
|
779
783
|
] })
|
|
780
784
|
] }) })
|
|
@@ -911,7 +915,7 @@ function AmountStep({
|
|
|
911
915
|
)
|
|
912
916
|
] }),
|
|
913
917
|
_optionalChain([uiConfig, 'optionalAccess', _21 => _21.minDepositUsd]) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-minimum", children: [
|
|
914
|
-
|
|
918
|
+
_chunkTCILEYM5cjs.currencyFormatter.format(uiConfig.minDepositUsd),
|
|
915
919
|
" minimum deposit"
|
|
916
920
|
] }),
|
|
917
921
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", children: [
|
|
@@ -937,7 +941,7 @@ function AmountStep({
|
|
|
937
941
|
] })
|
|
938
942
|
] }),
|
|
939
943
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
940
|
-
|
|
944
|
+
_chunkTCILEYM5cjs.Button,
|
|
941
945
|
{
|
|
942
946
|
onClick: handleContinue,
|
|
943
947
|
fullWidth: true,
|
|
@@ -945,7 +949,7 @@ function AmountStep({
|
|
|
945
949
|
children: _optionalChain([uiConfig, 'optionalAccess', _22 => _22.minDepositUsd]) && parseFloat(amount) > 0 && parseFloat(amount) < uiConfig.minDepositUsd ? "Update order" : "Continue"
|
|
946
950
|
}
|
|
947
951
|
) }),
|
|
948
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
952
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkTCILEYM5cjs.PoweredBy, {})
|
|
949
953
|
] });
|
|
950
954
|
}
|
|
951
955
|
|
|
@@ -995,7 +999,7 @@ function ConfirmStep({
|
|
|
995
999
|
setIsSwitching(true);
|
|
996
1000
|
switchChain(asset.chainId).catch((err) => {
|
|
997
1001
|
const raw = err instanceof Error ? err.message : "Failed to switch chain";
|
|
998
|
-
setError(
|
|
1002
|
+
setError(_chunkTCILEYM5cjs.formatUserError.call(void 0, raw));
|
|
999
1003
|
}).finally(() => {
|
|
1000
1004
|
setIsSwitching(false);
|
|
1001
1005
|
});
|
|
@@ -1038,7 +1042,7 @@ function ConfirmStep({
|
|
|
1038
1042
|
throw new Error("Wallet not properly connected");
|
|
1039
1043
|
}
|
|
1040
1044
|
const transferTo = sameRoute ? recipient : smartAccount;
|
|
1041
|
-
const hash =
|
|
1045
|
+
const hash = _chunkTCILEYM5cjs.isNativeAsset.call(void 0, asset) ? await walletClient.sendTransaction({
|
|
1042
1046
|
account,
|
|
1043
1047
|
chain,
|
|
1044
1048
|
to: transferTo,
|
|
@@ -1055,7 +1059,7 @@ function ConfirmStep({
|
|
|
1055
1059
|
onConfirm(hash, asset.chainId, amountUnits.toString(), asset.token);
|
|
1056
1060
|
} catch (err) {
|
|
1057
1061
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
1058
|
-
const message =
|
|
1062
|
+
const message = _chunkTCILEYM5cjs.formatUserError.call(void 0, raw);
|
|
1059
1063
|
setError(message);
|
|
1060
1064
|
_optionalChain([onError, 'optionalCall', _26 => _26(message, "TRANSFER_ERROR")]);
|
|
1061
1065
|
} finally {
|
|
@@ -1184,7 +1188,7 @@ function ConfirmStep({
|
|
|
1184
1188
|
] })
|
|
1185
1189
|
] }),
|
|
1186
1190
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1187
|
-
|
|
1191
|
+
_chunkTCILEYM5cjs.Button,
|
|
1188
1192
|
{
|
|
1189
1193
|
onClick: handleConfirm,
|
|
1190
1194
|
loading: isSubmitting,
|
|
@@ -1193,7 +1197,7 @@ function ConfirmStep({
|
|
|
1193
1197
|
children: "Confirm Order"
|
|
1194
1198
|
}
|
|
1195
1199
|
) }),
|
|
1196
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1200
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkTCILEYM5cjs.PoweredBy, {})
|
|
1197
1201
|
] });
|
|
1198
1202
|
}
|
|
1199
1203
|
|
|
@@ -1226,6 +1230,103 @@ function QRCode({ value, size = 200, iconSrc, className }) {
|
|
|
1226
1230
|
}
|
|
1227
1231
|
QRCode.displayName = "QRCode";
|
|
1228
1232
|
|
|
1233
|
+
// src/components/ui/Tooltip.tsx
|
|
1234
|
+
|
|
1235
|
+
|
|
1236
|
+
|
|
1237
|
+
|
|
1238
|
+
|
|
1239
|
+
|
|
1240
|
+
var _reactdom = require('react-dom');
|
|
1241
|
+
|
|
1242
|
+
function Tooltip({ content, children, className }) {
|
|
1243
|
+
const [open, setOpen] = _react.useState.call(void 0, false);
|
|
1244
|
+
const [position, setPosition] = _react.useState.call(void 0, null);
|
|
1245
|
+
const triggerRef = _react.useRef.call(void 0, null);
|
|
1246
|
+
const bubbleRef = _react.useRef.call(void 0, null);
|
|
1247
|
+
const updatePosition = _react.useCallback.call(void 0, () => {
|
|
1248
|
+
const trigger = triggerRef.current;
|
|
1249
|
+
if (!trigger) return;
|
|
1250
|
+
const rect = trigger.getBoundingClientRect();
|
|
1251
|
+
setPosition({
|
|
1252
|
+
top: rect.top,
|
|
1253
|
+
left: rect.left + rect.width / 2
|
|
1254
|
+
});
|
|
1255
|
+
}, []);
|
|
1256
|
+
_react.useEffect.call(void 0, () => {
|
|
1257
|
+
if (!open) return;
|
|
1258
|
+
updatePosition();
|
|
1259
|
+
function handleOutside(event) {
|
|
1260
|
+
const target = event.target;
|
|
1261
|
+
if (!target) return;
|
|
1262
|
+
if (_optionalChain([triggerRef, 'access', _27 => _27.current, 'optionalAccess', _28 => _28.contains, 'call', _29 => _29(target)])) return;
|
|
1263
|
+
if (_optionalChain([bubbleRef, 'access', _30 => _30.current, 'optionalAccess', _31 => _31.contains, 'call', _32 => _32(target)])) return;
|
|
1264
|
+
setOpen(false);
|
|
1265
|
+
}
|
|
1266
|
+
function handleKey(event) {
|
|
1267
|
+
if (event.key === "Escape") setOpen(false);
|
|
1268
|
+
}
|
|
1269
|
+
document.addEventListener("mousedown", handleOutside);
|
|
1270
|
+
document.addEventListener("touchstart", handleOutside);
|
|
1271
|
+
document.addEventListener("keydown", handleKey);
|
|
1272
|
+
window.addEventListener("scroll", updatePosition, true);
|
|
1273
|
+
window.addEventListener("resize", updatePosition);
|
|
1274
|
+
return () => {
|
|
1275
|
+
document.removeEventListener("mousedown", handleOutside);
|
|
1276
|
+
document.removeEventListener("touchstart", handleOutside);
|
|
1277
|
+
document.removeEventListener("keydown", handleKey);
|
|
1278
|
+
window.removeEventListener("scroll", updatePosition, true);
|
|
1279
|
+
window.removeEventListener("resize", updatePosition);
|
|
1280
|
+
};
|
|
1281
|
+
}, [open, updatePosition]);
|
|
1282
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1283
|
+
"span",
|
|
1284
|
+
{
|
|
1285
|
+
ref: triggerRef,
|
|
1286
|
+
className: `rs-tooltip ${_nullishCoalesce(className, () => ( ""))}`,
|
|
1287
|
+
onMouseEnter: () => setOpen(true),
|
|
1288
|
+
onMouseLeave: () => setOpen(false),
|
|
1289
|
+
children: [
|
|
1290
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1291
|
+
"span",
|
|
1292
|
+
{
|
|
1293
|
+
className: "rs-tooltip-trigger",
|
|
1294
|
+
role: "button",
|
|
1295
|
+
tabIndex: 0,
|
|
1296
|
+
"aria-label": content,
|
|
1297
|
+
onClick: (event) => {
|
|
1298
|
+
event.stopPropagation();
|
|
1299
|
+
event.preventDefault();
|
|
1300
|
+
setOpen((value) => !value);
|
|
1301
|
+
},
|
|
1302
|
+
onKeyDown: (event) => {
|
|
1303
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
1304
|
+
event.preventDefault();
|
|
1305
|
+
setOpen((value) => !value);
|
|
1306
|
+
}
|
|
1307
|
+
},
|
|
1308
|
+
children
|
|
1309
|
+
}
|
|
1310
|
+
),
|
|
1311
|
+
open && position && typeof document !== "undefined" && _reactdom.createPortal.call(void 0,
|
|
1312
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1313
|
+
"span",
|
|
1314
|
+
{
|
|
1315
|
+
ref: bubbleRef,
|
|
1316
|
+
className: "rs-tooltip-bubble",
|
|
1317
|
+
role: "tooltip",
|
|
1318
|
+
style: { top: position.top, left: position.left },
|
|
1319
|
+
children: content
|
|
1320
|
+
}
|
|
1321
|
+
),
|
|
1322
|
+
document.body
|
|
1323
|
+
)
|
|
1324
|
+
]
|
|
1325
|
+
}
|
|
1326
|
+
);
|
|
1327
|
+
}
|
|
1328
|
+
Tooltip.displayName = "Tooltip";
|
|
1329
|
+
|
|
1229
1330
|
// src/components/ui/DepositNotification.tsx
|
|
1230
1331
|
|
|
1231
1332
|
|
|
@@ -1233,9 +1334,9 @@ var INITIAL_POLL_INTERVAL = 3e3;
|
|
|
1233
1334
|
var MAX_POLL_INTERVAL = 3e4;
|
|
1234
1335
|
var BACKOFF_MULTIPLIER = 1.5;
|
|
1235
1336
|
function isEventForTx(event, txHash) {
|
|
1236
|
-
const eventTxHash =
|
|
1337
|
+
const eventTxHash = _chunkTCILEYM5cjs.getEventTxHash.call(void 0, event);
|
|
1237
1338
|
if (!eventTxHash) return false;
|
|
1238
|
-
return
|
|
1339
|
+
return _chunkTCILEYM5cjs.txRefsMatch.call(void 0, eventTxHash, txHash);
|
|
1239
1340
|
}
|
|
1240
1341
|
function truncateHash(hash) {
|
|
1241
1342
|
return `${hash.slice(0, 4)}\u2026${hash.slice(-4)}`;
|
|
@@ -1265,7 +1366,7 @@ function formatTimestamp(ms) {
|
|
|
1265
1366
|
return `${month} ${day}${suffix} \xB7 ${hours}:${minutes}:${seconds}`;
|
|
1266
1367
|
}
|
|
1267
1368
|
function formatBridgeFailedMessage(event) {
|
|
1268
|
-
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess',
|
|
1369
|
+
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _33 => _33.data]), () => ( {}));
|
|
1269
1370
|
const backendMessage = typeof eventData.message === "string" ? eventData.message.trim() : "";
|
|
1270
1371
|
if (backendMessage.length > 0) {
|
|
1271
1372
|
const lower = backendMessage.toLowerCase();
|
|
@@ -1329,7 +1430,7 @@ function DepositNotification({
|
|
|
1329
1430
|
const pollIntervalRef = _react.useRef.call(void 0, INITIAL_POLL_INTERVAL);
|
|
1330
1431
|
const pollTimeoutRef = _react.useRef.call(void 0, null);
|
|
1331
1432
|
const completedRef = _react.useRef.call(void 0, _nullishCoalesce(directTransfer, () => ( false)));
|
|
1332
|
-
const depositContextRef =
|
|
1433
|
+
const depositContextRef = _chunkTCILEYM5cjs.useLatestRef.call(void 0, {
|
|
1333
1434
|
amount,
|
|
1334
1435
|
sourceChain,
|
|
1335
1436
|
sourceToken: token,
|
|
@@ -1338,8 +1439,8 @@ function DepositNotification({
|
|
|
1338
1439
|
waitForFinalTx,
|
|
1339
1440
|
hasPostBridgeActions
|
|
1340
1441
|
});
|
|
1341
|
-
const onCompleteRef =
|
|
1342
|
-
const onFailedRef =
|
|
1442
|
+
const onCompleteRef = _chunkTCILEYM5cjs.useLatestRef.call(void 0, onComplete);
|
|
1443
|
+
const onFailedRef = _chunkTCILEYM5cjs.useLatestRef.call(void 0, onFailed);
|
|
1343
1444
|
const handleComplete = _react.useCallback.call(void 0,
|
|
1344
1445
|
(destTxHash) => {
|
|
1345
1446
|
if (completedRef.current) return;
|
|
@@ -1348,7 +1449,7 @@ function DepositNotification({
|
|
|
1348
1449
|
setCompletedAt(Date.now());
|
|
1349
1450
|
setStatus("complete");
|
|
1350
1451
|
const context = depositContextRef.current;
|
|
1351
|
-
_optionalChain([onCompleteRef, 'access',
|
|
1452
|
+
_optionalChain([onCompleteRef, 'access', _34 => _34.current, 'optionalCall', _35 => _35(txHash, destTxHash, {
|
|
1352
1453
|
amount: context.amount,
|
|
1353
1454
|
sourceChain: context.sourceChain,
|
|
1354
1455
|
sourceToken: context.sourceToken,
|
|
@@ -1363,7 +1464,7 @@ function DepositNotification({
|
|
|
1363
1464
|
if (completedRef.current) return;
|
|
1364
1465
|
completedRef.current = true;
|
|
1365
1466
|
setStatus("failed");
|
|
1366
|
-
_optionalChain([onFailedRef, 'access',
|
|
1467
|
+
_optionalChain([onFailedRef, 'access', _36 => _36.current, 'optionalCall', _37 => _37(txHash, error)]);
|
|
1367
1468
|
},
|
|
1368
1469
|
[onFailedRef, txHash]
|
|
1369
1470
|
);
|
|
@@ -1381,30 +1482,30 @@ function DepositNotification({
|
|
|
1381
1482
|
const lastEvent = data.lastEvent;
|
|
1382
1483
|
const eventForTx = isEventForTx(lastEvent, txHash) ? lastEvent : void 0;
|
|
1383
1484
|
const awaitingPostBridgeSwap = depositContextRef.current.waitForFinalTx && depositContextRef.current.hasPostBridgeActions;
|
|
1384
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
1385
|
-
const swapTxHash = _optionalChain([eventForTx, 'access',
|
|
1485
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _38 => _38.type]) === "post-bridge-swap-complete") {
|
|
1486
|
+
const swapTxHash = _optionalChain([eventForTx, 'access', _39 => _39.data, 'optionalAccess', _40 => _40.swap, 'optionalAccess', _41 => _41.transactionHash]);
|
|
1386
1487
|
handleComplete(swapTxHash);
|
|
1387
1488
|
return;
|
|
1388
1489
|
}
|
|
1389
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
1490
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _42 => _42.type]) === "post-bridge-swap-failed") {
|
|
1390
1491
|
handleFailed(formatBridgeFailedMessage(eventForTx));
|
|
1391
1492
|
return;
|
|
1392
1493
|
}
|
|
1393
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
1394
|
-
const destTx = _optionalChain([eventForTx, 'access',
|
|
1494
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _43 => _43.type]) === "bridge-complete" && !awaitingPostBridgeSwap) {
|
|
1495
|
+
const destTx = _optionalChain([eventForTx, 'access', _44 => _44.data, 'optionalAccess', _45 => _45.destination, 'optionalAccess', _46 => _46.transactionHash]);
|
|
1395
1496
|
handleComplete(destTx);
|
|
1396
1497
|
return;
|
|
1397
1498
|
}
|
|
1398
|
-
if (!waitForFinalTx && _optionalChain([eventForTx, 'optionalAccess',
|
|
1499
|
+
if (!waitForFinalTx && _optionalChain([eventForTx, 'optionalAccess', _47 => _47.type]) === "bridge-started") {
|
|
1399
1500
|
handleComplete(void 0);
|
|
1400
1501
|
return;
|
|
1401
1502
|
}
|
|
1402
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
1503
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _48 => _48.type]) === "bridge-failed") {
|
|
1403
1504
|
handleFailed(formatBridgeFailedMessage(eventForTx));
|
|
1404
1505
|
return;
|
|
1405
1506
|
}
|
|
1406
|
-
if (_optionalChain([eventForTx, 'optionalAccess',
|
|
1407
|
-
const errorMessage = _nullishCoalesce(_optionalChain([eventForTx, 'access',
|
|
1507
|
+
if (_optionalChain([eventForTx, 'optionalAccess', _49 => _49.type]) === "error") {
|
|
1508
|
+
const errorMessage = _nullishCoalesce(_optionalChain([eventForTx, 'access', _50 => _50.data, 'optionalAccess', _51 => _51.message]), () => ( "Unknown error"));
|
|
1408
1509
|
handleFailed(errorMessage);
|
|
1409
1510
|
return;
|
|
1410
1511
|
}
|
|
@@ -1476,7 +1577,7 @@ function DepositNotification({
|
|
|
1476
1577
|
}
|
|
1477
1578
|
)
|
|
1478
1579
|
}
|
|
1479
|
-
) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--processing", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1580
|
+
) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notification-badge rs-deposit-notification-badge--processing", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkTCILEYM5cjs.Spinner, {}) });
|
|
1480
1581
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1481
1582
|
"div",
|
|
1482
1583
|
{
|
|
@@ -1600,7 +1701,7 @@ var DEFAULT_SOLANA_RPC_URL = "https://api.mainnet.solana.com";
|
|
|
1600
1701
|
var configuredSolanaRpcUrl = null;
|
|
1601
1702
|
var cachedConnections = /* @__PURE__ */ new Map();
|
|
1602
1703
|
function configureSolanaRpcUrl(rpcUrl) {
|
|
1603
|
-
const normalized = _optionalChain([rpcUrl, 'optionalAccess',
|
|
1704
|
+
const normalized = _optionalChain([rpcUrl, 'optionalAccess', _52 => _52.trim, 'call', _53 => _53()]);
|
|
1604
1705
|
configuredSolanaRpcUrl = normalized ? normalized : null;
|
|
1605
1706
|
cachedConnections.clear();
|
|
1606
1707
|
}
|
|
@@ -1735,7 +1836,7 @@ function resolveSolanaTokenMeta(token) {
|
|
|
1735
1836
|
return {};
|
|
1736
1837
|
}
|
|
1737
1838
|
function getDepositEventDetails(event) {
|
|
1738
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
1839
|
+
if (!_optionalChain([event, 'optionalAccess', _54 => _54.type]) || !isRecord(event.data)) return {};
|
|
1739
1840
|
if (event.type === "deposit-received") {
|
|
1740
1841
|
const chainId = asChainId(event.data.chain);
|
|
1741
1842
|
const token = asString(event.data.token);
|
|
@@ -1749,12 +1850,12 @@ function getDepositEventDetails(event) {
|
|
|
1749
1850
|
}
|
|
1750
1851
|
if (event.type === "bridge-started") {
|
|
1751
1852
|
const source = isRecord(event.data.source) ? event.data.source : void 0;
|
|
1752
|
-
const chainId = asChainId(_optionalChain([source, 'optionalAccess',
|
|
1753
|
-
const token = asString(_optionalChain([source, 'optionalAccess',
|
|
1853
|
+
const chainId = asChainId(_optionalChain([source, 'optionalAccess', _55 => _55.chain]));
|
|
1854
|
+
const token = asString(_optionalChain([source, 'optionalAccess', _56 => _56.asset]));
|
|
1754
1855
|
const solanaMeta = chainId === "solana" ? resolveSolanaTokenMeta(token) : {};
|
|
1755
1856
|
return {
|
|
1756
1857
|
chainId,
|
|
1757
|
-
amount: asAmount(_optionalChain([source, 'optionalAccess',
|
|
1858
|
+
amount: asAmount(_optionalChain([source, 'optionalAccess', _57 => _57.amount])),
|
|
1758
1859
|
token,
|
|
1759
1860
|
...solanaMeta
|
|
1760
1861
|
};
|
|
@@ -1773,6 +1874,7 @@ function DepositAddressStep({
|
|
|
1773
1874
|
targetToken,
|
|
1774
1875
|
waitForFinalTx,
|
|
1775
1876
|
hasPostBridgeActions,
|
|
1877
|
+
uiConfig,
|
|
1776
1878
|
onDepositSubmitted,
|
|
1777
1879
|
onDepositComplete,
|
|
1778
1880
|
onDepositFailed,
|
|
@@ -1781,12 +1883,12 @@ function DepositAddressStep({
|
|
|
1781
1883
|
}) {
|
|
1782
1884
|
const hasSolana = Boolean(solanaDepositAddress);
|
|
1783
1885
|
const allowedChainSet = _react.useMemo.call(void 0,
|
|
1784
|
-
() => _optionalChain([allowedRoutes, 'optionalAccess',
|
|
1785
|
-
[_optionalChain([allowedRoutes, 'optionalAccess',
|
|
1886
|
+
() => _optionalChain([allowedRoutes, 'optionalAccess', _58 => _58.sourceChains]) ? new Set(allowedRoutes.sourceChains) : null,
|
|
1887
|
+
[_optionalChain([allowedRoutes, 'optionalAccess', _59 => _59.sourceChains])]
|
|
1786
1888
|
);
|
|
1787
1889
|
const allowedTokenSet = _react.useMemo.call(void 0,
|
|
1788
|
-
() => _optionalChain([allowedRoutes, 'optionalAccess',
|
|
1789
|
-
[_optionalChain([allowedRoutes, 'optionalAccess',
|
|
1890
|
+
() => _optionalChain([allowedRoutes, 'optionalAccess', _60 => _60.sourceTokens]) ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null,
|
|
1891
|
+
[_optionalChain([allowedRoutes, 'optionalAccess', _61 => _61.sourceTokens])]
|
|
1790
1892
|
);
|
|
1791
1893
|
const evmChainIds = _react.useMemo.call(void 0, () => {
|
|
1792
1894
|
const all = _chunkMUWVDVY4cjs.getSupportedChainIds.call(void 0, );
|
|
@@ -1818,6 +1920,7 @@ function DepositAddressStep({
|
|
|
1818
1920
|
const [pollingError, setPollingError] = _react.useState.call(void 0, null);
|
|
1819
1921
|
const [chainDropdownOpen, setChainDropdownOpen] = _react.useState.call(void 0, false);
|
|
1820
1922
|
const [tokenDropdownOpen, setTokenDropdownOpen] = _react.useState.call(void 0, false);
|
|
1923
|
+
const [priceImpactExpanded, setPriceImpactExpanded] = _react.useState.call(void 0, false);
|
|
1821
1924
|
const chainDropdownRef = _react.useRef.call(void 0, null);
|
|
1822
1925
|
const tokenDropdownRef = _react.useRef.call(void 0, null);
|
|
1823
1926
|
const [notifications, setNotifications] = _react.useState.call(void 0, []);
|
|
@@ -1834,9 +1937,9 @@ function DepositAddressStep({
|
|
|
1834
1937
|
const matched = _nullishCoalesce(SOLANA_TOKENS.find((t) => t.symbol === sourceTokenSymbol), () => ( SOLANA_TOKENS[0]));
|
|
1835
1938
|
sourceSelectionRef.current = {
|
|
1836
1939
|
chainId: "solana",
|
|
1837
|
-
token: _optionalChain([matched, 'optionalAccess',
|
|
1838
|
-
sourceSymbol: _optionalChain([matched, 'optionalAccess',
|
|
1839
|
-
sourceDecimals: _optionalChain([matched, 'optionalAccess',
|
|
1940
|
+
token: _optionalChain([matched, 'optionalAccess', _62 => _62.mint]),
|
|
1941
|
+
sourceSymbol: _optionalChain([matched, 'optionalAccess', _63 => _63.symbol]),
|
|
1942
|
+
sourceDecimals: _optionalChain([matched, 'optionalAccess', _64 => _64.decimals])
|
|
1840
1943
|
};
|
|
1841
1944
|
return;
|
|
1842
1945
|
}
|
|
@@ -1852,8 +1955,8 @@ function DepositAddressStep({
|
|
|
1852
1955
|
function handlePointerDown(event) {
|
|
1853
1956
|
const target = event.target;
|
|
1854
1957
|
if (!target) return;
|
|
1855
|
-
const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access',
|
|
1856
|
-
const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access',
|
|
1958
|
+
const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access', _65 => _65.current, 'optionalAccess', _66 => _66.contains, 'call', _67 => _67(target)]);
|
|
1959
|
+
const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access', _68 => _68.current, 'optionalAccess', _69 => _69.contains, 'call', _70 => _70(target)]);
|
|
1857
1960
|
if (clickedChainDropdown || clickedTokenDropdown) return;
|
|
1858
1961
|
setChainDropdownOpen(false);
|
|
1859
1962
|
setTokenDropdownOpen(false);
|
|
@@ -1866,7 +1969,7 @@ function DepositAddressStep({
|
|
|
1866
1969
|
};
|
|
1867
1970
|
}, [chainDropdownOpen, tokenDropdownOpen]);
|
|
1868
1971
|
const handleCopy = _react.useCallback.call(void 0, async () => {
|
|
1869
|
-
_optionalChain([onCopyAddress, 'optionalCall',
|
|
1972
|
+
_optionalChain([onCopyAddress, 'optionalCall', _71 => _71()]);
|
|
1870
1973
|
try {
|
|
1871
1974
|
await navigator.clipboard.writeText(displayAddress);
|
|
1872
1975
|
setCopied(true);
|
|
@@ -1925,10 +2028,10 @@ function DepositAddressStep({
|
|
|
1925
2028
|
return;
|
|
1926
2029
|
}
|
|
1927
2030
|
const event = status.lastEvent;
|
|
1928
|
-
const eventTxHash =
|
|
2031
|
+
const eventTxHash = _chunkTCILEYM5cjs.isDepositEvent.call(void 0, event) ? _nullishCoalesce(_chunkTCILEYM5cjs.getEventTxHash.call(void 0, event), () => ( null)) : null;
|
|
1929
2032
|
if (baselineTxHashRef.current === void 0) {
|
|
1930
2033
|
baselineTxHashRef.current = eventTxHash;
|
|
1931
|
-
} else if (eventTxHash && (!baselineTxHashRef.current || !
|
|
2034
|
+
} else if (eventTxHash && (!baselineTxHashRef.current || !_chunkTCILEYM5cjs.txRefsMatch.call(void 0, eventTxHash, baselineTxHashRef.current))) {
|
|
1932
2035
|
const details = getDepositEventDetails(event);
|
|
1933
2036
|
const fallback = sourceSelectionRef.current;
|
|
1934
2037
|
const chainId = _nullishCoalesce(details.chainId, () => ( fallback.chainId));
|
|
@@ -1959,7 +2062,7 @@ function DepositAddressStep({
|
|
|
1959
2062
|
directTransfer
|
|
1960
2063
|
};
|
|
1961
2064
|
setNotifications((prev) => [notification, ...prev]);
|
|
1962
|
-
_optionalChain([onDepositSubmittedRef, 'access',
|
|
2065
|
+
_optionalChain([onDepositSubmittedRef, 'access', _72 => _72.current, 'optionalCall', _73 => _73({
|
|
1963
2066
|
txHash: eventTxHash,
|
|
1964
2067
|
sourceChain: chainId,
|
|
1965
2068
|
amount
|
|
@@ -1971,7 +2074,7 @@ function DepositAddressStep({
|
|
|
1971
2074
|
if (!cancelled) {
|
|
1972
2075
|
const msg = err instanceof Error ? err.message : "Failed to check status";
|
|
1973
2076
|
setPollingError(msg);
|
|
1974
|
-
_optionalChain([onErrorRef, 'access',
|
|
2077
|
+
_optionalChain([onErrorRef, 'access', _74 => _74.current, 'optionalCall', _75 => _75(msg, "STATUS_POLL_ERROR")]);
|
|
1975
2078
|
}
|
|
1976
2079
|
}
|
|
1977
2080
|
if (!cancelled) {
|
|
@@ -1987,14 +2090,14 @@ function DepositAddressStep({
|
|
|
1987
2090
|
const handleNotificationComplete = _react.useCallback.call(void 0,
|
|
1988
2091
|
(txHash, destinationTxHash, context) => {
|
|
1989
2092
|
isTrackingRef.current = false;
|
|
1990
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
2093
|
+
_optionalChain([onDepositCompleteRef, 'access', _76 => _76.current, 'optionalCall', _77 => _77(txHash, destinationTxHash, context)]);
|
|
1991
2094
|
},
|
|
1992
2095
|
[]
|
|
1993
2096
|
);
|
|
1994
2097
|
const handleNotificationFailed = _react.useCallback.call(void 0,
|
|
1995
2098
|
(txHash, error) => {
|
|
1996
2099
|
isTrackingRef.current = false;
|
|
1997
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
2100
|
+
_optionalChain([onDepositFailedRef, 'access', _78 => _78.current, 'optionalCall', _79 => _79(txHash, error)]);
|
|
1998
2101
|
},
|
|
1999
2102
|
[]
|
|
2000
2103
|
);
|
|
@@ -2072,7 +2175,28 @@ function DepositAddressStep({
|
|
|
2072
2175
|
)) })
|
|
2073
2176
|
] }),
|
|
2074
2177
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", ref: tokenDropdownRef, children: [
|
|
2075
|
-
/* @__PURE__ */ _jsxruntime.
|
|
2178
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown-label rs-deposit-address-dropdown-label--with-min", children: [
|
|
2179
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Supported token" }),
|
|
2180
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
2181
|
+
"Min $",
|
|
2182
|
+
_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _80 => _80.minDepositUsd]), () => ( 0.1)),
|
|
2183
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2184
|
+
"svg",
|
|
2185
|
+
{
|
|
2186
|
+
className: "rs-deposit-address-min-icon",
|
|
2187
|
+
viewBox: "0 0 24 24",
|
|
2188
|
+
fill: "none",
|
|
2189
|
+
stroke: "currentColor",
|
|
2190
|
+
strokeWidth: "2",
|
|
2191
|
+
"aria-hidden": "true",
|
|
2192
|
+
children: [
|
|
2193
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "12", cy: "12", r: "9" }),
|
|
2194
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 8h.01M11 12h1v4h1" })
|
|
2195
|
+
]
|
|
2196
|
+
}
|
|
2197
|
+
) })
|
|
2198
|
+
] })
|
|
2199
|
+
] }),
|
|
2076
2200
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2077
2201
|
"button",
|
|
2078
2202
|
{
|
|
@@ -2183,6 +2307,103 @@ function DepositAddressStep({
|
|
|
2183
2307
|
}
|
|
2184
2308
|
)
|
|
2185
2309
|
] }),
|
|
2310
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2311
|
+
"div",
|
|
2312
|
+
{
|
|
2313
|
+
className: `rs-price-impact ${priceImpactExpanded ? "rs-price-impact--open" : ""}`,
|
|
2314
|
+
children: [
|
|
2315
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2316
|
+
"button",
|
|
2317
|
+
{
|
|
2318
|
+
type: "button",
|
|
2319
|
+
className: "rs-price-impact-header",
|
|
2320
|
+
onClick: () => setPriceImpactExpanded((v) => !v),
|
|
2321
|
+
"aria-expanded": priceImpactExpanded,
|
|
2322
|
+
children: [
|
|
2323
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", children: [
|
|
2324
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "12", cy: "12", r: "9" }),
|
|
2325
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2326
|
+
"path",
|
|
2327
|
+
{
|
|
2328
|
+
strokeLinecap: "round",
|
|
2329
|
+
strokeLinejoin: "round",
|
|
2330
|
+
d: "M15 9.5a2.5 2.5 0 00-2.5-2h-1A2 2 0 0011 11.5h2a2 2 0 010 4h-1a2.5 2.5 0 01-2.5-2M12 7v1m0 8v1"
|
|
2331
|
+
}
|
|
2332
|
+
)
|
|
2333
|
+
] }) }),
|
|
2334
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
2335
|
+
"Price impact: ",
|
|
2336
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" })
|
|
2337
|
+
] }),
|
|
2338
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2339
|
+
Tooltip,
|
|
2340
|
+
{
|
|
2341
|
+
className: "rs-price-impact-info",
|
|
2342
|
+
content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
|
|
2343
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": "true", children: [
|
|
2344
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "12", cy: "12", r: "9" }),
|
|
2345
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 8h.01M11 12h1v4h1" })
|
|
2346
|
+
] })
|
|
2347
|
+
}
|
|
2348
|
+
),
|
|
2349
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2350
|
+
"svg",
|
|
2351
|
+
{
|
|
2352
|
+
className: "rs-price-impact-chevron",
|
|
2353
|
+
viewBox: "0 0 24 24",
|
|
2354
|
+
fill: "none",
|
|
2355
|
+
stroke: "currentColor",
|
|
2356
|
+
strokeWidth: "2",
|
|
2357
|
+
"aria-hidden": "true",
|
|
2358
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.5 8.25l-7.5 7.5-7.5-7.5" })
|
|
2359
|
+
}
|
|
2360
|
+
)
|
|
2361
|
+
]
|
|
2362
|
+
}
|
|
2363
|
+
),
|
|
2364
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-price-impact-panel", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-panel-inner", children: [
|
|
2365
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
2366
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", children: [
|
|
2367
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "12", cy: "12", r: "9" }),
|
|
2368
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2369
|
+
"path",
|
|
2370
|
+
{
|
|
2371
|
+
strokeLinecap: "round",
|
|
2372
|
+
strokeLinejoin: "round",
|
|
2373
|
+
d: "M8.5 15.5l7-7M9.5 9.5h.01M14.5 14.5h.01"
|
|
2374
|
+
}
|
|
2375
|
+
)
|
|
2376
|
+
] }) }),
|
|
2377
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
2378
|
+
"Max slippage: ",
|
|
2379
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "Auto \u2022 0.1%" })
|
|
2380
|
+
] }),
|
|
2381
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2382
|
+
Tooltip,
|
|
2383
|
+
{
|
|
2384
|
+
className: "rs-price-impact-info",
|
|
2385
|
+
content: "Slippage accounts for price changes during execution. Slippage is adjusted per pair to ensure reliable execution.",
|
|
2386
|
+
children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": "true", children: [
|
|
2387
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "12", cy: "12", r: "9" }),
|
|
2388
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 8h.01M11 12h1v4h1" })
|
|
2389
|
+
] })
|
|
2390
|
+
}
|
|
2391
|
+
)
|
|
2392
|
+
] }),
|
|
2393
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-row", children: [
|
|
2394
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", children: [
|
|
2395
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "12", cy: "12", r: "9" }),
|
|
2396
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 7.5V12l2.5 2" })
|
|
2397
|
+
] }) }),
|
|
2398
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-label", children: [
|
|
2399
|
+
"Processing time: ",
|
|
2400
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "< 1 min" })
|
|
2401
|
+
] })
|
|
2402
|
+
] })
|
|
2403
|
+
] }) })
|
|
2404
|
+
]
|
|
2405
|
+
}
|
|
2406
|
+
),
|
|
2186
2407
|
pollingError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-error", children: pollingError })
|
|
2187
2408
|
] }) }),
|
|
2188
2409
|
notifications.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-notifications", children: notifications.map((deposit) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2201,7 +2422,7 @@ function DepositAddressStep({
|
|
|
2201
2422
|
},
|
|
2202
2423
|
deposit.id
|
|
2203
2424
|
)) }),
|
|
2204
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2425
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkTCILEYM5cjs.PoweredBy, {})
|
|
2205
2426
|
] });
|
|
2206
2427
|
}
|
|
2207
2428
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
@@ -2232,7 +2453,7 @@ function SolanaTokenSelectStep({
|
|
|
2232
2453
|
setError(null);
|
|
2233
2454
|
const portfolioBySymbol = {};
|
|
2234
2455
|
try {
|
|
2235
|
-
|
|
2456
|
+
_chunkTCILEYM5cjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:request", {
|
|
2236
2457
|
solanaAddress
|
|
2237
2458
|
});
|
|
2238
2459
|
const portfolio = await service.fetchSolanaPortfolio(solanaAddress);
|
|
@@ -2255,12 +2476,12 @@ function SolanaTokenSelectStep({
|
|
|
2255
2476
|
};
|
|
2256
2477
|
}
|
|
2257
2478
|
}
|
|
2258
|
-
|
|
2479
|
+
_chunkTCILEYM5cjs.debugLog.call(void 0, debug, "solana-token-select", "portfolio:success", {
|
|
2259
2480
|
symbols: Object.keys(portfolioBySymbol)
|
|
2260
2481
|
});
|
|
2261
2482
|
} catch (err) {
|
|
2262
2483
|
if (!active) return;
|
|
2263
|
-
|
|
2484
|
+
_chunkTCILEYM5cjs.debugError.call(void 0, debug, "solana-token-select", "portfolio:failure", err, {
|
|
2264
2485
|
solanaAddress
|
|
2265
2486
|
});
|
|
2266
2487
|
setError(
|
|
@@ -2285,7 +2506,7 @@ function SolanaTokenSelectStep({
|
|
|
2285
2506
|
setTokenBalances(results);
|
|
2286
2507
|
setLoading(false);
|
|
2287
2508
|
const totalUsd = results.reduce((sum, r) => sum + r.balanceUsd, 0);
|
|
2288
|
-
_optionalChain([onTotalBalanceComputed, 'optionalCall',
|
|
2509
|
+
_optionalChain([onTotalBalanceComputed, 'optionalCall', _81 => _81(totalUsd)]);
|
|
2289
2510
|
}
|
|
2290
2511
|
void loadBalances();
|
|
2291
2512
|
return () => {
|
|
@@ -2314,7 +2535,7 @@ function SolanaTokenSelectStep({
|
|
|
2314
2535
|
style: { paddingTop: 4, overflow: "auto", maxHeight: 340 },
|
|
2315
2536
|
children: [
|
|
2316
2537
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-loading-state", style: { padding: "40px 12px" }, children: [
|
|
2317
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2538
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkTCILEYM5cjs.Spinner, { className: "rs-text-tertiary" }),
|
|
2318
2539
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-text-sm rs-text-tertiary", children: "Loading balances" })
|
|
2319
2540
|
] }),
|
|
2320
2541
|
!loading && rows.length === 0 && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-empty-state", children: [
|
|
@@ -2351,7 +2572,7 @@ function SolanaTokenSelectStep({
|
|
|
2351
2572
|
try {
|
|
2352
2573
|
const raw = _viem.formatUnits.call(void 0, entry.balance, entry.token.decimals);
|
|
2353
2574
|
const numeric = Number(raw);
|
|
2354
|
-
formattedBalance = Number.isFinite(numeric) ?
|
|
2575
|
+
formattedBalance = Number.isFinite(numeric) ? _chunkTCILEYM5cjs.tokenFormatter.format(numeric) : raw;
|
|
2355
2576
|
} catch (e15) {
|
|
2356
2577
|
formattedBalance = "...";
|
|
2357
2578
|
}
|
|
@@ -2395,7 +2616,7 @@ function SolanaTokenSelectStep({
|
|
|
2395
2616
|
] })
|
|
2396
2617
|
] })
|
|
2397
2618
|
] }),
|
|
2398
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ?
|
|
2619
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-asset-balance", children: entry.balanceUsd > 0 ? _chunkTCILEYM5cjs.currencyFormatter.format(entry.balanceUsd) : `${formattedBalance} ${entry.token.symbol}` })
|
|
2399
2620
|
]
|
|
2400
2621
|
},
|
|
2401
2622
|
entry.token.symbol
|
|
@@ -2405,7 +2626,7 @@ function SolanaTokenSelectStep({
|
|
|
2405
2626
|
}
|
|
2406
2627
|
),
|
|
2407
2628
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2408
|
-
|
|
2629
|
+
_chunkTCILEYM5cjs.Button,
|
|
2409
2630
|
{
|
|
2410
2631
|
onClick: () => selectedEntry && onContinue(
|
|
2411
2632
|
selectedEntry.token,
|
|
@@ -2417,7 +2638,7 @@ function SolanaTokenSelectStep({
|
|
|
2417
2638
|
children: "Continue"
|
|
2418
2639
|
}
|
|
2419
2640
|
) }),
|
|
2420
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2641
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkTCILEYM5cjs.PoweredBy, {})
|
|
2421
2642
|
] });
|
|
2422
2643
|
}
|
|
2423
2644
|
|
|
@@ -2465,7 +2686,7 @@ function SolanaAmountStep({
|
|
|
2465
2686
|
const raw = _viem.formatUnits.call(void 0, balance, token.decimals);
|
|
2466
2687
|
const numeric = Number(raw);
|
|
2467
2688
|
if (!Number.isFinite(numeric)) return raw;
|
|
2468
|
-
return
|
|
2689
|
+
return _chunkTCILEYM5cjs.tokenFormatter.format(numeric);
|
|
2469
2690
|
} catch (e17) {
|
|
2470
2691
|
return "...";
|
|
2471
2692
|
}
|
|
@@ -2483,7 +2704,7 @@ function SolanaAmountStep({
|
|
|
2483
2704
|
}, [balance, token.decimals, tokenPriceUsd, balanceUsd]);
|
|
2484
2705
|
const formattedBalanceUsd = _react.useMemo.call(void 0, () => {
|
|
2485
2706
|
if (computedBalanceUsd === null || computedBalanceUsd <= 0) return null;
|
|
2486
|
-
return
|
|
2707
|
+
return _chunkTCILEYM5cjs.currencyFormatter.format(computedBalanceUsd);
|
|
2487
2708
|
}, [computedBalanceUsd]);
|
|
2488
2709
|
const spendableBalance = _react.useMemo.call(void 0, () => {
|
|
2489
2710
|
if (!isNativeSol(token)) return balance;
|
|
@@ -2508,7 +2729,7 @@ function SolanaAmountStep({
|
|
|
2508
2729
|
const factor = 10 ** maxDecimals;
|
|
2509
2730
|
const truncated = Math.floor(value * factor) / factor;
|
|
2510
2731
|
const formatted = truncated.toFixed(maxDecimals).replace(/\.?0+$/, "");
|
|
2511
|
-
|
|
2732
|
+
_chunkTCILEYM5cjs.debugLog.call(void 0, debug, "solana-amount", "amount:preset", {
|
|
2512
2733
|
percentage,
|
|
2513
2734
|
symbol: token.symbol,
|
|
2514
2735
|
formatted
|
|
@@ -2522,7 +2743,7 @@ function SolanaAmountStep({
|
|
|
2522
2743
|
const handleContinue = () => {
|
|
2523
2744
|
const numericAmount = parseFloat(amount);
|
|
2524
2745
|
if (isNaN(numericAmount) || numericAmount <= 0) {
|
|
2525
|
-
|
|
2746
|
+
_chunkTCILEYM5cjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2526
2747
|
amount,
|
|
2527
2748
|
reason: "nan-or-non-positive"
|
|
2528
2749
|
});
|
|
@@ -2532,13 +2753,13 @@ function SolanaAmountStep({
|
|
|
2532
2753
|
const sourceAmount = isSourceStablecoin || !hasPricing ? numericAmount : numericAmount / tokenPriceUsd;
|
|
2533
2754
|
if (hasPricing) {
|
|
2534
2755
|
const usdValue = numericAmount;
|
|
2535
|
-
if (_optionalChain([uiConfig, 'optionalAccess',
|
|
2756
|
+
if (_optionalChain([uiConfig, 'optionalAccess', _82 => _82.maxDepositUsd]) && usdValue > uiConfig.maxDepositUsd) {
|
|
2536
2757
|
setError(
|
|
2537
|
-
`Maximum deposit is ${
|
|
2758
|
+
`Maximum deposit is ${_chunkTCILEYM5cjs.currencyFormatter.format(uiConfig.maxDepositUsd)}`
|
|
2538
2759
|
);
|
|
2539
2760
|
return;
|
|
2540
2761
|
}
|
|
2541
|
-
if (_optionalChain([uiConfig, 'optionalAccess',
|
|
2762
|
+
if (_optionalChain([uiConfig, 'optionalAccess', _83 => _83.minDepositUsd]) && usdValue < uiConfig.minDepositUsd) {
|
|
2542
2763
|
setAmount(uiConfig.minDepositUsd.toString());
|
|
2543
2764
|
setError(null);
|
|
2544
2765
|
return;
|
|
@@ -2549,7 +2770,7 @@ function SolanaAmountStep({
|
|
|
2549
2770
|
try {
|
|
2550
2771
|
amountInUnits = _viem.parseUnits.call(void 0, sourceAmountStr, token.decimals);
|
|
2551
2772
|
} catch (e21) {
|
|
2552
|
-
|
|
2773
|
+
_chunkTCILEYM5cjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2553
2774
|
amount,
|
|
2554
2775
|
sourceAmount: sourceAmountStr,
|
|
2555
2776
|
reason: "parse-units-failed"
|
|
@@ -2559,7 +2780,7 @@ function SolanaAmountStep({
|
|
|
2559
2780
|
}
|
|
2560
2781
|
if (amountInUnits > spendableBalance) {
|
|
2561
2782
|
const isReserveIssue = isNativeSol(token) && amountInUnits <= balance;
|
|
2562
|
-
|
|
2783
|
+
_chunkTCILEYM5cjs.debugLog.call(void 0, debug, "solana-amount", "amount:invalid", {
|
|
2563
2784
|
amount,
|
|
2564
2785
|
balance: balance.toString(),
|
|
2565
2786
|
spendableBalance: spendableBalance.toString(),
|
|
@@ -2571,7 +2792,7 @@ function SolanaAmountStep({
|
|
|
2571
2792
|
);
|
|
2572
2793
|
return;
|
|
2573
2794
|
}
|
|
2574
|
-
|
|
2795
|
+
_chunkTCILEYM5cjs.debugLog.call(void 0, debug, "solana-amount", "amount:continue", {
|
|
2575
2796
|
symbol: token.symbol,
|
|
2576
2797
|
inputAmountUsd: amount,
|
|
2577
2798
|
sourceAmount: sourceAmountStr,
|
|
@@ -2639,8 +2860,8 @@ function SolanaAmountStep({
|
|
|
2639
2860
|
}
|
|
2640
2861
|
)
|
|
2641
2862
|
] }),
|
|
2642
|
-
_optionalChain([uiConfig, 'optionalAccess',
|
|
2643
|
-
|
|
2863
|
+
_optionalChain([uiConfig, 'optionalAccess', _84 => _84.minDepositUsd]) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-minimum", children: [
|
|
2864
|
+
_chunkTCILEYM5cjs.currencyFormatter.format(uiConfig.minDepositUsd),
|
|
2644
2865
|
" minimum deposit"
|
|
2645
2866
|
] }),
|
|
2646
2867
|
error && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-error", children: [
|
|
@@ -2666,15 +2887,15 @@ function SolanaAmountStep({
|
|
|
2666
2887
|
] })
|
|
2667
2888
|
] }),
|
|
2668
2889
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2669
|
-
|
|
2890
|
+
_chunkTCILEYM5cjs.Button,
|
|
2670
2891
|
{
|
|
2671
2892
|
onClick: handleContinue,
|
|
2672
2893
|
fullWidth: true,
|
|
2673
2894
|
disabled: !amount,
|
|
2674
|
-
children: _optionalChain([uiConfig, 'optionalAccess',
|
|
2895
|
+
children: _optionalChain([uiConfig, 'optionalAccess', _85 => _85.minDepositUsd]) && parseFloat(amount) > 0 && parseFloat(amount) < uiConfig.minDepositUsd ? "Update order" : "Continue"
|
|
2675
2896
|
}
|
|
2676
2897
|
) }),
|
|
2677
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2898
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkTCILEYM5cjs.PoweredBy, {})
|
|
2678
2899
|
] });
|
|
2679
2900
|
}
|
|
2680
2901
|
|
|
@@ -2718,7 +2939,7 @@ function SolanaConfirmStep({
|
|
|
2718
2939
|
const receiveAmount = isSameToken ? formattedReceiveAmount : `~ ${formattedReceiveAmount}`;
|
|
2719
2940
|
const handleConfirm = async () => {
|
|
2720
2941
|
if (!solanaProvider) {
|
|
2721
|
-
|
|
2942
|
+
_chunkTCILEYM5cjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
2722
2943
|
reason: "missing-provider"
|
|
2723
2944
|
});
|
|
2724
2945
|
setError("Solana wallet not connected");
|
|
@@ -2726,7 +2947,7 @@ function SolanaConfirmStep({
|
|
|
2726
2947
|
}
|
|
2727
2948
|
const parsedAmount = parseFloat(sourceAmount);
|
|
2728
2949
|
if (isNaN(parsedAmount) || parsedAmount <= 0) {
|
|
2729
|
-
|
|
2950
|
+
_chunkTCILEYM5cjs.debugLog.call(void 0, debug, "solana-confirm", "submit:blocked", {
|
|
2730
2951
|
reason: "invalid-amount",
|
|
2731
2952
|
sourceAmount
|
|
2732
2953
|
});
|
|
@@ -2735,7 +2956,7 @@ function SolanaConfirmStep({
|
|
|
2735
2956
|
}
|
|
2736
2957
|
setError(null);
|
|
2737
2958
|
setIsSubmitting(true);
|
|
2738
|
-
|
|
2959
|
+
_chunkTCILEYM5cjs.debugLog.call(void 0, debug, "solana-confirm", "submit:start", {
|
|
2739
2960
|
smartAccount,
|
|
2740
2961
|
solanaAddress,
|
|
2741
2962
|
solanaDepositAddress,
|
|
@@ -2745,7 +2966,7 @@ function SolanaConfirmStep({
|
|
|
2745
2966
|
});
|
|
2746
2967
|
try {
|
|
2747
2968
|
const check = await service.checkAccount(smartAccount);
|
|
2748
|
-
|
|
2969
|
+
_chunkTCILEYM5cjs.debugLog.call(void 0, debug, "solana-confirm", "check:success", {
|
|
2749
2970
|
smartAccount,
|
|
2750
2971
|
isRegistered: check.isRegistered,
|
|
2751
2972
|
targetChain: check.targetChain,
|
|
@@ -2758,7 +2979,7 @@ function SolanaConfirmStep({
|
|
|
2758
2979
|
}
|
|
2759
2980
|
const connection = getSolanaConnection();
|
|
2760
2981
|
const amountUnits = _viem.parseUnits.call(void 0, sourceAmount, token.decimals);
|
|
2761
|
-
|
|
2982
|
+
_chunkTCILEYM5cjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:start", {
|
|
2762
2983
|
token: token.symbol,
|
|
2763
2984
|
sourceAmount,
|
|
2764
2985
|
amountUnits: amountUnits.toString()
|
|
@@ -2775,10 +2996,10 @@ function SolanaConfirmStep({
|
|
|
2775
2996
|
token.mint,
|
|
2776
2997
|
amountUnits
|
|
2777
2998
|
);
|
|
2778
|
-
|
|
2999
|
+
_chunkTCILEYM5cjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
2779
3000
|
token: token.symbol,
|
|
2780
3001
|
instructionCount: transaction.instructions.length,
|
|
2781
|
-
feePayer: _optionalChain([transaction, 'access',
|
|
3002
|
+
feePayer: _optionalChain([transaction, 'access', _86 => _86.feePayer, 'optionalAccess', _87 => _87.toBase58, 'call', _88 => _88()]),
|
|
2782
3003
|
recentBlockhash: transaction.recentBlockhash
|
|
2783
3004
|
});
|
|
2784
3005
|
const txHash = await sendSolanaTransaction(
|
|
@@ -2786,21 +3007,21 @@ function SolanaConfirmStep({
|
|
|
2786
3007
|
connection,
|
|
2787
3008
|
transaction
|
|
2788
3009
|
);
|
|
2789
|
-
|
|
3010
|
+
_chunkTCILEYM5cjs.debugLog.call(void 0, debug, "solana-confirm", "tx:sent", {
|
|
2790
3011
|
txHash,
|
|
2791
3012
|
amountUnits: amountUnits.toString()
|
|
2792
3013
|
});
|
|
2793
3014
|
onConfirm(txHash, amountUnits.toString());
|
|
2794
3015
|
} catch (err) {
|
|
2795
3016
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
2796
|
-
const message =
|
|
2797
|
-
|
|
3017
|
+
const message = _chunkTCILEYM5cjs.formatUserError.call(void 0, raw);
|
|
3018
|
+
_chunkTCILEYM5cjs.debugError.call(void 0, debug, "solana-confirm", "submit:failure", err, {
|
|
2798
3019
|
smartAccount,
|
|
2799
3020
|
token: token.symbol,
|
|
2800
3021
|
sourceAmount
|
|
2801
3022
|
});
|
|
2802
3023
|
setError(message);
|
|
2803
|
-
_optionalChain([onError, 'optionalCall',
|
|
3024
|
+
_optionalChain([onError, 'optionalCall', _89 => _89(message, "SOLANA_TRANSFER_ERROR")]);
|
|
2804
3025
|
} finally {
|
|
2805
3026
|
setIsSubmitting(false);
|
|
2806
3027
|
}
|
|
@@ -2927,7 +3148,7 @@ function SolanaConfirmStep({
|
|
|
2927
3148
|
] })
|
|
2928
3149
|
] }),
|
|
2929
3150
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-step-footer", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2930
|
-
|
|
3151
|
+
_chunkTCILEYM5cjs.Button,
|
|
2931
3152
|
{
|
|
2932
3153
|
onClick: handleConfirm,
|
|
2933
3154
|
loading: isSubmitting,
|
|
@@ -2936,7 +3157,7 @@ function SolanaConfirmStep({
|
|
|
2936
3157
|
children: "Confirm Order"
|
|
2937
3158
|
}
|
|
2938
3159
|
) }),
|
|
2939
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3160
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkTCILEYM5cjs.PoweredBy, {})
|
|
2940
3161
|
] });
|
|
2941
3162
|
}
|
|
2942
3163
|
|
|
@@ -2988,16 +3209,16 @@ function DepositFlow({
|
|
|
2988
3209
|
onError,
|
|
2989
3210
|
debug
|
|
2990
3211
|
}) {
|
|
2991
|
-
const onStepChangeRef =
|
|
2992
|
-
const onTotalBalanceChangeRef =
|
|
2993
|
-
const onSmartAccountChangeRef =
|
|
2994
|
-
const onEventRef =
|
|
2995
|
-
const onDepositSubmittedRef =
|
|
2996
|
-
const onDepositCompleteRef =
|
|
2997
|
-
const onDepositFailedRef =
|
|
2998
|
-
const onErrorRef =
|
|
3212
|
+
const onStepChangeRef = _chunkTCILEYM5cjs.useLatestRef.call(void 0, onStepChange);
|
|
3213
|
+
const onTotalBalanceChangeRef = _chunkTCILEYM5cjs.useLatestRef.call(void 0, onTotalBalanceChange);
|
|
3214
|
+
const onSmartAccountChangeRef = _chunkTCILEYM5cjs.useLatestRef.call(void 0, onSmartAccountChange);
|
|
3215
|
+
const onEventRef = _chunkTCILEYM5cjs.useLatestRef.call(void 0, onEvent);
|
|
3216
|
+
const onDepositSubmittedRef = _chunkTCILEYM5cjs.useLatestRef.call(void 0, onDepositSubmitted);
|
|
3217
|
+
const onDepositCompleteRef = _chunkTCILEYM5cjs.useLatestRef.call(void 0, onDepositComplete);
|
|
3218
|
+
const onDepositFailedRef = _chunkTCILEYM5cjs.useLatestRef.call(void 0, onDepositFailed);
|
|
3219
|
+
const onErrorRef = _chunkTCILEYM5cjs.useLatestRef.call(void 0, onError);
|
|
2999
3220
|
const hasInitialReownSession = Boolean(
|
|
3000
|
-
enableSolana ? _optionalChain([reownWallet, 'optionalAccess',
|
|
3221
|
+
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _90 => _90.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _91 => _91.address]) : _optionalChain([reownWallet, 'optionalAccess', _92 => _92.address])
|
|
3001
3222
|
);
|
|
3002
3223
|
const hasInitialWalletHydrationPending = Boolean(
|
|
3003
3224
|
dappAddress && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasInitialReownSession && !reownWallet.isReady)
|
|
@@ -3015,13 +3236,13 @@ function DepositFlow({
|
|
|
3015
3236
|
flowModeRef.current = flowMode;
|
|
3016
3237
|
const logFlow = _react.useCallback.call(void 0,
|
|
3017
3238
|
(message, data) => {
|
|
3018
|
-
|
|
3239
|
+
_chunkTCILEYM5cjs.debugLog.call(void 0, debug, "deposit-flow", message, data);
|
|
3019
3240
|
},
|
|
3020
3241
|
[debug]
|
|
3021
3242
|
);
|
|
3022
3243
|
const logFlowError = _react.useCallback.call(void 0,
|
|
3023
3244
|
(message, error, data) => {
|
|
3024
|
-
|
|
3245
|
+
_chunkTCILEYM5cjs.debugError.call(void 0, debug, "deposit-flow", message, error, data);
|
|
3025
3246
|
},
|
|
3026
3247
|
[debug]
|
|
3027
3248
|
);
|
|
@@ -3044,12 +3265,12 @@ function DepositFlow({
|
|
|
3044
3265
|
return null;
|
|
3045
3266
|
}, []);
|
|
3046
3267
|
const dappSwitchChain = _react.useMemo.call(void 0, () => {
|
|
3047
|
-
if (!_optionalChain([dappWalletClient, 'optionalAccess',
|
|
3268
|
+
if (!_optionalChain([dappWalletClient, 'optionalAccess', _93 => _93.switchChain])) return void 0;
|
|
3048
3269
|
return async (chainId) => {
|
|
3049
|
-
await _optionalChain([dappWalletClient, 'access',
|
|
3270
|
+
await _optionalChain([dappWalletClient, 'access', _94 => _94.switchChain, 'optionalCall', _95 => _95({ id: chainId })]);
|
|
3050
3271
|
};
|
|
3051
3272
|
}, [dappWalletClient]);
|
|
3052
|
-
const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
3273
|
+
const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _96 => _96.account, 'optionalAccess', _97 => _97.address]), () => ( null));
|
|
3053
3274
|
const walletOptions = _react.useMemo.call(void 0, () => {
|
|
3054
3275
|
const options = [];
|
|
3055
3276
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -3063,7 +3284,7 @@ function DepositFlow({
|
|
|
3063
3284
|
});
|
|
3064
3285
|
seen.add(id);
|
|
3065
3286
|
}
|
|
3066
|
-
if (enableSolana && _optionalChain([reownWallet, 'optionalAccess',
|
|
3287
|
+
if (enableSolana && _optionalChain([reownWallet, 'optionalAccess', _98 => _98.isConnected]) && reownWallet.isSolana && reownWallet.solanaAddress && dappAddress) {
|
|
3067
3288
|
const id = _nullishCoalesce(reownWallet.caipAddress, () => ( `solana:${reownWallet.solanaAddress}`));
|
|
3068
3289
|
if (!seen.has(id)) {
|
|
3069
3290
|
options.push({
|
|
@@ -3075,7 +3296,7 @@ function DepositFlow({
|
|
|
3075
3296
|
});
|
|
3076
3297
|
seen.add(id);
|
|
3077
3298
|
}
|
|
3078
|
-
} else if (_optionalChain([reownWallet, 'optionalAccess',
|
|
3299
|
+
} else if (_optionalChain([reownWallet, 'optionalAccess', _99 => _99.address]) && reownWallet.isConnected && reownWallet.walletClient && reownWallet.publicClient && !seen.has(`evm:${reownWallet.address.toLowerCase()}`)) {
|
|
3079
3300
|
const id = `evm:${reownWallet.address.toLowerCase()}`;
|
|
3080
3301
|
if (!seen.has(id)) {
|
|
3081
3302
|
options.push({
|
|
@@ -3092,20 +3313,20 @@ function DepositFlow({
|
|
|
3092
3313
|
}, [
|
|
3093
3314
|
connectedWalletAddress,
|
|
3094
3315
|
dappAddress,
|
|
3095
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
3096
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
3097
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
3098
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
3099
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
3316
|
+
_optionalChain([reownWallet, 'optionalAccess', _100 => _100.address]),
|
|
3317
|
+
_optionalChain([reownWallet, 'optionalAccess', _101 => _101.isConnected]),
|
|
3318
|
+
_optionalChain([reownWallet, 'optionalAccess', _102 => _102.walletClient]),
|
|
3319
|
+
_optionalChain([reownWallet, 'optionalAccess', _103 => _103.publicClient]),
|
|
3320
|
+
_optionalChain([reownWallet, 'optionalAccess', _104 => _104.icon]),
|
|
3100
3321
|
enableSolana,
|
|
3101
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
3102
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
3103
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
3322
|
+
_optionalChain([reownWallet, 'optionalAccess', _105 => _105.isSolana]),
|
|
3323
|
+
_optionalChain([reownWallet, 'optionalAccess', _106 => _106.solanaAddress]),
|
|
3324
|
+
_optionalChain([reownWallet, 'optionalAccess', _107 => _107.caipAddress])
|
|
3104
3325
|
]);
|
|
3105
|
-
const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess',
|
|
3326
|
+
const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess', _108 => _108.account]) && dappAddress && !reownWallet;
|
|
3106
3327
|
const hasWalletOptions = walletOptions.length > 0;
|
|
3107
3328
|
const hasReownSession = Boolean(
|
|
3108
|
-
enableSolana ? _optionalChain([reownWallet, 'optionalAccess',
|
|
3329
|
+
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _109 => _109.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _110 => _110.address]) : _optionalChain([reownWallet, 'optionalAccess', _111 => _111.address])
|
|
3109
3330
|
);
|
|
3110
3331
|
const isWalletHydrationPending = Boolean(
|
|
3111
3332
|
dappAddress && !hasWalletOptions && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasReownSession && !reownWallet.isReady)
|
|
@@ -3145,16 +3366,16 @@ function DepositFlow({
|
|
|
3145
3366
|
return {
|
|
3146
3367
|
ownerAddress: dappAddress,
|
|
3147
3368
|
walletClient: void 0,
|
|
3148
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
3369
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkTCILEYM5cjs.getPublicClient.call(void 0, targetChain))),
|
|
3149
3370
|
switchChain: void 0
|
|
3150
3371
|
};
|
|
3151
3372
|
}
|
|
3152
3373
|
if (canAutoLock) {
|
|
3153
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
3374
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _112 => _112.chain, 'optionalAccess', _113 => _113.id]), () => ( targetChain));
|
|
3154
3375
|
return {
|
|
3155
3376
|
ownerAddress: dappWalletClient.account.address,
|
|
3156
3377
|
walletClient: dappWalletClient,
|
|
3157
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
3378
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkTCILEYM5cjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
3158
3379
|
switchChain: dappSwitchChain
|
|
3159
3380
|
};
|
|
3160
3381
|
}
|
|
@@ -3168,24 +3389,24 @@ function DepositFlow({
|
|
|
3168
3389
|
return {
|
|
3169
3390
|
ownerAddress: dappAddress,
|
|
3170
3391
|
walletClient: void 0,
|
|
3171
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
3392
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkTCILEYM5cjs.getPublicClient.call(void 0, targetChain))),
|
|
3172
3393
|
switchChain: void 0
|
|
3173
3394
|
};
|
|
3174
3395
|
}
|
|
3175
|
-
if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess',
|
|
3176
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
3396
|
+
if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess', _114 => _114.account]) && selectedOption.address && dappWalletClient.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
3397
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _115 => _115.chain, 'optionalAccess', _116 => _116.id]), () => ( targetChain));
|
|
3177
3398
|
return {
|
|
3178
3399
|
ownerAddress: dappWalletClient.account.address,
|
|
3179
3400
|
walletClient: dappWalletClient,
|
|
3180
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
3401
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkTCILEYM5cjs.getPublicClient.call(void 0, fallbackChainId))),
|
|
3181
3402
|
switchChain: dappSwitchChain
|
|
3182
3403
|
};
|
|
3183
3404
|
}
|
|
3184
|
-
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess',
|
|
3405
|
+
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess', _117 => _117.address]) && selectedOption.address && reownWallet.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
3185
3406
|
return {
|
|
3186
3407
|
ownerAddress: reownWallet.address,
|
|
3187
3408
|
walletClient: reownWallet.walletClient,
|
|
3188
|
-
publicClient: _nullishCoalesce(reownWallet.publicClient, () => (
|
|
3409
|
+
publicClient: _nullishCoalesce(reownWallet.publicClient, () => ( _chunkTCILEYM5cjs.getPublicClient.call(void 0, targetChain))),
|
|
3189
3410
|
switchChain: reownWallet.switchChain
|
|
3190
3411
|
};
|
|
3191
3412
|
}
|
|
@@ -3223,7 +3444,7 @@ function DepositFlow({
|
|
|
3223
3444
|
return {
|
|
3224
3445
|
ownerAddress: dappAddress,
|
|
3225
3446
|
walletClient: void 0,
|
|
3226
|
-
publicClient: _nullishCoalesce(dappPublicClient, () => (
|
|
3447
|
+
publicClient: _nullishCoalesce(dappPublicClient, () => ( _chunkTCILEYM5cjs.getPublicClient.call(void 0, targetChain))),
|
|
3227
3448
|
switchChain: void 0
|
|
3228
3449
|
};
|
|
3229
3450
|
}
|
|
@@ -3245,7 +3466,7 @@ function DepositFlow({
|
|
|
3245
3466
|
walletSignerContext,
|
|
3246
3467
|
walletSelectionKey
|
|
3247
3468
|
]);
|
|
3248
|
-
const sessionKeyAddress = _nullishCoalesce(_nullishCoalesce(dappAddress, () => ( _optionalChain([signerContext, 'optionalAccess',
|
|
3469
|
+
const sessionKeyAddress = _nullishCoalesce(_nullishCoalesce(dappAddress, () => ( _optionalChain([signerContext, 'optionalAccess', _118 => _118.ownerAddress]))), () => ( null));
|
|
3249
3470
|
const lastTargetRef = _react.useRef.call(void 0, null);
|
|
3250
3471
|
_react.useEffect.call(void 0, () => {
|
|
3251
3472
|
const prev = lastTargetRef.current;
|
|
@@ -3322,7 +3543,7 @@ function DepositFlow({
|
|
|
3322
3543
|
const stepIndex = step.type === "setup" ? 0 : step.type === "deposit-address" ? 1 : step.type === "select-asset" ? 1 : step.type === "solana-token-select" ? 1 : step.type === "solana-amount" ? 2 : step.type === "amount" ? 2 : step.type === "confirm" ? 3 : step.type === "solana-confirm" ? 3 : 4;
|
|
3323
3544
|
const currentBackHandler = step.type === "deposit-address" ? handleBackFromDepositAddress : step.type === "select-asset" && signerContext && !canAutoLock ? handleBackFromSelectAsset : step.type === "solana-token-select" ? handleBackFromSolanaTokenSelect : step.type === "solana-amount" ? handleBackFromSolanaAmount : step.type === "solana-confirm" ? handleBackFromSolanaConfirm : step.type === "amount" ? handleBackFromAmount : step.type === "confirm" ? handleBackFromConfirm : void 0;
|
|
3324
3545
|
_react.useEffect.call(void 0, () => {
|
|
3325
|
-
_optionalChain([onStepChangeRef, 'access',
|
|
3546
|
+
_optionalChain([onStepChangeRef, 'access', _119 => _119.current, 'optionalCall', _120 => _120(stepIndex, currentBackHandler)]);
|
|
3326
3547
|
}, [stepIndex, currentBackHandler, onStepChangeRef]);
|
|
3327
3548
|
const stepSendToken = step.type === "amount" ? step.asset.symbol : null;
|
|
3328
3549
|
const stepOpenEventKey = step.type === "select-asset" ? "select-asset" : step.type === "deposit-address" ? "deposit-address" : step.type === "amount" && stepSendToken ? `amount:${stepSendToken.toLowerCase()}` : null;
|
|
@@ -3337,7 +3558,7 @@ function DepositFlow({
|
|
|
3337
3558
|
}
|
|
3338
3559
|
lastStepOpenEventKeyRef.current = stepOpenEventKey;
|
|
3339
3560
|
if (step.type === "select-asset") {
|
|
3340
|
-
_optionalChain([onEventRef, 'access',
|
|
3561
|
+
_optionalChain([onEventRef, 'access', _121 => _121.current, 'optionalCall', _122 => _122({
|
|
3341
3562
|
type: "deposit_modal_connected_wallet_select_source_open",
|
|
3342
3563
|
total_balance_in_external_wallet: totalBalanceUsd,
|
|
3343
3564
|
pred_balance: totalBalanceUsd
|
|
@@ -3345,7 +3566,7 @@ function DepositFlow({
|
|
|
3345
3566
|
} else if (step.type === "deposit-address") {
|
|
3346
3567
|
const chainName = _chunkMUWVDVY4cjs.getChainName.call(void 0, targetChain);
|
|
3347
3568
|
const tokenSymbol = _chunkMUWVDVY4cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3348
|
-
_optionalChain([onEventRef, 'access',
|
|
3569
|
+
_optionalChain([onEventRef, 'access', _123 => _123.current, 'optionalCall', _124 => _124({
|
|
3349
3570
|
type: "deposit_modal_transfer_crypto_open",
|
|
3350
3571
|
default_chain: chainName,
|
|
3351
3572
|
default_token: tokenSymbol,
|
|
@@ -3353,7 +3574,7 @@ function DepositFlow({
|
|
|
3353
3574
|
})]);
|
|
3354
3575
|
} else if (step.type === "amount" && stepSendToken) {
|
|
3355
3576
|
const receiveSymbol = _chunkMUWVDVY4cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3356
|
-
_optionalChain([onEventRef, 'access',
|
|
3577
|
+
_optionalChain([onEventRef, 'access', _125 => _125.current, 'optionalCall', _126 => _126({
|
|
3357
3578
|
type: "deposit_modal_connected_wallet_enter_value_open",
|
|
3358
3579
|
send_token: stepSendToken,
|
|
3359
3580
|
receive_token: receiveSymbol,
|
|
@@ -3386,7 +3607,7 @@ function DepositFlow({
|
|
|
3386
3607
|
targetToken
|
|
3387
3608
|
]);
|
|
3388
3609
|
_react.useEffect.call(void 0, () => {
|
|
3389
|
-
_optionalChain([onTotalBalanceChangeRef, 'access',
|
|
3610
|
+
_optionalChain([onTotalBalanceChangeRef, 'access', _127 => _127.current, 'optionalCall', _128 => _128(totalBalanceUsd)]);
|
|
3390
3611
|
}, [totalBalanceUsd, onTotalBalanceChangeRef]);
|
|
3391
3612
|
const isDepositAddressMode = flowMode === "deposit-address";
|
|
3392
3613
|
const isSolanaWalletMode = flowMode === "solana-wallet";
|
|
@@ -3401,7 +3622,7 @@ function DepositFlow({
|
|
|
3401
3622
|
setStep({ type: "setup" });
|
|
3402
3623
|
}, []);
|
|
3403
3624
|
const handleNewDeposit = _react.useCallback.call(void 0, () => {
|
|
3404
|
-
_optionalChain([onSmartAccountChangeRef, 'access',
|
|
3625
|
+
_optionalChain([onSmartAccountChangeRef, 'access', _129 => _129.current, 'optionalCall', _130 => _130(null)]);
|
|
3405
3626
|
setFlowMode(null);
|
|
3406
3627
|
setStep({ type: "setup" });
|
|
3407
3628
|
setIsConnectSelectionConfirmed(false);
|
|
@@ -3415,7 +3636,7 @@ function DepositFlow({
|
|
|
3415
3636
|
hasSolanaDepositAddress: Boolean(solanaDepositAddress),
|
|
3416
3637
|
flowMode: isDepositAddressMode ? "deposit-address" : isSolanaWalletMode ? "solana-wallet" : "wallet"
|
|
3417
3638
|
});
|
|
3418
|
-
_optionalChain([onSmartAccountChangeRef, 'access',
|
|
3639
|
+
_optionalChain([onSmartAccountChangeRef, 'access', _131 => _131.current, 'optionalCall', _132 => _132(smartAccount)]);
|
|
3419
3640
|
if (isDepositAddressMode) {
|
|
3420
3641
|
setStep({
|
|
3421
3642
|
type: "deposit-address",
|
|
@@ -3430,7 +3651,7 @@ function DepositFlow({
|
|
|
3430
3651
|
solanaDepositAddress
|
|
3431
3652
|
});
|
|
3432
3653
|
} else {
|
|
3433
|
-
_optionalChain([onError, 'optionalCall',
|
|
3654
|
+
_optionalChain([onError, 'optionalCall', _133 => _133({
|
|
3434
3655
|
message: "Solana deposit address not available. Please try again.",
|
|
3435
3656
|
code: "SOLANA_SETUP_FAILED"
|
|
3436
3657
|
})]);
|
|
@@ -3448,7 +3669,7 @@ function DepositFlow({
|
|
|
3448
3669
|
sourceChain: data.sourceChain,
|
|
3449
3670
|
amount: data.amount
|
|
3450
3671
|
});
|
|
3451
|
-
_optionalChain([onDepositSubmittedRef, 'access',
|
|
3672
|
+
_optionalChain([onDepositSubmittedRef, 'access', _134 => _134.current, 'optionalCall', _135 => _135(data)]);
|
|
3452
3673
|
},
|
|
3453
3674
|
[logFlow, onDepositSubmittedRef]
|
|
3454
3675
|
);
|
|
@@ -3520,7 +3741,7 @@ function DepositFlow({
|
|
|
3520
3741
|
sourceDecimals: prev.token.decimals
|
|
3521
3742
|
};
|
|
3522
3743
|
});
|
|
3523
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
3744
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _136 => _136({
|
|
3524
3745
|
txHash,
|
|
3525
3746
|
sourceChain: "solana",
|
|
3526
3747
|
amount: amountUnits
|
|
@@ -3530,13 +3751,13 @@ function DepositFlow({
|
|
|
3530
3751
|
);
|
|
3531
3752
|
const handleConnected = _react.useCallback.call(void 0,
|
|
3532
3753
|
(addr, smartAccount) => {
|
|
3533
|
-
_optionalChain([onConnected, 'optionalCall',
|
|
3754
|
+
_optionalChain([onConnected, 'optionalCall', _137 => _137({ address: addr, smartAccount })]);
|
|
3534
3755
|
},
|
|
3535
3756
|
[onConnected]
|
|
3536
3757
|
);
|
|
3537
3758
|
const handleAssetContinue = _react.useCallback.call(void 0,
|
|
3538
3759
|
(asset) => {
|
|
3539
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
3760
|
+
_optionalChain([onEvent, 'optionalCall', _138 => _138({
|
|
3540
3761
|
type: "deposit_modal_connected_wallet_select_source_cta_click",
|
|
3541
3762
|
total_balance_in_external_wallet: totalBalanceUsd,
|
|
3542
3763
|
pred_balance: totalBalanceUsd,
|
|
@@ -3601,28 +3822,28 @@ function DepositFlow({
|
|
|
3601
3822
|
);
|
|
3602
3823
|
const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
|
|
3603
3824
|
(txHash, sourceChain, amount) => {
|
|
3604
|
-
_optionalChain([onDepositSubmittedRef, 'access',
|
|
3825
|
+
_optionalChain([onDepositSubmittedRef, 'access', _139 => _139.current, 'optionalCall', _140 => _140({ txHash, sourceChain, amount })]);
|
|
3605
3826
|
},
|
|
3606
3827
|
[onDepositSubmittedRef]
|
|
3607
3828
|
);
|
|
3608
3829
|
const handleDepositComplete = _react.useCallback.call(void 0,
|
|
3609
3830
|
(txHash, destinationTxHash, context) => {
|
|
3610
3831
|
logFlow("deposit:complete", { txHash, destinationTxHash, ...context });
|
|
3611
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
3832
|
+
_optionalChain([onDepositCompleteRef, 'access', _141 => _141.current, 'optionalCall', _142 => _142({ txHash, destinationTxHash, ...context })]);
|
|
3612
3833
|
},
|
|
3613
3834
|
[logFlow, onDepositCompleteRef]
|
|
3614
3835
|
);
|
|
3615
3836
|
const handleDepositFailed = _react.useCallback.call(void 0,
|
|
3616
3837
|
(txHash, error) => {
|
|
3617
3838
|
logFlowError("deposit:failed", error, { txHash });
|
|
3618
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
3839
|
+
_optionalChain([onDepositFailedRef, 'access', _143 => _143.current, 'optionalCall', _144 => _144({ txHash, error })]);
|
|
3619
3840
|
},
|
|
3620
3841
|
[logFlowError, onDepositFailedRef]
|
|
3621
3842
|
);
|
|
3622
3843
|
const handleError = _react.useCallback.call(void 0,
|
|
3623
3844
|
(message, code) => {
|
|
3624
3845
|
logFlowError("flow:error", message, { code });
|
|
3625
|
-
_optionalChain([onErrorRef, 'access',
|
|
3846
|
+
_optionalChain([onErrorRef, 'access', _145 => _145.current, 'optionalCall', _146 => _146({ message, code })]);
|
|
3626
3847
|
},
|
|
3627
3848
|
[logFlowError, onErrorRef]
|
|
3628
3849
|
);
|
|
@@ -3679,7 +3900,7 @@ function DepositFlow({
|
|
|
3679
3900
|
if (walletId) {
|
|
3680
3901
|
const selectedOption = walletOptions.find((o) => o.id === walletId);
|
|
3681
3902
|
setSelectedWalletId(walletId);
|
|
3682
|
-
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess',
|
|
3903
|
+
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess', _147 => _147.kind]) === "solana") {
|
|
3683
3904
|
handleSelectSolanaWallet();
|
|
3684
3905
|
} else {
|
|
3685
3906
|
handleSelectProvider();
|
|
@@ -3709,7 +3930,7 @@ function DepositFlow({
|
|
|
3709
3930
|
]);
|
|
3710
3931
|
if (showConnectStep) {
|
|
3711
3932
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-body", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3712
|
-
|
|
3933
|
+
_chunkTCILEYM5cjs.ConnectStep,
|
|
3713
3934
|
{
|
|
3714
3935
|
walletOptions,
|
|
3715
3936
|
selectedWalletId: selectedWalletIdEffective,
|
|
@@ -3728,7 +3949,7 @@ function DepositFlow({
|
|
|
3728
3949
|
const selectedOption = walletOptions.find(
|
|
3729
3950
|
(o) => o.id === selectedWalletIdEffective
|
|
3730
3951
|
);
|
|
3731
|
-
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess',
|
|
3952
|
+
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess', _148 => _148.kind]) === "solana") {
|
|
3732
3953
|
handleSelectSolanaWallet();
|
|
3733
3954
|
} else {
|
|
3734
3955
|
handleSelectProvider();
|
|
@@ -3772,14 +3993,15 @@ function DepositFlow({
|
|
|
3772
3993
|
targetChain,
|
|
3773
3994
|
targetToken,
|
|
3774
3995
|
waitForFinalTx,
|
|
3775
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
3996
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _149 => _149.length])),
|
|
3997
|
+
uiConfig,
|
|
3776
3998
|
onDepositSubmitted: handleDepositAddressSubmitted,
|
|
3777
3999
|
onDepositComplete: handleDepositComplete,
|
|
3778
4000
|
onDepositFailed: handleDepositFailed,
|
|
3779
4001
|
onCopyAddress: () => {
|
|
3780
4002
|
const chainName = _chunkMUWVDVY4cjs.getChainName.call(void 0, targetChain);
|
|
3781
4003
|
const tokenSymbol = _chunkMUWVDVY4cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3782
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
4004
|
+
_optionalChain([onEvent, 'optionalCall', _150 => _150({
|
|
3783
4005
|
type: "deposit_modal_transfer_crypto_cta_click",
|
|
3784
4006
|
default_chain: chainName,
|
|
3785
4007
|
default_token: tokenSymbol,
|
|
@@ -3795,8 +4017,8 @@ function DepositFlow({
|
|
|
3795
4017
|
}
|
|
3796
4018
|
if (isSolanaWalletMode) {
|
|
3797
4019
|
if (!sessionKeyAddress) return null;
|
|
3798
|
-
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess',
|
|
3799
|
-
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess',
|
|
4020
|
+
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess', _151 => _151.solanaAddress]);
|
|
4021
|
+
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess', _152 => _152.solanaProvider]);
|
|
3800
4022
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
3801
4023
|
step.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3802
4024
|
SetupStep,
|
|
@@ -3894,7 +4116,7 @@ function DepositFlow({
|
|
|
3894
4116
|
) })
|
|
3895
4117
|
] }) : null,
|
|
3896
4118
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3897
|
-
|
|
4119
|
+
_chunkTCILEYM5cjs.ProcessingStep,
|
|
3898
4120
|
{
|
|
3899
4121
|
smartAccount: step.smartAccount,
|
|
3900
4122
|
txHash: step.txHash,
|
|
@@ -3906,7 +4128,7 @@ function DepositFlow({
|
|
|
3906
4128
|
sourceSymbol: step.sourceSymbol,
|
|
3907
4129
|
sourceDecimals: step.sourceDecimals,
|
|
3908
4130
|
waitForFinalTx,
|
|
3909
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
4131
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _153 => _153.length])),
|
|
3910
4132
|
service,
|
|
3911
4133
|
directTransfer: step.directTransfer,
|
|
3912
4134
|
onClose,
|
|
@@ -3919,16 +4141,16 @@ function DepositFlow({
|
|
|
3919
4141
|
)
|
|
3920
4142
|
] });
|
|
3921
4143
|
}
|
|
3922
|
-
if (!_optionalChain([signerContext, 'optionalAccess',
|
|
4144
|
+
if (!_optionalChain([signerContext, 'optionalAccess', _154 => _154.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _155 => _155.publicClient])) {
|
|
3923
4145
|
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..." }) }) }) }) });
|
|
3924
4146
|
}
|
|
3925
4147
|
const ownerAddress = signerContext.ownerAddress;
|
|
3926
|
-
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access',
|
|
4148
|
+
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _156 => _156.walletClient, 'optionalAccess', _157 => _157.chain, 'optionalAccess', _158 => _158.id]), () => ( _optionalChain([signerContext, 'access', _159 => _159.publicClient, 'access', _160 => _160.chain, 'optionalAccess', _161 => _161.id]))), () => ( targetChain));
|
|
3927
4149
|
const getReadClientForChain = (chainId) => {
|
|
3928
|
-
if (_optionalChain([signerContext, 'access',
|
|
4150
|
+
if (_optionalChain([signerContext, 'access', _162 => _162.publicClient, 'access', _163 => _163.chain, 'optionalAccess', _164 => _164.id]) === chainId) {
|
|
3929
4151
|
return signerContext.publicClient;
|
|
3930
4152
|
}
|
|
3931
|
-
return
|
|
4153
|
+
return _chunkTCILEYM5cjs.getPublicClient.call(void 0, chainId);
|
|
3932
4154
|
};
|
|
3933
4155
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
3934
4156
|
step.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3985,7 +4207,7 @@ function DepositFlow({
|
|
|
3985
4207
|
onContinue: handleAmountContinue,
|
|
3986
4208
|
onCtaClick: (ctaName) => {
|
|
3987
4209
|
const receiveSymbol = _chunkMUWVDVY4cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3988
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
4210
|
+
_optionalChain([onEvent, 'optionalCall', _165 => _165({
|
|
3989
4211
|
type: "deposit_modal_connected_wallet_enter_value_cta_click",
|
|
3990
4212
|
send_token: step.asset.symbol,
|
|
3991
4213
|
receive_token: receiveSymbol,
|
|
@@ -4016,7 +4238,7 @@ function DepositFlow({
|
|
|
4016
4238
|
}
|
|
4017
4239
|
),
|
|
4018
4240
|
step.type === "processing" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4019
|
-
|
|
4241
|
+
_chunkTCILEYM5cjs.ProcessingStep,
|
|
4020
4242
|
{
|
|
4021
4243
|
smartAccount: step.smartAccount,
|
|
4022
4244
|
txHash: step.txHash,
|
|
@@ -4028,7 +4250,7 @@ function DepositFlow({
|
|
|
4028
4250
|
sourceSymbol: step.sourceSymbol,
|
|
4029
4251
|
sourceDecimals: step.sourceDecimals,
|
|
4030
4252
|
waitForFinalTx,
|
|
4031
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
4253
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _166 => _166.length])),
|
|
4032
4254
|
service,
|
|
4033
4255
|
directTransfer: step.directTransfer,
|
|
4034
4256
|
onClose,
|
|
@@ -4073,8 +4295,8 @@ function formatTimestamp2(iso) {
|
|
|
4073
4295
|
function resolveChainId(value) {
|
|
4074
4296
|
if (value === void 0 || value === null) return null;
|
|
4075
4297
|
if (typeof value === "number") return value;
|
|
4076
|
-
if (
|
|
4077
|
-
const parsed =
|
|
4298
|
+
if (_chunkTCILEYM5cjs.isSolanaCaip2.call(void 0, value) || value === "solana") return "solana";
|
|
4299
|
+
const parsed = _chunkTCILEYM5cjs.parseEvmChainId.call(void 0, value);
|
|
4078
4300
|
if (parsed !== null) return parsed;
|
|
4079
4301
|
const num = Number(value);
|
|
4080
4302
|
return Number.isFinite(num) ? num : null;
|
|
@@ -4308,7 +4530,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
|
4308
4530
|
// src/DepositModal.tsx
|
|
4309
4531
|
|
|
4310
4532
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
4311
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
4533
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-3GU5B776.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
4312
4534
|
);
|
|
4313
4535
|
function DepositModal(props) {
|
|
4314
4536
|
const needsReown = !!props.reownAppId;
|
|
@@ -4379,11 +4601,11 @@ function DepositModalInner({
|
|
|
4379
4601
|
debug
|
|
4380
4602
|
}) {
|
|
4381
4603
|
const modalRef = _react.useRef.call(void 0, null);
|
|
4382
|
-
const onReadyRef =
|
|
4604
|
+
const onReadyRef = _chunkTCILEYM5cjs.useLatestRef.call(void 0, onReady);
|
|
4383
4605
|
const [currentStepIndex, setCurrentStepIndex] = _react.useState.call(void 0, 0);
|
|
4384
4606
|
const [totalBalanceUsd, setTotalBalanceUsd] = _react.useState.call(void 0, null);
|
|
4385
4607
|
const backHandlerRef = _react.useRef.call(void 0, void 0);
|
|
4386
|
-
const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
4608
|
+
const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _167 => _167.showHistoryButton]), () => ( false));
|
|
4387
4609
|
const [activeSmartAccount, setActiveSmartAccount] = _react.useState.call(void 0, null);
|
|
4388
4610
|
const [historyOpen, setHistoryOpen] = _react.useState.call(void 0, false);
|
|
4389
4611
|
const [historyDeposits, setHistoryDeposits] = _react.useState.call(void 0, []);
|
|
@@ -4396,7 +4618,7 @@ function DepositModalInner({
|
|
|
4396
4618
|
const targetChain = _chunkMUWVDVY4cjs.getChainId.call(void 0, targetChainProp);
|
|
4397
4619
|
const sourceChain = sourceChainProp ? _chunkMUWVDVY4cjs.getChainId.call(void 0, sourceChainProp) : void 0;
|
|
4398
4620
|
const service = _react.useMemo.call(void 0,
|
|
4399
|
-
() =>
|
|
4621
|
+
() => _chunkTCILEYM5cjs.createDepositService.call(void 0, backendUrl, {
|
|
4400
4622
|
debug,
|
|
4401
4623
|
debugScope: "service:deposit"
|
|
4402
4624
|
}),
|
|
@@ -4404,7 +4626,7 @@ function DepositModalInner({
|
|
|
4404
4626
|
);
|
|
4405
4627
|
_react.useEffect.call(void 0, () => {
|
|
4406
4628
|
if (isOpen && modalRef.current) {
|
|
4407
|
-
|
|
4629
|
+
_chunkTCILEYM5cjs.applyTheme.call(void 0, modalRef.current, theme);
|
|
4408
4630
|
}
|
|
4409
4631
|
}, [isOpen, theme]);
|
|
4410
4632
|
_react.useEffect.call(void 0, () => {
|
|
@@ -4412,7 +4634,7 @@ function DepositModalInner({
|
|
|
4412
4634
|
}, [solanaRpcUrl]);
|
|
4413
4635
|
_react.useEffect.call(void 0, () => {
|
|
4414
4636
|
if (isOpen) {
|
|
4415
|
-
_optionalChain([onReadyRef, 'access',
|
|
4637
|
+
_optionalChain([onReadyRef, 'access', _168 => _168.current, 'optionalCall', _169 => _169()]);
|
|
4416
4638
|
}
|
|
4417
4639
|
}, [isOpen, onReadyRef]);
|
|
4418
4640
|
_react.useEffect.call(void 0, () => {
|
|
@@ -4431,7 +4653,7 @@ function DepositModalInner({
|
|
|
4431
4653
|
setTotalBalanceUsd(balance2);
|
|
4432
4654
|
}, []);
|
|
4433
4655
|
const handleBack = _react.useCallback.call(void 0, () => {
|
|
4434
|
-
_optionalChain([backHandlerRef, 'access',
|
|
4656
|
+
_optionalChain([backHandlerRef, 'access', _170 => _170.current, 'optionalCall', _171 => _171()]);
|
|
4435
4657
|
}, []);
|
|
4436
4658
|
const handleSmartAccountChange = _react.useCallback.call(void 0,
|
|
4437
4659
|
(account) => {
|
|
@@ -4500,26 +4722,26 @@ function DepositModalInner({
|
|
|
4500
4722
|
fetchHistory();
|
|
4501
4723
|
}
|
|
4502
4724
|
}, [historyOpen, fetchHistory]);
|
|
4503
|
-
const onDepositSubmittedRef =
|
|
4504
|
-
const onDepositCompleteRef =
|
|
4505
|
-
const onDepositFailedRef =
|
|
4725
|
+
const onDepositSubmittedRef = _chunkTCILEYM5cjs.useLatestRef.call(void 0, onDepositSubmitted);
|
|
4726
|
+
const onDepositCompleteRef = _chunkTCILEYM5cjs.useLatestRef.call(void 0, onDepositComplete);
|
|
4727
|
+
const onDepositFailedRef = _chunkTCILEYM5cjs.useLatestRef.call(void 0, onDepositFailed);
|
|
4506
4728
|
const handleDepositSubmitted = _react.useCallback.call(void 0,
|
|
4507
4729
|
(data) => {
|
|
4508
|
-
_optionalChain([onDepositSubmittedRef, 'access',
|
|
4730
|
+
_optionalChain([onDepositSubmittedRef, 'access', _172 => _172.current, 'optionalCall', _173 => _173(data)]);
|
|
4509
4731
|
if (showHistoryButton) markHistoryStale();
|
|
4510
4732
|
},
|
|
4511
4733
|
[onDepositSubmittedRef, showHistoryButton, markHistoryStale]
|
|
4512
4734
|
);
|
|
4513
4735
|
const handleDepositComplete = _react.useCallback.call(void 0,
|
|
4514
4736
|
(data) => {
|
|
4515
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
4737
|
+
_optionalChain([onDepositCompleteRef, 'access', _174 => _174.current, 'optionalCall', _175 => _175(data)]);
|
|
4516
4738
|
if (showHistoryButton) markHistoryStale();
|
|
4517
4739
|
},
|
|
4518
4740
|
[onDepositCompleteRef, showHistoryButton, markHistoryStale]
|
|
4519
4741
|
);
|
|
4520
4742
|
const handleDepositFailed = _react.useCallback.call(void 0,
|
|
4521
4743
|
(data) => {
|
|
4522
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
4744
|
+
_optionalChain([onDepositFailedRef, 'access', _176 => _176.current, 'optionalCall', _177 => _177(data)]);
|
|
4523
4745
|
if (showHistoryButton) markHistoryStale();
|
|
4524
4746
|
},
|
|
4525
4747
|
[onDepositFailedRef, showHistoryButton, markHistoryStale]
|
|
@@ -4535,15 +4757,15 @@ function DepositModalInner({
|
|
|
4535
4757
|
historyLoadedRef.current = false;
|
|
4536
4758
|
}
|
|
4537
4759
|
}, [isOpen]);
|
|
4538
|
-
const showLogo = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
4539
|
-
const showStepper = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
4540
|
-
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
4541
|
-
const balance = _optionalChain([uiConfig, 'optionalAccess',
|
|
4542
|
-
const logoUrl = _nullishCoalesce(_optionalChain([branding, 'optionalAccess',
|
|
4543
|
-
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess',
|
|
4760
|
+
const showLogo = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _178 => _178.showLogo]), () => ( false));
|
|
4761
|
+
const showStepper = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _179 => _179.showStepper]), () => ( false));
|
|
4762
|
+
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _180 => _180.showBackButton]), () => ( true));
|
|
4763
|
+
const balance = _optionalChain([uiConfig, 'optionalAccess', _181 => _181.balance]);
|
|
4764
|
+
const logoUrl = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _182 => _182.logoUrl]), () => ( "https://github.com/rhinestonewtf.png"));
|
|
4765
|
+
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _183 => _183.title]), () => ( "Deposit"));
|
|
4544
4766
|
const canGoBack = currentStepIndex > 0 && currentStepIndex < 4 && backHandlerRef.current !== void 0;
|
|
4545
4767
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4546
|
-
|
|
4768
|
+
_chunkTCILEYM5cjs.Modal,
|
|
4547
4769
|
{
|
|
4548
4770
|
isOpen,
|
|
4549
4771
|
onClose,
|
|
@@ -4636,7 +4858,7 @@ function DepositModalInner({
|
|
|
4636
4858
|
balance.title,
|
|
4637
4859
|
":"
|
|
4638
4860
|
] }),
|
|
4639
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ?
|
|
4861
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-modal-header-balance-value", children: _nullishCoalesce(balance.amount, () => ( (totalBalanceUsd !== null ? _chunkTCILEYM5cjs.currencyFormatter.format(totalBalanceUsd) : null))) })
|
|
4640
4862
|
] })
|
|
4641
4863
|
] }),
|
|
4642
4864
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
|