@rhinestone/deposit-modal 0.6.0 → 0.7.0

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.
Files changed (30) hide show
  1. package/dist/{DepositModalReown-J3KYAOD3.cjs → DepositModalReown-CHVDFNEX.cjs} +9 -9
  2. package/dist/{DepositModalReown-YD7TLEAA.mjs → DepositModalReown-T4RRW5FM.mjs} +6 -6
  3. package/dist/{WithdrawModalReown-ZPDMX47Z.mjs → WithdrawModalReown-Q6MUMZTX.mjs} +5 -5
  4. package/dist/{WithdrawModalReown-QSQUV6HX.cjs → WithdrawModalReown-YZMZTN6E.cjs} +8 -8
  5. package/dist/{chunk-FJWLC4AM.mjs → chunk-4JLYWRQA.mjs} +1 -1
  6. package/dist/{chunk-YYIE5U5K.cjs → chunk-6P3WNDED.cjs} +10 -8
  7. package/dist/{chunk-3JVGI7FC.mjs → chunk-CLUR2J72.mjs} +4 -4
  8. package/dist/{chunk-WJX3TJFK.mjs → chunk-CPMHRMPH.mjs} +36 -7
  9. package/dist/{chunk-ABVRVW3P.cjs → chunk-HH46H6ZI.cjs} +37 -8
  10. package/dist/{chunk-DXGM6YET.mjs → chunk-J52W34Y7.mjs} +6 -4
  11. package/dist/{chunk-F7P4MV72.mjs → chunk-K6J3RDDK.mjs} +1 -1
  12. package/dist/{chunk-DASS33PJ.cjs → chunk-KUURQOTT.cjs} +100 -100
  13. package/dist/{chunk-GQDVHMOT.mjs → chunk-OYPFPEIT.mjs} +333 -54
  14. package/dist/{chunk-7LVI3VAL.cjs → chunk-QSMPJQTX.cjs} +698 -529
  15. package/dist/{chunk-UEKPBRBY.cjs → chunk-RLMXWLF4.cjs} +3 -3
  16. package/dist/{chunk-ZDYV536Q.cjs → chunk-UN6MEOOA.cjs} +382 -103
  17. package/dist/{chunk-NSAODZSS.mjs → chunk-UZENNYHS.mjs} +242 -73
  18. package/dist/{chunk-NRNJAQUA.cjs → chunk-XOBLFIGV.cjs} +4 -4
  19. package/dist/constants.cjs +2 -2
  20. package/dist/constants.mjs +1 -1
  21. package/dist/deposit.cjs +6 -6
  22. package/dist/deposit.mjs +5 -5
  23. package/dist/index.cjs +7 -7
  24. package/dist/index.mjs +6 -6
  25. package/dist/polymarket.cjs +6 -6
  26. package/dist/polymarket.mjs +3 -3
  27. package/dist/styles.css +103 -31
  28. package/dist/withdraw.cjs +5 -5
  29. package/dist/withdraw.mjs +4 -4
  30. package/package.json +1 -1
@@ -13,7 +13,7 @@
13
13
 
14
14
 
15
15
 
16
- var _chunkABVRVW3Pcjs = require('./chunk-ABVRVW3P.cjs');
16
+ var _chunkHH46H6ZIcjs = require('./chunk-HH46H6ZI.cjs');
17
17
 
18
18
  // src/components/ui/Modal.tsx
19
19
 
@@ -538,6 +538,7 @@ function createDepositService(baseUrl, options) {
538
538
  }
539
539
  const PORTFOLIO_CACHE_TTL_MS = 3e4;
540
540
  const portfolioCache = /* @__PURE__ */ new Map();
