@rhinestone/deposit-modal 0.8.0 → 0.8.1
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-RZ6VSMKP.mjs → DepositModalReown-4BSHOQ5Y.mjs} +6 -6
- package/dist/{DepositModalReown-J5YFZKFS.cjs → DepositModalReown-UND3DEJH.cjs} +9 -9
- package/dist/{WithdrawModalReown-4YUV2WWV.mjs → WithdrawModalReown-FVXSSGY5.mjs} +5 -5
- package/dist/{WithdrawModalReown-B6BGY52S.cjs → WithdrawModalReown-TVZWJKQI.cjs} +8 -8
- package/dist/{chunk-LXTAAHPC.mjs → chunk-2JPB3PLB.mjs} +2 -2
- package/dist/{chunk-4IOQIWDY.cjs → chunk-4NN7UTWQ.cjs} +4 -4
- package/dist/{chunk-5S5BQ2GM.mjs → chunk-7KHEIMWD.mjs} +24 -11
- package/dist/{chunk-IRI34U6N.cjs → chunk-7OKA6GNA.cjs} +255 -137
- package/dist/{chunk-XLXJW44N.cjs → chunk-D3Y7ZBED.cjs} +349 -336
- package/dist/{chunk-YLIPI3NU.mjs → chunk-DABKCJVL.mjs} +1 -1
- package/dist/{chunk-JRFPKFL6.cjs → chunk-HQWZCOMS.cjs} +105 -98
- package/dist/{chunk-RXWJ267K.mjs → chunk-NASHLEVQ.mjs} +165 -47
- package/dist/{chunk-SX52FXKH.mjs → chunk-O5OKA27M.mjs} +7 -0
- package/dist/{chunk-VURI4G2Z.cjs → chunk-Q3W53BKR.cjs} +7 -7
- package/dist/{chunk-7JJ4EFDY.mjs → chunk-T43VUEJH.mjs} +12 -5
- package/dist/{chunk-PUMTR35E.cjs → chunk-U7SVYWVD.cjs} +8 -1
- package/dist/{chunk-TYB6AA6D.mjs → chunk-WK5AFRSP.mjs} +1 -1
- package/dist/{chunk-WL7AXYQ4.cjs → chunk-XRWQMIBY.cjs} +3 -3
- package/dist/constants.cjs +2 -2
- package/dist/constants.mjs +1 -1
- package/dist/deposit.cjs +6 -6
- package/dist/deposit.mjs +5 -5
- package/dist/index.cjs +7 -7
- package/dist/index.mjs +6 -6
- package/dist/polymarket.cjs +6 -6
- package/dist/polymarket.mjs +3 -3
- package/dist/styles.css +29 -0
- package/dist/withdraw.cjs +5 -5
- package/dist/withdraw.mjs +4 -4
- package/package.json +1 -1
|
@@ -17,7 +17,9 @@
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
var _chunkU7SVYWVDcjs = require('./chunk-U7SVYWVD.cjs');
|
|
21
23
|
|
|
22
24
|
// src/components/ui/Modal.tsx
|
|
23
25
|
|
|
@@ -953,7 +955,7 @@ function createDepositService(baseUrl, options) {
|
|
|
953
955
|
},
|
|
954
956
|
async checkLiquidity(params) {
|
|
955
957
|
if (params.destinationChainId === "solana") {
|
|
956
|
-
const token =
|
|
958
|
+
const token = _chunkU7SVYWVDcjs.getSolanaTokenByMint.call(void 0, params.destinationToken);
|
|
957
959
|
return {
|
|
958
960
|
hasLiquidity: true,
|
|
959
961
|
symbol: _nullishCoalesce(_optionalChain([token, 'optionalAccess', _25 => _25.symbol]), () => ( "Token")),
|
|
@@ -1010,7 +1012,7 @@ function createDepositService(baseUrl, options) {
|
|
|
1010
1012
|
const body = {
|
|
1011
1013
|
account: params.account,
|
|
1012
1014
|
// HyperCore has its own CAIP-2 namespace — never the eip155 placeholder.
|
|
1013
|
-
sourceChainId: params.sourceChainId === "hypercore" ?
|
|
1015
|
+
sourceChainId: params.sourceChainId === "hypercore" ? _chunkU7SVYWVDcjs.HYPERCORE_MAINNET_CAIP2 : `eip155:${params.sourceChainId}`,
|
|
1014
1016
|
sourceToken: params.sourceToken,
|
|
1015
1017
|
amount: params.amount
|
|
1016
1018
|
};
|
|
@@ -1074,6 +1076,31 @@ function createDepositService(baseUrl, options) {
|
|
|
1074
1076
|
return {};
|
|
1075
1077
|
}
|
|
1076
1078
|
},
|
|
1079
|
+
async fetchPricesByAddress(caip2Ids) {
|
|
1080
|
+
const list = caip2Ids.filter((id) => id.length > 0);
|
|
1081
|
+
if (list.length === 0) return {};
|
|
1082
|
+
const url = apiUrl(
|
|
1083
|
+
`/prices?${new URLSearchParams({ addresses: list.join(",") }).toString()}`
|
|
1084
|
+
);
|
|
1085
|
+
try {
|
|
1086
|
+
const response = await fetch(url, {
|
|
1087
|
+
method: "GET",
|
|
1088
|
+
headers: { "Content-Type": "application/json" },
|
|
1089
|
+
cache: "no-store"
|
|
1090
|
+
});
|
|
1091
|
+
if (!response.ok) {
|
|
1092
|
+
debugError(debug, scope, "fetchPricesByAddress:failed", {
|
|
1093
|
+
status: response.status
|
|
1094
|
+
});
|
|
1095
|
+
return {};
|
|
1096
|
+
}
|
|
1097
|
+
const data = await response.json();
|
|
1098
|
+
return _nullishCoalesce(data.prices, () => ( {}));
|
|
1099
|
+
} catch (err) {
|
|
1100
|
+
debugError(debug, scope, "fetchPricesByAddress:error", err);
|
|
1101
|
+
return {};
|
|
1102
|
+
}
|
|
1103
|
+
},
|
|
1077
1104
|
async getSwappedWidgetUrl(params) {
|
|
1078
1105
|
const url = apiUrl("/onramp/swapped/widget-url");
|
|
1079
1106
|
debugLog(debug, scope, "getSwappedWidgetUrl:request", {
|
|
@@ -1308,14 +1335,14 @@ function normalizeOrchestratorPortfolio(data) {
|
|
|
1308
1335
|
const unlocked = _nullishCoalesce(_optionalChain([chainBalance, 'access', _32 => _32.balance, 'optionalAccess', _33 => _33.unlocked]), () => ( "0"));
|
|
1309
1336
|
const normalizedName = tokenData.tokenName.trim();
|
|
1310
1337
|
const isNativeSymbol = normalizedName.toUpperCase() === "ETH" || normalizedName.toUpperCase() === "ETHER";
|
|
1311
|
-
const tokenAddress = _nullishCoalesce(_nullishCoalesce(chainBalance.tokenAddress, () => ( extractTokenAddress(tokenData, chainBalance.chainId))), () => (
|
|
1312
|
-
const resolvedTokenAddress = isNativeSymbol ?
|
|
1338
|
+
const tokenAddress = _nullishCoalesce(_nullishCoalesce(chainBalance.tokenAddress, () => ( extractTokenAddress(tokenData, chainBalance.chainId))), () => ( _chunkU7SVYWVDcjs.getTokenAddress.call(void 0, tokenData.tokenName, chainBalance.chainId)));
|
|
1339
|
+
const resolvedTokenAddress = isNativeSymbol ? _chunkU7SVYWVDcjs.NATIVE_TOKEN_ADDRESS : tokenAddress;
|
|
1313
1340
|
if (!resolvedTokenAddress) {
|
|
1314
1341
|
continue;
|
|
1315
1342
|
}
|
|
1316
|
-
const registrySymbol =
|
|
1343
|
+
const registrySymbol = _chunkU7SVYWVDcjs.getTokenSymbol.call(void 0, resolvedTokenAddress, chainBalance.chainId);
|
|
1317
1344
|
const symbol = registrySymbol !== "Token" ? registrySymbol : normalizedName || "Token";
|
|
1318
|
-
const decimals = registrySymbol !== "Token" ?
|
|
1345
|
+
const decimals = registrySymbol !== "Token" ? _chunkU7SVYWVDcjs.getTokenDecimalsByAddress.call(void 0, resolvedTokenAddress, chainBalance.chainId) : _nullishCoalesce(tokenData.tokenDecimals, () => ( 18));
|
|
1319
1346
|
tokens.push({
|
|
1320
1347
|
chainId: chainBalance.chainId,
|
|
1321
1348
|
address: resolvedTokenAddress,
|
|
@@ -1335,13 +1362,13 @@ function normalizeOrchestratorPortfolio(data) {
|
|
|
1335
1362
|
function normalizeDirectToken(token) {
|
|
1336
1363
|
const rawChainId = _nullishCoalesce(extractNumber(token, "chainId"), () => ( extractNumber(token.chain, "id")));
|
|
1337
1364
|
const rawChainString = _nullishCoalesce(extractString(token, "chainId"), () => ( extractString(token.chain, "id")));
|
|
1338
|
-
const chainId = _nullishCoalesce(rawChainId, () => ( (rawChainString ?
|
|
1365
|
+
const chainId = _nullishCoalesce(rawChainId, () => ( (rawChainString ? _chunkU7SVYWVDcjs.isSolanaCaip2.call(void 0, rawChainString) || rawChainString.toLowerCase() === "solana" ? "solana" : (
|
|
1339
1366
|
// HyperCore (`hypercore:mainnet`) is a non-EVM source; keep its USDC
|
|
1340
1367
|
// instead of dropping it as an unparseable chain string.
|
|
1341
|
-
|
|
1368
|
+
_chunkU7SVYWVDcjs.isHyperCoreCaip2.call(void 0, rawChainString) || rawChainString.toLowerCase() === "hypercore" ? "hypercore" : _chunkU7SVYWVDcjs.parseEvmChainId.call(void 0, rawChainString)
|
|
1342
1369
|
) : null)));
|
|
1343
1370
|
if (chainId === null) return null;
|
|
1344
|
-
const registryChainId = typeof chainId === "number" ? chainId : chainId === "hypercore" ?
|
|
1371
|
+
const registryChainId = typeof chainId === "number" ? chainId : chainId === "hypercore" ? _chunkU7SVYWVDcjs.HYPERCORE_CHAIN_ID : void 0;
|
|
1345
1372
|
const symbol = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "symbol"), () => ( extractString(token, "tokenSymbol"))), () => ( extractString(token, "tokenName"))), () => ( extractString(token, "name")));
|
|
1346
1373
|
if (!symbol) return null;
|
|
1347
1374
|
const balanceValue = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "balance"), () => ( extractString(token, "amount"))), () => ( extractString(token, "value"))), () => ( extractString(token, "rawBalance"))), () => ( _optionalChain([extractNumber, 'call', _34 => _34(token, "balance"), 'optionalAccess', _35 => _35.toString, 'call', _36 => _36()]))), () => ( _optionalChain([extractNumber, 'call', _37 => _37(token, "amount"), 'optionalAccess', _38 => _38.toString, 'call', _39 => _39()]))), () => ( _optionalChain([extractNumber, 'call', _40 => _40(token, "value"), 'optionalAccess', _41 => _41.toString, 'call', _42 => _42()]))), () => ( _optionalChain([extractNumber, 'call', _43 => _43(token, "rawBalance"), 'optionalAccess', _44 => _44.toString, 'call', _45 => _45()])));
|
|
@@ -1349,14 +1376,14 @@ function normalizeDirectToken(token) {
|
|
|
1349
1376
|
const address = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "address"), () => ( extractString(token, "tokenAddress"))), () => ( extractString(
|
|
1350
1377
|
token.token,
|
|
1351
1378
|
"address"
|
|
1352
|
-
))), () => ( (registryChainId !== void 0 ?
|
|
1379
|
+
))), () => ( (registryChainId !== void 0 ? _chunkU7SVYWVDcjs.getTokenAddress.call(void 0, symbol, registryChainId) : void 0)));
|
|
1353
1380
|
if (!address) return null;
|
|
1354
1381
|
const balanceUsd = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractNumber(token, "balanceUsd"), () => ( extractNumber(token, "usdValue"))), () => ( extractNumber(token, "valueUsd"))), () => ( extractNumericString(token, "balanceUsd"))), () => ( extractNumericString(token, "usdValue"))), () => ( extractNumericString(token, "valueUsd"))), () => ( 0));
|
|
1355
1382
|
const isSolanaToken = chainId === "solana";
|
|
1356
|
-
const registrySymbol = isSolanaToken ? "Token" :
|
|
1383
|
+
const registrySymbol = isSolanaToken ? "Token" : _chunkU7SVYWVDcjs.getTokenSymbol.call(void 0, address, registryChainId);
|
|
1357
1384
|
const resolvedSymbol = isSolanaToken ? symbol : registrySymbol !== "Token" ? registrySymbol : symbol;
|
|
1358
1385
|
const backendDecimals = _nullishCoalesce(extractNumber(token, "decimals"), () => ( extractNumber(token, "tokenDecimals")));
|
|
1359
|
-
const resolvedDecimals = !isSolanaToken && registrySymbol !== "Token" ?
|
|
1386
|
+
const resolvedDecimals = !isSolanaToken && registrySymbol !== "Token" ? _chunkU7SVYWVDcjs.getTokenDecimalsByAddress.call(void 0, address, registryChainId) : _nullishCoalesce(backendDecimals, () => ( 18));
|
|
1360
1387
|
return {
|
|
1361
1388
|
chainId,
|
|
1362
1389
|
address,
|
|
@@ -1497,7 +1524,7 @@ function getPublicClient(chainId, rpcUrls) {
|
|
|
1497
1524
|
const cacheKey = `${chainId}|${_nullishCoalesce(url, () => ( ""))}`;
|
|
1498
1525
|
let client = clientCache.get(cacheKey);
|
|
1499
1526
|
if (!client) {
|
|
1500
|
-
const chain =
|
|
1527
|
+
const chain = _chunkU7SVYWVDcjs.CHAIN_BY_ID[chainId];
|
|
1501
1528
|
client = _viem.createPublicClient.call(void 0, {
|
|
1502
1529
|
chain,
|
|
1503
1530
|
transport: _viem.http.call(void 0, url)
|
|
@@ -2468,7 +2495,7 @@ var EXCHANGE_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fr
|
|
|
2468
2495
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExchangeBadgeIcons, {}),
|
|
2469
2496
|
"+6"
|
|
2470
2497
|
] });
|
|
2471
|
-
var EXTRA_CHAIN_COUNT = Math.max(0,
|
|
2498
|
+
var EXTRA_CHAIN_COUNT = Math.max(0, _chunkU7SVYWVDcjs.getSupportedChainIds.call(void 0, ).length - 3);
|
|
2472
2499
|
var CHAIN_BADGE_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2473
2500
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChainBadgeIcons, {}),
|
|
2474
2501
|
EXTRA_CHAIN_COUNT > 0 ? `+${EXTRA_CHAIN_COUNT}` : null
|
|
@@ -2760,25 +2787,109 @@ ConnectStep.displayName = "ConnectStep";
|
|
|
2760
2787
|
// src/components/ui/TokenIcon.tsx
|
|
2761
2788
|
|
|
2762
2789
|
|
|
2790
|
+
function preconnectIconCdn() {
|
|
2791
|
+
if (typeof document === "undefined") return;
|
|
2792
|
+
if (document.getElementById("rs-icon-cdn-preconnect")) return;
|
|
2793
|
+
const link = document.createElement("link");
|
|
2794
|
+
link.id = "rs-icon-cdn-preconnect";
|
|
2795
|
+
link.rel = "preconnect";
|
|
2796
|
+
link.href = "https://s3.rhinestone.dev";
|
|
2797
|
+
link.crossOrigin = "anonymous";
|
|
2798
|
+
document.head.appendChild(link);
|
|
2799
|
+
}
|
|
2800
|
+
preconnectIconCdn();
|
|
2763
2801
|
function TokenIcon({ symbol, className, fallback }) {
|
|
2764
|
-
const [
|
|
2765
|
-
|
|
2802
|
+
const [loadedSymbol, setLoadedSymbol] = _react.useState.call(void 0, null);
|
|
2803
|
+
const [erroredSymbol, setErroredSymbol] = _react.useState.call(void 0, null);
|
|
2804
|
+
if (erroredSymbol === symbol) {
|
|
2766
2805
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: fallback });
|
|
2767
2806
|
}
|
|
2807
|
+
const loading = loadedSymbol !== symbol;
|
|
2768
2808
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2769
2809
|
"img",
|
|
2770
2810
|
{
|
|
2771
|
-
src:
|
|
2811
|
+
src: _chunkU7SVYWVDcjs.tokenIconUrl.call(void 0, symbol),
|
|
2772
2812
|
alt: "",
|
|
2773
|
-
className,
|
|
2774
|
-
loading: "lazy",
|
|
2813
|
+
className: `rs-token-icon ${_nullishCoalesce(className, () => ( ""))}`.trimEnd(),
|
|
2775
2814
|
decoding: "async",
|
|
2776
|
-
|
|
2777
|
-
|
|
2815
|
+
"data-loading": loading ? "" : void 0,
|
|
2816
|
+
onLoad: () => setLoadedSymbol(symbol),
|
|
2817
|
+
onError: () => setErroredSymbol(symbol)
|
|
2818
|
+
},
|
|
2819
|
+
symbol
|
|
2778
2820
|
);
|
|
2779
2821
|
}
|
|
2780
2822
|
TokenIcon.displayName = "TokenIcon";
|
|
2781
2823
|
|
|
2824
|
+
// src/core/useTokenPrices.ts
|
|
2825
|
+
|
|
2826
|
+
function isErc20(token) {
|
|
2827
|
+
return typeof token.chainId === "number" && !!token.address && token.address.toLowerCase() !== _chunkU7SVYWVDcjs.NATIVE_TOKEN_ADDRESS.toLowerCase();
|
|
2828
|
+
}
|
|
2829
|
+
function caip2For(token) {
|
|
2830
|
+
return `${_chunkU7SVYWVDcjs.toEvmCaip2.call(void 0, token.chainId)}:${token.address.toLowerCase()}`;
|
|
2831
|
+
}
|
|
2832
|
+
async function fetchTokenPriceUsd(service, token) {
|
|
2833
|
+
if (isErc20(token)) {
|
|
2834
|
+
const caip2 = caip2For(token);
|
|
2835
|
+
const prices2 = await service.fetchPricesByAddress([caip2]);
|
|
2836
|
+
const price2 = prices2[caip2];
|
|
2837
|
+
return typeof price2 === "number" && price2 > 0 ? price2 : null;
|
|
2838
|
+
}
|
|
2839
|
+
const symbol = token.symbol.toUpperCase();
|
|
2840
|
+
const prices = await service.fetchPrices([symbol]);
|
|
2841
|
+
const price = prices[symbol];
|
|
2842
|
+
return typeof price === "number" && price > 0 ? price : null;
|
|
2843
|
+
}
|
|
2844
|
+
function useTokenPrices(service, tokens) {
|
|
2845
|
+
const [prices, setPrices] = _react.useState.call(void 0, {});
|
|
2846
|
+
const defined = tokens.filter((t) => Boolean(_optionalChain([t, 'optionalAccess', _75 => _75.symbol])));
|
|
2847
|
+
const entries = [
|
|
2848
|
+
...new Map(
|
|
2849
|
+
defined.map((token) => {
|
|
2850
|
+
const erc20 = isErc20(token);
|
|
2851
|
+
const caip2 = erc20 ? caip2For(token) : null;
|
|
2852
|
+
const symbol = token.symbol.toUpperCase();
|
|
2853
|
+
return [_nullishCoalesce(caip2, () => ( `sym:${symbol}`)), { symbol, caip2 }];
|
|
2854
|
+
})
|
|
2855
|
+
).values()
|
|
2856
|
+
].sort(
|
|
2857
|
+
(a, b) => (_nullishCoalesce(a.caip2, () => ( a.symbol))).localeCompare(_nullishCoalesce(b.caip2, () => ( b.symbol)))
|
|
2858
|
+
);
|
|
2859
|
+
const key = JSON.stringify(entries);
|
|
2860
|
+
_react.useEffect.call(void 0, () => {
|
|
2861
|
+
if (key === "[]") return;
|
|
2862
|
+
let cancelled = false;
|
|
2863
|
+
const parsed = JSON.parse(key);
|
|
2864
|
+
const symbols = [
|
|
2865
|
+
...new Set(parsed.filter((e) => !e.caip2).map((e) => e.symbol))
|
|
2866
|
+
];
|
|
2867
|
+
const caip2Ids = [
|
|
2868
|
+
...new Set(
|
|
2869
|
+
parsed.filter((e) => e.caip2).map((e) => e.caip2)
|
|
2870
|
+
)
|
|
2871
|
+
];
|
|
2872
|
+
Promise.all([
|
|
2873
|
+
symbols.length > 0 ? service.fetchPrices(symbols) : Promise.resolve({}),
|
|
2874
|
+
caip2Ids.length > 0 ? service.fetchPricesByAddress(caip2Ids) : Promise.resolve({})
|
|
2875
|
+
]).then(([bySymbol, byAddress]) => {
|
|
2876
|
+
if (cancelled) return;
|
|
2877
|
+
const merged = { ...bySymbol };
|
|
2878
|
+
for (const entry of parsed) {
|
|
2879
|
+
if (!entry.caip2) continue;
|
|
2880
|
+
const price = byAddress[entry.caip2];
|
|
2881
|
+
if (typeof price === "number") merged[entry.symbol] = price;
|
|
2882
|
+
}
|
|
2883
|
+
setPrices(merged);
|
|
2884
|
+
}).catch(() => {
|
|
2885
|
+
});
|
|
2886
|
+
return () => {
|
|
2887
|
+
cancelled = true;
|
|
2888
|
+
};
|
|
2889
|
+
}, [service, key]);
|
|
2890
|
+
return prices;
|
|
2891
|
+
}
|
|
2892
|
+
|
|
2782
2893
|
// src/components/steps/ProcessingStep.tsx
|
|
2783
2894
|
|
|
2784
2895
|
|
|
@@ -2851,8 +2962,8 @@ function Tooltip({ content, children, className }) {
|
|
|
2851
2962
|
function handleOutside(event) {
|
|
2852
2963
|
const target = event.target;
|
|
2853
2964
|
if (!target) return;
|
|
2854
|
-
if (_optionalChain([triggerRef, 'access',
|
|
2855
|
-
if (_optionalChain([bubbleRef, 'access',
|
|
2965
|
+
if (_optionalChain([triggerRef, 'access', _76 => _76.current, 'optionalAccess', _77 => _77.contains, 'call', _78 => _78(target)])) return;
|
|
2966
|
+
if (_optionalChain([bubbleRef, 'access', _79 => _79.current, 'optionalAccess', _80 => _80.contains, 'call', _81 => _81(target)])) return;
|
|
2856
2967
|
setOpen(false);
|
|
2857
2968
|
}
|
|
2858
2969
|
function handleKey(event) {
|
|
@@ -3047,7 +3158,7 @@ function asNumber(value) {
|
|
|
3047
3158
|
const trimmed = value.trim();
|
|
3048
3159
|
if (!trimmed) return void 0;
|
|
3049
3160
|
const caipMatch = trimmed.match(/^eip155:(\d+)$/);
|
|
3050
|
-
if (_optionalChain([caipMatch, 'optionalAccess',
|
|
3161
|
+
if (_optionalChain([caipMatch, 'optionalAccess', _82 => _82[1]])) {
|
|
3051
3162
|
const parsed2 = Number(caipMatch[1]);
|
|
3052
3163
|
return Number.isFinite(parsed2) ? parsed2 : void 0;
|
|
3053
3164
|
}
|
|
@@ -3066,24 +3177,24 @@ function asAddress(value) {
|
|
|
3066
3177
|
return /^0x[a-fA-F0-9]{40}$/.test(value) ? value : void 0;
|
|
3067
3178
|
}
|
|
3068
3179
|
function getEventTxHash(event) {
|
|
3069
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
3180
|
+
if (!_optionalChain([event, 'optionalAccess', _83 => _83.type])) return void 0;
|
|
3070
3181
|
if (event.type === "deposit-received") {
|
|
3071
|
-
return asString(_optionalChain([event, 'access',
|
|
3182
|
+
return asString(_optionalChain([event, 'access', _84 => _84.data, 'optionalAccess', _85 => _85.transactionHash]));
|
|
3072
3183
|
}
|
|
3073
3184
|
if (event.type === "bridge-started" || event.type === "bridge-complete") {
|
|
3074
|
-
const deposit = isRecord(_optionalChain([event, 'access',
|
|
3075
|
-
const source = isRecord(_optionalChain([event, 'access',
|
|
3076
|
-
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess',
|
|
3185
|
+
const deposit = isRecord(_optionalChain([event, 'access', _86 => _86.data, 'optionalAccess', _87 => _87.deposit])) ? event.data.deposit : void 0;
|
|
3186
|
+
const source = isRecord(_optionalChain([event, 'access', _88 => _88.data, 'optionalAccess', _89 => _89.source])) ? event.data.source : void 0;
|
|
3187
|
+
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _90 => _90.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _91 => _91.transactionHash]))));
|
|
3077
3188
|
}
|
|
3078
3189
|
if (event.type === "bridge-failed" || event.type === "error") {
|
|
3079
|
-
const deposit = isRecord(_optionalChain([event, 'access',
|
|
3080
|
-
const source = isRecord(_optionalChain([event, 'access',
|
|
3081
|
-
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess',
|
|
3190
|
+
const deposit = isRecord(_optionalChain([event, 'access', _92 => _92.data, 'optionalAccess', _93 => _93.deposit])) ? event.data.deposit : void 0;
|
|
3191
|
+
const source = isRecord(_optionalChain([event, 'access', _94 => _94.data, 'optionalAccess', _95 => _95.source])) ? event.data.source : void 0;
|
|
3192
|
+
return _nullishCoalesce(asString(_optionalChain([deposit, 'optionalAccess', _96 => _96.transactionHash])), () => ( asString(_optionalChain([source, 'optionalAccess', _97 => _97.transactionHash]))));
|
|
3082
3193
|
}
|
|
3083
3194
|
return void 0;
|
|
3084
3195
|
}
|
|
3085
3196
|
function getEventSourceDetails(event) {
|
|
3086
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
3197
|
+
if (!_optionalChain([event, 'optionalAccess', _98 => _98.type]) || !isRecord(event.data)) return {};
|
|
3087
3198
|
if (event.type === "deposit-received") {
|
|
3088
3199
|
return {
|
|
3089
3200
|
chainId: asNumber(event.data.chain),
|
|
@@ -3095,9 +3206,9 @@ function getEventSourceDetails(event) {
|
|
|
3095
3206
|
const deposit = isRecord(event.data.deposit) ? event.data.deposit : void 0;
|
|
3096
3207
|
if (event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "bridge-failed" || event.type === "error") {
|
|
3097
3208
|
return {
|
|
3098
|
-
chainId: _nullishCoalesce(asNumber(_optionalChain([source, 'optionalAccess',
|
|
3099
|
-
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess',
|
|
3100
|
-
token: _nullishCoalesce(_nullishCoalesce(asAddress(_optionalChain([source, 'optionalAccess',
|
|
3209
|
+
chainId: _nullishCoalesce(asNumber(_optionalChain([source, 'optionalAccess', _99 => _99.chain])), () => ( asNumber(_optionalChain([deposit, 'optionalAccess', _100 => _100.chain])))),
|
|
3210
|
+
amount: _nullishCoalesce(asAmount(_optionalChain([source, 'optionalAccess', _101 => _101.amount])), () => ( asAmount(_optionalChain([deposit, 'optionalAccess', _102 => _102.amount])))),
|
|
3211
|
+
token: _nullishCoalesce(_nullishCoalesce(asAddress(_optionalChain([source, 'optionalAccess', _103 => _103.asset])), () => ( asAddress(_optionalChain([deposit, 'optionalAccess', _104 => _104.asset])))), () => ( asAddress(_optionalChain([deposit, 'optionalAccess', _105 => _105.token]))))
|
|
3101
3212
|
};
|
|
3102
3213
|
}
|
|
3103
3214
|
return {};
|
|
@@ -3111,7 +3222,7 @@ function asChain(value) {
|
|
|
3111
3222
|
return asNumber(value);
|
|
3112
3223
|
}
|
|
3113
3224
|
function getEventDestinationDetails(event) {
|
|
3114
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
3225
|
+
if (!_optionalChain([event, 'optionalAccess', _106 => _106.type]) || !isRecord(event.data)) return {};
|
|
3115
3226
|
if (event.type !== "bridge-started" && event.type !== "bridge-complete") {
|
|
3116
3227
|
return {};
|
|
3117
3228
|
}
|
|
@@ -3121,14 +3232,14 @@ function getEventDestinationDetails(event) {
|
|
|
3121
3232
|
return {
|
|
3122
3233
|
chainId: asChain(destination.chain),
|
|
3123
3234
|
amount: asAmount(destination.amount),
|
|
3124
|
-
token: _optionalChain([token, 'optionalAccess',
|
|
3235
|
+
token: _optionalChain([token, 'optionalAccess', _107 => _107.trim, 'call', _108 => _108()]) || void 0
|
|
3125
3236
|
};
|
|
3126
3237
|
}
|
|
3127
3238
|
function isDepositEvent(event) {
|
|
3128
|
-
return _optionalChain([event, 'optionalAccess',
|
|
3239
|
+
return _optionalChain([event, 'optionalAccess', _109 => _109.type]) === "deposit-received" || _optionalChain([event, 'optionalAccess', _110 => _110.type]) === "bridge-started" || _optionalChain([event, 'optionalAccess', _111 => _111.type]) === "bridge-complete" || _optionalChain([event, 'optionalAccess', _112 => _112.type]) === "bridge-failed" || _optionalChain([event, 'optionalAccess', _113 => _113.type]) === "error";
|
|
3129
3240
|
}
|
|
3130
3241
|
function isFailedEvent(event) {
|
|
3131
|
-
return _optionalChain([event, 'optionalAccess',
|
|
3242
|
+
return _optionalChain([event, 'optionalAccess', _114 => _114.type]) === "bridge-failed" || _optionalChain([event, 'optionalAccess', _115 => _115.type]) === "error";
|
|
3132
3243
|
}
|
|
3133
3244
|
function isHexString(value) {
|
|
3134
3245
|
return value.startsWith("0x") || value.startsWith("0X");
|
|
@@ -3140,7 +3251,7 @@ function txRefsMatch(a, b) {
|
|
|
3140
3251
|
return a === b;
|
|
3141
3252
|
}
|
|
3142
3253
|
function formatBridgeFailedMessage(event) {
|
|
3143
|
-
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess',
|
|
3254
|
+
const eventData = _nullishCoalesce(_optionalChain([event, 'optionalAccess', _116 => _116.data]), () => ( {}));
|
|
3144
3255
|
const code = typeof eventData.errorCode === "string" ? eventData.errorCode : void 0;
|
|
3145
3256
|
const backendMessage = typeof eventData.message === "string" ? eventData.message.trim() : "";
|
|
3146
3257
|
function toUserFacingFailure(raw) {
|
|
@@ -3168,7 +3279,7 @@ function formatBridgeFailedMessage(event) {
|
|
|
3168
3279
|
return { message: "Bridge failed" };
|
|
3169
3280
|
}
|
|
3170
3281
|
function failureMessageForEvent(event) {
|
|
3171
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
3282
|
+
if (_optionalChain([event, 'optionalAccess', _117 => _117.type]) === "error") {
|
|
3172
3283
|
const message = isRecord(event.data) ? asString(event.data.message) : void 0;
|
|
3173
3284
|
return _nullishCoalesce(message, () => ( "Unknown error"));
|
|
3174
3285
|
}
|
|
@@ -3196,29 +3307,29 @@ var EVM_ADDRESS_RE = /^0x[a-fA-F0-9]{40}$/;
|
|
|
3196
3307
|
function resolveTokenDisplay(token, chain, fallback) {
|
|
3197
3308
|
if (token !== void 0) {
|
|
3198
3309
|
if (chain === "solana") {
|
|
3199
|
-
const solanaToken =
|
|
3310
|
+
const solanaToken = _chunkU7SVYWVDcjs.getSolanaTokenByMint.call(void 0, token);
|
|
3200
3311
|
if (solanaToken) {
|
|
3201
3312
|
return { symbol: solanaToken.symbol, decimals: solanaToken.decimals };
|
|
3202
3313
|
}
|
|
3203
3314
|
} else if (chain === "hypercore") {
|
|
3204
|
-
const t =
|
|
3315
|
+
const t = _chunkU7SVYWVDcjs.HYPERCORE_SOURCE_TOKENS.find(
|
|
3205
3316
|
(x) => x.address.toLowerCase() === token.toLowerCase()
|
|
3206
3317
|
);
|
|
3207
3318
|
if (t) return { symbol: t.symbol, decimals: t.decimals };
|
|
3208
3319
|
} else if (EVM_ADDRESS_RE.test(token)) {
|
|
3209
|
-
const symbol =
|
|
3210
|
-
const decimals =
|
|
3320
|
+
const symbol = _chunkU7SVYWVDcjs.getTokenSymbol.call(void 0, token, chain);
|
|
3321
|
+
const decimals = _chunkU7SVYWVDcjs.findTokenDecimals.call(void 0, token, chain);
|
|
3211
3322
|
if (symbol !== "Token" || decimals !== void 0) {
|
|
3212
3323
|
return {
|
|
3213
|
-
symbol: symbol !== "Token" ? symbol : _nullishCoalesce(_optionalChain([fallback, 'optionalAccess',
|
|
3214
|
-
decimals: _nullishCoalesce(decimals, () => ( _optionalChain([fallback, 'optionalAccess',
|
|
3324
|
+
symbol: symbol !== "Token" ? symbol : _nullishCoalesce(_optionalChain([fallback, 'optionalAccess', _118 => _118.symbol]), () => ( symbol)),
|
|
3325
|
+
decimals: _nullishCoalesce(decimals, () => ( _optionalChain([fallback, 'optionalAccess', _119 => _119.decimals])))
|
|
3215
3326
|
};
|
|
3216
3327
|
}
|
|
3217
3328
|
}
|
|
3218
3329
|
}
|
|
3219
3330
|
return {
|
|
3220
|
-
symbol: _nullishCoalesce(_optionalChain([fallback, 'optionalAccess',
|
|
3221
|
-
decimals: _optionalChain([fallback, 'optionalAccess',
|
|
3331
|
+
symbol: _nullishCoalesce(_optionalChain([fallback, 'optionalAccess', _120 => _120.symbol]), () => ( "Token")),
|
|
3332
|
+
decimals: _optionalChain([fallback, 'optionalAccess', _121 => _121.decimals])
|
|
3222
3333
|
};
|
|
3223
3334
|
}
|
|
3224
3335
|
function maxFractionDigitsFor(symbol) {
|
|
@@ -3246,18 +3357,38 @@ function formatRawTokenAmount(rawAmount, token) {
|
|
|
3246
3357
|
if (value === void 0) return void 0;
|
|
3247
3358
|
return formatTokenAmount(value, token.symbol);
|
|
3248
3359
|
}
|
|
3360
|
+
function isDisplayStablecoinSymbol(symbol) {
|
|
3361
|
+
return symbol !== void 0 && STABLECOIN_SYMBOLS.has(symbol.toUpperCase());
|
|
3362
|
+
}
|
|
3249
3363
|
function priceUsdFor(symbol, prices) {
|
|
3250
3364
|
if (!symbol) return void 0;
|
|
3251
|
-
const
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3365
|
+
const quoted = prices[symbol.toUpperCase()];
|
|
3366
|
+
return typeof quoted === "number" && quoted > 0 ? quoted : void 0;
|
|
3367
|
+
}
|
|
3368
|
+
function isRecognizedToken(address, chain) {
|
|
3369
|
+
if (address === void 0 || chain === void 0) return false;
|
|
3370
|
+
if (chain === "solana") return _chunkU7SVYWVDcjs.getSolanaTokenByMint.call(void 0, address) !== void 0;
|
|
3371
|
+
if (chain === "hypercore") {
|
|
3372
|
+
return _chunkU7SVYWVDcjs.HYPERCORE_SOURCE_TOKENS.some(
|
|
3373
|
+
(t) => t.address.toLowerCase() === address.toLowerCase()
|
|
3374
|
+
);
|
|
3375
|
+
}
|
|
3376
|
+
return EVM_ADDRESS_RE.test(address) && _chunkU7SVYWVDcjs.isRegistryTokenOnChain.call(void 0, address, chain);
|
|
3255
3377
|
}
|
|
3256
3378
|
function estimateReceiveAmount(params) {
|
|
3257
|
-
const {
|
|
3258
|
-
|
|
3379
|
+
const {
|
|
3380
|
+
sourceAmount,
|
|
3381
|
+
sourceSymbol,
|
|
3382
|
+
targetSymbol,
|
|
3383
|
+
sourceAmountUsd,
|
|
3384
|
+
prices,
|
|
3385
|
+
sourceTrusted
|
|
3386
|
+
} = params;
|
|
3387
|
+
const trusted = sourceTrusted !== false;
|
|
3388
|
+
if (trusted && sourceSymbol !== void 0 && sourceSymbol.toUpperCase() === targetSymbol.toUpperCase()) {
|
|
3259
3389
|
return sourceAmount;
|
|
3260
3390
|
}
|
|
3391
|
+
if (!trusted) return void 0;
|
|
3261
3392
|
const usdValue = sourceAmountUsd !== void 0 && Number.isFinite(sourceAmountUsd) ? sourceAmountUsd : sourceAmount !== void 0 ? (() => {
|
|
3262
3393
|
const sourcePrice = priceUsdFor(sourceSymbol, prices);
|
|
3263
3394
|
return sourcePrice !== void 0 ? sourceAmount * sourcePrice : void 0;
|
|
@@ -3293,31 +3424,6 @@ function formatReceiveEstimate(params) {
|
|
|
3293
3424
|
return sameSymbol ? `${formatted} ${params.targetSymbol}` : `~${formatted} ${params.targetSymbol}`;
|
|
3294
3425
|
}
|
|
3295
3426
|
|
|
3296
|
-
// src/core/useTokenPrices.ts
|
|
3297
|
-
|
|
3298
|
-
function useTokenPrices(service, symbols) {
|
|
3299
|
-
const [prices, setPrices] = _react.useState.call(void 0, {});
|
|
3300
|
-
const symbolsKey = [
|
|
3301
|
-
...new Set(
|
|
3302
|
-
symbols.filter((symbol) => Boolean(symbol)).map((symbol) => symbol.toUpperCase())
|
|
3303
|
-
)
|
|
3304
|
-
].sort().join(",");
|
|
3305
|
-
_react.useEffect.call(void 0, () => {
|
|
3306
|
-
if (!symbolsKey) return;
|
|
3307
|
-
let cancelled = false;
|
|
3308
|
-
service.fetchPrices(symbolsKey.split(",")).then((result) => {
|
|
3309
|
-
if (!cancelled && result && Object.keys(result).length > 0) {
|
|
3310
|
-
setPrices(result);
|
|
3311
|
-
}
|
|
3312
|
-
}).catch(() => {
|
|
3313
|
-
});
|
|
3314
|
-
return () => {
|
|
3315
|
-
cancelled = true;
|
|
3316
|
-
};
|
|
3317
|
-
}, [service, symbolsKey]);
|
|
3318
|
-
return prices;
|
|
3319
|
-
}
|
|
3320
|
-
|
|
3321
3427
|
// src/components/steps/ProcessingStep.tsx
|
|
3322
3428
|
|
|
3323
3429
|
function SuccessBadge() {
|
|
@@ -3419,7 +3525,7 @@ function normalizeFeeUsd(value) {
|
|
|
3419
3525
|
return Number.isFinite(value) ? Math.max(0, value) : null;
|
|
3420
3526
|
}
|
|
3421
3527
|
function formatUsdFee(value) {
|
|
3422
|
-
return `$${_nullishCoalesce(_optionalChain([normalizeFeeUsd, 'call',
|
|
3528
|
+
return `$${_nullishCoalesce(_optionalChain([normalizeFeeUsd, 'call', _122 => _122(value), 'optionalAccess', _123 => _123.toFixed, 'call', _124 => _124(2)]), () => ( "0.00"))}`;
|
|
3423
3529
|
}
|
|
3424
3530
|
function getMarketNetworkFees(breakdown) {
|
|
3425
3531
|
if (!breakdown) return null;
|
|
@@ -3473,12 +3579,12 @@ function isEventForTx(event, txHash) {
|
|
|
3473
3579
|
return txRefsMatch(eventTxHash, txHash);
|
|
3474
3580
|
}
|
|
3475
3581
|
function parseWebhookTimestamp(event) {
|
|
3476
|
-
if (typeof _optionalChain([event, 'optionalAccess',
|
|
3582
|
+
if (typeof _optionalChain([event, 'optionalAccess', _125 => _125.time]) !== "string") return void 0;
|
|
3477
3583
|
const timestamp = Date.parse(event.time);
|
|
3478
3584
|
return Number.isFinite(timestamp) ? timestamp : void 0;
|
|
3479
3585
|
}
|
|
3480
3586
|
function syncPhaseTimings(previous, event) {
|
|
3481
|
-
if (!_optionalChain([event, 'optionalAccess',
|
|
3587
|
+
if (!_optionalChain([event, 'optionalAccess', _126 => _126.type])) return previous;
|
|
3482
3588
|
const timestamp = _nullishCoalesce(parseWebhookTimestamp(event), () => ( Date.now()));
|
|
3483
3589
|
const setReceived = (event.type === "deposit-received" || event.type === "bridge-started" || event.type === "bridge-complete" || event.type === "bridge-failed" || event.type === "error") && previous.receivedAt === void 0;
|
|
3484
3590
|
const setBridging = (event.type === "bridge-started" || event.type === "bridge-complete") && previous.bridgingAt === void 0;
|
|
@@ -3540,46 +3646,46 @@ function getCurrentPhaseId(state, phaseTimings) {
|
|
|
3540
3646
|
if (state.type === "complete") {
|
|
3541
3647
|
return void 0;
|
|
3542
3648
|
}
|
|
3543
|
-
if (_optionalChain([state, 'access',
|
|
3649
|
+
if (_optionalChain([state, 'access', _127 => _127.lastEvent, 'optionalAccess', _128 => _128.type]) === "bridge-started" || _optionalChain([state, 'access', _129 => _129.lastEvent, 'optionalAccess', _130 => _130.type]) === "bridge-complete")
|
|
3544
3650
|
return "bridging";
|
|
3545
|
-
if (_optionalChain([state, 'access',
|
|
3651
|
+
if (_optionalChain([state, 'access', _131 => _131.lastEvent, 'optionalAccess', _132 => _132.type]) === "deposit-received") return "received";
|
|
3546
3652
|
return "confirming";
|
|
3547
3653
|
}
|
|
3548
3654
|
function getCompletionDestinationTxHash(event) {
|
|
3549
|
-
const eventData = _optionalChain([event, 'optionalAccess',
|
|
3550
|
-
const swapTxHash = _optionalChain([eventData, 'optionalAccess',
|
|
3551
|
-
const destinationTxHash = _optionalChain([eventData, 'optionalAccess',
|
|
3655
|
+
const eventData = _optionalChain([event, 'optionalAccess', _133 => _133.data]);
|
|
3656
|
+
const swapTxHash = _optionalChain([eventData, 'optionalAccess', _134 => _134.swap, 'optionalAccess', _135 => _135.transactionHash]);
|
|
3657
|
+
const destinationTxHash = _optionalChain([eventData, 'optionalAccess', _136 => _136.destination, 'optionalAccess', _137 => _137.transactionHash]);
|
|
3552
3658
|
return _nullishCoalesce(swapTxHash, () => ( destinationTxHash));
|
|
3553
3659
|
}
|
|
3554
3660
|
function getTerminalProcessingOutcome(event) {
|
|
3555
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
3661
|
+
if (_optionalChain([event, 'optionalAccess', _138 => _138.type]) === "post-bridge-swap-complete") {
|
|
3556
3662
|
return {
|
|
3557
3663
|
type: "complete",
|
|
3558
3664
|
destinationTxHash: getCompletionDestinationTxHash(event)
|
|
3559
3665
|
};
|
|
3560
3666
|
}
|
|
3561
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
3667
|
+
if (_optionalChain([event, 'optionalAccess', _139 => _139.type]) === "post-bridge-swap-failed") {
|
|
3562
3668
|
return {
|
|
3563
3669
|
type: "failed",
|
|
3564
3670
|
message: formatBridgeFailedMessage(event).message
|
|
3565
3671
|
};
|
|
3566
3672
|
}
|
|
3567
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
3673
|
+
if (_optionalChain([event, 'optionalAccess', _140 => _140.type]) === "bridge-complete") {
|
|
3568
3674
|
return {
|
|
3569
3675
|
type: "complete",
|
|
3570
3676
|
destinationTxHash: getCompletionDestinationTxHash(event)
|
|
3571
3677
|
};
|
|
3572
3678
|
}
|
|
3573
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
3679
|
+
if (_optionalChain([event, 'optionalAccess', _141 => _141.type]) === "bridge-failed") {
|
|
3574
3680
|
return {
|
|
3575
3681
|
type: "failed",
|
|
3576
3682
|
message: formatBridgeFailedMessage(event).message
|
|
3577
3683
|
};
|
|
3578
3684
|
}
|
|
3579
|
-
if (_optionalChain([event, 'optionalAccess',
|
|
3685
|
+
if (_optionalChain([event, 'optionalAccess', _142 => _142.type]) === "error") {
|
|
3580
3686
|
return {
|
|
3581
3687
|
type: "failed",
|
|
3582
|
-
message: _nullishCoalesce(_optionalChain([event, 'access',
|
|
3688
|
+
message: _nullishCoalesce(_optionalChain([event, 'access', _143 => _143.data, 'optionalAccess', _144 => _144.message]), () => ( "Unknown error"))
|
|
3583
3689
|
};
|
|
3584
3690
|
}
|
|
3585
3691
|
return null;
|
|
@@ -3587,10 +3693,10 @@ function getTerminalProcessingOutcome(event) {
|
|
|
3587
3693
|
function getInitialProcessingState(event, txHash) {
|
|
3588
3694
|
if (!event || !isEventForTx(event, txHash)) return null;
|
|
3589
3695
|
const terminal = getTerminalProcessingOutcome(event);
|
|
3590
|
-
if (_optionalChain([terminal, 'optionalAccess',
|
|
3696
|
+
if (_optionalChain([terminal, 'optionalAccess', _145 => _145.type]) === "complete") {
|
|
3591
3697
|
return { type: "complete", lastEvent: event };
|
|
3592
3698
|
}
|
|
3593
|
-
if (_optionalChain([terminal, 'optionalAccess',
|
|
3699
|
+
if (_optionalChain([terminal, 'optionalAccess', _146 => _146.type]) === "failed") {
|
|
3594
3700
|
return { type: "failed", message: terminal.message, lastEvent: event };
|
|
3595
3701
|
}
|
|
3596
3702
|
if (isDepositEvent(event)) {
|
|
@@ -3693,7 +3799,7 @@ function ProcessingStep({
|
|
|
3693
3799
|
flowLabel
|
|
3694
3800
|
});
|
|
3695
3801
|
const context = processingContextRef.current;
|
|
3696
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
3802
|
+
_optionalChain([onDepositCompleteRef, 'access', _147 => _147.current, 'optionalCall', _148 => _148(txHash, void 0, {
|
|
3697
3803
|
amount: context.amount,
|
|
3698
3804
|
sourceChain: context.sourceChain,
|
|
3699
3805
|
sourceToken: context.sourceToken,
|
|
@@ -3724,7 +3830,7 @@ function ProcessingStep({
|
|
|
3724
3830
|
destinationTxHash: outcome.destinationTxHash,
|
|
3725
3831
|
event: event.type
|
|
3726
3832
|
});
|
|
3727
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
3833
|
+
_optionalChain([onDepositCompleteRef, 'access', _149 => _149.current, 'optionalCall', _150 => _150(txHash, outcome.destinationTxHash, {
|
|
3728
3834
|
amount: context.amount,
|
|
3729
3835
|
sourceChain: context.sourceChain,
|
|
3730
3836
|
sourceToken: context.sourceToken,
|
|
@@ -3740,7 +3846,7 @@ function ProcessingStep({
|
|
|
3740
3846
|
message: outcome.message,
|
|
3741
3847
|
event: event.type
|
|
3742
3848
|
});
|
|
3743
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
3849
|
+
_optionalChain([onDepositFailedRef, 'access', _151 => _151.current, 'optionalCall', _152 => _152(txHash, outcome.message)]);
|
|
3744
3850
|
}, [
|
|
3745
3851
|
debug,
|
|
3746
3852
|
onDepositCompleteRef,
|
|
@@ -3772,13 +3878,13 @@ function ProcessingStep({
|
|
|
3772
3878
|
updatePhaseTimings(
|
|
3773
3879
|
(previous) => syncPhaseTimings(previous, state.lastEvent)
|
|
3774
3880
|
);
|
|
3775
|
-
}, [_optionalChain([state, 'access',
|
|
3881
|
+
}, [_optionalChain([state, 'access', _153 => _153.lastEvent, 'optionalAccess', _154 => _154.time]), _optionalChain([state, 'access', _155 => _155.lastEvent, 'optionalAccess', _156 => _156.type]), updatePhaseTimings]);
|
|
3776
3882
|
const [swappedFiatContext, setSwappedFiatContext] = _react.useState.call(void 0, null);
|
|
3777
3883
|
_react.useEffect.call(void 0, () => {
|
|
3778
3884
|
let cancelled = false;
|
|
3779
3885
|
let timeoutId;
|
|
3780
|
-
const isFiatSwappedOrder = isSwappedOrder && _optionalChain([swappedContext, 'optionalAccess',
|
|
3781
|
-
const expectedOrderUuid = _nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess',
|
|
3886
|
+
const isFiatSwappedOrder = isSwappedOrder && _optionalChain([swappedContext, 'optionalAccess', _157 => _157.variant]) === "fiat";
|
|
3887
|
+
const expectedOrderUuid = _nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess', _158 => _158.expectedOrderUuid]), () => ( null));
|
|
3782
3888
|
setSwappedFiatContext(null);
|
|
3783
3889
|
if (isFiatSwappedOrder && !expectedOrderUuid) {
|
|
3784
3890
|
return () => {
|
|
@@ -3828,8 +3934,8 @@ function ProcessingStep({
|
|
|
3828
3934
|
smartAccount,
|
|
3829
3935
|
txHash,
|
|
3830
3936
|
isSwappedOrder,
|
|
3831
|
-
_optionalChain([swappedContext, 'optionalAccess',
|
|
3832
|
-
_optionalChain([swappedContext, 'optionalAccess',
|
|
3937
|
+
_optionalChain([swappedContext, 'optionalAccess', _159 => _159.variant]),
|
|
3938
|
+
_optionalChain([swappedContext, 'optionalAccess', _160 => _160.expectedOrderUuid])
|
|
3833
3939
|
]);
|
|
3834
3940
|
_react.useEffect.call(void 0, () => {
|
|
3835
3941
|
if (directTransfer) return;
|
|
@@ -3855,20 +3961,20 @@ function ProcessingStep({
|
|
|
3855
3961
|
debugLog(debug, "processing", "poll:event", {
|
|
3856
3962
|
type: lastEvent2.type,
|
|
3857
3963
|
matchesTx: eventMatchesTx,
|
|
3858
|
-
intentId: _optionalChain([eventData, 'optionalAccess',
|
|
3964
|
+
intentId: _optionalChain([eventData, 'optionalAccess', _161 => _161.intentId])
|
|
3859
3965
|
});
|
|
3860
3966
|
}
|
|
3861
3967
|
if (!isMounted) return;
|
|
3862
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
3968
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _162 => _162.type]) === "bridge-complete") {
|
|
3863
3969
|
setState({ type: "complete", lastEvent: eventForCurrentTx });
|
|
3864
|
-
const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access',
|
|
3970
|
+
const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access', _163 => _163.data, 'optionalAccess', _164 => _164.destination, 'optionalAccess', _165 => _165.transactionHash]);
|
|
3865
3971
|
debugLog(debug, "processing", "state:complete", {
|
|
3866
3972
|
txHash,
|
|
3867
3973
|
destinationTxHash: destinationTxHash2,
|
|
3868
3974
|
event: eventForCurrentTx.type
|
|
3869
3975
|
});
|
|
3870
3976
|
const context = processingContextRef.current;
|
|
3871
|
-
_optionalChain([onDepositCompleteRef, 'access',
|
|
3977
|
+
_optionalChain([onDepositCompleteRef, 'access', _166 => _166.current, 'optionalCall', _167 => _167(txHash, destinationTxHash2, {
|
|
3872
3978
|
amount: context.amount,
|
|
3873
3979
|
sourceChain: context.sourceChain,
|
|
3874
3980
|
sourceToken: context.sourceToken,
|
|
@@ -3879,7 +3985,7 @@ function ProcessingStep({
|
|
|
3879
3985
|
})]);
|
|
3880
3986
|
return;
|
|
3881
3987
|
}
|
|
3882
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
3988
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _168 => _168.type]) === "bridge-failed") {
|
|
3883
3989
|
const formatted = formatBridgeFailedMessage(eventForCurrentTx);
|
|
3884
3990
|
setState({
|
|
3885
3991
|
type: "failed",
|
|
@@ -3891,11 +3997,11 @@ function ProcessingStep({
|
|
|
3891
3997
|
message: formatted.message,
|
|
3892
3998
|
code: formatted.code
|
|
3893
3999
|
});
|
|
3894
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
4000
|
+
_optionalChain([onDepositFailedRef, 'access', _169 => _169.current, 'optionalCall', _170 => _170(txHash, formatted.message)]);
|
|
3895
4001
|
return;
|
|
3896
4002
|
}
|
|
3897
|
-
if (_optionalChain([eventForCurrentTx, 'optionalAccess',
|
|
3898
|
-
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access',
|
|
4003
|
+
if (_optionalChain([eventForCurrentTx, 'optionalAccess', _171 => _171.type]) === "error") {
|
|
4004
|
+
const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access', _172 => _172.data, 'optionalAccess', _173 => _173.message]), () => ( "Unknown error"));
|
|
3899
4005
|
setState({
|
|
3900
4006
|
type: "failed",
|
|
3901
4007
|
message: errorMessage,
|
|
@@ -3905,7 +4011,7 @@ function ProcessingStep({
|
|
|
3905
4011
|
txHash,
|
|
3906
4012
|
message: errorMessage
|
|
3907
4013
|
});
|
|
3908
|
-
_optionalChain([onDepositFailedRef, 'access',
|
|
4014
|
+
_optionalChain([onDepositFailedRef, 'access', _174 => _174.current, 'optionalCall', _175 => _175(txHash, errorMessage)]);
|
|
3909
4015
|
return;
|
|
3910
4016
|
}
|
|
3911
4017
|
setState((previous) => ({
|
|
@@ -3966,7 +4072,7 @@ function ProcessingStep({
|
|
|
3966
4072
|
txHash,
|
|
3967
4073
|
timeoutMs: ESCALATED_DELAY_MS
|
|
3968
4074
|
});
|
|
3969
|
-
_optionalChain([onErrorRef, 'access',
|
|
4075
|
+
_optionalChain([onErrorRef, 'access', _176 => _176.current, 'optionalCall', _177 => _177(message, "PROCESS_TIMEOUT")]);
|
|
3970
4076
|
}, ESCALATED_DELAY_MS);
|
|
3971
4077
|
return () => clearTimeout(timeoutId);
|
|
3972
4078
|
}, [debug, directTransfer, onErrorRef, state.type, txHash]);
|
|
@@ -3978,13 +4084,13 @@ function ProcessingStep({
|
|
|
3978
4084
|
const timelineNowMs = _nullishCoalesce(phaseTimings.endedAt, () => ( Date.now()));
|
|
3979
4085
|
const flowNoun = flowLabel === "withdraw" ? "withdrawal" : "deposit";
|
|
3980
4086
|
const flowCapitalized = flowLabel === "withdraw" ? "Withdrawal" : "Deposit";
|
|
3981
|
-
const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess',
|
|
4087
|
+
const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess', _178 => _178.data, 'optionalAccess', _179 => _179.destination, 'optionalAccess', _180 => _180.transactionHash]) || null;
|
|
3982
4088
|
const sourceDetails = getEventSourceDetails(lastEvent);
|
|
3983
4089
|
const displaySourceChain = _nullishCoalesce(sourceDetails.chainId, () => ( sourceChain));
|
|
3984
4090
|
const displaySourceToken = _nullishCoalesce(sourceDetails.token, () => ( sourceToken));
|
|
3985
4091
|
const displayAmount = _nullishCoalesce(sourceDetails.amount, () => ( amount));
|
|
3986
|
-
const sourceExplorerUrl =
|
|
3987
|
-
const destExplorerUrl = destinationTxHash ?
|
|
4092
|
+
const sourceExplorerUrl = _chunkU7SVYWVDcjs.getExplorerTxUrl.call(void 0, displaySourceChain, txHash);
|
|
4093
|
+
const destExplorerUrl = destinationTxHash ? _chunkU7SVYWVDcjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
|
|
3988
4094
|
const sourceDisplay = (() => {
|
|
3989
4095
|
const resolved = resolveTokenDisplay(displaySourceToken, displaySourceChain, {
|
|
3990
4096
|
symbol: _nullishCoalesce(providedSourceSymbol, () => ( (displaySourceChain === "solana" ? "SOL" : "Token"))),
|
|
@@ -4010,8 +4116,16 @@ function ProcessingStep({
|
|
|
4010
4116
|
const formattedDestinationAmount = eventDestination.amount !== void 0 ? formatRawTokenAmount(eventDestination.amount, targetDisplay) : void 0;
|
|
4011
4117
|
const amountUsdNumber = amountUsd !== void 0 && Number(amountUsd) > 0 ? Number(amountUsd) : void 0;
|
|
4012
4118
|
const prices = useTokenPrices(service, [
|
|
4013
|
-
|
|
4014
|
-
|
|
4119
|
+
{
|
|
4120
|
+
chainId: displaySourceChain,
|
|
4121
|
+
address: displaySourceToken,
|
|
4122
|
+
symbol: sourceDisplay.symbol
|
|
4123
|
+
},
|
|
4124
|
+
{
|
|
4125
|
+
chainId: _nullishCoalesce(eventDestination.chainId, () => ( targetChain)),
|
|
4126
|
+
address: _nullishCoalesce(eventDestination.token, () => ( targetToken)),
|
|
4127
|
+
symbol: targetDisplay.symbol
|
|
4128
|
+
}
|
|
4015
4129
|
]);
|
|
4016
4130
|
const estimatedReceiveAmount = (() => {
|
|
4017
4131
|
const estimate = estimateReceiveAmount({
|
|
@@ -4019,6 +4133,7 @@ function ProcessingStep({
|
|
|
4019
4133
|
sourceSymbol: sourceDisplay.symbol,
|
|
4020
4134
|
targetSymbol: targetDisplay.symbol,
|
|
4021
4135
|
sourceAmountUsd: amountUsdNumber,
|
|
4136
|
+
sourceTrusted: isRecognizedToken(displaySourceToken, displaySourceChain),
|
|
4022
4137
|
prices
|
|
4023
4138
|
});
|
|
4024
4139
|
return estimate !== void 0 ? formatTokenAmount(estimate, targetDisplay.symbol) : void 0;
|
|
@@ -4049,13 +4164,13 @@ function ProcessingStep({
|
|
|
4049
4164
|
const delayPhaseId = isProcessing && currentPhaseId && activePhaseElapsedMs >= SOFT_DELAY_MS[currentPhaseId] ? currentPhaseId : void 0;
|
|
4050
4165
|
void delayPhaseId;
|
|
4051
4166
|
void hasEscalatedDelay;
|
|
4052
|
-
const sourceChainIcon =
|
|
4053
|
-
const targetChainIcon =
|
|
4054
|
-
const sourceChainName =
|
|
4055
|
-
const targetChainName =
|
|
4167
|
+
const sourceChainIcon = _chunkU7SVYWVDcjs.getChainIcon.call(void 0, displaySourceChain);
|
|
4168
|
+
const targetChainIcon = _chunkU7SVYWVDcjs.getChainIcon.call(void 0, targetChain);
|
|
4169
|
+
const sourceChainName = _chunkU7SVYWVDcjs.getChainName.call(void 0, displaySourceChain);
|
|
4170
|
+
const targetChainName = _chunkU7SVYWVDcjs.getChainName.call(void 0, targetChain);
|
|
4056
4171
|
const timerText = formatTimer(elapsedSeconds);
|
|
4057
|
-
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
4058
|
-
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess',
|
|
4172
|
+
const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _181 => _181.feeSponsored]), () => ( false));
|
|
4173
|
+
const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _182 => _182.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
|
|
4059
4174
|
const stateTitle = isComplete ? `${flowCapitalized} successful` : isFailed ? `${flowCapitalized} failed` : "Processing...";
|
|
4060
4175
|
const handleRetry = _nullishCoalesce(onRetry, () => ( onNewDeposit));
|
|
4061
4176
|
const headerContent = isComplete ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-body-header", children: [
|
|
@@ -4066,20 +4181,20 @@ function ProcessingStep({
|
|
|
4066
4181
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-body-header-text", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h2", { className: "rs-body-header-title", children: stateTitle }) })
|
|
4067
4182
|
] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WalletIcon, {}), title: stateTitle });
|
|
4068
4183
|
if (isComplete && isSwappedOrder) {
|
|
4069
|
-
const effectivePaymentMethod = _nullishCoalesce(_nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess',
|
|
4184
|
+
const effectivePaymentMethod = _nullishCoalesce(_nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess', _183 => _183.method]), () => ( _optionalChain([swappedFiatContext, 'optionalAccess', _184 => _184.paymentMethod]))), () => ( null));
|
|
4070
4185
|
const onrampMethod = effectivePaymentMethod ? formatPaymentMethod(effectivePaymentMethod) : null;
|
|
4071
|
-
const onrampMethodIcon = _optionalChain([swappedContext, 'optionalAccess',
|
|
4186
|
+
const onrampMethodIcon = _optionalChain([swappedContext, 'optionalAccess', _185 => _185.variant]) === "connect" && effectivePaymentMethod ? getExchangeLogoSrc(
|
|
4072
4187
|
_nullishCoalesce(onrampMethod, () => ( effectivePaymentMethod)),
|
|
4073
4188
|
effectivePaymentMethod
|
|
4074
4189
|
) : null;
|
|
4075
|
-
const connectPaidAmount = _optionalChain([swappedContext, 'optionalAccess',
|
|
4076
|
-
const amountPaid = _nullishCoalesce(connectPaidAmount, () => ( (_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
4190
|
+
const connectPaidAmount = _optionalChain([swappedContext, 'optionalAccess', _186 => _186.variant]) === "connect" ? `${formattedSentAmount} ${sourceSymbol}` : null;
|
|
4191
|
+
const amountPaid = _nullishCoalesce(connectPaidAmount, () => ( (_optionalChain([swappedFiatContext, 'optionalAccess', _187 => _187.paidAmountUsd]) != null ? `$${swappedFiatContext.paidAmountUsd.toFixed(2)}` : null)));
|
|
4077
4192
|
const depositedAmount = receiveDisplay;
|
|
4078
|
-
const onrampFeeUsd = _nullishCoalesce(_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
4193
|
+
const onrampFeeUsd = _nullishCoalesce(_optionalChain([swappedFiatContext, 'optionalAccess', _188 => _188.onrampFeeUsd]), () => ( null));
|
|
4079
4194
|
const quoteFees = getMarketNetworkFees(quoteFeeBreakdown);
|
|
4080
4195
|
const fallbackNetworkFeeUsd = quoteFees === null && quotedFeeAmount !== void 0 && Number.isFinite(Number(quotedFeeAmount)) ? Number(quotedFeeAmount) : null;
|
|
4081
|
-
const marketFeeUsd = _nullishCoalesce(_optionalChain([quoteFees, 'optionalAccess',
|
|
4082
|
-
const networkFeeUsd = _nullishCoalesce(_optionalChain([quoteFees, 'optionalAccess',
|
|
4196
|
+
const marketFeeUsd = _nullishCoalesce(_optionalChain([quoteFees, 'optionalAccess', _189 => _189.marketUsd]), () => ( null));
|
|
4197
|
+
const networkFeeUsd = _nullishCoalesce(_optionalChain([quoteFees, 'optionalAccess', _190 => _190.networkUsd]), () => ( fallbackNetworkFeeUsd));
|
|
4083
4198
|
const sponsoredFeeTooltip = "This fee is sponsored for this deposit.";
|
|
4084
4199
|
const feesTooltip = feeSponsored ? "On-ramp fees are charged by the payment provider. Market and network fees are sponsored for this deposit." : "Fees include on-ramp, market, and network costs for this deposit.";
|
|
4085
4200
|
const feeRows = [];
|
|
@@ -4169,7 +4284,7 @@ function ProcessingStep({
|
|
|
4169
4284
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Ticker, { value: timerText }) })
|
|
4170
4285
|
] }),
|
|
4171
4286
|
isSwappedOrder ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
4172
|
-
_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
4287
|
+
_optionalChain([swappedFiatContext, 'optionalAccess', _191 => _191.paidAmountUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
4173
4288
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "You pay" }),
|
|
4174
4289
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
4175
4290
|
"$",
|
|
@@ -4181,7 +4296,7 @@ function ProcessingStep({
|
|
|
4181
4296
|
] })
|
|
4182
4297
|
] })
|
|
4183
4298
|
] }),
|
|
4184
|
-
_optionalChain([swappedFiatContext, 'optionalAccess',
|
|
4299
|
+
_optionalChain([swappedFiatContext, 'optionalAccess', _192 => _192.onrampFeeUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
|
|
4185
4300
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "On-ramp fee" }),
|
|
4186
4301
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
|
|
4187
4302
|
"$",
|
|
@@ -4416,4 +4531,7 @@ function accountFromPrivateKey(privateKey) {
|
|
|
4416
4531
|
|
|
4417
4532
|
|
|
4418
4533
|
|
|
4419
|
-
|
|
4534
|
+
|
|
4535
|
+
|
|
4536
|
+
|
|
4537
|
+
exports.Modal = Modal; exports.WalletIcon = WalletIcon; exports.ExternalLinkIcon = ExternalLinkIcon; exports.CheckIcon = CheckIcon; exports.TransferCryptoIcon = TransferCryptoIcon; exports.ChevronLeftIcon = ChevronLeftIcon; exports.ChevronDownIcon = ChevronDownIcon; exports.CloseIcon = CloseIcon; exports.HandCoinsIcon = HandCoinsIcon; exports.HistoryIcon = HistoryIcon; exports.InfoIcon = InfoIcon; exports.CopyIcon = CopyIcon; exports.ArrowUpRightIcon = ArrowUpRightIcon; exports.AlertTriangleIcon = AlertTriangleIcon; exports.PercentIcon = PercentIcon; exports.ClockIcon = ClockIcon; exports.PlusCircleIcon = PlusCircleIcon; exports.CircleArrowOutUpLeftIcon = CircleArrowOutUpLeftIcon; exports.BankIcon = BankIcon; exports.UnplugIcon = UnplugIcon; exports.Callout = Callout; exports.BodyHeader = BodyHeader; exports.PoweredBy = PoweredBy; exports.Spinner = Spinner; exports.getExchangeLogo = getExchangeLogo; exports.ConnectStep = ConnectStep; exports.useLatestRef = useLatestRef; exports.Button = Button; exports.TokenIcon = TokenIcon; exports.debugLog = debugLog; exports.debugError = debugError; exports.getAssetId = getAssetId; exports.portfolioToAssets = portfolioToAssets; exports.isNativeAsset = isNativeAsset; exports.buildSessionDetails = buildSessionDetails; exports.createDepositService = createDepositService; exports.currencyFormatter = currencyFormatter; exports.tokenFormatter = tokenFormatter; exports.isUnsupportedChainSwitchError = isUnsupportedChainSwitchError; exports.formatUserError = formatUserError; exports.Tooltip = Tooltip; exports.formatTokenAmount = formatTokenAmount; exports.isDisplayStablecoinSymbol = isDisplayStablecoinSymbol; exports.isRecognizedToken = isRecognizedToken; exports.formatQuotedReceive = formatQuotedReceive; exports.formatReceiveEstimate = formatReceiveEstimate; exports.getEventTxHash = getEventTxHash; exports.getEventSourceDetails = getEventSourceDetails; exports.isDepositEvent = isDepositEvent; exports.isFailedEvent = isFailedEvent; exports.txRefsMatch = txRefsMatch; exports.failureMessageForEvent = failureMessageForEvent; exports.fetchTokenPriceUsd = fetchTokenPriceUsd; exports.useTokenPrices = useTokenPrices; exports.ProcessingStep = ProcessingStep; exports.rpcUrlFor = rpcUrlFor; exports.RpcUrlsProvider = RpcUrlsProvider; exports.useRpcUrls = useRpcUrls; exports.useStableRpcUrls = useStableRpcUrls; exports.getPublicClient = getPublicClient; exports.getHyperEvmReadClient = getHyperEvmReadClient; exports.loadSessionOwnerFromStorage = loadSessionOwnerFromStorage; exports.saveSessionOwnerToStorage = saveSessionOwnerToStorage; exports.createSessionOwnerKey = createSessionOwnerKey; exports.accountFromPrivateKey = accountFromPrivateKey; exports.applyTheme = applyTheme;
|