@rhinestone/deposit-modal 0.1.58 → 0.1.60
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-C3WPJW3E.mjs → DepositModalReown-S24YS35X.mjs} +1 -1
- package/dist/{DepositModalReown-KONUZXHJ.cjs → DepositModalReown-VP5E2JRC.cjs} +2 -2
- package/dist/{WithdrawModalReown-TUBSUJQ6.cjs → WithdrawModalReown-7JLR264N.cjs} +2 -2
- package/dist/{WithdrawModalReown-PFGUPZFN.mjs → WithdrawModalReown-Y2ETJQON.mjs} +1 -1
- package/dist/{chunk-3FEFGN7H.cjs → chunk-3CANBYBN.cjs} +56 -29
- package/dist/{chunk-VOGD6Y4U.mjs → chunk-6SM3IQKZ.mjs} +79 -6
- package/dist/{chunk-Z2TKNB6C.cjs → chunk-HX7LLE2V.cjs} +165 -92
- package/dist/{chunk-3ESBSOB7.mjs → chunk-JJMPCRKB.mjs} +29 -2
- package/dist/deposit.cjs +2 -2
- package/dist/deposit.d.cts +2 -2
- package/dist/deposit.d.ts +2 -2
- package/dist/deposit.mjs +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +2 -2
- package/dist/reown.cjs +3 -3
- package/dist/reown.d.cts +1 -1
- package/dist/reown.d.ts +1 -1
- package/dist/reown.mjs +2 -2
- package/dist/styles.css +4 -4
- package/dist/{types-CL7ec666.d.cts → types-7IoN8k-P.d.cts} +58 -1
- package/dist/{types-B7UuWCtD.d.ts → types-BLIqLF0c.d.ts} +58 -1
- package/dist/withdraw.cjs +2 -2
- package/dist/withdraw.d.cts +2 -2
- package/dist/withdraw.d.ts +2 -2
- package/dist/withdraw.mjs +1 -1
- package/package.json +1 -1
|
@@ -83,6 +83,7 @@ function SetupStep({
|
|
|
83
83
|
signerAddress,
|
|
84
84
|
sessionChainIds,
|
|
85
85
|
recipient,
|
|
86
|
+
postBridgeActions,
|
|
86
87
|
forceRegister,
|
|
87
88
|
enableSolana = true,
|
|
88
89
|
service,
|
|
@@ -149,11 +150,12 @@ function SetupStep({
|
|
|
149
150
|
target: {
|
|
150
151
|
chain: _chunkTQ6IIGRScjs.toEvmCaip2.call(void 0, targetChain),
|
|
151
152
|
token: targetToken,
|
|
152
|
-
...recipient && { recipient }
|
|
153
|
+
...recipient && { recipient },
|
|
154
|
+
..._optionalChain([postBridgeActions, 'optionalAccess', _2 => _2.length]) && { postBridgeActions }
|
|
153
155
|
}
|
|
154
156
|
});
|
|
155
157
|
setState({ type: "ready", smartAccount });
|
|
156
|
-
_optionalChain([onConnected, 'optionalCall',
|
|
158
|
+
_optionalChain([onConnected, 'optionalCall', _3 => _3(address, smartAccount)]);
|
|
157
159
|
onSetupComplete(
|
|
158
160
|
smartAccount,
|
|
159
161
|
enableSolana ? registerResult.solanaDepositAddress : void 0
|
|
@@ -161,7 +163,7 @@ function SetupStep({
|
|
|
161
163
|
} catch (error) {
|
|
162
164
|
const message = error instanceof Error ? error.message : "Setup failed";
|
|
163
165
|
setState({ type: "error", message });
|
|
164
|
-
_optionalChain([onError, 'optionalCall',
|
|
166
|
+
_optionalChain([onError, 'optionalCall', _4 => _4(message, "SETUP_ERROR")]);
|
|
165
167
|
}
|
|
166
168
|
}, [
|
|
167
169
|
address,
|
|
@@ -171,6 +173,7 @@ function SetupStep({
|
|
|
171
173
|
signerAddress,
|
|
172
174
|
sessionChainIds,
|
|
173
175
|
recipient,
|
|
176
|
+
postBridgeActions,
|
|
174
177
|
forceRegister,
|
|
175
178
|
enableSolana,
|
|
176
179
|
service,
|
|
@@ -330,16 +333,16 @@ function AssetSelectStep({
|
|
|
330
333
|
(sum, asset) => sum + (_nullishCoalesce(asset.balanceUsd, () => ( 0))),
|
|
331
334
|
0
|
|
332
335
|
);
|
|
333
|
-
_optionalChain([onTotalBalanceComputed, 'optionalCall',
|
|
334
|
-
if (assets.length > 0) _optionalChain([onAssetsLoaded, 'optionalCall',
|
|
336
|
+
_optionalChain([onTotalBalanceComputed, 'optionalCall', _5 => _5(total)]);
|
|
337
|
+
if (assets.length > 0) _optionalChain([onAssetsLoaded, 'optionalCall', _6 => _6(assets)]);
|
|
335
338
|
}, [assets, onTotalBalanceComputed, onAssetsLoaded]);
|
|
336
339
|
const allowedChainSet = _react.useMemo.call(void 0,
|
|
337
|
-
() => _optionalChain([allowedRoutes, 'optionalAccess',
|
|
338
|
-
[_optionalChain([allowedRoutes, 'optionalAccess',
|
|
340
|
+
() => _optionalChain([allowedRoutes, 'optionalAccess', _7 => _7.sourceChains]) ? new Set(allowedRoutes.sourceChains) : null,
|
|
341
|
+
[_optionalChain([allowedRoutes, 'optionalAccess', _8 => _8.sourceChains])]
|
|
339
342
|
);
|
|
340
343
|
const allowedTokenSet = _react.useMemo.call(void 0,
|
|
341
|
-
() => _optionalChain([allowedRoutes, 'optionalAccess',
|
|
342
|
-
[_optionalChain([allowedRoutes, 'optionalAccess',
|
|
344
|
+
() => _optionalChain([allowedRoutes, 'optionalAccess', _9 => _9.sourceTokens]) ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null,
|
|
345
|
+
[_optionalChain([allowedRoutes, 'optionalAccess', _10 => _10.sourceTokens])]
|
|
343
346
|
);
|
|
344
347
|
const rows = _react.useMemo.call(void 0, () => {
|
|
345
348
|
return assets.filter((a) => {
|
|
@@ -497,7 +500,7 @@ function AssetSelectStep({
|
|
|
497
500
|
}
|
|
498
501
|
async function fetchNativeAssets(address, publicClient, existing) {
|
|
499
502
|
const existingIds = new Set(existing.map((asset) => asset.id));
|
|
500
|
-
const connectedChainId = _optionalChain([publicClient, 'access',
|
|
503
|
+
const connectedChainId = _optionalChain([publicClient, 'access', _11 => _11.chain, 'optionalAccess', _12 => _12.id]);
|
|
501
504
|
if (!connectedChainId) return [];
|
|
502
505
|
if (!_chunkR6U6BHCVcjs.SOURCE_CHAINS.some((chain) => chain.id === connectedChainId)) return [];
|
|
503
506
|
const id = _chunkTQ6IIGRScjs.getAssetId.call(void 0, {
|
|
@@ -551,7 +554,8 @@ function AmountStep({
|
|
|
551
554
|
uiConfig,
|
|
552
555
|
tokenPriceUsdOverride,
|
|
553
556
|
onBalanceUsdChange,
|
|
554
|
-
onContinue
|
|
557
|
+
onContinue,
|
|
558
|
+
onCtaClick
|
|
555
559
|
}) {
|
|
556
560
|
const [amount, setAmount] = _react.useState.call(void 0, "");
|
|
557
561
|
const [balance, setBalance] = _react.useState.call(void 0, null);
|
|
@@ -559,7 +563,7 @@ function AmountStep({
|
|
|
559
563
|
const [isSwitching, setIsSwitching] = _react.useState.call(void 0, false);
|
|
560
564
|
const hasAttemptedSwitch = _react.useRef.call(void 0, false);
|
|
561
565
|
const chainMismatch = Boolean(
|
|
562
|
-
_optionalChain([walletClient, 'optionalAccess',
|
|
566
|
+
_optionalChain([walletClient, 'optionalAccess', _13 => _13.chain, 'optionalAccess', _14 => _14.id]) && walletClient.chain.id !== asset.chainId
|
|
563
567
|
);
|
|
564
568
|
const targetSymbol = _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
565
569
|
const isSourceStablecoin = _chunkR6U6BHCVcjs.isStablecoinSymbol.call(void 0, asset.symbol);
|
|
@@ -640,7 +644,7 @@ function AmountStep({
|
|
|
640
644
|
}
|
|
641
645
|
}, [balance, tokenPriceUsd, asset.decimals]);
|
|
642
646
|
_react.useEffect.call(void 0, () => {
|
|
643
|
-
_optionalChain([onBalanceUsdChange, 'optionalCall',
|
|
647
|
+
_optionalChain([onBalanceUsdChange, 'optionalCall', _15 => _15(_nullishCoalesce(balanceUsd, () => ( 0)))]);
|
|
644
648
|
}, [balanceUsd, onBalanceUsdChange]);
|
|
645
649
|
const formattedBalance = _react.useMemo.call(void 0, () => {
|
|
646
650
|
if (balance === null) return "...";
|
|
@@ -655,6 +659,8 @@ function AmountStep({
|
|
|
655
659
|
}, [balance, asset.decimals]);
|
|
656
660
|
const handlePresetClick = (percentage) => {
|
|
657
661
|
if (balance === null) return;
|
|
662
|
+
const ctaName = percentage === 100 ? "Max" : `${percentage}%`;
|
|
663
|
+
_optionalChain([onCtaClick, 'optionalCall', _16 => _16(ctaName)]);
|
|
658
664
|
try {
|
|
659
665
|
const balanceUnits = Number(_viem.formatUnits.call(void 0, balance, asset.decimals));
|
|
660
666
|
if (!Number.isFinite(balanceUnits)) return;
|
|
@@ -688,13 +694,13 @@ function AmountStep({
|
|
|
688
694
|
}
|
|
689
695
|
if (hasPricing) {
|
|
690
696
|
const usdValue = numericAmount;
|
|
691
|
-
if (_optionalChain([uiConfig, 'optionalAccess',
|
|
697
|
+
if (_optionalChain([uiConfig, 'optionalAccess', _17 => _17.maxDepositUsd]) && usdValue > uiConfig.maxDepositUsd) {
|
|
692
698
|
setError(
|
|
693
699
|
`Maximum deposit is ${_chunkTQ6IIGRScjs.currencyFormatter.format(uiConfig.maxDepositUsd)}`
|
|
694
700
|
);
|
|
695
701
|
return;
|
|
696
702
|
}
|
|
697
|
-
if (_optionalChain([uiConfig, 'optionalAccess',
|
|
703
|
+
if (_optionalChain([uiConfig, 'optionalAccess', _18 => _18.minDepositUsd]) && usdValue < uiConfig.minDepositUsd) {
|
|
698
704
|
setAmount(uiConfig.minDepositUsd.toString());
|
|
699
705
|
setError(null);
|
|
700
706
|
return;
|
|
@@ -713,6 +719,7 @@ function AmountStep({
|
|
|
713
719
|
return;
|
|
714
720
|
}
|
|
715
721
|
setError(null);
|
|
722
|
+
_optionalChain([onCtaClick, 'optionalCall', _19 => _19("continue")]);
|
|
716
723
|
onContinue(tokenAmountStr, amount, _nullishCoalesce(balance, () => ( void 0)));
|
|
717
724
|
};
|
|
718
725
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
@@ -880,7 +887,7 @@ function AmountStep({
|
|
|
880
887
|
}
|
|
881
888
|
)
|
|
882
889
|
] }),
|
|
883
|
-
_optionalChain([uiConfig, 'optionalAccess',
|
|
890
|
+
_optionalChain([uiConfig, 'optionalAccess', _20 => _20.minDepositUsd]) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-minimum", children: [
|
|
884
891
|
_chunkTQ6IIGRScjs.currencyFormatter.format(uiConfig.minDepositUsd),
|
|
885
892
|
" minimum deposit"
|
|
886
893
|
] }),
|
|
@@ -912,7 +919,7 @@ function AmountStep({
|
|
|
912
919
|
onClick: handleContinue,
|
|
913
920
|
fullWidth: true,
|
|
914
921
|
disabled: !amount || chainMismatch,
|
|
915
|
-
children: _optionalChain([uiConfig, 'optionalAccess',
|
|
922
|
+
children: _optionalChain([uiConfig, 'optionalAccess', _21 => _21.minDepositUsd]) && parseFloat(amount) > 0 && parseFloat(amount) < uiConfig.minDepositUsd ? "Update order" : "Continue"
|
|
916
923
|
}
|
|
917
924
|
) }),
|
|
918
925
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkTQ6IIGRScjs.PoweredBy, {})
|
|
@@ -944,7 +951,7 @@ function ConfirmStep({
|
|
|
944
951
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
945
952
|
const [isSwitching, setIsSwitching] = _react.useState.call(void 0, false);
|
|
946
953
|
const hasAttemptedSwitch = _react.useRef.call(void 0, false);
|
|
947
|
-
const chainMismatch = _optionalChain([walletClient, 'optionalAccess',
|
|
954
|
+
const chainMismatch = _optionalChain([walletClient, 'optionalAccess', _22 => _22.chain, 'optionalAccess', _23 => _23.id]) && walletClient.chain.id !== asset.chainId;
|
|
948
955
|
const sameRoute = targetChain === asset.chainId && targetToken.toLowerCase() === asset.token.toLowerCase();
|
|
949
956
|
const targetSymbol = sameRoute ? asset.symbol : _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
950
957
|
const formattedSendAmount = amount && !Number.isNaN(Number(amount)) ? Number(amount).toLocaleString("en-US", { maximumFractionDigits: 6 }) : "0";
|
|
@@ -1021,13 +1028,13 @@ function ConfirmStep({
|
|
|
1021
1028
|
functionName: "transfer",
|
|
1022
1029
|
args: [transferTo, amountUnits]
|
|
1023
1030
|
});
|
|
1024
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
1031
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _24 => _24(hash, asset.chainId, amountUnits.toString())]);
|
|
1025
1032
|
onConfirm(hash, asset.chainId, amountUnits.toString(), asset.token);
|
|
1026
1033
|
} catch (err) {
|
|
1027
1034
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
1028
1035
|
const message = _chunkTQ6IIGRScjs.formatUserError.call(void 0, raw);
|
|
1029
1036
|
setError(message);
|
|
1030
|
-
_optionalChain([onError, 'optionalCall',
|
|
1037
|
+
_optionalChain([onError, 'optionalCall', _25 => _25(message, "TRANSFER_ERROR")]);
|
|
1031
1038
|
} finally {
|
|
1032
1039
|
setIsSubmitting(false);
|
|
1033
1040
|
}
|
|
@@ -1288,7 +1295,7 @@ var DEFAULT_SOLANA_RPC_URL = "https://api.mainnet.solana.com";
|
|
|
1288
1295
|
var configuredSolanaRpcUrl = null;
|
|
1289
1296
|
var cachedConnections = /* @__PURE__ */ new Map();
|
|
1290
1297
|
function configureSolanaRpcUrl(rpcUrl) {
|
|
1291
|
-
const normalized = _optionalChain([rpcUrl, 'optionalAccess',
|
|
1298
|
+
const normalized = _optionalChain([rpcUrl, 'optionalAccess', _26 => _26.trim, 'call', _27 => _27()]);
|
|
1292
1299
|
configuredSolanaRpcUrl = normalized ? normalized : null;
|
|
1293
1300
|
cachedConnections.clear();
|
|
1294
1301
|
}
|
|
@@ -1423,7 +1430,7 @@ function resolveSolanaTokenMeta(token) {
|
|
|
1423
1430
|
return {};
|
|
1424
1431
|
}
|
|
1425
1432
|
function getDepositEventDetails(event) {
|
|
1426
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
1433
|
+
if (!_optionalChain([event, 'optionalAccess', _28 => _28.type]) || !isRecord(event.data)) return {};
|
|
1427
1434
|
if (event.type === "deposit-received") {
|
|
1428
1435
|
const chainId = asChainId(event.data.chain);
|
|
1429
1436
|
const token = asString(event.data.token);
|
|
@@ -1437,12 +1444,12 @@ function getDepositEventDetails(event) {
|
|
|
1437
1444
|
}
|
|
1438
1445
|
if (event.type === "bridge-started") {
|
|
1439
1446
|
const source = isRecord(event.data.source) ? event.data.source : void 0;
|
|
1440
|
-
const chainId = asChainId(_optionalChain([source, 'optionalAccess',
|
|
1441
|
-
const token = asString(_optionalChain([source, 'optionalAccess',
|
|
1447
|
+
const chainId = asChainId(_optionalChain([source, 'optionalAccess', _29 => _29.chain]));
|
|
1448
|
+
const token = asString(_optionalChain([source, 'optionalAccess', _30 => _30.asset]));
|
|
1442
1449
|
const solanaMeta = chainId === "solana" ? resolveSolanaTokenMeta(token) : {};
|
|
1443
1450
|
return {
|
|
1444
1451
|
chainId,
|
|
1445
|
-
amount: asAmount(_optionalChain([source, 'optionalAccess',
|
|
1452
|
+
amount: asAmount(_optionalChain([source, 'optionalAccess', _31 => _31.amount])),
|
|
1446
1453
|
token,
|
|
1447
1454
|
...solanaMeta
|
|
1448
1455
|
};
|
|
@@ -1455,16 +1462,17 @@ function DepositAddressStep({
|
|
|
1455
1462
|
service,
|
|
1456
1463
|
allowedRoutes,
|
|
1457
1464
|
onDepositDetected,
|
|
1465
|
+
onCopyAddress,
|
|
1458
1466
|
onError
|
|
1459
1467
|
}) {
|
|
1460
1468
|
const hasSolana = Boolean(solanaDepositAddress);
|
|
1461
1469
|
const allowedChainSet = _react.useMemo.call(void 0,
|
|
1462
|
-
() => _optionalChain([allowedRoutes, 'optionalAccess',
|
|
1463
|
-
[_optionalChain([allowedRoutes, 'optionalAccess',
|
|
1470
|
+
() => _optionalChain([allowedRoutes, 'optionalAccess', _32 => _32.sourceChains]) ? new Set(allowedRoutes.sourceChains) : null,
|
|
1471
|
+
[_optionalChain([allowedRoutes, 'optionalAccess', _33 => _33.sourceChains])]
|
|
1464
1472
|
);
|
|
1465
1473
|
const allowedTokenSet = _react.useMemo.call(void 0,
|
|
1466
|
-
() => _optionalChain([allowedRoutes, 'optionalAccess',
|
|
1467
|
-
[_optionalChain([allowedRoutes, 'optionalAccess',
|
|
1474
|
+
() => _optionalChain([allowedRoutes, 'optionalAccess', _34 => _34.sourceTokens]) ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null,
|
|
1475
|
+
[_optionalChain([allowedRoutes, 'optionalAccess', _35 => _35.sourceTokens])]
|
|
1468
1476
|
);
|
|
1469
1477
|
const evmChainIds = _react.useMemo.call(void 0, () => {
|
|
1470
1478
|
const all = _chunkR6U6BHCVcjs.getSupportedChainIds.call(void 0, );
|
|
@@ -1507,9 +1515,9 @@ function DepositAddressStep({
|
|
|
1507
1515
|
const matched = _nullishCoalesce(SOLANA_TOKENS.find((t) => t.symbol === sourceTokenSymbol), () => ( SOLANA_TOKENS[0]));
|
|
1508
1516
|
sourceSelectionRef.current = {
|
|
1509
1517
|
chainId: "solana",
|
|
1510
|
-
token: _optionalChain([matched, 'optionalAccess',
|
|
1511
|
-
sourceSymbol: _optionalChain([matched, 'optionalAccess',
|
|
1512
|
-
sourceDecimals: _optionalChain([matched, 'optionalAccess',
|
|
1518
|
+
token: _optionalChain([matched, 'optionalAccess', _36 => _36.mint]),
|
|
1519
|
+
sourceSymbol: _optionalChain([matched, 'optionalAccess', _37 => _37.symbol]),
|
|
1520
|
+
sourceDecimals: _optionalChain([matched, 'optionalAccess', _38 => _38.decimals])
|
|
1513
1521
|
};
|
|
1514
1522
|
return;
|
|
1515
1523
|
}
|
|
@@ -1525,8 +1533,8 @@ function DepositAddressStep({
|
|
|
1525
1533
|
function handlePointerDown(event) {
|
|
1526
1534
|
const target = event.target;
|
|
1527
1535
|
if (!target) return;
|
|
1528
|
-
const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access',
|
|
1529
|
-
const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access',
|
|
1536
|
+
const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access', _39 => _39.current, 'optionalAccess', _40 => _40.contains, 'call', _41 => _41(target)]);
|
|
1537
|
+
const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access', _42 => _42.current, 'optionalAccess', _43 => _43.contains, 'call', _44 => _44(target)]);
|
|
1530
1538
|
if (clickedChainDropdown || clickedTokenDropdown) return;
|
|
1531
1539
|
setChainDropdownOpen(false);
|
|
1532
1540
|
setTokenDropdownOpen(false);
|
|
@@ -1539,6 +1547,7 @@ function DepositAddressStep({
|
|
|
1539
1547
|
};
|
|
1540
1548
|
}, [chainDropdownOpen, tokenDropdownOpen]);
|
|
1541
1549
|
const handleCopy = _react.useCallback.call(void 0, async () => {
|
|
1550
|
+
_optionalChain([onCopyAddress, 'optionalCall', _45 => _45()]);
|
|
1542
1551
|
try {
|
|
1543
1552
|
await navigator.clipboard.writeText(displayAddress);
|
|
1544
1553
|
setCopied(true);
|
|
@@ -1555,7 +1564,7 @@ function DepositAddressStep({
|
|
|
1555
1564
|
setCopied(true);
|
|
1556
1565
|
setTimeout(() => setCopied(false), 2e3);
|
|
1557
1566
|
}
|
|
1558
|
-
}, [displayAddress]);
|
|
1567
|
+
}, [displayAddress, onCopyAddress]);
|
|
1559
1568
|
_react.useEffect.call(void 0, () => {
|
|
1560
1569
|
setCopied(false);
|
|
1561
1570
|
setChainDropdownOpen(false);
|
|
@@ -1602,7 +1611,7 @@ function DepositAddressStep({
|
|
|
1602
1611
|
if (!cancelled) {
|
|
1603
1612
|
const msg = err instanceof Error ? err.message : "Failed to check status";
|
|
1604
1613
|
setPollingError(msg);
|
|
1605
|
-
_optionalChain([onError, 'optionalCall',
|
|
1614
|
+
_optionalChain([onError, 'optionalCall', _46 => _46(msg, "STATUS_POLL_ERROR")]);
|
|
1606
1615
|
}
|
|
1607
1616
|
}
|
|
1608
1617
|
if (!cancelled && !depositHandledRef.current) {
|
|
@@ -1883,7 +1892,7 @@ function SolanaTokenSelectStep({
|
|
|
1883
1892
|
setTokenBalances(results);
|
|
1884
1893
|
setLoading(false);
|
|
1885
1894
|
const totalUsd = results.reduce((sum, r) => sum + r.balanceUsd, 0);
|
|
1886
|
-
_optionalChain([onTotalBalanceComputed, 'optionalCall',
|
|
1895
|
+
_optionalChain([onTotalBalanceComputed, 'optionalCall', _47 => _47(totalUsd)]);
|
|
1887
1896
|
}
|
|
1888
1897
|
void loadBalances();
|
|
1889
1898
|
return () => {
|
|
@@ -2130,13 +2139,13 @@ function SolanaAmountStep({
|
|
|
2130
2139
|
const sourceAmount = isSourceStablecoin || !hasPricing ? numericAmount : numericAmount / tokenPriceUsd;
|
|
2131
2140
|
if (hasPricing) {
|
|
2132
2141
|
const usdValue = numericAmount;
|
|
2133
|
-
if (_optionalChain([uiConfig, 'optionalAccess',
|
|
2142
|
+
if (_optionalChain([uiConfig, 'optionalAccess', _48 => _48.maxDepositUsd]) && usdValue > uiConfig.maxDepositUsd) {
|
|
2134
2143
|
setError(
|
|
2135
2144
|
`Maximum deposit is ${_chunkTQ6IIGRScjs.currencyFormatter.format(uiConfig.maxDepositUsd)}`
|
|
2136
2145
|
);
|
|
2137
2146
|
return;
|
|
2138
2147
|
}
|
|
2139
|
-
if (_optionalChain([uiConfig, 'optionalAccess',
|
|
2148
|
+
if (_optionalChain([uiConfig, 'optionalAccess', _49 => _49.minDepositUsd]) && usdValue < uiConfig.minDepositUsd) {
|
|
2140
2149
|
setAmount(uiConfig.minDepositUsd.toString());
|
|
2141
2150
|
setError(null);
|
|
2142
2151
|
return;
|
|
@@ -2237,7 +2246,7 @@ function SolanaAmountStep({
|
|
|
2237
2246
|
}
|
|
2238
2247
|
)
|
|
2239
2248
|
] }),
|
|
2240
|
-
_optionalChain([uiConfig, 'optionalAccess',
|
|
2249
|
+
_optionalChain([uiConfig, 'optionalAccess', _50 => _50.minDepositUsd]) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-minimum", children: [
|
|
2241
2250
|
_chunkTQ6IIGRScjs.currencyFormatter.format(uiConfig.minDepositUsd),
|
|
2242
2251
|
" minimum deposit"
|
|
2243
2252
|
] }),
|
|
@@ -2269,7 +2278,7 @@ function SolanaAmountStep({
|
|
|
2269
2278
|
onClick: handleContinue,
|
|
2270
2279
|
fullWidth: true,
|
|
2271
2280
|
disabled: !amount,
|
|
2272
|
-
children: _optionalChain([uiConfig, 'optionalAccess',
|
|
2281
|
+
children: _optionalChain([uiConfig, 'optionalAccess', _51 => _51.minDepositUsd]) && parseFloat(amount) > 0 && parseFloat(amount) < uiConfig.minDepositUsd ? "Update order" : "Continue"
|
|
2273
2282
|
}
|
|
2274
2283
|
) }),
|
|
2275
2284
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkTQ6IIGRScjs.PoweredBy, {})
|
|
@@ -2376,7 +2385,7 @@ function SolanaConfirmStep({
|
|
|
2376
2385
|
_chunkTQ6IIGRScjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
2377
2386
|
token: token.symbol,
|
|
2378
2387
|
instructionCount: transaction.instructions.length,
|
|
2379
|
-
feePayer: _optionalChain([transaction, 'access',
|
|
2388
|
+
feePayer: _optionalChain([transaction, 'access', _52 => _52.feePayer, 'optionalAccess', _53 => _53.toBase58, 'call', _54 => _54()]),
|
|
2380
2389
|
recentBlockhash: transaction.recentBlockhash
|
|
2381
2390
|
});
|
|
2382
2391
|
const txHash = await sendSolanaTransaction(
|
|
@@ -2398,7 +2407,7 @@ function SolanaConfirmStep({
|
|
|
2398
2407
|
sourceAmount
|
|
2399
2408
|
});
|
|
2400
2409
|
setError(message);
|
|
2401
|
-
_optionalChain([onError, 'optionalCall',
|
|
2410
|
+
_optionalChain([onError, 'optionalCall', _55 => _55(message, "SOLANA_TRANSFER_ERROR")]);
|
|
2402
2411
|
} finally {
|
|
2403
2412
|
setIsSubmitting(false);
|
|
2404
2413
|
}
|
|
@@ -2559,6 +2568,7 @@ function DepositFlow({
|
|
|
2559
2568
|
sourceToken: defaultSourceToken,
|
|
2560
2569
|
amount: defaultAmount,
|
|
2561
2570
|
recipient,
|
|
2571
|
+
postBridgeActions,
|
|
2562
2572
|
signerAddress = _chunkR6U6BHCVcjs.DEFAULT_SIGNER_ADDRESS,
|
|
2563
2573
|
sessionChainIds,
|
|
2564
2574
|
forceRegister = false,
|
|
@@ -2578,11 +2588,12 @@ function DepositFlow({
|
|
|
2578
2588
|
onDepositSubmitted,
|
|
2579
2589
|
onDepositComplete,
|
|
2580
2590
|
onDepositFailed,
|
|
2591
|
+
onEvent,
|
|
2581
2592
|
onError,
|
|
2582
2593
|
debug
|
|
2583
2594
|
}) {
|
|
2584
2595
|
const hasInitialReownSession = Boolean(
|
|
2585
|
-
enableSolana ? _optionalChain([reownWallet, 'optionalAccess',
|
|
2596
|
+
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _56 => _56.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _57 => _57.address]) : _optionalChain([reownWallet, 'optionalAccess', _58 => _58.address])
|
|
2586
2597
|
);
|
|
2587
2598
|
const hasInitialWalletHydrationPending = Boolean(
|
|
2588
2599
|
dappAddress && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasInitialReownSession && !reownWallet.isReady)
|
|
@@ -2627,12 +2638,12 @@ function DepositFlow({
|
|
|
2627
2638
|
return null;
|
|
2628
2639
|
}, []);
|
|
2629
2640
|
const dappSwitchChain = _react.useMemo.call(void 0, () => {
|
|
2630
|
-
if (!_optionalChain([dappWalletClient, 'optionalAccess',
|
|
2641
|
+
if (!_optionalChain([dappWalletClient, 'optionalAccess', _59 => _59.switchChain])) return void 0;
|
|
2631
2642
|
return async (chainId) => {
|
|
2632
|
-
await _optionalChain([dappWalletClient, 'access',
|
|
2643
|
+
await _optionalChain([dappWalletClient, 'access', _60 => _60.switchChain, 'optionalCall', _61 => _61({ id: chainId })]);
|
|
2633
2644
|
};
|
|
2634
2645
|
}, [dappWalletClient]);
|
|
2635
|
-
const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
2646
|
+
const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _62 => _62.account, 'optionalAccess', _63 => _63.address]), () => ( null));
|
|
2636
2647
|
const walletOptions = _react.useMemo.call(void 0, () => {
|
|
2637
2648
|
const options = [];
|
|
2638
2649
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -2646,7 +2657,7 @@ function DepositFlow({
|
|
|
2646
2657
|
});
|
|
2647
2658
|
seen.add(id);
|
|
2648
2659
|
}
|
|
2649
|
-
if (enableSolana && _optionalChain([reownWallet, 'optionalAccess',
|
|
2660
|
+
if (enableSolana && _optionalChain([reownWallet, 'optionalAccess', _64 => _64.isConnected]) && reownWallet.isSolana && reownWallet.solanaAddress && dappAddress) {
|
|
2650
2661
|
const id = _nullishCoalesce(reownWallet.caipAddress, () => ( `solana:${reownWallet.solanaAddress}`));
|
|
2651
2662
|
if (!seen.has(id)) {
|
|
2652
2663
|
options.push({
|
|
@@ -2658,7 +2669,7 @@ function DepositFlow({
|
|
|
2658
2669
|
});
|
|
2659
2670
|
seen.add(id);
|
|
2660
2671
|
}
|
|
2661
|
-
} else if (_optionalChain([reownWallet, 'optionalAccess',
|
|
2672
|
+
} else if (_optionalChain([reownWallet, 'optionalAccess', _65 => _65.address]) && reownWallet.isConnected && reownWallet.walletClient && reownWallet.publicClient && !seen.has(`evm:${reownWallet.address.toLowerCase()}`)) {
|
|
2662
2673
|
const id = `evm:${reownWallet.address.toLowerCase()}`;
|
|
2663
2674
|
if (!seen.has(id)) {
|
|
2664
2675
|
options.push({
|
|
@@ -2675,20 +2686,20 @@ function DepositFlow({
|
|
|
2675
2686
|
}, [
|
|
2676
2687
|
connectedWalletAddress,
|
|
2677
2688
|
dappAddress,
|
|
2678
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2679
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2680
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2681
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2682
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2689
|
+
_optionalChain([reownWallet, 'optionalAccess', _66 => _66.address]),
|
|
2690
|
+
_optionalChain([reownWallet, 'optionalAccess', _67 => _67.isConnected]),
|
|
2691
|
+
_optionalChain([reownWallet, 'optionalAccess', _68 => _68.walletClient]),
|
|
2692
|
+
_optionalChain([reownWallet, 'optionalAccess', _69 => _69.publicClient]),
|
|
2693
|
+
_optionalChain([reownWallet, 'optionalAccess', _70 => _70.icon]),
|
|
2683
2694
|
enableSolana,
|
|
2684
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2685
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2686
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2695
|
+
_optionalChain([reownWallet, 'optionalAccess', _71 => _71.isSolana]),
|
|
2696
|
+
_optionalChain([reownWallet, 'optionalAccess', _72 => _72.solanaAddress]),
|
|
2697
|
+
_optionalChain([reownWallet, 'optionalAccess', _73 => _73.caipAddress])
|
|
2687
2698
|
]);
|
|
2688
|
-
const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess',
|
|
2699
|
+
const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess', _74 => _74.account]) && dappAddress && !reownWallet;
|
|
2689
2700
|
const hasWalletOptions = walletOptions.length > 0;
|
|
2690
2701
|
const hasReownSession = Boolean(
|
|
2691
|
-
enableSolana ? _optionalChain([reownWallet, 'optionalAccess',
|
|
2702
|
+
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _75 => _75.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _76 => _76.address]) : _optionalChain([reownWallet, 'optionalAccess', _77 => _77.address])
|
|
2692
2703
|
);
|
|
2693
2704
|
const isWalletHydrationPending = Boolean(
|
|
2694
2705
|
dappAddress && !hasWalletOptions && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasReownSession && !reownWallet.isReady)
|
|
@@ -2733,7 +2744,7 @@ function DepositFlow({
|
|
|
2733
2744
|
};
|
|
2734
2745
|
}
|
|
2735
2746
|
if (canAutoLock) {
|
|
2736
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
2747
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _78 => _78.chain, 'optionalAccess', _79 => _79.id]), () => ( targetChain));
|
|
2737
2748
|
return {
|
|
2738
2749
|
ownerAddress: dappWalletClient.account.address,
|
|
2739
2750
|
walletClient: dappWalletClient,
|
|
@@ -2755,8 +2766,8 @@ function DepositFlow({
|
|
|
2755
2766
|
switchChain: void 0
|
|
2756
2767
|
};
|
|
2757
2768
|
}
|
|
2758
|
-
if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess',
|
|
2759
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
2769
|
+
if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess', _80 => _80.account]) && selectedOption.address && dappWalletClient.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
2770
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _81 => _81.chain, 'optionalAccess', _82 => _82.id]), () => ( targetChain));
|
|
2760
2771
|
return {
|
|
2761
2772
|
ownerAddress: dappWalletClient.account.address,
|
|
2762
2773
|
walletClient: dappWalletClient,
|
|
@@ -2764,7 +2775,7 @@ function DepositFlow({
|
|
|
2764
2775
|
switchChain: dappSwitchChain
|
|
2765
2776
|
};
|
|
2766
2777
|
}
|
|
2767
|
-
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess',
|
|
2778
|
+
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess', _83 => _83.address]) && selectedOption.address && reownWallet.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
2768
2779
|
return {
|
|
2769
2780
|
ownerAddress: reownWallet.address,
|
|
2770
2781
|
walletClient: reownWallet.walletClient,
|
|
@@ -2828,7 +2839,7 @@ function DepositFlow({
|
|
|
2828
2839
|
walletSignerContext,
|
|
2829
2840
|
walletSelectionKey
|
|
2830
2841
|
]);
|
|
2831
|
-
const sessionKeyAddress = _nullishCoalesce(_nullishCoalesce(dappAddress, () => ( _optionalChain([signerContext, 'optionalAccess',
|
|
2842
|
+
const sessionKeyAddress = _nullishCoalesce(_nullishCoalesce(dappAddress, () => ( _optionalChain([signerContext, 'optionalAccess', _84 => _84.ownerAddress]))), () => ( null));
|
|
2832
2843
|
const lastTargetRef = _react.useRef.call(void 0, null);
|
|
2833
2844
|
_react.useEffect.call(void 0, () => {
|
|
2834
2845
|
const prev = lastTargetRef.current;
|
|
@@ -2905,8 +2916,34 @@ function DepositFlow({
|
|
|
2905
2916
|
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;
|
|
2906
2917
|
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;
|
|
2907
2918
|
_react.useEffect.call(void 0, () => {
|
|
2908
|
-
_optionalChain([onStepChange, 'optionalCall',
|
|
2919
|
+
_optionalChain([onStepChange, 'optionalCall', _85 => _85(stepIndex, currentBackHandler)]);
|
|
2909
2920
|
}, [stepIndex, currentBackHandler, onStepChange]);
|
|
2921
|
+
_react.useEffect.call(void 0, () => {
|
|
2922
|
+
if (step.type === "select-asset") {
|
|
2923
|
+
_optionalChain([onEvent, 'optionalCall', _86 => _86({
|
|
2924
|
+
type: "deposit_modal_connected_wallet_select_source_open",
|
|
2925
|
+
total_balance_in_external_wallet: totalBalanceUsd,
|
|
2926
|
+
pred_balance: totalBalanceUsd
|
|
2927
|
+
})]);
|
|
2928
|
+
} else if (step.type === "deposit-address") {
|
|
2929
|
+
const chainName = _chunkR6U6BHCVcjs.getChainName.call(void 0, targetChain);
|
|
2930
|
+
const tokenSymbol = _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
2931
|
+
_optionalChain([onEvent, 'optionalCall', _87 => _87({
|
|
2932
|
+
type: "deposit_modal_transfer_crypto_open",
|
|
2933
|
+
default_chain: chainName,
|
|
2934
|
+
default_token: tokenSymbol,
|
|
2935
|
+
pred_balance: totalBalanceUsd
|
|
2936
|
+
})]);
|
|
2937
|
+
} else if (step.type === "amount") {
|
|
2938
|
+
const receiveSymbol = _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
2939
|
+
_optionalChain([onEvent, 'optionalCall', _88 => _88({
|
|
2940
|
+
type: "deposit_modal_connected_wallet_enter_value_open",
|
|
2941
|
+
send_token: step.asset.symbol,
|
|
2942
|
+
receive_token: receiveSymbol,
|
|
2943
|
+
pred_balance: totalBalanceUsd
|
|
2944
|
+
})]);
|
|
2945
|
+
}
|
|
2946
|
+
}, [step, onEvent, totalBalanceUsd, targetChain, targetToken]);
|
|
2910
2947
|
_react.useEffect.call(void 0, () => {
|
|
2911
2948
|
logFlow("state:changed", {
|
|
2912
2949
|
step: step.type,
|
|
@@ -2924,7 +2961,7 @@ function DepositFlow({
|
|
|
2924
2961
|
targetToken
|
|
2925
2962
|
]);
|
|
2926
2963
|
_react.useEffect.call(void 0, () => {
|
|
2927
|
-
_optionalChain([onTotalBalanceChange, 'optionalCall',
|
|
2964
|
+
_optionalChain([onTotalBalanceChange, 'optionalCall', _89 => _89(totalBalanceUsd)]);
|
|
2928
2965
|
}, [totalBalanceUsd, onTotalBalanceChange]);
|
|
2929
2966
|
const isDepositAddressMode = flowMode === "deposit-address";
|
|
2930
2967
|
const isSolanaWalletMode = flowMode === "solana-wallet";
|
|
@@ -2966,7 +3003,7 @@ function DepositFlow({
|
|
|
2966
3003
|
solanaDepositAddress
|
|
2967
3004
|
});
|
|
2968
3005
|
} else {
|
|
2969
|
-
_optionalChain([onError, 'optionalCall',
|
|
3006
|
+
_optionalChain([onError, 'optionalCall', _90 => _90({
|
|
2970
3007
|
message: "Solana deposit address not available. Please try again.",
|
|
2971
3008
|
code: "SOLANA_SETUP_FAILED"
|
|
2972
3009
|
})]);
|
|
@@ -3001,7 +3038,7 @@ function DepositFlow({
|
|
|
3001
3038
|
directTransfer
|
|
3002
3039
|
};
|
|
3003
3040
|
});
|
|
3004
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
3041
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _91 => _91({ txHash, sourceChain: chainId, amount })]);
|
|
3005
3042
|
},
|
|
3006
3043
|
[onDepositSubmitted, targetChain, targetToken]
|
|
3007
3044
|
);
|
|
@@ -3073,7 +3110,7 @@ function DepositFlow({
|
|
|
3073
3110
|
sourceDecimals: prev.token.decimals
|
|
3074
3111
|
};
|
|
3075
3112
|
});
|
|
3076
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
3113
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _92 => _92({
|
|
3077
3114
|
txHash,
|
|
3078
3115
|
sourceChain: "solana",
|
|
3079
3116
|
amount: amountUnits
|
|
@@ -3083,12 +3120,20 @@ function DepositFlow({
|
|
|
3083
3120
|
);
|
|
3084
3121
|
const handleConnected = _react.useCallback.call(void 0,
|
|
3085
3122
|
(addr, smartAccount) => {
|
|
3086
|
-
_optionalChain([onConnected, 'optionalCall',
|
|
3123
|
+
_optionalChain([onConnected, 'optionalCall', _93 => _93({ address: addr, smartAccount })]);
|
|
3087
3124
|
},
|
|
3088
3125
|
[onConnected]
|
|
3089
3126
|
);
|
|
3090
3127
|
const handleAssetContinue = _react.useCallback.call(void 0,
|
|
3091
3128
|
(asset) => {
|
|
3129
|
+
_optionalChain([onEvent, 'optionalCall', _94 => _94({
|
|
3130
|
+
type: "deposit_modal_connected_wallet_select_source_cta_click",
|
|
3131
|
+
total_balance_in_external_wallet: totalBalanceUsd,
|
|
3132
|
+
pred_balance: totalBalanceUsd,
|
|
3133
|
+
cta_name: "token_selected",
|
|
3134
|
+
token_name: asset.symbol,
|
|
3135
|
+
token_balance: _nullishCoalesce(asset.balance, () => ( "0"))
|
|
3136
|
+
})]);
|
|
3092
3137
|
setStep((prev) => {
|
|
3093
3138
|
if (prev.type !== "select-asset") return prev;
|
|
3094
3139
|
return {
|
|
@@ -3099,7 +3144,7 @@ function DepositFlow({
|
|
|
3099
3144
|
};
|
|
3100
3145
|
});
|
|
3101
3146
|
},
|
|
3102
|
-
[defaultAmount]
|
|
3147
|
+
[defaultAmount, onEvent, totalBalanceUsd]
|
|
3103
3148
|
);
|
|
3104
3149
|
const handleAmountContinue = _react.useCallback.call(void 0,
|
|
3105
3150
|
(amount, targetAmount, balance) => {
|
|
@@ -3146,28 +3191,28 @@ function DepositFlow({
|
|
|
3146
3191
|
);
|
|
3147
3192
|
const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
|
|
3148
3193
|
(txHash, sourceChain, amount) => {
|
|
3149
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
3194
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _95 => _95({ txHash, sourceChain, amount })]);
|
|
3150
3195
|
},
|
|
3151
3196
|
[onDepositSubmitted]
|
|
3152
3197
|
);
|
|
3153
3198
|
const handleDepositComplete = _react.useCallback.call(void 0,
|
|
3154
3199
|
(txHash, destinationTxHash, context) => {
|
|
3155
3200
|
logFlow("deposit:complete", { txHash, destinationTxHash, ...context });
|
|
3156
|
-
_optionalChain([onDepositComplete, 'optionalCall',
|
|
3201
|
+
_optionalChain([onDepositComplete, 'optionalCall', _96 => _96({ txHash, destinationTxHash, ...context })]);
|
|
3157
3202
|
},
|
|
3158
3203
|
[logFlow, onDepositComplete]
|
|
3159
3204
|
);
|
|
3160
3205
|
const handleDepositFailed = _react.useCallback.call(void 0,
|
|
3161
3206
|
(txHash, error) => {
|
|
3162
3207
|
logFlowError("deposit:failed", error, { txHash });
|
|
3163
|
-
_optionalChain([onDepositFailed, 'optionalCall',
|
|
3208
|
+
_optionalChain([onDepositFailed, 'optionalCall', _97 => _97({ txHash, error })]);
|
|
3164
3209
|
},
|
|
3165
3210
|
[logFlowError, onDepositFailed]
|
|
3166
3211
|
);
|
|
3167
3212
|
const handleError = _react.useCallback.call(void 0,
|
|
3168
3213
|
(message, code) => {
|
|
3169
3214
|
logFlowError("flow:error", message, { code });
|
|
3170
|
-
_optionalChain([onError, 'optionalCall',
|
|
3215
|
+
_optionalChain([onError, 'optionalCall', _98 => _98({ message, code })]);
|
|
3171
3216
|
},
|
|
3172
3217
|
[logFlowError, onError]
|
|
3173
3218
|
);
|
|
@@ -3224,7 +3269,7 @@ function DepositFlow({
|
|
|
3224
3269
|
if (walletId) {
|
|
3225
3270
|
const selectedOption = walletOptions.find((o) => o.id === walletId);
|
|
3226
3271
|
setSelectedWalletId(walletId);
|
|
3227
|
-
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess',
|
|
3272
|
+
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess', _99 => _99.kind]) === "solana") {
|
|
3228
3273
|
handleSelectSolanaWallet();
|
|
3229
3274
|
} else {
|
|
3230
3275
|
handleSelectProvider();
|
|
@@ -3273,7 +3318,7 @@ function DepositFlow({
|
|
|
3273
3318
|
const selectedOption = walletOptions.find(
|
|
3274
3319
|
(o) => o.id === selectedWalletIdEffective
|
|
3275
3320
|
);
|
|
3276
|
-
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess',
|
|
3321
|
+
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess', _100 => _100.kind]) === "solana") {
|
|
3277
3322
|
handleSelectSolanaWallet();
|
|
3278
3323
|
} else {
|
|
3279
3324
|
handleSelectProvider();
|
|
@@ -3296,6 +3341,7 @@ function DepositFlow({
|
|
|
3296
3341
|
signerAddress,
|
|
3297
3342
|
sessionChainIds,
|
|
3298
3343
|
recipient,
|
|
3344
|
+
postBridgeActions,
|
|
3299
3345
|
forceRegister,
|
|
3300
3346
|
enableSolana,
|
|
3301
3347
|
service,
|
|
@@ -3312,6 +3358,17 @@ function DepositFlow({
|
|
|
3312
3358
|
service,
|
|
3313
3359
|
allowedRoutes,
|
|
3314
3360
|
onDepositDetected: handleDepositAddressDetected,
|
|
3361
|
+
onCopyAddress: () => {
|
|
3362
|
+
const chainName = _chunkR6U6BHCVcjs.getChainName.call(void 0, targetChain);
|
|
3363
|
+
const tokenSymbol = _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3364
|
+
_optionalChain([onEvent, 'optionalCall', _101 => _101({
|
|
3365
|
+
type: "deposit_modal_transfer_crypto_cta_click",
|
|
3366
|
+
default_chain: chainName,
|
|
3367
|
+
default_token: tokenSymbol,
|
|
3368
|
+
pred_balance: totalBalanceUsd,
|
|
3369
|
+
cta_name: "copy"
|
|
3370
|
+
})]);
|
|
3371
|
+
},
|
|
3315
3372
|
onError: handleError
|
|
3316
3373
|
}
|
|
3317
3374
|
),
|
|
@@ -3342,8 +3399,8 @@ function DepositFlow({
|
|
|
3342
3399
|
}
|
|
3343
3400
|
if (isSolanaWalletMode) {
|
|
3344
3401
|
if (!sessionKeyAddress) return null;
|
|
3345
|
-
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess',
|
|
3346
|
-
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess',
|
|
3402
|
+
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess', _102 => _102.solanaAddress]);
|
|
3403
|
+
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess', _103 => _103.solanaProvider]);
|
|
3347
3404
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
3348
3405
|
step.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3349
3406
|
SetupStep,
|
|
@@ -3354,6 +3411,7 @@ function DepositFlow({
|
|
|
3354
3411
|
signerAddress,
|
|
3355
3412
|
sessionChainIds,
|
|
3356
3413
|
recipient,
|
|
3414
|
+
postBridgeActions,
|
|
3357
3415
|
forceRegister,
|
|
3358
3416
|
enableSolana,
|
|
3359
3417
|
service,
|
|
@@ -3462,13 +3520,13 @@ function DepositFlow({
|
|
|
3462
3520
|
)
|
|
3463
3521
|
] });
|
|
3464
3522
|
}
|
|
3465
|
-
if (!_optionalChain([signerContext, 'optionalAccess',
|
|
3523
|
+
if (!_optionalChain([signerContext, 'optionalAccess', _104 => _104.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _105 => _105.publicClient])) {
|
|
3466
3524
|
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..." }) }) }) }) });
|
|
3467
3525
|
}
|
|
3468
3526
|
const ownerAddress = signerContext.ownerAddress;
|
|
3469
|
-
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access',
|
|
3527
|
+
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _106 => _106.walletClient, 'optionalAccess', _107 => _107.chain, 'optionalAccess', _108 => _108.id]), () => ( _optionalChain([signerContext, 'access', _109 => _109.publicClient, 'access', _110 => _110.chain, 'optionalAccess', _111 => _111.id]))), () => ( targetChain));
|
|
3470
3528
|
const getReadClientForChain = (chainId) => {
|
|
3471
|
-
if (_optionalChain([signerContext, 'access',
|
|
3529
|
+
if (_optionalChain([signerContext, 'access', _112 => _112.publicClient, 'access', _113 => _113.chain, 'optionalAccess', _114 => _114.id]) === chainId) {
|
|
3472
3530
|
return signerContext.publicClient;
|
|
3473
3531
|
}
|
|
3474
3532
|
return _chunkTQ6IIGRScjs.getPublicClient.call(void 0, chainId);
|
|
@@ -3484,6 +3542,7 @@ function DepositFlow({
|
|
|
3484
3542
|
signerAddress,
|
|
3485
3543
|
sessionChainIds,
|
|
3486
3544
|
recipient,
|
|
3545
|
+
postBridgeActions,
|
|
3487
3546
|
forceRegister,
|
|
3488
3547
|
enableSolana,
|
|
3489
3548
|
service,
|
|
@@ -3518,7 +3577,17 @@ function DepositFlow({
|
|
|
3518
3577
|
targetChain,
|
|
3519
3578
|
targetToken,
|
|
3520
3579
|
uiConfig,
|
|
3521
|
-
onContinue: handleAmountContinue
|
|
3580
|
+
onContinue: handleAmountContinue,
|
|
3581
|
+
onCtaClick: (ctaName) => {
|
|
3582
|
+
const receiveSymbol = _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3583
|
+
_optionalChain([onEvent, 'optionalCall', _115 => _115({
|
|
3584
|
+
type: "deposit_modal_connected_wallet_enter_value_cta_click",
|
|
3585
|
+
send_token: step.asset.symbol,
|
|
3586
|
+
receive_token: receiveSymbol,
|
|
3587
|
+
pred_balance: totalBalanceUsd,
|
|
3588
|
+
cta_name: ctaName
|
|
3589
|
+
})]);
|
|
3590
|
+
}
|
|
3522
3591
|
}
|
|
3523
3592
|
),
|
|
3524
3593
|
step.type === "confirm" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3570,7 +3639,7 @@ function DepositFlow({
|
|
|
3570
3639
|
// src/DepositModal.tsx
|
|
3571
3640
|
|
|
3572
3641
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
3573
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
3642
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-VP5E2JRC.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
3574
3643
|
);
|
|
3575
3644
|
function DepositModal(props) {
|
|
3576
3645
|
const needsReown = !!props.reownAppId;
|
|
@@ -3618,6 +3687,7 @@ function DepositModalInner({
|
|
|
3618
3687
|
forceRegister = false,
|
|
3619
3688
|
waitForFinalTx = true,
|
|
3620
3689
|
enableSolana = true,
|
|
3690
|
+
postBridgeActions,
|
|
3621
3691
|
reownWallet,
|
|
3622
3692
|
onConnect,
|
|
3623
3693
|
onDisconnect,
|
|
@@ -3633,6 +3703,7 @@ function DepositModalInner({
|
|
|
3633
3703
|
onDepositSubmitted,
|
|
3634
3704
|
onDepositComplete,
|
|
3635
3705
|
onDepositFailed,
|
|
3706
|
+
onEvent,
|
|
3636
3707
|
onError,
|
|
3637
3708
|
debug
|
|
3638
3709
|
}) {
|
|
@@ -3661,7 +3732,7 @@ function DepositModalInner({
|
|
|
3661
3732
|
_react.useEffect.call(void 0, () => {
|
|
3662
3733
|
if (isOpen && !hasCalledReady.current) {
|
|
3663
3734
|
hasCalledReady.current = true;
|
|
3664
|
-
_optionalChain([onReady, 'optionalCall',
|
|
3735
|
+
_optionalChain([onReady, 'optionalCall', _116 => _116()]);
|
|
3665
3736
|
}
|
|
3666
3737
|
}, [isOpen, onReady]);
|
|
3667
3738
|
_react.useEffect.call(void 0, () => {
|
|
@@ -3680,14 +3751,14 @@ function DepositModalInner({
|
|
|
3680
3751
|
setTotalBalanceUsd(balance2);
|
|
3681
3752
|
}, []);
|
|
3682
3753
|
const handleBack = _react.useCallback.call(void 0, () => {
|
|
3683
|
-
_optionalChain([backHandlerRef, 'access',
|
|
3754
|
+
_optionalChain([backHandlerRef, 'access', _117 => _117.current, 'optionalCall', _118 => _118()]);
|
|
3684
3755
|
}, []);
|
|
3685
|
-
const showLogo = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3686
|
-
const showStepper = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3687
|
-
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3688
|
-
const balance = _optionalChain([uiConfig, 'optionalAccess',
|
|
3689
|
-
const logoUrl = _nullishCoalesce(_optionalChain([branding, 'optionalAccess',
|
|
3690
|
-
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess',
|
|
3756
|
+
const showLogo = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _119 => _119.showLogo]), () => ( false));
|
|
3757
|
+
const showStepper = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _120 => _120.showStepper]), () => ( false));
|
|
3758
|
+
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _121 => _121.showBackButton]), () => ( true));
|
|
3759
|
+
const balance = _optionalChain([uiConfig, 'optionalAccess', _122 => _122.balance]);
|
|
3760
|
+
const logoUrl = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _123 => _123.logoUrl]), () => ( "https://github.com/rhinestonewtf.png"));
|
|
3761
|
+
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _124 => _124.title]), () => ( "Deposit"));
|
|
3691
3762
|
const canGoBack = currentStepIndex > 0 && currentStepIndex < 4 && backHandlerRef.current !== void 0;
|
|
3692
3763
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3693
3764
|
_chunkTQ6IIGRScjs.Modal,
|
|
@@ -3827,6 +3898,7 @@ function DepositModalInner({
|
|
|
3827
3898
|
sourceToken,
|
|
3828
3899
|
amount: defaultAmount,
|
|
3829
3900
|
recipient,
|
|
3901
|
+
postBridgeActions,
|
|
3830
3902
|
signerAddress,
|
|
3831
3903
|
sessionChainIds,
|
|
3832
3904
|
forceRegister,
|
|
@@ -3846,6 +3918,7 @@ function DepositModalInner({
|
|
|
3846
3918
|
onDepositSubmitted,
|
|
3847
3919
|
onDepositComplete,
|
|
3848
3920
|
onDepositFailed,
|
|
3921
|
+
onEvent,
|
|
3849
3922
|
onError,
|
|
3850
3923
|
debug
|
|
3851
3924
|
}
|