@thurinlabs/identity-kit 0.7.3 → 0.7.4

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.
@@ -39380,9 +39380,8 @@ ${prettyStateOverride(stateOverride)}`;
39380
39380
  const name = typeof n2.name === "string" ? n2.name : new TextDecoder().decode(n2.name);
39381
39381
  const value = n2.value instanceof Uint8Array ? new TextDecoder().decode(n2.value) : typeof n2.value === "string" ? n2.value : null;
39382
39382
  if (value) {
39383
- const dedupeKey = `${name}:${value}`;
39384
- if (!seen.has(dedupeKey)) {
39385
- seen.add(dedupeKey);
39383
+ if (!seen.has(value)) {
39384
+ seen.add(value);
39386
39385
  notations.push({ name, value });
39387
39386
  }
39388
39387
  }
@@ -39528,7 +39527,8 @@ ${prettyStateOverride(stateOverride)}`;
39528
39527
  enabled: !!attestations && attestations.length > 0,
39529
39528
  staleTime: 3e5
39530
39529
  });
39531
- const isLoading = countLoading || attestationsLoading || verifyLoading;
39530
+ const eventLogsPending = !!address && attestationCount > 0 && eventData === void 0;
39531
+ const isLoading = countLoading || attestationsLoading || verifyLoading || eventLogsPending;
39532
39532
  const activeClaims = (claims || []).filter((c2) => !c2.revoked);
39533
39533
  const verifiedClaims = activeClaims.filter((c2) => c2.verification?.verified);
39534
39534
  const currentFingerprint = verifiedClaims.length > 0 ? verifiedClaims[verifiedClaims.length - 1].fingerprint : null;
@@ -39620,9 +39620,8 @@ ${prettyStateOverride(stateOverride)}`;
39620
39620
  parse: (m2) => ({ instance: m2[1], user: m2[2] })
39621
39621
  }
39622
39622
  ];
39623
- var PROOF_NAMESPACES = /* @__PURE__ */ new Set(["proof@thurin.id", "proof@ariadne.id"]);
39624
39623
  function identifyProof(notation) {
39625
- if (!PROOF_NAMESPACES.has(notation.name)) return null;
39624
+ if (notation.name !== "proof@thurin.id") return null;
39626
39625
  for (const { provider, label, pattern, parse } of PROVIDERS) {
39627
39626
  const m2 = notation.value.match(pattern);
39628
39627
  if (m2) {
@@ -39798,7 +39797,7 @@ ${prettyStateOverride(stateOverride)}`;
39798
39797
  // src/hooks/usePGPProofs.ts
39799
39798
  function usePGPProofs(fingerprint) {
39800
39799
  const config = useIdentityKitConfig();
39801
- const { data, isLoading } = useQuery({
39800
+ const { data } = useQuery({
39802
39801
  queryKey: ["pgp-proofs", fingerprint],
39803
39802
  queryFn: async () => {
39804
39803
  if (!fingerprint) return { keyInfo: null, proofs: [] };
@@ -39806,7 +39805,7 @@ ${prettyStateOverride(stateOverride)}`;
39806
39805
  if (!armoredKey) return { keyInfo: null, proofs: [] };
39807
39806
  const keyInfo = await parsePgpKey(armoredKey);
39808
39807
  if (!keyInfo) return { keyInfo: null, proofs: [] };
39809
- const identified = keyInfo.notations.map((n2) => identifyProof(n2)).filter((p2) => p2 !== null);
39808
+ const identified = keyInfo.notations.map((n2) => identifyProof(n2)).filter((p2) => p2 !== null && p2.provider !== "unknown");
39810
39809
  const proofs = await Promise.all(
39811
39810
  identified.map(async (proof) => {
39812
39811
  const result = await verifyProof(proof, fingerprint, config.neynarApiKey);
@@ -39822,7 +39821,15 @@ ${prettyStateOverride(stateOverride)}`;
39822
39821
  };
39823
39822
  })
39824
39823
  );
39825
- return { keyInfo, proofs };
39824
+ const byAccount = /* @__PURE__ */ new Map();
39825
+ for (const p2 of proofs) {
39826
+ const key = `${p2.provider}:${p2.displayUrl}`;
39827
+ const prev = byAccount.get(key);
39828
+ if (!prev || p2.status === "verified" && prev.status !== "verified") {
39829
+ byAccount.set(key, p2);
39830
+ }
39831
+ }
39832
+ return { keyInfo, proofs: [...byAccount.values()] };
39826
39833
  },
39827
39834
  enabled: !!fingerprint,
39828
39835
  staleTime: 3e5
@@ -39830,7 +39837,11 @@ ${prettyStateOverride(stateOverride)}`;
39830
39837
  return {
39831
39838
  keyInfo: data?.keyInfo ?? null,
39832
39839
  proofs: data?.proofs ?? [],
39833
- isLoading
39840
+ // Report loading whenever a fingerprint is set but its proofs haven't
39841
+ // resolved yet. Using react-query's own isLoading leaves a gap while the
39842
+ // query is enabling (fingerprint just became known), during which the card
39843
+ // would briefly paint without proof badges and then pop them in.
39844
+ isLoading: !!fingerprint && data === void 0
39834
39845
  };
39835
39846
  }
39836
39847