@rash2x/bridge-widget 0.1.20 → 0.1.22

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.
@@ -912,7 +912,7 @@ const SettingModal = ({ isOpen, onClose }) => {
912
912
  /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center", children: [
913
913
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
914
914
  /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm font-medium leading-4", children: t2("settings.gasOnDestination") }),
915
- /* @__PURE__ */ jsx(Tip, { text: t2("settings.gasOnDestination"), children: /* @__PURE__ */ jsx(TipIcon, { className: "size-4 text-muted-foreground" }) })
915
+ /* @__PURE__ */ jsx(Tip, { text: t2("settings.gasOnDestination"), children: /* @__PURE__ */ jsx(TipIcon, { className: "w-4 h-4 text-muted-foreground" }) })
916
916
  ] }),
917
917
  /* @__PURE__ */ jsx("p", { className: "text-foreground text-sm font-medium leading-4", children: formatUsd(gasUsdValue) })
918
918
  ] }),
@@ -949,7 +949,7 @@ const SettingModal = ({ isOpen, onClose }) => {
949
949
  /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center", children: [
950
950
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
951
951
  /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm font-medium leading-4", children: t2("settings.slippageTolerance") }),
952
- /* @__PURE__ */ jsx(Tip, { text: t2("settings.slippageTolerance"), children: /* @__PURE__ */ jsx(TipIcon, { className: "size-4 text-muted-foreground" }) })
952
+ /* @__PURE__ */ jsx(Tip, { text: t2("settings.slippageTolerance"), children: /* @__PURE__ */ jsx(TipIcon, { className: "w-4 h-4 text-muted-foreground" }) })
953
953
  ] }),