541
+ let topTokensPromise = null;
541
542
  function cachedPortfolio(key, fetcher, forceRefresh = false) {
542
543
  const now = Date.now();
543
544
  const entry = portfolioCache.get(key);
@@ -642,7 +643,7 @@ function createDepositService(baseUrl, options) {
642
643
  },
643
644
  async fetchPortfolio(address, options2) {
644
645
  return cachedPortfolio(`evm:${address.toLowerCase()}`, async () => {
645
- const url = apiUrl(`/portfolio/${address}`);
646
+ const url = apiUrl(`/portfolio/${address}?includeUnsupported=true`);
646
647
  debugLog(debug, scope, "fetchPortfolio:request", { url, address });
647
648
  const response = await fetch(url, {
648
649
  method: "GET",
@@ -948,7 +949,7 @@ function createDepositService(baseUrl, options) {
948
949
  },
949
950
  async checkLiquidity(params) {
950
951
  if (params.destinationChainId === "solana") {
951
- const token = _chunkABVRVW3Pcjs.getSolanaTokenByMint.call(void 0, params.destinationToken);
952
+ const token = _chunkHH46H6ZIcjs.getSolanaTokenByMint.call(void 0, params.destinationToken);
952
953
  return {
953
954
  hasLiquidity: true,
954
955
  symbol: _nullishCoalesce(_optionalChain([token, 'optionalAccess', _25 => _25.symbol]), () => ( "Token")),
@@ -1178,6 +1179,60 @@ function createDepositService(baseUrl, options) {
1178
1179
  stale: body.stale === true ? true : void 0
1179
1180
  };
1180
1181
  },
1182
+ getTopTokens() {
1183
+ if (!topTokensPromise) {
1184
+ topTokensPromise = (async () => {
1185
+ try {
1186
+ const response = await fetch(apiUrl("/tokens"), {
1187
+ method: "GET",
1188
+ headers: { "Content-Type": "application/json" }
1189
+ });
1190
+ if (!response.ok) {
1191
+ debugLog(debug, scope, "getTopTokens:unavailable", {
1192
+ status: response.status
1193
+ });
1194
+ return null;
1195
+ }
1196
+ const data = await response.json();
1197
+ const tokens = _nullishCoalesce(data.tokens, () => ( null));
1198
+ debugLog(debug, scope, "getTopTokens:success", {
1199
+ chains: tokens ? Object.keys(tokens).length : 0
1200
+ });
1201
+ return tokens;
1202
+ } catch (error) {
1203
+ debugError(debug, scope, "getTopTokens:error", error);
1204
+ return null;
1205
+ }
1206
+ })();
1207
+ }
1208
+ return topTokensPromise;
1209
+ },
1210
+ async getSetup() {
1211
+ const url = apiUrl("/setup");
1212
+ try {
1213
+ const response = await fetch(url, {
1214
+ method: "GET",
1215
+ headers: { "Content-Type": "application/json" },
1216
+ cache: "no-store"
1217
+ });
1218
+ if (!response.ok) {
1219
+ debugLog(debug, scope, "getSetup:unavailable", {
1220
+ status: response.status
1221
+ });
1222
+ return null;
1223
+ }
1224
+ const data = await response.json();
1225
+ debugLog(debug, scope, "getSetup:success", {
1226
+ hasWhitelist: Boolean(data.depositWhitelist),
1227
+ whitelistChains: data.depositWhitelist ? Object.keys(data.depositWhitelist).length : 0,
1228
+ minDepositUsd: data.minDepositUsd
1229
+ });
1230
+ return data;
1231
+ } catch (error) {
1232
+ debugError(debug, scope, "getSetup:error", error);
1233
+ return null;
1234
+ }
1235
+ },
1181
1236
  async fetchSwappedOrderStatus(smartAccount) {
1182
1237
  const url = apiUrl(
1183
1238
  `/onramp/swapped/status/${encodeURIComponent(smartAccount)}`
@@ -1198,7 +1253,16 @@ function createDepositService(baseUrl, options) {
1198
1253
  const status = typeof body.status === "string" ? body.status : null;
1199
1254
  const orderId = typeof body.orderId === "string" ? body.orderId : null;
1200
1255
  if (!status || !orderId) return null;
1201
- const numericOrNull = (v) => typeof v === "number" && Number.isFinite(v) ? v : null;
1256
+ const numericOrNull = (v) => {
1257
+ if (typeof v === "number") {
1258
+ return Number.isFinite(v) ? v : null;
1259
+ }
1260
+ if (typeof v === "string" && v.trim().length > 0) {
1261
+ const parsed = Number(v);
1262
+ return Number.isFinite(parsed) ? parsed : null;
1263
+ }
1264
+ return null;
1265
+ };
1202
1266
  return {
1203
1267
  orderId,
1204
1268
  status,
@@ -1239,14 +1303,14 @@ function normalizeOrchestratorPortfolio(data) {
1239
1303
  const unlocked = _nullishCoalesce(_optionalChain([chainBalance, 'access', _32 => _32.balance, 'optionalAccess', _33 => _33.unlocked]), () => ( "0"));
1240
1304
  const normalizedName = tokenData.tokenName.trim();
1241
1305
  const isNativeSymbol = normalizedName.toUpperCase() === "ETH" || normalizedName.toUpperCase() === "ETHER";
1242
- const tokenAddress = _nullishCoalesce(_nullishCoalesce(chainBalance.tokenAddress, () => ( extractTokenAddress(tokenData, chainBalance.chainId))), () => ( _chunkABVRVW3Pcjs.getTokenAddress.call(void 0, tokenData.tokenName, chainBalance.chainId)));
1243
- const resolvedTokenAddress = isNativeSymbol ? _chunkABVRVW3Pcjs.NATIVE_TOKEN_ADDRESS : tokenAddress;
1306
+ const tokenAddress = _nullishCoalesce(_nullishCoalesce(chainBalance.tokenAddress, () => ( extractTokenAddress(tokenData, chainBalance.chainId))), () => ( _chunkHH46H6ZIcjs.getTokenAddress.call(void 0, tokenData.tokenName, chainBalance.chainId)));
1307
+ const resolvedTokenAddress = isNativeSymbol ? _chunkHH46H6ZIcjs.NATIVE_TOKEN_ADDRESS : tokenAddress;
1244
1308
  if (!resolvedTokenAddress) {
1245
1309
  continue;
1246
1310
  }
1247
- const registrySymbol = _chunkABVRVW3Pcjs.getTokenSymbol.call(void 0, resolvedTokenAddress, chainBalance.chainId);
1311
+ const registrySymbol = _chunkHH46H6ZIcjs.getTokenSymbol.call(void 0, resolvedTokenAddress, chainBalance.chainId);
1248
1312
  const symbol = registrySymbol !== "Token" ? registrySymbol : normalizedName || "Token";
1249
- const decimals = registrySymbol !== "Token" ? _chunkABVRVW3Pcjs.getTokenDecimalsByAddress.call(void 0, resolvedTokenAddress, chainBalance.chainId) : _nullishCoalesce(tokenData.tokenDecimals, () => ( 18));
1313
+ const decimals = registrySymbol !== "Token" ? _chunkHH46H6ZIcjs.getTokenDecimalsByAddress.call(void 0, resolvedTokenAddress, chainBalance.chainId) : _nullishCoalesce(tokenData.tokenDecimals, () => ( 18));
1250
1314
  tokens.push({
1251
1315
  chainId: chainBalance.chainId,
1252
1316
  address: resolvedTokenAddress,
@@ -1266,7 +1330,7 @@ function normalizeOrchestratorPortfolio(data) {
1266
1330
  function normalizeDirectToken(token) {
1267
1331
  const rawChainId = _nullishCoalesce(extractNumber(token, "chainId"), () => ( extractNumber(token.chain, "id")));
1268
1332
  const rawChainString = _nullishCoalesce(extractString(token, "chainId"), () => ( extractString(token.chain, "id")));
1269
- const chainId = _nullishCoalesce(rawChainId, () => ( (rawChainString ? _chunkABVRVW3Pcjs.isSolanaCaip2.call(void 0, rawChainString) || rawChainString.toLowerCase() === "solana" ? "solana" : _chunkABVRVW3Pcjs.parseEvmChainId.call(void 0, rawChainString) : null)));
1333
+ const chainId = _nullishCoalesce(rawChainId, () => ( (rawChainString ? _chunkHH46H6ZIcjs.isSolanaCaip2.call(void 0, rawChainString) || rawChainString.toLowerCase() === "solana" ? "solana" : _chunkHH46H6ZIcjs.parseEvmChainId.call(void 0, rawChainString) : null)));
1270
1334
  if (chainId === null) return null;
1271
1335
  const symbol = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "symbol"), () => ( extractString(token, "tokenSymbol"))), () => ( extractString(token, "tokenName"))), () => ( extractString(token, "name")));
1272
1336
  if (!symbol) return null;
@@ -1275,14 +1339,14 @@ function normalizeDirectToken(token) {
1275
1339
  const address = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(extractString(token, "address"), () => ( extractString(token, "tokenAddress"))), () => ( extractString(
1276
1340
  token.token,
1277
1341
  "address"
1278
- ))), () => ( (typeof chainId === "number" ? _chunkABVRVW3Pcjs.getTokenAddress.call(void 0, symbol, chainId) : void 0)));
1342
+ ))), () => ( (typeof chainId === "number" ? _chunkHH46H6ZIcjs.getTokenAddress.call(void 0, symbol, chainId) : void 0)));
1279
1343
  if (!address) return null;
1280
1344
  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));
1281
1345
  const isSolanaToken = chainId === "solana";
1282
- const registrySymbol = isSolanaToken ? "Token" : _chunkABVRVW3Pcjs.getTokenSymbol.call(void 0, address, chainId);
1346
+ const registrySymbol = isSolanaToken ? "Token" : _chunkHH46H6ZIcjs.getTokenSymbol.call(void 0, address, chainId);
1283
1347
  const resolvedSymbol = isSolanaToken ? symbol : registrySymbol !== "Token" ? registrySymbol : symbol;
1284
1348
  const backendDecimals = _nullishCoalesce(extractNumber(token, "decimals"), () => ( extractNumber(token, "tokenDecimals")));
1285
- const resolvedDecimals = !isSolanaToken && registrySymbol !== "Token" ? _chunkABVRVW3Pcjs.getTokenDecimalsByAddress.call(void 0, address, chainId) : _nullishCoalesce(backendDecimals, () => ( 18));
1349
+ const resolvedDecimals = !isSolanaToken && registrySymbol !== "Token" ? _chunkHH46H6ZIcjs.getTokenDecimalsByAddress.call(void 0, address, chainId) : _nullishCoalesce(backendDecimals, () => ( 18));
1286
1350
  return {
1287
1351
  chainId,
1288
1352
  address,
@@ -1423,7 +1487,7 @@ function getPublicClient(chainId, rpcUrls) {
1423
1487
  const cacheKey = `${chainId}|${_nullishCoalesce(url, () => ( ""))}`;
1424
1488
  let client = clientCache.get(cacheKey);
1425
1489
  if (!client) {
1426
- const chain = _chunkABVRVW3Pcjs.CHAIN_BY_ID[chainId];
1490
+ const chain = _chunkHH46H6ZIcjs.CHAIN_BY_ID[chainId];
1427
1491
  client = _viem.createPublicClient.call(void 0, {
1428
1492
  chain,
1429
1493
  transport: _viem.http.call(void 0, url)
@@ -2231,7 +2295,7 @@ function VisaMark() {
2231
2295
  xmlns: "http://www.w3.org/2000/svg",
2232
2296
  "aria-hidden": "true",
2233
2297
  children: [
2234
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "rect", { width: "37.2537", height: "24", rx: "4.2985", fill: "white" }),
2298
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "rect", { width: "38", height: "24", rx: "4.2985", fill: "white" }),
2235
2299
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2236
2300
  "path",
2237
2301
  {
@@ -2254,7 +2318,7 @@ function MastercardMark() {
2254
2318
  xmlns: "http://www.w3.org/2000/svg",
2255
2319
  "aria-hidden": "true",
2256
2320
  children: [
2257
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "rect", { width: "37.2537", height: "24", rx: "4.2985", fill: "white" }),
2321
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "rect", { width: "38", height: "24", rx: "4.2985", fill: "white" }),
2258
2322
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2259
2323
  "path",
2260
2324
  {
@@ -2298,7 +2362,7 @@ function AmexMark() {
2298
2362
  xmlns: "http://www.w3.org/2000/svg",
2299
2363
  "aria-hidden": "true",
2300
2364
  children: [
2301
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "rect", { width: "37.2537", height: "24", rx: "4.2985", fill: "#006FCF" }),
2365
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "rect", { width: "38", height: "24", rx: "4.2985", fill: "#006FCF" }),
2302
2366
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2303
2367
  "path",
2304
2368
  {
@@ -2346,12 +2410,12 @@ function rankCryptoRows(descriptors) {
2346
2410
  return descriptors.map((descriptor, index) => ({ descriptor, index })).sort((a, b) => {
2347
2411
  const first = a.descriptor;
2348
2412
  const second = b.descriptor;
2349
- if (first.isBalanceSource !== second.isBalanceSource) {
2350
- return first.isBalanceSource ? -1 : 1;
2351
- }
2352
- if (!first.isBalanceSource) return a.index - b.index;
2353
- if (first.resolved !== second.resolved) return first.resolved ? -1 : 1;
2354
- if (first.resolved && first.balanceUsd !== second.balanceUsd) {
2413
+ const firstHasFunds = first.isBalanceSource && first.resolved && first.balanceUsd > 0;
2414
+ const secondHasFunds = second.isBalanceSource && second.resolved && second.balanceUsd > 0;
2415
+ const firstTier = firstHasFunds ? 0 : first.isBalanceSource ? 2 : 1;
2416
+ const secondTier = secondHasFunds ? 0 : second.isBalanceSource ? 2 : 1;
2417
+ if (firstTier !== secondTier) return firstTier - secondTier;
2418
+ if (firstTier === 0 && first.balanceUsd !== second.balanceUsd) {
2355
2419
  return second.balanceUsd - first.balanceUsd;
2356
2420
  }
2357
2421
  return a.index - b.index;
@@ -2394,7 +2458,7 @@ var EXCHANGE_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fr
2394
2458
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ExchangeBadgeIcons, {}),
2395
2459
  "+6"
2396
2460
  ] });
2397
- var EXTRA_CHAIN_COUNT = Math.max(0, _chunkABVRVW3Pcjs.getSupportedChainIds.call(void 0, ).length - 3);
2461
+ var EXTRA_CHAIN_COUNT = Math.max(0, _chunkHH46H6ZIcjs.getSupportedChainIds.call(void 0, ).length - 3);
2398
2462
  var CHAIN_BADGE_META = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
2399
2463
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChainBadgeIcons, {}),
2400
2464
  EXTRA_CHAIN_COUNT > 0 ? `+${EXTRA_CHAIN_COUNT}` : null
@@ -2826,21 +2890,25 @@ Tooltip.displayName = "Tooltip";
2826
2890
  // src/components/ui/FeesAccordion.tsx
2827
2891
 
2828
2892
 
2829
- function FeesAccordion({ total, rows }) {
2893
+ function FeesAccordion({ total, rows, tooltip }) {
2830
2894
  const [open, setOpen] = _react.useState.call(void 0, false);
2831
2895
  const expandable = rows.length > 0;
2832
2896
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-fees-accordion", children: [
2833
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
2834
- "button",
2835
- {
2836
- type: "button",
2837
- className: "rs-fees-accordion-summary",
2838
- "aria-expanded": expandable ? open : void 0,
2839
- disabled: !expandable,
2840
- onClick: () => expandable && setOpen((o) => !o),
2841
- children: [
2842
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Fees" }),
2843
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
2897
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-fees-accordion-summary", children: [
2898
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-fees-accordion-label", children: [
2899
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Fees" }),
2900
+ tooltip && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Tooltip, { content: tooltip, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-info", "aria-label": "Fees info", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InfoIcon, {}) }) })
2901
+ ] }),
2902
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
2903
+ "button",
2904
+ {
2905
+ type: "button",
2906
+ className: "rs-fees-accordion-toggle",
2907
+ "aria-label": "Fees",
2908
+ "aria-expanded": expandable ? open : void 0,
2909
+ disabled: !expandable,
2910
+ onClick: () => expandable && setOpen((o) => !o),
2911
+ children: [
2844
2912
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: total }),
2845
2913
  expandable && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2846
2914
  "span",
@@ -2850,13 +2918,29 @@ function FeesAccordion({ total, rows }) {
2850
2918
  children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ChevronDownIcon, {})
2851
2919
  }
2852
2920
  )
2853
- ] })
2854
- ]
2855
- }
2856
- ),
2921
+ ]
2922
+ }
2923
+ )
2924
+ ] }),
2857
2925
  expandable && open && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-fees-accordion-rows", children: rows.map((row, i) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-fees-accordion-row", children: [
2858
2926
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: row.label }),
2859
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: row.value })
2927
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
2928
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2929
+ "span",
2930
+ {
2931
+ className: row.strike ? "rs-review-detail-value--strike" : void 0,
2932
+ children: row.value
2933
+ }
2934
+ ),
2935
+ row.tooltip && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Tooltip, { content: row.tooltip, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2936
+ "span",
2937
+ {
2938
+ className: "rs-review-detail-info",
2939
+ "aria-label": `${row.label} info`,
2940
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, InfoIcon, {})
2941
+ }
2942
+ ) })
2943
+ ] })
2860
2944
  ] }, `${row.label}-${i}`)) })
