@rash2x/bridge-widget 0.6.47 → 0.6.49

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.
@@ -945,7 +945,7 @@ const truncateToDecimals = (num, decimals) => {
945
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).replace(/0+$/, "").replace(/\.$/, "");
948
+ return truncated.toFixed(decimals).replace(/\.?0+$/, "");
949
949
  };
950
950
  const formatTokenAmount = (amount, symbol, options) => {
951
951
  const normalizedSymbol = (symbol ?? "").toUpperCase();
@@ -969,7 +969,7 @@ const formatUsd = (value) => {
969
969
  return `$${value.toFixed(6).replace(/0+$/, "").replace(/\.$/, "")}`;
970
970
  };
971
971
  const formatPercentage = (bps, decimals = 2) => {
972
- return `${(bps / 100).toFixed(decimals)}%`;
972
+ return `${(bps / 100).toFixed(decimals).replace(/0+$/, "").replace(/\.$/, "")}%`;
973
973
  };
974
974
  const formatBalance = (amount, decimals = 2) => {
975
975
  if (!isFinite(amount) || isNaN(amount) || amount <= 0) {
@@ -3372,7 +3372,7 @@ 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 ? truncateToDecimals(Number(bridgeData.quoteDetails?.outputAmount), quote ? 6 : 2) : "0";
3375
+ const receiveText = bridgeData.quoteDetails?.outputAmount != null ? truncateToDecimals(Number(bridgeData.quoteDetails?.outputAmount), 6) : "0";
3376
3376
  const etaText = bridgeData.quoteDetails?.etaSeconds != null ? `≈ ${Math.max(
3377
3377
  1,
3378
3378
  Math.round(bridgeData.quoteDetails?.etaSeconds / 60)
@@ -4142,7 +4142,6 @@ const WalletModalButton = (props) => {
4142
4142
  type: "button",
4143
4143
  onClick: () => {
4144
4144
  onDisconnect();
4145
- onClose?.();
4146
4145
  },
4147
4146
  className: "text-sm font-medium text-muted-foreground hover:text-foreground transition-colors",
4148
4147
  children: /* @__PURE__ */ jsxRuntime.jsx(ExitIcon, { className: "w-6 h-6" })
@@ -25966,7 +25965,7 @@ class WalletConnectModal {
25966
25965
  }
25967
25966
  async initUi() {
25968
25967
  if (typeof window !== "undefined") {
25969
- await Promise.resolve().then(() => require("./index-CdHojoQM.cjs"));
25968
+ await Promise.resolve().then(() => require("./index-CJ7gSazU.cjs"));
25970
25969
  const modal = document.createElement("wcm-modal");
25971
25970
  document.body.insertAdjacentElement("beforeend", modal);
25972
25971
  OptionsCtrl.setIsUiLoaded(true);
@@ -26723,4 +26722,4 @@ exports.useSettingsStore = useSettingsStore;
26723
26722
  exports.useSwapModel = useSwapModel;
26724
26723
  exports.useTokensStore = useTokensStore;
26725
26724
  exports.useTransactionStore = useTransactionStore;
26726
- //# sourceMappingURL=index-BtPPZlsB.cjs.map
26725
+ //# sourceMappingURL=index-Cobl4hz4.cjs.map