@rhinestone/deposit-modal 0.1.59 → 0.1.61
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-727JVH7Q.mjs} +1 -1
- package/dist/{DepositModalReown-DPCGEQT5.cjs → DepositModalReown-BKMRNZNX.cjs} +2 -2
- package/dist/{WithdrawModalReown-PFGUPZFN.mjs → WithdrawModalReown-OHTYDGI5.mjs} +1 -1
- package/dist/{WithdrawModalReown-TUBSUJQ6.cjs → WithdrawModalReown-ZNQPXAS6.cjs} +2 -2
- package/dist/{chunk-3FEFGN7H.cjs → chunk-C5TWF4ZE.cjs} +56 -29
- package/dist/{chunk-E4YPPHZF.mjs → chunk-IKTHUMGZ.mjs} +70 -5
- package/dist/{chunk-3ESBSOB7.mjs → chunk-RRYC5EZF.mjs} +29 -2
- package/dist/{chunk-M4QDXLIN.cjs → chunk-TBUOMWKJ.cjs} +145 -80
- 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,35 @@ 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
|
+
const stepSendToken = step.type === "amount" ? step.asset.symbol : null;
|
|
2922
|
+
_react.useEffect.call(void 0, () => {
|
|
2923
|
+
if (step.type === "select-asset") {
|
|
2924
|
+
_optionalChain([onEvent, 'optionalCall', _86 => _86({
|
|
2925
|
+
type: "deposit_modal_connected_wallet_select_source_open",
|
|
2926
|
+
total_balance_in_external_wallet: totalBalanceUsd,
|
|
2927
|
+
pred_balance: totalBalanceUsd
|
|
2928
|
+
})]);
|
|
2929
|
+
} else if (step.type === "deposit-address") {
|
|
2930
|
+
const chainName = _chunkR6U6BHCVcjs.getChainName.call(void 0, targetChain);
|
|
2931
|
+
const tokenSymbol = _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
2932
|
+
_optionalChain([onEvent, 'optionalCall', _87 => _87({
|
|
2933
|
+
type: "deposit_modal_transfer_crypto_open",
|
|
2934
|
+
default_chain: chainName,
|
|
2935
|
+
default_token: tokenSymbol,
|
|
2936
|
+
pred_balance: totalBalanceUsd
|
|
2937
|
+
})]);
|
|
2938
|
+
} else if (step.type === "amount" && stepSendToken) {
|
|
2939
|
+
const receiveSymbol = _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
2940
|
+
_optionalChain([onEvent, 'optionalCall', _88 => _88({
|
|
2941
|
+
type: "deposit_modal_connected_wallet_enter_value_open",
|
|
2942
|
+
send_token: stepSendToken,
|
|
2943
|
+
receive_token: receiveSymbol,
|
|
2944
|
+
pred_balance: totalBalanceUsd
|
|
2945
|
+
})]);
|
|
2946
|
+
}
|
|
2947
|
+
}, [step.type, stepSendToken, onEvent]);
|
|
2914
2948
|
_react.useEffect.call(void 0, () => {
|
|
2915
2949
|
logFlow("state:changed", {
|
|
2916
2950
|
step: step.type,
|
|
@@ -2928,7 +2962,7 @@ function DepositFlow({
|
|
|
2928
2962
|
targetToken
|
|
2929
2963
|
]);
|
|
2930
2964
|
_react.useEffect.call(void 0, () => {
|
|
2931
|
-
_optionalChain([onTotalBalanceChange, 'optionalCall',
|
|
2965
|
+
_optionalChain([onTotalBalanceChange, 'optionalCall', _89 => _89(totalBalanceUsd)]);
|
|
2932
2966
|
}, [totalBalanceUsd, onTotalBalanceChange]);
|
|
2933
2967
|
const isDepositAddressMode = flowMode === "deposit-address";
|
|
2934
2968
|
const isSolanaWalletMode = flowMode === "solana-wallet";
|
|
@@ -2970,7 +3004,7 @@ function DepositFlow({
|
|
|
2970
3004
|
solanaDepositAddress
|
|
2971
3005
|
});
|
|
2972
3006
|
} else {
|
|
2973
|
-
_optionalChain([onError, 'optionalCall',
|
|
3007
|
+
_optionalChain([onError, 'optionalCall', _90 => _90({
|
|
2974
3008
|
message: "Solana deposit address not available. Please try again.",
|
|
2975
3009
|
code: "SOLANA_SETUP_FAILED"
|
|
2976
3010
|
})]);
|
|
@@ -3005,7 +3039,7 @@ function DepositFlow({
|
|
|
3005
3039
|
directTransfer
|
|
3006
3040
|
};
|
|
3007
3041
|
});
|
|
3008
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
3042
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _91 => _91({ txHash, sourceChain: chainId, amount })]);
|
|
3009
3043
|
},
|
|
3010
3044
|
[onDepositSubmitted, targetChain, targetToken]
|
|
3011
3045
|
);
|
|
@@ -3077,7 +3111,7 @@ function DepositFlow({
|
|
|
3077
3111
|
sourceDecimals: prev.token.decimals
|
|
3078
3112
|
};
|
|
3079
3113
|
});
|
|
3080
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
3114
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _92 => _92({
|
|
3081
3115
|
txHash,
|
|
3082
3116
|
sourceChain: "solana",
|
|
3083
3117
|
amount: amountUnits
|
|
@@ -3087,12 +3121,20 @@ function DepositFlow({
|
|
|
3087
3121
|
);
|
|
3088
3122
|
const handleConnected = _react.useCallback.call(void 0,
|
|
3089
3123
|
(addr, smartAccount) => {
|
|
3090
|
-
_optionalChain([onConnected, 'optionalCall',
|
|
3124
|
+
_optionalChain([onConnected, 'optionalCall', _93 => _93({ address: addr, smartAccount })]);
|
|
3091
3125
|
},
|
|
3092
3126
|
[onConnected]
|
|
3093
3127
|
);
|
|
3094
3128
|
const handleAssetContinue = _react.useCallback.call(void 0,
|
|
3095
3129
|
(asset) => {
|
|
3130
|
+
_optionalChain([onEvent, 'optionalCall', _94 => _94({
|
|
3131
|
+
type: "deposit_modal_connected_wallet_select_source_cta_click",
|
|
3132
|
+
total_balance_in_external_wallet: totalBalanceUsd,
|
|
3133
|
+
pred_balance: totalBalanceUsd,
|
|
3134
|
+
cta_name: "token_selected",
|
|
3135
|
+
token_name: asset.symbol,
|
|
3136
|
+
token_balance: _nullishCoalesce(asset.balance, () => ( "0"))
|
|
3137
|
+
})]);
|
|
3096
3138
|
setStep((prev) => {
|
|
3097
3139
|
if (prev.type !== "select-asset") return prev;
|
|
3098
3140
|
return {
|
|
@@ -3103,7 +3145,7 @@ function DepositFlow({
|
|
|
3103
3145
|
};
|
|
3104
3146
|
});
|
|
3105
3147
|
},
|
|
3106
|
-
[defaultAmount]
|
|
3148
|
+
[defaultAmount, onEvent, totalBalanceUsd]
|
|
3107
3149
|
);
|
|
3108
3150
|
const handleAmountContinue = _react.useCallback.call(void 0,
|
|
3109
3151
|
(amount, targetAmount, balance) => {
|
|
@@ -3150,28 +3192,28 @@ function DepositFlow({
|
|
|
3150
3192
|
);
|
|
3151
3193
|
const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
|
|
3152
3194
|
(txHash, sourceChain, amount) => {
|
|
3153
|
-
_optionalChain([onDepositSubmitted, 'optionalCall',
|
|
3195
|
+
_optionalChain([onDepositSubmitted, 'optionalCall', _95 => _95({ txHash, sourceChain, amount })]);
|
|
3154
3196
|
},
|
|
3155
3197
|
[onDepositSubmitted]
|
|
3156
3198
|
);
|
|
3157
3199
|
const handleDepositComplete = _react.useCallback.call(void 0,
|
|
3158
3200
|
(txHash, destinationTxHash, context) => {
|
|
3159
3201
|
logFlow("deposit:complete", { txHash, destinationTxHash, ...context });
|
|
3160
|
-
_optionalChain([onDepositComplete, 'optionalCall',
|
|
3202
|
+
_optionalChain([onDepositComplete, 'optionalCall', _96 => _96({ txHash, destinationTxHash, ...context })]);
|
|
3161
3203
|
},
|
|
3162
3204
|
[logFlow, onDepositComplete]
|
|
3163
3205
|
);
|
|
3164
3206
|
const handleDepositFailed = _react.useCallback.call(void 0,
|
|
3165
3207
|
(txHash, error) => {
|
|
3166
3208
|
logFlowError("deposit:failed", error, { txHash });
|
|
3167
|
-
_optionalChain([onDepositFailed, 'optionalCall',
|
|
3209
|
+
_optionalChain([onDepositFailed, 'optionalCall', _97 => _97({ txHash, error })]);
|
|
3168
3210
|
},
|
|
3169
3211
|
[logFlowError, onDepositFailed]
|
|
3170
3212
|
);
|
|
3171
3213
|
const handleError = _react.useCallback.call(void 0,
|
|
3172
3214
|
(message, code) => {
|
|
3173
3215
|
logFlowError("flow:error", message, { code });
|
|
3174
|
-
_optionalChain([onError, 'optionalCall',
|
|
3216
|
+
_optionalChain([onError, 'optionalCall', _98 => _98({ message, code })]);
|
|
3175
3217
|
},
|
|
3176
3218
|
[logFlowError, onError]
|
|
3177
3219
|
);
|
|
@@ -3228,7 +3270,7 @@ function DepositFlow({
|
|
|
3228
3270
|
if (walletId) {
|
|
3229
3271
|
const selectedOption = walletOptions.find((o) => o.id === walletId);
|
|
3230
3272
|
setSelectedWalletId(walletId);
|
|
3231
|
-
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess',
|
|
3273
|
+
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess', _99 => _99.kind]) === "solana") {
|
|
3232
3274
|
handleSelectSolanaWallet();
|
|
3233
3275
|
} else {
|
|
3234
3276
|
handleSelectProvider();
|
|
@@ -3277,7 +3319,7 @@ function DepositFlow({
|
|
|
3277
3319
|
const selectedOption = walletOptions.find(
|
|
3278
3320
|
(o) => o.id === selectedWalletIdEffective
|
|
3279
3321
|
);
|
|
3280
|
-
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess',
|
|
3322
|
+
if (enableSolana && _optionalChain([selectedOption, 'optionalAccess', _100 => _100.kind]) === "solana") {
|
|
3281
3323
|
handleSelectSolanaWallet();
|
|
3282
3324
|
} else {
|
|
3283
3325
|
handleSelectProvider();
|
|
@@ -3317,6 +3359,17 @@ function DepositFlow({
|
|
|
3317
3359
|
service,
|
|
3318
3360
|
allowedRoutes,
|
|
3319
3361
|
onDepositDetected: handleDepositAddressDetected,
|
|
3362
|
+
onCopyAddress: () => {
|
|
3363
|
+
const chainName = _chunkR6U6BHCVcjs.getChainName.call(void 0, targetChain);
|
|
3364
|
+
const tokenSymbol = _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3365
|
+
_optionalChain([onEvent, 'optionalCall', _101 => _101({
|
|
3366
|
+
type: "deposit_modal_transfer_crypto_cta_click",
|
|
3367
|
+
default_chain: chainName,
|
|
3368
|
+
default_token: tokenSymbol,
|
|
3369
|
+
pred_balance: totalBalanceUsd,
|
|
3370
|
+
cta_name: "copy"
|
|
3371
|
+
})]);
|
|
3372
|
+
},
|
|
3320
3373
|
onError: handleError
|
|
3321
3374
|
}
|
|
3322
3375
|
),
|
|
@@ -3347,8 +3400,8 @@ function DepositFlow({
|
|
|
3347
3400
|
}
|
|
3348
3401
|
if (isSolanaWalletMode) {
|
|
3349
3402
|
if (!sessionKeyAddress) return null;
|
|
3350
|
-
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess',
|
|
3351
|
-
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess',
|
|
3403
|
+
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess', _102 => _102.solanaAddress]);
|
|
3404
|
+
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess', _103 => _103.solanaProvider]);
|
|
3352
3405
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
3353
3406
|
step.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3354
3407
|
SetupStep,
|
|
@@ -3468,13 +3521,13 @@ function DepositFlow({
|
|
|
3468
3521
|
)
|
|
3469
3522
|
] });
|
|
3470
3523
|
}
|
|
3471
|
-
if (!_optionalChain([signerContext, 'optionalAccess',
|
|
3524
|
+
if (!_optionalChain([signerContext, 'optionalAccess', _104 => _104.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _105 => _105.publicClient])) {
|
|
3472
3525
|
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
3526
|
}
|
|
3474
3527
|
const ownerAddress = signerContext.ownerAddress;
|
|
3475
|
-
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access',
|
|
3528
|
+
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
3529
|
const getReadClientForChain = (chainId) => {
|
|
3477
|
-
if (_optionalChain([signerContext, 'access',
|
|
3530
|
+
if (_optionalChain([signerContext, 'access', _112 => _112.publicClient, 'access', _113 => _113.chain, 'optionalAccess', _114 => _114.id]) === chainId) {
|
|
3478
3531
|
return signerContext.publicClient;
|
|
3479
3532
|
}
|
|
3480
3533
|
return _chunkTQ6IIGRScjs.getPublicClient.call(void 0, chainId);
|
|
@@ -3525,7 +3578,17 @@ function DepositFlow({
|
|
|
3525
3578
|
targetChain,
|
|
3526
3579
|
targetToken,
|
|
3527
3580
|
uiConfig,
|
|
3528
|
-
onContinue: handleAmountContinue
|
|
3581
|
+
onContinue: handleAmountContinue,
|
|
3582
|
+
onCtaClick: (ctaName) => {
|
|
3583
|
+
const receiveSymbol = _chunkR6U6BHCVcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
|
|
3584
|
+
_optionalChain([onEvent, 'optionalCall', _115 => _115({
|
|
3585
|
+
type: "deposit_modal_connected_wallet_enter_value_cta_click",
|
|
3586
|
+
send_token: step.asset.symbol,
|
|
3587
|
+
receive_token: receiveSymbol,
|
|
3588
|
+
pred_balance: totalBalanceUsd,
|
|
3589
|
+
cta_name: ctaName
|
|
3590
|
+
})]);
|
|
3591
|
+
}
|
|
3529
3592
|
}
|
|
3530
3593
|
),
|
|
3531
3594
|
step.type === "confirm" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3577,7 +3640,7 @@ function DepositFlow({
|
|
|
3577
3640
|
// src/DepositModal.tsx
|
|
3578
3641
|
|
|
3579
3642
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
3580
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
3643
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-BKMRNZNX.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
3581
3644
|
);
|
|
3582
3645
|
function DepositModal(props) {
|
|
3583
3646
|
const needsReown = !!props.reownAppId;
|
|
@@ -3641,6 +3704,7 @@ function DepositModalInner({
|
|
|
3641
3704
|
onDepositSubmitted,
|
|
3642
3705
|
onDepositComplete,
|
|
3643
3706
|
onDepositFailed,
|
|
3707
|
+
onEvent,
|
|
3644
3708
|
onError,
|
|
3645
3709
|
debug
|
|
3646
3710
|
}) {
|
|
@@ -3669,7 +3733,7 @@ function DepositModalInner({
|
|
|
3669
3733
|
_react.useEffect.call(void 0, () => {
|
|
3670
3734
|
if (isOpen && !hasCalledReady.current) {
|
|
3671
3735
|
hasCalledReady.current = true;
|
|
3672
|
-
_optionalChain([onReady, 'optionalCall',
|
|
3736
|
+
_optionalChain([onReady, 'optionalCall', _116 => _116()]);
|
|
3673
3737
|
}
|
|
3674
3738
|
}, [isOpen, onReady]);
|
|
3675
3739
|
_react.useEffect.call(void 0, () => {
|
|
@@ -3688,14 +3752,14 @@ function DepositModalInner({
|
|
|
3688
3752
|
setTotalBalanceUsd(balance2);
|
|
3689
3753
|
}, []);
|
|
3690
3754
|
const handleBack = _react.useCallback.call(void 0, () => {
|
|
3691
|
-
_optionalChain([backHandlerRef, 'access',
|
|
3755
|
+
_optionalChain([backHandlerRef, 'access', _117 => _117.current, 'optionalCall', _118 => _118()]);
|
|
3692
3756
|
}, []);
|
|
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',
|
|
3757
|
+
const showLogo = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _119 => _119.showLogo]), () => ( false));
|
|
3758
|
+
const showStepper = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _120 => _120.showStepper]), () => ( false));
|
|
3759
|
+
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _121 => _121.showBackButton]), () => ( true));
|
|
3760
|
+
const balance = _optionalChain([uiConfig, 'optionalAccess', _122 => _122.balance]);
|
|
3761
|
+
const logoUrl = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _123 => _123.logoUrl]), () => ( "https://github.com/rhinestonewtf.png"));
|
|
3762
|
+
const title = _nullishCoalesce(_optionalChain([branding, 'optionalAccess', _124 => _124.title]), () => ( "Deposit"));
|
|
3699
3763
|
const canGoBack = currentStepIndex > 0 && currentStepIndex < 4 && backHandlerRef.current !== void 0;
|
|
3700
3764
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3701
3765
|
_chunkTQ6IIGRScjs.Modal,
|
|
@@ -3855,6 +3919,7 @@ function DepositModalInner({
|
|
|
3855
3919
|
onDepositSubmitted,
|
|
3856
3920
|
onDepositComplete,
|
|
3857
3921
|
onDepositFailed,
|
|
3922
|
+
onEvent,
|
|
3858
3923
|
onError,
|
|
3859
3924
|
debug
|
|
3860
3925
|
}
|