@rash2x/bridge-widget 0.7.3 → 0.7.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.
@@ -2386,6 +2386,9 @@ function computeFeeBreakdownUsd(quote, srcToken, tokens, chains) {
2386
2386
  bridgeFeeAmount: 0,
2387
2387
  bridgeFeeSymbol: "",
2388
2388
  bridgeFeeUsd: 0,
2389
+ dstGasAmount: 0,
2390
+ dstGasSymbol: "",
2391
+ dstGasUsd: 0,
2389
2392
  totalFeeUsd: 0
2390
2393
  };
2391
2394
  if (!quote || !srcToken) return empty;
@@ -2421,7 +2424,25 @@ function computeFeeBreakdownUsd(quote, srcToken, tokens, chains) {
2421
2424
  bridgeFeeAmount = diff;
2422
2425
  bridgeFeeUsd = (srcToken.price?.usd ?? 0) * diff;
2423
2426
  }
2424
- const totalFeeUsd = messageFeeUsd + bridgeFeeUsd;
2427
+ let dstGasAmount = 0;
2428
+ let dstGasSymbol = "";
2429
+ let dstGasUsd = 0;
2430
+ const dstNativeAmountLD = quote.dstNativeAmount;
2431
+ if (dstNativeAmountLD && BigInt(dstNativeAmountLD || "0") > 0n) {
2432
+ const dstChain = chains?.find((c2) => c2.chainKey === quote.dstChainKey);
2433
+ if (dstChain) {
2434
+ const { decimals, priceUsd } = lookupTokenMeta(
2435
+ tokens,
2436
+ chains,
2437
+ dstChain.chainKey,
2438
+ dstChain.nativeCurrency.address
2439
+ );
2440
+ dstGasAmount = fromLD(dstNativeAmountLD, decimals);
2441
+ dstGasSymbol = dstChain.nativeCurrency.symbol?.toUpperCase() ?? "";
2442
+ dstGasUsd = dstGasAmount * (priceUsd ?? 0);
2443
+ }
2444
+ }
2445
+ const totalFeeUsd = messageFeeUsd + bridgeFeeUsd + dstGasUsd;
2425
2446
  return {
2426
2447
  messageFeeAmount,
2427
2448
  messageFeeSymbol,
@@ -2429,6 +2450,9 @@ function computeFeeBreakdownUsd(quote, srcToken, tokens, chains) {
2429
2450
  bridgeFeeAmount,
2430
2451
  bridgeFeeSymbol,
2431
2452
  bridgeFeeUsd,
2453
+ dstGasAmount,
2454
+ dstGasSymbol,
2455
+ dstGasUsd,
2432
2456
  totalFeeUsd
2433
2457
  };
2434
2458
  }
@@ -26022,7 +26046,7 @@ class WalletConnectModal {
26022
26046
  }
26023
26047
  async initUi() {
26024
26048
  if (typeof window !== "undefined") {
26025
- await import("./index-hG98qwY3.js");
26049
+ await import("./index-Giyq4_RJ.js");
26026
26050
  const modal = document.createElement("wcm-modal");
26027
26051
  document.body.insertAdjacentElement("beforeend", modal);
26028
26052
  OptionsCtrl.setIsUiLoaded(true);
@@ -26922,4 +26946,4 @@ export {
26922
26946
  calculateMinReceived as y,
26923
26947
  getQuoteDetails as z
26924
26948
  };
26925
- //# sourceMappingURL=index-hcTHOiGQ.js.map
26949
+ //# sourceMappingURL=index-DGMnvCZU.js.map