@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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("./index-dS_Zjwua.cjs");
3
+ const index = require("./index-BtPPZlsB.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 { U, d, f, e, H, B, F, X, N, z, $, G, A, D, Z, w, s, v, r, p, q, L, a2, aa, a4, a7, x, I, y, a5, J, a3, a8, a9, Y, a6, W, P, _, a1, ab, Q, S, a0, K, V, t, o, i, u, l, m, j, n, h, k } from "./index-C-Rv5dlA.js";
1
+ import { U, d, f, e, H, B, F, X, N, z, $, G, A, D, Z, w, s, v, r, p, q, L, a2, aa, a4, a7, x, I, y, a5, J, a3, a8, a9, Y, a6, W, P, _, a1, ab, Q, S, a0, K, V, t, o, i, u, l, m, j, n, h, k } from "./index-BDeKdIW1.js";
2
2
  export {
3
3
  U as DEFAULT_SLIPPAGE_BPS,
4
4
  d as EvaaBridge,
@@ -941,10 +941,10 @@ function useChainStrategies() {
941
941
  return context;
942
942
  }
943
943
  const truncateToDecimals = (num, decimals) => {
944
- if (!isFinite(num) || isNaN(num)) return "0.00";
944
+ if (!isFinite(num) || isNaN(num)) return "0";
945
945
  const multiplier = Math.pow(10, decimals);
946
946
  const truncated = Math.floor(num * multiplier) / multiplier;
947
- return truncated.toFixed(decimals);
947
+ return truncated.toFixed(decimals).replace(/0+$/, "").replace(/\.$/, "");
948
948
  };
949
949
  const formatTokenAmount = (amount, symbol, options) => {
950
950
  const normalizedSymbol = (symbol ?? "").toUpperCase();
@@ -3371,12 +3371,12 @@ const Details = () => {
3371
3371
  const bridgeData = useBridgeExternalData();
3372
3372
  const symbol = (selectedAssetSymbol ?? bridgeData.dstToken?.symbol ?? "—").toUpperCase();
3373
3373
  const isLoading = status === "loading";
3374
- const receiveText = bridgeData.quoteDetails?.outputAmount != null ? Number(bridgeData.quoteDetails?.outputAmount).toFixed(quote ? 6 : 2) : "0.00";
3374
+ const receiveText = bridgeData.quoteDetails?.outputAmount != null ? truncateToDecimals(Number(bridgeData.quoteDetails?.outputAmount), quote ? 6 : 2) : "0";
3375
3375
  const etaText = bridgeData.quoteDetails?.etaSeconds != null ? `≈ ${Math.max(
3376
3376
  1,
3377
3377
  Math.round(bridgeData.quoteDetails?.etaSeconds / 60)
3378
3378
  )}m` : "—";
3379
- const totalFeeDisplay = !quote ? "—" : gas.requiredNative > 0 ? `${gas.requiredNative.toFixed(6)} ${gas.nativeSym}` : "—";
3379
+ const totalFeeDisplay = !quote ? "—" : gas.requiredNative > 0 ? `${truncateToDecimals(gas.requiredNative, 6)} ${gas.nativeSym}` : "—";
3380
3380
  const currentSlippageText = !quote ? "—" : formatPercentage(slippageBps);
3381
3381
  const routeText = getRouteDisplayName(quote?.route);
3382
3382
  return /* @__PURE__ */ jsx(Accordion, { type: "single", collapsible: true, className: "w-full border-none", children: /* @__PURE__ */ jsxs(AccordionItem, { value: "item-1", className: "bg-muted rounded-sm", children: [
@@ -25965,7 +25965,7 @@ class WalletConnectModal {
25965
25965
  }
25966
25966
  async initUi() {
25967
25967
  if (typeof window !== "undefined") {
25968
- await import("./index-DlXh95vJ.js");
25968
+ await import("./index-BpJB61tF.js");
25969
25969
  const modal = document.createElement("wcm-modal");
25970
25970
  document.body.insertAdjacentElement("beforeend", modal);
25971
25971
  OptionsCtrl.setIsUiLoaded(true);
@@ -26724,4 +26724,4 @@ export {
26724
26724
  getQuoteFees as y,
26725
26725
  calculateMinReceived as z
26726
26726
  };
26727
- //# sourceMappingURL=index-C-Rv5dlA.js.map
26727
+ //# sourceMappingURL=index-BDeKdIW1.js.map