@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.
@@ -2387,6 +2387,9 @@ function computeFeeBreakdownUsd(quote, srcToken, tokens, chains) {
2387
2387
  bridgeFeeAmount: 0,
2388
2388
  bridgeFeeSymbol: "",
2389
2389
  bridgeFeeUsd: 0,
2390
+ dstGasAmount: 0,
2391
+ dstGasSymbol: "",
2392
+ dstGasUsd: 0,
2390
2393
  totalFeeUsd: 0
2391
2394
  };
2392
2395
  if (!quote || !srcToken) return empty;
@@ -2422,7 +2425,25 @@ function computeFeeBreakdownUsd(quote, srcToken, tokens, chains) {
2422
2425
  bridgeFeeAmount = diff;
2423
2426
  bridgeFeeUsd = (srcToken.price?.usd ?? 0) * diff;
2424
2427
  }
2425
- const totalFeeUsd = messageFeeUsd + bridgeFeeUsd;
2428
+ let dstGasAmount = 0;
2429
+ let dstGasSymbol = "";
2430
+ let dstGasUsd = 0;
2431
+ const dstNativeAmountLD = quote.dstNativeAmount;
2432
+ if (dstNativeAmountLD && BigInt(dstNativeAmountLD || "0") > 0n) {
2433
+ const dstChain = chains?.find((c2) => c2.chainKey === quote.dstChainKey);
2434
+ if (dstChain) {
2435
+ const { decimals, priceUsd } = lookupTokenMeta(
2436
+ tokens,
2437
+ chains,
2438
+ dstChain.chainKey,
2439
+ dstChain.nativeCurrency.address
2440
+ );
2441
+ dstGasAmount = fromLD(dstNativeAmountLD, decimals);
2442
+ dstGasSymbol = dstChain.nativeCurrency.symbol?.toUpperCase() ?? "";
2443
+ dstGasUsd = dstGasAmount * (priceUsd ?? 0);
2444
+ }
2445
+ }
2446
+ const totalFeeUsd = messageFeeUsd + bridgeFeeUsd + dstGasUsd;
2426
2447
  return {
2427
2448
  messageFeeAmount,
2428
2449
  messageFeeSymbol,
@@ -2430,6 +2451,9 @@ function computeFeeBreakdownUsd(quote, srcToken, tokens, chains) {
2430
2451
  bridgeFeeAmount,
2431
2452
  bridgeFeeSymbol,
2432
2453
  bridgeFeeUsd,
2454
+ dstGasAmount,
2455
+ dstGasSymbol,
2456
+ dstGasUsd,
2433
2457
  totalFeeUsd
2434
2458
  };
2435
2459
  }
@@ -26023,7 +26047,7 @@ class WalletConnectModal {
26023
26047
  }
26024
26048
  async initUi() {
26025
26049
  if (typeof window !== "undefined") {
26026
- await Promise.resolve().then(() => require("./index-BO18yuE2.cjs"));
26050
+ await Promise.resolve().then(() => require("./index-B9T9OLH8.cjs"));
26027
26051
  const modal = document.createElement("wcm-modal");
26028
26052
  document.body.insertAdjacentElement("beforeend", modal);
26029
26053
  OptionsCtrl.setIsUiLoaded(true);
@@ -26921,4 +26945,4 @@ exports.useSettingsStore = useSettingsStore;
26921
26945
  exports.useSwapModel = useSwapModel;
26922
26946
  exports.useTokensStore = useTokensStore;
26923
26947
  exports.useTransactionStore = useTransactionStore;
26924
- //# sourceMappingURL=index-B3z_l7uV.cjs.map
26948
+ //# sourceMappingURL=index-Cvo_dMKt.cjs.map