@rash2x/bridge-widget 0.8.8 → 0.8.9

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.
@@ -4626,7 +4626,7 @@ function useBridgeTransaction() {
4626
4626
  const txStore = useTransactionStore();
4627
4627
  const gas = useGasEstimate();
4628
4628
  const srcToken = useMemo(
4629
- () => resolveTokenOnChainFromMatrix$1(
4629
+ () => resolveBridgeSourceTokenOnChainFromMatrix(
4630
4630
  assetMatrix,
4631
4631
  selectedAssetSymbol,
4632
4632
  quote?.srcChainKey
@@ -4634,7 +4634,7 @@ function useBridgeTransaction() {
4634
4634
  [assetMatrix, selectedAssetSymbol, quote?.srcChainKey]
4635
4635
  );
4636
4636
  const dstToken = useMemo(
4637
- () => resolveTokenOnChainFromMatrix$1(
4637
+ () => resolveBridgeDestinationTokenOnChainFromMatrix(
4638
4638
  assetMatrix,
4639
4639
  selectedAssetSymbol,
4640
4640
  quote?.dstChainKey
@@ -5589,6 +5589,14 @@ const SuccessStep = ({
5589
5589
  const { t: t2 } = useBridgeTranslation();
5590
5590
  const metadata = current?.metadata;
5591
5591
  const srcTxHash = current?.tonTransactionHash || current?.srcTxHash;
5592
+ const srcAmount = metadata?.srcAmountHuman;
5593
+ const hasSrcAmount = Number.isFinite(srcAmount);
5594
+ const srcTokenSymbol = metadata?.srcTokenSymbol ?? "default";
5595
+ const formatSrcAmount = (value) => {
5596
+ if (value <= 0) return "0";
5597
+ if (value >= 1) return formatBalance(value, 2);
5598
+ return value.toFixed(6).replace(/\.?0+$/, "");
5599
+ };
5592
5600
  return /* @__PURE__ */ jsxs(
5593
5601
  DialogContent,
5594
5602
  {
@@ -5599,17 +5607,17 @@ const SuccessStep = ({
5599
5607
  icon,
5600
5608
  /* @__PURE__ */ jsx(DialogHeader, { className: "z-10 relative p-0", children: /* @__PURE__ */ jsx(DialogTitle, { className: "text-[28px] text-center", children: t2("transaction.success") }) }),
5601
5609
  /* @__PURE__ */ jsxs("div", { className: "w-full space-y-2 mt-5 relative z-10 pb-14", children: [
5602
- metadata?.srcAmountHuman && /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center", children: [
5610
+ hasSrcAmount && /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center", children: [
5603
5611
  /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: t2("transaction.bridged") }),
5604
5612
  /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1 font-medium", children: [
5605
- formatBalance(metadata.srcAmountHuman, 2),
5613
+ formatSrcAmount(srcAmount ?? 0),
5606
5614
  " ",
5607
- metadata?.srcTokenSymbol,
5615
+ srcTokenSymbol,
5608
5616
  /* @__PURE__ */ jsx(
5609
5617
  TokenSymbol,
5610
5618
  {
5611
5619
  className: "w-[18px] h-[18px]",
5612
- symbol: metadata?.srcTokenSymbol
5620
+ symbol: srcTokenSymbol
5613
5621
  }
5614
5622
  )
5615
5623
  ] })
@@ -26740,7 +26748,7 @@ class WalletConnectModal {
26740
26748
  }
26741
26749
  async initUi() {
26742
26750
  if (typeof window !== "undefined") {
26743
- await import("./index-CZGfdIKB.js");
26751
+ await import("./index-Bl4_W_Mc.js");
26744
26752
  const modal = document.createElement("wcm-modal");
26745
26753
  document.body.insertAdjacentElement("beforeend", modal);
26746
26754
  OptionsCtrl.setIsUiLoaded(true);
@@ -27664,4 +27672,4 @@ export {
27664
27672
  calculateMinReceived as y,
27665
27673
  getQuoteDetails as z
27666
27674
  };
27667
- //# sourceMappingURL=index-JmSrX7Hz.js.map
27675
+ //# sourceMappingURL=index-IZ7t2PGj.js.map