@rhinestone/deposit-modal 0.3.0-alpha.10 → 0.3.0-alpha.12
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-4NV6JM2U.cjs → DepositModalReown-EC4DJ3EC.cjs} +2 -2
- package/dist/{DepositModalReown-2S76TEXU.mjs → DepositModalReown-QOTUF4JC.mjs} +1 -1
- package/dist/{chunk-N5NOJ4ZV.mjs → chunk-HR6BABPX.mjs} +375 -233
- package/dist/{chunk-HUPEN2T5.cjs → chunk-I5G5ULRP.cjs} +260 -118
- package/dist/deposit.cjs +2 -2
- package/dist/deposit.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +1 -1
- package/dist/styles.css +82 -11
- package/package.json +1 -1
|
@@ -1376,14 +1376,15 @@ function getDepositEventDetails(event) {
|
|
|
1376
1376
|
...solanaMeta
|
|
1377
1377
|
};
|
|
1378
1378
|
}
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
const
|
|
1379
|
+
const source = isRecord(event.data.source) ? event.data.source : void 0;
|
|
1380
|
+
const deposit = isRecord(event.data.deposit) ? event.data.deposit : void 0;
|
|
1381
|
+
if (source || deposit) {
|
|
1382
|
+
const chainId = _nullishCoalesce(asChainId(_optionalChain([source, 'optionalAccess', _48 => _48.chain])), () => ( asChainId(_optionalChain([deposit, 'optionalAccess', _49 => _49.chain]))));
|
|
1383
|
+
const token = _nullishCoalesce(_nullishCoalesce(asString(_optionalChain([source, 'optionalAccess', _50 => _50.asset])), () => ( asString(_optionalChain([deposit, 'optionalAccess', _51 => _51.asset])))), () => ( asString(_optionalChain([deposit, 'optionalAccess', _52 => _52.token]))));
|
|
1383
1384
|
const solanaMeta = chainId === "solana" ? resolveSolanaTokenMeta(token) : {};
|
|
1384
1385
|
return {
|
|
1385
1386
|
chainId,
|
|
1386
|
-
amount: asAmount(_optionalChain([source, 'optionalAccess',
|
|
1387
|
+
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess', _53 => _53.amount])), () => ( asAmount(_optionalChain([deposit, 'optionalAccess', _54 => _54.amount])))),
|
|
1387
1388
|
token,
|
|
1388
1389
|
...solanaMeta
|
|
1389
1390
|
};
|
|
@@ -1420,12 +1421,12 @@ function DepositAddressStep({
|
|
|
1420
1421
|
}) {
|
|
1421
1422
|
const hasSolana = Boolean(solanaDepositAddress);
|
|
1422
1423
|
const allowedChainSet = _react.useMemo.call(void 0,
|
|
1423
|
-
() => _optionalChain([allowedRoutes, 'optionalAccess',
|
|
1424
|
-
[_optionalChain([allowedRoutes, 'optionalAccess',
|
|
1424
|
+
() => _optionalChain([allowedRoutes, 'optionalAccess', _55 => _55.sourceChains]) ? new Set(allowedRoutes.sourceChains) : null,
|
|
1425
|
+
[_optionalChain([allowedRoutes, 'optionalAccess', _56 => _56.sourceChains])]
|
|
1425
1426
|
);
|
|
1426
1427
|
const allowedTokenSet = _react.useMemo.call(void 0,
|
|
1427
|
-
() => _optionalChain([allowedRoutes, 'optionalAccess',
|
|
1428
|
-
[_optionalChain([allowedRoutes, 'optionalAccess',
|
|
1428
|
+
() => _optionalChain([allowedRoutes, 'optionalAccess', _57 => _57.sourceTokens]) ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null,
|
|
1429
|
+
[_optionalChain([allowedRoutes, 'optionalAccess', _58 => _58.sourceTokens])]
|
|
1429
1430
|
);
|
|
1430
1431
|
const evmChainIds = _react.useMemo.call(void 0, () => {
|
|
1431
1432
|
const all = _chunk7JIDIX27cjs.getSupportedChainIds.call(void 0, );
|
|
@@ -1437,8 +1438,8 @@ function DepositAddressStep({
|
|
|
1437
1438
|
options.splice(1, 0, "solana");
|
|
1438
1439
|
return options;
|
|
1439
1440
|
}, [evmChainIds, hasSolana]);
|
|
1440
|
-
const
|
|
1441
|
-
const defaultChainId = evmChainIds.includes(
|
|
1441
|
+
const BASE_CHAIN_ID2 = 8453;
|
|
1442
|
+
const defaultChainId = evmChainIds.includes(BASE_CHAIN_ID2) ? BASE_CHAIN_ID2 : evmChainIds[0];
|
|
1442
1443
|
const [sourceChainId, setSourceChainId] = _react.useState.call(void 0, defaultChainId);
|
|
1443
1444
|
const isSolana = sourceChainId === "solana";
|
|
1444
1445
|
const tokensForChain = _react.useMemo.call(void 0,
|
|
@@ -1517,8 +1518,8 @@ function DepositAddressStep({
|
|
|
1517
1518
|
function handlePointerDown(event) {
|
|
1518
1519
|
const target = event.target;
|
|
1519
1520
|
if (!target) return;
|
|
1520
|
-
const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access',
|
|
1521
|
-
const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access',
|
|
1521
|
+
const clickedChainDropdown = _optionalChain([chainDropdownRef, 'access', _59 => _59.current, 'optionalAccess', _60 => _60.contains, 'call', _61 => _61(target)]);
|
|
1522
|
+
const clickedTokenDropdown = _optionalChain([tokenDropdownRef, 'access', _62 => _62.current, 'optionalAccess', _63 => _63.contains, 'call', _64 => _64(target)]);
|
|
1522
1523
|
if (clickedChainDropdown || clickedTokenDropdown) return;
|
|
1523
1524
|
setChainDropdownOpen(false);
|
|
1524
1525
|
setTokenDropdownOpen(false);
|
|
@@ -1532,7 +1533,7 @@ function DepositAddressStep({
|
|
|
1532
1533
|
}, [chainDropdownOpen, tokenDropdownOpen]);
|
|
1533
1534
|
const handleCopy = _react.useCallback.call(void 0, async () => {
|
|
1534
1535
|
if (isUpdating) return;
|
|
1535
|
-
_optionalChain([onCopyAddress, 'optionalCall',
|
|
1536
|
+
_optionalChain([onCopyAddress, 'optionalCall', _65 => _65()]);
|
|
1536
1537
|
try {
|
|
1537
1538
|
await navigator.clipboard.writeText(displayAddress);
|
|
1538
1539
|
setCopied(true);
|
|
@@ -1643,7 +1644,7 @@ function DepositAddressStep({
|
|
|
1643
1644
|
directTransfer
|
|
1644
1645
|
};
|
|
1645
1646
|
setNotifications((prev) => [notification, ...prev]);
|
|
1646
|
-
_optionalChain([onDepositSubmittedRef, 'access',
|
|
1647
|
+
_optionalChain([onDepositSubmittedRef, 'access', _66 => _66.current, 'optionalCall', _67 => _67({
|
|
1647
1648
|
txHash: eventTxHash,
|
|
1648
1649
|
sourceChain: chainId,
|
|
1649
1650
|
amount
|
|
@@ -1654,7 +1655,7 @@ function DepositAddressStep({
|
|
|
1654
1655
|
if (!cancelled) {
|
|
1655
1656
|
const msg = err instanceof Error ? err.message : "Failed to check status";
|
|
1656
1657
|
setPollingError(msg);
|
|
1657
|
-
_optionalChain([onErrorRef, 'access',
|
|
1658
|
+
_optionalChain([onErrorRef, 'access', _68 => _68.current, 'optionalCall', _69 => _69(msg, "STATUS_POLL_ERROR")]);
|
|
1658
1659
|
}
|
|
1659
1660
|
}
|
|
1660
1661
|
if (!cancelled) {
|
|
@@ -1670,14 +1671,14 @@ function DepositAddressStep({
|
|
|
1670
1671
|
const handleNotificationComplete = _react.useCallback.call(void 0,
|
|
1671
1672
|
(txHash, destinationTxHash, context) => {
|
|
1672
1673
|
isTrackingRef.current = false;
|
|
1673
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
1674
|
+
_optionalChain([onDepositCompleteRef, 'access', _70 => _70.current, 'optionalCall', _71 => _71(txHash, destinationTxHash, context)]);
|
|
1674
1675
|
},
|
|
1675
1676
|
[]
|
|
1676
1677
|
);
|
|
1677
1678
|
const handleNotificationFailed = _react.useCallback.call(void 0,
|
|
1678
1679
|
(txHash, error) => {
|
|
1679
1680
|
isTrackingRef.current = false;
|
|
1680
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
1681
|
+
_optionalChain([onDepositFailedRef, 'access', _72 => _72.current, 'optionalCall', _73 => _73(txHash, error)]);
|
|
1681
1682
|
},
|
|
1682
1683
|
[]
|
|
1683
1684
|
);
|
|
@@ -1741,7 +1742,7 @@ function DepositAddressStep({
|
|
|
1741
1742
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Supported token" }),
|
|
1742
1743
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
1743
1744
|
"Min.$",
|
|
1744
|
-
(_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
1745
|
+
(_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _74 => _74.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
1745
1746
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1746
1747
|
_chunk2TWQGPPBcjs.InfoIcon,
|
|
1747
1748
|
{
|
|
@@ -1947,6 +1948,129 @@ function DepositAddressStep({
|
|
|
1947
1948
|
}
|
|
1948
1949
|
DepositAddressStep.displayName = "DepositAddressStep";
|
|
1949
1950
|
|
|
1951
|
+
// src/components/steps/DepositAddressSkeleton.tsx
|
|
1952
|
+
|
|
1953
|
+
var BASE_CHAIN_ID = 8453;
|
|
1954
|
+
function DepositAddressSkeleton({
|
|
1955
|
+
uiConfig,
|
|
1956
|
+
allowedRoutes
|
|
1957
|
+
}) {
|
|
1958
|
+
const allowedChainSet = _optionalChain([allowedRoutes, 'optionalAccess', _75 => _75.sourceChains]) ? new Set(allowedRoutes.sourceChains) : null;
|
|
1959
|
+
const allowedTokenSet = _optionalChain([allowedRoutes, 'optionalAccess', _76 => _76.sourceTokens]) ? new Set(allowedRoutes.sourceTokens.map((s) => s.toUpperCase())) : null;
|
|
1960
|
+
const evmChainIds = (() => {
|
|
1961
|
+
const all = _chunk7JIDIX27cjs.getSupportedChainIds.call(void 0, );
|
|
1962
|
+
return allowedChainSet ? all.filter((id) => allowedChainSet.has(id)) : all;
|
|
1963
|
+
})();
|
|
1964
|
+
const defaultChainId = evmChainIds.includes(BASE_CHAIN_ID) ? BASE_CHAIN_ID : evmChainIds[0];
|
|
1965
|
+
const tokensForChain = (() => {
|
|
1966
|
+
const all = _chunk7JIDIX27cjs.getTargetTokenSymbolsForChain.call(void 0, defaultChainId);
|
|
1967
|
+
return allowedTokenSet ? all.filter((s) => allowedTokenSet.has(s.toUpperCase())) : all;
|
|
1968
|
+
})();
|
|
1969
|
+
const defaultToken = tokensForChain.includes("USDC") ? "USDC" : _nullishCoalesce(tokensForChain[0], () => ( "USDC"));
|
|
1970
|
+
const chainName = _chunk7JIDIX27cjs.getChainName.call(void 0, defaultChainId);
|
|
1971
|
+
const chainIcon = _chunk7JIDIX27cjs.getChainIcon.call(void 0, defaultChainId);
|
|
1972
|
+
const tokenIcon = _chunk7JIDIX27cjs.getTokenIcon.call(void 0, defaultToken);
|
|
1973
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", "aria-busy": "true", children: [
|
|
1974
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-sr-only", role: "status", children: "Preparing deposit details\u2026" }),
|
|
1975
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
|
|
1976
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.TransferCryptoIcon, {}), title: "Transfer crypto" }),
|
|
1977
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-selectors", "aria-hidden": "true", children: [
|
|
1978
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
1979
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-dropdown-label", children: "Supported chain" }),
|
|
1980
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown-trigger", children: [
|
|
1981
|
+
chainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1982
|
+
"img",
|
|
1983
|
+
{
|
|
1984
|
+
src: chainIcon,
|
|
1985
|
+
alt: "",
|
|
1986
|
+
className: "rs-deposit-address-dropdown-icon"
|
|
1987
|
+
}
|
|
1988
|
+
),
|
|
1989
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: chainName }),
|
|
1990
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
1991
|
+
] })
|
|
1992
|
+
] }),
|
|
1993
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown", children: [
|
|
1994
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown-label rs-deposit-address-dropdown-label--with-min", children: [
|
|
1995
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Supported token" }),
|
|
1996
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-deposit-address-min", children: [
|
|
1997
|
+
"Min.$",
|
|
1998
|
+
(_nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _77 => _77.minDepositUsd]), () => ( 0.1))).toFixed(2),
|
|
1999
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.Tooltip, { content: "Minimum deposit amount required for the selected chain.", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2000
|
+
_chunk2TWQGPPBcjs.InfoIcon,
|
|
2001
|
+
{
|
|
2002
|
+
className: "rs-deposit-address-min-icon",
|
|
2003
|
+
"aria-hidden": "true"
|
|
2004
|
+
}
|
|
2005
|
+
) })
|
|
2006
|
+
] })
|
|
2007
|
+
] }),
|
|
2008
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-dropdown-trigger", children: [
|
|
2009
|
+
tokenIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2010
|
+
"img",
|
|
2011
|
+
{
|
|
2012
|
+
src: tokenIcon,
|
|
2013
|
+
alt: "",
|
|
2014
|
+
className: "rs-deposit-address-dropdown-icon"
|
|
2015
|
+
}
|
|
2016
|
+
),
|
|
2017
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: defaultToken }),
|
|
2018
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.ChevronDownIcon, { className: "rs-deposit-address-dropdown-chevron" })
|
|
2019
|
+
] })
|
|
2020
|
+
] })
|
|
2021
|
+
] }),
|
|
2022
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2023
|
+
"div",
|
|
2024
|
+
{
|
|
2025
|
+
style: { display: "flex", flexDirection: "column", gap: 4, width: "100%" },
|
|
2026
|
+
children: [
|
|
2027
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-deposit-address-well", children: [
|
|
2028
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-deposit-address-qr", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-skeleton rs-skeleton-qr", "aria-hidden": "true" }) }),
|
|
2029
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-skeleton rs-skeleton-address", "aria-hidden": "true" })
|
|
2030
|
+
] }),
|
|
2031
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2032
|
+
"button",
|
|
2033
|
+
{
|
|
2034
|
+
type: "button",
|
|
2035
|
+
className: "rs-deposit-address-copy",
|
|
2036
|
+
disabled: true,
|
|
2037
|
+
"aria-hidden": "true",
|
|
2038
|
+
children: [
|
|
2039
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.CopyIcon, {}),
|
|
2040
|
+
"Copy address"
|
|
2041
|
+
]
|
|
2042
|
+
}
|
|
2043
|
+
)
|
|
2044
|
+
]
|
|
2045
|
+
}
|
|
2046
|
+
),
|
|
2047
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-price-impact", "aria-hidden": "true", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-price-impact-header", children: [
|
|
2048
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-price-impact-header-left", children: [
|
|
2049
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: "Price impact" }),
|
|
2050
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-price-impact-label", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "strong", { children: "0.00%" }) }),
|
|
2051
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2052
|
+
_chunk2TWQGPPBcjs.Tooltip,
|
|
2053
|
+
{
|
|
2054
|
+
className: "rs-price-impact-info",
|
|
2055
|
+
content: "Price impact is the difference between expected and execution price, due to trade size and liquidity.",
|
|
2056
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.InfoIcon, { "aria-hidden": "true" })
|
|
2057
|
+
}
|
|
2058
|
+
)
|
|
2059
|
+
] }),
|
|
2060
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2061
|
+
_chunk2TWQGPPBcjs.ChevronDownIcon,
|
|
2062
|
+
{
|
|
2063
|
+
className: "rs-price-impact-chevron",
|
|
2064
|
+
"aria-hidden": "true"
|
|
2065
|
+
}
|
|
2066
|
+
)
|
|
2067
|
+
] }) })
|
|
2068
|
+
] }),
|
|
2069
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk2TWQGPPBcjs.PoweredBy, {})
|
|
2070
|
+
] });
|
|
2071
|
+
}
|
|
2072
|
+
DepositAddressSkeleton.displayName = "DepositAddressSkeleton";
|
|
2073
|
+
|
|
1950
2074
|
// src/components/steps/SolanaTokenSelectStep.tsx
|
|
1951
2075
|
|
|
1952
2076
|
|
|
@@ -2027,7 +2151,7 @@ function SolanaTokenSelectStep({
|
|
|
2027
2151
|
setTokenBalances(results);
|
|
2028
2152
|
setLoading(false);
|
|
2029
2153
|
const totalUsd = results.reduce((sum, r) => sum + r.balanceUsd, 0);
|
|
2030
|
-
_optionalChain([onTotalBalanceComputed, 'optionalCall',
|
|
2154
|
+
_optionalChain([onTotalBalanceComputed, 'optionalCall', _78 => _78(totalUsd)]);
|
|
2031
2155
|
}
|
|
2032
2156
|
void loadBalances();
|
|
2033
2157
|
return () => {
|
|
@@ -2173,7 +2297,7 @@ function SolanaAmountStep({
|
|
|
2173
2297
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
2174
2298
|
const hasAppliedDefaultRef = _react.useRef.call(void 0, false);
|
|
2175
2299
|
const isSourceStablecoin = _chunk7JIDIX27cjs.isStablecoinSymbol.call(void 0, token.symbol);
|
|
2176
|
-
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess',
|
|
2300
|
+
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess', _79 => _79.trim, 'call', _80 => _80(), 'access', _81 => _81.toLowerCase, 'call', _82 => _82()]) === "max";
|
|
2177
2301
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
2178
2302
|
if (isSourceStablecoin) return 1;
|
|
2179
2303
|
try {
|
|
@@ -2275,8 +2399,8 @@ function SolanaAmountStep({
|
|
|
2275
2399
|
return null;
|
|
2276
2400
|
}
|
|
2277
2401
|
}, [numericAmount, isSourceStablecoin, hasPricing, tokenPriceUsd, token.decimals]);
|
|
2278
|
-
const minDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
2279
|
-
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
2402
|
+
const minDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _83 => _83.minDepositUsd]), () => ( null));
|
|
2403
|
+
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _84 => _84.maxDepositUsd]), () => ( null));
|
|
2280
2404
|
const isBelowMin = minDepositUsd !== null && numericAmount > 0 && numericAmount < minDepositUsd;
|
|
2281
2405
|
const isAboveMax = maxDepositUsd !== null && numericAmount > maxDepositUsd;
|
|
2282
2406
|
const exceedsBalance = Boolean(
|
|
@@ -2453,7 +2577,7 @@ var DEFAULT_SOLANA_RPC_URL = "https://api.mainnet.solana.com";
|
|
|
2453
2577
|
var configuredSolanaRpcUrl = null;
|
|
2454
2578
|
var cachedConnections = /* @__PURE__ */ new Map();
|
|
2455
2579
|
function configureSolanaRpcUrl(rpcUrl) {
|
|
2456
|
-
const normalized = _optionalChain([rpcUrl, 'optionalAccess',
|
|
2580
|
+
const normalized = _optionalChain([rpcUrl, 'optionalAccess', _85 => _85.trim, 'call', _86 => _86()]);
|
|
2457
2581
|
configuredSolanaRpcUrl = normalized ? normalized : null;
|
|
2458
2582
|
cachedConnections.clear();
|
|
2459
2583
|
}
|
|
@@ -2573,8 +2697,8 @@ function SolanaConfirmStep({
|
|
|
2573
2697
|
const targetChainIcon = _chunk7JIDIX27cjs.getChainIcon.call(void 0, targetChain);
|
|
2574
2698
|
const sourceTokenIcon = _chunk7JIDIX27cjs.getTokenIcon.call(void 0, token.symbol);
|
|
2575
2699
|
const targetTokenIcon = _chunk7JIDIX27cjs.getTokenIcon.call(void 0, targetSymbol);
|
|
2576
|
-
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
2577
|
-
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
2700
|
+
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _87 => _87.feeSponsored]), () => ( false));
|
|
2701
|
+
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _88 => _88.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
2578
2702
|
const formattedAmount = sourceAmount && !Number.isNaN(Number(sourceAmount)) ? Number(sourceAmount).toLocaleString("en-US", {
|
|
2579
2703
|
minimumFractionDigits: 2,
|
|
2580
2704
|
maximumFractionDigits: 6
|
|
@@ -2656,7 +2780,7 @@ function SolanaConfirmStep({
|
|
|
2656
2780
|
_chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
2657
2781
|
token: token.symbol,
|
|
2658
2782
|
instructionCount: transaction.instructions.length,
|
|
2659
|
-
feePayer: _optionalChain([transaction, 'access',
|
|
2783
|
+
feePayer: _optionalChain([transaction, 'access', _89 => _89.feePayer, 'optionalAccess', _90 => _90.toBase58, 'call', _91 => _91()]),
|
|
2660
2784
|
recentBlockhash: transaction.recentBlockhash
|
|
2661
2785
|
});
|
|
2662
2786
|
const txHash = await sendSolanaTransaction(
|
|
@@ -2678,7 +2802,7 @@ function SolanaConfirmStep({
|
|
|
2678
2802
|
sourceAmount
|
|
2679
2803
|
});
|
|
2680
2804
|
setError(message);
|
|
2681
|
-
_optionalChain([onError, 'optionalCall',
|
|
2805
|
+
_optionalChain([onError, 'optionalCall', _92 => _92(message, "SOLANA_TRANSFER_ERROR")]);
|
|
2682
2806
|
} finally {
|
|
2683
2807
|
setIsSubmitting(false);
|
|
2684
2808
|
}
|
|
@@ -3221,21 +3345,21 @@ var polymarketProvider = {
|
|
|
3221
3345
|
async fetchAvailability({ eoa, getPublicClient: getPublicClient2, signal }) {
|
|
3222
3346
|
const proxyWallet = await fetchPolymarketProxyWallet(eoa, signal);
|
|
3223
3347
|
if (!proxyWallet) return null;
|
|
3224
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
3348
|
+
if (_optionalChain([signal, 'optionalAccess', _93 => _93.aborted])) return null;
|
|
3225
3349
|
const polygonClient = getPublicClient2(POLYMARKET_POLYGON_CHAIN_ID);
|
|
3226
3350
|
if (!polygonClient) return null;
|
|
3227
3351
|
const balances = await readPolymarketBalances({
|
|
3228
3352
|
publicClient: polygonClient,
|
|
3229
3353
|
proxyWallet
|
|
3230
3354
|
});
|
|
3231
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
3355
|
+
if (_optionalChain([signal, 'optionalAccess', _94 => _94.aborted])) return null;
|
|
3232
3356
|
if (balances.pusd === 0n && balances.usdce === 0n) return null;
|
|
3233
3357
|
const walletKind = await detectPolymarketWalletKind({
|
|
3234
3358
|
publicClient: polygonClient,
|
|
3235
3359
|
proxyWallet,
|
|
3236
3360
|
eoa
|
|
3237
3361
|
});
|
|
3238
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
3362
|
+
if (_optionalChain([signal, 'optionalAccess', _95 => _95.aborted])) return null;
|
|
3239
3363
|
if (!walletKind) return null;
|
|
3240
3364
|
const assets = [];
|
|
3241
3365
|
if (balances.pusd > 0n) {
|
|
@@ -3399,6 +3523,7 @@ function applyBack(state, hasWalletOptions) {
|
|
|
3399
3523
|
targetAmount: null,
|
|
3400
3524
|
targetTokenPriceUsd: null,
|
|
3401
3525
|
balance: null,
|
|
3526
|
+
inputAmountUsd: null,
|
|
3402
3527
|
liquidityWarning: null
|
|
3403
3528
|
},
|
|
3404
3529
|
flow: {
|
|
@@ -3598,12 +3723,12 @@ function applyAction(state, action) {
|
|
|
3598
3723
|
requestKey: action.requestKey,
|
|
3599
3724
|
cacheKey: action.cacheKey,
|
|
3600
3725
|
status: "loading",
|
|
3601
|
-
smartAccount: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
3602
|
-
sessionOwnerAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
3603
|
-
solanaDepositAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
3726
|
+
smartAccount: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _96 => _96.smartAccount]), () => ( null)),
|
|
3727
|
+
sessionOwnerAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _97 => _97.sessionOwnerAddress]), () => ( null)),
|
|
3728
|
+
solanaDepositAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _98 => _98.solanaDepositAddress]), () => ( null)),
|
|
3604
3729
|
message: null,
|
|
3605
3730
|
cacheable: action.cacheable,
|
|
3606
|
-
attemptNonce: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
3731
|
+
attemptNonce: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _99 => _99.attemptNonce]), () => ( 0))
|
|
3607
3732
|
}));
|
|
3608
3733
|
}
|
|
3609
3734
|
case "setup/ready": {
|
|
@@ -3654,7 +3779,11 @@ function applyAction(state, action) {
|
|
|
3654
3779
|
selectedAsset: action.asset,
|
|
3655
3780
|
// Seed the user-facing amount input with the modal's defaultAmount
|
|
3656
3781
|
// on first visit. Subsequent visits override via amount/entered.
|
|
3657
|
-
|
|
3782
|
+
// `inputAmountUsd` is the USD-style value the input shows; it (not
|
|
3783
|
+
// the native `amount`) is what re-seeds the input on back, so seed
|
|
3784
|
+
// it here too and reset it on a fresh pick.
|
|
3785
|
+
amount: _nullishCoalesce(action.seedAmount, () => ( state.deposit.amount)),
|
|
3786
|
+
inputAmountUsd: _nullishCoalesce(action.seedAmount, () => ( null))
|
|
3658
3787
|
},
|
|
3659
3788
|
flow: { ...state.flow, step: "amount" }
|
|
3660
3789
|
};
|
|
@@ -3667,6 +3796,11 @@ function applyAction(state, action) {
|
|
|
3667
3796
|
targetAmount: action.targetAmount,
|
|
3668
3797
|
targetTokenPriceUsd: action.targetTokenPriceUsd,
|
|
3669
3798
|
balance: _nullishCoalesce(action.balance, () => ( null)),
|
|
3799
|
+
// `targetAmount` is the USD-style value the user typed. Preserve it
|
|
3800
|
+
// as `inputAmountUsd` so back-from-confirm re-seeds the input with
|
|
3801
|
+
// the typed USD value rather than the converted native `amount`
|
|
3802
|
+
// (which corrupts the input for non-stablecoin priced tokens).
|
|
3803
|
+
inputAmountUsd: action.targetAmount,
|
|
3670
3804
|
liquidityWarning: _nullishCoalesce(action.liquidityWarning, () => ( null))
|
|
3671
3805
|
},
|
|
3672
3806
|
flow: { ...state.flow, step: "confirm" }
|
|
@@ -4015,14 +4149,14 @@ function computeCacheKey(input, sessionOwnerAddress) {
|
|
|
4015
4149
|
});
|
|
4016
4150
|
}
|
|
4017
4151
|
function computeIsCacheable(input) {
|
|
4018
|
-
return !input.forceRegister && !(_nullishCoalesce(_optionalChain([input, 'access',
|
|
4152
|
+
return !input.forceRegister && !(_nullishCoalesce(_optionalChain([input, 'access', _100 => _100.postBridgeActions, 'optionalAccess', _101 => _101.length]), () => ( 0)));
|
|
4019
4153
|
}
|
|
4020
4154
|
var SETUP_REQUEST_DEDUPE_TTL_MS = 3e4;
|
|
4021
4155
|
var setupRequestDedupe = /* @__PURE__ */ new Map();
|
|
4022
4156
|
function readDedupedAccountSetupResult(requestKey) {
|
|
4023
4157
|
const now = Date.now();
|
|
4024
4158
|
const existing = setupRequestDedupe.get(requestKey);
|
|
4025
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
4159
|
+
if (_optionalChain([existing, 'optionalAccess', _102 => _102.settled]) && existing.expiresAt > now && existing.result) {
|
|
4026
4160
|
return existing.result;
|
|
4027
4161
|
}
|
|
4028
4162
|
return null;
|
|
@@ -4036,7 +4170,7 @@ async function runAccountSetup(input, deps) {
|
|
|
4036
4170
|
_chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "account-setup", "setup:start", {
|
|
4037
4171
|
owner: input.ownerAddress,
|
|
4038
4172
|
sessionOwner: sessionOwner.address,
|
|
4039
|
-
hasPostBridgeActions: Boolean(_optionalChain([input, 'access',
|
|
4173
|
+
hasPostBridgeActions: Boolean(_optionalChain([input, 'access', _103 => _103.postBridgeActions, 'optionalAccess', _104 => _104.length])),
|
|
4040
4174
|
forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
|
|
4041
4175
|
});
|
|
4042
4176
|
const setup = await service.setupAccount({
|
|
@@ -4098,10 +4232,10 @@ async function runAccountSetup(input, deps) {
|
|
|
4098
4232
|
chain: _chunk2TWQGPPBcjs.targetChainToCaip2.call(void 0, input.targetChain),
|
|
4099
4233
|
token: input.targetToken,
|
|
4100
4234
|
...input.recipient && { recipient: input.recipient },
|
|
4101
|
-
..._optionalChain([input, 'access',
|
|
4235
|
+
..._optionalChain([input, 'access', _105 => _105.postBridgeActions, 'optionalAccess', _106 => _106.length]) && {
|
|
4102
4236
|
postBridgeActions: input.postBridgeActions
|
|
4103
4237
|
},
|
|
4104
|
-
..._optionalChain([input, 'access',
|
|
4238
|
+
..._optionalChain([input, 'access', _107 => _107.outputTokenRules, 'optionalAccess', _108 => _108.length]) && {
|
|
4105
4239
|
outputTokenRules: input.outputTokenRules
|
|
4106
4240
|
},
|
|
4107
4241
|
...input.rejectUnmapped != null && {
|
|
@@ -4243,7 +4377,9 @@ function deriveStep(flow, d, p, activeEntry) {
|
|
|
4243
4377
|
type: "amount",
|
|
4244
4378
|
smartAccount,
|
|
4245
4379
|
asset: d.selectedAsset,
|
|
4246
|
-
|
|
4380
|
+
// Seed the input from the USD-style value the user typed, not the
|
|
4381
|
+
// native source `amount` (which would corrupt the input on back).
|
|
4382
|
+
inputAmountUsd: _nullishCoalesce(d.inputAmountUsd, () => ( void 0))
|
|
4247
4383
|
};
|
|
4248
4384
|
case "confirm":
|
|
4249
4385
|
if (!smartAccount || !d.selectedAsset || !d.amount || !d.targetAmount) {
|
|
@@ -4368,7 +4504,7 @@ function DepositFlow({
|
|
|
4368
4504
|
const onLifecycleRef = _chunk2TWQGPPBcjs.useLatestRef.call(void 0, onLifecycle);
|
|
4369
4505
|
const onErrorRef = _chunk2TWQGPPBcjs.useLatestRef.call(void 0, onError);
|
|
4370
4506
|
const hasInitialReownSession = Boolean(
|
|
4371
|
-
enableSolana ? _optionalChain([reownWallet, 'optionalAccess',
|
|
4507
|
+
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _109 => _109.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _110 => _110.address]) : _optionalChain([reownWallet, 'optionalAccess', _111 => _111.address])
|
|
4372
4508
|
);
|
|
4373
4509
|
const hasInitialWalletHydrationPending = Boolean(
|
|
4374
4510
|
dappAddress && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasInitialReownSession && !reownWallet.isReady)
|
|
@@ -4418,12 +4554,12 @@ function DepositFlow({
|
|
|
4418
4554
|
return null;
|
|
4419
4555
|
}, []);
|
|
4420
4556
|
const dappSwitchChain = _react.useMemo.call(void 0, () => {
|
|
4421
|
-
if (!_optionalChain([dappWalletClient, 'optionalAccess',
|
|
4557
|
+
if (!_optionalChain([dappWalletClient, 'optionalAccess', _112 => _112.switchChain])) return void 0;
|
|
4422
4558
|
return async (chainId) => {
|
|
4423
|
-
await _optionalChain([dappWalletClient, 'access',
|
|
4559
|
+
await _optionalChain([dappWalletClient, 'access', _113 => _113.switchChain, 'optionalCall', _114 => _114({ id: chainId })]);
|
|
4424
4560
|
};
|
|
4425
4561
|
}, [dappWalletClient]);
|
|
4426
|
-
const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
4562
|
+
const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _115 => _115.account, 'optionalAccess', _116 => _116.address]), () => ( null));
|
|
4427
4563
|
const walletOptions = _react.useMemo.call(void 0, () => {
|
|
4428
4564
|
const options = [];
|
|
4429
4565
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -4437,7 +4573,7 @@ function DepositFlow({
|
|
|
4437
4573
|
});
|
|
4438
4574
|
seen.add(id);
|
|
4439
4575
|
}
|
|
4440
|
-
if (enableSolana && _optionalChain([reownWallet, 'optionalAccess',
|
|
4576
|
+
if (enableSolana && _optionalChain([reownWallet, 'optionalAccess', _117 => _117.isConnected]) && reownWallet.isSolana && reownWallet.solanaAddress && dappAddress) {
|
|
4441
4577
|
const id = _nullishCoalesce(reownWallet.caipAddress, () => ( `solana:${reownWallet.solanaAddress}`));
|
|
4442
4578
|
if (!seen.has(id)) {
|
|
4443
4579
|
options.push({
|
|
@@ -4449,7 +4585,7 @@ function DepositFlow({
|
|
|
4449
4585
|
});
|
|
4450
4586
|
seen.add(id);
|
|
4451
4587
|
}
|
|
4452
|
-
} else if (_optionalChain([reownWallet, 'optionalAccess',
|
|
4588
|
+
} else if (_optionalChain([reownWallet, 'optionalAccess', _118 => _118.address]) && reownWallet.isConnected && reownWallet.walletClient && reownWallet.publicClient && !seen.has(`evm:${reownWallet.address.toLowerCase()}`)) {
|
|
4453
4589
|
const id = `evm:${reownWallet.address.toLowerCase()}`;
|
|
4454
4590
|
if (!seen.has(id)) {
|
|
4455
4591
|
options.push({
|
|
@@ -4466,20 +4602,20 @@ function DepositFlow({
|
|
|
4466
4602
|
}, [
|
|
4467
4603
|
connectedWalletAddress,
|
|
4468
4604
|
dappAddress,
|
|
4469
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4470
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4471
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4472
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4473
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4605
|
+
_optionalChain([reownWallet, 'optionalAccess', _119 => _119.address]),
|
|
4606
|
+
_optionalChain([reownWallet, 'optionalAccess', _120 => _120.isConnected]),
|
|
4607
|
+
_optionalChain([reownWallet, 'optionalAccess', _121 => _121.walletClient]),
|
|
4608
|
+
_optionalChain([reownWallet, 'optionalAccess', _122 => _122.publicClient]),
|
|
4609
|
+
_optionalChain([reownWallet, 'optionalAccess', _123 => _123.icon]),
|
|
4474
4610
|
enableSolana,
|
|
4475
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4476
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4477
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4611
|
+
_optionalChain([reownWallet, 'optionalAccess', _124 => _124.isSolana]),
|
|
4612
|
+
_optionalChain([reownWallet, 'optionalAccess', _125 => _125.solanaAddress]),
|
|
4613
|
+
_optionalChain([reownWallet, 'optionalAccess', _126 => _126.caipAddress])
|
|
4478
4614
|
]);
|
|
4479
|
-
const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess',
|
|
4615
|
+
const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess', _127 => _127.account]) && dappAddress && !reownWallet;
|
|
4480
4616
|
const hasWalletOptions = walletOptions.length > 0;
|
|
4481
4617
|
const hasReownSession = Boolean(
|
|
4482
|
-
enableSolana ? _optionalChain([reownWallet, 'optionalAccess',
|
|
4618
|
+
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _128 => _128.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _129 => _129.address]) : _optionalChain([reownWallet, 'optionalAccess', _130 => _130.address])
|
|
4483
4619
|
);
|
|
4484
4620
|
const isWalletHydrationPending = Boolean(
|
|
4485
4621
|
dappAddress && !hasWalletOptions && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasReownSession && !reownWallet.isReady)
|
|
@@ -4543,7 +4679,7 @@ function DepositFlow({
|
|
|
4543
4679
|
};
|
|
4544
4680
|
}
|
|
4545
4681
|
if (canAutoLock) {
|
|
4546
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
4682
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _131 => _131.chain, 'optionalAccess', _132 => _132.id]), () => ( setupChainId));
|
|
4547
4683
|
return {
|
|
4548
4684
|
ownerAddress: dappWalletClient.account.address,
|
|
4549
4685
|
walletClient: dappWalletClient,
|
|
@@ -4565,8 +4701,8 @@ function DepositFlow({
|
|
|
4565
4701
|
switchChain: void 0
|
|
4566
4702
|
};
|
|
4567
4703
|
}
|
|
4568
|
-
if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess',
|
|
4569
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
4704
|
+
if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess', _133 => _133.account]) && selectedOption.address && dappWalletClient.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
4705
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _134 => _134.chain, 'optionalAccess', _135 => _135.id]), () => ( setupChainId));
|
|
4570
4706
|
return {
|
|
4571
4707
|
ownerAddress: dappWalletClient.account.address,
|
|
4572
4708
|
walletClient: dappWalletClient,
|
|
@@ -4574,7 +4710,7 @@ function DepositFlow({
|
|
|
4574
4710
|
switchChain: dappSwitchChain
|
|
4575
4711
|
};
|
|
4576
4712
|
}
|
|
4577
|
-
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess',
|
|
4713
|
+
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess', _136 => _136.address]) && selectedOption.address && reownWallet.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
4578
4714
|
return {
|
|
4579
4715
|
ownerAddress: reownWallet.address,
|
|
4580
4716
|
walletClient: reownWallet.walletClient,
|
|
@@ -4641,37 +4777,37 @@ function DepositFlow({
|
|
|
4641
4777
|
const selectedEvmWalletOwner = _react.useMemo.call(void 0, () => {
|
|
4642
4778
|
if (!selectedWalletId) return null;
|
|
4643
4779
|
const opt = walletOptions.find((o) => o.id === selectedWalletId);
|
|
4644
|
-
if (_optionalChain([opt, 'optionalAccess',
|
|
4780
|
+
if (_optionalChain([opt, 'optionalAccess', _137 => _137.kind]) === "external" && opt.address) {
|
|
4645
4781
|
return opt.address;
|
|
4646
4782
|
}
|
|
4647
|
-
if (_optionalChain([opt, 'optionalAccess',
|
|
4783
|
+
if (_optionalChain([opt, 'optionalAccess', _138 => _138.kind]) === "connected" && opt.address) {
|
|
4648
4784
|
return opt.address;
|
|
4649
4785
|
}
|
|
4650
4786
|
return null;
|
|
4651
4787
|
}, [selectedWalletId, walletOptions]);
|
|
4652
4788
|
const dappImportOwner = _react.useMemo.call(void 0, () => {
|
|
4653
4789
|
if (selectedEvmWalletOwner) return selectedEvmWalletOwner;
|
|
4654
|
-
if (_optionalChain([reownWallet, 'optionalAccess',
|
|
4790
|
+
if (_optionalChain([reownWallet, 'optionalAccess', _139 => _139.address]) && reownWallet.isConnected) {
|
|
4655
4791
|
return reownWallet.address;
|
|
4656
4792
|
}
|
|
4657
4793
|
if (connectedWalletAddress) return connectedWalletAddress;
|
|
4658
4794
|
return null;
|
|
4659
4795
|
}, [
|
|
4660
4796
|
selectedEvmWalletOwner,
|
|
4661
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4662
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4797
|
+
_optionalChain([reownWallet, 'optionalAccess', _140 => _140.address]),
|
|
4798
|
+
_optionalChain([reownWallet, 'optionalAccess', _141 => _141.isConnected]),
|
|
4663
4799
|
connectedWalletAddress
|
|
4664
4800
|
]);
|
|
4665
4801
|
const activeOwner = _react.useMemo.call(void 0,
|
|
4666
4802
|
() => resolveOwnerForMode(flowMode, {
|
|
4667
4803
|
dappAddress,
|
|
4668
|
-
walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess',
|
|
4804
|
+
walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _142 => _142.ownerAddress]), () => ( (canAutoLock ? connectedWalletAddress : selectedEvmWalletOwner))),
|
|
4669
4805
|
dappImportOwner
|
|
4670
4806
|
}),
|
|
4671
4807
|
[
|
|
4672
4808
|
flowMode,
|
|
4673
4809
|
dappAddress,
|
|
4674
|
-
_optionalChain([signerContext, 'optionalAccess',
|
|
4810
|
+
_optionalChain([signerContext, 'optionalAccess', _143 => _143.ownerAddress]),
|
|
4675
4811
|
canAutoLock,
|
|
4676
4812
|
connectedWalletAddress,
|
|
4677
4813
|
selectedEvmWalletOwner,
|
|
@@ -4700,12 +4836,12 @@ function DepositFlow({
|
|
|
4700
4836
|
return;
|
|
4701
4837
|
}
|
|
4702
4838
|
lastActiveSetupLifecycleKeyRef.current = lifecycleKey;
|
|
4703
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
4839
|
+
_optionalChain([onLifecycleRef, 'access', _144 => _144.current, 'optionalCall', _145 => _145({
|
|
4704
4840
|
type: "smart-account-changed",
|
|
4705
4841
|
evm: activeEntry.smartAccount,
|
|
4706
4842
|
solana: _nullishCoalesce(activeEntry.solanaDepositAddress, () => ( null))
|
|
4707
4843
|
})]);
|
|
4708
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
4844
|
+
_optionalChain([onLifecycleRef, 'access', _146 => _146.current, 'optionalCall', _147 => _147({
|
|
4709
4845
|
type: "connected",
|
|
4710
4846
|
address: activeOwner,
|
|
4711
4847
|
smartAccount: activeEntry.smartAccount
|
|
@@ -4738,7 +4874,7 @@ function DepositFlow({
|
|
|
4738
4874
|
const currentBackHandler = canGoBackFromHere ? handleBack : void 0;
|
|
4739
4875
|
const currentScreen = showConnectStep ? "connect" : effectiveStep.type;
|
|
4740
4876
|
_react.useEffect.call(void 0, () => {
|
|
4741
|
-
_optionalChain([onStepChangeRef, 'access',
|
|
4877
|
+
_optionalChain([onStepChangeRef, 'access', _148 => _148.current, 'optionalCall', _149 => _149(currentBackHandler, currentScreen)]);
|
|
4742
4878
|
}, [currentBackHandler, currentScreen, onStepChangeRef]);
|
|
4743
4879
|
const stepSendToken = effectiveStep.type === "amount" ? effectiveStep.asset.symbol : null;
|
|
4744
4880
|
const stepOpenEventKey = effectiveStep.type === "select-asset" ? "select-asset" : effectiveStep.type === "deposit-address" ? "deposit-address" : effectiveStep.type === "amount" && stepSendToken ? `amount:${stepSendToken.toLowerCase()}` : null;
|
|
@@ -4753,7 +4889,7 @@ function DepositFlow({
|
|
|
4753
4889
|
}
|
|
4754
4890
|
lastStepOpenEventKeyRef.current = stepOpenEventKey;
|
|
4755
4891
|
if (effectiveStep.type === "select-asset") {
|
|
4756
|
-
_optionalChain([onEventRef, 'access',
|
|
4892
|
+
_optionalChain([onEventRef, 'access', _150 => _150.current, 'optionalCall', _151 => _151({
|
|
4757
4893
|
type: "deposit_modal_connected_wallet_select_source_open",
|
|
4758
4894
|
total_balance_in_external_wallet: totalBalanceUsd,
|
|
4759
4895
|
pred_balance: totalBalanceUsd
|
|
@@ -4761,7 +4897,7 @@ function DepositFlow({
|
|
|
4761
4897
|
} else if (effectiveStep.type === "deposit-address") {
|
|
4762
4898
|
const chainName = _chunk7JIDIX27cjs.getChainName.call(void 0, targetChain);
|
|
4763
4899
|
const tokenSymbol = _chunk7JIDIX27cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
4764
|
-
_optionalChain([onEventRef, 'access',
|
|
4900
|
+
_optionalChain([onEventRef, 'access', _152 => _152.current, 'optionalCall', _153 => _153({
|
|
4765
4901
|
type: "deposit_modal_transfer_crypto_open",
|
|
4766
4902
|
default_chain: chainName,
|
|
4767
4903
|
default_token: tokenSymbol,
|
|
@@ -4769,7 +4905,7 @@ function DepositFlow({
|
|
|
4769
4905
|
})]);
|
|
4770
4906
|
} else if (effectiveStep.type === "amount" && stepSendToken) {
|
|
4771
4907
|
const receiveSymbol = _chunk7JIDIX27cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
4772
|
-
_optionalChain([onEventRef, 'access',
|
|
4908
|
+
_optionalChain([onEventRef, 'access', _154 => _154.current, 'optionalCall', _155 => _155({
|
|
4773
4909
|
type: "deposit_modal_connected_wallet_enter_value_open",
|
|
4774
4910
|
send_token: stepSendToken,
|
|
4775
4911
|
receive_token: receiveSymbol,
|
|
@@ -4802,7 +4938,7 @@ function DepositFlow({
|
|
|
4802
4938
|
targetToken
|
|
4803
4939
|
]);
|
|
4804
4940
|
_react.useEffect.call(void 0, () => {
|
|
4805
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
4941
|
+
_optionalChain([onLifecycleRef, 'access', _156 => _156.current, 'optionalCall', _157 => _157({
|
|
4806
4942
|
type: "balance-changed",
|
|
4807
4943
|
totalUsd: totalBalanceUsd
|
|
4808
4944
|
})]);
|
|
@@ -4816,7 +4952,7 @@ function DepositFlow({
|
|
|
4816
4952
|
const handleConfirmWallet = _react.useCallback.call(void 0,
|
|
4817
4953
|
(walletId) => {
|
|
4818
4954
|
const selectedOption = walletOptions.find((o) => o.id === walletId);
|
|
4819
|
-
const mode = enableSolana && _optionalChain([selectedOption, 'optionalAccess',
|
|
4955
|
+
const mode = enableSolana && _optionalChain([selectedOption, 'optionalAccess', _158 => _158.kind]) === "solana" ? "solana-wallet" : "wallet";
|
|
4820
4956
|
storeApi.dispatch({
|
|
4821
4957
|
type: "connect/wallet-confirmed",
|
|
4822
4958
|
walletId,
|
|
@@ -4826,7 +4962,7 @@ function DepositFlow({
|
|
|
4826
4962
|
[walletOptions, enableSolana, storeApi]
|
|
4827
4963
|
);
|
|
4828
4964
|
const isSolanaWalletConnected = Boolean(
|
|
4829
|
-
enableSolana && _optionalChain([reownWallet, 'optionalAccess',
|
|
4965
|
+
enableSolana && _optionalChain([reownWallet, 'optionalAccess', _159 => _159.isConnected]) && _optionalChain([reownWallet, 'optionalAccess', _160 => _160.isSolana])
|
|
4830
4966
|
);
|
|
4831
4967
|
const dappImportsKey = dappImports ? Object.keys(dappImports).filter((k) => dappImports[k]).sort().join(",") : "";
|
|
4832
4968
|
const enabledDappImportProviders = _react.useMemo.call(void 0,
|
|
@@ -4839,7 +4975,7 @@ function DepositFlow({
|
|
|
4839
4975
|
const owner = dappImportOwner;
|
|
4840
4976
|
if (owner) {
|
|
4841
4977
|
const wallet = walletOptions.find(
|
|
4842
|
-
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess',
|
|
4978
|
+
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _161 => _161.toLowerCase, 'call', _162 => _162()]) === owner.toLowerCase()
|
|
4843
4979
|
);
|
|
4844
4980
|
if (wallet) {
|
|
4845
4981
|
storeApi.dispatch({
|
|
@@ -4920,7 +5056,7 @@ function DepositFlow({
|
|
|
4920
5056
|
if (!dappImportOwner) {
|
|
4921
5057
|
return { ...baseRow, status: "needs-connect" };
|
|
4922
5058
|
}
|
|
4923
|
-
const availabilityEntry = _optionalChain([dappImportAvailabilityOwner, 'optionalAccess',
|
|
5059
|
+
const availabilityEntry = _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _163 => _163.toLowerCase, 'call', _164 => _164()]) === dappImportOwner.toLowerCase() ? dappImportAvailability[provider.id] : void 0;
|
|
4924
5060
|
const dappImportSetup = readSetupForOwner(setupSlice, dappImportOwner);
|
|
4925
5061
|
if (availabilityEntry === "loading" || availabilityEntry === void 0) {
|
|
4926
5062
|
return { ...baseRow, status: "loading" };
|
|
@@ -4968,7 +5104,7 @@ function DepositFlow({
|
|
|
4968
5104
|
}, [activeDappImportProviderId, enabledDappImportProviders]);
|
|
4969
5105
|
const activeDappImportAvailability = _react.useMemo.call(void 0, () => {
|
|
4970
5106
|
if (!activeDappImportProviderId) return null;
|
|
4971
|
-
if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess',
|
|
5107
|
+
if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _165 => _165.toLowerCase, 'call', _166 => _166()]) !== dappImportOwner.toLowerCase()) {
|
|
4972
5108
|
return null;
|
|
4973
5109
|
}
|
|
4974
5110
|
const entry = dappImportAvailability[activeDappImportProviderId];
|
|
@@ -4981,7 +5117,7 @@ function DepositFlow({
|
|
|
4981
5117
|
dappImportOwner
|
|
4982
5118
|
]);
|
|
4983
5119
|
const handleNewDeposit = _react.useCallback.call(void 0, () => {
|
|
4984
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
5120
|
+
_optionalChain([onLifecycleRef, 'access', _167 => _167.current, 'optionalCall', _168 => _168({
|
|
4985
5121
|
type: "smart-account-changed",
|
|
4986
5122
|
evm: null,
|
|
4987
5123
|
solana: null
|
|
@@ -5029,13 +5165,13 @@ function DepositFlow({
|
|
|
5029
5165
|
};
|
|
5030
5166
|
push(dappAddress);
|
|
5031
5167
|
push(connectedWalletAddress);
|
|
5032
|
-
push(_optionalChain([reownWallet, 'optionalAccess',
|
|
5168
|
+
push(_optionalChain([reownWallet, 'optionalAccess', _169 => _169.address]));
|
|
5033
5169
|
push(dappImportOwner);
|
|
5034
5170
|
return owners;
|
|
5035
5171
|
}, [
|
|
5036
5172
|
dappAddress,
|
|
5037
5173
|
connectedWalletAddress,
|
|
5038
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5174
|
+
_optionalChain([reownWallet, 'optionalAccess', _170 => _170.address]),
|
|
5039
5175
|
dappImportOwner
|
|
5040
5176
|
]);
|
|
5041
5177
|
_react.useEffect.call(void 0, () => {
|
|
@@ -5140,7 +5276,7 @@ function DepositFlow({
|
|
|
5140
5276
|
sourceChain: data.sourceChain,
|
|
5141
5277
|
amount: data.amount
|
|
5142
5278
|
});
|
|
5143
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
5279
|
+
_optionalChain([onLifecycleRef, 'access', _171 => _171.current, 'optionalCall', _172 => _172({ type: "submitted", ...data })]);
|
|
5144
5280
|
},
|
|
5145
5281
|
[logFlow, onLifecycleRef]
|
|
5146
5282
|
);
|
|
@@ -5197,7 +5333,7 @@ function DepositFlow({
|
|
|
5197
5333
|
sourceSymbol: tokenAtSubmit.symbol,
|
|
5198
5334
|
sourceDecimals: tokenAtSubmit.decimals
|
|
5199
5335
|
});
|
|
5200
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
5336
|
+
_optionalChain([onLifecycleRef, 'access', _173 => _173.current, 'optionalCall', _174 => _174({
|
|
5201
5337
|
type: "submitted",
|
|
5202
5338
|
txHash,
|
|
5203
5339
|
sourceChain: "solana",
|
|
@@ -5208,7 +5344,7 @@ function DepositFlow({
|
|
|
5208
5344
|
);
|
|
5209
5345
|
const handleAssetContinue = _react.useCallback.call(void 0,
|
|
5210
5346
|
(asset) => {
|
|
5211
|
-
_optionalChain([onEventRef, 'access',
|
|
5347
|
+
_optionalChain([onEventRef, 'access', _175 => _175.current, 'optionalCall', _176 => _176({
|
|
5212
5348
|
type: "deposit_modal_connected_wallet_select_source_cta_click",
|
|
5213
5349
|
total_balance_in_external_wallet: totalBalanceUsd,
|
|
5214
5350
|
pred_balance: totalBalanceUsd,
|
|
@@ -5261,8 +5397,8 @@ function DepositFlow({
|
|
|
5261
5397
|
sourceChain: chainId,
|
|
5262
5398
|
sourceToken: token,
|
|
5263
5399
|
amount,
|
|
5264
|
-
sourceSymbol: _optionalChain([dappImport, 'optionalAccess',
|
|
5265
|
-
sourceDecimals: _optionalChain([dappImport, 'optionalAccess',
|
|
5400
|
+
sourceSymbol: _optionalChain([dappImport, 'optionalAccess', _177 => _177.symbol]),
|
|
5401
|
+
sourceDecimals: _optionalChain([dappImport, 'optionalAccess', _178 => _178.decimals]),
|
|
5266
5402
|
directTransfer: !dappImport && isSameRoute2(chainId, token, targetChain, targetToken)
|
|
5267
5403
|
});
|
|
5268
5404
|
},
|
|
@@ -5270,7 +5406,7 @@ function DepositFlow({
|
|
|
5270
5406
|
);
|
|
5271
5407
|
const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
|
|
5272
5408
|
(txHash, sourceChain, amount) => {
|
|
5273
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
5409
|
+
_optionalChain([onLifecycleRef, 'access', _179 => _179.current, 'optionalCall', _180 => _180({
|
|
5274
5410
|
type: "submitted",
|
|
5275
5411
|
txHash,
|
|
5276
5412
|
sourceChain,
|
|
@@ -5282,7 +5418,7 @@ function DepositFlow({
|
|
|
5282
5418
|
const handleDepositComplete = _react.useCallback.call(void 0,
|
|
5283
5419
|
(txHash, destinationTxHash, context) => {
|
|
5284
5420
|
logFlow("deposit:complete", { txHash, destinationTxHash, ...context });
|
|
5285
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
5421
|
+
_optionalChain([onLifecycleRef, 'access', _181 => _181.current, 'optionalCall', _182 => _182({
|
|
5286
5422
|
type: "complete",
|
|
5287
5423
|
txHash,
|
|
5288
5424
|
destinationTxHash,
|
|
@@ -5294,14 +5430,14 @@ function DepositFlow({
|
|
|
5294
5430
|
const handleDepositFailed = _react.useCallback.call(void 0,
|
|
5295
5431
|
(txHash, error) => {
|
|
5296
5432
|
logFlowError("deposit:failed", error, { txHash });
|
|
5297
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
5433
|
+
_optionalChain([onLifecycleRef, 'access', _183 => _183.current, 'optionalCall', _184 => _184({ type: "failed", txHash, error })]);
|
|
5298
5434
|
},
|
|
5299
5435
|
[logFlowError, onLifecycleRef]
|
|
5300
5436
|
);
|
|
5301
5437
|
const handleError = _react.useCallback.call(void 0,
|
|
5302
5438
|
(message, code) => {
|
|
5303
5439
|
logFlowError("flow:error", message, { code });
|
|
5304
|
-
_optionalChain([onErrorRef, 'access',
|
|
5440
|
+
_optionalChain([onErrorRef, 'access', _185 => _185.current, 'optionalCall', _186 => _186({ message, code })]);
|
|
5305
5441
|
},
|
|
5306
5442
|
[logFlowError, onErrorRef]
|
|
5307
5443
|
);
|
|
@@ -5430,13 +5566,19 @@ function DepositFlow({
|
|
|
5430
5566
|
if (isDepositAddressMode) {
|
|
5431
5567
|
if (!dappAddress) return null;
|
|
5432
5568
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
5433
|
-
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5569
|
+
effectiveStep.type === "setup" && (activeEntry.status === "error" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5434
5570
|
AccountPreparingSkeleton,
|
|
5435
5571
|
{
|
|
5436
|
-
errorMessage:
|
|
5437
|
-
onRetry:
|
|
5572
|
+
errorMessage: _nullishCoalesce(activeEntry.message, () => ( void 0)),
|
|
5573
|
+
onRetry: () => handleRetrySetup(dappAddress)
|
|
5438
5574
|
}
|
|
5439
|
-
),
|
|
5575
|
+
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5576
|
+
DepositAddressSkeleton,
|
|
5577
|
+
{
|
|
5578
|
+
uiConfig,
|
|
5579
|
+
allowedRoutes
|
|
5580
|
+
}
|
|
5581
|
+
)),
|
|
5440
5582
|
effectiveStep.type === "deposit-address" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5441
5583
|
DepositAddressStep,
|
|
5442
5584
|
{
|
|
@@ -5447,7 +5589,7 @@ function DepositFlow({
|
|
|
5447
5589
|
allowedRoutes,
|
|
5448
5590
|
targetChain,
|
|
5449
5591
|
targetToken,
|
|
5450
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
5592
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _187 => _187.length])),
|
|
5451
5593
|
uiConfig,
|
|
5452
5594
|
onDepositSubmitted: handleDepositAddressSubmitted,
|
|
5453
5595
|
onDepositComplete: handleDepositComplete,
|
|
@@ -5455,7 +5597,7 @@ function DepositFlow({
|
|
|
5455
5597
|
onCopyAddress: () => {
|
|
5456
5598
|
const chainName = _chunk7JIDIX27cjs.getChainName.call(void 0, targetChain);
|
|
5457
5599
|
const tokenSymbol = _chunk7JIDIX27cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
5458
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
5600
|
+
_optionalChain([onEvent, 'optionalCall', _188 => _188({
|
|
5459
5601
|
type: "deposit_modal_transfer_crypto_cta_click",
|
|
5460
5602
|
default_chain: chainName,
|
|
5461
5603
|
default_token: tokenSymbol,
|
|
@@ -5471,8 +5613,8 @@ function DepositFlow({
|
|
|
5471
5613
|
}
|
|
5472
5614
|
if (isSolanaWalletMode) {
|
|
5473
5615
|
if (!dappAddress) return null;
|
|
5474
|
-
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess',
|
|
5475
|
-
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess',
|
|
5616
|
+
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess', _189 => _189.solanaAddress]);
|
|
5617
|
+
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess', _190 => _190.solanaProvider]);
|
|
5476
5618
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
5477
5619
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5478
5620
|
AccountPreparingSkeleton,
|
|
@@ -5528,7 +5670,7 @@ function DepositFlow({
|
|
|
5528
5670
|
targetToken,
|
|
5529
5671
|
service,
|
|
5530
5672
|
solanaProvider,
|
|
5531
|
-
solanaConnection: _optionalChain([reownWallet, 'optionalAccess',
|
|
5673
|
+
solanaConnection: _optionalChain([reownWallet, 'optionalAccess', _191 => _191.solanaConnection]),
|
|
5532
5674
|
uiConfig,
|
|
5533
5675
|
onConfirm: handleSolanaConfirmed,
|
|
5534
5676
|
onError: handleError,
|
|
@@ -5581,7 +5723,7 @@ function DepositFlow({
|
|
|
5581
5723
|
amount: effectiveStep.amount,
|
|
5582
5724
|
sourceSymbol: effectiveStep.sourceSymbol,
|
|
5583
5725
|
sourceDecimals: effectiveStep.sourceDecimals,
|
|
5584
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
5726
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _192 => _192.length])),
|
|
5585
5727
|
service,
|
|
5586
5728
|
directTransfer: effectiveStep.directTransfer,
|
|
5587
5729
|
onClose,
|
|
@@ -5594,13 +5736,13 @@ function DepositFlow({
|
|
|
5594
5736
|
)
|
|
5595
5737
|
] });
|
|
5596
5738
|
}
|
|
5597
|
-
if (!_optionalChain([signerContext, 'optionalAccess',
|
|
5739
|
+
if (!_optionalChain([signerContext, 'optionalAccess', _193 => _193.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _194 => _194.publicClient])) {
|
|
5598
5740
|
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\u2026" }) }) }) }) });
|
|
5599
5741
|
}
|
|
5600
5742
|
const ownerAddress = signerContext.ownerAddress;
|
|
5601
|
-
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access',
|
|
5743
|
+
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _195 => _195.walletClient, 'optionalAccess', _196 => _196.chain, 'optionalAccess', _197 => _197.id]), () => ( _optionalChain([signerContext, 'access', _198 => _198.publicClient, 'access', _199 => _199.chain, 'optionalAccess', _200 => _200.id]))), () => ( setupChainId));
|
|
5602
5744
|
const getReadClientForChain = (chainId) => {
|
|
5603
|
-
if (_optionalChain([signerContext, 'access',
|
|
5745
|
+
if (_optionalChain([signerContext, 'access', _201 => _201.publicClient, 'access', _202 => _202.chain, 'optionalAccess', _203 => _203.id]) === chainId) {
|
|
5604
5746
|
return signerContext.publicClient;
|
|
5605
5747
|
}
|
|
5606
5748
|
return _chunk2TWQGPPBcjs.getPublicClient.call(void 0, chainId);
|
|
@@ -5634,7 +5776,7 @@ function DepositFlow({
|
|
|
5634
5776
|
effectiveStep.type === "dapp-import-asset-select" && activeDappImportProvider && activeDappImportAvailability && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5635
5777
|
DappImportAssetSelectStep,
|
|
5636
5778
|
{
|
|
5637
|
-
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access',
|
|
5779
|
+
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access', _204 => _204.assets, 'access', _205 => _205[0], 'optionalAccess', _206 => _206.sourceLabel]), () => ( activeDappImportProvider.label)),
|
|
5638
5780
|
assets: activeDappImportAvailability.assets,
|
|
5639
5781
|
onSelect: handleDappImportAssetSelected
|
|
5640
5782
|
}
|
|
@@ -5651,7 +5793,7 @@ function DepositFlow({
|
|
|
5651
5793
|
chainId: effectiveStep.asset.depositChainId,
|
|
5652
5794
|
token: effectiveStep.asset.depositToken
|
|
5653
5795
|
} : void 0,
|
|
5654
|
-
defaultAmount: _nullishCoalesce(effectiveStep.
|
|
5796
|
+
defaultAmount: _nullishCoalesce(effectiveStep.inputAmountUsd, () => ( defaultAmount)),
|
|
5655
5797
|
switchChain: signerContext.switchChain,
|
|
5656
5798
|
targetChain,
|
|
5657
5799
|
targetToken,
|
|
@@ -5661,7 +5803,7 @@ function DepositFlow({
|
|
|
5661
5803
|
onContinue: handleAmountContinue,
|
|
5662
5804
|
onCtaClick: (ctaName) => {
|
|
5663
5805
|
const receiveSymbol = _chunk7JIDIX27cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
5664
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
5806
|
+
_optionalChain([onEvent, 'optionalCall', _207 => _207({
|
|
5665
5807
|
type: "deposit_modal_connected_wallet_enter_value_cta_click",
|
|
5666
5808
|
send_token: effectiveStep.asset.symbol,
|
|
5667
5809
|
receive_token: receiveSymbol,
|
|
@@ -5724,7 +5866,7 @@ function DepositFlow({
|
|
|
5724
5866
|
amount: effectiveStep.amount,
|
|
5725
5867
|
sourceSymbol: effectiveStep.sourceSymbol,
|
|
5726
5868
|
sourceDecimals: effectiveStep.sourceDecimals,
|
|
5727
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
5869
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _208 => _208.length])),
|
|
5728
5870
|
service,
|
|
5729
5871
|
directTransfer: effectiveStep.directTransfer,
|
|
5730
5872
|
uiConfig,
|
|
@@ -5863,7 +6005,7 @@ function DepositHistoryPanel({
|
|
|
5863
6005
|
);
|
|
5864
6006
|
const visibleDeposits = _react.useMemo.call(void 0, () => {
|
|
5865
6007
|
const sourceHashes = new Set(
|
|
5866
|
-
deposits.map((d) => _optionalChain([d, 'access',
|
|
6008
|
+
deposits.map((d) => _optionalChain([d, 'access', _209 => _209.sourceTxHash, 'optionalAccess', _210 => _210.toLowerCase, 'call', _211 => _211()])).filter((h) => Boolean(h))
|
|
5867
6009
|
);
|
|
5868
6010
|
return deposits.filter(
|
|
5869
6011
|
(d) => !(d.txHash && sourceHashes.has(d.txHash.toLowerCase()))
|
|
@@ -5985,7 +6127,7 @@ function HistoryCard({ deposit }) {
|
|
|
5985
6127
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `rs-history-badge rs-history-badge--${status}`, children: STATUS_LABEL[status] })
|
|
5986
6128
|
] })
|
|
5987
6129
|
] }),
|
|
5988
|
-
|
|
6130
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-history-card-panel", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-history-card-panel-inner", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-history-card-details", children: [
|
|
5989
6131
|
sourceChainName && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-amount-detail-row", children: [
|
|
5990
6132
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
|
|
5991
6133
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-amount-detail-value", children: [
|
|
@@ -6017,7 +6159,7 @@ function HistoryCard({ deposit }) {
|
|
|
6017
6159
|
}
|
|
6018
6160
|
)
|
|
6019
6161
|
] })
|
|
6020
|
-
] })
|
|
6162
|
+
] }) }) })
|
|
6021
6163
|
]
|
|
6022
6164
|
}
|
|
6023
6165
|
);
|
|
@@ -6027,7 +6169,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
|
6027
6169
|
// src/DepositModal.tsx
|
|
6028
6170
|
|
|
6029
6171
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
6030
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
6172
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-EC4DJ3EC.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
6031
6173
|
);
|
|
6032
6174
|
function sortByCreatedAtDesc(items) {
|
|
6033
6175
|
return [...items].sort((a, b) => {
|
|
@@ -6106,7 +6248,7 @@ function DepositModalInner({
|
|
|
6106
6248
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
6107
6249
|
void 0
|
|
6108
6250
|
);
|
|
6109
|
-
const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
6251
|
+
const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _212 => _212.showHistoryButton]), () => ( false));
|
|
6110
6252
|
const historyButtonVisible = showHistoryButton && (currentScreen === "select-asset" || currentScreen === "deposit-address");
|
|
6111
6253
|
const [historyOpen, setHistoryOpen] = _react.useState.call(void 0, false);
|
|
6112
6254
|
const [historyDeposits, setHistoryDeposits] = _react.useState.call(void 0, []);
|
|
@@ -6144,7 +6286,7 @@ function DepositModalInner({
|
|
|
6144
6286
|
}, [solanaRpcUrl]);
|
|
6145
6287
|
_react.useEffect.call(void 0, () => {
|
|
6146
6288
|
if (isOpen) {
|
|
6147
|
-
_optionalChain([onReadyRef, 'access',
|
|
6289
|
+
_optionalChain([onReadyRef, 'access', _213 => _213.current, 'optionalCall', _214 => _214()]);
|
|
6148
6290
|
}
|
|
6149
6291
|
}, [isOpen, onReadyRef]);
|
|
6150
6292
|
const handleStepChange = _react.useCallback.call(void 0,
|
|
@@ -6223,7 +6365,7 @@ function DepositModalInner({
|
|
|
6223
6365
|
const onLifecycleRef = _chunk2TWQGPPBcjs.useLatestRef.call(void 0, onLifecycle);
|
|
6224
6366
|
const handleLifecycle = _react.useCallback.call(void 0,
|
|
6225
6367
|
(event) => {
|
|
6226
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6368
|
+
_optionalChain([onLifecycleRef, 'access', _215 => _215.current, 'optionalCall', _216 => _216(event)]);
|
|
6227
6369
|
if (event.type === "smart-account-changed" && !event.evm && !event.solana) {
|
|
6228
6370
|
historyStaleRef.current = true;
|
|
6229
6371
|
}
|
|
@@ -6249,7 +6391,7 @@ function DepositModalInner({
|
|
|
6249
6391
|
store.dispatch({ type: "flow/reset" });
|
|
6250
6392
|
}
|
|
6251
6393
|
}, [isOpen, store]);
|
|
6252
|
-
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
6394
|
+
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _217 => _217.showBackButton]), () => ( true));
|
|
6253
6395
|
const canGoBack = backHandler !== void 0;
|
|
6254
6396
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6255
6397
|
_chunk2TWQGPPBcjs.Modal,
|