@rash2x/bridge-widget 0.8.3 → 0.8.4

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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("./index-egFmHlPu.cjs");
3
+ const index = require("./index-BDGHvxEQ.cjs");
4
4
  exports.DEFAULT_SLIPPAGE_BPS = index.DEFAULT_SLIPPAGE_BPS;
5
5
  exports.EvaaBridge = index.EvaaBridge;
6
6
  exports.RoutePriority = index.RoutePriority;
@@ -1,4 +1,4 @@
1
- import { L, d, f, e, D, Q, H, y, B, U, w, s, v, r, p, q, G, Z, a6, $, a3, x, z, a0, A, _, a4, a5, X, Y, S, a1, P, I, V, a2, W, a7, a8, J, K, F, N, t, o, i, u, l, m, j, n, h, k } from "./index-D2zkzmLE.js";
1
+ import { L, d, f, e, D, Q, H, y, B, U, w, s, v, r, p, q, G, Z, a6, $, a3, x, z, a0, A, _, a4, a5, X, Y, S, a1, P, I, V, a2, W, a7, a8, J, K, F, N, t, o, i, u, l, m, j, n, h, k } from "./index-B5QQQ8Nj.js";
2
2
  export {
3
3
  L as DEFAULT_SLIPPAGE_BPS,
4
4
  d as EvaaBridge,
@@ -2445,6 +2445,7 @@ function computeFeeBreakdownUsd(quote, srcToken, dstToken, tokens, chains, srcCh
2445
2445
  let messageFeeUsd = 0;
2446
2446
  let messageFeeAmount = 0;
2447
2447
  let messageFeeSymbol = "";
2448
+ let messageFeeTokenPriceUsd = 0;
2448
2449
  const messageFees = quote.fees.filter((f4) => f4.type === "message");
2449
2450
  for (const f4 of messageFees) {
2450
2451
  const { decimals, priceUsd } = lookupTokenMeta(
@@ -2462,6 +2463,7 @@ function computeFeeBreakdownUsd(quote, srcToken, dstToken, tokens, chains, srcCh
2462
2463
  (t2) => t2.chainKey === f4.chainKey && t2.address.toLowerCase() === f4.token.toLowerCase()
2463
2464
  );
2464
2465
  messageFeeSymbol = token?.symbol?.toUpperCase() ?? chain2?.nativeCurrency?.symbol?.toUpperCase() ?? "";
2466
+ messageFeeTokenPriceUsd = priceUsd ?? 0;
2465
2467
  }
2466
2468
  }
2467
2469
  let bridgeFeeAmount = 0;
@@ -2492,7 +2494,14 @@ function computeFeeBreakdownUsd(quote, srcToken, dstToken, tokens, chains, srcCh
2492
2494
  dstGasUsd = dstGasAmount * (priceUsd ?? 0);
2493
2495
  }
2494
2496
  }
2495
- const totalFeeUsd = messageFeeUsd + bridgeFeeUsd + dstGasUsd;
2497
+ if (dstGasAmount > 0 && messageFeeSymbol) {
2498
+ if (messageFeeSymbol === dstGasSymbol) {
2499
+ messageFeeAmount += dstGasAmount;
2500
+ } else if (messageFeeTokenPriceUsd > 0) {
2501
+ messageFeeAmount += dstGasUsd / messageFeeTokenPriceUsd;
2502
+ }
2503
+ }
2504
+ const totalFeeUsd = messageFeeUsd + bridgeFeeUsd;
2496
2505
  return {
2497
2506
  messageFeeAmount,
2498
2507
  messageFeeSymbol,
@@ -26536,7 +26545,7 @@ class WalletConnectModal {
26536
26545
  }
26537
26546
  async initUi() {
26538
26547
  if (typeof window !== "undefined") {
26539
- await import("./index-0JKTjlKW.js");
26548
+ await import("./index-BKyBBUlY.js");
26540
26549
  const modal = document.createElement("wcm-modal");
26541
26550
  document.body.insertAdjacentElement("beforeend", modal);
26542
26551
  OptionsCtrl.setIsUiLoaded(true);
@@ -27441,4 +27450,4 @@ export {
27441
27450
  calculateMinReceived as y,
27442
27451
  getQuoteDetails as z
27443
27452
  };
27444
- //# sourceMappingURL=index-D2zkzmLE.js.map
27453
+ //# sourceMappingURL=index-B5QQQ8Nj.js.map