@lumiapassport/ui-kit 1.14.6 → 1.14.8

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.
package/dist/index.js CHANGED
@@ -4526,7 +4526,7 @@ import { useEffect as useEffect31 } from "react";
4526
4526
  // package.json
4527
4527
  var package_default = {
4528
4528
  name: "@lumiapassport/ui-kit",
4529
- version: "1.14.6",
4529
+ version: "1.14.8",
4530
4530
  description: "React UI components and hooks for Lumia Passport authentication and Account Abstraction",
4531
4531
  type: "module",
4532
4532
  main: "./dist/index.cjs",
@@ -10317,7 +10317,7 @@ function mapBlockscoutToAsset(balance) {
10317
10317
  if (type === "erc721") {
10318
10318
  formattedBalance = "1";
10319
10319
  } else if (decimals !== void 0) {
10320
- formattedBalance = parseFloat(formatUnits(BigInt(value), decimals)).toFixed(4);
10320
+ formattedBalance = formatUnits(BigInt(value), decimals);
10321
10321
  } else {
10322
10322
  formattedBalance = value;
10323
10323
  }
@@ -10476,7 +10476,8 @@ function useBlockscoutAssets(options) {
10476
10476
  const registry = await publicClient2.readContract({
10477
10477
  address: tokenAddress,
10478
10478
  abi: ERC3643_ABI,
10479
- functionName: "identityRegistry"
10479
+ functionName: "identityRegistry",
10480
+ args: []
10480
10481
  });
10481
10482
  if (registry && registry !== "0x0000000000000000000000000000000000000000") {
10482
10483
  return { tokenAddress, registry };
@@ -10497,7 +10498,6 @@ function useBlockscoutAssets(options) {
10497
10498
  },
10498
10499
  enabled: !!address && enabled && detectSecurityTokens && erc20TokenAddresses.length > 0 && !!publicClient2,
10499
10500
  staleTime: BLOCKSCOUT_QUERY_STALE_TIME * 2,
10500
- // Less frequent refresh for contract calls
10501
10501
  gcTime: BLOCKSCOUT_QUERY_GC_TIME,
10502
10502
  retry: 1
10503
10503
  });
@@ -10621,6 +10621,7 @@ var ASSETS_RATES_QUERY_KEY = "lumia-passport-assets-rates-query-key";
10621
10621
  function PortfolioItem(props) {
10622
10622
  const { address, asset, isProjectAsset } = props;
10623
10623
  const [nftImageError, setNftImageError] = useState10(false);
10624
+ const [logoError, setLogoError] = useState10(false);
10624
10625
  const { assets: projectAssets, showBalanceAs: showBalanceAsSymbol } = useLumiaPassportConfig().config.current.projectAssets || {};
10625
10626
  const qc = useQueryClient15();
10626
10627
  const { balanceQueryKey } = projectAssets?.find((a) => a.symbol === showBalanceAsSymbol) || {};
@@ -10655,7 +10656,7 @@ function PortfolioItem(props) {
10655
10656
  "group-hover:opacity-60 transition-opacity",
10656
10657
  // NFTs get rounded corners, tokens get circular
10657
10658
  isNft ? "w-12 h-12 rounded-lg" : "w-10 h-10 rounded-full",
10658
- !asset.logo && !nftImage && "bg-[var(--l-pass-fg)]"
10659
+ (!asset.logo || logoError) && !nftImage && "bg-[var(--l-pass-fg)]"
10659
10660
  ),
10660
10661
  children: [
10661
10662
  isNft && nftImage && !nftImageError ? /* @__PURE__ */ jsx52(
@@ -10669,18 +10670,13 @@ function PortfolioItem(props) {
10669
10670
  ) : isNft && (!nftImage || nftImageError) ? (
10670
10671
  // NFT placeholder when no image available
10671
10672
  /* @__PURE__ */ jsx52("div", { className: "w-full h-full bg-[var(--l-pass-fg)] flex items-center justify-center", children: /* @__PURE__ */ jsx52(ImageIcon, { className: "w-5 h-5 text-[var(--l-pass-fg-inverted)]" }) })
10672
- ) : asset.logo ? /* @__PURE__ */ jsx52(
10673
+ ) : asset.logo && !logoError ? /* @__PURE__ */ jsx52(
10673
10674
  "img",
10674
10675
  {
10675
10676
  src: asset.logo,
10676
10677
  alt: asset.symbol,
10677
10678
  className: "w-full h-full object-cover",
10678
- onError: (e) => {
10679
- const target = e.target;
10680
- target.style.display = "none";
10681
- target.parentElement.classList.add("bg-[var(--l-pass-fg)]");
10682
- target.parentElement.innerHTML = `<span class="text-[var(--l-pass-fg-inverted)] font-bold text-sm">${asset.symbol.charAt(0)}</span>`;
10683
- }
10679
+ onError: () => setLogoError(true)
10684
10680
  }
10685
10681
  ) : /* @__PURE__ */ jsx52("span", { className: "text-[var(--l-pass-fg-inverted)] font-bold text-sm", children: asset.symbol.charAt(0) }),
10686
10682
  isNft && /* @__PURE__ */ jsx52("div", { className: "absolute -top-1 -right-1 w-4 h-4 rounded-full bg-[var(--l-pass-accent)] flex items-center justify-center", children: /* @__PURE__ */ jsx52(Sparkles, { className: "w-2.5 h-2.5 text-[var(--l-pass-fg-inverted)]" }) }),