2861
2945
  ] });
2862
2946
  }
@@ -2872,6 +2956,7 @@ function SwappedReceipt({
2872
2956
  depositedIcon,
2873
2957
  feesTotal,
2874
2958
  feeRows,
2959
+ feesTooltip,
2875
2960
  newLabel,
2876
2961
  onNewDeposit,
2877
2962
  onClose
@@ -2892,13 +2977,20 @@ function SwappedReceipt({
2892
2977
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: amountPaid })
2893
2978
  ] }),
2894
2979
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
2895
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Receive" }),
2980
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Deposited amount" }),
2896
2981
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
2897
2982
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: depositedAmount }),
2898
2983
  depositedIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "img", { src: depositedIcon, alt: "" }) })
2899
2984
  ] })
2900
2985
  ] }),
2901
- feesTotal != null && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FeesAccordion, { total: feesTotal, rows: _nullishCoalesce(feeRows, () => ( [])) })
2986
+ feesTotal != null && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
2987
+ FeesAccordion,
2988
+ {
2989
+ total: feesTotal,
2990
+ rows: _nullishCoalesce(feeRows, () => ( [])),
2991
+ tooltip: _nullishCoalesce(feesTooltip, () => ( void 0))
2992
+ }
2993
+ )
2902
2994
  ] }),