954
954
  slippageBps >= 500 && /* @__PURE__ */ jsx("p", { className: "text-destructive text-xs font-medium", children: t2("settings.highSlippageWarning", {
955
955
  defaultValue: "High slippage warning"
@@ -978,7 +978,7 @@ const SettingModal = ({ isOpen, onClose }) => {
978
978
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-5", children: [
979
979
  /* @__PURE__ */ jsx("div", { className: "flex justify-between items-center", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
980
980
  /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm font-medium leading-4", children: t2("settings.routePriority") }),
981
- /* @__PURE__ */ jsx(Tip, { text: t2("settings.routePriority"), children: /* @__PURE__ */ jsx(TipIcon, { className: "size-4 text-muted-foreground" }) })
981
+ /* @__PURE__ */ jsx(Tip, { text: t2("settings.routePriority"), children: /* @__PURE__ */ jsx(TipIcon, { className: "w-4 h-4 text-muted-foreground" }) })
982
982
  ] }) }),
983
983
  /* @__PURE__ */ jsx("div", { className: "flex items-center justify-end gap-2", children: routePresets.map((r) => /* @__PURE__ */ jsx(
984
984
  Badge,
@@ -1161,7 +1161,7 @@ const SearchInput = ({
1161
1161
  containerClassName
1162
1162
  ),
1163
1163
  children: [
1164
- /* @__PURE__ */ jsx(SearchIcon, { className: "size-6 text-input-icon" }),
1164
+ /* @__PURE__ */ jsx(SearchIcon, { className: "w-6 h-6 text-input-icon" }),
1165
1165
  /* @__PURE__ */ jsx(
1166
1166
  Input,
1167
1167
  {
@@ -1201,7 +1201,7 @@ const TokenRow = ({
1201
1201
  TokenSymbol,
1202
1202
  {
1203
1203
  symbol,
1204
- className: "size-8 rounded-full",
1204
+ className: "w-8 h-8 rounded-full",
1205
1205
  alt: symbol
1206
1206
  }
1207
1207
  ),
@@ -1558,7 +1558,7 @@ const SelectTokenButton = ({
1558
1558
  ),
1559
1559
  /* @__PURE__ */ jsx("span", { className: "text-secondary-foreground text-sm font-semibold", children: label })
1560
1560
  ] }),
1561
- /* @__PURE__ */ jsx(ArrowDownIcon, { className: "size-4 text-secondary-foreground" })
1561
+ /* @__PURE__ */ jsx(ArrowDownIcon, { className: "w-4 h-4 text-secondary-foreground" })
1562
1562
  ]
1563
1563
  }
1564
1564
  );
@@ -2176,7 +2176,9 @@ const SwapButton = () => {
2176
2176
  };
2177
2177
  const WalletBalance = (props) => {
2178
2178
  const { value, isLoading = false } = props;
2179
- if (isLoading) {
2179
+ const hasNoData = !value || value === "0" || value === "0.00" || value === "0.0";
2180
+ const shouldShowSkeleton = isLoading && hasNoData;
2181
+ if (shouldShowSkeleton) {
2180
2182
  return /* @__PURE__ */ jsxs("div", { className: "flex gap-2 items-center", children: [
2181
2183
  /* @__PURE__ */ jsx(WalletIcon, { className: "text-muted-foreground" }),
2182
2184
  /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-16 rounded-md" })
@@ -2225,7 +2227,7 @@ const SelectNetworkButton = ({
2225
2227
  ),
2226
2228
  /* @__PURE__ */ jsx("span", { className: "text-secondary-foreground text-sm leading-5 font-semibold ", children: label })
2227
2229
  ] }),
2228
- /* @__PURE__ */ jsx(ArrowDownIcon, { className: "size-4 text-secondary-foreground" })
2230
+ /* @__PURE__ */ jsx(ArrowDownIcon, { className: "w-4 h-4 text-secondary-foreground" })
2229
2231
  ]
2230
2232
  }
2231
2233
  );
@@ -2413,9 +2415,9 @@ function short$1(addr) {
2413
2415
  return addr.slice(0, 4) + "…" + addr.slice(-4);
2414
2416
  }
2415
2417
  const prefixIcons = {
2416
- tronlink: /* @__PURE__ */ jsx(TronLinkIcon, { className: "size-5" }),
2417
- metamask: /* @__PURE__ */ jsx(MetaMaskIcon, { className: "size-5" }),
2418
- ton: /* @__PURE__ */ jsx(TonKeeperIcon, { className: "size-5" })
2418
+ tronlink: /* @__PURE__ */ jsx(TronLinkIcon, { className: "w-5 h-5" }),
2419
+ metamask: /* @__PURE__ */ jsx(MetaMaskIcon, { className: "w-5 h-5" }),
2420
+ ton: /* @__PURE__ */ jsx(TonKeeperIcon, { className: "w-5 h-5" })
2419
2421
  };
2420
2422
  const mapWalletToType = (wallet) => {
2421
2423
  switch (wallet) {
@@ -2700,9 +2702,9 @@ const AnotherAddress = () => {
2700
2702
  {
2701
2703
  variant: "ghost",
2702
2704
  size: "sm",
2703
- className: "rounded-full p-0 size-5 self-start",
2705
+ className: "rounded-full p-0 w-5 h-5 self-start",
2704
2706
  onClick: () => setValue(""),
2705
- children: /* @__PURE__ */ jsx(X, { className: "size-4" })
2707
+ children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4" })
2706
2708
  }
2707
2709
  )
2708
2710
  ]
@@ -2877,7 +2879,7 @@ const Details = () => {
2877
2879
  {
2878
2880
  label: t2("transaction.route"),
2879
2881
  value: /* @__PURE__ */ jsxs("strong", { className: "flex items-center gap-2", children: [
2880
- /* @__PURE__ */ jsx(StargateIcon, { className: "size-4" }),
2882
+ /* @__PURE__ */ jsx(StargateIcon, { className: "w-4 h-4" }),
2881
2883
  /* @__PURE__ */ jsx("p", { className: "", children: routeText })
2882
2884
  ] })
2883
2885
  }
@@ -2918,7 +2920,7 @@ const DetailsRow = ({
2918
2920
  }) => /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center", children: [
2919
2921
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
2920
2922
  /* @__PURE__ */ jsx("p", { className: "text-sm text-priority font-normal", children: label }),
2921
- /* @__PURE__ */ jsx(Tip, { text: label, children: /* @__PURE__ */ jsx(TipIcon, { className: "size-4 text-receive-icon" }) })
2923
+ /* @__PURE__ */ jsx(Tip, { text: label, children: /* @__PURE__ */ jsx(TipIcon, { className: "w-4 h-4 text-receive-icon" }) })
2922
2924
  ] }),
2923
2925
  isLoading ? /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-16 rounded-md" }) : /* @__PURE__ */ jsx("div", { className: "text-foreground text-sm", children: value ?? "—" })
2924
2926
  ] });
@@ -3683,7 +3685,7 @@ const WalletSelectModal = () => {
3683
3685
  const IconComponent = wallet.icon;
3684
3686
  return /* @__PURE__ */ jsx("div", { className: "-mx-5", children: /* @__PURE__ */ jsxs(Button, { className: "w-full cursor-pointer bg-transparent flex shadow-none items-center justify-between gap-3 px-5 py-3 hover:bg-muted h-auto rounded-md transition-[300]", children: [
3685
3687
  /* @__PURE__ */ jsx("div", { className: "flex items-center gap-3 min-w-0", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
3686
- /* @__PURE__ */ jsx("div", { className: "size-8 flex items-center justify-center", children: /* @__PURE__ */ jsx(IconComponent, { className: "size-8" }) }),
3688
+ /* @__PURE__ */ jsx("div", { className: "w-8 h-8 flex items-center justify-center", children: /* @__PURE__ */ jsx(IconComponent, { className: "w-8 h-8" }) }),
3687
3689
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-start min-w-0", children: [
3688
3690
  /* @__PURE__ */ jsx("p", { className: "font-extrabold text-foreground text-sm leading-4 truncate", children: short(wallet.address) }),
3689
3691
  /* @__PURE__ */ jsx("div", { className: "text-xs leading-3 font-semibold text-muted-foreground", children: wallet.name })
@@ -3697,7 +3699,7 @@ const WalletSelectModal = () => {
3697
3699
  onClose();
3698
3700
  },
3699
3701
  className: "text-sm font-medium text-muted-foreground",
3700
- children: /* @__PURE__ */ jsx(ExitIcon, { className: "text-[#808080] size-6" })
3702
+ children: /* @__PURE__ */ jsx(ExitIcon, { className: "text-[#808080] w-6 h-6" })
3701
3703
  }
3702
3704
  )
3703
3705
  ] }) }, wallet.id);
@@ -3724,7 +3726,7 @@ const WalletSelectModal = () => {
3724
3726
  disabled: isEvmConnector ? isPending : !wallet.enabled,
3725
3727
  className: "w-full cursor-pointer bg-transparent flex shadow-none items-center justify-between gap-3 px-5 py-3 hover:bg-muted h-auto rounded-md transition-[300] disabled:opacity-50 disabled:cursor-not-allowed",
3726
3728
  children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 min-w-0", children: [
3727
- /* @__PURE__ */ jsx("div", { className: "w-8 flex items-center justify-center", children: /* @__PURE__ */ jsx(IconComponent, { className: "size-8" }) }),
3729
+ /* @__PURE__ */ jsx("div", { className: "w-8 flex items-center justify-center", children: /* @__PURE__ */ jsx(IconComponent, { className: "w-8 h-8" }) }),
3728
3730
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-start min-w-0", children: [
3729
3731
  /* @__PURE__ */ jsx("p", { className: "font-extrabold text-foreground text-sm leading-4 truncate", children: wallet.name }),
3730
3732
  wallet.comingSoon ? /* @__PURE__ */ jsx("div", { className: "text-xs leading-3 font-semibold text-muted-foreground", children: t2("wallets.comingSoon") }) : /* @__PURE__ */ jsx("div", { className: "text-xs leading-3 font-semibold text-muted-foreground", children: t2("wallets.connect") })
@@ -5896,13 +5898,11 @@ async function getEvmBalances(publicClient, address, tokens, priorityToken) {
5896
5898
  }
5897
5899
  const nativeTokens = tokens.filter((t2) => isNativeAddress(t2.address));
5898
5900
  const erc20Tokens = tokens.filter(
5899
- (t2) => !isNativeAddress(t2.address) && isAddress(t2.address)
5901
+ (t2) => !isNativeAddress(t2.address) && isAddress(t2.address) && (!priorityToken || t2.address !== priorityToken.address)
5900
5902
  );
5901
5903
  if (priorityToken) {
5902
5904
  try {
5903
5905
  const isPriorityNative = isNativeAddress(priorityToken.address);
5904
- console.log(priorityToken);
5905
- console.log(isPriorityNative);
5906
5906
  if (isPriorityNative) {
5907
5907
  const ethBalance = await publicClient.getBalance({
5908
5908
  address
@@ -5928,20 +5928,22 @@ async function getEvmBalances(publicClient, address, tokens, priorityToken) {
5928
5928
  functionName: "balanceOf",
5929
5929
  args: [address]
5930
5930
  });
5931
- console.log(tokenBalance);
5932
5931
  const balance = parseFloat(
5933
5932
  formatUnits(tokenBalance, priorityToken.decimals)
5934
5933
  );
5935
- console.log(balance);
5936
5934
  if (balance > 0) {
5937
5935
  balances[priorityToken.symbol] = { balance, address };
5938
5936
  }
5939
5937
  }
5940
5938
  } catch (error) {
5941
- console.debug(
5942
- `Failed to get priority token balance for ${priorityToken.symbol}:`,
5943
- error
5944
- );
5939
+ const errorMessage = error instanceof Error ? error.message : String(error);
5940
+ const isZeroDataError = errorMessage.includes('returned no data ("0x")');
5941
+ if (!isZeroDataError) {
5942
+ console.debug(
5943
+ `Failed to get priority token balance for ${priorityToken.symbol}:`,
5944
+ error
5945
+ );
5946
+ }
5945
5947
  }
5946
5948
  }
5947
5949
  for (const token of nativeTokens) {