@rash2x/bridge-widget 0.6.46 → 0.6.47

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.
@@ -942,10 +942,10 @@ function useChainStrategies() {
942
942
  return context;
943
943
  }
944
944
  const truncateToDecimals = (num, decimals) => {
945
- if (!isFinite(num) || isNaN(num)) return "0.00";
945
+ if (!isFinite(num) || isNaN(num)) return "0";
946
946
  const multiplier = Math.pow(10, decimals);
947
947
  const truncated = Math.floor(num * multiplier) / multiplier;
948
- return truncated.toFixed(decimals);
948
+ return truncated.toFixed(decimals).replace(/0+$/, "").replace(/\.$/, "");
949
949
  };
950
950
  const formatTokenAmount = (amount, symbol, options) => {
951
951
  const normalizedSymbol = (symbol ?? "").toUpperCase();
@@ -3372,12 +3372,12 @@ const Details = () => {
3372
3372
  const bridgeData = useBridgeExternalData();
3373
3373
  const symbol = (selectedAssetSymbol ?? bridgeData.dstToken?.symbol ?? "—").toUpperCase();
3374
3374
  const isLoading = status === "loading";
3375
- const receiveText = bridgeData.quoteDetails?.outputAmount != null ? Number(bridgeData.quoteDetails?.outputAmount).toFixed(quote ? 6 : 2) : "0.00";
3375
+ const receiveText = bridgeData.quoteDetails?.outputAmount != null ? truncateToDecimals(Number(bridgeData.quoteDetails?.outputAmount), quote ? 6 : 2) : "0";
3376
3376
  const etaText = bridgeData.quoteDetails?.etaSeconds != null ? `≈ ${Math.max(
3377
3377
  1,
3378
3378
  Math.round(bridgeData.quoteDetails?.etaSeconds / 60)
3379
3379
  )}m` : "—";
3380
- const totalFeeDisplay = !quote ? "—" : gas.requiredNative > 0 ? `${gas.requiredNative.toFixed(6)} ${gas.nativeSym}` : "—";
3380
+ const totalFeeDisplay = !quote ? "—" : gas.requiredNative > 0 ? `${truncateToDecimals(gas.requiredNative, 6)} ${gas.nativeSym}` : "—";
3381
3381
  const currentSlippageText = !quote ? "—" : formatPercentage(slippageBps);
3382
3382
  const routeText = getRouteDisplayName(quote?.route);
3383
3383
  return /* @__PURE__ */ jsxRuntime.jsx(accordion.Accordion, { type: "single", collapsible: true, className: "w-full border-none", children: /* @__PURE__ */ jsxRuntime.jsxs(accordion.AccordionItem, { value: "item-1", className: "bg-muted rounded-sm", children: [
@@ -25966,7 +25966,7 @@ class WalletConnectModal {
25966
25966
  }
25967
25967
  async initUi() {
25968
25968
  if (typeof window !== "undefined") {
25969
- await Promise.resolve().then(() => require("./index-D87zq9PV.cjs"));
25969
+ await Promise.resolve().then(() => require("./index-CdHojoQM.cjs"));
25970
25970
  const modal = document.createElement("wcm-modal");
25971
25971
  document.body.insertAdjacentElement("beforeend", modal);
25972
25972
  OptionsCtrl.setIsUiLoaded(true);
@@ -26723,4 +26723,4 @@ exports.useSettingsStore = useSettingsStore;
26723
26723
  exports.useSwapModel = useSwapModel;
26724
26724
  exports.useTokensStore = useTokensStore;
26725
26725
  exports.useTransactionStore = useTransactionStore;
26726
- //# sourceMappingURL=index-dS_Zjwua.cjs.map
26726
+ //# sourceMappingURL=index-BtPPZlsB.cjs.map