@rhinestone/deposit-modal 0.1.59 → 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-X3XPNZNZ.mjs → DepositModalReown-S24YS35X.mjs} +1 -1
- package/dist/{DepositModalReown-DPCGEQT5.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-E4YPPHZF.mjs → chunk-6SM3IQKZ.mjs} +69 -5
- package/dist/{chunk-M4QDXLIN.cjs → chunk-HX7LLE2V.cjs} +144 -80
- 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/{types-Dp8Wj8Vt.d.cts → types-7IoN8k-P.d.cts} +51 -1
- package/dist/{types-CB9x9ab7.d.ts → types-BLIqLF0c.d.ts} +51 -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
|
@@ -554,7 +554,8 @@ function AmountStep({
|
|
|
554
554
|
uiConfig,
|
|
555
555
|
tokenPriceUsdOverride,
|
|
556
556
|
onBalanceUsdChange,
|
|
557
|
-
onContinue
|
|
557
|
+
onContinue,
|
|
558
|
+
onCtaClick
|
|
558
559
|
}) {
|
|
559
560
|
const [amount, setAmount] = _react.useState.call(void 0, "");
|
|
560
561
|
const [balance, setBalance] = _react.useState.call(void 0, null);
|
|
@@ -658,6 +659,8 @@ function AmountStep({
|
|
|
658
659
|
}, [balance, asset.decimals]);
|
|
659
660
|
const handlePresetClick = (percentage) => {
|
|
660
661
|
if (balance === null) return;
|
|
662
|
+
const ctaName = percentage === 100 ? "Max" : `${percentage}%`;
|
|
663
|
+
_optionalChain([onCtaClick, 'optionalCall', _16 => _16(ctaName)]);
|
|
661
664
|
try {
|
|
662
665
|
const balanceUnits = Number(_viem.formatUnits.call(void 0, balance, asset.decimals));
|
|
663
666
|
if (!Number.isFinite(balanceUnits)) return;
|
|
@@ -691,13 +694,13 @@ function AmountStep({
|
|
|
691
694
|
}
|
|
692
695
|
if (hasPricing) {
|
|
693
696
|
const usdValue = numericAmount;
|
|
694
|
-
if (_optionalChain([uiConfig, 'optionalAccess',
|
|
697
|
+
if (_optionalChain([uiConfig, 'optionalAccess', _17 => _17.maxDepositUsd]) && usdValue > uiConfig.maxDepositUsd) {
|
|
695
698
|
setError(
|
|
696
699
|
`Maximum deposit is ${_chunkTQ6IIGRScjs.currencyFormatter.format(uiConfig.maxDepositUsd)}`
|
|
697
700
|
);
|
|
698
701
|
return;
|
|
699
702
|
}
|
|
700
|
-
if (_optionalChain([uiConfig, 'optionalAccess',
|
|
703
|
+
if (_optionalChain([uiConfig, 'optionalAccess', _18 => _18.minDepositUsd]) && usdValue < uiConfig.minDepositUsd) {
|
|
701
704
|
setAmount(uiConfig.minDepositUsd.toString());
|
|
702
705
|
setError(null);
|
|
703
706
|
return;
|
|
@@ -716,6 +719,7 @@ function AmountStep({
|
|
|
716
719
|
return;
|
|
717
720
|
}
|
|
718
721
|
setError(null);
|
|
722
|
+
_optionalChain([onCtaClick, 'optionalCall', _19 => _19("continue")]);
|
|
719
723
|
onContinue(tokenAmountStr, amount, _nullishCoalesce(balance, () => ( void 0)));
|
|
720
724
|
};
|
|
721
725
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-step", children: [
|
|
@@ -883,7 +887,7 @@ function AmountStep({
|
|
|
883
887
|
}
|
|
884
888
|
)
|
|
885
889
|
] }),
|
|
886
|
-
_optionalChain([uiConfig, 'optionalAccess',
|
|
890
|
+
_optionalChain([uiConfig, 'optionalAccess', _20 => _20.minDepositUsd]) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-minimum", children: [
|
|
887
891
|
_chunkTQ6IIGRScjs.currencyFormatter.format(uiConfig.minDepositUsd),
|
|
888
892
|
" minimum deposit"
|
|
889
893
|
] }),
|
|
@@ -915,7 +919,7 @@ function AmountStep({
|
|
|
915
919
|
onClick: handleContinue,
|
|
916
920
|
fullWidth: true,
|
|
917
921
|
disabled: !amount || chainMismatch,
|
|
918
|
-
children: _optionalChain([uiConfig, 'optionalAccess',
|
|
922
|
+
children: _optionalChain([uiConfig, 'optionalAccess', _21 => _21.minDepositUsd]) && parseFloat(amount) > 0 && parseFloat(amount) < uiConfig.minDepositUsd ? "Update order" : "Continue"
|
|
919
923
|
}
|
|
920
924
|
) }),
|
|
921
925
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkTQ6IIGRScjs.PoweredBy, {})
|
|
@@ -947,7 +951,7 @@ function ConfirmStep({
|
|
|
947
951
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
948
952
|
const [isSwitching, setIsSwitching] = _react.useState.call(void 0, false);
|
|
949
953
|
const hasAttemptedSwitch = _react.useRef.call(void 0, false);
|
|
950
|
-
const chainMismatch = _optionalChain([walletClient, 'optionalAccess',
|
|
954
|
+
const chainMismatch = _optionalChain([walletClient, 'optionalAccess', _22 => _22.chain, 'optionalAccess', _23 => _23.id]) && walletClient.chain.id !== asset.chainId;
|
|
951
955
|
const sameRoute = targetChain === asset.chainId && targetToken.toLowerCase() === asset.token.toLowerCase();
|
|
952
956
|
const targetSymbol = sameRoute ? asset.symbol : _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
953
957
|
const formattedSendAmount = amount && !Number.isNaN(Number(amount)) ? Number(amount).toLocaleString("en-US", { maximumFractionDigits: 6 }) : "0";
|
|
@@ -1024,13 +1028,13 @@ function ConfirmStep({
|
|
|
1024
1028
|
functionName: "transfer",
|
|
1025
1029
|
args: [transferTo, amountUnits]
|
|
1026
1030
|
});
|
|
1027
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
1031
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _24 => _24(hash, asset.chainId, amountUnits.toString())]);
|
|
1028
1032
|
onConfirm(hash, asset.chainId, amountUnits.toString(), asset.token);
|
|
1029
1033
|
} catch (err) {
|
|
1030
1034
|
const raw = err instanceof Error ? err.message : "Transfer failed";
|
|
1031
1035
|
const message = _chunkTQ6IIGRScjs.formatUserError.call(void 0, raw);
|
|
1032
1036
|
setError(message);
|
|
1033
|
-
_optionalChain([onError, 'optionalCall',
|
|
1037
|
+
_optionalChain([onError, 'optionalCall', _25 => _25(message, "TRANSFER_ERROR")]);
|
|
1034
1038
|
} finally {
|
|
1035
1039
|
setIsSubmitting(false);
|
|
1036
1040
|
}
|
|
@@ -1291,7 +1295,7 @@ var DEFAULT_SOLANA_RPC_URL = "https://api.mainnet.solana.com";
|
|
|
1291
1295
|
var configuredSolanaRpcUrl = null;
|
|
1292
1296
|
var cachedConnections = /* @__PURE__ */ new Map();
|
|
1293
1297
|
function configureSolanaRpcUrl(rpcUrl) {
|
|
1294
|
-
const normalized = _optionalChain([rpcUrl, 'optionalAccess',
|
|
1298
|
+
const normalized = _optionalChain([rpcUrl, 'optionalAccess', _26 => _26.trim, 'call', _27 => _27()]);
|
|
1295
1299
|
configuredSolanaRpcUrl = normalized ? normalized : null;
|
|
1296
1300
|
cachedConnections.clear();
|
|
1297
1301
|
}
|
|
@@ -1426,7 +1430,7 @@ function resolveSolanaTokenMeta(token) {
|
|
|
1426
1430
|
return {};
|
|
1427
1431
|
}
|
|
1428
1432
|
function getDepositEventDetails(event) {
|
|
1429
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
1433
|
+
if (!_optionalChain([event, 'optionalAccess', _28 => _28.type]) || !isRecord(event.data)) return {};
|
|
1430
1434
|
if (event.type === "deposit-received") {
|
|
1431
1435
|
const chainId = asChainId(event.data.chain);
|
|
1432
1436
|
const token = asString(event.data.token);
|
|
@@ -1440,12 +1444,12 @@ function getDepositEventDetails(event) {
|
|
|
1440
1444
|
}
|
|
1441
1445
|
if (event.type === "bridge-started") {
|
|
1442
1446
|
const source = isRecord(event.data.source) ? event.data.source : void 0;
|
|
1443
|
-
const chainId = asChainId(_optionalChain([source, 'optionalAccess',
|
|
1444
|
-
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]));
|
|
1445
1449
|
const solanaMeta = chainId === "solana" ? resolveSolanaTokenMeta(token) : {};
|
|
1446
1450
|
return {
|
|
1447
1451
|
chainId,
|
|
1448
|
-
amount: asAmount(_optionalChain([source, 'optionalAccess',
|
|
1452
|
+
amount: asAmount(_optionalChain([source, 'optionalAccess', _31 => _31.amount])),
|
|
1449
1453
|
token,
|
|
1450
1454
|
...solanaMeta
|
|
1451
1455
|
};
|
|
@@ -1458,16 +1462,17 @@ function DepositAddressStep({
|
|
|
1458
1462
|
service,
|
|
1459
1463
|
allowedRoutes,
|
|
1460
1464
|
onDepositDetected,
|
|
1465
|
+
onCopyAddress,
|
|
1461
1466
|
onError
|
|
1462
1467
|
}) {
|
|
1463
1468
|
const hasSolana = Boolean(solanaDepositAddress);
|
|
1464
1469
|
const allowedChainSet = _react.useMemo.call(void 0,
|
|
1465
|
-
() => _optionalChain([allowedRoutes, 'optionalAccess',
|
|
1466
|
-
[_optionalChain([allowedRoutes, 'optionalAccess',
|
|
1470
|
+
() => _optionalChain([allowedRoutes, 'optionalAccess', _32 => _32.sourceChains]) ? new Set(allowedRoutes.sourceChains) : null,
|
|
1471
|
+
[_optionalChain([allowedRoutes, 'optionalAccess', _33 => _33.sourceChains])]
|
|
1467
1472
|
);
|
|
1468
1473
|
const allowedTokenSet = _react.useMemo.call(void 0,
|
|
1469
|
-
() => _optionalChain([allowedRoutes, 'optionalAccess',
|
|
1470
|
-
[_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])]
|
|
1471
1476
|
);
|
|
1472
1477
|
const evmChainIds = _react.useMemo.call(void 0, () => {
|
|
1473
1478
|
const all = _chunkR6U6BHCVcjs.getSupportedChainIds.call(void 0, );
|
|
@@ -1510,9 +1515,9 @@ function DepositAddressStep({
|
|
|
1510
1515
|
const matched = _nullishCoalesce(SOLANA_TOKENS.find((t) => t.symbol === sourceTokenSymbol), () => ( SOLANA_TOKENS[0]));
|
|
1511
1516
|
sourceSelectionRef.current = {
|
|
1512
1517
|
chainId: "solana",
|
|
1513
|
-
token: _optionalChain([matched, 'optionalAccess',
|
|
1514
|
-
sourceSymbol: _optionalChain([matched, 'optionalAccess',
|
|
1515
|
-
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])
|
|
1516
1521
|
};
|
|
1517
1522
|
return;
|
|
1518
1523
|
}
|
|
@@ -1528,8 +1533,8 @@ function DepositAddressStep({
|
|
|
1528
1533
|
function handlePointerDown(event) {
|
|
1529
1534
|
const target = event.target;
|
|
1530
1535
|
if (!target) return;
|
|
1531
|
-
const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access',
|
|
1532
|
-
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)]);
|
|
1533
1538
|
if (clickedChainDropdown || clickedTokenDropdown) return;
|
|
1534
1539
|
setChainDropdownOpen(false);
|
|
1535
1540
|
setTokenDropdownOpen(false);
|
|
@@ -1542,6 +1547,7 @@ function DepositAddressStep({
|
|
|
1542
1547
|
};
|
|
1543
1548
|
}, [chainDropdownOpen, tokenDropdownOpen]);
|
|
1544
1549
|
const handleCopy = _react.useCallback.call(void 0, async () => {
|
|
1550
|
+
_optionalChain([onCopyAddress, 'optionalCall', _45 => _45()]);
|
|
1545
1551
|
try {
|
|
1546
1552
|
await navigator.clipboard.writeText(displayAddress);
|
|
1547
1553
|
setCopied(true);
|
|
@@ -1558,7 +1564,7 @@ function DepositAddressStep({
|
|
|
1558
1564
|
setCopied(true);
|
|
1559
1565
|
setTimeout(() => setCopied(false), 2e3);
|
|
1560
1566
|
}
|
|
1561
|
-
}, [displayAddress]);
|
|
1567
|
+
}, [displayAddress, onCopyAddress]);
|
|
1562
1568
|
_react.useEffect.call(void 0, () => {
|
|
1563
1569
|
setCopied(false);
|
|
1564
1570
|
setChainDropdownOpen(false);
|
|
@@ -1605,7 +1611,7 @@ function DepositAddressStep({
|
|
|
1605
1611
|
if (!cancelled) {
|
|
1606
1612
|
const msg = err instanceof Error ? err.message : "Failed to check status";
|
|
1607
1613
|
setPollingError(msg);
|
|
1608
|
-
_optionalChain([onError, 'optionalCall',
|
|
1614
|
+
_optionalChain([onError, 'optionalCall', _46 => _46(msg, "STATUS_POLL_ERROR")]);
|
|
1609
1615
|
}
|
|
1610
1616
|
}
|
|
1611
1617
|
if (!cancelled && !depositHandledRef.current) {
|
|
@@ -1886,7 +1892,7 @@ function SolanaTokenSelectStep({
|
|
|
1886
1892
|
setTokenBalances(results);
|
|
1887
1893
|
setLoading(false);
|
|
1888
1894
|
const totalUsd = results.reduce((sum, r) => sum + r.balanceUsd, 0);
|
|
1889
|
-
_optionalChain([onTotalBalanceComputed, 'optionalCall',
|
|
1895
|
+
_optionalChain([onTotalBalanceComputed, 'optionalCall', _47 => _47(totalUsd)]);
|
|
1890
1896
|
}
|
|
1891
1897
|
void loadBalances();
|
|
1892
1898
|
return () => {
|
|
@@ -2133,13 +2139,13 @@ function SolanaAmountStep({
|
|
|
2133
2139
|
const sourceAmount = isSourceStablecoin || !hasPricing ? numericAmount : numericAmount / tokenPriceUsd;
|
|
2134
2140
|
if (hasPricing) {
|
|
2135
2141
|
const usdValue = numericAmount;
|
|
2136
|
-
if (_optionalChain([uiConfig, 'optionalAccess',
|
|
2142
|
+
if (_optionalChain([uiConfig, 'optionalAccess', _48 => _48.maxDepositUsd]) && usdValue > uiConfig.maxDepositUsd) {
|
|
2137
2143
|
setError(
|
|
2138
2144
|
`Maximum deposit is ${_chunkTQ6IIGRScjs.currencyFormatter.format(uiConfig.maxDepositUsd)}`
|
|
2139
2145
|
);
|
|
2140
2146
|
return;
|
|
2141
2147
|
}
|
|
2142
|
-
if (_optionalChain([uiConfig, 'optionalAccess',
|
|
2148
|
+
if (_optionalChain([uiConfig, 'optionalAccess', _49 => _49.minDepositUsd]) && usdValue < uiConfig.minDepositUsd) {
|
|
2143
2149
|
setAmount(uiConfig.minDepositUsd.toString());
|
|
2144
2150
|
setError(null);
|
|
2145
2151
|
return;
|
|
@@ -2240,7 +2246,7 @@ function SolanaAmountStep({
|
|
|
2240
2246
|
}
|
|
2241
2247
|
)
|
|
2242
2248
|
] }),
|
|
2243
|
-
_optionalChain([uiConfig, 'optionalAccess',
|
|
2249
|
+
_optionalChain([uiConfig, 'optionalAccess', _50 => _50.minDepositUsd]) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-minimum", children: [
|
|
2244
2250
|
_chunkTQ6IIGRScjs.currencyFormatter.format(uiConfig.minDepositUsd),
|
|
2245
2251
|
" minimum deposit"
|
|
2246
2252
|
] }),
|
|
@@ -2272,7 +2278,7 @@ function SolanaAmountStep({
|
|
|
2272
2278
|
onClick: handleContinue,
|
|
2273
2279
|
fullWidth: true,
|
|
2274
2280
|
disabled: !amount,
|
|
2275
|
-
children: _optionalChain([uiConfig, 'optionalAccess',
|
|
2281
|
+
children: _optionalChain([uiConfig, 'optionalAccess', _51 => _51.minDepositUsd]) && parseFloat(amount) > 0 && parseFloat(amount) < uiConfig.minDepositUsd ? "Update order" : "Continue"
|
|
2276
2282
|
}
|
|
2277
2283
|
) }),
|
|
2278
2284
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkTQ6IIGRScjs.PoweredBy, {})
|
|
@@ -2379,7 +2385,7 @@ function SolanaConfirmStep({
|
|
|
2379
2385
|
_chunkTQ6IIGRScjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
2380
2386
|
token: token.symbol,
|
|
2381
2387
|
instructionCount: transaction.instructions.length,
|
|
2382
|
-
feePayer: _optionalChain([transaction, 'access',
|
|
2388
|
+
feePayer: _optionalChain([transaction, 'access', _52 => _52.feePayer, 'optionalAccess', _53 => _53.toBase58, 'call', _54 => _54()]),
|
|
2383
2389
|
recentBlockhash: transaction.recentBlockhash
|
|
2384
2390
|
});
|
|
2385
2391
|
const txHash = await sendSolanaTransaction(
|
|
@@ -2401,7 +2407,7 @@ function SolanaConfirmStep({
|
|
|
2401
2407
|
sourceAmount
|
|
2402
2408
|
});
|
|
2403
2409
|
setError(message);
|
|
2404
|
-
_optionalChain([onError, 'optionalCall',
|
|
2410
|
+
_optionalChain([onError, 'optionalCall', _55 => _55(message, "SOLANA_TRANSFER_ERROR")]);
|
|
2405
2411
|
} finally {
|
|
2406
2412
|
setIsSubmitting(false);
|
|
2407
2413
|
}
|
|
@@ -2582,11 +2588,12 @@ function DepositFlow({
|
|
|
2582
2588
|
onDepositSubmitted,
|
|
2583
2589
|
onDepositComplete,
|
|
2584
2590
|
onDepositFailed,
|
|
2591
|
+
onEvent,
|
|
2585
2592
|
onError,
|
|
2586
2593
|
debug
|
|
2587
2594
|
}) {
|
|
2588
2595
|
const hasInitialReownSession = Boolean(
|
|
2589
|
-
enableSolana ? _optionalChain([reownWallet, 'optionalAccess',
|
|
2596
|
+
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _56 => _56.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _57 => _57.address]) : _optionalChain([reownWallet, 'optionalAccess', _58 => _58.address])
|
|
2590
2597
|
);
|
|
2591
2598
|
const hasInitialWalletHydrationPending = Boolean(
|
|
2592
2599
|
dappAddress && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasInitialReownSession && !reownWallet.isReady)
|
|
@@ -2631,12 +2638,12 @@ function DepositFlow({
|
|
|
2631
2638
|
return null;
|
|
2632
2639
|
}, []);
|
|
2633
2640
|
const dappSwitchChain = _react.useMemo.call(void 0, () => {
|
|
2634
|
-
if (!_optionalChain([dappWalletClient, 'optionalAccess',
|
|
2641
|
+
if (!_optionalChain([dappWalletClient, 'optionalAccess', _59 => _59.switchChain])) return void 0;
|
|
2635
2642
|
return async (chainId) => {
|
|
2636
|
-
await _optionalChain([dappWalletClient, 'access',
|
|
2643
|
+
await _optionalChain([dappWalletClient, 'access', _60 => _60.switchChain, 'optionalCall', _61 => _61({ id: chainId })]);
|
|
2637
2644
|
};
|
|
2638
2645
|
}, [dappWalletClient]);
|
|
2639
|
-
const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
2646
|
+
const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _62 => _62.account, 'optionalAccess', _63 => _63.address]), () => ( null));
|
|
2640
2647
|
const walletOptions = _react.useMemo.call(void 0, () => {
|
|
2641
2648
|
const options = [];
|
|
2642
2649
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -2650,7 +2657,7 @@ function DepositFlow({
|
|
|
2650
2657
|
});
|
|
2651
2658
|
seen.add(id);
|
|
2652
2659
|
}
|
|
2653
|
-
if (enableSolana && _optionalChain([reownWallet, 'optionalAccess',
|
|
2660
|
+
if (enableSolana && _optionalChain([reownWallet, 'optionalAccess', _64 => _64.isConnected]) && reownWallet.isSolana && reownWallet.solanaAddress && dappAddress) {
|
|
2654
2661
|
const id = _nullishCoalesce(reownWallet.caipAddress, () => ( `solana:${reownWallet.solanaAddress}`));
|
|
2655
2662
|
if (!seen.has(id)) {
|
|
2656
2663
|
options.push({
|
|
@@ -2662,7 +2669,7 @@ function DepositFlow({
|
|
|
2662
2669
|
});
|
|
2663
2670
|
seen.add(id);
|
|
2664
2671
|
}
|
|
2665
|
-
} 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()}`)) {
|
|
2666
2673
|
const id = `evm:${reownWallet.address.toLowerCase()}`;
|
|
2667
2674
|
if (!seen.has(id)) {
|
|
2668
2675
|
options.push({
|
|
@@ -2679,20 +2686,20 @@ function DepositFlow({
|
|
|
2679
2686
|
}, [
|
|
2680
2687
|
connectedWalletAddress,
|
|
2681
2688
|
dappAddress,
|
|
2682
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2683
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2684
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2685
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2686
|
-
_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]),
|
|
2687
2694
|
enableSolana,
|
|
2688
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2689
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2690
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
2695
|
+
_optionalChain([reownWallet, 'optionalAccess', _71 => _71.isSolana]),
|
|
2696
|
+
_optionalChain([reownWallet, 'optionalAccess', _72 => _72.solanaAddress]),
|
|
2697
|
+
_optionalChain([reownWallet, 'optionalAccess', _73 => _73.caipAddress])
|
|
2691
2698
|
]);
|
|
2692
|
-
const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess',
|
|
2699
|
+
const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess', _74 => _74.account]) && dappAddress && !reownWallet;
|
|
2693
2700
|
const hasWalletOptions = walletOptions.length > 0;
|
|
2694
2701
|
const hasReownSession = Boolean(
|
|
2695
|
-
enableSolana ? _optionalChain([reownWallet, 'optionalAccess',
|
|
2702
|
+
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _75 => _75.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _76 => _76.address]) : _optionalChain([reownWallet, 'optionalAccess', _77 => _77.address])
|
|
2696
2703
|
);
|
|
2697
2704
|
const isWalletHydrationPending = Boolean(
|
|
2698
2705
|
dappAddress && !hasWalletOptions && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasReownSession && !reownWallet.isReady)
|
|
@@ -2737,7 +2744,7 @@ function DepositFlow({
|
|
|
2737
2744
|
};
|
|
2738
2745
|
}
|
|
2739
2746
|
if (canAutoLock) {
|
|
2740
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
2747
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _78 => _78.chain, 'optionalAccess', _79 => _79.id]), () => ( targetChain));
|
|
2741
2748
|
return {
|
|
2742
2749
|
ownerAddress: dappWalletClient.account.address,
|
|
2743
2750
|
walletClient: dappWalletClient,
|
|
@@ -2759,8 +2766,8 @@ function DepositFlow({
|
|
|
2759
2766
|
switchChain: void 0
|
|
2760
2767
|
};
|
|
2761
2768
|
}
|
|
2762
|
-
if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess',
|
|
2763
|
-
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));
|
|
2764
2771
|
return {
|
|
2765
2772
|
ownerAddress: dappWalletClient.account.address,
|
|
2766
2773
|
walletClient: dappWalletClient,
|
|
@@ -2768,7 +2775,7 @@ function DepositFlow({
|
|
|
2768
2775
|
switchChain: dappSwitchChain
|
|
2769
2776
|
};
|
|
2770
2777
|
}
|
|
2771
|
-
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()) {
|
|
2772
2779
|
return {
|
|
2773
2780
|
ownerAddress: reownWallet.address,
|
|
2774
2781
|
walletClient: reownWallet.walletClient,
|
|
@@ -2832,7 +2839,7 @@ function DepositFlow({
|
|
|
2832
2839
|
walletSignerContext,
|
|
2833
2840
|
walletSelectionKey
|
|
2834
2841
|
]);
|
|
2835
|
-
const sessionKeyAddress = _nullishCoalesce(_nullishCoalesce(dappAddress, () => ( _optionalChain([signerContext, 'optionalAccess',
|
|
2842
|
+
const sessionKeyAddress = _nullishCoalesce(_nullishCoalesce(dappAddress, () => ( _optionalChain([signerContext, 'optionalAccess', _84 => _84.ownerAddress]))), () => ( null));
|
|
2836
2843
|
const lastTargetRef = _react.useRef.call(void 0, null);
|
|
2837
2844
|
_react.useEffect.call(void 0, () => {
|
|
2838
2845
|
const prev = lastTargetRef.current;
|
|
@@ -2909,8 +2916,34 @@ function DepositFlow({
|
|
|
2909
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;
|
|
2910
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;
|
|
2911
2918
|
_react.useEffect.call(void 0, () => {
|
|
2912
|
-
_optionalChain([onStepChange, 'optionalCall',
|
|
2919
|
+
_optionalChain([onStepChange, 'optionalCall', _85 => _85(stepIndex, currentBackHandler)]);
|
|
2913
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]);
|
|
2914
2947
|
_react.useEffect.call(void 0, () => {
|
|
2915
2948
|
logFlow("state:changed", {
|
|
2916
2949
|
step: step.type,
|
|
@@ -2928,7 +2961,7 @@ function DepositFlow({
|
|
|
2928
2961
|
targetToken
|
|
2929
2962
|
]);
|
|
2930
2963
|
_react.useEffect.call(void 0, () => {
|
|
2931
|
-
_optionalChain([onTotalBalanceChange, 'optionalCall',
|
|
2964
|
+
_optionalChain([onTotalBalanceChange, 'optionalCall', _89 => _89(totalBalanceUsd)]);
|
|
2932
2965
|
}, [totalBalanceUsd, onTotalBalanceChange]);
|
|
2933
2966
|
const isDepositAddressMode = flowMode === "deposit-address";
|
|
2934
2967
|
const isSolanaWalletMode = flowMode === "solana-wallet";
|
|
@@ -2970,7 +3003,7 @@ function DepositFlow({
|
|
|
2970
3003
|
solanaDepositAddress
|
|
2971
3004
|
});
|
|
2972
3005
|
} else {
|
|
2973
|
-
_optionalChain([onError, 'optionalCall',
|
|
3006
|
+
_optionalChain([onError, 'optionalCall', _90 => _90({
|
|
2974
3007
|
message: "Solana deposit address not available. Please try again.",
|
|
2975
3008
|
code: "SOLANA_SETUP_FAILED"
|
|
2976
3009
|
})]);
|
|
@@ -3005,7 +3038,7 @@ function DepositFlow({
|
|
|
3005
3038
|
directTransfer
|
|
3006
3039
|
};
|
|
3007
3040
|
});
|
|
3008
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
3041
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _91 => _91({ txHash, sourceChain: chainId, amount })]);
|
|
3009
3042
|
},
|
|
3010
3043
|
[onDepositSubmitted, targetChain, targetToken]
|
|
3011
3044
|
);
|
|
@@ -3077,7 +3110,7 @@ function DepositFlow({
|
|
|
3077
3110
|
sourceDecimals: prev.token.decimals
|
|
3078
3111
|
};
|
|
3079
3112
|
});
|
|
3080
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
3113
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _92 => _92({
|
|
3081
3114
|
txHash,
|
|
3082
3115
|
sourceChain: "solana",
|
|
3083
3116
|
amount: amountUnits
|
|
@@ -3087,12 +3120,20 @@ function DepositFlow({
|
|
|
3087
3120
|
);
|
|
3088
3121
|
const handleConnected = _react.useCallback.call(void 0,
|
|
3089
3122
|
(addr, smartAccount) => {
|
|
3090
|
-
_optionalChain([onConnected, 'optionalCall',
|
|
3123
|
+
_optionalChain([onConnected, 'optionalCall', _93 => _93({ address: addr, smartAccount })]);
|
|
3091
3124
|
},
|
|
3092
3125
|
[onConnected]
|
|
3093
3126
|
);
|
|
3094
3127
|
const handleAssetContinue = _react.useCallback.call(void 0,
|
|
3095
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
|
+
})]);
|
|
3096
3137
|
setStep((prev) => {
|
|
3097
3138
|
if (prev.type !== "select-asset") return prev;
|
|
3098
3139
|
return {
|
|
@@ -3103,7 +3144,7 @@ function DepositFlow({
|
|
|
3103
3144
|
};
|
|
3104
3145
|
});
|
|
3105
3146
|
},
|
|
3106
|
-
[defaultAmount]
|
|
3147
|
+
[defaultAmount, onEvent, totalBalanceUsd]
|
|
3107
3148
|
);
|
|
3108
3149
|
const handleAmountContinue = _react.useCallback.call(void 0,
|
|
3109
3150
|
(amount, targetAmount, balance) => {
|
|
@@ -3150,28 +3191,28 @@ function DepositFlow({
|
|
|
3150
3191
|
);
|
|
3151
3192
|
const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
|
|
3152
3193
|
(txHash, sourceChain, amount) => {
|
|
3153
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
3194
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _95 => _95({ txHash, sourceChain, amount })]);
|
|
3154
3195
|
},
|
|
3155
3196
|
[onDepositSubmitted]
|
|
3156
3197
|
);
|
|
3157
3198
|
const handleDepositComplete = _react.useCallback.call(void 0,
|
|
3158
3199
|
(txHash, destinationTxHash, context) => {
|
|
3159
3200
|
logFlow("deposit:complete", { txHash, destinationTxHash, ...context });
|
|
3160
|
-
_optionalChain([onDepositComplete, 'optionalCall',
|
|
3201
|
+
_optionalChain([onDepositComplete, 'optionalCall', _96 => _96({ txHash, destinationTxHash, ...context })]);
|
|
3161
3202
|
},
|
|
3162
3203
|
[logFlow, onDepositComplete]
|
|
3163
3204
|
);
|
|
3164
3205
|
const handleDepositFailed = _react.useCallback.call(void 0,
|
|
3165
3206
|
(txHash, error) => {
|
|
3166
3207
|
logFlowError("deposit:failed", error, { txHash });
|
|
3167
|
-
_optionalChain([onDepositFailed, 'optionalCall',
|
|
3208
|
+
_optionalChain([onDepositFailed, 'optionalCall', _97 => _97({ txHash, error })]);
|
|
3168
3209
|
},
|
|
3169
3210
|
[logFlowError, onDepositFailed]
|
|
3170
3211
|
);
|
|
3171
3212
|
const handleError = _react.useCallback.call(void 0,
|
|
3172
3213
|
(message, code) => {
|
|
3173
3214
|
logFlowError("flow:error", message, { code });
|
|
3174
|
-
_optionalChain([onError, 'optionalCall',
|
|
3215
|
+
_optionalChain([onError, 'optionalCall', _98 => _98({ message, code })]);
|
|
3175
3216
|
},
|
|
3176
3217
|
[logFlowError, onError]
|
|
3177
3218
|
);
|
|
@@ -3228,7 +3269,7 @@ function DepositFlow({
|
|
|
3228
3269
|
if (walletId) {
|
|
3229
3270
|
const selectedOption = walletOptions.find((o) => o.id === walletId);
|
|
3230
3271
|
setSelectedWalletId(walletId);
|
|
3231
|
-
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess',
|
|
3272
|
+
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess', _99 => _99.kind]) === "solana") {
|
|
3232
3273
|
handleSelectSolanaWallet();
|
|
3233
3274
|
} else {
|
|
3234
3275
|
handleSelectProvider();
|
|
@@ -3277,7 +3318,7 @@ function DepositFlow({
|
|
|
3277
3318
|
const selectedOption = walletOptions.find(
|
|
3278
3319
|
(o) => o.id === selectedWalletIdEffective
|
|
3279
3320
|
);
|
|
3280
|
-
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess',
|
|
3321
|
+
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess', _100 => _100.kind]) === "solana") {
|
|
3281
3322
|
handleSelectSolanaWallet();
|
|
3282
3323
|
} else {
|
|
3283
3324
|
handleSelectProvider();
|
|
@@ -3317,6 +3358,17 @@ function DepositFlow({
|
|
|
3317
3358
|
service,
|
|
3318
3359
|
allowedRoutes,
|
|
3319
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
|
+
},
|
|
3320
3372
|
onError: handleError
|
|
3321
3373
|
}
|
|
3322
3374
|
),
|
|
@@ -3347,8 +3399,8 @@ function DepositFlow({
|
|
|
3347
3399
|
}
|
|
3348
3400
|
if (isSolanaWalletMode) {
|
|
3349
3401
|
if (!sessionKeyAddress) return null;
|
|
3350
|
-
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess',
|
|
3351
|
-
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess',
|
|
3402
|
+
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess', _102 => _102.solanaAddress]);
|
|
3403
|
+
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess', _103 => _103.solanaProvider]);
|
|
3352
3404
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
3353
3405
|
step.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3354
3406
|
SetupStep,
|
|
@@ -3468,13 +3520,13 @@ function DepositFlow({
|
|
|
3468
3520
|
)
|
|
3469
3521
|
] });
|
|
3470
3522
|
}
|
|
3471
|
-
if (!_optionalChain([signerContext, 'optionalAccess',
|
|
3523
|
+
if (!_optionalChain([signerContext, 'optionalAccess', _104 => _104.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _105 => _105.publicClient])) {
|
|
3472
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..." }) }) }) }) });
|
|
3473
3525
|
}
|
|
3474
3526
|
const ownerAddress = signerContext.ownerAddress;
|
|
3475
|
-
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));
|
|
3476
3528
|
const getReadClientForChain = (chainId) => {
|
|
3477
|
-
if (_optionalChain([signerContext, 'access',
|
|
3529
|
+
if (_optionalChain([signerContext, 'access', _112 => _112.publicClient, 'access', _113 => _113.chain, 'optionalAccess', _114 => _114.id]) === chainId) {
|
|
3478
3530
|
return signerContext.publicClient;
|
|
3479
3531
|
}
|
|
3480
3532
|
return _chunkTQ6IIGRScjs.getPublicClient.call(void 0, chainId);
|
|
@@ -3525,7 +3577,17 @@ function DepositFlow({
|
|
|
3525
3577
|
targetChain,
|
|
3526
3578
|
targetToken,
|
|
3527
3579
|
uiConfig,
|
|
3528
|
-
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
|
+
}
|
|
3529
3591
|
}
|
|
3530
3592
|
),
|
|
3531
3593
|
step.type === "confirm" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3577,7 +3639,7 @@ function DepositFlow({
|
|
|
3577
3639
|
// src/DepositModal.tsx
|
|
3578
3640
|
|
|
3579
3641
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
3580
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
3642
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-VP5E2JRC.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
3581
3643
|
);
|
|
3582
3644
|
function DepositModal(props) {
|
|
3583
3645
|
const needsReown = !!props.reownAppId;
|
|
@@ -3641,6 +3703,7 @@ function DepositModalInner({
|
|
|
3641
3703
|
onDepositSubmitted,
|
|
3642
3704
|
onDepositComplete,
|
|
3643
3705
|
onDepositFailed,
|
|
3706
|
+
onEvent,
|
|
3644
3707
|
onError,
|
|
3645
3708
|
debug
|
|
3646
3709
|
}) {
|
|
@@ -3669,7 +3732,7 @@ function DepositModalInner({
|
|
|
3669
3732
|
_react.useEffect.call(void 0, () => {
|
|
3670
3733
|
if (isOpen && !hasCalledReady.current) {
|
|
3671
3734
|
hasCalledReady.current = true;
|
|
3672
|
-
_optionalChain([onReady, 'optionalCall',
|
|
3735
|
+
_optionalChain([onReady, 'optionalCall', _116 => _116()]);
|
|
3673
3736
|
}
|
|
3674
3737
|
}, [isOpen, onReady]);
|
|
3675
3738
|
_react.useEffect.call(void 0, () => {
|
|
@@ -3688,14 +3751,14 @@ function DepositModalInner({
|
|
|
3688
3751
|
setTotalBalanceUsd(balance2);
|
|
3689
3752
|
}, []);
|
|
3690
3753
|
const handleBack = _react.useCallback.call(void 0, () => {
|
|
3691
|
-
_optionalChain([backHandlerRef, 'access',
|
|
3754
|
+
_optionalChain([backHandlerRef, 'access', _117 => _117.current, 'optionalCall', _118 => _118()]);
|
|
3692
3755
|
}, []);
|
|
3693
|
-
const showLogo = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3694
|
-
const showStepper = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3695
|
-
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
3696
|
-
const balance = _optionalChain([uiConfig, 'optionalAccess',
|
|
3697
|
-
const logoUrl = _nullishCoalesce(_optionalChain([branding, 'optionalAccess',
|
|
3698
|
-
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"));
|
|
3699
3762
|
const canGoBack = currentStepIndex > 0 && currentStepIndex < 4 && backHandlerRef.current !== void 0;
|
|
3700
3763
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3701
3764
|
_chunkTQ6IIGRScjs.Modal,
|
|
@@ -3855,6 +3918,7 @@ function DepositModalInner({
|
|
|
3855
3918
|
onDepositSubmitted,
|
|
3856
3919
|
onDepositComplete,
|
|
3857
3920
|
onDepositFailed,
|
|
3921
|
+
onEvent,
|
|
3858
3922
|
onError,
|
|
3859
3923
|
debug
|
|
3860
3924
|
}
|