2903
2995
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-button-row", children: [
2904
2996
  onNewDeposit && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Button, { variant: "outline", onClick: onNewDeposit, fullWidth: true, children: newLabel }),
@@ -3070,13 +3162,13 @@ var EVM_ADDRESS_RE = /^0x[a-fA-F0-9]{40}$/;
3070
3162
  function resolveTokenDisplay(token, chain, fallback) {
3071
3163
  if (token !== void 0) {
3072
3164
  if (chain === "solana") {
3073
- const solanaToken = _chunkABVRVW3Pcjs.getSolanaTokenByMint.call(void 0, token);
3165
+ const solanaToken = _chunkHH46H6ZIcjs.getSolanaTokenByMint.call(void 0, token);
3074
3166
  if (solanaToken) {
3075
3167
  return { symbol: solanaToken.symbol, decimals: solanaToken.decimals };
3076
3168
  }
3077
3169
  } else if (EVM_ADDRESS_RE.test(token)) {
3078
- const symbol = _chunkABVRVW3Pcjs.getTokenSymbol.call(void 0, token, chain);
3079
- const decimals = _chunkABVRVW3Pcjs.findTokenDecimals.call(void 0, token, chain);
3170
+ const symbol = _chunkHH46H6ZIcjs.getTokenSymbol.call(void 0, token, chain);
3171
+ const decimals = _chunkHH46H6ZIcjs.findTokenDecimals.call(void 0, token, chain);
3080
3172
  if (symbol !== "Token" || decimals !== void 0) {
3081
3173
  return {
3082
3174
  symbol: symbol !== "Token" ? symbol : _nullishCoalesce(_optionalChain([fallback, 'optionalAccess', _117 => _117.symbol]), () => ( symbol)),
@@ -3252,6 +3344,8 @@ function FailedBadge() {
3252
3344
  var INITIAL_POLL_INTERVAL = 3e3;
3253
3345
  var MAX_POLL_INTERVAL = 3e4;
3254
3346
  var BACKOFF_MULTIPLIER = 1.5;
3347
+ var SWAPPED_RECEIPT_STATUS_RETRY_INTERVAL_MS = 1e3;
3348
+ var SWAPPED_FIAT_STATUS_MAX_ATTEMPTS = 12;
3255
3349
  var ESCALATED_DELAY_MS = 10 * 60 * 1e3;
3256
3350
  var SOFT_DELAY_MS = {
3257
3351
  confirming: 90 * 1e3,
@@ -3282,6 +3376,36 @@ function formatPaymentMethod(method) {
3282
3376
  if (PAYMENT_METHOD_LABELS[key]) return PAYMENT_METHOD_LABELS[key];
3283
3377
  return key.replace(/[-_]+/g, " ").split(" ").filter(Boolean).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
3284
3378
  }
3379
+ function normalizeFeeUsd(value) {
3380
+ return Number.isFinite(value) ? Math.max(0, value) : null;
3381
+ }
3382
+ function formatUsdFee(value) {
3383
+ return `$${_nullishCoalesce(_optionalChain([normalizeFeeUsd, 'call', _121 => _121(value), 'optionalAccess', _122 => _122.toFixed, 'call', _123 => _123(2)]), () => ( "0.00"))}`;
3384
+ }
3385
+ function getMarketNetworkFees(breakdown) {
3386
+ if (!breakdown) return null;
3387
+ const gasUsd = normalizeFeeUsd(breakdown.gasUsd);
3388
+ const bridgeUsd = normalizeFeeUsd(breakdown.bridgeUsd);
3389
+ const swapUsd = normalizeFeeUsd(breakdown.swapUsd);
3390
+ if (gasUsd === null || bridgeUsd === null || swapUsd === null) return null;
3391
+ return {
3392
+ marketUsd: bridgeUsd + swapUsd,
3393
+ networkUsd: gasUsd
3394
+ };
3395
+ }
3396
+ function toSwappedFiatContext(status) {
3397
+ return {
3398
+ orderCrypto: status.orderCrypto,
3399
+ orderCryptoAmount: status.orderCryptoAmount,
3400
+ paidAmountUsd: status.paidAmountUsd,
3401
+ paidAmountEur: status.paidAmountEur,
3402
+ onrampFeeUsd: status.onrampFeeUsd,
3403
+ paymentMethod: status.paymentMethod
3404
+ };
3405
+ }
3406
+ function hasFiatReceiptPricing(status) {
3407
+ return status.paidAmountUsd != null && status.onrampFeeUsd != null;
3408
+ }
3285
3409
  function loadPhaseTimings(txHash) {
3286
3410
  if (typeof window === "undefined") return null;
3287
3411
  try {
@@ -3310,12 +3434,12 @@ function isEventForTx(event, txHash) {
3310
3434
  return txRefsMatch(eventTxHash, txHash);
3311
3435
  }
3312
3436
  function parseWebhookTimestamp(event) {
3313
- if (typeof _optionalChain([event, 'optionalAccess', _121 => _121.time]) !== "string") return void 0;
3437
+ if (typeof _optionalChain([event, 'optionalAccess', _124 => _124.time]) !== "string") return void 0;
3314
3438
  const timestamp = Date.parse(event.time);
3315
3439
  return Number.isFinite(timestamp) ? timestamp : void 0;
3316
3440
  }
3317
3441
  function syncPhaseTimings(previous, event) {
3318
- if (!_optionalChain([event, 'optionalAccess', _122 => _122.type])) return previous;
3442
+ if (!_optionalChain([event, 'optionalAccess', _125 => _125.type])) return previous;
3319
3443
  const timestamp = _nullishCoalesce(parseWebhookTimestamp(event), () => ( Date.now()));
3320
3444
  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;
3321
3445
  const setBridging = (event.type === "bridge-started" || event.type === "bridge-complete") && previous.bridgingAt === void 0;
@@ -3377,11 +3501,64 @@ function getCurrentPhaseId(state, phaseTimings) {
3377
3501
  if (state.type === "complete") {
3378
3502
  return void 0;
3379
3503
  }
3380
- if (_optionalChain([state, 'access', _123 => _123.lastEvent, 'optionalAccess', _124 => _124.type]) === "bridge-started" || _optionalChain([state, 'access', _125 => _125.lastEvent, 'optionalAccess', _126 => _126.type]) === "bridge-complete")
3504
+ if (_optionalChain([state, 'access', _126 => _126.lastEvent, 'optionalAccess', _127 => _127.type]) === "bridge-started" || _optionalChain([state, 'access', _128 => _128.lastEvent, 'optionalAccess', _129 => _129.type]) === "bridge-complete")
3381
3505
  return "bridging";
3382
- if (_optionalChain([state, 'access', _127 => _127.lastEvent, 'optionalAccess', _128 => _128.type]) === "deposit-received") return "received";
3506
+ if (_optionalChain([state, 'access', _130 => _130.lastEvent, 'optionalAccess', _131 => _131.type]) === "deposit-received") return "received";
3383
3507
  return "confirming";
3384
3508
  }
3509
+ function getCompletionDestinationTxHash(event) {
3510
+ const eventData = _optionalChain([event, 'optionalAccess', _132 => _132.data]);
3511
+ const swapTxHash = _optionalChain([eventData, 'optionalAccess', _133 => _133.swap, 'optionalAccess', _134 => _134.transactionHash]);
3512
+ const destinationTxHash = _optionalChain([eventData, 'optionalAccess', _135 => _135.destination, 'optionalAccess', _136 => _136.transactionHash]);
3513
+ return _nullishCoalesce(swapTxHash, () => ( destinationTxHash));
3514
+ }
3515
+ function getTerminalProcessingOutcome(event) {
3516
+ if (_optionalChain([event, 'optionalAccess', _137 => _137.type]) === "post-bridge-swap-complete") {
3517
+ return {
3518
+ type: "complete",
3519
+ destinationTxHash: getCompletionDestinationTxHash(event)
3520
+ };
3521
+ }
3522
+ if (_optionalChain([event, 'optionalAccess', _138 => _138.type]) === "post-bridge-swap-failed") {
3523
+ return {
3524
+ type: "failed",
3525
+ message: formatBridgeFailedMessage(event).message
3526
+ };
3527
+ }
3528
+ if (_optionalChain([event, 'optionalAccess', _139 => _139.type]) === "bridge-complete") {
3529
+ return {
3530
+ type: "complete",
3531
+ destinationTxHash: getCompletionDestinationTxHash(event)
3532
+ };
3533
+ }
3534
+ if (_optionalChain([event, 'optionalAccess', _140 => _140.type]) === "bridge-failed") {
3535
+ return {
3536
+ type: "failed",
3537
+ message: formatBridgeFailedMessage(event).message
3538
+ };
3539
+ }
3540
+ if (_optionalChain([event, 'optionalAccess', _141 => _141.type]) === "error") {
3541
+ return {
3542
+ type: "failed",
3543
+ message: _nullishCoalesce(_optionalChain([event, 'access', _142 => _142.data, 'optionalAccess', _143 => _143.message]), () => ( "Unknown error"))
3544
+ };
3545
+ }
3546
+ return null;
3547
+ }
3548
+ function getInitialProcessingState(event, txHash) {
3549
+ if (!event || !isEventForTx(event, txHash)) return null;
3550
+ const terminal = getTerminalProcessingOutcome(event);
3551
+ if (_optionalChain([terminal, 'optionalAccess', _144 => _144.type]) === "complete") {
3552
+ return { type: "complete", lastEvent: event };
3553
+ }
3554
+ if (_optionalChain([terminal, 'optionalAccess', _145 => _145.type]) === "failed") {
3555
+ return { type: "failed", message: terminal.message, lastEvent: event };
3556
+ }
3557
+ if (isDepositEvent(event)) {
3558
+ return { type: "processing", lastEvent: event };
3559
+ }
3560
+ return null;
3561
+ }
3385
3562
  function ProcessingStep({
3386
3563
  smartAccount,
3387
3564
  solanaDepositAddress,
@@ -3395,12 +3572,14 @@ function ProcessingStep({
3395
3572
  amountUsd,
3396
3573
  service,
3397
3574
  directTransfer,
3575
+ initialEvent,
3398
3576
  flowLabel = "deposit",
3399
3577
  debug,
3400
3578
  targetToken,
3401
3579
  uiConfig,
3402
3580
  quotedFeeAmount,
3403
3581
  quotedFeeSymbol,
3582
+ quoteFeeBreakdown,
3404
3583
  balanceAfterUsd,
3405
3584
  isSwappedOrder,
3406
3585
  swappedContext,
@@ -3427,9 +3606,21 @@ function ProcessingStep({
3427
3606
  const onDepositCompleteRef = useLatestRef(onDepositComplete);
3428
3607
  const onDepositFailedRef = useLatestRef(onDepositFailed);
3429
3608
  const onErrorRef = useLatestRef(onError);
3430
- const [state, setState] = _react.useState.call(void 0,
3431
- directTransfer ? { type: "complete" } : { type: "processing" }
3432
- );
3609
+ const initialTerminalEventRef = _react.useRef.call(void 0, null);
3610
+ const [state, setState] = _react.useState.call(void 0, () => {
3611
+ if (directTransfer) return { type: "complete" };
3612
+ const initial = getInitialProcessingState(
3613
+ initialEvent,
3614
+ txHash
3615
+ );
3616
+ if (initial) {
3617
+ if (initial.type !== "processing") {
3618
+ initialTerminalEventRef.current = _nullishCoalesce(initial.lastEvent, () => ( null));
3619
+ }
3620
+ return initial;
3621
+ }
3622
+ return { type: "processing" };
3623
+ });
3433
3624
  const [elapsedSeconds, setElapsedSeconds] = _react.useState.call(void 0, 0);
3434
3625
  const [phaseTimings, setPhaseTimings] = _react.useState.call(void 0, () => {
3435
3626
  const saved = loadPhaseTimings(txHash);
@@ -3463,7 +3654,7 @@ function ProcessingStep({
3463
3654
  flowLabel
3464
3655
  });
3465
3656
  const context = processingContextRef.current;
3466
- _optionalChain([onDepositCompleteRef, 'access', _129 => _129.current, 'optionalCall', _130 => _130(txHash, void 0, {
3657
+ _optionalChain([onDepositCompleteRef, 'access', _146 => _146.current, 'optionalCall', _147 => _147(txHash, void 0, {
3467
3658
  amount: context.amount,
3468
3659
  sourceChain: context.sourceChain,
3469
3660
  sourceToken: context.sourceToken,
@@ -3481,6 +3672,43 @@ function ProcessingStep({
3481
3672
  txHash,
3482
3673
  updatePhaseTimings
3483
3674
  ]);
3675
+ _react.useEffect.call(void 0, () => {
3676
+ const event = initialTerminalEventRef.current;
3677
+ if (!event) return;
3678
+ initialTerminalEventRef.current = null;
3679
+ const outcome = getTerminalProcessingOutcome(event);
3680
+ if (!outcome) return;
3681
+ if (outcome.type === "complete") {
3682
+ const context = processingContextRef.current;
3683
+ debugLog(debug, "processing", "initial-event:complete", {
3684
+ txHash,
3685
+ destinationTxHash: outcome.destinationTxHash,
3686
+ event: event.type
3687
+ });
3688
+ _optionalChain([onDepositCompleteRef, 'access', _148 => _148.current, 'optionalCall', _149 => _149(txHash, outcome.destinationTxHash, {
3689
+ amount: context.amount,
3690
+ sourceChain: context.sourceChain,
3691
+ sourceToken: context.sourceToken,
3692
+ sourceDecimals: context.sourceDecimals,
3693
+ amountUsd: context.amountUsd,
3694
+ targetChain: context.targetChain,
3695
+ targetToken: context.targetToken
3696
+ })]);
3697
+ return;
3698
+ }
3699
+ debugLog(debug, "processing", "initial-event:failed", {
3700
+ txHash,
3701
+ message: outcome.message,
3702
+ event: event.type
3703
+ });
3704
+ _optionalChain([onDepositFailedRef, 'access', _150 => _150.current, 'optionalCall', _151 => _151(txHash, outcome.message)]);
3705
+ }, [
3706
+ debug,
3707
+ onDepositCompleteRef,
3708
+ onDepositFailedRef,
3709
+ processingContextRef,
3710
+ txHash
3711
+ ]);
3484
3712
  _react.useEffect.call(void 0, () => {
3485
3713
  if (directTransfer || state.type !== "processing") return;
3486
3714
  const updateElapsed = () => {
@@ -3505,31 +3733,65 @@ function ProcessingStep({
3505
3733
  updatePhaseTimings(
3506
3734
  (previous) => syncPhaseTimings(previous, state.lastEvent)
3507
3735
  );
3508
- }, [_optionalChain([state, 'access', _131 => _131.lastEvent, 'optionalAccess', _132 => _132.time]), _optionalChain([state, 'access', _133 => _133.lastEvent, 'optionalAccess', _134 => _134.type]), updatePhaseTimings]);
3736
+ }, [_optionalChain([state, 'access', _152 => _152.lastEvent, 'optionalAccess', _153 => _153.time]), _optionalChain([state, 'access', _154 => _154.lastEvent, 'optionalAccess', _155 => _155.type]), updatePhaseTimings]);
3509
3737
  const [swappedFiatContext, setSwappedFiatContext] = _react.useState.call(void 0, null);
3510
3738
  _react.useEffect.call(void 0, () => {
3511
3739
  let cancelled = false;
3512
- service.fetchSwappedOrderStatus(smartAccount).then((res) => {
3513
- if (cancelled || !res) return;
3514
- if (res.transactionId != null) {
3515
- if (res.transactionId.toLowerCase() !== txHash.toLowerCase()) return;
3516
- } else if (!isSwappedOrder || _optionalChain([swappedContext, 'optionalAccess', _135 => _135.variant]) === "connect") {
3740
+ let timeoutId;
3741
+ const isFiatSwappedOrder = isSwappedOrder && _optionalChain([swappedContext, 'optionalAccess', _156 => _156.variant]) === "fiat";
3742
+ const expectedOrderUuid = _nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess', _157 => _157.expectedOrderUuid]), () => ( null));
3743
+ setSwappedFiatContext(null);
3744
+ if (isFiatSwappedOrder && !expectedOrderUuid) {
3745
+ return () => {
3746
+ cancelled = true;
3747
+ };
3748
+ }
3749
+ let attempts = 0;
3750
+ const matchesCurrentDeposit = (res) => {
3751
+ if (isFiatSwappedOrder) {
3752
+ return res.orderId === expectedOrderUuid;
3753
+ }
3754
+ return res.transactionId != null && res.transactionId.toLowerCase() === txHash.toLowerCase();
3755
+ };
3756
+ const scheduleRetry = () => {
3757
+ if (cancelled || !isFiatSwappedOrder || attempts >= SWAPPED_FIAT_STATUS_MAX_ATTEMPTS) {
3517
3758
  return;
3518
3759
  }
3519
- setSwappedFiatContext({
3520
- orderCrypto: res.orderCrypto,
3521
- orderCryptoAmount: res.orderCryptoAmount,
3522
- paidAmountUsd: res.paidAmountUsd,
3523
- paidAmountEur: res.paidAmountEur,
3524
- onrampFeeUsd: res.onrampFeeUsd,
3525
- paymentMethod: res.paymentMethod
3526
- });
3527
- }).catch(() => {
3528
- });
3760
+ timeoutId = setTimeout(
3761
+ fetchContext,
3762
+ SWAPPED_RECEIPT_STATUS_RETRY_INTERVAL_MS
3763
+ );
3764
+ };
3765
+ async function fetchContext() {
3766
+ attempts += 1;
3767
+ try {
3768
+ const res = await service.fetchSwappedOrderStatus(smartAccount);
3769
+ if (cancelled) return;
3770
+ if (!res || !matchesCurrentDeposit(res)) {
3771
+ scheduleRetry();
3772
+ return;
3773
+ }
3774
+ setSwappedFiatContext(toSwappedFiatContext(res));
3775
+ if (isFiatSwappedOrder && !hasFiatReceiptPricing(res)) {
3776
+ scheduleRetry();
3777
+ }
3778
+ } catch (e8) {
3779
+ scheduleRetry();
3780
+ }
3781
+ }
3782
+ fetchContext();
3529
3783
  return () => {
3530
3784
  cancelled = true;
3785
+ if (timeoutId !== void 0) clearTimeout(timeoutId);
3531
3786
  };
3532
- }, [service, smartAccount, txHash, isSwappedOrder, _optionalChain([swappedContext, 'optionalAccess', _136 => _136.variant])]);
3787
+ }, [
3788
+ service,
3789
+ smartAccount,
3790
+ txHash,
3791
+ isSwappedOrder,
3792
+ _optionalChain([swappedContext, 'optionalAccess', _158 => _158.variant]),
3793
+ _optionalChain([swappedContext, 'optionalAccess', _159 => _159.expectedOrderUuid])
3794
+ ]);
3533
3795
  _react.useEffect.call(void 0, () => {
3534
3796
  if (directTransfer) return;
3535
3797
  if (state.type !== "processing") {
@@ -3554,20 +3816,20 @@ function ProcessingStep({
3554
3816
  debugLog(debug, "processing", "poll:event", {
3555
3817
  type: lastEvent2.type,
3556
3818
  matchesTx: eventMatchesTx,
3557
- intentId: _optionalChain([eventData, 'optionalAccess', _137 => _137.intentId])
3819
+ intentId: _optionalChain([eventData, 'optionalAccess', _160 => _160.intentId])
3558
3820
  });
3559
3821
  }
3560
3822
  if (!isMounted) return;
3561
- if (_optionalChain([eventForCurrentTx, 'optionalAccess', _138 => _138.type]) === "bridge-complete") {
3823
+ if (_optionalChain([eventForCurrentTx, 'optionalAccess', _161 => _161.type]) === "bridge-complete") {
3562
3824
  setState({ type: "complete", lastEvent: eventForCurrentTx });
3563
- const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access', _139 => _139.data, 'optionalAccess', _140 => _140.destination, 'optionalAccess', _141 => _141.transactionHash]);
3825
+ const destinationTxHash2 = _optionalChain([eventForCurrentTx, 'access', _162 => _162.data, 'optionalAccess', _163 => _163.destination, 'optionalAccess', _164 => _164.transactionHash]);
3564
3826
  debugLog(debug, "processing", "state:complete", {
3565
3827
  txHash,
3566
3828
  destinationTxHash: destinationTxHash2,
3567
3829
  event: eventForCurrentTx.type
3568
3830
  });
3569
3831
  const context = processingContextRef.current;
3570
- _optionalChain([onDepositCompleteRef, 'access', _142 => _142.current, 'optionalCall', _143 => _143(txHash, destinationTxHash2, {
3832
+ _optionalChain([onDepositCompleteRef, 'access', _165 => _165.current, 'optionalCall', _166 => _166(txHash, destinationTxHash2, {
3571
3833
  amount: context.amount,
3572
3834
  sourceChain: context.sourceChain,
3573
3835
  sourceToken: context.sourceToken,
@@ -3578,7 +3840,7 @@ function ProcessingStep({
3578
3840
  })]);
3579
3841
  return;
3580
3842
  }
3581
- if (_optionalChain([eventForCurrentTx, 'optionalAccess', _144 => _144.type]) === "bridge-failed") {
3843
+ if (_optionalChain([eventForCurrentTx, 'optionalAccess', _167 => _167.type]) === "bridge-failed") {
3582
3844
  const formatted = formatBridgeFailedMessage(eventForCurrentTx);
3583
3845
  setState({
3584
3846
  type: "failed",
@@ -3590,11 +3852,11 @@ function ProcessingStep({
3590
3852
  message: formatted.message,
3591
3853
  code: formatted.code
3592
3854
  });
3593
- _optionalChain([onDepositFailedRef, 'access', _145 => _145.current, 'optionalCall', _146 => _146(txHash, formatted.message)]);
3855
+ _optionalChain([onDepositFailedRef, 'access', _168 => _168.current, 'optionalCall', _169 => _169(txHash, formatted.message)]);
3594
3856
  return;
3595
3857
  }
3596
- if (_optionalChain([eventForCurrentTx, 'optionalAccess', _147 => _147.type]) === "error") {
3597
- const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access', _148 => _148.data, 'optionalAccess', _149 => _149.message]), () => ( "Unknown error"));
3858
+ if (_optionalChain([eventForCurrentTx, 'optionalAccess', _170 => _170.type]) === "error") {
3859
+ const errorMessage = _nullishCoalesce(_optionalChain([eventForCurrentTx, 'access', _171 => _171.data, 'optionalAccess', _172 => _172.message]), () => ( "Unknown error"));
3598
3860
  setState({
3599
3861
  type: "failed",
3600
3862
  message: errorMessage,
@@ -3604,7 +3866,7 @@ function ProcessingStep({
3604
3866
  txHash,
3605
3867
  message: errorMessage
3606
3868
  });
3607
- _optionalChain([onDepositFailedRef, 'access', _150 => _150.current, 'optionalCall', _151 => _151(txHash, errorMessage)]);
3869
+ _optionalChain([onDepositFailedRef, 'access', _173 => _173.current, 'optionalCall', _174 => _174(txHash, errorMessage)]);
3608
3870
  return;
3609
3871
  }
3610
3872
  setState((previous) => ({
@@ -3665,7 +3927,7 @@ function ProcessingStep({
3665
3927
  txHash,
3666
3928
  timeoutMs: ESCALATED_DELAY_MS
3667
3929
  });
3668
- _optionalChain([onErrorRef, 'access', _152 => _152.current, 'optionalCall', _153 => _153(message, "PROCESS_TIMEOUT")]);
3930
+ _optionalChain([onErrorRef, 'access', _175 => _175.current, 'optionalCall', _176 => _176(message, "PROCESS_TIMEOUT")]);
3669
3931
  }, ESCALATED_DELAY_MS);
3670
3932
  return () => clearTimeout(timeoutId);
3671
3933
  }, [debug, directTransfer, onErrorRef, state.type, txHash]);
@@ -3677,13 +3939,13 @@ function ProcessingStep({
3677
3939
  const timelineNowMs = _nullishCoalesce(phaseTimings.endedAt, () => ( Date.now()));
3678
3940
  const flowNoun = flowLabel === "withdraw" ? "withdrawal" : "deposit";
3679
3941
  const flowCapitalized = flowLabel === "withdraw" ? "Withdrawal" : "Deposit";
3680
- const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess', _154 => _154.data, 'optionalAccess', _155 => _155.destination, 'optionalAccess', _156 => _156.transactionHash]) || null;
3942
+ const destinationTxHash = _optionalChain([lastEvent, 'optionalAccess', _177 => _177.data, 'optionalAccess', _178 => _178.destination, 'optionalAccess', _179 => _179.transactionHash]) || null;
3681
3943
  const sourceDetails = getEventSourceDetails(lastEvent);
3682
3944
  const displaySourceChain = _nullishCoalesce(sourceDetails.chainId, () => ( sourceChain));
3683
3945
  const displaySourceToken = _nullishCoalesce(sourceDetails.token, () => ( sourceToken));
3684
3946
  const displayAmount = _nullishCoalesce(sourceDetails.amount, () => ( amount));
3685
- const sourceExplorerUrl = _chunkABVRVW3Pcjs.getExplorerTxUrl.call(void 0, displaySourceChain, txHash);
3686
- const destExplorerUrl = destinationTxHash ? _chunkABVRVW3Pcjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
3947
+ const sourceExplorerUrl = _chunkHH46H6ZIcjs.getExplorerTxUrl.call(void 0, displaySourceChain, txHash);
3948
+ const destExplorerUrl = destinationTxHash ? _chunkHH46H6ZIcjs.getExplorerTxUrl.call(void 0, targetChain, destinationTxHash) : null;
3687
3949
  const sourceDisplay = (() => {
3688
3950
  const resolved = resolveTokenDisplay(displaySourceToken, displaySourceChain, {
3689
3951
  symbol: _nullishCoalesce(providedSourceSymbol, () => ( (displaySourceChain === "solana" ? "SOL" : "Token"))),
@@ -3748,15 +4010,15 @@ function ProcessingStep({
3748
4010
  const delayPhaseId = isProcessing && currentPhaseId && activePhaseElapsedMs >= SOFT_DELAY_MS[currentPhaseId] ? currentPhaseId : void 0;
3749
4011
  void delayPhaseId;
3750
4012
  void hasEscalatedDelay;
3751
- const targetTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, targetSymbol);
3752
- const sourceChainIcon = _chunkABVRVW3Pcjs.getChainIcon.call(void 0, displaySourceChain);
3753
- const targetChainIcon = _chunkABVRVW3Pcjs.getChainIcon.call(void 0, targetChain);
3754
- const sourceTokenIcon = _chunkABVRVW3Pcjs.getTokenIcon.call(void 0, sourceSymbol);
3755
- const sourceChainName = _chunkABVRVW3Pcjs.getChainName.call(void 0, displaySourceChain);
3756
- const targetChainName = _chunkABVRVW3Pcjs.getChainName.call(void 0, targetChain);
4013
+ const targetTokenIcon = _chunkHH46H6ZIcjs.getTokenIcon.call(void 0, targetSymbol);
4014
+ const sourceChainIcon = _chunkHH46H6ZIcjs.getChainIcon.call(void 0, displaySourceChain);
4015
+ const targetChainIcon = _chunkHH46H6ZIcjs.getChainIcon.call(void 0, targetChain);
4016
+ const sourceTokenIcon = _chunkHH46H6ZIcjs.getTokenIcon.call(void 0, sourceSymbol);
4017
+ const sourceChainName = _chunkHH46H6ZIcjs.getChainName.call(void 0, displaySourceChain);
4018
+ const targetChainName = _chunkHH46H6ZIcjs.getChainName.call(void 0, targetChain);
3757
4019
  const timerText = formatTimer(elapsedSeconds);
3758
- const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _157 => _157.feeSponsored]), () => ( false));
3759
- const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _158 => _158.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
4020
+ const feeSponsored = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _180 => _180.feeSponsored]), () => ( false));
4021
+ const feeTooltip = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _181 => _181.feeTooltip]), () => ( (feeSponsored ? "Network fees are sponsored for this deposit." : "Network fees apply.")));
3760
4022
  const stateTitle = isComplete ? `${flowCapitalized} successful` : isFailed ? `${flowCapitalized} failed` : "Processing...";
3761
4023
  const handleRetry = _nullishCoalesce(onRetry, () => ( onNewDeposit));
3762
4024
  const headerContent = isComplete ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-body-header", children: [
@@ -3767,31 +4029,47 @@ function ProcessingStep({
3767
4029
  /* @__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 }) })
3768
4030
  ] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WalletIcon, {}), title: stateTitle });
3769
4031
  if (isComplete && isSwappedOrder) {
3770
- const effectivePaymentMethod = _nullishCoalesce(_nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess', _159 => _159.method]), () => ( _optionalChain([swappedFiatContext, 'optionalAccess', _160 => _160.paymentMethod]))), () => ( null));
4032
+ const effectivePaymentMethod = _nullishCoalesce(_nullishCoalesce(_optionalChain([swappedContext, 'optionalAccess', _182 => _182.method]), () => ( _optionalChain([swappedFiatContext, 'optionalAccess', _183 => _183.paymentMethod]))), () => ( null));
3771
4033
  const onrampMethod = effectivePaymentMethod ? formatPaymentMethod(effectivePaymentMethod) : null;
3772
- const onrampMethodIcon = _optionalChain([swappedContext, 'optionalAccess', _161 => _161.variant]) === "connect" && effectivePaymentMethod ? getExchangeLogoSrc(
4034
+ const onrampMethodIcon = _optionalChain([swappedContext, 'optionalAccess', _184 => _184.variant]) === "connect" && effectivePaymentMethod ? getExchangeLogoSrc(
3773
4035
  _nullishCoalesce(onrampMethod, () => ( effectivePaymentMethod)),
3774
4036
  effectivePaymentMethod
3775
4037
  ) : null;
3776
- const connectPaidAmount = _optionalChain([swappedContext, 'optionalAccess', _162 => _162.variant]) === "connect" ? `${formattedSentAmount} ${sourceSymbol}` : null;
3777
- const amountPaid = _nullishCoalesce(connectPaidAmount, () => ( (_optionalChain([swappedFiatContext, 'optionalAccess', _163 => _163.paidAmountUsd]) != null ? `$${swappedFiatContext.paidAmountUsd.toFixed(2)}` : null)));
4038
+ const connectPaidAmount = _optionalChain([swappedContext, 'optionalAccess', _185 => _185.variant]) === "connect" ? `${formattedSentAmount} ${sourceSymbol}` : null;
4039
+ const amountPaid = _nullishCoalesce(connectPaidAmount, () => ( (_optionalChain([swappedFiatContext, 'optionalAccess', _186 => _186.paidAmountUsd]) != null ? `$${swappedFiatContext.paidAmountUsd.toFixed(2)}` : null)));
3778
4040
  const depositedAmount = receiveDisplay;
3779
- const onrampFeeUsd = _nullishCoalesce(_optionalChain([swappedFiatContext, 'optionalAccess', _164 => _164.onrampFeeUsd]), () => ( null));
3780
- const networkFeeUsd = quotedFeeAmount !== void 0 && Number.isFinite(Number(quotedFeeAmount)) ? Number(quotedFeeAmount) : null;
4041
+ const onrampFeeUsd = _nullishCoalesce(_optionalChain([swappedFiatContext, 'optionalAccess', _187 => _187.onrampFeeUsd]), () => ( null));
4042
+ const quoteFees = getMarketNetworkFees(quoteFeeBreakdown);
4043
+ const fallbackNetworkFeeUsd = quoteFees === null && quotedFeeAmount !== void 0 && Number.isFinite(Number(quotedFeeAmount)) ? Number(quotedFeeAmount) : null;
4044
+ const marketFeeUsd = _nullishCoalesce(_optionalChain([quoteFees, 'optionalAccess', _188 => _188.marketUsd]), () => ( null));
4045
+ const networkFeeUsd = _nullishCoalesce(_optionalChain([quoteFees, 'optionalAccess', _189 => _189.networkUsd]), () => ( fallbackNetworkFeeUsd));
4046
+ const sponsoredFeeTooltip = "This fee is sponsored for this deposit.";
4047
+ 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.";
3781
4048
  const feeRows = [];
3782
4049
  if (onrampFeeUsd != null) {
3783
4050
  feeRows.push({
3784
4051
  label: "On-ramp fee",
3785
- value: `$${onrampFeeUsd.toFixed(2)}`
4052
+ value: formatUsdFee(onrampFeeUsd)
4053
+ });
4054
+ }
4055
+ if (marketFeeUsd != null) {
4056
+ feeRows.push({
4057
+ label: "Market fee",
4058
+ value: formatUsdFee(marketFeeUsd),
4059
+ strike: feeSponsored,
4060
+ tooltip: feeSponsored ? sponsoredFeeTooltip : void 0
3786
4061
  });
3787
4062
  }
3788
4063
  if (networkFeeUsd != null) {
3789
4064
  feeRows.push({
3790
4065
  label: "Network fee",
3791
- value: `$${networkFeeUsd.toFixed(2)}`
4066
+ value: formatUsdFee(networkFeeUsd),
4067
+ strike: feeSponsored,
4068
+ tooltip: feeSponsored ? sponsoredFeeTooltip : void 0
3792
4069
  });
3793
4070
  }
3794
- const feesTotal = feeRows.length > 0 ? `$${((_nullishCoalesce(onrampFeeUsd, () => ( 0))) + (_nullishCoalesce(networkFeeUsd, () => ( 0)))).toFixed(2)}` : null;
4071
+ const chargeableQuoteFeeUsd = feeSponsored ? 0 : (_nullishCoalesce(marketFeeUsd, () => ( 0))) + (_nullishCoalesce(networkFeeUsd, () => ( 0)));
4072
+ const feesTotal = feeRows.length > 0 ? formatUsdFee((_nullishCoalesce(onrampFeeUsd, () => ( 0))) + chargeableQuoteFeeUsd) : null;
3795
4073
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3796
4074
  SwappedReceipt,
3797
4075
  {
@@ -3802,6 +4080,7 @@ function ProcessingStep({
3802
4080
  depositedIcon: targetTokenIcon,
3803
4081
  feesTotal,
3804
4082
  feeRows,
4083
+ feesTooltip,
3805
4084
  newLabel: `New ${flowNoun}`,
3806
4085
  onNewDeposit,
3807
4086
  onClose
@@ -3853,7 +4132,7 @@ function ProcessingStep({
3853
4132
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Ticker, { value: timerText }) })
3854
4133
  ] }),
3855
4134
  isSwappedOrder ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
3856
- _optionalChain([swappedFiatContext, 'optionalAccess', _165 => _165.paidAmountUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
4135
+ _optionalChain([swappedFiatContext, 'optionalAccess', _190 => _190.paidAmountUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
3857
4136
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "You pay" }),
3858
4137
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
3859
4138
  "$",
@@ -3865,7 +4144,7 @@ function ProcessingStep({
3865
4144
  ] })
3866
4145
  ] })
3867
4146
  ] }),
3868
- _optionalChain([swappedFiatContext, 'optionalAccess', _166 => _166.onrampFeeUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
4147
+ _optionalChain([swappedFiatContext, 'optionalAccess', _191 => _191.onrampFeeUsd]) != null && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
3869
4148
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "On-ramp fee" }),
3870
4149
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
3871
4150
  "$",
@@ -4009,7 +4288,7 @@ function loadSessionOwnerFromStorage(eoaAddress) {
4009
4288
  privateKey: parsed.privateKey,
4010
4289
  address: account.address
4011
4290
  };
4012
- } catch (e8) {
4291
+ } catch (e9) {
4013
4292
  return null;
4014
4293
  }
4015
4294
  }