@rhinestone/deposit-modal 0.3.0-alpha.10 → 0.3.0-alpha.11
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-KXFF6ZXY.cjs} +2 -2
- package/dist/{DepositModalReown-2S76TEXU.mjs → DepositModalReown-UNFGBOIJ.mjs} +1 -1
- package/dist/{chunk-N5NOJ4ZV.mjs → chunk-V63GWJHB.mjs} +7 -6
- package/dist/{chunk-HUPEN2T5.cjs → chunk-Y4CESMTH.cjs} +108 -107
- 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/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkY4CESMTHcjs = require('./chunk-Y4CESMTH.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -35,7 +35,7 @@ function DepositModalWithReown(props) {
|
|
|
35
35
|
reown.disconnect();
|
|
36
36
|
}, [reown.disconnect]);
|
|
37
37
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
38
|
-
|
|
38
|
+
_chunkY4CESMTHcjs.DepositModalInner,
|
|
39
39
|
{
|
|
40
40
|
...props,
|
|
41
41
|
reownWallet: reownWithSolana,
|
|
@@ -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 = asChainId(source?.chain) ?? asChainId(deposit?.chain);
|
|
1383
|
+
const token = asString(source?.asset) ?? asString(deposit?.asset) ?? asString(deposit?.token);
|
|
1383
1384
|
const solanaMeta = chainId === "solana" ? resolveSolanaTokenMeta(token) : {};
|
|
1384
1385
|
return {
|
|
1385
1386
|
chainId,
|
|
1386
|
-
amount: asAmount(source?.amount),
|
|
1387
|
+
amount: asAmount(source?.amount) ?? asAmount(deposit?.amount),
|
|
1387
1388
|
token,
|
|
1388
1389
|
...solanaMeta
|
|
1389
1390
|
};
|
|
@@ -6027,7 +6028,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
|
6027
6028
|
// src/DepositModal.tsx
|
|
6028
6029
|
import { jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
6029
6030
|
var ReownDepositInner = lazy2(
|
|
6030
|
-
() => import("./DepositModalReown-
|
|
6031
|
+
() => import("./DepositModalReown-UNFGBOIJ.mjs").then((m) => ({ default: m.DepositModalReown }))
|
|
6031
6032
|
);
|
|
6032
6033
|
function sortByCreatedAtDesc(items) {
|
|
6033
6034
|
return [...items].sort((a, b) => {
|
|
@@ -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, );
|
|
@@ -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
|
{
|
|
@@ -2027,7 +2028,7 @@ function SolanaTokenSelectStep({
|
|
|
2027
2028
|
setTokenBalances(results);
|
|
2028
2029
|
setLoading(false);
|
|
2029
2030
|
const totalUsd = results.reduce((sum, r) => sum + r.balanceUsd, 0);
|
|
2030
|
-
_optionalChain([onTotalBalanceComputed, 'optionalCall',
|
|
2031
|
+
_optionalChain([onTotalBalanceComputed, 'optionalCall', _75 => _75(totalUsd)]);
|
|
2031
2032
|
}
|
|
2032
2033
|
void loadBalances();
|
|
2033
2034
|
return () => {
|
|
@@ -2173,7 +2174,7 @@ function SolanaAmountStep({
|
|
|
2173
2174
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
2174
2175
|
const hasAppliedDefaultRef = _react.useRef.call(void 0, false);
|
|
2175
2176
|
const isSourceStablecoin = _chunk7JIDIX27cjs.isStablecoinSymbol.call(void 0, token.symbol);
|
|
2176
|
-
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess',
|
|
2177
|
+
const isMaxDefault = _optionalChain([defaultAmount, 'optionalAccess', _76 => _76.trim, 'call', _77 => _77(), 'access', _78 => _78.toLowerCase, 'call', _79 => _79()]) === "max";
|
|
2177
2178
|
const tokenPriceUsd = _react.useMemo.call(void 0, () => {
|
|
2178
2179
|
if (isSourceStablecoin) return 1;
|
|
2179
2180
|
try {
|
|
@@ -2275,8 +2276,8 @@ function SolanaAmountStep({
|
|
|
2275
2276
|
return null;
|
|
2276
2277
|
}
|
|
2277
2278
|
}, [numericAmount, isSourceStablecoin, hasPricing, tokenPriceUsd, token.decimals]);
|
|
2278
|
-
const minDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
2279
|
-
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
2279
|
+
const minDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _80 => _80.minDepositUsd]), () => ( null));
|
|
2280
|
+
const maxDepositUsd = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _81 => _81.maxDepositUsd]), () => ( null));
|
|
2280
2281
|
const isBelowMin = minDepositUsd !== null && numericAmount > 0 && numericAmount < minDepositUsd;
|
|
2281
2282
|
const isAboveMax = maxDepositUsd !== null && numericAmount > maxDepositUsd;
|
|
2282
2283
|
const exceedsBalance = Boolean(
|
|
@@ -2453,7 +2454,7 @@ var DEFAULT_SOLANA_RPC_URL = "https://api.mainnet.solana.com";
|
|
|
2453
2454
|
var configuredSolanaRpcUrl = null;
|
|
2454
2455
|
var cachedConnections = /* @__PURE__ */ new Map();
|
|
2455
2456
|
function configureSolanaRpcUrl(rpcUrl) {
|
|
2456
|
-
const normalized = _optionalChain([rpcUrl, 'optionalAccess',
|
|
2457
|
+
const normalized = _optionalChain([rpcUrl, 'optionalAccess', _82 => _82.trim, 'call', _83 => _83()]);
|
|
2457
2458
|
configuredSolanaRpcUrl = normalized ? normalized : null;
|
|
2458
2459
|
cachedConnections.clear();
|
|
2459
2460
|
}
|
|
@@ -2573,8 +2574,8 @@ function SolanaConfirmStep({
|
|
|
2573
2574
|
const targetChainIcon = _chunk7JIDIX27cjs.getChainIcon.call(void 0, targetChain);
|
|
2574
2575
|
const sourceTokenIcon = _chunk7JIDIX27cjs.getTokenIcon.call(void 0, token.symbol);
|
|
2575
2576
|
const targetTokenIcon = _chunk7JIDIX27cjs.getTokenIcon.call(void 0, targetSymbol);
|
|
2576
|
-
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
2577
|
-
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
2577
|
+
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _84 => _84.feeSponsored]), () => ( false));
|
|
2578
|
+
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _85 => _85.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
2578
2579
|
const formattedAmount = sourceAmount && !Number.isNaN(Number(sourceAmount)) ? Number(sourceAmount).toLocaleString("en-US", {
|
|
2579
2580
|
minimumFractionDigits: 2,
|
|
2580
2581
|
maximumFractionDigits: 6
|
|
@@ -2656,7 +2657,7 @@ function SolanaConfirmStep({
|
|
|
2656
2657
|
_chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "solana-confirm", "tx:build:success", {
|
|
2657
2658
|
token: token.symbol,
|
|
2658
2659
|
instructionCount: transaction.instructions.length,
|
|
2659
|
-
feePayer: _optionalChain([transaction, 'access',
|
|
2660
|
+
feePayer: _optionalChain([transaction, 'access', _86 => _86.feePayer, 'optionalAccess', _87 => _87.toBase58, 'call', _88 => _88()]),
|
|
2660
2661
|
recentBlockhash: transaction.recentBlockhash
|
|
2661
2662
|
});
|
|
2662
2663
|
const txHash = await sendSolanaTransaction(
|
|
@@ -2678,7 +2679,7 @@ function SolanaConfirmStep({
|
|
|
2678
2679
|
sourceAmount
|
|
2679
2680
|
});
|
|
2680
2681
|
setError(message);
|
|
2681
|
-
_optionalChain([onError, 'optionalCall',
|
|
2682
|
+
_optionalChain([onError, 'optionalCall', _89 => _89(message, "SOLANA_TRANSFER_ERROR")]);
|
|
2682
2683
|
} finally {
|
|
2683
2684
|
setIsSubmitting(false);
|
|
2684
2685
|
}
|
|
@@ -3221,21 +3222,21 @@ var polymarketProvider = {
|
|
|
3221
3222
|
async fetchAvailability({ eoa, getPublicClient: getPublicClient2, signal }) {
|
|
3222
3223
|
const proxyWallet = await fetchPolymarketProxyWallet(eoa, signal);
|
|
3223
3224
|
if (!proxyWallet) return null;
|
|
3224
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
3225
|
+
if (_optionalChain([signal, 'optionalAccess', _90 => _90.aborted])) return null;
|
|
3225
3226
|
const polygonClient = getPublicClient2(POLYMARKET_POLYGON_CHAIN_ID);
|
|
3226
3227
|
if (!polygonClient) return null;
|
|
3227
3228
|
const balances = await readPolymarketBalances({
|
|
3228
3229
|
publicClient: polygonClient,
|
|
3229
3230
|
proxyWallet
|
|
3230
3231
|
});
|
|
3231
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
3232
|
+
if (_optionalChain([signal, 'optionalAccess', _91 => _91.aborted])) return null;
|
|
3232
3233
|
if (balances.pusd === 0n && balances.usdce === 0n) return null;
|
|
3233
3234
|
const walletKind = await detectPolymarketWalletKind({
|
|
3234
3235
|
publicClient: polygonClient,
|
|
3235
3236
|
proxyWallet,
|
|
3236
3237
|
eoa
|
|
3237
3238
|
});
|
|
3238
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
3239
|
+
if (_optionalChain([signal, 'optionalAccess', _92 => _92.aborted])) return null;
|
|
3239
3240
|
if (!walletKind) return null;
|
|
3240
3241
|
const assets = [];
|
|
3241
3242
|
if (balances.pusd > 0n) {
|
|
@@ -3598,12 +3599,12 @@ function applyAction(state, action) {
|
|
|
3598
3599
|
requestKey: action.requestKey,
|
|
3599
3600
|
cacheKey: action.cacheKey,
|
|
3600
3601
|
status: "loading",
|
|
3601
|
-
smartAccount: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
3602
|
-
sessionOwnerAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
3603
|
-
solanaDepositAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
3602
|
+
smartAccount: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _93 => _93.smartAccount]), () => ( null)),
|
|
3603
|
+
sessionOwnerAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _94 => _94.sessionOwnerAddress]), () => ( null)),
|
|
3604
|
+
solanaDepositAddress: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _95 => _95.solanaDepositAddress]), () => ( null)),
|
|
3604
3605
|
message: null,
|
|
3605
3606
|
cacheable: action.cacheable,
|
|
3606
|
-
attemptNonce: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
3607
|
+
attemptNonce: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _96 => _96.attemptNonce]), () => ( 0))
|
|
3607
3608
|
}));
|
|
3608
3609
|
}
|
|
3609
3610
|
case "setup/ready": {
|
|
@@ -4015,14 +4016,14 @@ function computeCacheKey(input, sessionOwnerAddress) {
|
|
|
4015
4016
|
});
|
|
4016
4017
|
}
|
|
4017
4018
|
function computeIsCacheable(input) {
|
|
4018
|
-
return !input.forceRegister && !(_nullishCoalesce(_optionalChain([input, 'access',
|
|
4019
|
+
return !input.forceRegister && !(_nullishCoalesce(_optionalChain([input, 'access', _97 => _97.postBridgeActions, 'optionalAccess', _98 => _98.length]), () => ( 0)));
|
|
4019
4020
|
}
|
|
4020
4021
|
var SETUP_REQUEST_DEDUPE_TTL_MS = 3e4;
|
|
4021
4022
|
var setupRequestDedupe = /* @__PURE__ */ new Map();
|
|
4022
4023
|
function readDedupedAccountSetupResult(requestKey) {
|
|
4023
4024
|
const now = Date.now();
|
|
4024
4025
|
const existing = setupRequestDedupe.get(requestKey);
|
|
4025
|
-
if (_optionalChain([existing, 'optionalAccess',
|
|
4026
|
+
if (_optionalChain([existing, 'optionalAccess', _99 => _99.settled]) && existing.expiresAt > now && existing.result) {
|
|
4026
4027
|
return existing.result;
|
|
4027
4028
|
}
|
|
4028
4029
|
return null;
|
|
@@ -4036,7 +4037,7 @@ async function runAccountSetup(input, deps) {
|
|
|
4036
4037
|
_chunk2TWQGPPBcjs.debugLog.call(void 0, debug, "account-setup", "setup:start", {
|
|
4037
4038
|
owner: input.ownerAddress,
|
|
4038
4039
|
sessionOwner: sessionOwner.address,
|
|
4039
|
-
hasPostBridgeActions: Boolean(_optionalChain([input, 'access',
|
|
4040
|
+
hasPostBridgeActions: Boolean(_optionalChain([input, 'access', _100 => _100.postBridgeActions, 'optionalAccess', _101 => _101.length])),
|
|
4040
4041
|
forceRegister: _nullishCoalesce(input.forceRegister, () => ( false))
|
|
4041
4042
|
});
|
|
4042
4043
|
const setup = await service.setupAccount({
|
|
@@ -4098,10 +4099,10 @@ async function runAccountSetup(input, deps) {
|
|
|
4098
4099
|
chain: _chunk2TWQGPPBcjs.targetChainToCaip2.call(void 0, input.targetChain),
|
|
4099
4100
|
token: input.targetToken,
|
|
4100
4101
|
...input.recipient && { recipient: input.recipient },
|
|
4101
|
-
..._optionalChain([input, 'access',
|
|
4102
|
+
..._optionalChain([input, 'access', _102 => _102.postBridgeActions, 'optionalAccess', _103 => _103.length]) && {
|
|
4102
4103
|
postBridgeActions: input.postBridgeActions
|
|
4103
4104
|
},
|
|
4104
|
-
..._optionalChain([input, 'access',
|
|
4105
|
+
..._optionalChain([input, 'access', _104 => _104.outputTokenRules, 'optionalAccess', _105 => _105.length]) && {
|
|
4105
4106
|
outputTokenRules: input.outputTokenRules
|
|
4106
4107
|
},
|
|
4107
4108
|
...input.rejectUnmapped != null && {
|
|
@@ -4368,7 +4369,7 @@ function DepositFlow({
|
|
|
4368
4369
|
const onLifecycleRef = _chunk2TWQGPPBcjs.useLatestRef.call(void 0, onLifecycle);
|
|
4369
4370
|
const onErrorRef = _chunk2TWQGPPBcjs.useLatestRef.call(void 0, onError);
|
|
4370
4371
|
const hasInitialReownSession = Boolean(
|
|
4371
|
-
enableSolana ? _optionalChain([reownWallet, 'optionalAccess',
|
|
4372
|
+
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _106 => _106.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _107 => _107.address]) : _optionalChain([reownWallet, 'optionalAccess', _108 => _108.address])
|
|
4372
4373
|
);
|
|
4373
4374
|
const hasInitialWalletHydrationPending = Boolean(
|
|
4374
4375
|
dappAddress && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasInitialReownSession && !reownWallet.isReady)
|
|
@@ -4418,12 +4419,12 @@ function DepositFlow({
|
|
|
4418
4419
|
return null;
|
|
4419
4420
|
}, []);
|
|
4420
4421
|
const dappSwitchChain = _react.useMemo.call(void 0, () => {
|
|
4421
|
-
if (!_optionalChain([dappWalletClient, 'optionalAccess',
|
|
4422
|
+
if (!_optionalChain([dappWalletClient, 'optionalAccess', _109 => _109.switchChain])) return void 0;
|
|
4422
4423
|
return async (chainId) => {
|
|
4423
|
-
await _optionalChain([dappWalletClient, 'access',
|
|
4424
|
+
await _optionalChain([dappWalletClient, 'access', _110 => _110.switchChain, 'optionalCall', _111 => _111({ id: chainId })]);
|
|
4424
4425
|
};
|
|
4425
4426
|
}, [dappWalletClient]);
|
|
4426
|
-
const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
4427
|
+
const connectedWalletAddress = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _112 => _112.account, 'optionalAccess', _113 => _113.address]), () => ( null));
|
|
4427
4428
|
const walletOptions = _react.useMemo.call(void 0, () => {
|
|
4428
4429
|
const options = [];
|
|
4429
4430
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -4437,7 +4438,7 @@ function DepositFlow({
|
|
|
4437
4438
|
});
|
|
4438
4439
|
seen.add(id);
|
|
4439
4440
|
}
|
|
4440
|
-
if (enableSolana && _optionalChain([reownWallet, 'optionalAccess',
|
|
4441
|
+
if (enableSolana && _optionalChain([reownWallet, 'optionalAccess', _114 => _114.isConnected]) && reownWallet.isSolana && reownWallet.solanaAddress && dappAddress) {
|
|
4441
4442
|
const id = _nullishCoalesce(reownWallet.caipAddress, () => ( `solana:${reownWallet.solanaAddress}`));
|
|
4442
4443
|
if (!seen.has(id)) {
|
|
4443
4444
|
options.push({
|
|
@@ -4449,7 +4450,7 @@ function DepositFlow({
|
|
|
4449
4450
|
});
|
|
4450
4451
|
seen.add(id);
|
|
4451
4452
|
}
|
|
4452
|
-
} else if (_optionalChain([reownWallet, 'optionalAccess',
|
|
4453
|
+
} else if (_optionalChain([reownWallet, 'optionalAccess', _115 => _115.address]) && reownWallet.isConnected && reownWallet.walletClient && reownWallet.publicClient && !seen.has(`evm:${reownWallet.address.toLowerCase()}`)) {
|
|
4453
4454
|
const id = `evm:${reownWallet.address.toLowerCase()}`;
|
|
4454
4455
|
if (!seen.has(id)) {
|
|
4455
4456
|
options.push({
|
|
@@ -4466,20 +4467,20 @@ function DepositFlow({
|
|
|
4466
4467
|
}, [
|
|
4467
4468
|
connectedWalletAddress,
|
|
4468
4469
|
dappAddress,
|
|
4469
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4470
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4471
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4472
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4473
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4470
|
+
_optionalChain([reownWallet, 'optionalAccess', _116 => _116.address]),
|
|
4471
|
+
_optionalChain([reownWallet, 'optionalAccess', _117 => _117.isConnected]),
|
|
4472
|
+
_optionalChain([reownWallet, 'optionalAccess', _118 => _118.walletClient]),
|
|
4473
|
+
_optionalChain([reownWallet, 'optionalAccess', _119 => _119.publicClient]),
|
|
4474
|
+
_optionalChain([reownWallet, 'optionalAccess', _120 => _120.icon]),
|
|
4474
4475
|
enableSolana,
|
|
4475
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4476
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4477
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4476
|
+
_optionalChain([reownWallet, 'optionalAccess', _121 => _121.isSolana]),
|
|
4477
|
+
_optionalChain([reownWallet, 'optionalAccess', _122 => _122.solanaAddress]),
|
|
4478
|
+
_optionalChain([reownWallet, 'optionalAccess', _123 => _123.caipAddress])
|
|
4478
4479
|
]);
|
|
4479
|
-
const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess',
|
|
4480
|
+
const canAutoLock = _optionalChain([dappWalletClient, 'optionalAccess', _124 => _124.account]) && dappAddress && !reownWallet;
|
|
4480
4481
|
const hasWalletOptions = walletOptions.length > 0;
|
|
4481
4482
|
const hasReownSession = Boolean(
|
|
4482
|
-
enableSolana ? _optionalChain([reownWallet, 'optionalAccess',
|
|
4483
|
+
enableSolana ? _optionalChain([reownWallet, 'optionalAccess', _125 => _125.isConnected]) || _optionalChain([reownWallet, 'optionalAccess', _126 => _126.address]) : _optionalChain([reownWallet, 'optionalAccess', _127 => _127.address])
|
|
4483
4484
|
);
|
|
4484
4485
|
const isWalletHydrationPending = Boolean(
|
|
4485
4486
|
dappAddress && !hasWalletOptions && (hasDappWalletClientProp && dappWalletClient === void 0 || reownWallet && !hasReownSession && !reownWallet.isReady)
|
|
@@ -4543,7 +4544,7 @@ function DepositFlow({
|
|
|
4543
4544
|
};
|
|
4544
4545
|
}
|
|
4545
4546
|
if (canAutoLock) {
|
|
4546
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
4547
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _128 => _128.chain, 'optionalAccess', _129 => _129.id]), () => ( setupChainId));
|
|
4547
4548
|
return {
|
|
4548
4549
|
ownerAddress: dappWalletClient.account.address,
|
|
4549
4550
|
walletClient: dappWalletClient,
|
|
@@ -4565,8 +4566,8 @@ function DepositFlow({
|
|
|
4565
4566
|
switchChain: void 0
|
|
4566
4567
|
};
|
|
4567
4568
|
}
|
|
4568
|
-
if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess',
|
|
4569
|
-
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess',
|
|
4569
|
+
if (selectedOption.kind === "connected" && _optionalChain([dappWalletClient, 'optionalAccess', _130 => _130.account]) && selectedOption.address && dappWalletClient.account.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
4570
|
+
const fallbackChainId = _nullishCoalesce(_optionalChain([dappWalletClient, 'optionalAccess', _131 => _131.chain, 'optionalAccess', _132 => _132.id]), () => ( setupChainId));
|
|
4570
4571
|
return {
|
|
4571
4572
|
ownerAddress: dappWalletClient.account.address,
|
|
4572
4573
|
walletClient: dappWalletClient,
|
|
@@ -4574,7 +4575,7 @@ function DepositFlow({
|
|
|
4574
4575
|
switchChain: dappSwitchChain
|
|
4575
4576
|
};
|
|
4576
4577
|
}
|
|
4577
|
-
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess',
|
|
4578
|
+
if (selectedOption.kind === "external" && _optionalChain([reownWallet, 'optionalAccess', _133 => _133.address]) && selectedOption.address && reownWallet.address.toLowerCase() === selectedOption.address.toLowerCase()) {
|
|
4578
4579
|
return {
|
|
4579
4580
|
ownerAddress: reownWallet.address,
|
|
4580
4581
|
walletClient: reownWallet.walletClient,
|
|
@@ -4641,37 +4642,37 @@ function DepositFlow({
|
|
|
4641
4642
|
const selectedEvmWalletOwner = _react.useMemo.call(void 0, () => {
|
|
4642
4643
|
if (!selectedWalletId) return null;
|
|
4643
4644
|
const opt = walletOptions.find((o) => o.id === selectedWalletId);
|
|
4644
|
-
if (_optionalChain([opt, 'optionalAccess',
|
|
4645
|
+
if (_optionalChain([opt, 'optionalAccess', _134 => _134.kind]) === "external" && opt.address) {
|
|
4645
4646
|
return opt.address;
|
|
4646
4647
|
}
|
|
4647
|
-
if (_optionalChain([opt, 'optionalAccess',
|
|
4648
|
+
if (_optionalChain([opt, 'optionalAccess', _135 => _135.kind]) === "connected" && opt.address) {
|
|
4648
4649
|
return opt.address;
|
|
4649
4650
|
}
|
|
4650
4651
|
return null;
|
|
4651
4652
|
}, [selectedWalletId, walletOptions]);
|
|
4652
4653
|
const dappImportOwner = _react.useMemo.call(void 0, () => {
|
|
4653
4654
|
if (selectedEvmWalletOwner) return selectedEvmWalletOwner;
|
|
4654
|
-
if (_optionalChain([reownWallet, 'optionalAccess',
|
|
4655
|
+
if (_optionalChain([reownWallet, 'optionalAccess', _136 => _136.address]) && reownWallet.isConnected) {
|
|
4655
4656
|
return reownWallet.address;
|
|
4656
4657
|
}
|
|
4657
4658
|
if (connectedWalletAddress) return connectedWalletAddress;
|
|
4658
4659
|
return null;
|
|
4659
4660
|
}, [
|
|
4660
4661
|
selectedEvmWalletOwner,
|
|
4661
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4662
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
4662
|
+
_optionalChain([reownWallet, 'optionalAccess', _137 => _137.address]),
|
|
4663
|
+
_optionalChain([reownWallet, 'optionalAccess', _138 => _138.isConnected]),
|
|
4663
4664
|
connectedWalletAddress
|
|
4664
4665
|
]);
|
|
4665
4666
|
const activeOwner = _react.useMemo.call(void 0,
|
|
4666
4667
|
() => resolveOwnerForMode(flowMode, {
|
|
4667
4668
|
dappAddress,
|
|
4668
|
-
walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess',
|
|
4669
|
+
walletOwner: _nullishCoalesce(_optionalChain([signerContext, 'optionalAccess', _139 => _139.ownerAddress]), () => ( (canAutoLock ? connectedWalletAddress : selectedEvmWalletOwner))),
|
|
4669
4670
|
dappImportOwner
|
|
4670
4671
|
}),
|
|
4671
4672
|
[
|
|
4672
4673
|
flowMode,
|
|
4673
4674
|
dappAddress,
|
|
4674
|
-
_optionalChain([signerContext, 'optionalAccess',
|
|
4675
|
+
_optionalChain([signerContext, 'optionalAccess', _140 => _140.ownerAddress]),
|
|
4675
4676
|
canAutoLock,
|
|
4676
4677
|
connectedWalletAddress,
|
|
4677
4678
|
selectedEvmWalletOwner,
|
|
@@ -4700,12 +4701,12 @@ function DepositFlow({
|
|
|
4700
4701
|
return;
|
|
4701
4702
|
}
|
|
4702
4703
|
lastActiveSetupLifecycleKeyRef.current = lifecycleKey;
|
|
4703
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
4704
|
+
_optionalChain([onLifecycleRef, 'access', _141 => _141.current, 'optionalCall', _142 => _142({
|
|
4704
4705
|
type: "smart-account-changed",
|
|
4705
4706
|
evm: activeEntry.smartAccount,
|
|
4706
4707
|
solana: _nullishCoalesce(activeEntry.solanaDepositAddress, () => ( null))
|
|
4707
4708
|
})]);
|
|
4708
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
4709
|
+
_optionalChain([onLifecycleRef, 'access', _143 => _143.current, 'optionalCall', _144 => _144({
|
|
4709
4710
|
type: "connected",
|
|
4710
4711
|
address: activeOwner,
|
|
4711
4712
|
smartAccount: activeEntry.smartAccount
|
|
@@ -4738,7 +4739,7 @@ function DepositFlow({
|
|
|
4738
4739
|
const currentBackHandler = canGoBackFromHere ? handleBack : void 0;
|
|
4739
4740
|
const currentScreen = showConnectStep ? "connect" : effectiveStep.type;
|
|
4740
4741
|
_react.useEffect.call(void 0, () => {
|
|
4741
|
-
_optionalChain([onStepChangeRef, 'access',
|
|
4742
|
+
_optionalChain([onStepChangeRef, 'access', _145 => _145.current, 'optionalCall', _146 => _146(currentBackHandler, currentScreen)]);
|
|
4742
4743
|
}, [currentBackHandler, currentScreen, onStepChangeRef]);
|
|
4743
4744
|
const stepSendToken = effectiveStep.type === "amount" ? effectiveStep.asset.symbol : null;
|
|
4744
4745
|
const stepOpenEventKey = effectiveStep.type === "select-asset" ? "select-asset" : effectiveStep.type === "deposit-address" ? "deposit-address" : effectiveStep.type === "amount" && stepSendToken ? `amount:${stepSendToken.toLowerCase()}` : null;
|
|
@@ -4753,7 +4754,7 @@ function DepositFlow({
|
|
|
4753
4754
|
}
|
|
4754
4755
|
lastStepOpenEventKeyRef.current = stepOpenEventKey;
|
|
4755
4756
|
if (effectiveStep.type === "select-asset") {
|
|
4756
|
-
_optionalChain([onEventRef, 'access',
|
|
4757
|
+
_optionalChain([onEventRef, 'access', _147 => _147.current, 'optionalCall', _148 => _148({
|
|
4757
4758
|
type: "deposit_modal_connected_wallet_select_source_open",
|
|
4758
4759
|
total_balance_in_external_wallet: totalBalanceUsd,
|
|
4759
4760
|
pred_balance: totalBalanceUsd
|
|
@@ -4761,7 +4762,7 @@ function DepositFlow({
|
|
|
4761
4762
|
} else if (effectiveStep.type === "deposit-address") {
|
|
4762
4763
|
const chainName = _chunk7JIDIX27cjs.getChainName.call(void 0, targetChain);
|
|
4763
4764
|
const tokenSymbol = _chunk7JIDIX27cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
4764
|
-
_optionalChain([onEventRef, 'access',
|
|
4765
|
+
_optionalChain([onEventRef, 'access', _149 => _149.current, 'optionalCall', _150 => _150({
|
|
4765
4766
|
type: "deposit_modal_transfer_crypto_open",
|
|
4766
4767
|
default_chain: chainName,
|
|
4767
4768
|
default_token: tokenSymbol,
|
|
@@ -4769,7 +4770,7 @@ function DepositFlow({
|
|
|
4769
4770
|
})]);
|
|
4770
4771
|
} else if (effectiveStep.type === "amount" && stepSendToken) {
|
|
4771
4772
|
const receiveSymbol = _chunk7JIDIX27cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
4772
|
-
_optionalChain([onEventRef, 'access',
|
|
4773
|
+
_optionalChain([onEventRef, 'access', _151 => _151.current, 'optionalCall', _152 => _152({
|
|
4773
4774
|
type: "deposit_modal_connected_wallet_enter_value_open",
|
|
4774
4775
|
send_token: stepSendToken,
|
|
4775
4776
|
receive_token: receiveSymbol,
|
|
@@ -4802,7 +4803,7 @@ function DepositFlow({
|
|
|
4802
4803
|
targetToken
|
|
4803
4804
|
]);
|
|
4804
4805
|
_react.useEffect.call(void 0, () => {
|
|
4805
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
4806
|
+
_optionalChain([onLifecycleRef, 'access', _153 => _153.current, 'optionalCall', _154 => _154({
|
|
4806
4807
|
type: "balance-changed",
|
|
4807
4808
|
totalUsd: totalBalanceUsd
|
|
4808
4809
|
})]);
|
|
@@ -4816,7 +4817,7 @@ function DepositFlow({
|
|
|
4816
4817
|
const handleConfirmWallet = _react.useCallback.call(void 0,
|
|
4817
4818
|
(walletId) => {
|
|
4818
4819
|
const selectedOption = walletOptions.find((o) => o.id === walletId);
|
|
4819
|
-
const mode = enableSolana && _optionalChain([selectedOption, 'optionalAccess',
|
|
4820
|
+
const mode = enableSolana && _optionalChain([selectedOption, 'optionalAccess', _155 => _155.kind]) === "solana" ? "solana-wallet" : "wallet";
|
|
4820
4821
|
storeApi.dispatch({
|
|
4821
4822
|
type: "connect/wallet-confirmed",
|
|
4822
4823
|
walletId,
|
|
@@ -4826,7 +4827,7 @@ function DepositFlow({
|
|
|
4826
4827
|
[walletOptions, enableSolana, storeApi]
|
|
4827
4828
|
);
|
|
4828
4829
|
const isSolanaWalletConnected = Boolean(
|
|
4829
|
-
enableSolana && _optionalChain([reownWallet, 'optionalAccess',
|
|
4830
|
+
enableSolana && _optionalChain([reownWallet, 'optionalAccess', _156 => _156.isConnected]) && _optionalChain([reownWallet, 'optionalAccess', _157 => _157.isSolana])
|
|
4830
4831
|
);
|
|
4831
4832
|
const dappImportsKey = dappImports ? Object.keys(dappImports).filter((k) => dappImports[k]).sort().join(",") : "";
|
|
4832
4833
|
const enabledDappImportProviders = _react.useMemo.call(void 0,
|
|
@@ -4839,7 +4840,7 @@ function DepositFlow({
|
|
|
4839
4840
|
const owner = dappImportOwner;
|
|
4840
4841
|
if (owner) {
|
|
4841
4842
|
const wallet = walletOptions.find(
|
|
4842
|
-
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess',
|
|
4843
|
+
(o) => _optionalChain([(_nullishCoalesce(o.address, () => ( null))), 'optionalAccess', _158 => _158.toLowerCase, 'call', _159 => _159()]) === owner.toLowerCase()
|
|
4843
4844
|
);
|
|
4844
4845
|
if (wallet) {
|
|
4845
4846
|
storeApi.dispatch({
|
|
@@ -4920,7 +4921,7 @@ function DepositFlow({
|
|
|
4920
4921
|
if (!dappImportOwner) {
|
|
4921
4922
|
return { ...baseRow, status: "needs-connect" };
|
|
4922
4923
|
}
|
|
4923
|
-
const availabilityEntry = _optionalChain([dappImportAvailabilityOwner, 'optionalAccess',
|
|
4924
|
+
const availabilityEntry = _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _160 => _160.toLowerCase, 'call', _161 => _161()]) === dappImportOwner.toLowerCase() ? dappImportAvailability[provider.id] : void 0;
|
|
4924
4925
|
const dappImportSetup = readSetupForOwner(setupSlice, dappImportOwner);
|
|
4925
4926
|
if (availabilityEntry === "loading" || availabilityEntry === void 0) {
|
|
4926
4927
|
return { ...baseRow, status: "loading" };
|
|
@@ -4968,7 +4969,7 @@ function DepositFlow({
|
|
|
4968
4969
|
}, [activeDappImportProviderId, enabledDappImportProviders]);
|
|
4969
4970
|
const activeDappImportAvailability = _react.useMemo.call(void 0, () => {
|
|
4970
4971
|
if (!activeDappImportProviderId) return null;
|
|
4971
|
-
if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess',
|
|
4972
|
+
if (!dappImportOwner || _optionalChain([dappImportAvailabilityOwner, 'optionalAccess', _162 => _162.toLowerCase, 'call', _163 => _163()]) !== dappImportOwner.toLowerCase()) {
|
|
4972
4973
|
return null;
|
|
4973
4974
|
}
|
|
4974
4975
|
const entry = dappImportAvailability[activeDappImportProviderId];
|
|
@@ -4981,7 +4982,7 @@ function DepositFlow({
|
|
|
4981
4982
|
dappImportOwner
|
|
4982
4983
|
]);
|
|
4983
4984
|
const handleNewDeposit = _react.useCallback.call(void 0, () => {
|
|
4984
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
4985
|
+
_optionalChain([onLifecycleRef, 'access', _164 => _164.current, 'optionalCall', _165 => _165({
|
|
4985
4986
|
type: "smart-account-changed",
|
|
4986
4987
|
evm: null,
|
|
4987
4988
|
solana: null
|
|
@@ -5029,13 +5030,13 @@ function DepositFlow({
|
|
|
5029
5030
|
};
|
|
5030
5031
|
push(dappAddress);
|
|
5031
5032
|
push(connectedWalletAddress);
|
|
5032
|
-
push(_optionalChain([reownWallet, 'optionalAccess',
|
|
5033
|
+
push(_optionalChain([reownWallet, 'optionalAccess', _166 => _166.address]));
|
|
5033
5034
|
push(dappImportOwner);
|
|
5034
5035
|
return owners;
|
|
5035
5036
|
}, [
|
|
5036
5037
|
dappAddress,
|
|
5037
5038
|
connectedWalletAddress,
|
|
5038
|
-
_optionalChain([reownWallet, 'optionalAccess',
|
|
5039
|
+
_optionalChain([reownWallet, 'optionalAccess', _167 => _167.address]),
|
|
5039
5040
|
dappImportOwner
|
|
5040
5041
|
]);
|
|
5041
5042
|
_react.useEffect.call(void 0, () => {
|
|
@@ -5140,7 +5141,7 @@ function DepositFlow({
|
|
|
5140
5141
|
sourceChain: data.sourceChain,
|
|
5141
5142
|
amount: data.amount
|
|
5142
5143
|
});
|
|
5143
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
5144
|
+
_optionalChain([onLifecycleRef, 'access', _168 => _168.current, 'optionalCall', _169 => _169({ type: "submitted", ...data })]);
|
|
5144
5145
|
},
|
|
5145
5146
|
[logFlow, onLifecycleRef]
|
|
5146
5147
|
);
|
|
@@ -5197,7 +5198,7 @@ function DepositFlow({
|
|
|
5197
5198
|
sourceSymbol: tokenAtSubmit.symbol,
|
|
5198
5199
|
sourceDecimals: tokenAtSubmit.decimals
|
|
5199
5200
|
});
|
|
5200
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
5201
|
+
_optionalChain([onLifecycleRef, 'access', _170 => _170.current, 'optionalCall', _171 => _171({
|
|
5201
5202
|
type: "submitted",
|
|
5202
5203
|
txHash,
|
|
5203
5204
|
sourceChain: "solana",
|
|
@@ -5208,7 +5209,7 @@ function DepositFlow({
|
|
|
5208
5209
|
);
|
|
5209
5210
|
const handleAssetContinue = _react.useCallback.call(void 0,
|
|
5210
5211
|
(asset) => {
|
|
5211
|
-
_optionalChain([onEventRef, 'access',
|
|
5212
|
+
_optionalChain([onEventRef, 'access', _172 => _172.current, 'optionalCall', _173 => _173({
|
|
5212
5213
|
type: "deposit_modal_connected_wallet_select_source_cta_click",
|
|
5213
5214
|
total_balance_in_external_wallet: totalBalanceUsd,
|
|
5214
5215
|
pred_balance: totalBalanceUsd,
|
|
@@ -5261,8 +5262,8 @@ function DepositFlow({
|
|
|
5261
5262
|
sourceChain: chainId,
|
|
5262
5263
|
sourceToken: token,
|
|
5263
5264
|
amount,
|
|
5264
|
-
sourceSymbol: _optionalChain([dappImport, 'optionalAccess',
|
|
5265
|
-
sourceDecimals: _optionalChain([dappImport, 'optionalAccess',
|
|
5265
|
+
sourceSymbol: _optionalChain([dappImport, 'optionalAccess', _174 => _174.symbol]),
|
|
5266
|
+
sourceDecimals: _optionalChain([dappImport, 'optionalAccess', _175 => _175.decimals]),
|
|
5266
5267
|
directTransfer: !dappImport && isSameRoute2(chainId, token, targetChain, targetToken)
|
|
5267
5268
|
});
|
|
5268
5269
|
},
|
|
@@ -5270,7 +5271,7 @@ function DepositFlow({
|
|
|
5270
5271
|
);
|
|
5271
5272
|
const handleDepositSubmittedCallback = _react.useCallback.call(void 0,
|
|
5272
5273
|
(txHash, sourceChain, amount) => {
|
|
5273
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
5274
|
+
_optionalChain([onLifecycleRef, 'access', _176 => _176.current, 'optionalCall', _177 => _177({
|
|
5274
5275
|
type: "submitted",
|
|
5275
5276
|
txHash,
|
|
5276
5277
|
sourceChain,
|
|
@@ -5282,7 +5283,7 @@ function DepositFlow({
|
|
|
5282
5283
|
const handleDepositComplete = _react.useCallback.call(void 0,
|
|
5283
5284
|
(txHash, destinationTxHash, context) => {
|
|
5284
5285
|
logFlow("deposit:complete", { txHash, destinationTxHash, ...context });
|
|
5285
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
5286
|
+
_optionalChain([onLifecycleRef, 'access', _178 => _178.current, 'optionalCall', _179 => _179({
|
|
5286
5287
|
type: "complete",
|
|
5287
5288
|
txHash,
|
|
5288
5289
|
destinationTxHash,
|
|
@@ -5294,14 +5295,14 @@ function DepositFlow({
|
|
|
5294
5295
|
const handleDepositFailed = _react.useCallback.call(void 0,
|
|
5295
5296
|
(txHash, error) => {
|
|
5296
5297
|
logFlowError("deposit:failed", error, { txHash });
|
|
5297
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
5298
|
+
_optionalChain([onLifecycleRef, 'access', _180 => _180.current, 'optionalCall', _181 => _181({ type: "failed", txHash, error })]);
|
|
5298
5299
|
},
|
|
5299
5300
|
[logFlowError, onLifecycleRef]
|
|
5300
5301
|
);
|
|
5301
5302
|
const handleError = _react.useCallback.call(void 0,
|
|
5302
5303
|
(message, code) => {
|
|
5303
5304
|
logFlowError("flow:error", message, { code });
|
|
5304
|
-
_optionalChain([onErrorRef, 'access',
|
|
5305
|
+
_optionalChain([onErrorRef, 'access', _182 => _182.current, 'optionalCall', _183 => _183({ message, code })]);
|
|
5305
5306
|
},
|
|
5306
5307
|
[logFlowError, onErrorRef]
|
|
5307
5308
|
);
|
|
@@ -5447,7 +5448,7 @@ function DepositFlow({
|
|
|
5447
5448
|
allowedRoutes,
|
|
5448
5449
|
targetChain,
|
|
5449
5450
|
targetToken,
|
|
5450
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
5451
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _184 => _184.length])),
|
|
5451
5452
|
uiConfig,
|
|
5452
5453
|
onDepositSubmitted: handleDepositAddressSubmitted,
|
|
5453
5454
|
onDepositComplete: handleDepositComplete,
|
|
@@ -5455,7 +5456,7 @@ function DepositFlow({
|
|
|
5455
5456
|
onCopyAddress: () => {
|
|
5456
5457
|
const chainName = _chunk7JIDIX27cjs.getChainName.call(void 0, targetChain);
|
|
5457
5458
|
const tokenSymbol = _chunk7JIDIX27cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
5458
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
5459
|
+
_optionalChain([onEvent, 'optionalCall', _185 => _185({
|
|
5459
5460
|
type: "deposit_modal_transfer_crypto_cta_click",
|
|
5460
5461
|
default_chain: chainName,
|
|
5461
5462
|
default_token: tokenSymbol,
|
|
@@ -5471,8 +5472,8 @@ function DepositFlow({
|
|
|
5471
5472
|
}
|
|
5472
5473
|
if (isSolanaWalletMode) {
|
|
5473
5474
|
if (!dappAddress) return null;
|
|
5474
|
-
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess',
|
|
5475
|
-
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess',
|
|
5475
|
+
const solanaAddr = _optionalChain([reownWallet, 'optionalAccess', _186 => _186.solanaAddress]);
|
|
5476
|
+
const solanaProvider = _optionalChain([reownWallet, 'optionalAccess', _187 => _187.solanaProvider]);
|
|
5476
5477
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-body", children: [
|
|
5477
5478
|
effectiveStep.type === "setup" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5478
5479
|
AccountPreparingSkeleton,
|
|
@@ -5528,7 +5529,7 @@ function DepositFlow({
|
|
|
5528
5529
|
targetToken,
|
|
5529
5530
|
service,
|
|
5530
5531
|
solanaProvider,
|
|
5531
|
-
solanaConnection: _optionalChain([reownWallet, 'optionalAccess',
|
|
5532
|
+
solanaConnection: _optionalChain([reownWallet, 'optionalAccess', _188 => _188.solanaConnection]),
|
|
5532
5533
|
uiConfig,
|
|
5533
5534
|
onConfirm: handleSolanaConfirmed,
|
|
5534
5535
|
onError: handleError,
|
|
@@ -5581,7 +5582,7 @@ function DepositFlow({
|
|
|
5581
5582
|
amount: effectiveStep.amount,
|
|
5582
5583
|
sourceSymbol: effectiveStep.sourceSymbol,
|
|
5583
5584
|
sourceDecimals: effectiveStep.sourceDecimals,
|
|
5584
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
5585
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _189 => _189.length])),
|
|
5585
5586
|
service,
|
|
5586
5587
|
directTransfer: effectiveStep.directTransfer,
|
|
5587
5588
|
onClose,
|
|
@@ -5594,13 +5595,13 @@ function DepositFlow({
|
|
|
5594
5595
|
)
|
|
5595
5596
|
] });
|
|
5596
5597
|
}
|
|
5597
|
-
if (!_optionalChain([signerContext, 'optionalAccess',
|
|
5598
|
+
if (!_optionalChain([signerContext, 'optionalAccess', _190 => _190.walletClient]) || !_optionalChain([signerContext, 'optionalAccess', _191 => _191.publicClient])) {
|
|
5598
5599
|
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
5600
|
}
|
|
5600
5601
|
const ownerAddress = signerContext.ownerAddress;
|
|
5601
|
-
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access',
|
|
5602
|
+
const ownerChainId = _nullishCoalesce(_nullishCoalesce(_optionalChain([signerContext, 'access', _192 => _192.walletClient, 'optionalAccess', _193 => _193.chain, 'optionalAccess', _194 => _194.id]), () => ( _optionalChain([signerContext, 'access', _195 => _195.publicClient, 'access', _196 => _196.chain, 'optionalAccess', _197 => _197.id]))), () => ( setupChainId));
|
|
5602
5603
|
const getReadClientForChain = (chainId) => {
|
|
5603
|
-
if (_optionalChain([signerContext, 'access',
|
|
5604
|
+
if (_optionalChain([signerContext, 'access', _198 => _198.publicClient, 'access', _199 => _199.chain, 'optionalAccess', _200 => _200.id]) === chainId) {
|
|
5604
5605
|
return signerContext.publicClient;
|
|
5605
5606
|
}
|
|
5606
5607
|
return _chunk2TWQGPPBcjs.getPublicClient.call(void 0, chainId);
|
|
@@ -5634,7 +5635,7 @@ function DepositFlow({
|
|
|
5634
5635
|
effectiveStep.type === "dapp-import-asset-select" && activeDappImportProvider && activeDappImportAvailability && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5635
5636
|
DappImportAssetSelectStep,
|
|
5636
5637
|
{
|
|
5637
|
-
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access',
|
|
5638
|
+
sourceLabel: _nullishCoalesce(_optionalChain([activeDappImportAvailability, 'access', _201 => _201.assets, 'access', _202 => _202[0], 'optionalAccess', _203 => _203.sourceLabel]), () => ( activeDappImportProvider.label)),
|
|
5638
5639
|
assets: activeDappImportAvailability.assets,
|
|
5639
5640
|
onSelect: handleDappImportAssetSelected
|
|
5640
5641
|
}
|
|
@@ -5661,7 +5662,7 @@ function DepositFlow({
|
|
|
5661
5662
|
onContinue: handleAmountContinue,
|
|
5662
5663
|
onCtaClick: (ctaName) => {
|
|
5663
5664
|
const receiveSymbol = _chunk7JIDIX27cjs.getTargetTokenSymbol.call(void 0, targetToken, targetChain);
|
|
5664
|
-
_optionalChain([onEvent, 'optionalCall',
|
|
5665
|
+
_optionalChain([onEvent, 'optionalCall', _204 => _204({
|
|
5665
5666
|
type: "deposit_modal_connected_wallet_enter_value_cta_click",
|
|
5666
5667
|
send_token: effectiveStep.asset.symbol,
|
|
5667
5668
|
receive_token: receiveSymbol,
|
|
@@ -5724,7 +5725,7 @@ function DepositFlow({
|
|
|
5724
5725
|
amount: effectiveStep.amount,
|
|
5725
5726
|
sourceSymbol: effectiveStep.sourceSymbol,
|
|
5726
5727
|
sourceDecimals: effectiveStep.sourceDecimals,
|
|
5727
|
-
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess',
|
|
5728
|
+
hasPostBridgeActions: Boolean(_optionalChain([postBridgeActions, 'optionalAccess', _205 => _205.length])),
|
|
5728
5729
|
service,
|
|
5729
5730
|
directTransfer: effectiveStep.directTransfer,
|
|
5730
5731
|
uiConfig,
|
|
@@ -5863,7 +5864,7 @@ function DepositHistoryPanel({
|
|
|
5863
5864
|
);
|
|
5864
5865
|
const visibleDeposits = _react.useMemo.call(void 0, () => {
|
|
5865
5866
|
const sourceHashes = new Set(
|
|
5866
|
-
deposits.map((d) => _optionalChain([d, 'access',
|
|
5867
|
+
deposits.map((d) => _optionalChain([d, 'access', _206 => _206.sourceTxHash, 'optionalAccess', _207 => _207.toLowerCase, 'call', _208 => _208()])).filter((h) => Boolean(h))
|
|
5867
5868
|
);
|
|
5868
5869
|
return deposits.filter(
|
|
5869
5870
|
(d) => !(d.txHash && sourceHashes.has(d.txHash.toLowerCase()))
|
|
@@ -6027,7 +6028,7 @@ DepositHistoryPanel.displayName = "DepositHistoryPanel";
|
|
|
6027
6028
|
// src/DepositModal.tsx
|
|
6028
6029
|
|
|
6029
6030
|
var ReownDepositInner = _react.lazy.call(void 0,
|
|
6030
|
-
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-
|
|
6031
|
+
() => Promise.resolve().then(() => _interopRequireWildcard(require("./DepositModalReown-KXFF6ZXY.cjs"))).then((m) => ({ default: m.DepositModalReown }))
|
|
6031
6032
|
);
|
|
6032
6033
|
function sortByCreatedAtDesc(items) {
|
|
6033
6034
|
return [...items].sort((a, b) => {
|
|
@@ -6106,7 +6107,7 @@ function DepositModalInner({
|
|
|
6106
6107
|
const [backHandler, setBackHandler] = _react.useState.call(void 0,
|
|
6107
6108
|
void 0
|
|
6108
6109
|
);
|
|
6109
|
-
const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
6110
|
+
const showHistoryButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _209 => _209.showHistoryButton]), () => ( false));
|
|
6110
6111
|
const historyButtonVisible = showHistoryButton && (currentScreen === "select-asset" || currentScreen === "deposit-address");
|
|
6111
6112
|
const [historyOpen, setHistoryOpen] = _react.useState.call(void 0, false);
|
|
6112
6113
|
const [historyDeposits, setHistoryDeposits] = _react.useState.call(void 0, []);
|
|
@@ -6144,7 +6145,7 @@ function DepositModalInner({
|
|
|
6144
6145
|
}, [solanaRpcUrl]);
|
|
6145
6146
|
_react.useEffect.call(void 0, () => {
|
|
6146
6147
|
if (isOpen) {
|
|
6147
|
-
_optionalChain([onReadyRef, 'access',
|
|
6148
|
+
_optionalChain([onReadyRef, 'access', _210 => _210.current, 'optionalCall', _211 => _211()]);
|
|
6148
6149
|
}
|
|
6149
6150
|
}, [isOpen, onReadyRef]);
|
|
6150
6151
|
const handleStepChange = _react.useCallback.call(void 0,
|
|
@@ -6223,7 +6224,7 @@ function DepositModalInner({
|
|
|
6223
6224
|
const onLifecycleRef = _chunk2TWQGPPBcjs.useLatestRef.call(void 0, onLifecycle);
|
|
6224
6225
|
const handleLifecycle = _react.useCallback.call(void 0,
|
|
6225
6226
|
(event) => {
|
|
6226
|
-
_optionalChain([onLifecycleRef, 'access',
|
|
6227
|
+
_optionalChain([onLifecycleRef, 'access', _212 => _212.current, 'optionalCall', _213 => _213(event)]);
|
|
6227
6228
|
if (event.type === "smart-account-changed" && !event.evm && !event.solana) {
|
|
6228
6229
|
historyStaleRef.current = true;
|
|
6229
6230
|
}
|
|
@@ -6249,7 +6250,7 @@ function DepositModalInner({
|
|
|
6249
6250
|
store.dispatch({ type: "flow/reset" });
|
|
6250
6251
|
}
|
|
6251
6252
|
}, [isOpen, store]);
|
|
6252
|
-
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
6253
|
+
const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _214 => _214.showBackButton]), () => ( true));
|
|
6253
6254
|
const canGoBack = backHandler !== void 0;
|
|
6254
6255
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, DepositStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
6255
6256
|
_chunk2TWQGPPBcjs.Modal,
|
package/dist/deposit.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkY4CESMTHcjs = require('./chunk-Y4CESMTH.cjs');
|
|
4
4
|
require('./chunk-2TWQGPPB.cjs');
|
|
5
5
|
require('./chunk-7JIDIX27.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.DepositModal =
|
|
8
|
+
exports.DepositModal = _chunkY4CESMTHcjs.DepositModal;
|
package/dist/deposit.mjs
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkY4CESMTHcjs = require('./chunk-Y4CESMTH.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkYI63OMXNcjs = require('./chunk-YI63OMXN.cjs');
|
|
@@ -79,4 +79,4 @@ async function disconnectWallet() {
|
|
|
79
79
|
|
|
80
80
|
|
|
81
81
|
|
|
82
|
-
exports.CHAIN_BY_ID = _chunk7JIDIX27cjs.CHAIN_BY_ID; exports.DEFAULT_BACKEND_URL = _chunk7JIDIX27cjs.DEFAULT_BACKEND_URL; exports.DEFAULT_SIGNER_ADDRESS = _chunk7JIDIX27cjs.DEFAULT_SIGNER_ADDRESS; exports.DepositModal =
|
|
82
|
+
exports.CHAIN_BY_ID = _chunk7JIDIX27cjs.CHAIN_BY_ID; exports.DEFAULT_BACKEND_URL = _chunk7JIDIX27cjs.DEFAULT_BACKEND_URL; exports.DEFAULT_SIGNER_ADDRESS = _chunk7JIDIX27cjs.DEFAULT_SIGNER_ADDRESS; exports.DepositModal = _chunkY4CESMTHcjs.DepositModal; exports.NATIVE_TOKEN_ADDRESS = _chunk7JIDIX27cjs.NATIVE_TOKEN_ADDRESS; exports.SOURCE_CHAINS = _chunk7JIDIX27cjs.SOURCE_CHAINS; exports.SUPPORTED_CHAINS = _chunk7JIDIX27cjs.SUPPORTED_CHAINS; exports.WithdrawModal = _chunkYI63OMXNcjs.WithdrawModal; exports.chainRegistry = _chunk7JIDIX27cjs.chainRegistry; exports.disconnectWallet = disconnectWallet; exports.findChainIdForToken = _chunk7JIDIX27cjs.findChainIdForToken; exports.getChainBadge = _chunk7JIDIX27cjs.getChainBadge; exports.getChainIcon = _chunk7JIDIX27cjs.getChainIcon; exports.getChainId = _chunk7JIDIX27cjs.getChainId; exports.getChainName = _chunk7JIDIX27cjs.getChainName; exports.getChainObject = _chunk7JIDIX27cjs.getChainObject; exports.getExplorerName = _chunk7JIDIX27cjs.getExplorerName; exports.getExplorerTxUrl = _chunk7JIDIX27cjs.getExplorerTxUrl; exports.getExplorerUrl = _chunk7JIDIX27cjs.getExplorerUrl; exports.getSupportedChainIds = _chunk7JIDIX27cjs.getSupportedChainIds; exports.getSupportedTargetTokens = _chunk7JIDIX27cjs.getSupportedTargetTokens; exports.getSupportedTokenSymbolsForChain = _chunk7JIDIX27cjs.getSupportedTokenSymbolsForChain; exports.getTargetTokenSymbolsForChain = _chunk7JIDIX27cjs.getTargetTokenSymbolsForChain; exports.getTokenAddress = _chunk7JIDIX27cjs.getTokenAddress; exports.getTokenDecimals = _chunk7JIDIX27cjs.getTokenDecimals; exports.getTokenDecimalsByAddress = _chunk7JIDIX27cjs.getTokenDecimalsByAddress; exports.getTokenIcon = _chunk7JIDIX27cjs.getTokenIcon; exports.getTokenSymbol = _chunk7JIDIX27cjs.getTokenSymbol; exports.getUsdcAddress = _chunk7JIDIX27cjs.getUsdcAddress; exports.getUsdcDecimals = _chunk7JIDIX27cjs.getUsdcDecimals; exports.isSupportedTokenAddressForChain = _chunk7JIDIX27cjs.isSupportedTokenAddressForChain;
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED